mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
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:
parent
3bff5fe7f8
commit
1a7b6a2c59
2 changed files with 27 additions and 0 deletions
13
packages/db/migrations/0105.do.remove_content_report_constraints.sql
Executable file
13
packages/db/migrations/0105.do.remove_content_report_constraints.sql
Executable 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;
|
||||
14
packages/db/migrations/0105.undo.remove_content_report_constraints.sql
Executable file
14
packages/db/migrations/0105.undo.remove_content_report_constraints.sql
Executable 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;
|
||||
Loading…
Reference in a new issue