Class: Hanami::CLI::Commands::Destroy::Migration Private

Inherits:
Command
  • Object
show all
Defined in:
lib/hanami/cli/commands/destroy/migration.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.

Since:

  • 1.1.0

Instance Method Summary collapse

Methods inherited from Command

inherited, #initialize

Constructor Details

This class inherits a constructor from Hanami::CLI::Commands::Command

Instance Method Details

#call(migration:, **options) ⇒ 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.

Since:

  • 1.1.0



18
19
20
21
22
23
24
25
26
27
# File 'lib/hanami/cli/commands/destroy/migration.rb', line 18

def call(migration:, **options)
  migration   = Utils::String.underscore(migration)
  context     = Context.new(migration: migration, options: options)
  context     = context.with(destination: project.find_migration(context))

  assert_valid_migration!(context)

  destroy_migration(context)
  true
end