Skip to main content

max / makenotwork

281 B · 6 lines History Blame Raw
1 -- Widen idempotency key unique constraint to include method and path.
2 -- Prevents cross-endpoint collision when the same key is reused.
3
4 ALTER TABLE idempotency_keys DROP CONSTRAINT idempotency_keys_pkey;
5 ALTER TABLE idempotency_keys ADD PRIMARY KEY (key, user_id, method, path);
6