Proper Way to Deal with Migration Failures and Rolling Back?
So I added an Enum and made a few minor changes and generated 3 SQL files. But when running a migration I got the error
on one of my created enums. It seemed like something bugged out where it wasn't creating the enum in the proper order? Anyway, I had to delete my snapshot json, SQL, and _journal files back to last working migration (#5) vs #8 where i was.
If i didn't manually delete the migrations in the array in _jounral i would get
throw new Error(
No file ${migrationPath} found in ${migrationFolderTo} folder)
error.
Not sure if there was a proper way of rolling back migrations but hopefully this manual approach helps anyone3 Replies
You mean drizzle-kit drop? https://orm.drizzle.team/kit-docs/commands#drop-migration
List of commands – DrizzleORM
Drizzle ORM | %s
good call. didnt see that. if you drop file 2 and you're on 5, does it drop 2-5 as well?
Just tested it, nope.