Sha256: 77b55e0f2b80ddaf2c029716d1025c64cd45410e57ed8310f55ce1b56af7e163

Contents?: true

Size: 669 Bytes

Versions: 8

Compression:

Stored size: 669 Bytes

Contents

# frozen_string_literal: true

require_relative "../../application"
require_relative "structure/dump"

module Hanami
  module CLI
    module Commands
      module Monolith
        module DB
          class CreateMigration < Application
            desc "Create new migration file"

            argument :name, desc: "Migration file name"

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

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hanami-cli-2.0.0.alpha8.1 lib/hanami/cli/commands/monolith/db/create_migration.rb
hanami-cli-2.0.0.alpha8 lib/hanami/cli/commands/monolith/db/create_migration.rb
hanami-cli-2.0.0.alpha7 lib/hanami/cli/commands/monolith/db/create_migration.rb
hanami-cli-2.0.0.alpha6.1 lib/hanami/cli/commands/monolith/db/create_migration.rb
hanami-cli-2.0.0.alpha6 lib/hanami/cli/commands/monolith/db/create_migration.rb
hanami-cli-2.0.0.alpha4 lib/hanami/cli/commands/monolith/db/create_migration.rb
hanami-cli-2.0.0.alpha3 lib/hanami/cli/commands/monolith/db/create_migration.rb
hanami-cli-2.0.0.alpha2 lib/hanami/cli/commands/monolith/db/create_migration.rb