[open-ils-commits] r13412 - trunk/Open-ILS/src/sql/Pg (scottmk)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jun 19 14:08:22 EDT 2009


Author: scottmk
Date: 2009-06-19 14:08:19 -0400 (Fri, 19 Jun 2009)
New Revision: 13412

Modified:
   trunk/Open-ILS/src/sql/Pg/999.functions.global.sql
Log:
Replace four calls to actor.usr_merge() with simple UPDATEs.
These columns are not included in any unique indexes, so
updating them will not violate any uniqueness constraints.


Modified: trunk/Open-ILS/src/sql/Pg/999.functions.global.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/999.functions.global.sql	2009-06-19 15:56:47 UTC (rev 13411)
+++ trunk/Open-ILS/src/sql/Pg/999.functions.global.sql	2009-06-19 18:08:19 UTC (rev 13412)
@@ -87,7 +87,7 @@
     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 @@
     -- 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;



More information about the open-ils-commits mailing list