Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rake db:migrate doesn't seem to work in production

People also ask

Which Command executes a database migration?

The down command executes the migrations of your currently configured migrations directory. More specific the down migrations are being called. Down migrations are called in reverse order in which the up migrations previously were executed.

How rails db Migrate works?

When you run db:migrate, rails will check a special table in the database which contains the timestamp of the last migration applied to the database. It will then apply all of the migrations with timestamps after that date and update the database table with the timestamp of the last migration.


Sometimes I forget about Google. The answer is this:

rake db:migrate RAILS_ENV=production

For me the answer above not works. I have to add bundle exec to make it works.

bundle exec rails db:migrate RAILS_ENV=production