Class: Migr8::Actions::DownAction

Inherits:
Action
  • Object
show all
Defined in:
lib/migr8.rb

Constant Summary collapse

NAME =
"down"
DESC =
"unapply current migration"
OPTS =
[
  "-n N  : unapply N migrations",
  "--ALL : unapply all migrations",
]
ARGS =
nil

Instance Method Summary collapse

Methods inherited from Action

#cmdopterr, find_by_name, #get_command, inherited, #parse, #parser, #repository, #short_usage, subclasses, #usage

Instance Method Details

#run(options, args) ⇒ Object



1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
# File 'lib/migr8.rb', line 1729

def run(options, args)
  n = 1
  if options['n']
    n = options['n'].to_i
  elsif options['ALL']
    n = nil
  end
  #
  op = RepositoryOperation.new(repository())
  _wrap do
    op.downgrade(n)
  end
end