feature: add checklist

This commit is contained in:
Jordan Knott
2020-06-18 18:12:15 -05:00
parent b6f0e8b6b2
commit 9d6c67f791
73 changed files with 4582 additions and 390 deletions

View File

@ -0,0 +1,6 @@
ALTER TABLE task_label DROP CONSTRAINT task_label_task_id_fkey;
ALTER TABLE task_label
ADD CONSTRAINT task_label_task_id_fkey
FOREIGN KEY (task_id)
REFERENCES task(task_id)
ON DELETE CASCADE;

View File

@ -0,0 +1,6 @@
ALTER TABLE task_assigned DROP CONSTRAINT task_assigned_task_id_fkey;
ALTER TABLE task_assigned
ADD CONSTRAINT task_assigned_task_id_fkey
FOREIGN KEY (task_id)
REFERENCES task(task_id)
ON DELETE CASCADE;

View File

@ -0,0 +1,6 @@
ALTER TABLE task DROP CONSTRAINT task_task_group_id_fkey;
ALTER TABLE task
ADD CONSTRAINT task_task_group_id_fkey
FOREIGN KEY (task_group_id)
REFERENCES task_group(task_group_id)
ON DELETE CASCADE;

View File

@ -0,0 +1 @@
ALTER TABLE task ADD COLUMN complete boolean NOT NULL DEFAULT FALSE;

View File

@ -0,0 +1,7 @@
CREATE TABLE task_checklist (
task_checklist_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
task_id uuid NOT NULL REFERENCES task(task_id) ON DELETE CASCADE,
created_at timestamptz NOT NULL,
name text NOT NULL,
position float NOT NULL
);

View File

@ -0,0 +1,9 @@
CREATE TABLE task_checklist_item (
task_checklist_item_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
task_checklist_id uuid NOT NULL REFERENCES task_checklist(task_checklist_id) ON DELETE CASCADE,
created_at timestamptz NOT NULL,
complete boolean NOT NULL DEFAULT false,
name text NOT NULL,
position float NOT NULL,
due_date timestamptz
);