Class: Brut::CLI::Apps::DB::Rebuild

Inherits:
Command
  • Object
show all
Defined in:
lib/brut/cli/apps/db.rb

Instance Method Summary collapse

Methods inherited from Command

#after_bootstrap, args, #args, #before_execute, command_name, default_env, #delegate_to_commands, description, detailed_description, env_var, #err, #global_options, #initialize, name_matches?, option_parser, #options, opts, #out, requires_project_env, requires_project_env?, #system!

Methods included from Framework::Errors

#abstract_method!, #bug!

Methods included from I18n::ForCLI

#capture, #html_escape, #safe

Methods included from I18n::BaseMethods

#l, #t, #t_direct, #this_field_value

Methods included from ExecutionResults

#abort_execution, #as_execution_result, #cli_usage_error, #continue_execution, #show_cli_usage, #stop_execution

Constructor Details

This class inherits a constructor from Brut::CLI::Command

Instance Method Details

#executeObject



62
63
64
# File 'lib/brut/cli/apps/db.rb', line 62

def execute
  delegate_to_commands(Drop, Create, Migrate)
end

#handle_bootstrap_exception(ex) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/brut/cli/apps/db.rb', line 47

def handle_bootstrap_exception(ex)
  case ex
  when Sequel::DatabaseConnectionError
    continue_execution
  when Sequel::DatabaseError
    if ex.cause.kind_of?(PG::UndefinedTable)
      continue_execution
    else
      super
    end
  else
    super
  end
end