taskcafe/migrations/0051_add-notification-tables.up.sql
Jordan Knott 0caa803d27 feat: add notification UI
showPopup was also refactored to be better
2020-09-10 15:31:04 -05:00

16 lines
568 B
SQL

CREATE TABLE notification_object (
notification_object_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
entity_id uuid NOT NULL,
action_type int NOT NULL,
actor_id uuid NOT NULL,
entity_type int NOT NULL,
created_on timestamptz NOT NULL
);
CREATE TABLE notification (
notification_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
notification_object_id uuid REFERENCES notification_object(notification_object_id) ON DELETE CASCADE,
notifier_id uuid NOT NULL REFERENCES user_account(user_id) ON DELETE CASCADE,
read boolean NOT NULL DEFAULT false
);