Authorization working
This commit is contained in:
4
db/1.0.0/1. schema.sql
Normal file
4
db/1.0.0/1. schema.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
CREATE USER raid_builder WITH PASSWORD 'raid_builder';
|
||||
|
||||
CREATE SCHEMA raid_builder;
|
||||
GRANT ALL ON SCHEMA raid_builder TO raid_builder;
|
||||
16
db/1.0.0/2. createAccount.sql
Normal file
16
db/1.0.0/2. createAccount.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
CREATE TYPE raid_builder.account_status AS ENUM ( 'ACTIVE', 'LOCKED', 'INACTIVE', 'DELETED', 'UNCONFIRMED');
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS raid_builder.account(
|
||||
account_id uuid PRIMARY KEY,
|
||||
username text UNIQUE NOT NULL,
|
||||
password text NOT NULL,
|
||||
login_date timestamptz,
|
||||
email text UNIQUE NOT NULL,
|
||||
force_reset boolean NOT NULL,
|
||||
refresh_token uuid UNIQUE,
|
||||
refresh_token_expiration timestamptz,
|
||||
account_status raid_builder.account_status NOT NULL
|
||||
);
|
||||
|
||||
GRANT ALL ON TABLE raid_builder.account TO raid_builder;
|
||||
10
db/1.0.0/3. createAccountPermission.sql
Normal file
10
db/1.0.0/3. createAccountPermission.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
CREATE TYPE raid_builder.account_permission_type AS ENUM ( 'ADMIN', 'USER' );
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS raid_builder.account_permission(
|
||||
account_permission_id uuid PRIMARY KEY,
|
||||
account_id uuid REFERENCES raid_builder.account(account_id) NOT NULL,
|
||||
account_permission_type raid_builder.account_permission_type NOT NULL
|
||||
);
|
||||
|
||||
GRANT ALL ON TABLE raid_builder.account_permission TO raid_builder;
|
||||
14
db/1.0.0/4. createAccountTutorialStatus.sql
Normal file
14
db/1.0.0/4. createAccountTutorialStatus.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
CREATE TYPE raid_builder.tutorial_status AS ENUM ( 'COMPLETED', 'NOT_COMPLETED' );
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS raid_builder.account_tutorial_status (
|
||||
account_tutorial_status_id uuid PRIMARY KEY,
|
||||
account_id uuid REFERENCES raid_builder.account(account_id),
|
||||
games_tutorial_status raid_builder.tutorial_status NOT NULL,
|
||||
game_tutorial_status raid_builder.tutorial_status NOT NULL,
|
||||
raid_groups_tutorial_status raid_builder.tutorial_status NOT NULL,
|
||||
raid_group_tutorial_status raid_builder.tutorial_status NOT NULL,
|
||||
instance_tutorial_status raid_builder.tutorial_status NOT NULL
|
||||
);
|
||||
|
||||
GRANT ALL ON TABLE raid_builder.account_tutorial_status TO raid_builder;
|
||||
Reference in New Issue
Block a user