Reputation: 5355
Can't seem to find anything definitive here. When I 'cap deploy' my app, I am getting my files pushed over OK. However, the db is not being migrated. If I manually go to /myapp/current and run 'rake db:migrate' (should I have to do this?) the it creates db/development.sqlite which leads me to beleive my environment is set to dev. I have tried setting both set :deploy_env, "production" and set :rails_env, "production" in my delopy.rb file with no change. Any help appreciated.
PS Would be nice if I could add the migration as a part of the deploy, rather than have to manually do it.
Upvotes: 0
Views: 243
Reputation: 771
Maybe you are missing require 'capistrano/rails/migrations'
in your Capfile?
Upvotes: 0
Reputation: 3726
Assuming capistrano 2.x try cap deploy:migrations
to deploy and migrate the database.
You can also use cap deploy:migrate
to run migrations in recently deployed application.
Take a look at capistrano wiki for more details: https://github.com/capistrano/capistrano/wiki/Capistrano-Tasks
Upvotes: 2
Reputation: 9045
Use cap db:migrate
in order to run your migrations with Capistrano. As far as the environment is concerned, Multistage Extension could be really helpful.
Upvotes: 1