mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-24 06:45:22 +00:00
core: add database schema for Control account connections
This commit is contained in:
18
packages/opencode/src/control/control.sql.ts
Normal file
18
packages/opencode/src/control/control.sql.ts
Normal 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] })],
|
||||
)
|
||||
3
packages/opencode/src/control/index.ts
Normal file
3
packages/opencode/src/control/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from "./control.sql"
|
||||
|
||||
export namespace Control {}
|
||||
Reference in New Issue
Block a user