Class: Migr8::Actions::UpAction

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

Constant Summary collapse

NAME =
"up"
DESC =
"apply next migration"
OPTS =
[
  "-n N : apply N migrations",
  "-a   : apply 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



1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
# File 'lib/migr8.rb', line 1704

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