fix: add migration for missing ai_settings columns
The original migration only created the table with id/userId/apiKey. All provider keys, models, toggles, and feature flags were in the schema but never added to the database, causing every AI settings save to fail with a Prisma column-not-found error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
ALTER TABLE "ai_settings" ADD COLUMN IF NOT EXISTS "aiEnabled" BOOLEAN NOT NULL DEFAULT true;
|
||||
ALTER TABLE "ai_settings" ADD COLUMN IF NOT EXISTS "openAiKey" TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE "ai_settings" ADD COLUMN IF NOT EXISTS "openAiEnabled" BOOLEAN NOT NULL DEFAULT false;
|
||||
ALTER TABLE "ai_settings" ADD COLUMN IF NOT EXISTS "claudeAiKey" TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE "ai_settings" ADD COLUMN IF NOT EXISTS "claudeAiEnabled" BOOLEAN NOT NULL DEFAULT false;
|
||||
ALTER TABLE "ai_settings" ADD COLUMN IF NOT EXISTS "claudeAiModel" TEXT NOT NULL DEFAULT 'claude-haiku-4-5-20251001';
|
||||
ALTER TABLE "ai_settings" ADD COLUMN IF NOT EXISTS "openAiModel" TEXT NOT NULL DEFAULT 'gpt-5.2';
|
||||
ALTER TABLE "ai_settings" ADD COLUMN IF NOT EXISTS "googleAiModel" TEXT NOT NULL DEFAULT 'gemini-2.5-flash';
|
||||
ALTER TABLE "ai_settings" ADD COLUMN IF NOT EXISTS "dentalMgmtKey" TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE "ai_settings" ADD COLUMN IF NOT EXISTS "dentalMgmtEnabled" BOOLEAN NOT NULL DEFAULT false;
|
||||
ALTER TABLE "ai_settings" ADD COLUMN IF NOT EXISTS "afterHoursEnabled" BOOLEAN NOT NULL DEFAULT true;
|
||||
ALTER TABLE "ai_settings" ADD COLUMN IF NOT EXISTS "openPhoneReply" BOOLEAN NOT NULL DEFAULT false;
|
||||
Reference in New Issue
Block a user