Skip to content

Commit

Permalink
feat: add database table creation for favorite tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparkier committed Sep 28, 2023
1 parent 9e4eb92 commit 911a1e8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,16 @@ CREATE TABLE organization_report (
organization_id integer NOT NULL REFERENCES organizations(id) ON DELETE CASCADE ON UPDATE CASCADE,
report_id integer NOT NULL REFERENCES reports(id) ON DELETE CASCADE ON UPDATE CASCADE,
editor boolean NOT NULL DEFAULT false
);

CREATE TABLE report_like (
id integer GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
user_id integer NOT NULL REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE,
report_id integer NOT NULL REFERENCES reports(id) ON DELETE CASCADE ON UPDATE CASCADE
);

CREATE TABLE project_like (
id integer GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
user_id integer NOT NULL REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE,
project_uuid text NOT NULL REFERENCES projects(uuid) ON DELETE CASCADE ON UPDATE CASCADE
);

0 comments on commit 911a1e8

Please sign in to comment.