taskcafe/migrations/0070_add-task_due_date_notification.up.sql
2021-11-05 22:35:57 -05:00

16 lines
613 B
SQL

CREATE TABLE task_due_date_reminder_duration (
code text PRIMARY KEY
);
INSERT INTO task_due_date_reminder_duration VALUES ('MINUTE');
INSERT INTO task_due_date_reminder_duration VALUES ('HOUR');
INSERT INTO task_due_date_reminder_duration VALUES ('DAY');
INSERT INTO task_due_date_reminder_duration VALUES ('WEEK');
CREATE TABLE task_due_date_reminder (
due_date_reminder_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
task_id uuid NOT NULL REFERENCES task(task_id) ON DELETE CASCADE,
period int NOT NULL,
duration text NOT NULL REFERENCES task_due_date_reminder_duration(code) ON DELETE CASCADE
);