Another way to get this error is by changing the migration and pushing the changes to Heroku without rebuilding the table.
Caution: you will lose data and possibly links, so I'm going to explain this is a bad idea if you are not sure that the links will not be lost. Rails provides ways to modify tables using migration - create new migrations to modify tables, do not modify the migrations themselves after they are created as a whole.
Having said that, you can run heroku run rake db:rollback until this table changes, and then run heroku run rake db:migrate to return it with your changes.
In addition, you can use the tap label to backup and restore data. Extend the database tables, lift them up as you need, and then push the tables with taps. I do this quite often during the prototyping phase. I would never do this with a live application, though.
source share