mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 14:44:40 +02:00
* Switch to JSON/config.json based user groups, and user group membership
This commit is contained in:
parent
6f3137d522
commit
150bd5778a
4 changed files with 28 additions and 95 deletions
|
@ -53,20 +53,11 @@ function createUserTables() {
|
|||
');'
|
||||
);
|
||||
|
||||
dbs.user.run(
|
||||
'CREATE TABLE IF NOT EXISTS user_group (' +
|
||||
' group_id INTEGER PRIMARY KEY,' +
|
||||
' group_name VARCHAR NOT NULL,' +
|
||||
' UNIQUE(group_name)' +
|
||||
');'
|
||||
);
|
||||
|
||||
dbs.user.run(
|
||||
'CREATE TABLE IF NOT EXISTS user_group_member (' +
|
||||
' group_id INTEGER NOT NULL,' +
|
||||
' group_name VARCHAR NOT NULL,' +
|
||||
' user_id INTEGER NOT NULL,' +
|
||||
' UNIQUE(group_id, user_id),' +
|
||||
' FOREIGN KEY(group_id) REFERENCES user_group(group_id) ON DELETE CASCADE' +
|
||||
' UNIQUE(group_name, user_id)' +
|
||||
');'
|
||||
);
|
||||
|
||||
|
@ -151,13 +142,4 @@ function createInitialMessageValues() {
|
|||
}
|
||||
|
||||
function createInitialUserValues() {
|
||||
dbs.user.run(
|
||||
'INSERT OR IGNORE INTO user_group ' +
|
||||
'VALUES(1, "users");'
|
||||
);
|
||||
|
||||
dbs.user.run(
|
||||
'INSERT OR IGNORE INTO user_group ' +
|
||||
'VALUES(2, "sysops");'
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue