adds a description column for the config.hold_matrix_matchpoint and circ_matrix_match... user/rogan/lp1545115_matrix_descriptions
authorRogan Hamby <rogan.hamby@gmail.com>
Mon, 25 Apr 2016 16:59:12 +0000 (12:59 -0400)
committerRogan Hamby <rogan.hamby@gmail.com>
Mon, 25 Apr 2016 16:59:12 +0000 (12:59 -0400)
Open-ILS/src/sql/Pg/100.circ_matrix.sql
Open-ILS/src/sql/Pg/110.hold_matrix.sql
Open-ILS/src/sql/Pg/t/lp1545115-circ-and-hold-matrix-get-notes.pg [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/xxxx.schema.add_description_circ_matrix.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/xxxx.schema.add_description_hold_matrix.sql [new file with mode: 0644]

index 4226a27..50cfd23 100644 (file)
@@ -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.
index fe17a9a..3b47b62 100644 (file)
@@ -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 (file)
index 0000000..5bf6112
--- /dev/null
@@ -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 (file)
index 0000000..a461c4b
--- /dev/null
@@ -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 (file)
index 0000000..f65fc13
--- /dev/null
@@ -0,0 +1,6 @@
+BEGIN;
+
+ALTER TABLE config.hold_matrix_matchpoint
+    ADD COLUMN description TEXT;
+
+COMMIT;