init project, impl authorization
This commit is contained in:
9
backend/migrations/20220601131817_create_account.sql
Normal file
9
backend/migrations/20220601131817_create_account.sql
Normal file
@ -0,0 +1,9 @@
|
||||
-- Add migration script here
|
||||
CREATE TABLE account
|
||||
(
|
||||
id uuid primary key,
|
||||
username varchar(128) unique not null,
|
||||
password_hash bytea not null,
|
||||
password_salt varchar(32) not null,
|
||||
email text null
|
||||
);
|
||||
9
backend/migrations/20220604192644_auth_token.sql
Normal file
9
backend/migrations/20220604192644_auth_token.sql
Normal file
@ -0,0 +1,9 @@
|
||||
-- Add migration script here
|
||||
CREATE TABLE refresh_token
|
||||
(
|
||||
id uuid not null,
|
||||
user_id uuid not null,
|
||||
time_created timestamp not null,
|
||||
CONSTRAINT fk_user_id FOREIGN KEY (user_id) REFERENCES account (id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (id, user_id)
|
||||
);
|
||||
Reference in New Issue
Block a user