Open History to see the last commit
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 // 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 === "tracked_folders_json")) return;
11 yield* sql`
12 ALTER TABLE projection_projects
13 ADD COLUMN tracked_folders_json TEXT NOT NULL DEFAULT '[]'
14 `;
15});