Skip to content

Commit 50693b3

Browse files
committed
DB migration 000035: Add explainatory comment
1 parent 51b45d7 commit 50693b3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

resources/migrations/000035_add_song_requests_indices.up.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
BEGIN;
22

3+
-- This index also acts as a unique constraint to ensure that only one
4+
-- CURRENTLY_PLAYING and one UP_NEXT request are present per session
35
CREATE UNIQUE INDEX song_requests_status_index
46
ON song_requests (session_id, status)
57
WHERE status in ('CURRENTLY_PLAYING', 'UP_NEXT');

0 commit comments

Comments
 (0)