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 const columns = yield* sql<{ readonly name: string }>`
7 PRAGMA table_info(projection_threads)
8 `;
9
10 if (columns.some((column) => column.name === "archived_at")) {
11 return;
12 }
13
14 yield* sql`
15 ALTER TABLE projection_threads
16 ADD COLUMN archived_at TEXT
17 `;
18});