Skip to content
Closed
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
3 changes: 3 additions & 0 deletions scripts/check-migrations.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/check-migrations-script.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)", () => {
Expand Down
Loading