changing plurals to single and proper-casing

This commit is contained in:
2024-11-19 21:15:15 -05:00
parent 08f1a610f7
commit 429d6d2b26
11 changed files with 204 additions and 32 deletions

14
src/db/schema/Product.ts Normal file
View File

@@ -0,0 +1,14 @@
import { pgTable, integer, varchar, text, decimal } from "drizzle-orm/pg-core";
import { sql } from "drizzle-orm";
import { timestamps } from "./columns.helpers";
export const Product = pgTable("products", {
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "products_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
name: varchar({length: 255 }).notNull(),
description: text().notNull(),
price: decimal().notNull(),
reseller_id: integer().notNull(),
category_id: integer().notNull(),
stock_qty: integer().default(0),
...timestamps
})