Files
omnivore/packages/db/migrations/0107.do.grant_delete_permission_on_subscription.sql
Hongbo Wu d3f3a07f5e Fix typo
2023-01-18 14:44:12 +08:00

17 lines
470 B
PL/PgSQL
Executable File

-- Type: DO
-- Name: grant_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;