mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Grant delete permission on subscriptions table
This commit is contained in:
parent
c91cbe2bce
commit
b3fafb0c75
2 changed files with 31 additions and 0 deletions
16
packages/db/migrations/0107.do.grant_delete_permission_on_subscription.sql
Executable file
16
packages/db/migrations/0107.do.grant_delete_permission_on_subscription.sql
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
-- Type: DO
|
||||
-- Name: add_delete_permission_to_subscription
|
||||
-- Description: Add delete permission to subscription table
|
||||
|
||||
BEGIN;
|
||||
|
||||
GRANT DELETE ON omnivore.subscriptions TO omnivore_user;
|
||||
|
||||
ALTER TABLE omnivore.subscriptions
|
||||
DROP CONSTRAINT subscriptions_newsletter_email_id_fkey,
|
||||
ADD CONSTRAINT subscriptions_newsletter_email_id_fkey
|
||||
FOREIGN KEY (newsletter_email_id)
|
||||
REFERENCES omnivore.newsletter_emails (id)
|
||||
ON DELETE CASCADE;
|
||||
|
||||
COMMIT;
|
||||
15
packages/db/migrations/0107.undo.grant_delete_permission_on_subscription.sql
Executable file
15
packages/db/migrations/0107.undo.grant_delete_permission_on_subscription.sql
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
-- Type: UNDO
|
||||
-- Name: add_delete_permission_to_subscription
|
||||
-- Description: Add delete permission to subscription table
|
||||
|
||||
BEGIN;
|
||||
|
||||
REVOKE DELETE ON omnivore.subscriptions FROM omnivore_user;
|
||||
|
||||
ALTER TABLE omnivore.subscriptions
|
||||
DROP CONSTRAINT subscriptions_newsletter_email_id_fkey,
|
||||
ADD CONSTRAINT subscriptions_newsletter_email_id_fkey
|
||||
FOREIGN KEY (newsletter_email_id)
|
||||
REFERENCES omnivore.newsletter_emails (id);
|
||||
|
||||
COMMIT;
|
||||
Loading…
Reference in a new issue