core: add database schema for Control account connections

This commit is contained in:
Dax Raad
2026-02-12 21:38:00 -05:00
parent 3592fa25d0
commit 1c02eb0cc3
2 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import { sqliteTable, text, integer, primaryKey } from "drizzle-orm/sqlite-core"
import { Timestamps } from "@/storage/schema.sql"
export const ControlAccountTable = sqliteTable(
"control_account",
{
email: text().notNull(),
url: text().notNull(),
access_token: text().notNull(),
refresh_token: text(),
token_expiry: integer(),
active: integer({ mode: "boolean" })
.notNull()
.$default(() => false),
...Timestamps,
},
(table) => [primaryKey({ columns: [table.email, table.url] })],
)

View File

@@ -0,0 +1,3 @@
export * from "./control.sql"
export namespace Control {}