Introduce Soft deletion across core collections
See #48 for initial discussion
At the moment, only some collections support soft deletion, I think we should enforce this basically to almost all collections which have to live long and are referenced in orders, like:
Countries Languages Currencies Assortments Users
And at the same time, introduce a general inconsistency cleaning job, which tries to wipe unreferenced or deleted items of all kinds from the database:
- Old Products that are not referenced in any important record (treshhold controlled)
- Old Assortments that are not referenced in any important record (treshhold controlled)
- ProductVariations, ProductMedia, Media
- AssortmentTexts, AssortmentProducts, AssortmentLinks
- Bookmarks, Filters, Credentials
Users (this will be hard but important): Will have to move the referenced items to a "trash user" or completely anonymize the user for archival purposes? This also depends on laws in europe (right to forget)
More important than I though, just ran into an issue where the removal of a currency made price queries crashing
- [x] Currently Assortments have no deletion flags, should they have?
- [x] Users don’t support deletion, another issue
Partly implemented, see above, so we postponed this to Unchained 2.0
Assortments should have a deletion flag too because of the slug they occupy, it's not cool to have old links error just because assortment tree has been manipulated.
We already remove product and assortment linked data including images with the zombie-killer in the newest version, what is still missing though is a function that completely removes old products and assortments that have been deleted a while ago but that is only possible to a great extent when historic orders are removed too and that's up to the project to implement that.
So what is still left is:
At the moment, only some collections support soft deletion, I think we should enforce that basically to almost all collections which have to live long and are referenced in orders, like:
- [x] Assortments