Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

072_WaitingLinkRequestIndex.ts

13 lines516 Bytes

1import * as Effect from "effect/Effect";
2import * as SqlClient from "effect/sql/SqlClient";
3​
4export default Effect.gen(function* () {
5 const sql = yield* SqlClient.SqlClient;
6​
7 // Keep this predicate aligned with ProjectionStore's waiting link card query.
8 yield* sql`
9 CREATE INDEX IF NOT EXISTS orchestration_v2_projection_turn_items_waiting_link_idx
10 ON orchestration_v2_projection_turn_items(thread_id, updated_at DESC, turn_item_id DESC)
11 WHERE type = 'link_request' AND status = 'waiting'
12 `;
13});