From f45959b53b8322a852554aa8dd7f8c9f4f99b5b4 Mon Sep 17 00:00:00 2001
From: Tom Smeding <tom.smeding@gmail.com>
Date: Sat, 20 Jun 2020 21:01:39 +0200
Subject: server: Add 'not null' to all non-null columns in schema

---
 schema.sql | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index 1592bdd..3efe0f1 100644
--- a/schema.sql
+++ b/schema.sql
@@ -5,28 +5,28 @@ create table Meta (
 );
 
 create table Rooms (
-	id integer primary key,
-	name text
+	id integer primary key not null,
+	name text not null
 );
 create unique index rooms_name_index on Rooms(name);
 
 create table Members (
-	room integer,
-	user integer,
+	room integer not null,
+	user integer not null,
 	primary key(room, user),
 	foreign key(room) references Rooms(id) on delete cascade,
 	foreign key(user) references Users(id) on delete cascade
 );
 
 create table Users (
-	id integer primary key,
-	name text,
-	pass text
+	id integer primary key not null,
+	name text not null,
+	pass text not null
 );
 create unique index users_name_index on Users(name);
 
 create table Messages (
-	id integer primary key,
+	id integer primary key not null,
 	room integer not null,
 	user integer null,
 	time integer not null,
@@ -37,8 +37,8 @@ create table Messages (
 create index messages_time_index on Messages(time);
 
 create table Firebase (
-	user integer,
-	token text,
+	user integer not null,
+	token text not null,
 	foreign key(user) references Users(id) on delete cascade
 );
 create index firebase_user_index on Firebase(user);
-- 
cgit v1.2.3-70-g09d2

