diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2020-06-20 21:01:39 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2020-06-20 21:01:39 +0200 |
commit | f45959b53b8322a852554aa8dd7f8c9f4f99b5b4 (patch) | |
tree | 1eaf36c83be0da29a49dc6bd346957509d63fbdb | |
parent | b639c48017181a493095daa9a9dd030e3bf417f2 (diff) |
server: Add 'not null' to all non-null columns in schema
-rw-r--r-- | schema.sql | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -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); |