LP 1450561: Restore org. unit settings history limit function and trigger
authorJason Stephenson <jstephenson@mvlc.org>
Fri, 1 May 2015 19:33:05 +0000 (15:33 -0400)
committerBen Shum <bshum@biblio.org>
Wed, 19 Aug 2015 02:23:50 +0000 (22:23 -0400)
commit618910ec115d47111d68c2e7bd3c409320265f9a
tree99e281f1359d021875e97dc0ff0d13865e220163
parenta3f27f0b54c9222c2eec692a0972f9144cbb555e
LP 1450561: Restore org. unit settings history limit function and trigger

The evergreen.limit_oustl function and the limit_log_oustl trigger on
config.org_unit_setting_type_log were missed in the upgrade scripts
when these were added to the base schema.  This commit adds them and a
pgtap test to check that they exist after.

This commit also alters the body of the limit_oustl function to take into
account of the org unit when deleting entries from the log table.  This
change allows multiple consortium members to have their own five history
entries.  The original code only kept the last five entries of any given
setting across the whole installation.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/t/lp1450561-limit_oustl.pg [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.lmit_logs_oust-create.sql [new file with mode: 0644]