diff options
| author | Frank <[email protected]> | 2025-10-16 17:50:30 -0400 |
|---|---|---|
| committer | Frank <[email protected]> | 2025-10-16 17:50:32 -0400 |
| commit | 729ad1cb75bb4518ab83f6784d63f69b75626f58 (patch) | |
| tree | 1104dc898390c95bf661a0873b262a7945de5bf4 /packages/console/core/src/schema/auth.sql.ts | |
| parent | fb4105a46cc4147c6d55c66002482a761aa42caf (diff) | |
| download | opencode-729ad1cb75bb4518ab83f6784d63f69b75626f58.tar.gz opencode-729ad1cb75bb4518ab83f6784d63f69b75626f58.zip | |
wip: zen
Diffstat (limited to 'packages/console/core/src/schema/auth.sql.ts')
| -rw-r--r-- | packages/console/core/src/schema/auth.sql.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/console/core/src/schema/auth.sql.ts b/packages/console/core/src/schema/auth.sql.ts new file mode 100644 index 000000000..be2244ef3 --- /dev/null +++ b/packages/console/core/src/schema/auth.sql.ts @@ -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)], +) |
