From 16b99833988e0fc833352fe0a7d02e27592cd373 Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Mon, 25 Apr 2016 12:59:12 -0400 Subject: [PATCH] LP#1545115: add description field for policy matrix tables This patch adds description column for the config.hold_matrix_matchpoint and circ_matrix_matchpoint tables and pgTAP tests for them. Signed-off-by: Rogan Hamby Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- Open-ILS/examples/fm_IDL.xml | 2 ++ Open-ILS/src/sql/Pg/100.circ_matrix.sql | 3 ++- Open-ILS/src/sql/Pg/110.hold_matrix.sql | 3 ++- .../lp1545115-circ-and-hold-matrix-get-notes.pg | 17 +++++++++++++++++ .../xxxx.schema.add_description_circ_matrix.sql | 6 ++++++ .../xxxx.schema.add_description_hold_matrix.sql | 6 ++++++ .../global/config/circ_matrix_matchpoint.tt2 | 2 +- .../global/config/hold_matrix_matchpoint.tt2 | 2 +- 8 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/t/lp1545115-circ-and-hold-matrix-get-notes.pg create mode 100644 Open-ILS/src/sql/Pg/upgrade/xxxx.schema.add_description_circ_matrix.sql create mode 100644 Open-ILS/src/sql/Pg/upgrade/xxxx.schema.add_description_hold_matrix.sql diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index ee01905f73..4c1ed7648b 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -1870,6 +1870,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + @@ -1928,6 +1929,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + diff --git a/Open-ILS/src/sql/Pg/100.circ_matrix.sql b/Open-ILS/src/sql/Pg/100.circ_matrix.sql index 53b207a3b6..09b4e3db01 100644 --- a/Open-ILS/src/sql/Pg/100.circ_matrix.sql +++ b/Open-ILS/src/sql/Pg/100.circ_matrix.sql @@ -81,7 +81,8 @@ CREATE TABLE config.circ_matrix_matchpoint ( grace_period INTERVAL, -- Grace period override script_test TEXT, -- javascript source total_copy_hold_ratio FLOAT, - available_copy_hold_ratio FLOAT + available_copy_hold_ratio FLOAT, + description TEXT ); -- Nulls don't count for a constraint match, so we have to coalesce them into something that does. diff --git a/Open-ILS/src/sql/Pg/110.hold_matrix.sql b/Open-ILS/src/sql/Pg/110.hold_matrix.sql index fe17a9a7c4..3b47b62ebf 100644 --- a/Open-ILS/src/sql/Pg/110.hold_matrix.sql +++ b/Open-ILS/src/sql/Pg/110.hold_matrix.sql @@ -55,7 +55,8 @@ CREATE TABLE config.hold_matrix_matchpoint ( max_holds INT, -- Total hold requests must be less than this, NULL means skip (always pass) include_frozen_holds BOOL NOT NULL DEFAULT TRUE, -- Include frozen hold requests in the count for max_holds test stop_blocked_user BOOL NOT NULL DEFAULT FALSE, -- Stop users who cannot check out items from placing holds - age_hold_protect_rule INT REFERENCES config.rule_age_hold_protect (id) DEFERRABLE INITIALLY DEFERRED -- still not sure we want to move this off the copy + age_hold_protect_rule INT REFERENCES config.rule_age_hold_protect (id) DEFERRABLE INITIALLY DEFERRED, -- still not sure we want to move this off the copy + description TEXT ); -- Nulls don't count for a constraint match, so we have to coalesce them into something that does. diff --git a/Open-ILS/src/sql/Pg/t/lp1545115-circ-and-hold-matrix-get-notes.pg b/Open-ILS/src/sql/Pg/t/lp1545115-circ-and-hold-matrix-get-notes.pg new file mode 100644 index 0000000000..65e8c46637 --- /dev/null +++ b/Open-ILS/src/sql/Pg/t/lp1545115-circ-and-hold-matrix-get-notes.pg @@ -0,0 +1,17 @@ +-- Load the TAP functions. +BEGIN; + +-- Plan the tests. +SELECT plan(2); + +-- Run the tests. + +SELECT has_column('config', 'circ_matrix_matchpoint', 'description', + 'Column "description" on config.circ_matrix_matchpoint should exist'); +SELECT has_column('config', 'hold_matrix_matchpoint', 'description', + 'Column "description" on config.hold_matrix_matchpoint should exist'); + +-- Finish the tests and clean up. +SELECT * FROM finish(); +ROLLBACK; + diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.add_description_circ_matrix.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.add_description_circ_matrix.sql new file mode 100644 index 0000000000..a461c4b095 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.add_description_circ_matrix.sql @@ -0,0 +1,6 @@ +BEGIN; + +ALTER TABLE config.circ_matrix_matchpoint + ADD COLUMN description TEXT; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.add_description_hold_matrix.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.add_description_hold_matrix.sql new file mode 100644 index 0000000000..f65fc133a1 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.add_description_hold_matrix.sql @@ -0,0 +1,6 @@ +BEGIN; + +ALTER TABLE config.hold_matrix_matchpoint + ADD COLUMN description TEXT; + +COMMIT; diff --git a/Open-ILS/src/templates/conify/global/config/circ_matrix_matchpoint.tt2 b/Open-ILS/src/templates/conify/global/config/circ_matrix_matchpoint.tt2 index a576d46b03..df2b8ccce3 100644 --- a/Open-ILS/src/templates/conify/global/config/circ_matrix_matchpoint.tt2 +++ b/Open-ILS/src/templates/conify/global/config/circ_matrix_matchpoint.tt2 @@ -9,7 +9,7 @@