| import { pgTable, serial, text, timestamp, boolean, integer } from "drizzle-orm/pg-core"; |
| import { createInsertSchema } from "drizzle-zod"; |
| import { z } from "zod/v4"; |
|
|
| export const videosTable = pgTable("videos", { |
| id: serial("id").primaryKey(), |
| videoUrl: text("video_url").notNull(), |
| thumbnailUrl: text("thumbnail_url"), |
| prompt: text("prompt").notNull(), |
| negativePrompt: text("negative_prompt"), |
| model: text("model").notNull().default("grok-3"), |
| aspectRatio: text("aspect_ratio").notNull().default("16:9"), |
| resolution: text("resolution").notNull().default("480p"), |
| duration: integer("duration").notNull().default(6), |
| hasRefImage: boolean("has_ref_image").notNull().default(false), |
| isPrivate: boolean("is_private").notNull().default(false), |
| userId: integer("user_id"), |
| createdAt: timestamp("created_at").defaultNow().notNull(), |
| }); |
|
|
| export const insertVideoSchema = createInsertSchema(videosTable).omit({ id: true, createdAt: true }); |
| export type InsertVideo = z.infer<typeof insertVideoSchema>; |
| export type Video = typeof videosTable.$inferSelect; |
|
|