The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import * as Effect from "effect/Effect"; |
| 2 | import * as SqlClient from "effect/sql/SqlClient"; |
| 3 | |
| 4 | export default Effect.gen(function* () { |
| 5 | const sql = yield* SqlClient.SqlClient; |
| 6 | // Earlier builds of this change shipped the column under another migration id. |
| 7 | const columns = yield* sql<{ readonly name: string }>` |
| 8 | PRAGMA table_info(projection_projects) |
| 9 | `; |
| 10 | if (!columns.some((column) => column.name === "has_custom_title")) { |
| 11 | yield* sql` |
| 12 | ALTER TABLE projection_projects |
| 13 | ADD COLUMN has_custom_title INTEGER NOT NULL DEFAULT 0 |
| 14 | `; |
| 15 | } |
| 16 | yield* sql` |
| 17 | UPDATE projection_projects |
| 18 | SET has_custom_title = 1 |
| 19 | WHERE project_id IN ( |
| 20 | SELECT stream_id FROM orchestration_events |
| 21 | WHERE aggregate_kind = 'project' |
| 22 | AND event_type = 'project.meta-updated' |
| 23 | AND json_type(payload_json, '$.title') = 'text' |
| 24 | ) |
| 25 | `; |
| 26 | }); |