chore(server): renumber v2 migrations 038-046 to 041-049 after main's 038-040
Main released ProjectionThreadsPinOrderKey (038), ProjectionProjectsDefaultThreadEnvMode (039) and ProjectionProjectFaviconPath (040), so the branch-private v2 stack shifts up by three. Registry ids were already 41-49; this renames the files and identifiers to match and updates the ledger expectations and through-id boundaries in the migration tests (released boundary 37 -> 40). Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
f096e0717b
commit
f3d2958518
14 files changed
+54
-51
No files matched your search
@@ -53,15 +53,15 @@ import Migration0037 from "./Migrations/037_ProjectionTurnsKeysetIndex.ts";
|
||||
import Migration0038 from "./Migrations/038_ProjectionThreadsPinOrderKey.ts";
|
||||
import Migration0039 from "./Migrations/039_ProjectionProjectsDefaultThreadEnvMode.ts";
|
||||
import Migration0040 from "./Migrations/040_ProjectionProjectFaviconPath.ts";
|
||||
import Migration038V2 from "./Migrations/038_OrchestrationV2.ts";
|
||||
import Migration039V2 from "./Migrations/039_OrchestrationV2Subagents.ts";
|
||||
import Migration040V2 from "./Migrations/040_OrchestrationV2Foundation.ts";
|
||||
import Migration041V2 from "./Migrations/041_OrchestrationV2ProviderSessionBindings.ts";
|
||||
import Migration042V2 from "./Migrations/042_OrchestrationV2ThreadLaunchWorkflows.ts";
|
||||
import Migration043V2 from "./Migrations/043_ApplicationEventSource.ts";
|
||||
import Migration044V2 from "./Migrations/044_OrchestrationV2EffectCancellation.ts";
|
||||
import Migration045V2 from "./Migrations/045_ScheduledTasks.ts";
|
||||
import Migration046V2 from "./Migrations/046_LegacyV1ImportState.ts";
|
||||
import Migration0041 from "./Migrations/041_OrchestrationV2.ts";
|
||||
import Migration0042 from "./Migrations/042_OrchestrationV2Subagents.ts";
|
||||
import Migration0043 from "./Migrations/043_OrchestrationV2Foundation.ts";
|
||||
import Migration0044 from "./Migrations/044_OrchestrationV2ProviderSessionBindings.ts";
|
||||
import Migration0045 from "./Migrations/045_OrchestrationV2ThreadLaunchWorkflows.ts";
|
||||
import Migration0046 from "./Migrations/046_ApplicationEventSource.ts";
|
||||
import Migration0047 from "./Migrations/047_OrchestrationV2EffectCancellation.ts";
|
||||
import Migration0048 from "./Migrations/048_ScheduledTasks.ts";
|
||||
import Migration0049 from "./Migrations/049_LegacyV1ImportState.ts";
|
||||
|
||||
/**
|
||||
* Migration loader with all migrations defined inline.
|
||||
@@ -114,15 +114,15 @@ export const migrationEntries = [
|
||||
[38, "ProjectionThreadsPinOrderKey", Migration0038],
|
||||
[39, "ProjectionProjectsDefaultThreadEnvMode", Migration0039],
|
||||
[40, "ProjectionProjectFaviconPath", Migration0040],
|
||||
[41, "OrchestrationV2", Migration038V2],
|
||||
[42, "OrchestrationV2Subagents", Migration039V2],
|
||||
[43, "OrchestrationV2Foundation", Migration040V2],
|
||||
[44, "OrchestrationV2ProviderSessionBindings", Migration041V2],
|
||||
[45, "OrchestrationV2ThreadLaunchWorkflows", Migration042V2],
|
||||
[46, "ApplicationEventSource", Migration043V2],
|
||||
[47, "OrchestrationV2EffectCancellation", Migration044V2],
|
||||
[48, "ScheduledTasks", Migration045V2],
|
||||
[49, "LegacyV1ImportState", Migration046V2],
|
||||
[41, "OrchestrationV2", Migration0041],
|
||||
[42, "OrchestrationV2Subagents", Migration0042],
|
||||
[43, "OrchestrationV2Foundation", Migration0043],
|
||||
[44, "OrchestrationV2ProviderSessionBindings", Migration0044],
|
||||
[45, "OrchestrationV2ThreadLaunchWorkflows", Migration0045],
|
||||
[46, "ApplicationEventSource", Migration0046],
|
||||
[47, "OrchestrationV2EffectCancellation", Migration0047],
|
||||
[48, "ScheduledTasks", Migration0048],
|
||||
[49, "LegacyV1ImportState", Migration0049],
|
||||
] as const;
|
||||
|
||||
export const migrationManifest = migrationEntries.map(([id, name]) => [id, name] as const);
|
||||
|
||||
+30
-27
@@ -13,7 +13,7 @@ layer("038_039_OrchestrationV2", (it) => {
|
||||
Effect.sync(() => {
|
||||
assert.deepStrictEqual(
|
||||
migrationEntries.map(([id]) => id),
|
||||
Array.from({ length: 46 }, (_, index) => index + 1),
|
||||
Array.from({ length: 49 }, (_, index) => index + 1),
|
||||
);
|
||||
}),
|
||||
);
|
||||
@@ -22,7 +22,7 @@ layer("038_039_OrchestrationV2", (it) => {
|
||||
Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 39 });
|
||||
yield* runMigrations({ toMigrationInclusive: 42 });
|
||||
|
||||
const migrations = yield* sql<{
|
||||
readonly migration_id: number;
|
||||
@@ -30,24 +30,24 @@ layer("038_039_OrchestrationV2", (it) => {
|
||||
}>`
|
||||
SELECT migration_id, name
|
||||
FROM effect_sql_migrations
|
||||
WHERE migration_id IN (36, 37, 38, 39)
|
||||
WHERE migration_id IN (39, 40, 41, 42)
|
||||
ORDER BY migration_id
|
||||
`;
|
||||
assert.deepStrictEqual(migrations, [
|
||||
{
|
||||
migration_id: 36,
|
||||
name: "ProjectionThreadsPinned",
|
||||
migration_id: 39,
|
||||
name: "ProjectionProjectsDefaultThreadEnvMode",
|
||||
},
|
||||
{
|
||||
migration_id: 37,
|
||||
name: "ProjectionTurnsKeysetIndex",
|
||||
migration_id: 40,
|
||||
name: "ProjectionProjectFaviconPath",
|
||||
},
|
||||
{
|
||||
migration_id: 38,
|
||||
migration_id: 41,
|
||||
name: "OrchestrationV2",
|
||||
},
|
||||
{
|
||||
migration_id: 39,
|
||||
migration_id: 42,
|
||||
name: "OrchestrationV2Subagents",
|
||||
},
|
||||
]);
|
||||
@@ -64,10 +64,10 @@ layer("038_039_OrchestrationV2", (it) => {
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("backfills provider-session thread bindings in migration 038", () =>
|
||||
it.effect("backfills provider-session thread bindings in migration 041", () =>
|
||||
Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
yield* runMigrations({ toMigrationInclusive: 40 });
|
||||
yield* runMigrations({ toMigrationInclusive: 43 });
|
||||
yield* sql`
|
||||
INSERT INTO orchestration_v2_projection_provider_sessions (
|
||||
provider_session_id,
|
||||
@@ -92,7 +92,7 @@ layer("038_039_OrchestrationV2", (it) => {
|
||||
)
|
||||
`;
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 41 });
|
||||
yield* runMigrations({ toMigrationInclusive: 44 });
|
||||
|
||||
const bindings = yield* sql<{
|
||||
readonly provider_session_id: string;
|
||||
@@ -113,7 +113,7 @@ layer("038_039_OrchestrationV2", (it) => {
|
||||
it.effect("preserves turn items with colliding ordinals in migration 037", () =>
|
||||
Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
yield* runMigrations({ toMigrationInclusive: 39 });
|
||||
yield* runMigrations({ toMigrationInclusive: 42 });
|
||||
yield* sql`
|
||||
INSERT INTO orchestration_v2_projection_runs (
|
||||
run_id,
|
||||
@@ -150,7 +150,7 @@ layer("038_039_OrchestrationV2", (it) => {
|
||||
('turn-item:d', 'thread:two', NULL, 42, 'assistant_message', 'completed', '2026-01-01T00:00:00.000Z', '{}')
|
||||
`;
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 40 });
|
||||
yield* runMigrations({ toMigrationInclusive: 43 });
|
||||
|
||||
const positions = yield* sql<{
|
||||
readonly thread_id: string;
|
||||
@@ -171,18 +171,18 @@ layer("038_039_OrchestrationV2", (it) => {
|
||||
);
|
||||
});
|
||||
|
||||
it.effect("upgrades a database already at released main migration 037", () =>
|
||||
it.effect("upgrades a database already at released main migration 040", () =>
|
||||
Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 37 });
|
||||
yield* runMigrations({ toMigrationInclusive: 40 });
|
||||
const snoozeColumns = yield* sql<{ readonly name: string }>`
|
||||
PRAGMA table_info(projection_threads)
|
||||
`;
|
||||
assert.ok(snoozeColumns.some((column) => column.name === "snoozed_until"));
|
||||
assert.ok(snoozeColumns.some((column) => column.name === "snoozed_at"));
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 46 });
|
||||
yield* runMigrations({ toMigrationInclusive: 49 });
|
||||
|
||||
const migrations = yield* sql<{
|
||||
readonly migration_id: number;
|
||||
@@ -190,7 +190,7 @@ it.effect("upgrades a database already at released main migration 037", () =>
|
||||
}>`
|
||||
SELECT migration_id, name
|
||||
FROM effect_sql_migrations
|
||||
WHERE migration_id BETWEEN 36 AND 46
|
||||
WHERE migration_id BETWEEN 36 AND 49
|
||||
ORDER BY migration_id
|
||||
`;
|
||||
assert.deepStrictEqual(
|
||||
@@ -198,15 +198,18 @@ it.effect("upgrades a database already at released main migration 037", () =>
|
||||
[
|
||||
[36, "ProjectionThreadsPinned"],
|
||||
[37, "ProjectionTurnsKeysetIndex"],
|
||||
[38, "OrchestrationV2"],
|
||||
[39, "OrchestrationV2Subagents"],
|
||||
[40, "OrchestrationV2Foundation"],
|
||||
[41, "OrchestrationV2ProviderSessionBindings"],
|
||||
[42, "OrchestrationV2ThreadLaunchWorkflows"],
|
||||
[43, "ApplicationEventSource"],
|
||||
[44, "OrchestrationV2EffectCancellation"],
|
||||
[45, "ScheduledTasks"],
|
||||
[46, "LegacyV1ImportState"],
|
||||
[38, "ProjectionThreadsPinOrderKey"],
|
||||
[39, "ProjectionProjectsDefaultThreadEnvMode"],
|
||||
[40, "ProjectionProjectFaviconPath"],
|
||||
[41, "OrchestrationV2"],
|
||||
[42, "OrchestrationV2Subagents"],
|
||||
[43, "OrchestrationV2Foundation"],
|
||||
[44, "OrchestrationV2ProviderSessionBindings"],
|
||||
[45, "OrchestrationV2ThreadLaunchWorkflows"],
|
||||
[46, "ApplicationEventSource"],
|
||||
[47, "OrchestrationV2EffectCancellation"],
|
||||
[48, "ScheduledTasks"],
|
||||
[49, "LegacyV1ImportState"],
|
||||
],
|
||||
);
|
||||
|
||||
File renamed without changes.
File renamed without changes.
+2
-2
@@ -8,7 +8,7 @@ import * as NodeSqliteClient from "../NodeSqliteClient.ts";
|
||||
it.effect("backfills the V2 event driver from payload before the legacy provider column", () =>
|
||||
Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
yield* runMigrations({ toMigrationInclusive: 39 });
|
||||
yield* runMigrations({ toMigrationInclusive: 42 });
|
||||
|
||||
yield* sql`
|
||||
INSERT INTO orchestration_v2_events (
|
||||
@@ -37,7 +37,7 @@ it.effect("backfills the V2 event driver from payload before the legacy provider
|
||||
)
|
||||
`;
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 40 });
|
||||
yield* runMigrations({ toMigrationInclusive: 43 });
|
||||
|
||||
const events = yield* sql<{
|
||||
readonly event_id: string;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
-2
@@ -12,7 +12,7 @@ layer("043_ApplicationEventSource", (it) => {
|
||||
it.effect("moves V2 events and current project state behind one global sequence", () =>
|
||||
Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
yield* runMigrations({ toMigrationInclusive: 42 });
|
||||
yield* runMigrations({ toMigrationInclusive: 45 });
|
||||
|
||||
yield* sql`
|
||||
INSERT INTO orchestration_v2_events (
|
||||
@@ -84,7 +84,7 @@ layer("043_ApplicationEventSource", (it) => {
|
||||
)
|
||||
`;
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 43 });
|
||||
yield* runMigrations({ toMigrationInclusive: 46 });
|
||||
|
||||
const events = yield* sql<{
|
||||
readonly sequence: number;
|
||||
File renamed without changes.
+2
-2
@@ -12,7 +12,7 @@ layer("044_OrchestrationV2EffectCancellation", (it) => {
|
||||
it.effect("preserves existing effects and adds the cancelled terminal status", () =>
|
||||
Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
yield* runMigrations({ toMigrationInclusive: 43 });
|
||||
yield* runMigrations({ toMigrationInclusive: 46 });
|
||||
yield* sql`
|
||||
INSERT INTO orchestration_v2_effect_outbox (
|
||||
effect_id,
|
||||
@@ -47,7 +47,7 @@ layer("044_OrchestrationV2EffectCancellation", (it) => {
|
||||
)
|
||||
`;
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 44 });
|
||||
yield* runMigrations({ toMigrationInclusive: 47 });
|
||||
yield* sql`
|
||||
UPDATE orchestration_v2_effect_outbox
|
||||
SET
|
||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user