© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
9 replies
nukepower

Multiple primary keys error

Hey, im having problem with migration, got this error: [⣟] applying migrations...error: multiple primary keys for table "workShopRates" are not allowed

Even tho i dont have multiple primary keys.

Here is my schema

export const authMake = pgTable("manufacturers", {
  value: uuid("value").primaryKey(),
  label: varchar("label", { length: 256 }),
});
export const workShopRates = pgTable("workShopRates", {
  id: uuid("id").primaryKey().defaultRandom(),
  createdBy: uuid("createdBy")
    .notNull()
    .default("00000000-0000-0000-0000-000000000000"),
  point: varchar("point", { length: 256 }),
  workShopName: varchar("workshopName", { length: 256 }),
  workShopZip: varchar("workShopZip", { length: 256 }).notNull(),
  hasAuth: boolean("hasAuth").notNull(),
  bodyRateFrom: integer("bodyRateFrom").notNull(),
  bodyRateTo: integer("bodyRateTo").notNull(),
  paintRateFrom: integer("paintRateFrom").notNull(),
  paintRateTo: integer("paintRateTo").notNull(),
  serviceFrom: integer("serviceFrom").notNull(),
  serviceTo: integer("serviceTo").notNull(),
  additionalInformation: text("additionalInformation"),
  createdAt: date("createdAt").defaultNow(),
  authMakeValue: uuid("authMakeValue").references(() => authMake.value),
});
export const authMake = pgTable("manufacturers", {
  value: uuid("value").primaryKey(),
  label: varchar("label", { length: 256 }),
});
export const workShopRates = pgTable("workShopRates", {
  id: uuid("id").primaryKey().defaultRandom(),
  createdBy: uuid("createdBy")
    .notNull()
    .default("00000000-0000-0000-0000-000000000000"),
  point: varchar("point", { length: 256 }),
  workShopName: varchar("workshopName", { length: 256 }),
  workShopZip: varchar("workShopZip", { length: 256 }).notNull(),
  hasAuth: boolean("hasAuth").notNull(),
  bodyRateFrom: integer("bodyRateFrom").notNull(),
  bodyRateTo: integer("bodyRateTo").notNull(),
  paintRateFrom: integer("paintRateFrom").notNull(),
  paintRateTo: integer("paintRateTo").notNull(),
  serviceFrom: integer("serviceFrom").notNull(),
  serviceTo: integer("serviceTo").notNull(),
  additionalInformation: text("additionalInformation"),
  createdAt: date("createdAt").defaultNow(),
  authMakeValue: uuid("authMakeValue").references(() => authMake.value),
});
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Composite primary key, multiple primary keys
Drizzle TeamDTDrizzle Team / help
2y ago
error: multiple primary keys for table "event_item_price" are not allowed
Drizzle TeamDTDrizzle Team / help
10mo ago
Dropping primary keys every time
Drizzle TeamDTDrizzle Team / help
3y ago