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
7 // Accounts added beside a standalone tracker's first one. The first keeps no row and binds
8 // with a null account_id, so bindings saved before this migration still read the same.
9 yield* sql`
10 CREATE TABLE IF NOT EXISTS issue_tracker_accounts (
11 tracker TEXT NOT NULL,
12 account_id TEXT NOT NULL,
13 created_at TEXT NOT NULL,
14 PRIMARY KEY (tracker, account_id)
15 ) WITHOUT ROWID
16 `;
17 yield* sql`ALTER TABLE issue_tracker_bindings ADD COLUMN account_id TEXT`;
18});