From: Thomas Berezansky Date: Mon, 18 Jun 2012 17:19:18 +0000 (-0400) Subject: Purge Circulations: Remove extra delete loop X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d34df9a5b52cf03bda291c0f5eed1114d9f3b8f2;p=working%2FEvergreen.git Purge Circulations: Remove extra delete loop A trigger on action.circulation purges upwards through the circ chain. Thus we don't need to do the loop ourselves. Signed-off-by: Thomas Berezansky --- diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql index 831dd15ca3..c427559604 100644 --- a/Open-ILS/src/sql/Pg/090.schema.action.sql +++ b/Open-ILS/src/sql/Pg/090.schema.action.sql @@ -849,11 +849,8 @@ BEGIN CONTINUE WHEN AGE(NOW(), last_finished) < keep_age; -- We've passed the purging tests, purge the circ chain starting at the end + -- A trigger should auto-purge the rest of the chain. DELETE FROM action.circulation WHERE id = circ_chain_tail.id; - WHILE circ_chain_tail.parent_circ IS NOT NULL LOOP - SELECT * INTO circ_chain_tail FROM action.circulation WHERE id = circ_chain_tail.parent_circ; - DELETE FROM action.circulation WHERE id = circ_chain_tail.id; - END LOOP; count_purged := count_purged + 1;