Class: Hanami::CLI::Commands::App::DB::CreateMigration Private

Inherits:
Command show all
Defined in:
lib/hanami/cli/commands/app/db/create_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:

  • 2.0.0

Constant Summary

Constants inherited from Command

Command::ACTION_SEPARATOR

Instance Method Summary collapse

Methods inherited from Command

#app, #database, #database_config, inherited, #measure, #run_command

Methods inherited from Hanami::CLI::Command

#initialize, new

Constructor Details

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

Instance Method Details

#call(name:) ⇒ 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:

  • 2.0.0



19
20
21
22
23
24
25
26
# File 'lib/hanami/cli/commands/app/db/create_migration.rb', line 19

def call(name:, **)
  migrator = database.migrator
  version = migrator.generate_version

  measure "migration #{version}_#{name} created" do
    migrator.create_file(name, version)
  end
end