In some cases it is difficult to run migrations from the irb console using the cf console command. It is possible to include your migration execution within a rails initializer when your application starts.
To follow this approach you have to create a new initializer file within the config/initializers directory. Let's call it run_migrations.rb.
The file should contain the following line of code for executing the database migrations:
And that's it. Next time migrations will be run automatically when you execute cf push for deploying your application to anynines.
Please sign in to leave a comment.