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
24 changes: 24 additions & 0 deletions src/lib/db/migrationRunner/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,30 @@ export const RENAMED_MIGRATION_COMPATIBILITY = [
toVersion: "153",
toName: "radar_local_model_state",
},
{
fromVersion: "056",
fromName: "provider_default",
toVersion: "056",
toName: "mcp_accessibility_compression",
},
{
fromVersion: "073",
fromName: "discovery_results",
toVersion: "073",
toName: "per_model_token_limits",
},
{
fromVersion: "077",
fromName: "plugin_metrics",
toVersion: "077",
toName: "api_key_stream_default_mode",
},
{
fromVersion: "101",
fromName: "proxy_pool_rotation",
toVersion: "101",
toName: "api_key_usage_limits",
},
] as const;

export const LEGACY_VERSION_SLOT_MIGRATIONS = [
Expand Down
37 changes: 30 additions & 7 deletions tests/unit/db-migrationrunner-constants-split.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ describe("migrationRunner/constants — exact small-table snapshots", () => {
// ── large tables — count + shape + spot-checks (corruption guard) ─────────────

describe("migrationRunner/constants — large-table integrity", () => {
it("RENAMED_MIGRATION_COMPATIBILITY has 27 well-formed entries", () => {
assert.equal(RENAMED_MIGRATION_COMPATIBILITY.length, 27);
it("RENAMED_MIGRATION_COMPATIBILITY has 31 well-formed entries", () => {
assert.equal(RENAMED_MIGRATION_COMPATIBILITY.length, 31);
for (const e of RENAMED_MIGRATION_COMPATIBILITY) {
assert.equal(typeof e.fromVersion, "string");
assert.equal(typeof e.fromName, "string");
Expand Down Expand Up @@ -113,26 +113,49 @@ describe("migrationRunner/constants — large-table integrity", () => {
"144",
]
);
// 147 collided with 147_api_keys_model_access_mode — renumbered to 151 in #8228
assert.ok(devin.every((e) => e.toVersion === "151"));
assert.deepEqual(RENAMED_MIGRATION_COMPATIBILITY.at(-3), {
assert.deepEqual(RENAMED_MIGRATION_COMPATIBILITY.at(-7), {
fromVersion: "134",
fromName: "ccr_blocks",
toVersion: "139",
toName: "ccr_blocks",
});
assert.deepEqual(RENAMED_MIGRATION_COMPATIBILITY.at(-2), {
assert.deepEqual(RENAMED_MIGRATION_COMPATIBILITY.at(-6), {
fromVersion: "139",
fromName: "job_registry",
toVersion: "146",
toName: "job_registry",
});
assert.deepEqual(RENAMED_MIGRATION_COMPATIBILITY.at(-1), {
assert.deepEqual(RENAMED_MIGRATION_COMPATIBILITY.at(-5), {
fromVersion: "143",
fromName: "radar_local_model_state",
toVersion: "153",
toName: "radar_local_model_state",
});
// #12036: renamed migrations 056/073/077/101 appended as compatibility renames
assert.deepEqual(RENAMED_MIGRATION_COMPATIBILITY.at(-4), {
fromVersion: "056",
fromName: "provider_default",
toVersion: "056",
toName: "mcp_accessibility_compression",
});
assert.deepEqual(RENAMED_MIGRATION_COMPATIBILITY.at(-3), {
fromVersion: "073",
fromName: "discovery_results",
toVersion: "073",
toName: "per_model_token_limits",
});
assert.deepEqual(RENAMED_MIGRATION_COMPATIBILITY.at(-2), {
fromVersion: "077",
fromName: "plugin_metrics",
toVersion: "077",
toName: "api_key_stream_default_mode",
});
assert.deepEqual(RENAMED_MIGRATION_COMPATIBILITY.at(-1), {
fromVersion: "101",
fromName: "proxy_pool_rotation",
toVersion: "101",
toName: "api_key_usage_limits",
});
});

it("PHYSICAL_SCHEMA_SENTINELS has 15 well-formed entries incl. the newest 064", () => {
Expand Down
Loading