Merge - ensure location entities remaining on deleted contacts have is_primary integrity
The testing I'm doing for #2039 (closed) highlights that when a contact is deleted by merge they can be left with 1 or more address/email etc but none marked primary,
I thought about fixing the test to exclude deleted contacts but
- if they are undeleted again then the integrity is not fixed
- having integrity on all contacts makes it a bit easier to check for integrity (ie the query in the test is faster than once we start filtering out deleted contacts)
I've started on some preparatory cleanup
https://github.com/civicrm/civicrm-core/pull/18499 https://github.com/civicrm/civicrm-core/pull/18500