ecommerce-template/packages/db/src/schema/products.ts
afiqzudinhadi 7d4b49a0e5 chore: fix module import | add extension
requires extension because no bundler in this package
2025-07-10 22:59:00 +08:00

15 lines
560 B
TypeScript

import { pgTable, serial, text, numeric, boolean } from "drizzle-orm/pg-core";
import { timestamps } from "./column.helpers.ts";
export const products = pgTable("products", {
id: serial("id").primaryKey(),
name: text("name").notNull(),
description: text("description"),
price: numeric("price", { precision: 10, scale: 2 }).notNull(),
imageUrl: text("image_url"),
isPublished: boolean("is_published").default(false),
...timestamps,
});
export type InsertProduct = typeof products.$inferInsert;
export type SelectProduct = typeof products.$inferSelect;