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
b64cecb079
commit
06495ea964
7 changed files with 724 additions and 18 deletions
|
|
@ -1,7 +1,10 @@
|
|||
import { text, mysqlTable, uniqueIndex, varchar, int } from "drizzle-orm/mysql-core"
|
||||
import { mysqlTable, uniqueIndex, varchar, int, mysqlEnum } from "drizzle-orm/mysql-core"
|
||||
import { timestamps, utc, workspaceColumns } from "../drizzle/types"
|
||||
import { workspaceIndexes } from "./workspace.sql"
|
||||
|
||||
const UserRole = ["admin", "member"] as const
|
||||
export type UserRole = (typeof UserRole)[number]
|
||||
|
||||
export const UserTable = mysqlTable(
|
||||
"user",
|
||||
{
|
||||
|
|
@ -10,7 +13,9 @@ export const UserTable = mysqlTable(
|
|||
email: varchar("email", { length: 255 }).notNull(),
|
||||
name: varchar("name", { length: 255 }).notNull(),
|
||||
timeSeen: utc("time_seen"),
|
||||
timeJoined: utc("time_joined"),
|
||||
color: int("color"),
|
||||
role: mysqlEnum("role", ["admin", "member"]),
|
||||
},
|
||||
(table) => [...workspaceIndexes(table), uniqueIndex("user_email").on(table.workspaceID, table.email)],
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue