Spaces:
Sleeping
Sleeping
File size: 701 Bytes
0e14acb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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>;
|