Module: DohDb::Migrate

Defined in:
lib/dohmysql/migrate/options.rb

Constant Summary collapse

COMMAND_INFO =
[
['make', '<name>', 'creates the files for a new migration'],
['check', '<name>', 'checks that all migrations are valid'],
['commit', '<name>', 'UNIMPLEMENTED: executes the check command, then git add,commit'],
['apply', '<name>', 'applies one or more migrations'],
['revert', '<name>', 'reverts one or more migrations'],
['verify' ,'<name>', 'verifies that the migration has been integrated into the base files'],
['merge', '<name>', 'UNIMPLEMENTED: executes the verify command, then git rm,commit'],
].freeze
COMMANDS =
COMMAND_INFO.collect {|name, args, desc| name}.freeze
NOTIFY_COMMANDS =
%w(apply revert)
OPTS =
Doh::Options.new(
{'database' => [Doh.config[:default_database], "-d", "--database <database>", "name of the database to migrate -- defaults to config[:default_database], currently '#{Doh.config[:default_database]}'"] \
, 'runafter' => [false, "-a", "--after", "for migrate make, creates the migrations designed to be run after a deploy (defaults to before)"] \
}, true, "Commands:\n\n#{cmd_detail}")

Class Method Summary collapse

Class Method Details

.cmd_name_and_argsObject



37
38
39
# File 'lib/dohmysql/migrate/options.rb', line 37

def self.cmd_name_and_args
  [OPTS, CMD_NAME, CMD_ARGS]
end