sscirrus
sscirrus

Reputation: 56719

Possible to force a migration from the command line?

I made a rookie mistake with a migration yesterday. I amended a migration that had already been uploaded and run, and I forgot to rollback before uploading the new version. Now, the migration is failing because either a column already exists (up) or there is no column to delete (down)!

Is it possible to get a migration to force its changes one time from the console, without having to write :force => true within the document first, migrating, and then removing it again?

Upvotes: 4

Views: 6656

Answers (1)

Don Roby
Don Roby

Reputation: 41137

A simple way of getting back to a stable state would be to make a manual change in the database adding the column so that the rollback works, and then do the rollback and migrate up again.

Upvotes: 4

Related Questions