From 909ada35ccb617344d244d4e76c9ce85fd2b922b Mon Sep 17 00:00:00 2001
From: Tom Smeding <tom.smeding@gmail.com>
Date: Mon, 27 Jul 2020 20:24:44 +0200
Subject: server: Migrate database to version 2

---
 schema.sql | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'schema.sql')

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);
 
-- 
cgit v1.2.3-54-g00ecf

