Update of the collection information is incomplete when a collection of a former import is deleted in the METS-File
Description
Updating the collection information in the database is sucessful for adding new collections - but failed in the perspective of deleting, when a collection of a former import is deleted in the METS-File.
Reproduction
Steps to reproduce the behaviour:
- Deleting a collection in Kitodo.Production with an export of the METS-File
- Import/Indexing the METS-File in Kitodo.Presentation
Expected Behavior
The Database of Kitodo.Presentation shows the current state of the METS-File regarding chosen collections.
Screenshots and Examples
We had to manage a change of name for an institution from "Behörde für Gesundheit und Verbraucherschutz, Institut für Hygiene und Umwelt - Bibliothek" to "Institut für Hygiene und Umwelt - Bibliothek"
The METS-File is corrected:

The former entry for the name has not been deleted:

Environment
- OS version: Debian Linux 4.19 (Host Europe/effective webwork)
- RDBMS version: MySQL 5.5.5
- Apache Solr version: 7.4.0
- TYPO3 version: 8.7.25
- PHP version: 7.1.33
Thank you for your detailed report.
We know this behaviour. This is in our opinion in conflict with the feature to create collections manually in Kitodo.Presentation.
These manually added collections may be assigned to existing documents. If a document gets updated, new collections are added. But we cannot distinguish if additional collections in the document record are added manually or are from older index processes.
That's why. If you or someone else has a good idea to solve this - let me know!
Would it be possible to choose one option actively by configuration? Maybe for most institutions it is an "either-or" and and and not a "both" option? In the end it can be decided, if collections are deleted automatically or not.
@subhhwendt: If one collection is not used anymore completely, all the references in Kitodo.Production are deleted, if the collection is deleted, It is annoying, when collections have to be deleted only in specific documents.