From 0f87c795e31c88695a3e9ac2fff91d2b73a45233 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sun, 20 Jun 2021 00:16:50 +0000 Subject: add subforum schema things --- apioforum/db.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apioforum/db.py b/apioforum/db.py index 910118d..ad6cd39 100644 --- a/apioforum/db.py +++ b/apioforum/db.py @@ -84,6 +84,17 @@ CREATE TABLE thread_tags ( ALTER TABLE users ADD COLUMN bio TEXT; ALTER TABLE users ADD COLUMN joined TIMESTAMP; """, +""" +CREATE TABLE forums ( + id INTEGER PRIMARY KEY, + name TEXT NOT NULL, + parent INTEGER REFERENCES forums(id), + description TEXT +); +INSERT INTO forums (name,parent,description) values ('root',null,'the default root forum'); +ALTER TABLE threads ADD COLUMN forum NOT NULL DEFAULT 1 REFERENCES forums(id); +""", + ] def init_db(): -- cgit v1.2.3