From 9c9c106acd1ea730fb3877d49662fc14b456d0cb Mon Sep 17 00:00:00 2001 From: sudoer777 <78781902+sudoer777@users.noreply.github.com> Date: Wed, 24 Nov 2021 15:53:42 -0700 Subject: [PATCH] Database init script now creates accounts table --- database/init_database.sql | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/database/init_database.sql b/database/init_database.sql index ad4f0e7..ea8decf 100644 --- a/database/init_database.sql +++ b/database/init_database.sql @@ -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; \ No newline at end of file