mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 01:34:22 +01:00
wip: zen
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { mysqlTable, uniqueIndex, varchar, int, mysqlEnum, foreignKey } from "drizzle-orm/mysql-core"
|
||||
import { mysqlTable, uniqueIndex, varchar, int, mysqlEnum, index } from "drizzle-orm/mysql-core"
|
||||
import { timestamps, ulid, utc, workspaceColumns } from "../drizzle/types"
|
||||
import { workspaceIndexes } from "./workspace.sql"
|
||||
import { AccountTable } from "./account.sql"
|
||||
|
||||
export const UserRole = ["admin", "member"] as const
|
||||
|
||||
@@ -23,10 +22,7 @@ export const UserTable = mysqlTable(
|
||||
...workspaceIndexes(table),
|
||||
uniqueIndex("user_account_id").on(table.workspaceID, table.accountID),
|
||||
uniqueIndex("user_email").on(table.workspaceID, table.email),
|
||||
foreignKey({
|
||||
columns: [table.accountID],
|
||||
foreignColumns: [AccountTable.id],
|
||||
name: "global_account_id",
|
||||
}),
|
||||
index("global_account_id").on(table.accountID),
|
||||
index("global_email").on(table.email),
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user