-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema-4.5 cleanup. (DOI model) #1111
Conversation
c3eb8b4
to
467a13b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - one question about the impact of the audit change, but it's non-blocking to merge
@@ -5,7 +5,7 @@ | |||
|
|||
class Doi < ApplicationRecord | |||
PUBLISHER_JSON_SCHEMA = "#{Rails.root}/app/models/schemas/doi/publisher.json" | |||
audited only: %i[doi url creators contributors titles publisher publisher_obj publication_year types descriptions container sizes formats version_info language dates identifiers related_identifiers related_items funding_references geo_locations rights_list subjects schema_version content_url landing_page aasm_state source reason] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will removing this remove historical data about changes to the field from the activities
table/index/endpoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question. Deleting the field name from that line just tells the audit module (activities) to not record changes for that field. It won't erase historical data for publisher or leave those changes out of a call to /activities.
Changes are kept in the audited_changes column of the audits table. For reporting changes, activities just grabs audited_changes, but doesn't care what is in it. For recording changes, the publisher column will be gone, so of course we don't need it recorded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good
Purpose
Related to: Issue #1016, PR#1112
Approach
STEP 1 - This PR which obsoletes the publisher column from the database by making it an active record virtual attribute. To preserve backward compatibility, 'publisher' is still accepted by the API as either a string or a hash, but is saved to the DB or read from the DB as publisher_obj. Also, the API publisher='true' flag still works as documented to return either a string or hash in the response.
STEP 2 - A second PR (PR#1112) which has the rake task to remove the publisher column from the DB, and contains the new schema.rb file.
Open Questions and Pre-Merge TODOs
Learning
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
Reviewer, please remember our guidelines: