All of a sudden build fails with ActiveRecord::PendingMigrationError


#1

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.


#2

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


#3

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.


#4

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?


#5