mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-02 06:20:29 +00:00
wip: zen
This commit is contained in:
parent
ad0f137e35
commit
3be1f9b67e
4 changed files with 750 additions and 7 deletions
|
|
@ -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),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue