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:
@@ -29,10 +29,10 @@ UPDATE soundtrack SET deleted=NULL WHERE id=$1;
|
||||
SELECT id FROM soundtrack WHERE soundtrack_name = $1;
|
||||
|
||||
-- name: InsertSoundtrack :one
|
||||
INSERT INTO soundtrack (soundtrack_name, path, hash, added) VALUES ($1, $2, $3, now()) returning id;
|
||||
INSERT INTO soundtrack (uuid, soundtrack_name, path, hash, added) VALUES ($1, $2, $3, $4, now()) returning id;
|
||||
|
||||
-- name: InsertSoundtrackWithExistingId :exec
|
||||
INSERT INTO soundtrack (id, soundtrack_name, path, hash, added) VALUES ($1, $2, $3, $4, now());
|
||||
INSERT INTO soundtrack (id, uuid, soundtrack_name, path, hash, added) VALUES ($1, $2, $3, $4, $5, now());
|
||||
|
||||
-- name: FindAllSoundtracks :many
|
||||
SELECT *
|
||||
|
||||
Reference in New Issue
Block a user