mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-20 01:04:22 +01:00
wip: zen
This commit is contained in:
16
packages/console/core/src/schema/auth.sql.ts
Normal file
16
packages/console/core/src/schema/auth.sql.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { mysqlEnum, mysqlTable, uniqueIndex, varchar } from "drizzle-orm/mysql-core"
|
||||
import { id, timestamps, ulid } from "../drizzle/types"
|
||||
|
||||
export const AuthProvider = ["email", "github", "google"] as const
|
||||
|
||||
export const AuthTable = mysqlTable(
|
||||
"auth",
|
||||
{
|
||||
id: id(),
|
||||
...timestamps,
|
||||
provider: mysqlEnum("provider", AuthProvider).notNull(),
|
||||
subject: varchar("subject", { length: 255 }).notNull(),
|
||||
accountID: ulid("account_id").notNull(),
|
||||
},
|
||||
(table) => [uniqueIndex("provider").on(table.provider, table.subject)],
|
||||
)
|
||||
Reference in New Issue
Block a user