From 898876fbf846c1601601520a146b4cc68590cdd4 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 1 Jun 2026 22:40:38 +0200 Subject: [PATCH] step 3: Make UUID columns NOT NULL - Add migration 000008: Add NOT NULL constraints to UUID columns - This completes the dual-write phase Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- internal/db/migrations/000008_make_uuid_required.down.sql | 7 +++++++ internal/db/migrations/000008_make_uuid_required.up.sql | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 internal/db/migrations/000008_make_uuid_required.down.sql create mode 100644 internal/db/migrations/000008_make_uuid_required.up.sql diff --git a/internal/db/migrations/000008_make_uuid_required.down.sql b/internal/db/migrations/000008_make_uuid_required.down.sql new file mode 100644 index 0000000..91fa637 --- /dev/null +++ b/internal/db/migrations/000008_make_uuid_required.down.sql @@ -0,0 +1,7 @@ +-- Rollback: Make UUID columns nullable again + +-- Make UUID nullable on soundtrack +ALTER TABLE soundtrack ALTER COLUMN uuid DROP NOT NULL; + +-- Make UUID nullable on song +ALTER TABLE song ALTER COLUMN uuid DROP NOT NULL; diff --git a/internal/db/migrations/000008_make_uuid_required.up.sql b/internal/db/migrations/000008_make_uuid_required.up.sql new file mode 100644 index 0000000..cf60e09 --- /dev/null +++ b/internal/db/migrations/000008_make_uuid_required.up.sql @@ -0,0 +1,7 @@ +-- Migration: Make UUID columns NOT NULL + +-- Make UUID required on soundtrack +ALTER TABLE soundtrack ALTER COLUMN uuid SET NOT NULL; + +-- Make UUID required on song +ALTER TABLE song ALTER COLUMN uuid SET NOT NULL;