diff options
Diffstat (limited to 'schema.sql')
-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); |