panter / panter-rails-deploy

Capistrano setup for Panter Rails hosting
MIT License
1 stars 0 forks source link

migrations don't run correctly on rails 5 environment #15

Open domicode opened 7 years ago

domicode commented 7 years ago

most probably because of this: http://blog.bigbinary.com/2016/06/07/rails-5-prevents-destructive-action-on-production-db.html

I had to run the migration manually. I am not sure if that's standard or maybe because I have a bit more complex setup with devise and devise_token_auth

run migrations on server: bundle exec rake RAILS_ENV=production db:migrate DISABLE_DATABASE_ENVIRONMENT_CHECK=1

toupeira commented 7 years ago

Hmm we don't really do anything to the default Capistrano Rails tasks, and RAILS_ENV should always be set consistently during all Capistrano tasks.

Can you check the environment in your ar_internal_metadata table on the server? It's possible that you ran migrations once with a different RAILS_ENV, which then got stored in that table.

domicode commented 7 years ago

[{"key"=>"environment", "value"=>"production", "created_at"=>"2017-06-28 15:34:25.812474", "updated_at"=>"2017-06-28 15:34:25.812474"}]

so should be okay

toupeira commented 7 years ago

Can you send me the Capistrano output and the link to the repository? (on Rocket.Chat if it's sensitive :))