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