[open-ils-commits] [GIT] Evergreen ILS branch rel_2_10 updated. c86b93b9c3a2e49934072b2bab8388c81dfe8cf7
Evergreen Git
git at git.evergreen-ils.org
Thu Apr 28 11:33:30 EDT 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, rel_2_10 has been updated
via c86b93b9c3a2e49934072b2bab8388c81dfe8cf7 (commit)
via aee25ed4af15e12830fbabc5acdb783f9fb77d80 (commit)
via 9c734be41407263ce3ce77a822302edcf05fb199 (commit)
via 5e82acab0c48c2fc08299608ce2043dc595b2288 (commit)
via 12d9fa7cc810fc87e619ab3ecd9ba70ec1238355 (commit)
via 5edce038cd5965261d725afee4c2dbb9e24f36e4 (commit)
from 5b63792c560afb0e29fb33f048c76f5ba3440608 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c86b93b9c3a2e49934072b2bab8388c81dfe8cf7
Author: Galen Charlton <gmc at esilibrary.com>
Date: Thu Apr 28 11:31:20 2016 -0400
LP#1569884: stamp schema update
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 2a92f1c..95766bf 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -91,7 +91,7 @@ CREATE TRIGGER no_overlapping_deps
BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0976', :eg_version); -- berick/kmlussier
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0977', :eg_version); -- Callender/Dyrcona/gmcharlt
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql b/Open-ILS/src/sql/Pg/upgrade/0977.schema.allow_parts_to_be_recreated.sql
similarity index 67%
rename from Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql
rename to Open-ILS/src/sql/Pg/upgrade/0977.schema.allow_parts_to_be_recreated.sql
index c403a5d..1c220b7 100644
--- a/Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0977.schema.allow_parts_to_be_recreated.sql
@@ -1,6 +1,6 @@
BEGIN;
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0977', :eg_version); -- Callender/Dyrcona/gmcharlt
ALTER TABLE biblio.monograph_part DROP CONSTRAINT "record_label_unique";
CREATE UNIQUE INDEX record_label_unique_idx ON biblio.monograph_part (record, label) WHERE deleted = FALSE;
commit aee25ed4af15e12830fbabc5acdb783f9fb77d80
Author: Galen Charlton <gmc at esilibrary.com>
Date: Thu Apr 28 11:27:11 2016 -0400
LP#1569884: fix schema update script
CREATE INDEX cannot run concurrently in a transaction
block period, at least as of 9.4.
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
diff --git a/Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql b/Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql
index 235a5f0..c403a5d 100644
--- a/Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql
+++ b/Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql
@@ -3,6 +3,6 @@ BEGIN;
SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
ALTER TABLE biblio.monograph_part DROP CONSTRAINT "record_label_unique";
-CREATE UNIQUE INDEX CONCURRENTLY record_label_unique_idx ON biblio.monograph_part (record, label) WHERE deleted = FALSE;
+CREATE UNIQUE INDEX record_label_unique_idx ON biblio.monograph_part (record, label) WHERE deleted = FALSE;
COMMIT;
commit 9c734be41407263ce3ce77a822302edcf05fb199
Author: Jason Stephenson <jstephenson at mvlcstaff.org>
Date: Wed Apr 27 15:43:31 2016 -0400
LP#1569884 Fix two problems in previous commit.
The CREATE TABLE biblio.monograph_part statement in
010.schema.biblio.sql ended up with a trailing comma.
The CREATE UNIQUE INDEX on biblio.monograph_part cannot be done
CONCURRENTLY at DB creation time, apparently. At least not on
PostgreSQL 9.3.
Signed-off-by: Jason Stephenson <jstephenson at mvlcstaff.org>
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
diff --git a/Open-ILS/src/sql/Pg/010.schema.biblio.sql b/Open-ILS/src/sql/Pg/010.schema.biblio.sql
index 3312edf..f0c0133 100644
--- a/Open-ILS/src/sql/Pg/010.schema.biblio.sql
+++ b/Open-ILS/src/sql/Pg/010.schema.biblio.sql
@@ -98,9 +98,9 @@ CREATE TABLE biblio.monograph_part (
record BIGINT NOT NULL REFERENCES biblio.record_entry (id),
label TEXT NOT NULL,
label_sortkey TEXT NOT NULL,
- deleted BOOL NOT NULL DEFAULT FALSE,
+ deleted BOOL NOT NULL DEFAULT FALSE
);
-CREATE UNIQUE INDEX CONCURRENTLY record_label_unique_idx ON biblio.monograph_part (record, label) WHERE deleted = FALSE;
+CREATE UNIQUE INDEX record_label_unique_idx ON biblio.monograph_part (record, label) WHERE deleted = FALSE;
CREATE OR REPLACE FUNCTION biblio.normalize_biblio_monograph_part_sortkey () RETURNS TRIGGER AS $$
BEGIN
commit 5e82acab0c48c2fc08299608ce2043dc595b2288
Author: Steven Callender <stevecallender at esilibrary.com>
Date: Wed Apr 27 12:05:48 2016 -0400
LP#1569884 Updated base schema with monograph parts index.
Signed-off-by: Steven Callender <stevecallender at esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson at mvlcstaff.org>
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
diff --git a/Open-ILS/src/sql/Pg/010.schema.biblio.sql b/Open-ILS/src/sql/Pg/010.schema.biblio.sql
index ff0542d..3312edf 100644
--- a/Open-ILS/src/sql/Pg/010.schema.biblio.sql
+++ b/Open-ILS/src/sql/Pg/010.schema.biblio.sql
@@ -99,8 +99,8 @@ CREATE TABLE biblio.monograph_part (
label TEXT NOT NULL,
label_sortkey TEXT NOT NULL,
deleted BOOL NOT NULL DEFAULT FALSE,
- CONSTRAINT record_label_unique UNIQUE (record,label)
);
+CREATE UNIQUE INDEX CONCURRENTLY record_label_unique_idx ON biblio.monograph_part (record, label) WHERE deleted = FALSE;
CREATE OR REPLACE FUNCTION biblio.normalize_biblio_monograph_part_sortkey () RETURNS TRIGGER AS $$
BEGIN
commit 12d9fa7cc810fc87e619ab3ecd9ba70ec1238355
Author: Steven Callender <stevecallender at esilibrary.com>
Date: Wed Apr 13 11:15:27 2016 -0400
LP#1569884 Allow deleted monograph parts to be recreated.
Changed the constraint on the biblio.monograph_part table to allow for a
monograph part to be created if a duplicate deleted version is found.
To test:
[1] Add a monograph part to a bib.
[2] Delete that monograph part.
[3] Attempt to add a monograph part to the same bib using
the same part label. Without the patches installed, this
will fail; upon applying the database update, this operation
should succeed.
Signed-off-by: Steven Callender <stevecallender at esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson at mvlcstaff.org>
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
diff --git a/Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql b/Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql
new file mode 100644
index 0000000..235a5f0
--- /dev/null
+++ b/Open-ILS/src/sql/XXXX.schema.allow_parts_to_be_recreated.sql
@@ -0,0 +1,8 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+ALTER TABLE biblio.monograph_part DROP CONSTRAINT "record_label_unique";
+CREATE UNIQUE INDEX CONCURRENTLY record_label_unique_idx ON biblio.monograph_part (record, label) WHERE deleted = FALSE;
+
+COMMIT;
commit 5edce038cd5965261d725afee4c2dbb9e24f36e4
Author: Galen Charlton <gmc at esilibrary.com>
Date: Thu Apr 28 11:20:29 2016 -0400
LP#1569884: add regression test
This pgTAP test verifies that if you logically delete a monograph part,
you can subsequently add a new one with the same label as that of the
deleted one.
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
diff --git a/Open-ILS/src/sql/Pg/t/regress/lp1569884_readd_deleted_bmp.sql b/Open-ILS/src/sql/Pg/t/regress/lp1569884_readd_deleted_bmp.sql
new file mode 100644
index 0000000..ecb468f
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/t/regress/lp1569884_readd_deleted_bmp.sql
@@ -0,0 +1,52 @@
+BEGIN;
+
+SELECT plan(4);
+
+INSERT INTO biblio.record_entry (id, last_xact_id, marc)
+VALUES (999999998, 'pgtap', '<record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" xmlns="http://www.loc.gov/MARC21/slim">
+ <leader>00531nam a2200157 a 4500</leader>
+ <controlfield tag="005">20080729170300.0</controlfield>
+ <controlfield tag="008"> t19981999enka 0 eng </controlfield>
+ <datafield tag="245" ind1="1" ind2="4">
+ <subfield code="a">test-value</subfield>
+ </datafield>
+</record>');
+
+INSERT INTO biblio.monograph_part(record, label) VALUES (999999998, 'Part 1');
+
+SELECT is(
+ label,
+ 'Part 1',
+ 'LP#1569884: new monograph parts start out active'
+)
+FROM biblio.monograph_part
+WHERE record = 999999998
+AND NOT deleted;
+
+DELETE FROM biblio.monograph_part WHERE record = 999999998;
+
+SELECT is(
+ deleted,
+ TRUE,
+ 'LP#1569884: deleting monograph part sets deleted flag'
+)
+FROM biblio.monograph_part
+WHERE record = 999999998
+AND label = 'Part 1';
+
+SELECT lives_ok(
+ $$INSERT INTO biblio.monograph_part(record, label) VALUES (999999998, 'Part 1')$$,
+ 'LP#1569884: can add monograph part with same label as logically deleted one'
+);
+
+SELECT is(
+ COUNT(*)::INT,
+ 1,
+ 'LP#1569884: one active part with label Part 1'
+)
+FROM biblio.monograph_part
+WHERE record = 999999998
+AND label = 'Part 1'
+AND NOT deleted;
+
+ROLLBACK;
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/010.schema.biblio.sql | 4 +-
.../Pg/t/regress/lp1569884_readd_deleted_bmp.sql | 52 ++++++++++++++++++++
.../0977.schema.allow_parts_to_be_recreated.sql | 8 +++
4 files changed, 63 insertions(+), 3 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/t/regress/lp1569884_readd_deleted_bmp.sql
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0977.schema.allow_parts_to_be_recreated.sql
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list