[open-ils-commits] [GIT] Evergreen ILS branch rel_2_9 updated. 2caf056a9045615927e3beac2ba29e91041938d2
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_9 has been updated
via 2caf056a9045615927e3beac2ba29e91041938d2 (commit)
via 9e20a27a9d1370b9375d25cadd413caa44eb9c33 (commit)
via f6d4dea4af5f37849367b099a4d8652dea304867 (commit)
via 9e5e06bfef338c85bb6e77da51a1c6779f3ad194 (commit)
via 25024ec416017d68b79308897d2b936203fc2e73 (commit)
via e1f051997cbd50e9d2c5be7ca54b8b542fc7ac74 (commit)
from 71dfb5bd98de998396fb98442d6ea657d21342a2 (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 2caf056a9045615927e3beac2ba29e91041938d2
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>
Conflicts:
Open-ILS/src/sql/Pg/002.schema.config.sql
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index bf2df91..e1e4a2c 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 ('0974', :eg_version); -- tmccanna/gmcharlt
+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 9e20a27a9d1370b9375d25cadd413caa44eb9c33
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 f6d4dea4af5f37849367b099a4d8652dea304867
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 9e5e06bfef338c85bb6e77da51a1c6779f3ad194
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 25024ec416017d68b79308897d2b936203fc2e73
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 e1f051997cbd50e9d2c5be7ca54b8b542fc7ac74
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