Skip to content

Commit 276e761

Browse files
committed
Merge branch 'main' of github.com:massbit/mida-sync
2 parents 2e4d7dd + e0ca047 commit 276e761

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
-- Prevent duplicate alert_reports rows when concurrent scheduler ticks
2+
-- or manual route invocations race on the same report_number.
3+
-- Apply manually on production after deduping existing rows, e.g.:
4+
--
5+
-- DELETE FROM alert_reports a
6+
-- USING alert_reports b
7+
-- WHERE a.id < b.id
8+
-- AND a.report_number = b.report_number;
9+
--
10+
ALTER TABLE alert_reports
11+
ADD CONSTRAINT alert_reports_report_number_key UNIQUE (report_number);

0 commit comments

Comments
 (0)