Migrations won't be executed in order on a new db.
I created a manual .sql file based on a pg_dump for the initial migration as we have some features that are not supported yet (e.g. enabling uuid-ossp extension) etc.
I then introspected the schema based on said initial dumped schema, which works fine. I can drop all tables and schemas, recreate the public schema and apply the migration file without issues.
Now when I make any change in the schema and run the npx drizzle-kit migrate again, it will work just fine and apply the 2nd migration.
But if I then try to delete the db, meaning dropping all tables and schemas and try to recreate the db with migrations, the operation will fail because it just runs the 2nd migration again without running the first one.
Note, that I dropped the drizzle schema as well so that cannot be the issue.
Expected behavior
On a fresh db without drizzle schema with migrations table it should run all migration files in correct order
What version of
drizzle-orm
are you using?0.31.0
What version of
drizzle-kit
are you using?0.22.1
Describe the Bug
Migrations won't be executed in order on a new db.
I created a manual .sql file based on a pg_dump for the initial migration as we have some features that are not supported yet (e.g. enabling
uuid-ossp
extension) etc.I then introspected the schema based on said initial dumped schema, which works fine. I can drop all tables and schemas, recreate the public schema and apply the migration file without issues.
Now when I make any change in the schema and run the
npx drizzle-kit migrate
again, it will work just fine and apply the 2nd migration.But if I then try to delete the db, meaning dropping all tables and schemas and try to recreate the db with migrations, the operation will fail because it just runs the 2nd migration again without running the first one.
Note, that I dropped the drizzle schema as well so that cannot be the issue.
Expected behavior
On a fresh db without drizzle schema with migrations table it should run all migration files in correct order
Environment & setup
postgres v16