summaryrefslogtreecommitdiff
path: root/db/schema/items.ts
blob: 1d4b0dedf73e478aa8d9ee882566bee3848ef189 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import { pgTable, varchar, text, timestamp ,serial} from "drizzle-orm/pg-core"

export const items = pgTable("items", {
  id: serial("id").primaryKey(),
  itemCode: varchar("item_code", { length: 100 }).unique(),
  itemName: varchar("item_name", { length: 255 }).notNull(),
  description: text("description"),
  createdAt: timestamp("created_at").defaultNow().notNull(),
  updatedAt: timestamp("updated_at").defaultNow().notNull(),
});

export type Item = typeof items.$inferSelect