Closed kkatemoffatt closed 10 months ago
Hi Kate,
I've removed 523 person records
There were 2 edge cases that I didn't remove since they had firm relationship. You can decide if they need to be keep or removed as desired.
https://womensprinthistoryproject.com/person/10962 https://womensprinthistoryproject.com/person/10964
Historical bookkeeping (you can ignore)
/* find records */
SELECT person.*
FROM person
LEFT JOIN title_role ON person.id = title_role.person_id
WHERE person.finalcheck IS FALSE
AND title_role.id IS NULL;
/* find edge cases records */
SELECT person.*
FROM person
LEFT JOIN title_role ON person.id = title_role.person_id
JOIN person_firm ON person.id = person_firm.person_id
WHERE person.finalcheck IS FALSE
AND title_role.id IS NULL;
/* remove records (minus edge cases) */
DELETE person
FROM person
LEFT JOIN title_role ON person.id = title_role.person_id
WHERE person.finalcheck IS FALSE
AND title_role.id IS NULL
AND person.id NOT IN (10962, 10964);
What isn’t working as expected on the website?
We would like to delete all person records that are 1) unverified AND 2) have no titles attached to them.
If you encountered an error message, please copy the relevant details or take a screenshot and paste it below.
N/A
What is the URL of the page where you encountered the bug?
N/A
What steps did you take before you encountered the bug?
N/A
What browser, operating system, and device were you using when you encountered the error?
N/A
Additional information
Here's an example of a person record that is unverified and has no titles attached, and should be deleted: https://womensprinthistoryproject.com/person/5612