From da556c7f5fedf03ed1d6e84050033c237b774b1c Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Fri, 30 Sep 2011 11:28:08 -0400 Subject: [PATCH] Add can_have_copies field to config.bib_source. Add the column definition to config.bib_source in 002.schema.config.sql. Insert TRUE into the column for the default sources created in 950.data.seed-values.sql. Add the field definition to class id cbs in fm_IDL.xml. Teach OpenILS/Application/Storage/CDBI/config.pm about new field. Add upgrade script for config.bib_source.can_have_copies. Signed-off-by: Jason Stephenson Signed-off-by: Dan Scott --- Open-ILS/examples/fm_IDL.xml | 1 + .../perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm | 2 +- Open-ILS/src/sql/Pg/002.schema.config.sql | 7 +++++-- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 12 ++++++------ .../Pg/upgrade/XXXX.config.bib_source.can_have_copies.sql | 2 ++ 5 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.config.bib_source.can_have_copies.sql diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index d605f1df6a..ec1cac6e7a 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -4863,6 +4863,7 @@ SELECT usr, + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm index 5034730d54..54a13e3f7d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm @@ -24,7 +24,7 @@ package config::bib_source; use base qw/config/; __PACKAGE__->table('config_bib_source'); __PACKAGE__->columns(Primary => 'id'); -__PACKAGE__->columns(Essential => qw/quality source transcendant/); +__PACKAGE__->columns(Essential => qw/quality source transcendant can_have_copies/); #------------------------------------------------------------------------------- package config::metabib_field; diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 54865b3a16..fa531418f1 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -92,13 +92,16 @@ CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, quality INT CHECK ( quality BETWEEN 0 AND 100 ), source TEXT NOT NULL UNIQUE, - transcendant BOOL NOT NULL DEFAULT FALSE + transcendant BOOL NOT NULL DEFAULT FALSE, + can_have_copies BOOL NOT NULL DEFAULT TRUE ); COMMENT ON TABLE config.bib_source IS $$ This is table is used to set up the relative "quality" of each MARC source, such as OCLC. Also identifies "transcendant" sources, i.e., sources of bib records that should display in the OPAC -even if no copies or located URIs are attached. +even if no copies or located URIs are attached. Also indicates if +the source is allowed to have actual copies on its bibs. Volumes +for targeted URIs are unaffected by this setting. $$; CREATE TABLE config.standing ( diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 628856ff4c..41e8d19353 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1,10 +1,10 @@ --002.schema.config.sql: -INSERT INTO config.bib_source (id, quality, source, transcendant) VALUES - (1, 90, oils_i18n_gettext(1, 'oclc', 'cbs', 'source'), FALSE); -INSERT INTO config.bib_source (id, quality, source, transcendant) VALUES - (2, 10, oils_i18n_gettext(2, 'System Local', 'cbs', 'source'), FALSE); -INSERT INTO config.bib_source (id, quality, source, transcendant) VALUES - (3, 1, oils_i18n_gettext(3, 'Project Gutenberg', 'cbs', 'source'), TRUE); +INSERT INTO config.bib_source (id, quality, source, transcendant, can_have_copies) VALUES + (1, 90, oils_i18n_gettext(1, 'oclc', 'cbs', 'source'), FALSE, TRUE); +INSERT INTO config.bib_source (id, quality, source, transcendant, can_have_copies) VALUES + (2, 10, oils_i18n_gettext(2, 'System Local', 'cbs', 'source'), FALSE, TRUE); +INSERT INTO config.bib_source (id, quality, source, transcendant, can_have_copies) VALUES + (3, 1, oils_i18n_gettext(3, 'Project Gutenberg', 'cbs', 'source'), TRUE, TRUE); SELECT SETVAL('config.bib_source_id_seq'::TEXT, 100); INSERT INTO biblio.peer_type (id,name) VALUES diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.config.bib_source.can_have_copies.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.config.bib_source.can_have_copies.sql new file mode 100644 index 0000000000..102da7a4ff --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.config.bib_source.can_have_copies.sql @@ -0,0 +1,2 @@ +ALTER TABLE config.bib_source +ADD COLUMN can_have_copies BOOL NOT NULL DEFAULT TRUE; -- 2.11.0