Class: Migreazy::Action::Down
- Inherits:
-
Migreazy::Action
- Object
- Migreazy::Action
- Migreazy::Action::Down
- Defined in:
- lib/migreazy.rb
Instance Method Summary collapse
Methods inherited from Migreazy::Action
Constructor Details
This class inherits a constructor from Migreazy::Action
Instance Method Details
#run ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/migreazy.rb', line 75 def run missing_in_branch = @source1.migrations - @source2.migrations if missing_in_branch.empty? puts "No down migrations to run" else missing_in_branch.sort.reverse.each do |version| cmd = "rake db:migrate:down VERSION=#{version}" puts cmd output = `#{cmd}` puts output end end end |