From b1bd8b1f824c683416a0b6017eb17ab140bc0562 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 6 Jan 2026 20:34:50 -0600 Subject: [PATCH] Hotfix v1.3.1: Add missing SystemSettings columns Fix production database schema mismatch where downloadSource and primaryFailureFallback columns were missing from SystemSettings table. Root cause: Migration gap between squashed init migration and production database setup timing. Fix: Idempotent migration adds both columns if they don't exist: - downloadSource TEXT NOT NULL DEFAULT 'soulseek' - primaryFailureFallback TEXT NOT NULL DEFAULT 'none' --- .../migration.sql | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 backend/prisma/migrations/20260107000000_add_download_source_columns/migration.sql diff --git a/backend/prisma/migrations/20260107000000_add_download_source_columns/migration.sql b/backend/prisma/migrations/20260107000000_add_download_source_columns/migration.sql new file mode 100644 index 0000000..0793c07 --- /dev/null +++ b/backend/prisma/migrations/20260107000000_add_download_source_columns/migration.sql @@ -0,0 +1,21 @@ +-- Add downloadSource column if it doesn't exist (idempotent) +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM information_schema.columns + WHERE table_name = 'SystemSettings' AND column_name = 'downloadSource' + ) THEN + ALTER TABLE "SystemSettings" ADD COLUMN "downloadSource" TEXT NOT NULL DEFAULT 'soulseek'; + END IF; +END $$; + +-- Add primaryFailureFallback column if it doesn't exist (idempotent) +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 FROM information_schema.columns + WHERE table_name = 'SystemSettings' AND column_name = 'primaryFailureFallback' + ) THEN + ALTER TABLE "SystemSettings" ADD COLUMN "primaryFailureFallback" TEXT NOT NULL DEFAULT 'none'; + END IF; +END $$;