Class: Migr8::Actions::UnapplyAction
Constant Summary collapse
- NAME =
"unapply"- DESC =
"unapply specified migrations"- OPTS =
["-x: unapply versions with down-script in DB, not in file"]
- ARGS =
"version ..."
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
1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 |
# File 'lib/migr8.rb', line 1800 def run(, args) only_in_db = ['x'] ! args.empty? or raise cmdopterr("#{NAME}: version required.") # versions = args repo = repository() op = RepositoryOperation.new(repo) _wrap do if only_in_db op.unapply_only_in_database(versions) else op.unapply(versions) end end end |