import { pgTable, text, serial, integer, numeric, timestamp } from "drizzle-orm/pg-core"; import { toolsTable } from "./tools"; import { usersTable } from "./users"; export const toolCostsTable = pgTable("tool_costs", { id: serial("id").primaryKey(), toolId: integer("tool_id").notNull().references(() => toolsTable.id, { onDelete: "cascade" }), licenseType: text("license_type", { enum: ["free", "subscription", "one_time", "usage_based"] }).notNull().default("free"), billingPeriod: text("billing_period", { enum: ["monthly", "quarterly", "yearly"] }), cost: numeric("cost", { precision: 10, scale: 2 }), currency: text("currency").default("EUR"), notes: text("notes"), createdBy: integer("created_by").references(() => usersTable.id, { onDelete: "set null" }), createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(), });