Add edition_id
to link check reports
#9986
Draft
+20
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds
edition_id
association to Link Checker Reports. We'll run the migration and then remove the oldlink_reportable_type
/link_reportable_id
fields which are an unnecessary layer of abstraction.The polymorphic association was added in November 2017 with no explanation: 03c4734
Since then, there doesn't seem to have been a single link check report which is associated with anything other than an Edition:
Therefore let's remove the obtuse reference and make it clear
that a link check report is associated with an edition (not a
'linkable'). This should also cut down on quite a lot of DB space,
since we're currently storing the word "Edition" on every single
link check report (almost 12 million rows in the DB).
Loosely related to https://trello.com/c/tmnht4P1/
Follow these steps if you are doing a Rails upgrade.