Sha256: 8b3826e8656b18cd59b1b331944fb0ba4a285a61701e8f8baef25fd70c21293a

Contents?: true

Size: 642 Bytes

Versions: 6

Compression:

Stored size: 642 Bytes

Contents

require 'sequel/extensions/migration'

module Legion
  module Extensions
    module Data
      class Migrator < Sequel::IntegerMigrator
        def initialize(path, extension, **)
          @path = path
          @extension = extension
          super(Legion::Data::Connection.sequel, path)
        end

        def default_schema_column
          :schema_version
        end

        def default_schema_table
          :extensions
        end

        def schema_dataset
          Legion::Data::Connection.sequel.from(default_schema_table).where(namespace: @extension)
        end
        alias ds schema_dataset
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
legionio-0.4.3 lib/legion/extensions/data/migrator.rb
legionio-0.4.2 lib/legion/extensions/data/migrator.rb
legionio-0.4.1 lib/legion/extensions/data/migrator.rb
legionio-0.4.0 lib/legion/extensions/data/migrator.rb
legionio-0.3.2 lib/legion/extensions/data/migrator.rb
legionio-0.3.1 lib/legion/extensions/data/migrator.rb