aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);