]> git.evergreen-ils.org Git - Evergreen.git/commit
Patch from Thomas Berezansky addressing circ/hold config constraints, and their lack...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Feb 2011 17:22:00 +0000 (17:22 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Feb 2011 17:22:00 +0000 (17:22 +0000)
commitc923d4ffca85423f73a2084bea1ad97717af7eda
treee2b0df322f05a8bb73bde125118369625ffa0d52
parent165bc20450999ffaaf0dd6f17b7eba5d8d04e017
Patch from Thomas Berezansky addressing circ/hold config constraints, and their lack of usefulness.

The config.circ_matrix_matchpoint and config.hold_matrix_matchpoint tables have unique constraints that are intended to ensure that you have at most one entry in the table for each set of input conditions.

These constraints operate over a set of fields that can (in whole or part) be set to null, and thus don't do what they are intended to in most (if not basically all) cases.

[This patch] replaces the unique constraints with unique indexes. Nullable fields are coalesced into empty strings so that they can be matched against, and the index only applies to those rows set as active.

The included upgrade script cleans up the tables by taking each set of non-unique rows the unique index would fail on and setting all but the first (in id order) to active=false. If an administrator determines that the wrong row was left active they can toggle active off on the one that was left and back on for the correct one.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@19408 dcc99617-32d9-48b4-a31d-7c20da2025e4
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/100.circ_matrix.sql
Open-ILS/src/sql/Pg/110.hold_matrix.sql
Open-ILS/src/sql/Pg/upgrade/0482.schema.fix_matchpoint_unique.sql [new file with mode: 0644]