refactor: make block kind enum dynamic in schema (#762)
This commit is contained in:
parent
5e059844a2
commit
dfc07ce0ae
1 changed files with 2 additions and 3 deletions
|
|
@ -10,6 +10,7 @@ import {
|
|||
foreignKey,
|
||||
boolean,
|
||||
} from 'drizzle-orm/pg-core';
|
||||
import { blockKinds } from '../blocks/server';
|
||||
|
||||
export const user = pgTable('User', {
|
||||
id: uuid('id').primaryKey().notNull().defaultRandom(),
|
||||
|
|
@ -72,9 +73,7 @@ export const document = pgTable(
|
|||
createdAt: timestamp('createdAt').notNull(),
|
||||
title: text('title').notNull(),
|
||||
content: text('content'),
|
||||
kind: varchar('text', { enum: ['text', 'code', 'image', 'sheet'] })
|
||||
.notNull()
|
||||
.default('text'),
|
||||
kind: varchar('text', { enum: blockKinds }).notNull().default('text'),
|
||||
userId: uuid('userId')
|
||||
.notNull()
|
||||
.references(() => user.id),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue