From d016b92863d3c109480ac04f688ca16a4a22ccf4 Mon Sep 17 00:00:00 2001 From: Sasha Date: Thu, 19 Sep 2024 02:56:29 +0200 Subject: [PATCH] chore: drop constrain from wakuRequestResponse --- lib/database/sql/000018_waku_req_res.up.sql | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/database/sql/000018_waku_req_res.up.sql b/lib/database/sql/000018_waku_req_res.up.sql index c83bbf8..c6fdd33 100644 --- a/lib/database/sql/000018_waku_req_res.up.sql +++ b/lib/database/sql/000018_waku_req_res.up.sql @@ -13,4 +13,16 @@ CREATE TABLE IF NOT EXISTS wakuRequestResponse ( extraData TEXT, CONSTRAINT messages_unique UNIQUE (peerId, messageHash) -); \ No newline at end of file +); + +DO $$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_constraint + WHERE conname = 'messages_unique' + ) THEN + ALTER TABLE wakuRequestResponse + DROP CONSTRAINT messages_unique; + END IF; +END $$;