All of a sudden build fails with ActiveRecord::PendingMigrationError

A simple branch with a migration and schema change now causes:

ActiveRecord::PendingMigrationError: 

Migrations are pending. To resolve this issue, run:

	bin/rake db:migrate RAILS_ENV=test

This doesn’t make any sense, as the build should just run migrations. I tried following solutions from the other thread but they didn’t work.

Hello @jcohenho,

When you committed the migration did you also commit the change to schema.rb?

See also this thread on how to workaround this issue.

Best,
Zak

Hi Zak!

First off, good to hear from you. I met you a couple times with my friend Claudio at RubyConf.

I did indeed commit changes to schema.rb along with the migration, but it still makes the build fail. I’ll try the other workarounds again and see if I have any luck.

I used the following workaround from the thread:

database:
      override:
        - bundle exec rake db:drop
        - bundle exec rake db:create RAILS_ENV=test
        - bundle exec rake db:migrate RAILS_ENV=test

and I put it in the dependency configuration, is that the right place to put this?