drizzle-kit push keeps trying to drop and recreate the same constraints

│ALTER TABLE "authenticator" DROP CONSTRAINT authenticator_userId_credentialID_pk;
│--> statement-breakpoint
│ALTER TABLE "authenticator" ADD CONSTRAINT authenticator_userId_credentialID_pk PRIMARY KEY(userId,credentialID);
│ALTER TABLE "account" DROP CONSTRAINT account_provider_providerAccountId_userId_pk;
│--> statement-breakpoint
│ALTER TABLE "account" ADD CONSTRAINT account_provider_providerAccountId_userId_pk PRIMARY KEY(provider,providerAccountId,userId);
│ALTER TABLE "authenticator" DROP CONSTRAINT authenticator_userId_credentialID_pk;
│--> statement-breakpoint
│ALTER TABLE "authenticator" ADD CONSTRAINT authenticator_userId_credentialID_pk PRIMARY KEY(userId,credentialID);
│ALTER TABLE "account" DROP CONSTRAINT account_provider_providerAccountId_userId_pk;
│--> statement-breakpoint
│ALTER TABLE "account" ADD CONSTRAINT account_provider_providerAccountId_userId_pk PRIMARY KEY(provider,providerAccountId,userId);
[email protected] using vercel-neon postgres I see many posts with this happening but no responses. Any clues ? This is becoming a huge headache in production for us.
5 Replies
SpamixTheProducer
having the same issue, but with mysql + mariadb. I know mariadb isnt officially supported but this shouldn't happen.
TOSL
TOSL3mo ago
Did you migrate to Drizzle from something else? Did you pull (introspect) to generate your scheme? Would be good to see schema as well.
SpamixTheProducer
Yes I will drop that, and no, I didn’t have a populated database before
SpamixTheProducer
@TOSL here's the schema: https://pastebin.com/WxPcMCX0
Pastebin
schema.ts - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

Did you find this page helpful?