Replace four calls to actor.usr_merge() with simple UPDATEs.
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 19 Jun 2009 18:08:19 +0000 (18:08 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 19 Jun 2009 18:08:19 +0000 (18:08 +0000)
These columns are not included in any unique indexes, so
updating them will not violate any uniqueness constraints.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@13412 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/999.functions.global.sql

index f824b19..487ad5b 100644 (file)
@@ -87,7 +87,7 @@ BEGIN
     PERFORM actor.usr_merge_rows('container.call_number_bucket', 'owner', src_usr, dest_usr);
     PERFORM actor.usr_merge_rows('container.copy_bucket', 'owner', src_usr, dest_usr);
     PERFORM actor.usr_merge_rows('container.user_bucket', 'owner', src_usr, dest_usr);
-    PERFORM actor.usr_merge_rows('container.user_bucket_item', 'target_user', src_usr, dest_usr);
+       UPDATE container.user_bucket_item SET target_user = dest_usr WHERE target_user = src_usr;
 
     -- vandelay.*
     PERFORM actor.usr_merge_rows('vandelay.queue', 'owner', src_usr, dest_usr);
@@ -141,17 +141,17 @@ BEGIN
     -- It's not uncommon to define the reporter schema in a replica 
     -- DB only, so don't assume these tables exist in the write DB.
     BEGIN
-        PERFORM actor.usr_merge_rows('reporter.template', 'owner', src_usr, dest_usr);
+       UPDATE reporter.template SET owner = dest_usr WHERE owner = src_usr;
     EXCEPTION WHEN undefined_table THEN
         -- do nothing
     END;
     BEGIN
-        PERFORM actor.usr_merge_rows('reporter.report', 'owner', src_usr, dest_usr);
+       UPDATE reporter.report SET owner = dest_usr WHERE owner = src_usr;
     EXCEPTION WHEN undefined_table THEN
         -- do nothing
     END;
     BEGIN
-        PERFORM actor.usr_merge_rows('reporter.schedule', 'runner', src_usr, dest_usr);
+       UPDATE reporter.schedule SET runner = dest_usr WHERE runner = src_usr;
     EXCEPTION WHEN undefined_table THEN
         -- do nothing
     END;