Skip to content

Commit 0ce04b5

Browse files
WardormeurDanielBrierton
authored andcommitted
Add constraint to stop fast webhooks from creating 2 events with… (CoderDojo#169)
* Add constraint to stop very fast webhooks from creating 2 events with the same eb_id * Fix condition of error handling catchall bcause of lazyness
1 parent e5964cb commit 0ce04b5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
DO $$
2+
BEGIN
3+
BEGIN
4+
ALTER TABLE cd_events ADD UNIQUE (eventbrite_id);
5+
EXCEPTION
6+
WHEN OTHERS THEN RAISE NOTICE 'constraint eventbrite_id already exists in cd_events.';
7+
END;
8+
END;
9+
$$

0 commit comments

Comments
 (0)