Skip to content

Commit 1eecc59

Browse files
committed
fix(db): bound the chat lock in 0409 with a statement timeout
1 parent b627f34 commit 1eecc59

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎packages/db/migrations/0409_drop_retired_storage.sql‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ SET lock_timeout = '100ms';--> statement-breakpoint
1212
-- The lock spans the backfill and SET NOT NULL so a fork copying a legacy null row cannot land between them.
1313
BEGIN;--> statement-breakpoint
1414
SET LOCAL lock_timeout = '100ms';--> statement-breakpoint
15+
SET LOCAL statement_timeout = '5s';--> statement-breakpoint
1516
LOCK TABLE "chat" IN ACCESS EXCLUSIVE MODE NOWAIT;--> statement-breakpoint
1617
ALTER TABLE "chat" ALTER COLUMN "include_tool_calls" SET DEFAULT false;--> statement-breakpoint
1718
UPDATE "chat" SET "include_tool_calls" = false WHERE "include_tool_calls" IS NULL;--> statement-breakpoint

0 commit comments

Comments
 (0)