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
73115efab1
commit
a8341e2b8b
10 changed files with 43 additions and 38 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { mysqlTable, uniqueIndex, varchar, int, mysqlEnum } from "drizzle-orm/mysql-core"
|
||||
import { mysqlTable, uniqueIndex, varchar, int, mysqlEnum, foreignKey } 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
|
||||
|
||||
|
|
@ -22,5 +23,10 @@ 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",
|
||||
}),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue