The best way to control Claude Code, Codex and more from any computer or phone
| 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 | |
| 7 | // Databases that ran migration 86 before its json_valid guard reject malformed user messages. |
| 8 | yield* sql`DROP INDEX IF EXISTS orchestration_v2_projection_turn_items_queued_input_idx`; |
| 9 | yield* sql` |
| 10 | CREATE INDEX orchestration_v2_projection_turn_items_queued_input_idx |
| 11 | ON orchestration_v2_projection_turn_items(run_id) |
| 12 | WHERE type = 'user_message' |
| 13 | AND json_valid(payload_json) |
| 14 | AND json_extract(payload_json, '$.inputIntent') = 'queued_turn' |
| 15 | `; |
| 16 | }); |