initial commit
This commit is contained in:
6
api/migrations/0001_add-refresh-token-table.up.sql
Normal file
6
api/migrations/0001_add-refresh-token-table.up.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE TABLE refresh_token (
|
||||
token_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
user_id uuid NOT NULL,
|
||||
created_at timestamptz NOT NULL,
|
||||
expires_at timestamptz NOT NULL
|
||||
);
|
8
api/migrations/0002_add-users-table.up.sql
Normal file
8
api/migrations/0002_add-users-table.up.sql
Normal file
@ -0,0 +1,8 @@
|
||||
CREATE TABLE user_account (
|
||||
user_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
created_at timestamptz NOT NULL,
|
||||
display_name text NOT NULL,
|
||||
email text NOT NULL UNIQUE,
|
||||
username text NOT NULL UNIQUE,
|
||||
password_hash text NOT NULL
|
||||
);
|
5
api/migrations/0003_add-team-table.up.sql
Normal file
5
api/migrations/0003_add-team-table.up.sql
Normal file
@ -0,0 +1,5 @@
|
||||
CREATE TABLE team (
|
||||
team_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
created_at timestamptz NOT NULL,
|
||||
name text NOT NULL
|
||||
);
|
6
api/migrations/0004_add-project-table.up.sql
Normal file
6
api/migrations/0004_add-project-table.up.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE TABLE project (
|
||||
project_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
team_id uuid NOT NULL REFERENCES team(team_id),
|
||||
created_at timestamptz NOT NULL,
|
||||
name text NOT NULL
|
||||
);
|
7
api/migrations/0005_add-task-group-table.up.sql
Normal file
7
api/migrations/0005_add-task-group-table.up.sql
Normal file
@ -0,0 +1,7 @@
|
||||
CREATE TABLE task_group (
|
||||
task_group_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
project_id uuid NOT NULL REFERENCES project(project_id),
|
||||
created_at timestamptz NOT NULL,
|
||||
name text NOT NULL,
|
||||
position float NOT NULL
|
||||
);
|
7
api/migrations/0006_add-task.up.sql
Normal file
7
api/migrations/0006_add-task.up.sql
Normal file
@ -0,0 +1,7 @@
|
||||
CREATE TABLE task (
|
||||
task_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
task_group_id uuid NOT NULL REFERENCES task_group(task_group_id),
|
||||
created_at timestamptz NOT NULL,
|
||||
name text NOT NULL,
|
||||
position float NOT NULL
|
||||
);
|
5
api/migrations/0007_add-organization-table.up.sql
Normal file
5
api/migrations/0007_add-organization-table.up.sql
Normal file
@ -0,0 +1,5 @@
|
||||
CREATE TABLE organization (
|
||||
organization_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
created_at timestamptz NOT NULL,
|
||||
name text NOT NULL
|
||||
);
|
1
api/migrations/0008_add-org-id-to-team-table.up.sql
Normal file
1
api/migrations/0008_add-org-id-to-team-table.up.sql
Normal file
@ -0,0 +1 @@
|
||||
ALTER TABLE team ADD COLUMN organization_id uuid NOT NULL REFERENCES organization(organization_id);
|
Reference in New Issue
Block a user