Remove constraints on content display reports

We dont want to ever clear the content reports table, even if
a user is deleted the report is still valid, so remove the
constraints.
This commit is contained in:
Jackson Harper 2023-01-09 18:03:31 +08:00
parent 3bff5fe7f8
commit 1a7b6a2c59
2 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,13 @@
-- Type: DO
-- Name: remove_content_report_constraints
-- Description: Remove unneeded constraints from the content_report table
BEGIN;
ALTER TABLE omnivore.content_display_report
DROP CONSTRAINT content_display_report_page_id_fkey;
ALTER TABLE omnivore.content_display_report
DROP CONSTRAINT content_display_report_user_id_fkey;
COMMIT;

View file

@ -0,0 +1,14 @@
-- Type: UNDO
-- Name: remove_content_report_constraints
-- Description: Remove unneeded constraints from the content_report table
BEGIN;
ALTER TABLE omnivore.content_display_report
ADD CONSTRAINT content_display_report_user_id_fkey FOREIGN KEY (user_id) REFERENCES omnivore."user"(id);
ALTER TABLE omnivore.content_display_report
ADD CONSTRAINT content_display_report_page_id_fkey FOREIGN KEY (page_id) REFERENCES omnivore.pages(id);
COMMIT;