import { pgTable, text, serial, timestamp } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; import { z } from "zod/v4"; export const toolsTable = pgTable("tools", { id: serial("id").primaryKey(), name: text("name").notNull(), description: text("description").notNull(), category: text("category").notNull(), websiteUrl: text("website_url"), features: text("features").array().notNull().default([]), tags: text("tags").array().notNull().default([]), createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(), updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow().$onUpdate(() => new Date()), }); export const insertToolSchema = createInsertSchema(toolsTable).omit({ id: true, createdAt: true, updatedAt: true }); export type InsertTool = z.infer; export type Tool = typeof toolsTable.$inferSelect;