0

I apologise in advance for not being to provide a lot of information about this but I really am in a very weird situation: My schema.rb file gets messed up between different git branches, carrying with it database fields at will with the relative migrations just not existing.

When I run rake db:migrate:status I get a couple of ********** NO FILE **********.

Has anyone been in a similar situation? I would appreciate any kind of leads for a direction to try.

sebkkom
  • 1,426
  • 17
  • 31
  • If you try recreating your schema from the database and then check the status rake db:schema:dump – Rafal Jun 23 '14 at 15:52
  • Here is a similar question http://stackoverflow.com/questions/9240590/rails-how-to-solve-this-issue-of-an-orphaned-migration – Rafal Jun 23 '14 at 15:54
  • @Rafal The database is branch-agnostic. – sebkkom Jun 26 '14 at 14:22
  • Possible duplicate of [What is the preferred way to manage schema.rb in git?](http://stackoverflow.com/questions/737854/what-is-the-preferred-way-to-manage-schema-rb-in-git) – Tachyons Apr 07 '17 at 09:22

1 Answers1

0

The way I solved this is by dropping the database, feeding an older dump to it and then running the remaining migrations on my current branch. Yet another motivation to keep db backups, I guess.

sebkkom
  • 1,426
  • 17
  • 31