initial commit

This commit is contained in:
Jordan Knott
2020-04-09 21:40:22 -05:00
commit 9611105364
141 changed files with 29236 additions and 0 deletions

View 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
);

View 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
);

View 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
);

View 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
);

View 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
);

View 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
);

View 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
);

View File

@ -0,0 +1 @@
ALTER TABLE team ADD COLUMN organization_id uuid NOT NULL REFERENCES organization(organization_id);