aboutsummaryrefslogtreecommitdiff
path: root/schema.sql
diff options
context:
space:
mode:
Diffstat (limited to 'schema.sql')
-rw-r--r--schema.sql6
1 files changed, 5 insertions, 1 deletions
diff --git a/schema.sql b/schema.sql
index 15d274c..5a1938c 100644
--- a/schema.sql
+++ b/schema.sql
@@ -1,3 +1,5 @@
+-- Database schema version 2
+
pragma foreign_keys = on;
create table Meta (
@@ -31,9 +33,11 @@ create table Messages (
room integer not null,
user integer null,
time integer not null,
+ reply integer null,
message blob,
foreign key(room) references Rooms(id) on delete cascade,
- foreign key(user) references Users(id) on delete set null
+ foreign key(user) references Users(id) on delete set null,
+ foreign key(reply) references Messages(id) on delete set null
);
create index messages_time_index on Messages(room, time desc);