[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch master updated. d4b34797cc94fbe2acf54ccaea4ed481ee861f13
Evergreen Git
git at git.evergreen-ils.org
Thu Oct 10 16:42:10 EDT 2013
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, master has been updated
via d4b34797cc94fbe2acf54ccaea4ed481ee861f13 (commit)
from 6530fb4806670765a61dbbdf1d0b5f9040c264c5 (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 d4b34797cc94fbe2acf54ccaea4ed481ee861f13
Author: Dan Wells <dbw2 at calvin.edu>
Date: Thu Oct 10 15:54:40 2013 -0400
Adding 0842, 0843 to help with 0841 deficiencies
A clean backport of 0841 was not possible due to partial schema
differences in the upgrade. While we may have planned ahead better,
add 0842 just for 2_3 upgraders which ends up being a no-op for
2_4, and adds ON UPDATE CASCADE for 2_5.
Also, for similar but additional reasons, add 0843, which serves two
purposes:
1) add ON UPDATE CASCADE to the rest for those upgrading 2_5/master
2) alter config.z3950_index_field_map for those upgrading from 2_4
and previous (other lines are no-ops in this case)
Signed-off-by: Dan Wells <dbw2 at calvin.edu>
Signed-off-by: Remington Steed <rjs7 at calvin.edu>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index bed55d7..c80854e 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 ('0841', :eg_version); -- dbwells/senator
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0843', :eg_version); -- dbwells/rsteed
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
@@ -239,7 +239,7 @@ $$;
CREATE TABLE config.metabib_field_ts_map (
id SERIAL PRIMARY KEY,
- metabib_field INT NOT NULL REFERENCES config.metabib_field (id) DEFERRABLE INITIALLY DEFERRED,
+ metabib_field INT NOT NULL REFERENCES config.metabib_field (id) ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,
ts_config TEXT NOT NULL REFERENCES config.ts_config_list (id),
active BOOL NOT NULL DEFAULT TRUE,
index_weight CHAR(1) NOT NULL DEFAULT 'C' CHECK (index_weight IN ('A','B','C','D')),
@@ -256,7 +256,7 @@ $$;
CREATE TABLE config.metabib_search_alias (
alias TEXT PRIMARY KEY,
field_class TEXT NOT NULL REFERENCES config.metabib_class (name),
- field INT REFERENCES config.metabib_field (id) DEFERRABLE INITIALLY DEFERRED
+ field INT REFERENCES config.metabib_field (id) ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED
);
CREATE TABLE config.non_cataloged_type (
@@ -1056,7 +1056,7 @@ $$;
CREATE TABLE config.z3950_index_field_map (
id SERIAL PRIMARY KEY,
label TEXT NOT NULL, -- i18n
- metabib_field INTEGER REFERENCES config.metabib_field(id) DEFERRABLE INITIALLY DEFERRED,
+ metabib_field INTEGER REFERENCES config.metabib_field(id) ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,
record_attr TEXT REFERENCES config.record_attr_definition(name),
z3950_attr INTEGER REFERENCES config.z3950_attr(id),
z3950_attr_type TEXT,-- REFERENCES config.z3950_attr(name)
diff --git a/Open-ILS/src/sql/Pg/030.schema.metabib.sql b/Open-ILS/src/sql/Pg/030.schema.metabib.sql
index 73b30ea..a0ae451 100644
--- a/Open-ILS/src/sql/Pg/030.schema.metabib.sql
+++ b/Open-ILS/src/sql/Pg/030.schema.metabib.sql
@@ -204,7 +204,7 @@ CREATE TRIGGER metabib_browse_entry_fti_trigger
CREATE TABLE metabib.browse_entry_def_map (
id BIGSERIAL PRIMARY KEY,
entry BIGINT REFERENCES metabib.browse_entry (id),
- def INT REFERENCES config.metabib_field (id) DEFERRABLE INITIALLY DEFERRED,
+ def INT REFERENCES config.metabib_field (id) ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,
source BIGINT REFERENCES biblio.record_entry (id),
authority BIGINT REFERENCES authority.record_entry (id) ON DELETE SET NULL
);
diff --git a/Open-ILS/src/sql/Pg/upgrade/0842.schema.redo_config_metabib_field_sequence_2_3_to_2_4.sql b/Open-ILS/src/sql/Pg/upgrade/0842.schema.redo_config_metabib_field_sequence_2_3_to_2_4.sql
new file mode 100644
index 0000000..22aaaa4
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/0842.schema.redo_config_metabib_field_sequence_2_3_to_2_4.sql
@@ -0,0 +1,11 @@
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0842', :eg_version);
+
+-- this upgrade is only for people coming from 2_3, and is a NO-OP for those on 2_4
+ALTER TABLE config.metabib_field_ts_map DROP CONSTRAINT metabib_field_ts_map_metabib_field_fkey;
+
+ALTER TABLE config.metabib_field_ts_map ADD CONSTRAINT metabib_field_ts_map_metabib_field_fkey FOREIGN KEY (metabib_field) REFERENCES config.metabib_field(id) ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED;
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/0843.schema.redo_config_metabib_field_sequence_2_5.sql b/Open-ILS/src/sql/Pg/upgrade/0843.schema.redo_config_metabib_field_sequence_2_5.sql
new file mode 100644
index 0000000..acaf243
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/0843.schema.redo_config_metabib_field_sequence_2_5.sql
@@ -0,0 +1,18 @@
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0843', :eg_version);
+
+-- this upgrade file serves 2 purposes:
+-- 1) add ON UPDATE CASCADE for those upgrading 2_5/master
+-- 2) alter config.z3950_index_field_map for those upgrading from 2_4 and previous (other lines
+-- are no-ops in this case)
+ALTER TABLE config.metabib_search_alias DROP CONSTRAINT metabib_search_alias_field_fkey;
+ALTER TABLE config.z3950_index_field_map DROP CONSTRAINT z3950_index_field_map_metabib_field_fkey;
+ALTER TABLE metabib.browse_entry_def_map DROP CONSTRAINT browse_entry_def_map_def_fkey;
+
+ALTER TABLE config.metabib_search_alias ADD CONSTRAINT metabib_search_alias_field_fkey FOREIGN KEY (field) REFERENCES config.metabib_field(id) ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE config.z3950_index_field_map ADD CONSTRAINT z3950_index_field_map_metabib_field_fkey FOREIGN KEY (metabib_field) REFERENCES config.metabib_field(id) ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE metabib.browse_entry_def_map ADD CONSTRAINT browse_entry_def_map_def_fkey FOREIGN KEY (def) REFERENCES config.metabib_field(id) ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED;
+
+COMMIT;
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 8 ++++----
Open-ILS/src/sql/Pg/030.schema.metabib.sql | 2 +-
...do_config_metabib_field_sequence_2_3_to_2_4.sql | 11 +++++++++++
...hema.redo_config_metabib_field_sequence_2_5.sql | 18 ++++++++++++++++++
4 files changed, 34 insertions(+), 5 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0842.schema.redo_config_metabib_field_sequence_2_3_to_2_4.sql
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0843.schema.redo_config_metabib_field_sequence_2_5.sql
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list