-1

I use rails 4 , and has to migrate folder under db/migrate,for example: db/migrate/A , db/migrate/B .

I have success used A migration file create A database schema , used B migration file create B database schema .

But when i connect A database , and start my rails server , it check all my migration file under db/migrate..,and show the message :

"Migrations are pending. To resolve this issue, run: bin/rake db:migrate RAILS_ENV=development"

Anyone know how to solve this problem?

Michael Gaskill
  • 7,913
  • 10
  • 38
  • 43
Hsiu Chuan Tsao
  • 1,396
  • 1
  • 12
  • 23
  • Have you tried to run proposed command? – retgoat May 13 '16 at 10:26
  • Are you connecting to the correct database in config/database.yml? You cant have 2 separate migrations running on the same database... they will just toggle each other – Boltz0r May 13 '16 at 10:31

1 Answers1

1

To resolve this issue, run:

bin/rake db:migrate RAILS_ENV=development

That will apply the migrations that are pending.

Michael Gaskill
  • 7,913
  • 10
  • 38
  • 43