fix(migrations): resolve VCS migration prefix collision (213-215) and unblock deploy (MUL-3772) (#5883)

Renumber the six VCS migrations off the 213/214/215 prefix collisions to a unique contiguous tail 216-221 (tables before indexes), and make 214_chat_session_project idempotent (ADD COLUMN IF NOT EXISTS) so the #5868 rename-induced re-run no-ops instead of crashing. Fixes the red migration lint on main and unblocks the dev deploy.
This commit is contained in:
Bohan Jiang
2026-07-24 15:28:43 +08:00
committed by GitHub
parent 2aafa41a5f
commit 3f2e1c68d7
13 changed files with 8 additions and 2 deletions

View File

@@ -4,5 +4,11 @@
-- Create/delete handlers serialize on the project row, project deletion clears
-- existing references, and daemon claim revalidates workspace ownership before
-- injecting any context.
--
-- IF NOT EXISTS because this migration was first shipped as 213_chat_session_project
-- and later renumbered to 214 (#5868, dodging a prefix collision). Environments
-- that already applied it under the old 213 name have the column but not the 214
-- version row, so the runner re-applies it under the new name; without the guard
-- that re-run fails with "column already exists" (SQLSTATE 42701) and blocks deploy.
ALTER TABLE chat_session
ADD COLUMN project_id UUID;
ADD COLUMN IF NOT EXISTS project_id UUID;

View File

@@ -17,7 +17,7 @@
-- rows below in a single atomic statement). The inline UNIQUE / PRIMARY KEY
-- constraints stay — they back the ON CONFLICT upsert targets in vcs.sql.
-- Secondary indexes live in follow-up single-statement CREATE INDEX
-- CONCURRENTLY migrations (214-218), which cannot share a file with these
-- CONCURRENTLY migrations (217-221), which cannot share a file with these
-- CREATE TABLEs.
CREATE TABLE IF NOT EXISTS vcs_connection (