Skip to content

Commit

Permalink
Add primary key constraint to presence confirmations table (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
boavenn authored Apr 5, 2024
1 parent 74ddfff commit e1c6d6f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DELETE FROM presence_confirmations
WHERE id NOT IN (
SELECT MIN(id)
FROM presence_confirmations
GROUP BY date, user_id
);

ALTER TABLE presence_confirmations
ADD CONSTRAINT pk_presence_confirmations PRIMARY KEY (date, user_id);

0 comments on commit e1c6d6f

Please sign in to comment.