step 2: Add UUID columns with backfill and dual-write support

- Add migration 000007: Add UUID columns to soundtrack and song with backfill
- Update InsertSoundtrack and InsertSoundtrackWithExistingId to accept UUID
- Update AddSong to accept UUID
- Add dual-write: Go code now generates UUIDs for new records
- Add uuid and pgtype imports

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-06-01 22:40:21 +02:00
parent 9256b7fe4b
commit 0f552282f3
8 changed files with 69 additions and 30 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ DELETE FROM song;
DELETE FROM song WHERE soundtrack_id = $1;
-- name: AddSong :exec
INSERT INTO song(soundtrack_id, song_name, path, file_name, hash) VALUES ($1, $2, $3, $4, $5);
INSERT INTO song(uuid, soundtrack_id, song_name, path, file_name, hash) VALUES ($1, $2, $3, $4, $5, $6);
-- name: CheckSong :one
SELECT COUNT(*) FROM song WHERE soundtrack_id = $1 AND path = $2;