From 06c66285d881043f04a729deffe6d9662c94b7ef Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Mon, 25 Apr 2016 12:59:12 -0400 Subject: [PATCH] adds a description column for the config.hold_matrix_matchpoint and circ_matrix_matchpoint tables and pg_tap tests for them --- Open-ILS/src/sql/Pg/100.circ_matrix.sql | 3 ++- Open-ILS/src/sql/Pg/110.hold_matrix.sql | 3 ++- .../Pg/t/lp1545115-circ-and-hold-matrix-get-notes.pg | 18 ++++++++++++++++++ .../xxxx.schema.add_description_circ_matrix.sql | 6 ++++++ .../xxxx.schema.add_description_hold_matrix.sql | 6 ++++++ 5 files changed, 34 insertions(+), 2 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/src/sql/Pg/100.circ_matrix.sql b/Open-ILS/src/sql/Pg/100.circ_matrix.sql index 4226a27024..50cfd23a30 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..5bf611245c --- /dev/null +++ b/Open-ILS/src/sql/Pg/t/lp1545115-circ-and-hold-matrix-get-notes.pg @@ -0,0 +1,18 @@ +-- 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; -- 2.11.0