diff options
Diffstat (limited to 'schema.sql')
-rw-r--r-- | schema.sql | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |