diff options
author | ubq323 <ubq323> | 2021-07-08 01:19:35 +0000 |
---|---|---|
committer | ubq323 <ubq323> | 2021-07-08 01:19:35 +0000 |
commit | e39b446e72c47d802c43bf40bdee8479f231b17d (patch) | |
tree | 7e1cfd106274c968075cb60ff1b447134b195c2a | |
parent | 13ef3cb6d3f25bcf4d3413b69cccc6f3117effd4 (diff) |
idkbureaucracy2
-rw-r--r-- | apioforum/db.py | 10 |
1 files changed, 9 insertions, 1 deletions
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(): |