From e39b446e72c47d802c43bf40bdee8479f231b17d Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 8 Jul 2021 01:19:35 +0000 Subject: idk --- apioforum/db.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apioforum/db.py b/apioforum/db.py index 10b2c24..bb31084 100644 --- a/apioforum/db.py +++ b/apioforum/db.py @@ -142,7 +142,15 @@ CREATE TRIGGER default_roles AFTER INSERT ON forums BEGIN INSERT INTO roles (role,forum) VALUES ('approved',new.id); INSERT INTO roles (role,forum) VALUES ('other',new.id); END; -""", +""", +""" +CREATE TABLE user_roles ( + user TEXT NOT NULL REFERENCES users(username), + forum INTEGER NOT NULL REFERENCS forums(id), + role_name TEXT NOT NULL, + FOREIGN KEY (forum,role_name) REFERENCES roles(forum,name) +); +""", ] def init_db(): -- cgit v1.2.3