mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-25 03:34:22 +01:00
22 lines
544 B
TypeScript
22 lines
544 B
TypeScript
import { primaryKey, mysqlTable, uniqueIndex, varchar } from "drizzle-orm/mysql-core"
|
|
import { timestamps, ulid } from "../drizzle/types"
|
|
|
|
export const WorkspaceTable = mysqlTable(
|
|
"workspace",
|
|
{
|
|
id: ulid("id").notNull().primaryKey(),
|
|
slug: varchar("slug", { length: 255 }),
|
|
name: varchar("name", { length: 255 }),
|
|
...timestamps,
|
|
},
|
|
(table) => [uniqueIndex("slug").on(table.slug)],
|
|
)
|
|
|
|
export function workspaceIndexes(table: any) {
|
|
return [
|
|
primaryKey({
|
|
columns: [table.workspaceID, table.id],
|
|
}),
|
|
]
|
|
}
|