KitAstro
KitAstro
DTDrizzle Team
Created by KitAstro on 8/10/2023 in #help
how to use serial within compound primary key
export const refund = pgTable("refund", {
id: serial("id").primaryKey(),
purchase_id: integer("purchase_id")
.references(() => purchase.id)
.default(-1)
.notNull(),
order: integer("order").notNull(),
timestamp: timestamp("timestamp").defaultNow(),
})
export const refund = pgTable("refund", {
id: serial("id").primaryKey(),
purchase_id: integer("purchase_id")
.references(() => purchase.id)
.default(-1)
.notNull(),
order: integer("order").notNull(),
timestamp: timestamp("timestamp").defaultNow(),
})
I want the order to go from 0 to n depending on the references shared with purchase_id
35 replies