Sha256: 871ce28b4168dbcbcb000ca5c445bd23446e96d441eb3f72f9a6485b2cc1bfd8

Contents?: true

Size: 624 Bytes

Versions: 44

Compression:

Stored size: 624 Bytes

Contents

module DataMigrate
  class LegacyMigrator
    def initialize(migrations_paths = "db/data")
      @migrations_paths = migrations_paths || "db/data"
    end

    def migrate
      dates =
        DataMigrate::DataMigrator.migrations(@migrations_paths).collect(&:version)
      legacy = ActiveRecord::SchemaMigration.where(version: dates)
      legacy.each do |v|
        begin
          version = v.version
          puts "Creating #{version} in data schema"
          DataMigrate::DataSchemaMigration.create(version: version)
        rescue ActiveRecord::RecordNotUnique
          nil
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
data_migrate-9.1.3 lib/data_migrate/legacy_migrator.rb
data_migrate-9.1.2 lib/data_migrate/legacy_migrator.rb
data_migrate-9.1.1 lib/data_migrate/legacy_migrator.rb
data_migrate-9.1.0 lib/data_migrate/legacy_migrator.rb
data_migrate-10.0.3.rc lib/data_migrate/legacy_migrator.rb
data_migrate-10.0.0.rc1 lib/data_migrate/legacy_migrator.rb
data_migrate-9.0.0 lib/data_migrate/legacy_migrator.rb
data_migrate-8.5.0 lib/data_migrate/legacy_migrator.rb
data_migrate-8.4.2 lib/data_migrate/legacy_migrator.rb
data_migrate-8.4.1 lib/data_migrate/legacy_migrator.rb
data_migrate-8.4.0 lib/data_migrate/legacy_migrator.rb
data_migrate-8.3.0 lib/data_migrate/legacy_migrator.rb
data_migrate-8.2.0 lib/data_migrate/legacy_migrator.rb
data_migrate-8.1.1 lib/data_migrate/legacy_migrator.rb
data_migrate-8.1.0 lib/data_migrate/legacy_migrator.rb
data_migrate-8.0.0 lib/data_migrate/legacy_migrator.rb
data_migrate-8.0.0.rc2 lib/data_migrate/legacy_migrator.rb
data_migrate-8.0.0.rc1 lib/data_migrate/legacy_migrator.rb
data_migrate-7.0.2 lib/data_migrate/legacy_migrator.rb
data_migrate-7.0.1 lib/data_migrate/legacy_migrator.rb