Skip to content
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

[Outreachy Round 27] Add references and references_previous fields to Revisions table #5567

Conversation

gabina
Copy link
Member

@gabina gabina commented Dec 28, 2023

What this PR does

This PR is part of the "Improve how Wiki Education Dashboard counts references added" project (read issue #5547).

The purpose of this PR is to add two new (integer) fields to the Revisions table:

  • references: to store the number of references existing in a given revision id (AddReferencesToRevision class)
  • references_previous: to store the number of references existing in the previous revision id (AddReferencesPreviousToRevision class)

This PR also provides a new regenerated erd.pdf file, and updates annotations on revision models and factories to reflect the changes.

Changes in app/models/wiki_content/revision.rb, spec/models/revision_spec.rb, and spec/factories/revisions.rb were automatically done by running annotate --models.

Open questions and concerns

  • Notice that these new two fields will replace features and features_previous ones. We will need to remove them in the future (as well as all code related to them).
  • db/schema.rb was automatically modified when running the migration locally, but manually modified after that, as some changes looked incorrect.

@gabina gabina changed the title [WIP] [Outreachy Round 27] Add references and references_previous fields to Revisions table [Outreachy Round 27] Add references and references_previous fields to Revisions table Jan 2, 2024
@ragesoss
Copy link
Member

ragesoss commented Jan 2, 2024

@gabina If possible, I would like to re-use the existing fields rather than adding these ones and removing the features and features_previous ones. Those features columns are serialized hashes, so they are flexible enough to hold the references counts for new data while co-existing with the features data from already-present revisions in the production database.

@gabina
Copy link
Member Author

gabina commented Jan 2, 2024

@gabina If possible, I would like to re-use the existing fields rather than adding these ones and removing the features and features_previous ones. Those features columns are serialized hashes, so they are flexible enough to hold the references counts for new data while co-existing with the features data from already-present revisions in the production database.

Yes, sure. In that case, I'm closing this PR as it won't be necessary.

@gabina gabina closed this Jan 2, 2024
@gabina gabina deleted the 5547-outreachy-round-27-update-revisions-models-to-have-new-references-fields branch May 14, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants