aboutsummaryrefslogtreecommitdiff
path: root/schema.sql
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-06-20 21:01:39 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-06-20 21:01:39 +0200
commitf45959b53b8322a852554aa8dd7f8c9f4f99b5b4 (patch)
tree1eaf36c83be0da29a49dc6bd346957509d63fbdb /schema.sql
parentb639c48017181a493095daa9a9dd030e3bf417f2 (diff)
server: Add 'not null' to all non-null columns in schema
Diffstat (limited to 'schema.sql')
-rw-r--r--schema.sql20
1 files changed, 10 insertions, 10 deletions
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);