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

013_ProjectionThreadProposedPlans.ts

22 lines628 Bytes

1import * as Effect from "effect/Effect";
2import * as SqlClient from "effect/unstable/sql/SqlClient";
3​
4export default Effect.gen(function* () {
5 const sql = yield* SqlClient.SqlClient;
6​
7 yield* sql`
8 CREATE TABLE IF NOT EXISTS projection_thread_proposed_plans (
9 plan_id TEXT PRIMARY KEY,
10 thread_id TEXT NOT NULL,
11 turn_id TEXT,
12 plan_markdown TEXT NOT NULL,
13 created_at TEXT NOT NULL,
14 updated_at TEXT NOT NULL
15 )
16 `;
17​
18 yield* sql`
19 CREATE INDEX IF NOT EXISTS idx_projection_thread_proposed_plans_thread_created
20 ON projection_thread_proposed_plans(thread_id, created_at)
21 `;
22});