Sha256: 60f7c77770c27ffa7b1d1c99f67a3a95bee2fe7e347a953d6f705dbcd43db1ca

Contents?: true

Size: 786 Bytes

Versions: 10

Compression:

Stored size: 786 Bytes

Contents

class RenameBulkraxImporterRunToImporterRun < ActiveRecord::Migration[5.2]
  def up
    if column_exists?(:bulkrax_pending_relationships, :bulkrax_importer_run_id)
      remove_foreign_key :bulkrax_pending_relationships, :bulkrax_importer_runs
      remove_index :bulkrax_pending_relationships, column: :bulkrax_importer_run_id

      rename_column :bulkrax_pending_relationships, :bulkrax_importer_run_id, :importer_run_id

      add_foreign_key :bulkrax_pending_relationships, :bulkrax_importer_runs, column: :importer_run_id
      add_index :bulkrax_pending_relationships, :importer_run_id, name: 'index_bulkrax_pending_relationships_on_importer_run_id'
    end
  end

  def down
    rename_column :bulkrax_pending_relationships, :importer_run_id, :bulkrax_importer_run_id
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bulkrax-4.3.1 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-4.3.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-4.2.1 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-4.2.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-4.1.1 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-4.1.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-4.0.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-3.5.1 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-3.5.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-3.4.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb