4 SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
6 CREATE OR REPLACE FUNCTION actor.usr_delete(
11 old_profile actor.usr.profile%type;
12 old_home_ou actor.usr.home_ou%type;
13 new_profile actor.usr.profile%type;
14 new_home_ou actor.usr.home_ou%type;
16 new_dob actor.usr.dob%type;
19 id || '-PURGED-' || now(),
33 -- Quit if no such user
35 IF old_profile IS NULL THEN
39 perform actor.usr_purge_data( src_usr, dest_usr );
41 -- Find the root grp_tree and the root org_unit. This would be simpler if we
42 -- could assume that there is only one root. Theoretically, someday, maybe,
43 -- there could be multiple roots, so we take extra trouble to get the right ones.
50 permission.grp_ancestors( old_profile )
59 actor.org_unit_ancestors( old_home_ou )
63 -- Truncate date of birth
65 IF new_dob IS NOT NULL THEN
66 new_dob := date_trunc( 'year', new_dob );
73 profile = new_profile,
76 passwd = random()::text,
81 FROM config.identification_type
86 net_access_level = DEFAULT,
89 first_given_name = new_name,
90 second_given_name = NULL,
91 family_name = new_name,
98 mailing_address = NULL,
99 billing_address = NULL,
100 home_ou = new_home_ou,
103 master_account = DEFAULT,
104 super_user = DEFAULT,
109 claims_returned_count = DEFAULT,
110 credit_forward_balance = DEFAULT,
111 last_xact_id = DEFAULT,
112 alert_message = NULL,