Set up some versions on rake db:migrate RAILS_ENV=production

Viewed 17

im trying to update my Bitnami Redmine database, by using rake db:migrate RAILS_ENV=production but the problem is that the status says that i have many updates to do, but when i try theses updates i allways receive a message that the column or the table already exists, there is some command to "jump" db to especific version?

1 Answers

You can always "inject" a version into the schema_migrations table to trick the migration system into ignoring them, but TBH I'd be looking into why the migrations are so out of whack.

Worst case, you could always add column_exists? checks to each failing migration, and not add or update a column if it already has been added. But again, you run the risk of your migrations being out of spec with the state of the actual database.

Related