Spaces:
Sleeping
Sleeping
| import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core"; | |
| import { sql } from "drizzle-orm"; | |
| import { createInsertSchema } from "drizzle-zod"; | |
| import { z } from "zod/v4"; | |
| export const conversations = sqliteTable("conversations", { | |
| id: integer("id").primaryKey({ autoIncrement: true }), | |
| title: text("title").notNull(), | |
| createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull().default(sql`(unixepoch() * 1000)`), | |
| }); | |
| export const insertConversationSchema = createInsertSchema(conversations).omit({ | |
| id: true, | |
| createdAt: true, | |
| }); | |
| export type Conversation = typeof conversations.$inferSelect; | |
| export type InsertConversation = z.infer<typeof insertConversationSchema>; | |