Search code examples
ruby-on-railsmigrationrake

rake db:migrate not working properly without version


I have a simple rails app without dependencies (rails new example). Then I created a scaffold Student (rails g scaffold Student name:string). After, I run rake db:create and then rake db:migrate.

rake db:migrate returns nothing. It's not executing my migration, without no error on the screen. But, when I execute rake db:migrate VERSION=123456 the migration runs properly.

Do you have any idea what is happening with rake db:migrate without version? (I'm on MAC OS X)

thanks


Solution

  • The only logical answer I can come up is that your environment has the variable VERSION set with 0. Type this in the command line echo $VERSION

    If you do, running rake db:migrate should be equivalent to rake db:migrate VERSION=0 which would behave similarly to what you are describing. Unset the variable (unset VERSION) and try again.

    If you don't, this answer is clearly incorrect.