Sha256: cda9445892fca5f9ef04c5816ffebd03537b968c49eda8b1adab4cb672385d7b

Contents?: true

Size: 786 Bytes

Versions: 27

Compression:

Stored size: 786 Bytes

Contents

class RenameBulkraxImporterRunToImporterRun < ActiveRecord::Migration[5.1]
  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

27 entries across 27 versions & 1 rubygems

Version Path
bulkrax-9.0.2 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-9.0.1 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-9.0.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-8.2.3 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-8.2.2 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-8.3.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-8.2.1 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-8.2.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-8.1.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-8.0.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-7.0.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-5.5.1 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-5.4.2 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-5.3.1 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-6.0.1 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-6.0.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-5.5.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-5.4.1 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-5.4.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
bulkrax-5.3.0 db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb