From e04403c7f1b4f31d11da578a5c99bf11af894392 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Thu, 17 May 2018 19:40:14 +0100 Subject: [PATCH] Adds replyingTo field to post. --- setup_nimforum.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup_nimforum.nim b/setup_nimforum.nim index c233a55..6004d0c 100644 --- a/setup_nimforum.nim +++ b/setup_nimforum.nim @@ -105,9 +105,11 @@ proc initialiseDb(admin: tuple[username, password, email: string]) = thread integer not null, creation timestamp not null default (DATETIME('now')), isDeleted boolean not null default 0, + replyingTo integer, foreign key (thread) references thread(id), - foreign key (author) references person(id) + foreign key (author) references person(id), + foreign key (replyingTo) references post(id) );""", []) db.exec sql"create index PostByAuthorIdx on post(thread, author);"