© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago
janosch.hrm

error: column "x" is in a primary key

I'm getting the following error, when trying to push my schema to my remote db: error: column "x" is in a primary key

The weird thing is that everything works fine, when I drop all tables and run it for the first time, but if I try to re-run
drizzle-kit push:pg
drizzle-kit push:pg
, this is the error I get, even if the schema has not changed at all.

Does anyone know what might cause this?
 {
  length: 109,
  severity: 'ERROR',
  code: '42P16',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'tablecmds.c',
  line: '7287',
  routine: 'ATExecDropNotNull'
}
 {
  length: 109,
  severity: 'ERROR',
  code: '42P16',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'tablecmds.c',
  line: '7287',
  routine: 'ATExecDropNotNull'
}
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

Column primary key not working
Drizzle TeamDTDrizzle Team / help
3y ago
Can't run drizzle-kit push:pg - error: column is in a primary key
Drizzle TeamDTDrizzle Team / help
3y ago
Compostie primary key of a composite primary key
Drizzle TeamDTDrizzle Team / help
2y ago
SQLite composite primary key error.
Drizzle TeamDTDrizzle Team / help
3y ago