Sha256: 3b1479b465b765fbc369a2e1c2e963910c4fb1027d60205af61bd1802adc6b5d

Contents?: true

Size: 596 Bytes

Versions: 24

Compression:

Stored size: 596 Bytes

Contents

module Hanami
  module Model
    # Database migration
    #
    # @since 0.7.0
    # @api private
    class Migration
      # @since 0.7.0
      # @api private
      attr_reader :gateway

      # @since 0.7.0
      # @api private
      attr_reader :migration

      # @since 0.7.0
      # @api private
      def initialize(gateway, &block)
        @gateway = gateway
        @migration = gateway.migration(&block)
        freeze
      end

      # @since 0.7.0
      # @api private
      def run(direction = :up)
        migration.apply(gateway.connection, direction)
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
hanami-model-1.3.2 lib/hanami/model/migration.rb
hanami-model-1.3.1 lib/hanami/model/migration.rb
hanami-model-1.3.0 lib/hanami/model/migration.rb
hanami-model-1.3.0.beta1 lib/hanami/model/migration.rb
hanami-model-1.2.0 lib/hanami/model/migration.rb
hanami-model-1.2.0.rc2 lib/hanami/model/migration.rb
hanami-model-1.2.0.rc1 lib/hanami/model/migration.rb
hanami-model-1.2.0.beta2 lib/hanami/model/migration.rb
hanami-model-1.2.0.beta1 lib/hanami/model/migration.rb
hanami-model-1.1.0 lib/hanami/model/migration.rb
hanami-model-1.1.0.rc1 lib/hanami/model/migration.rb
hanami-model-1.0.4 lib/hanami/model/migration.rb
hanami-model-1.0.3 lib/hanami/model/migration.rb
hanami-model-1.1.0.beta3 lib/hanami/model/migration.rb
hanami-model-1.1.0.beta2 lib/hanami/model/migration.rb
hanami-model-1.1.0.beta1 lib/hanami/model/migration.rb
hanami-model-1.0.2 lib/hanami/model/migration.rb
hanami-model-1.0.1 lib/hanami/model/migration.rb
hanami-model-1.0.0 lib/hanami/model/migration.rb
hanami-model-1.0.0.rc1 lib/hanami/model/migration.rb