Skip to content

Upgrading to Version 3.0

Benjamin Kiah Stroud edited this page May 18, 2022 · 2 revisions

Database Changes

  • New table Pending Relationships
  • column name changes in the Importer Runs table

Please run db:migrate to ensure that these changes get added to your database

** If you were using our beta releases you may need to revert/drop the pending_relationships table before running db:migrate

Code changes to be aware of for overrides

ObjectFactory

  • The initialization arguments have been changed, collection_field_mapping is no longer accepted and importer_run_id is a new argument
  • The create_attributes and attribute_update methods have been removed please use transform_attributes instead.
  • Collection membership is no longer handled in the object factory. The create relationships job and new pending relationships object handle them now.
    • Related to this, :member_of_collections_attributes has been removed from Bulkrax::ObjectFactory#permitted_attributes. If you overrode the #permitted_attributes method, please remove :member_of_collections_attributes from it.

Views

  • New Pending icon
  • Collections column has been removed from the importer/exporter show view.

Entries

  • The self.data_for_entry method now takes in a third parameter 'parser'
  • The collection_field method is now parent_field
  • In general, the CSV parser has changed drastically and overrides will likely have to be carefully updated and in some cases completely rewritten.

Parsers

  • The self.data_for_entry method in the entry model now takes in a third parameter 'parser'. This method is usually called from parsers so make sure the method calls in your custom parsers are updated.

Importer

  • 3 methods: import_works, import_collections, and import_file_sets have now been combined into one method import_objects. The original methods can still be called, but they just redirect to the new method.

Jobs

  • CreateRelationshipsJob has been completely rewritten to use the new PendingRelationship models
  • ScheduleRelationshipsJob is now the only thing that calls the CreateRelationshipsJob

Dynamic Record Lookup

  • The find_record method can now take an importer run id to further specify which entry to retrieve.
  • The find_record method now returns an array of two objects [ Entry, ActiveFedora Object ]