Can I force migration from the command line?

Yesterday I made a rookie mistake. I changed the migration that was already downloaded and started, and I forgot the rollback before downloading the new version. Now the migration fails because either the column already exists (up) or there is no column to delete (down)!

Is it possible to get a migration to force change its changes from the console, without , to first write :force => true inside the document, transfer and delete it again?

+4
source share
1 answer

An easy way to return to a stable state would be to manually make changes to the database by adding a column so that the rollback works, and then rolls back and migrates again.

+4
source

Source: https://habr.com/ru/post/1344463/


All Articles