Sha256: 4785eecccbe613ced7c1134e4d87b698d9d7573c4295c3cc042ec6facc80452f

Contents?: true

Size: 532 Bytes

Versions: 2

Compression:

Stored size: 532 Bytes

Contents

namespace :deploy do
  desc "Migrate database if has migration"
  task :migrate, :roles => :db, :on_no_matching_servers => :continue, :only => {:primary => true}, :except => { :no_release => true } do
    return if ENV['MIGRATE_SKIP']

    if find_servers_for_task(current_task).any?
      CapistranoRailsRecipes::Util.ensure_changed_remote_dirs(self, "db/migrate") do
        run "cd #{release_path} && #{fetch :rake} RAILS_ENV=#{rails_env} db:migrate"
      end
    end
  end
end

after "deploy:finalize_update", "deploy:migrate"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capistrano_rails_recipes-0.1.23 lib/capistrano_rails_recipes/recipes/migrate.rb
capistrano_rails_recipes-0.1.22 lib/capistrano_rails_recipes/recipes/migrate.rb