Spaces:
Runtime error
Runtime error
| import { pgTable, text, integer, timestamp, uuid } from "drizzle-orm/pg-core"; | |
| import { createInsertSchema } from "drizzle-zod"; | |
| import { z } from "zod/v4"; | |
| export const briefsTable = pgTable("briefs", { | |
| id: integer("id").primaryKey().generatedAlwaysAsIdentity(), | |
| title: text("title").notNull(), | |
| category: text("category"), | |
| content: text("content").notNull(), | |
| userId: uuid("user_id").notNull(), | |
| createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(), | |
| updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull().$onUpdate(() => new Date()), | |
| }); | |
| export const insertBriefSchema = createInsertSchema(briefsTable).pick({ | |
| title: true, | |
| category: true, | |
| content: true, | |
| }); | |
| export type InsertBrief = z.infer<typeof insertBriefSchema>; | |
| export type Brief = typeof briefsTable.$inferSelect; | |