ENSCORESW-2744: remove dependent_xref when removing master
Created by: magaliruffier
Requirements
- Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion;
- Review the contributing guidelines for this repository; remember in particular:
- do not modify code without testing for regression
- provide simple unit tests to test the changes
- if you change the schema you must patch the test databases as well, see Updating the schema
- the PR must not fail unit testing
Description
Using one or more sentences, describe in detail the proposed changes. Remove all dependent_xref when the main xref is removed
Use case
Describe the problem. Please provide an example representing the motivation behind the need for having these changes in place. Before loading a new set of xrefs into the core database, existing xrefs from updated sources are removed from the core database. This is done source by source, meaning that dependent sources are only deleted if there is an update to that source. As their mapping depends on the master source, they should be removed at the same time.
Benefits
If applicable, describe the advantages the changes will have. If a dependent source is not updated but its master is, we do not end up with orphan entries. This also means we remove older mappings more regularly.
Possible Drawbacks
If applicable, describe any possible undesirable consequence of the changes. The query is not optimised and can take a while to run on the server. It also leaves the xref entries in the xref table as they can be dependent of multiple sources.
Testing
Have you added/modified unit tests to test the changes? This was tested on gorilla which failed last release due to a single PDB that was left as an orphan. It is left as an orphan before the code change but is cleanly removed with this update. This was also run on a hundred species to check for regression.
If so, do the tests pass/fail? The identified edge case is fixed and no new regressions are detected.
Have you run the entire test suite and no regression was detected? NA