This commit is contained in:
Frank
2025-10-16 17:50:30 -04:00
parent fb4105a46c
commit 729ad1cb75
6 changed files with 1059 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ import { z } from "zod"
export namespace Identifier {
const prefixes = {
account: "acc",
auth: "aut",
billing: "bil",
key: "key",
model: "mod",

View 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)],
)