Sha256: 7b90f67040922b77dfc7060c0d805eac258beb85d0555e9cae2df12fca3c30c6

Contents?: true

Size: 728 Bytes

Versions: 3

Compression:

Stored size: 728 Bytes

Contents

configuration = Capistrano::Configuration.respond_to?(:instance) ?
  Capistrano::Configuration.instance(:must_exist) :
  Capistrano.configuration(:must_exist)

configuration.load do
  namespace :deploy do    
    namespace :rollback do
      desc <<-DESC
      Rolls back the migration to the version found in schema.rb file of the previous release path.\
      Uses sed command to read the version from schema.rb file.
      DESC
      task :migrations do
        run "cd #{current_release};  rake db:migrate RAILS_ENV=#{rails_env} VERSION=`grep \":version =>\" #{previous_release}/db/schema.rb | sed -e 's/[a-z A-Z = \> \: \. \( \)]//g'`"
      end
      after "deploy:rollback","deploy:rollback:migrations"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capistrano-db-rollback-0.1.3 lib/capistrano-db-rollback.rb
capistrano-db-rollback-0.1.2 lib/capistrano-db-rollback.rb
capistrano-db-rollback-0.1.1 lib/capistrano-db-rollback.rb