]> git.evergreen-ils.org Git - working/Evergreen.git/commit
LP#1802166: (follow-up) document a way to clear names from already-purged patron...
authorGalen Charlton <gmc@equinoxinitiative.org>
Mon, 27 Jul 2020 14:51:37 +0000 (10:51 -0400)
committerChris Burton <cburton@nflibrary.ca>
Thu, 10 Sep 2020 16:01:35 +0000 (12:01 -0400)
commited6c4760e6d636e5b8e6a70982b27f600b3768ae
treeb86c60e232e7833831e5d56527797a1a8f49fc5b
parent6efe747e75760fd8d014dd2ecca2979c5b3e123f
LP#1802166: (follow-up) document a way to clear names from already-purged patron records

For reference, the following SQL will clear the preferred name
and name keyword fields from already-purged records:

UPDATE actor.usr
SET pref_prefix = NULL,
    pref_first_given_name = NULL,
    pref_second_given_name = NULL,
    pref_family_name = NULL,
    pref_suffix = NULL,
    name_keywords = NULL
WHERE usrname ~ ('^' || id || '-PURGED')
AND NOT active
AND deleted
AND (
    pref_prefix IS NOT NULL OR
    pref_first_given_name IS NOT NULL OR
    pref_second_given_name IS NOT NULL OR
    pref_family_name IS NOT NULL OR
    pref_suffix IS NOT NULL OR
    name_keywords IS NOT NULL
);

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
docs/RELEASE_NOTES_NEXT/Circulation/purge_usr_pref_names.adoc