Class: Hanami::CLI::Commands::App::DB::Drop Private
- Inherits:
-
DB::Command
- Object
- DB::Command
- Hanami::CLI::Commands::App::DB::Drop
- Defined in:
- lib/hanami/cli/commands/app/db/drop.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
Instance Method Details
#call(app: false, slice: nil, gateway: nil, command_exit: method(:exit)) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/hanami/cli/commands/app/db/drop.rb', line 14 def call(app: false, slice: nil, gateway: nil, command_exit: method(:exit), **) exit_codes = [] databases(app: app, slice: slice, gateway: gateway).each do |database| result = database.exec_drop_command exit_codes << result.exit_code if result.respond_to?(:exit_code) if result == true || result.successful? out.puts "=> database #{database.name} dropped" else out.puts "=> failed to drop database #{database.name}" out.puts "#{result.err}\n" end end exit_codes.each do |code| break command_exit.(code) if code > 0 end re_run_development_command_in_test end |