lib/capistrano-db-rollback.rb in capistrano-db-rollback-0.1.0 vs lib/capistrano-db-rollback.rb in capistrano-db-rollback-0.1.1
- old
+ new
@@ -1,16 +1,18 @@
configuration = Capistrano::Configuration.respond_to?(:instance) ?
Capistrano::Configuration.instance(:must_exist) :
Capistrano.configuration(:must_exist)
configuration.load do
- namespace :rollback do
- desc <<-DESC
- Rollbacks 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'`"
+ 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
- after "deploy:rollback","deploy:rollback:migrations"
end
end