diff --git a/db/migrate/20190731114016_change_importer_and_exporter_to_polymorphic.rb b/db/migrate/20190731114016_change_importer_and_exporter_to_polymorphic.rb index a409f2d9..8fb5b9b0 100644 --- a/db/migrate/20190731114016_change_importer_and_exporter_to_polymorphic.rb +++ b/db/migrate/20190731114016_change_importer_and_exporter_to_polymorphic.rb @@ -6,7 +6,12 @@ class Entry < ApplicationRecord class ChangeImporterAndExporterToPolymorphic < ActiveRecord::Migration[5.1] def change - remove_foreign_key :bulkrax_entries, column: :importer_id if foreign_key_exists?(:bulkrax_entries, column: :importer_id) + begin # deal with odd bug around foreign keys in ci + remove_foreign_key :bulkrax_entries, column: :importer_id if foreign_key_exists?(:bulkrax_entries, column: :importer_id) + rescue ArgumentError + # do nothing + end + remove_index :bulkrax_entries, :importer_id if index_exists?(:bulkrax_entries, :importer_id) rename_column :bulkrax_entries, :importer_id, :importerexporter_id if column_exists?(:bulkrax_entries, :importer_id) add_column :bulkrax_entries, :importerexporter_type, :string, after: :id, default: 'Bulkrax::Importer' unless column_exists?(:bulkrax_entries, :importerexporter_type)