Database init script now creates accounts table

main
sudoer777 2021-11-24 15:53:42 -07:00
parent 64026a791e
commit 9c9c106acd
1 changed files with 10 additions and 4 deletions

View File

@ -22,10 +22,7 @@ scores:
accounts:
users:
*user_id* | email | salt | password_hash | role | approved
sessions:
*session_id* | ~user_id~ | expiration_date
*user_id* | email | password | admin
*/
@ -102,4 +99,13 @@ CREATE TABLE IF NOT EXISTS scores.games(
);
CREATE SCHEMA IF NOT EXISTS accounts;
CREATE TABLE IF NOT EXISTS accounts.users(
user_id BIGINT GENERATED ALWAYS AS IDENTITY,
email TEXT UNIQUE NOT NULL,
password TEXT NOT NULL,
admin BOOLEAN NOT NULL DEFAULT FALSE
);
COMMIT;