Add can_have_copies field to config.bib_source.
authorJason Stephenson <jstephenson@mvlc.org>
Fri, 30 Sep 2011 15:28:08 +0000 (11:28 -0400)
committerDan Scott <dscott@laurentian.ca>
Mon, 5 Dec 2011 18:07:52 +0000 (13:07 -0500)
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 <jstephenson@mvlc.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>

Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.config.bib_source.can_have_copies.sql [new file with mode: 0644]

index d605f1d..ec1cac6 100644 (file)
@@ -4863,6 +4863,7 @@ SELECT  usr,
                        <field name="quality" reporter:datatype="int" />
                        <field name="source" reporter:datatype="text"/>
                        <field name="transcendant" reporter:datatype="bool"/>
+                       <field name="can_have_copies" reporter:datatype="bool"/>
                </fields>
                <links/>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
index 5034730..54a13e3 100644 (file)
@@ -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;
index 54865b3..fa53141 100644 (file)
@@ -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 (
index 628856f..41e8d19 100644 (file)
@@ -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 (file)
index 0000000..102da7a
--- /dev/null
@@ -0,0 +1,2 @@
+ALTER TABLE config.bib_source
+ADD COLUMN can_have_copies BOOL NOT NULL DEFAULT TRUE;