Eugene
Eugene

Reputation: 689

No migration at deploy

I have simple question. My app at deploy dont't start rake db:migrate at production env. I Did not create deploy.rb I got it already prepared. deploy.rb is working, but command 'deploy:migrate' don't work. I don't know, how correctly ask this question. But I think this problem with :role. Maybe rake db:migrate need to describe? Like this:

namespace :db do

  desc "Rake migration"
    task :migrate, :roles => :db do
      run "cd #{current_path} && #{rake} RAILS_ENV=production db:migrate"
    end
  end

end

Upvotes: 0

Views: 313

Answers (1)

smathy
smathy

Reputation: 27971

I'm not sure if I've understood your question...

There is already a deploy:migrate task defined as part of capistrano, which you just have to add a hook for in your deploy.rb and it will run. See this answer for details on doing that.

You shouldn't need the code you've defined above, but if you do then note that you aren't defining deploy:migrate you're defining db:migrate.

Upvotes: 1

Related Questions