Co-authored-by: codex <[email protected]> Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
18 lines
475 B
TypeScript
18 lines
475 B
TypeScript
import * as Effect from "effect/Effect";
|
|
import * as SqlClient from "effect/unstable/sql/SqlClient";
|
|
|
|
export default Effect.gen(function* () {
|
|
const sql = yield* SqlClient.SqlClient;
|
|
|
|
const sessionColumns = yield* sql<{ readonly name: string }>`
|
|
PRAGMA table_info(auth_sessions)
|
|
`;
|
|
|
|
if (!sessionColumns.some((column) => column.name === "last_connected_at")) {
|
|
yield* sql`
|
|
ALTER TABLE auth_sessions
|
|
ADD COLUMN last_connected_at TEXT
|
|
`;
|
|
}
|
|
});
|