Start your All-Access Pass to unlock this challenge
Imagine you run a migration with 5 queries in it... and it fails on the 2nd query! What do we do???
Just fix the migration and run it again. All modern database systems are able to "roll back" the 1st query to reset the system.
Just fix the migration and run it again. The migrations system keeps track of exactly which queries have and haven't been executed. When you re-run the migration later, it'll skip the query.
After fixing the migration, the only safe thing to do is completely reset your database to the structure (and data) it had before you ran the migration. Then you can run the migration to validate that it works.