From 9dadb236c71204435801f75c7e499cf53a8aeb01 Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Thu, 2 Jul 2026 01:30:18 -0700 Subject: [PATCH 1/2] fix(migrations): grandfather the shipped 0090 duplicate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0090_contributor_cap_label.sql (#2479) and 0090_pull_request_detail_sync_head_sha.sql (#2527) both merged to main with the same migration number. Both are bare ADD COLUMN statements that are already applied in production, so renumbering either now would make wrangler try to re-apply it and error the deploy — the same non-idempotent-rename hazard already documented for the 0015/0017/0074 grandfathered pairs. Add 0090 to KNOWN_DUPLICATES so db:migrations:check passes again for every PR that touches src/**, which currently fails the required validate check on all of them regardless of whether they touch migrations/. --- scripts/check-migrations.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/check-migrations.mjs b/scripts/check-migrations.mjs index 8d5ca2a30d..63aabd2a81 100644 --- a/scripts/check-migrations.mjs +++ b/scripts/check-migrations.mjs @@ -17,6 +17,8 @@ // • 0074 — both 0074_ai_review_cache (#1462) and 0074_orb_self_enrollment_disabled (#1465, a bare ADD COLUMN) // merged + deployed before the collision surfaced; the column already exists in prod, so a rename would // re-run the ALTER and fail. Grandfathered for the same reason as 0015/0017. +// • 0090 — both 0090_contributor_cap_label (#2479) and 0090_pull_request_detail_sync_head_sha (#2527, a bare +// ADD COLUMN) merged + deployed before the collision surfaced. Grandfathered for the same reason as 0074. import { readdirSync, readFileSync } from "node:fs"; const DIR = process.env.CHECK_MIGRATIONS_DIR || "migrations"; @@ -25,6 +27,7 @@ const KNOWN_DUPLICATES = new Map([ [15, new Set(["0015_github_agent_command_feedback.sql", "0015_product_usage_events.sql"])], [17, new Set(["0017_agent_recommendation_outcomes.sql", "0017_product_usage_role_retention_rollups.sql"])], [74, new Set(["0074_ai_review_cache.sql", "0074_orb_self_enrollment_disabled.sql"])], + [90, new Set(["0090_contributor_cap_label.sql", "0090_pull_request_detail_sync_head_sha.sql"])], ]); const fail = (message) => { From 300524c6e425cf8067a56d50ff99336c9c7f97d7 Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Thu, 2 Jul 2026 01:30:53 -0700 Subject: [PATCH 2/2] test(migrations): update the grandfathered-duplicates count for 0090 --- test/unit/check-migrations-script.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/check-migrations-script.test.ts b/test/unit/check-migrations-script.test.ts index 1320c32f88..65bbb20066 100644 --- a/test/unit/check-migrations-script.test.ts +++ b/test/unit/check-migrations-script.test.ts @@ -31,7 +31,7 @@ describe("check-migrations script", () => { it("reports every grandfathered duplicate migration number in the success summary", () => { const output = execFileSync(process.execPath, ["scripts/check-migrations.mjs"], { encoding: "utf8" }); - expect(output).toContain("(3 grandfathered duplicates: 0015, 0017, 0074)"); + expect(output).toContain("(4 grandfathered duplicates: 0015, 0017, 0074, 0090)"); }); it("rejects a migration that creates a temporary object (the D1 remote authorizer blocks it)", () => {