mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 01:34:22 +01:00
wip: zen
This commit is contained in:
@@ -4,6 +4,7 @@ import { z } from "zod"
|
||||
export namespace Identifier {
|
||||
const prefixes = {
|
||||
account: "acc",
|
||||
auth: "aut",
|
||||
billing: "bil",
|
||||
key: "key",
|
||||
model: "mod",
|
||||
|
||||
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