Files
FEDEO/backend/db/schema/units.ts
2026-01-06 12:07:43 +01:00

28 lines
616 B
TypeScript

import {
pgTable,
bigint,
timestamp,
text,
} from "drizzle-orm/pg-core"
export const units = pgTable("units", {
id: bigint("id", { mode: "number" })
.primaryKey()
.generatedByDefaultAsIdentity(),
createdAt: timestamp("created_at", { withTimezone: true })
.notNull()
.defaultNow(),
name: text("name").notNull(),
single: text("single").notNull(),
multiple: text("multiple"),
short: text("short"),
step: text("step").notNull().default("1"),
})
export type Unit = typeof units.$inferSelect
export type NewUnit = typeof units.$inferInsert