mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-31 06:12:26 +00:00
Co-authored-by: Github Action <action@github.com> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: Brendan Allan <git@brendonovich.dev>
23 lines
694 B
TypeScript
23 lines
694 B
TypeScript
import { sqliteTable, text, integer, primaryKey, uniqueIndex } from "drizzle-orm/sqlite-core"
|
|
import { eq } from "drizzle-orm"
|
|
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().notNull(),
|
|
token_expiry: integer(),
|
|
active: integer({ mode: "boolean" })
|
|
.notNull()
|
|
.$default(() => false),
|
|
...Timestamps,
|
|
},
|
|
(table) => [
|
|
primaryKey({ columns: [table.email, table.url] }),
|
|
// uniqueIndex("control_account_active_idx").on(table.email).where(eq(table.active, true)),
|
|
],
|
|
)
|