3 SELECT evergreen.upgrade_deps_block_check('1211', :eg_version); -- Dyrcona/rhamby/gmcharlt
5 CREATE OR REPLACE FUNCTION actor.usr_delete(
10 old_profile actor.usr.profile%type;
11 old_home_ou actor.usr.home_ou%type;
12 new_profile actor.usr.profile%type;
13 new_home_ou actor.usr.home_ou%type;
15 new_dob actor.usr.dob%type;
18 id || '-PURGED-' || now(),
32 -- Quit if no such user
34 IF old_profile IS NULL THEN
38 perform actor.usr_purge_data( src_usr, dest_usr );
40 -- Find the root grp_tree and the root org_unit. This would be simpler if we
41 -- could assume that there is only one root. Theoretically, someday, maybe,
42 -- there could be multiple roots, so we take extra trouble to get the right ones.
49 permission.grp_ancestors( old_profile )
58 actor.org_unit_ancestors( old_home_ou )
62 -- Truncate date of birth
64 IF new_dob IS NOT NULL THEN
65 new_dob := date_trunc( 'year', new_dob );
72 profile = new_profile,
75 passwd = random()::text,
80 FROM config.identification_type
85 net_access_level = DEFAULT,
88 first_given_name = new_name,
89 second_given_name = NULL,
90 family_name = new_name,
97 mailing_address = NULL,
98 billing_address = NULL,
99 home_ou = new_home_ou,
102 master_account = DEFAULT,
103 super_user = DEFAULT,
108 claims_returned_count = DEFAULT,
109 credit_forward_balance = DEFAULT,
110 last_xact_id = DEFAULT,
111 alert_message = NULL,
113 pref_first_given_name = NULL,
114 pref_second_given_name = NULL,
115 pref_family_name = NULL,
117 name_keywords = NULL,