diff options
| author | Frank <[email protected]> | 2025-10-02 13:58:38 -0400 |
|---|---|---|
| committer | Frank <[email protected]> | 2025-10-02 13:58:40 -0400 |
| commit | a45fa7a93c7864ef7eed792949755b334a9b2524 (patch) | |
| tree | 00fedb5631806de856ecf9e5b49c997521d9d31d /packages/console/core/src/schema/user.sql.ts | |
| parent | ae15c914556a51c042f37284d52945d6c480b37f (diff) | |
| download | opencode-a45fa7a93c7864ef7eed792949755b334a9b2524.tar.gz opencode-a45fa7a93c7864ef7eed792949755b334a9b2524.zip | |
wip: zen
Diffstat (limited to 'packages/console/core/src/schema/user.sql.ts')
| -rw-r--r-- | packages/console/core/src/schema/user.sql.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/console/core/src/schema/user.sql.ts b/packages/console/core/src/schema/user.sql.ts index eaadb06d5..e1da69ee6 100644 --- a/packages/console/core/src/schema/user.sql.ts +++ b/packages/console/core/src/schema/user.sql.ts @@ -1,5 +1,5 @@ import { mysqlTable, uniqueIndex, varchar, int, mysqlEnum } from "drizzle-orm/mysql-core" -import { timestamps, utc, workspaceColumns } from "../drizzle/types" +import { timestamps, ulid, utc, workspaceColumns } from "../drizzle/types" import { workspaceIndexes } from "./workspace.sql" export const UserRole = ["admin", "member"] as const @@ -9,6 +9,8 @@ export const UserTable = mysqlTable( { ...workspaceColumns, ...timestamps, + accountID: ulid("account_id"), + oldAccountID: ulid("old_account_id"), email: varchar("email", { length: 255 }), oldEmail: varchar("old_email", { length: 255 }), name: varchar("name", { length: 255 }).notNull(), @@ -16,5 +18,9 @@ export const UserTable = mysqlTable( color: int("color"), role: mysqlEnum("role", UserRole).notNull(), }, - (table) => [...workspaceIndexes(table), uniqueIndex("user_email").on(table.workspaceID, table.email)], + (table) => [ + ...workspaceIndexes(table), + uniqueIndex("user_account_id").on(table.workspaceID, table.accountID), + uniqueIndex("user_email").on(table.workspaceID, table.email), + ], ) |
