Sha256: c9cb6da64d45cc36b5bc41ba78bfc80817b0c72bc6c8c636518ae3d21a914c1e
Contents?: true
Size: 907 Bytes
Versions: 6
Compression:
Stored size: 907 Bytes
Contents
# frozen_string_literal: true require "hanami/cli" require "snowpack/cli/application/command" require_relative "structure/dump" require_relative "utils/database" module Snowpack module CLI module Application module Commands module DB class Version < Command desc "Print schema version" option :target, desc: "Target migration number", aliases: ["-t"] def call(target: nil, **) migration = database.applied_migrations.last version = migration ? File.basename(migration, ".*") : "not available" out.puts "=> current schema version is #{version}" end private def database @database ||= Utils::Database.for_application(application) end end end register "db version", DB::Version end end end end
Version data entries
6 entries across 6 versions & 1 rubygems