Migrations are pending

1

First I put rails server in the console and when I put in the local browser Host: 3000 I get this message, how can I solve it?

    
asked by Yohnathan Arrieta Camacho 02.04.2017 в 03:00
source

3 answers

0

As you have indicated in the comments, you have not executed the necessary migrations. That means that you have files in db / migrate with a date higher than the one you have in your db / schema.rb To solve this, you have to execute the migrations. Simply run in the terminal:

rake db:migrate db:test:prepare

The first part will execute all the migration files whose date is lower than the one in the schema.rb. Note that the date is the one with the file. So for example 20170220141221 You are specifying the date with YearMesDayHoraMinutoSecond.

The second part: db: test: prepare, copy the schema for the test database. Therefore, when executing the two, you prepare both the development database and the test database.

    
answered by 04.04.2017 / 09:25
source
1

rake db:migrate should serve

    
answered by 07.04.2017 в 20:56
0

On your console in the folder of your project you need to run the migration if you have rails 5 or greater the command is rails db:migrate

If you have a version of rails smaller than version 5 then the command is

bundle exec rake db:migrate
    
answered by 04.04.2017 в 18:42