* Switch to JSON/config.json based user groups, and user group membership

This commit is contained in:
Bryan Ashby 2015-08-20 22:29:16 -06:00
parent 6f3137d522
commit 150bd5778a
4 changed files with 28 additions and 95 deletions

View file

@ -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");'
);
}