a) Raw item in
b) We make normalised item id="Id290"
c) Raw item updated, set normalised=FALSE
d) normalised item id="id290" is now Stale, and the checks on it are Stale too?
e) normalise process updates normalised item which delete check results, so now it's ok
Worst:
a) Raw item in
b) We make normalised item id="Id290"
c) Raw item updated, set normalised=FALSE
d) We renormalise, but now the id of the item is "id952"
d) normalised item id="id290" still exists in the DB, and won't be deleted!
I think when we update a raw item, we have to look for any normalised items created from it and mark them as deleted and delete any profile checks from them.
Otherwise:
a) Raw item in b) We make normalised item id="Id290" c) Raw item updated, set normalised=FALSE d) normalised item id="id290" is now Stale, and the checks on it are Stale too? e) normalise process updates normalised item which delete check results, so now it's ok
Worst:
a) Raw item in b) We make normalised item id="Id290" c) Raw item updated, set normalised=FALSE d) We renormalise, but now the id of the item is "id952" d) normalised item id="id290" still exists in the DB, and won't be deleted!
I think when we update a raw item, we have to look for any normalised items created from it and mark them as deleted and delete any profile checks from them.