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

097_IssueTrackerBindings.ts

18 lines680 Bytes

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 // One row per project bound to a standalone issue tracker (Linear, Jira): which tracker and
8 // which of its scopes (a team or project key). Unbinding deletes the row; a project with no row
9 // reads only its git host's issues. The credential itself lives in the secret store.
10 yield* sql`
11 CREATE TABLE IF NOT EXISTS issue_tracker_bindings (
12 project_id TEXT PRIMARY KEY,
13 tracker TEXT NOT NULL,
14 scope TEXT NOT NULL,
15 updated_at TEXT NOT NULL
16 ) WITHOUT ROWID
17 `;
18});