drizzle-kit push:mysql drops unchanged primary key & introspect:mysql fails hard
drizzle-kit version: 0.19.3
database: Planetscale
drizzle.config.ts:
Running drizzle-kit push:mysql errored out because it was trying to drop a primary key
As per https://orm.drizzle.team/kit-docs/overview#prototyping-with-db-push i understood that drizzle-kit executes a schema introspection, and then diffs it against my current schema.
So i ran a schema introspection, and the result very wrong
Attached screenshots of the current table structure, obtained by running
SHOW CREATE TABLE [name]
and the schema that drizzle generatedDrizzle Kit - DrizzleORM
Drizzle ORM | %s
8 Replies
I have same issue. SO fking anoying, been trying to debug the whole day
I have the same issue
Are you using next-auth too?
Seems a issue with next auth schema
It's a little annoying to delete all tables,
push:mysql
, import some data to test the new schemaActually solved by commenting out
strict
umm, I don't have it in my config
Im experiencing this too, someone help please
Im using next auth
Did you guys found any work around?. Its getting annoying to delete tables each time to push the new schema changes.
For me commenting out strict and verbose solved this. Make sure you have latest drizzle orm version
Yeah I didn't have either of those (and verbose just displays what its going to do afaik). I had to downgrade to make this work.