Closed Bug 1599377 Opened 6 years ago Closed 4 years ago

Mark translations as "deleted" instead of actually removing them

Categories

(Webtools Graveyard :: Pontoon, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED MOVED

People

(Reporter: adrian, Unassigned)

Details

At the moment, when we want to hide a translation from the UI and API, we delete it from the database. Because we still need to know that something changed on the associated entity, project and locale, we created the ChangedEntityLocale table.

If, instead of deleting the entry, we marked it as deleted, we could do without that table. It would also simplify some of our existing relationships, and would avoid the loss of some data due to links with the translation table.

Doing this however means we will need to rework our queries to the Translation table to exclude deleted translations.

I don't think the quantity of data that this will add will be worrisome but we should still keep that in mind and monitor the size of our table.

Steps

  1. Add a deleted boolean field to the Translation model.
  2. Replace all queries to the Translation table to exclude deleted=True. Add tests to verify that behavior.
  3. Update the delete_translation method to mark as deleted.
  4. Update ActionLog's translation:deleted action to link to the translation instead of entity/locale couple.
  5. Update code that uses the ChangedEntityLocale table to rely on the Translation table instead.
  6. Remove the ChangedEntityLocale table.
*This bug has been moved to GitHub.* *Please check it out on https://github.com/mozilla/pontoon/issues.*
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → MOVED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.