[open-ils-commits] [GIT] Evergreen ILS branch master updated. eb2d38267effaa3ecce608d8dfe4cc765b561eb2

Evergreen Git git at git.evergreen-ils.org
Mon Feb 18 13:02:37 EST 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  eb2d38267effaa3ecce608d8dfe4cc765b561eb2 (commit)
       via  84b19c08a3f917907f32a79ca0544c1a20356397 (commit)
       via  c819ee44d328a511fcd59d576abf4b5a2941c72e (commit)
      from  8f5fe0722161f767ffa4a73e1add8d4216b06195 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit eb2d38267effaa3ecce608d8dfe4cc765b561eb2
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Mon Feb 18 13:01:27 2019 -0500

    LP#1812733: stamp schema update
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 4f5da68e51..e49f9be336 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1147', :eg_version); -- berick/miker
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1148', :eg_version); -- csharp/gmcharlt
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actor_usr_delete_function.sql b/Open-ILS/src/sql/Pg/upgrade/1148.schema.fix_actor_usr_delete_function.sql
similarity index 96%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actor_usr_delete_function.sql
rename to Open-ILS/src/sql/Pg/upgrade/1148.schema.fix_actor_usr_delete_function.sql
index aaf5c79c09..8af9f55fc1 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actor_usr_delete_function.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1148.schema.fix_actor_usr_delete_function.sql
@@ -1,7 +1,7 @@
 
 BEGIN;
 
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1148', :eg_version); -- csharp/gmcharlt
 
 CREATE OR REPLACE FUNCTION actor.usr_delete(
 	src_usr  IN INTEGER,

commit 84b19c08a3f917907f32a79ca0544c1a20356397
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Mon Feb 18 12:57:48 2019 -0500

    LP#1812733: put in correct version of actor.usr_delete()
    
    This fixes an issue in the previous patch where second_given_name
    would never have been NULLed.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actor_usr_delete_function.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actor_usr_delete_function.sql
index 0350dd483e..aaf5c79c09 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actor_usr_delete_function.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actor_usr_delete_function.sql
@@ -87,10 +87,11 @@ BEGIN
 			photo_url = NULL,
 			prefix = NULL,
 			first_given_name = new_name,
-			guardian = NULL,
+			second_given_name = NULL,
 			family_name = new_name,
 			suffix = NULL,
 			alias = NULL,
+            guardian = NULL,
 			day_phone = NULL,
 			evening_phone = NULL,
 			other_phone = NULL,

commit c819ee44d328a511fcd59d576abf4b5a2941c72e
Author: Chris Sharp <csharp at georgialibraries.org>
Date:   Mon Jan 21 13:50:17 2019 -0500

    LP#1812733 - Repair actor.usr_delete function.
    
    The Parent/Guardian feature altered the actor.usr_delete
    function, but accidentally tries to update the "guardian"
    field twice.  This fixes that problem.
    
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actor_usr_delete_function.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actor_usr_delete_function.sql
new file mode 100644
index 0000000000..0350dd483e
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_actor_usr_delete_function.sql
@@ -0,0 +1,119 @@
+
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE OR REPLACE FUNCTION actor.usr_delete(
+	src_usr  IN INTEGER,
+	dest_usr IN INTEGER
+) RETURNS VOID AS $$
+DECLARE
+	old_profile actor.usr.profile%type;
+	old_home_ou actor.usr.home_ou%type;
+	new_profile actor.usr.profile%type;
+	new_home_ou actor.usr.home_ou%type;
+	new_name    text;
+	new_dob     actor.usr.dob%type;
+BEGIN
+	SELECT
+		id || '-PURGED-' || now(),
+		profile,
+		home_ou,
+		dob
+	INTO
+		new_name,
+		old_profile,
+		old_home_ou,
+		new_dob
+	FROM
+		actor.usr
+	WHERE
+		id = src_usr;
+	--
+	-- Quit if no such user
+	--
+	IF old_profile IS NULL THEN
+		RETURN;
+	END IF;
+	--
+	perform actor.usr_purge_data( src_usr, dest_usr );
+	--
+	-- Find the root grp_tree and the root org_unit.  This would be simpler if we 
+	-- could assume that there is only one root.  Theoretically, someday, maybe,
+	-- there could be multiple roots, so we take extra trouble to get the right ones.
+	--
+	SELECT
+		id
+	INTO
+		new_profile
+	FROM
+		permission.grp_ancestors( old_profile )
+	WHERE
+		parent is null;
+	--
+	SELECT
+		id
+	INTO
+		new_home_ou
+	FROM
+		actor.org_unit_ancestors( old_home_ou )
+	WHERE
+		parent_ou is null;
+	--
+	-- Truncate date of birth
+	--
+	IF new_dob IS NOT NULL THEN
+		new_dob := date_trunc( 'year', new_dob );
+	END IF;
+	--
+	UPDATE
+		actor.usr
+		SET
+			card = NULL,
+			profile = new_profile,
+			usrname = new_name,
+			email = NULL,
+			passwd = random()::text,
+			standing = DEFAULT,
+			ident_type = 
+			(
+				SELECT MIN( id )
+				FROM config.identification_type
+			),
+			ident_value = NULL,
+			ident_type2 = NULL,
+			ident_value2 = NULL,
+			net_access_level = DEFAULT,
+			photo_url = NULL,
+			prefix = NULL,
+			first_given_name = new_name,
+			guardian = NULL,
+			family_name = new_name,
+			suffix = NULL,
+			alias = NULL,
+			day_phone = NULL,
+			evening_phone = NULL,
+			other_phone = NULL,
+			mailing_address = NULL,
+			billing_address = NULL,
+			home_ou = new_home_ou,
+			dob = new_dob,
+			active = FALSE,
+			master_account = DEFAULT, 
+			super_user = DEFAULT,
+			barred = FALSE,
+			deleted = TRUE,
+			juvenile = DEFAULT,
+			usrgroup = 0,
+			claims_returned_count = DEFAULT,
+			credit_forward_balance = DEFAULT,
+			last_xact_id = DEFAULT,
+			alert_message = NULL,
+			create_date = now(),
+			expire_date = now()
+	WHERE
+		id = src_usr;
+END;
+$$ LANGUAGE plpgsql;
+
+COMMIT;

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/sql/Pg/002.schema.config.sql          |  2 +-
 ... 1148.schema.fix_actor_usr_delete_function.sql} | 57 +---------------------
 2 files changed, 3 insertions(+), 56 deletions(-)
 copy Open-ILS/src/sql/Pg/upgrade/{1139.schema.patron-guardian.sql => 1148.schema.fix_actor_usr_delete_function.sql} (52%)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list