Files
Momento/memento-note/prisma/migrations/20260426140000_ensure_agent_schedule_columns/migration.sql
sepehr 950f024aa9
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m3s
fix: add new migration to ensure agent schedule columns exist
Previous migration (20260426130000) may be recorded as failed in
_prisma_migrations after a db push conflict. This new migration with
a different timestamp will be seen as pending and applied with
idempotent SQL that handles both cases.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 11:51:43 +02:00

17 lines
508 B
SQL

-- Ensure agent schedule columns exist (idempotent)
-- Handles both: fresh DB (columns missing) and DB where columns were added by db push
DO $$ BEGIN
ALTER TABLE "Agent" ADD COLUMN "scheduledTime" TEXT DEFAULT '08:00';
EXCEPTION WHEN duplicate_column THEN NULL;
END $$;
DO $$ BEGIN
ALTER TABLE "Agent" ADD COLUMN "scheduledDay" INTEGER;
EXCEPTION WHEN duplicate_column THEN NULL;
END $$;
DO $$ BEGIN
ALTER TABLE "Agent" ADD COLUMN "timezone" TEXT;
EXCEPTION WHEN duplicate_column THEN NULL;
END $$;