diff options
Diffstat (limited to 'packages/console/core/src/schema/workspace.sql.ts')
| -rw-r--r-- | packages/console/core/src/schema/workspace.sql.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/console/core/src/schema/workspace.sql.ts b/packages/console/core/src/schema/workspace.sql.ts new file mode 100644 index 000000000..979255428 --- /dev/null +++ b/packages/console/core/src/schema/workspace.sql.ts @@ -0,0 +1,21 @@ +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], + }), + ] +} |
