From 5cc50eae96512638bd132f1e3f1dbf9822d6936f Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Thu, 17 Feb 2011 14:15:17 -0500 Subject: [PATCH] add peer_type and mapping tables ... everywhere --- Open-ILS/examples/fm_IDL.xml | 44 ++++++++++++++++++++++ .../lib/OpenILS/Application/Storage/CDBI/biblio.pm | 16 ++++++++ .../OpenILS/Application/Storage/Driver/Pg/dbi.pm | 12 ++++++ Open-ILS/src/sql/Pg/010.schema.biblio.sql | 12 ++++++ Open-ILS/src/sql/Pg/950.data.seed-values.sql | 8 ++++ 5 files changed, 92 insertions(+) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 60e38b8a39..70fb11ccfe 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -955,6 +955,50 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/biblio.pm index 46fefaab6e..1cb2e9f4b0 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/biblio.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/biblio.pm @@ -22,5 +22,21 @@ biblio::record_note->columns( Essential => qw/id record value creator editor create_date edit_date pub/ ); #------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +package biblio::peer_type; +use base qw/biblio/; + +biblio::peer_type->table( 'biblio_peer_type' ); +biblio::peer_type->columns( Essential => qw/id name/ ); +#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------- +package biblio::peer_record_copy_map; +use base qw/biblio/; + +biblio::peer_record_copy_map->table( 'biblio_peer_record_copy_map' ); +biblio::peer_record_copy_map->columns( Essential => qw/id peer_type peer_record target_copy/ ); +#------------------------------------------------------------------------------- + 1; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/dbi.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/dbi.pm index 5ca6fd008b..eadae0f395 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/dbi.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/dbi.pm @@ -1,6 +1,18 @@ { #------------------------------------------------------------------------------- + package biblio::peer_record_copy_map; + + biblio::peer_record_copy_map->table( 'biblio.peer_record_copy_map' ); + biblio::peer_record_copy_map->sequence( 'biblio.peer_record_copy_map_id_seq' ); + + #------------------------------------------------------------------------------- + package biblio::peer_type; + + biblio::peer_type->table( 'biblio.peer_type' ); + biblio::peer_type->sequence( 'biblio.peer_type_id_seq' ); + + #------------------------------------------------------------------------------- package container::user_bucket; container::user_bucket->table( 'container.user_bucket' ); diff --git a/Open-ILS/src/sql/Pg/010.schema.biblio.sql b/Open-ILS/src/sql/Pg/010.schema.biblio.sql index 428b575481..5a4a7f5743 100644 --- a/Open-ILS/src/sql/Pg/010.schema.biblio.sql +++ b/Open-ILS/src/sql/Pg/010.schema.biblio.sql @@ -79,4 +79,16 @@ CREATE INDEX biblio_record_note_record_idx ON biblio.record_note ( record ); CREATE INDEX biblio_record_note_creator_idx ON biblio.record_note ( creator ); CREATE INDEX biblio_record_note_editor_idx ON biblio.record_note ( editor ); +CREATE TABLE biblio.peer_type ( + id SERIAL PRIMARY KEY, + name TEXT NOT NULL UNIQUE -- i18n +); + +CREATE TABLE biblio.peer_bib_copy_map ( + id SERIAL PRIMARY KEY, + peer_type INT NOT NULL REFERENCES biblio.peer_type (id), + peer_record BIGINT NOT NULL REFERENCES biblio.record_entry (id), + target_copy BIGINT NOT NULL -- can't use fkey because of acp subtables +); + COMMIT; 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 409656b4bb..6edae66152 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -7,6 +7,14 @@ INSERT INTO config.bib_source (id, quality, source, transcendant) VALUES (3, 1, oils_i18n_gettext(3, 'Project Gutenberg', 'cbs', 'source'), TRUE); SELECT SETVAL('config.bib_source_id_seq'::TEXT, 100); +INSERT INTO biblio.peer_type (id,name) VALUES + (1,oils_i18n_gettext(1,'Bound Volume','bpt','name')), + (2,oils_i18n_gettext(2,'Bilingual','bpt','name')), + (3,oils_i18n_gettext(3,'Back-to-back','bpt','name')), + (4,oils_i18n_gettext(4,'Set','bpt','name')), + (5,oils_i18n_gettext(5,'e-Reader Preload','bpt','name')); +SELECT SETVAL('biblio.peer_type_id_seq'::TEXT, 100); + INSERT INTO config.standing (id, value) VALUES (1, oils_i18n_gettext(1, 'Good', 'cst', 'value')); INSERT INTO config.standing (id, value) VALUES (2, oils_i18n_gettext(2, 'Barred', 'cst', 'value')); SELECT SETVAL('config.standing_id_seq'::TEXT, 100); -- 2.11.0