Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/db/src/migrations/0070_powerful_whizzer.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "kilocode_users" ADD COLUMN "vercel_downstream_safety_identifier" text;--> statement-breakpoint
CREATE UNIQUE INDEX "UQ_kilocode_users_vercel_downstream_safety_identifier" ON "kilocode_users" USING btree ("vercel_downstream_safety_identifier") WHERE "kilocode_users"."vercel_downstream_safety_identifier" IS NOT NULL;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Unique index creation will lock writes on kilocode_users

kilocode_users is an existing populated table, and CREATE UNIQUE INDEX takes a write-blocking lock for the duration of the index build. Running this migration in production can stall inserts and updates against users until the index finishes. Use a concurrent index build strategy here instead of a plain CREATE UNIQUE INDEX.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it wasn't a problem last time 🤷

Loading
Loading