diff --git a/src/db/schema.ts b/src/db/schema.ts index 874fa6f..bf42a6f 100644 --- a/src/db/schema.ts +++ b/src/db/schema.ts @@ -164,11 +164,11 @@ export const quote_items = pgTable("quote_items", { .notNull() .references(() => clients.id, { onDelete: "cascade" }), service_id: text("service_id") - .notNull() - .references(() => service_catalog.id, { onDelete: "restrict" }), + .references(() => service_catalog.id, { onDelete: "restrict" }), // nullable — free-form items have no catalog ref quantity: numeric("quantity", { precision: 10, scale: 2 }).notNull(), unit_price: numeric("unit_price", { precision: 10, scale: 2 }).notNull(), // snapshot at time of quote subtotal: numeric("subtotal", { precision: 10, scale: 2 }).notNull(), + custom_label: text("custom_label"), // free-form item label (when service_id is null) }); // ============ RELATIONS ============