fix(server): renumber v2 migrations after main's 037_ProjectionTurnsKeysetIndex
Main owns migration numbering: 037_ProjectionTurnsKeysetIndex landed on main (#5493), so the v2 migrations shift from 037-045 to 038-046. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
e992d844b6
commit
4cd4e62417
14 files changed
+53
-53
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 Migration037V2 from "./Migrations/037_OrchestrationV2.ts";
|
||||
import Migration038V2 from "./Migrations/038_OrchestrationV2Subagents.ts";
|
||||
import Migration039V2 from "./Migrations/039_OrchestrationV2Foundation.ts";
|
||||
import Migration040V2 from "./Migrations/040_OrchestrationV2ProviderSessionBindings.ts";
|
||||
import Migration041V2 from "./Migrations/041_OrchestrationV2ThreadLaunchWorkflows.ts";
|
||||
import Migration042V2 from "./Migrations/042_ApplicationEventSource.ts";
|
||||
import Migration043V2 from "./Migrations/043_OrchestrationV2EffectCancellation.ts";
|
||||
import Migration044V2 from "./Migrations/044_ScheduledTasks.ts";
|
||||
import Migration045V2 from "./Migrations/045_LegacyV1ImportState.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";
|
||||
|
||||
/**
|
||||
* 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", Migration037V2],
|
||||
[42, "OrchestrationV2Subagents", Migration038V2],
|
||||
[43, "OrchestrationV2Foundation", Migration039V2],
|
||||
[44, "OrchestrationV2ProviderSessionBindings", Migration040V2],
|
||||
[45, "OrchestrationV2ThreadLaunchWorkflows", Migration041V2],
|
||||
[46, "ApplicationEventSource", Migration042V2],
|
||||
[47, "OrchestrationV2EffectCancellation", Migration043V2],
|
||||
[48, "ScheduledTasks", Migration044V2],
|
||||
[49, "LegacyV1ImportState", Migration045V2],
|
||||
[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],
|
||||
] as const;
|
||||
|
||||
export const migrationManifest = migrationEntries.map(([id, name]) => [id, name] as const);
|
||||
|
||||
+27
-27
@@ -8,12 +8,12 @@ import * as NodeSqliteClient from "../NodeSqliteClient.ts";
|
||||
|
||||
const layer = it.layer(Layer.mergeAll(NodeSqliteClient.layerMemory()));
|
||||
|
||||
layer("037_038_OrchestrationV2", (it) => {
|
||||
layer("038_039_OrchestrationV2", (it) => {
|
||||
it.effect("keeps released and private migration ids contiguous", () =>
|
||||
Effect.sync(() => {
|
||||
assert.deepStrictEqual(
|
||||
migrationEntries.map(([id]) => id),
|
||||
Array.from({ length: 45 }, (_, index) => index + 1),
|
||||
Array.from({ length: 46 }, (_, index) => index + 1),
|
||||
);
|
||||
}),
|
||||
);
|
||||
@@ -22,7 +22,7 @@ layer("037_038_OrchestrationV2", (it) => {
|
||||
Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 38 });
|
||||
yield* runMigrations({ toMigrationInclusive: 39 });
|
||||
|
||||
const migrations = yield* sql<{
|
||||
readonly migration_id: number;
|
||||
@@ -30,24 +30,24 @@ layer("037_038_OrchestrationV2", (it) => {
|
||||
}>`
|
||||
SELECT migration_id, name
|
||||
FROM effect_sql_migrations
|
||||
WHERE migration_id IN (35, 36, 37, 38)
|
||||
WHERE migration_id IN (36, 37, 38, 39)
|
||||
ORDER BY migration_id
|
||||
`;
|
||||
assert.deepStrictEqual(migrations, [
|
||||
{
|
||||
migration_id: 35,
|
||||
name: "ProjectionThreadTitleRegeneration",
|
||||
},
|
||||
{
|
||||
migration_id: 36,
|
||||
name: "ProjectionThreadsPinned",
|
||||
},
|
||||
{
|
||||
migration_id: 37,
|
||||
name: "OrchestrationV2",
|
||||
name: "ProjectionTurnsKeysetIndex",
|
||||
},
|
||||
{
|
||||
migration_id: 38,
|
||||
name: "OrchestrationV2",
|
||||
},
|
||||
{
|
||||
migration_id: 39,
|
||||
name: "OrchestrationV2Subagents",
|
||||
},
|
||||
]);
|
||||
@@ -67,7 +67,7 @@ layer("037_038_OrchestrationV2", (it) => {
|
||||
it.effect("backfills provider-session thread bindings in migration 038", () =>
|
||||
Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
yield* runMigrations({ toMigrationInclusive: 39 });
|
||||
yield* runMigrations({ toMigrationInclusive: 40 });
|
||||
yield* sql`
|
||||
INSERT INTO orchestration_v2_projection_provider_sessions (
|
||||
provider_session_id,
|
||||
@@ -92,7 +92,7 @@ layer("037_038_OrchestrationV2", (it) => {
|
||||
)
|
||||
`;
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 40 });
|
||||
yield* runMigrations({ toMigrationInclusive: 41 });
|
||||
|
||||
const bindings = yield* sql<{
|
||||
readonly provider_session_id: string;
|
||||
@@ -113,7 +113,7 @@ layer("037_038_OrchestrationV2", (it) => {
|
||||
it.effect("preserves turn items with colliding ordinals in migration 037", () =>
|
||||
Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
yield* runMigrations({ toMigrationInclusive: 38 });
|
||||
yield* runMigrations({ toMigrationInclusive: 39 });
|
||||
yield* sql`
|
||||
INSERT INTO orchestration_v2_projection_runs (
|
||||
run_id,
|
||||
@@ -150,7 +150,7 @@ layer("037_038_OrchestrationV2", (it) => {
|
||||
('turn-item:d', 'thread:two', NULL, 42, 'assistant_message', 'completed', '2026-01-01T00:00:00.000Z', '{}')
|
||||
`;
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 39 });
|
||||
yield* runMigrations({ toMigrationInclusive: 40 });
|
||||
|
||||
const positions = yield* sql<{
|
||||
readonly thread_id: string;
|
||||
@@ -171,18 +171,18 @@ layer("037_038_OrchestrationV2", (it) => {
|
||||
);
|
||||
});
|
||||
|
||||
it.effect("upgrades a database already at released main migration 036", () =>
|
||||
it.effect("upgrades a database already at released main migration 037", () =>
|
||||
Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 36 });
|
||||
yield* runMigrations({ toMigrationInclusive: 37 });
|
||||
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: 45 });
|
||||
yield* runMigrations({ toMigrationInclusive: 46 });
|
||||
|
||||
const migrations = yield* sql<{
|
||||
readonly migration_id: number;
|
||||
@@ -190,23 +190,23 @@ it.effect("upgrades a database already at released main migration 036", () =>
|
||||
}>`
|
||||
SELECT migration_id, name
|
||||
FROM effect_sql_migrations
|
||||
WHERE migration_id BETWEEN 35 AND 45
|
||||
WHERE migration_id BETWEEN 36 AND 46
|
||||
ORDER BY migration_id
|
||||
`;
|
||||
assert.deepStrictEqual(
|
||||
migrations.map(({ migration_id, name }) => [migration_id, name]),
|
||||
[
|
||||
[35, "ProjectionThreadTitleRegeneration"],
|
||||
[36, "ProjectionThreadsPinned"],
|
||||
[37, "OrchestrationV2"],
|
||||
[38, "OrchestrationV2Subagents"],
|
||||
[39, "OrchestrationV2Foundation"],
|
||||
[40, "OrchestrationV2ProviderSessionBindings"],
|
||||
[41, "OrchestrationV2ThreadLaunchWorkflows"],
|
||||
[42, "ApplicationEventSource"],
|
||||
[43, "OrchestrationV2EffectCancellation"],
|
||||
[44, "ScheduledTasks"],
|
||||
[45, "LegacyV1ImportState"],
|
||||
[37, "ProjectionTurnsKeysetIndex"],
|
||||
[38, "OrchestrationV2"],
|
||||
[39, "OrchestrationV2Subagents"],
|
||||
[40, "OrchestrationV2Foundation"],
|
||||
[41, "OrchestrationV2ProviderSessionBindings"],
|
||||
[42, "OrchestrationV2ThreadLaunchWorkflows"],
|
||||
[43, "ApplicationEventSource"],
|
||||
[44, "OrchestrationV2EffectCancellation"],
|
||||
[45, "ScheduledTasks"],
|
||||
[46, "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: 38 });
|
||||
yield* runMigrations({ toMigrationInclusive: 39 });
|
||||
|
||||
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: 39 });
|
||||
yield* runMigrations({ toMigrationInclusive: 40 });
|
||||
|
||||
const events = yield* sql<{
|
||||
readonly event_id: string;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
-3
@@ -8,11 +8,11 @@ import * as NodeSqliteClient from "../NodeSqliteClient.ts";
|
||||
|
||||
const layer = it.layer(Layer.mergeAll(NodeSqliteClient.layerMemory()));
|
||||
|
||||
layer("042_ApplicationEventSource", (it) => {
|
||||
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: 41 });
|
||||
yield* runMigrations({ toMigrationInclusive: 42 });
|
||||
|
||||
yield* sql`
|
||||
INSERT INTO orchestration_v2_events (
|
||||
@@ -84,7 +84,7 @@ layer("042_ApplicationEventSource", (it) => {
|
||||
)
|
||||
`;
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 42 });
|
||||
yield* runMigrations({ toMigrationInclusive: 43 });
|
||||
|
||||
const events = yield* sql<{
|
||||
readonly sequence: number;
|
||||
File renamed without changes.
+3
-3
@@ -8,11 +8,11 @@ import * as NodeSqliteClient from "../NodeSqliteClient.ts";
|
||||
|
||||
const layer = it.layer(Layer.mergeAll(NodeSqliteClient.layerMemory()));
|
||||
|
||||
layer("043_OrchestrationV2EffectCancellation", (it) => {
|
||||
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: 42 });
|
||||
yield* runMigrations({ toMigrationInclusive: 43 });
|
||||
yield* sql`
|
||||
INSERT INTO orchestration_v2_effect_outbox (
|
||||
effect_id,
|
||||
@@ -47,7 +47,7 @@ layer("043_OrchestrationV2EffectCancellation", (it) => {
|
||||
)
|
||||
`;
|
||||
|
||||
yield* runMigrations({ toMigrationInclusive: 43 });
|
||||
yield* runMigrations({ toMigrationInclusive: 44 });
|
||||
yield* sql`
|
||||
UPDATE orchestration_v2_effect_outbox
|
||||
SET
|
||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user