From 902cc484a2f46107ab3cbda42d3b4be02d4769df Mon Sep 17 00:00:00 2001 From: bkellam Date: Fri, 28 Nov 2025 22:48:55 -0800 Subject: [PATCH] s --- .../migration.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/db/prisma/migrations/20251129063148_change_chat_created_by_to_optional/migration.sql b/packages/db/prisma/migrations/20251129063148_change_chat_created_by_to_optional/migration.sql index 5ac3e45d..d0fd2ba0 100644 --- a/packages/db/prisma/migrations/20251129063148_change_chat_created_by_to_optional/migration.sql +++ b/packages/db/prisma/migrations/20251129063148_change_chat_created_by_to_optional/migration.sql @@ -1,5 +1,5 @@ --- AlterTable +-- First, remove the NOT NULL constraint on the createdById column. ALTER TABLE "Chat" ALTER COLUMN "createdById" DROP NOT NULL; --- Set all chats created by the guest user (id: 1) to have a NULL createdById. +-- Then, set all chats created by the guest user (id: 1) to have a NULL createdById. UPDATE "Chat" SET "createdById" = NULL WHERE "createdById" = '1';