2022-03-29 19:32:21 +02:00
|
|
|
CREATE TABLE user (
|
|
|
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
|
|
username TEXT UNIQUE NOT NULL,
|
|
|
|
email TEXT UNIQUE NOT NULL,
|
|
|
|
role TEXT NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE pwd (
|
2022-04-21 19:44:42 +02:00
|
|
|
user_id INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
password TEXT NOT NULL,
|
2022-05-14 15:46:05 +02:00
|
|
|
CONSTRAINT FK_UserId FOREIGN KEY (user_id) REFERENCES user(id) ON DELETE CASCADE
|
|
|
|
);
|
|
|
|
|
|
|
|
--Initialize default admin user, with password "gamenight!"
|
|
|
|
INSERT INTO user (id, username, role)
|
|
|
|
values(-1, 'admin', 'admin');
|
|
|
|
|
|
|
|
insert INTO pwd (id, pwd)
|
|
|
|
values(-1, '$argon2id$v=19$m=4096,t=3,p=1$zEdUjCAnZqd8DziYWzlFHw$YBLQhKvYIZBY43B8zM6hyBvLKuqTeh0EM5pKOfbWQSI');
|