Skip to content

Commit

Permalink
Merge pull request #1198 from egovernments/ashish-egov-patch-1
Browse files Browse the repository at this point in the history
Update V20240731162600__add_uniqiue_constraint_process_track.sql
  • Loading branch information
ashish-egov authored Jul 31, 2024
2 parents 6668394 + 68ace0d commit 2128542
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
-- Step 1: Remove duplicate rows
DELETE FROM eg_cm_campaign_process a
USING health.eg_cm_campaign_process b
WHERE a.id < b.id
AND a.campaignId = b.campaignId
AND a.type = b.type;

-- Step 2: Add the unique constraint
ALTER TABLE eg_cm_campaign_process
ADD CONSTRAINT uq_campaignId_type UNIQUE (campaignId, type);
ADD CONSTRAINT uq_campaignId_type UNIQUE (campaignId, type);

0 comments on commit 2128542

Please sign in to comment.