Class: Hanami::CLI::Commands::App::DB::Version Private
- Inherits:
-
Command
- Object
- Dry::CLI::Command
- Hanami::CLI::Command
- Command
- Command
- Hanami::CLI::Commands::App::DB::Version
- Defined in:
- lib/hanami/cli/commands/app/db/version.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 Attribute Summary
Attributes inherited from Command
#system_call, #test_env_executor
Instance Method Summary collapse
-
#call(app: false, slice: nil, gateway: nil) ⇒ Object
private
rubocop:disable Layout/LineLength.
Methods inherited from Command
#initialize, #nested_command?, #run_command
Methods inherited from Command
#app, #inflector, inherited, #measure, #run_command
Methods inherited from Hanami::CLI::Command
Constructor Details
This class inherits a constructor from Hanami::CLI::Commands::App::DB::Command
Instance Method Details
#call(app: false, slice: nil, gateway: nil) ⇒ 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.
rubocop:disable Layout/LineLength
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/hanami/cli/commands/app/db/version.rb', line 16 def call(app: false, slice: nil, gateway: nil, **) databases(app: app, slice: slice, gateway: gateway).each do |database| unless database.migrations_dir? relative_migrations_path = database.migrations_path.relative_path_from(database.slice.app.root) out.puts "=> Cannot find version for database #{database.name}: no migrations directory at #{relative_migrations_path}/" return end migration = database.applied_migrations.last version = migration ? File.basename(migration, ".*") : "not available" out.puts "=> #{database.name} current schema version is #{version}" end # rubocop:enable Layout/LineLength end |