Data fix for wrongly deleted document headers #1048
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://eaflood.atlassian.net/browse/WATER-4627
We received a report that an external user was unable to link MD/054/0009/047 to their account (it returned the error "We cannot find these licence numbers"). We reproduced the issue in pre-prod and tracked down the cause.
When you add a licence number, the legacy code runs this query to pull it from
CRM.document_headers
.On 2023-10-03 the water-abstraction-import marked the
crm.document_header
record as deleted. This is a step in the import process where it checks for deleted 'document'.The knowledge of why the query didn't see this licence in the NALD data on that date is now lost to the universe! However, we can clearly see that the licence has a record in NALD, so it shouldn't have been picked up.
We've checked if others are affected, and fortunately, only 5 licences have a populated
date_deleted
though they have a matching record in the NALD data.This change adds a migration data fix to reset the
date_deleted
tonull
for the 5 affected licences.