@devries-cameron20 / t3code-1 / commits / f9752d7c08
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

migr

Julius Marminge committed Feb 26, 2026 at 21:23 UTC f9752d7c08ee1e22161bfdd4ec8441c4272c5b99
3 files changed +32 -2
apps/server/src/persistence/Migrations.ts
+2
@@ -17,6 +17,7 @@ import Migration0002 from "./Migrations/002_OrchestrationCommandReceipts.ts";
17 import Migration0003 from "./Migrations/003_CheckpointDiffBlobs.ts";
18 import Migration0004 from "./Migrations/004_ProviderSessionRuntime.ts";
19 import Migration0005 from "./Migrations/005_Projections.ts";
20 +import Migration0006 from "./Migrations/006_ProjectionThreadSessionRuntimeModeColumns.ts";
21
22 /**
23 * Migration loader with all migrations defined inline.
@@ -34,6 +35,7 @@ const loader = Migrator.fromRecord({
35 "3_CheckpointDiffBlobs": Migration0003,
36 "4_ProviderSessionRuntime": Migration0004,
37 "5_Projections": Migration0005,
38 + "6_ProjectionThreadSessionRuntimeModeColumns": Migration0006,
39 });
40
41 /**
apps/server/src/persistence/Migrations/005_Projections.ts
-2
@@ -65,8 +65,6 @@ export default Effect.gen(function* () {
65 provider_name TEXT,
66 provider_session_id TEXT,
67 provider_thread_id TEXT,
68 - approval_policy TEXT NOT NULL,
69 - sandbox_mode TEXT NOT NULL,
68 active_turn_id TEXT,
69 last_error TEXT,
70 updated_at TEXT NOT NULL
apps/server/src/persistence/Migrations/006_ProjectionThreadSessionRuntimeModeColumns.ts new
+30
@@ -0,0 +1,30 @@
1 +import * as SqlClient from "effect/unstable/sql/SqlClient";
2 +import * as Effect from "effect/Effect";
3 +
4 +const DEFAULT_APPROVAL_POLICY = "never";
5 +const DEFAULT_SANDBOX_MODE = "workspace-write";
6 +
7 +export default Effect.gen(function* () {
8 + const sql = yield* SqlClient.SqlClient;
9 +
10 + yield* sql`
11 + ALTER TABLE projection_thread_sessions
12 + ADD COLUMN approval_policy TEXT NOT NULL DEFAULT 'never'
13 + `;
14 +
15 + yield* sql`
16 + ALTER TABLE projection_thread_sessions
17 + ADD COLUMN sandbox_mode TEXT NOT NULL DEFAULT 'workspace-write'
18 + `;
19 +
20 + yield* sql`
21 + UPDATE projection_thread_sessions
22 + SET approval_policy = ${DEFAULT_APPROVAL_POLICY}
23 + WHERE approval_policy IS NULL
24 + `;
25 + yield* sql`
26 + UPDATE projection_thread_sessions
27 + SET sandbox_mode = ${DEFAULT_SANDBOX_MODE}
28 + WHERE sandbox_mode IS NULL
29 + `;
30 +});