From b206f8e6b11876e9a95e56058a00f935346b7a5f Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Thu, 9 Mar 2023 14:53:06 +0800 Subject: [PATCH] Remove unique constraint of user_id and event_types on webhooks table --- .../migrations/0111.do.remove_unique_key_on_webhooks.sql | 9 +++++++++ .../0111.undo.remove_unique_key_on_webhooks.sql | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100755 packages/db/migrations/0111.do.remove_unique_key_on_webhooks.sql create mode 100755 packages/db/migrations/0111.undo.remove_unique_key_on_webhooks.sql diff --git a/packages/db/migrations/0111.do.remove_unique_key_on_webhooks.sql b/packages/db/migrations/0111.do.remove_unique_key_on_webhooks.sql new file mode 100755 index 000000000..6142b79fe --- /dev/null +++ b/packages/db/migrations/0111.do.remove_unique_key_on_webhooks.sql @@ -0,0 +1,9 @@ +-- Type: DO +-- Name: remove_unique_key_on_webhooks +-- Description: Remove unique constraint of user_id and event_types on webhooks table + +BEGIN; + +ALTER TABLE omnivore.webhooks DROP CONSTRAINT webhooks_user_id_event_types_key; + +COMMIT; diff --git a/packages/db/migrations/0111.undo.remove_unique_key_on_webhooks.sql b/packages/db/migrations/0111.undo.remove_unique_key_on_webhooks.sql new file mode 100755 index 000000000..8a0bd7c21 --- /dev/null +++ b/packages/db/migrations/0111.undo.remove_unique_key_on_webhooks.sql @@ -0,0 +1,9 @@ +-- Type: UNDO +-- Name: remove_unique_key_on_webhooks +-- Description: Remove unique constraint of user_id and event_types on webhooks table + +BEGIN; + +ALTER TABLE omnivore.webhooks ADD CONSTRAINT webhooks_user_id_event_types_key UNIQUE (user_id, event_types); + +COMMIT;