Introduced New DB
This commit is contained in:
27
db/schema/units.ts
Normal file
27
db/schema/units.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
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
|
||||
Reference in New Issue
Block a user