Sha256: 65806a3b5ee843dd35717b222e5811cf9d750428e96429c21dc4c3ced858662c

Contents?: true

Size: 675 Bytes

Versions: 15

Compression:

Stored size: 675 Bytes

Contents

module Hanami
  class CLI
    module Commands
      module Db
        # @since 1.1.0
        # @api private
        class Create < Command
          requires "model.configuration"

          desc "Create the database (only for development/test)"

          # @since 1.1.0
          # @api private
          def call(**options)
            context = Context.new(options: options)

            create_database(context)
          end

          private

          # @since 1.1.0
          # @api private
          def create_database(*)
            require "hanami/model/migrator"
            Hanami::Model::Migrator.create
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
hanami-1.3.5 lib/hanami/cli/commands/db/create.rb
hanami-1.3.4 lib/hanami/cli/commands/db/create.rb
hanami-1.3.3 lib/hanami/cli/commands/db/create.rb
hanami-1.3.2 lib/hanami/cli/commands/db/create.rb
hanami-1.3.1 lib/hanami/cli/commands/db/create.rb
hanami-1.3.0 lib/hanami/cli/commands/db/create.rb
hanami-1.3.0.beta1 lib/hanami/cli/commands/db/create.rb
hanami-1.2.0 lib/hanami/cli/commands/db/create.rb
hanami-1.2.0.rc2 lib/hanami/cli/commands/db/create.rb
hanami-1.2.0.rc1 lib/hanami/cli/commands/db/create.rb
hanami-1.2.0.beta2 lib/hanami/cli/commands/db/create.rb
hanami-1.2.0.beta1 lib/hanami/cli/commands/db/create.rb
hanami-1.1.1 lib/hanami/cli/commands/db/create.rb
hanami-1.1.0 lib/hanami/cli/commands/db/create.rb
hanami-1.1.0.rc1 lib/hanami/cli/commands/db/create.rb