wip: zen
This commit is contained in:
parent
fb4105a46c
commit
729ad1cb75
6 changed files with 1059 additions and 7 deletions
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)],
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue