From: miker Date: Thu, 1 Apr 2010 19:21:01 +0000 (+0000) Subject: fields for supporting bib record ownership and sharing X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a41a38db3045504ecc3dedfa07fe89c913d627db;p=evergreen%2Fbjwebb.git fields for supporting bib record ownership and sharing git-svn-id: svn://svn.open-ils.org/ILS/trunk@16094 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 0497560e0..9d4cc783a 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -1702,6 +1702,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + @@ -1714,6 +1716,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/biblio.pm index 0a6b447a0..46fefaab6 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/biblio.pm @@ -10,7 +10,7 @@ use base qw/biblio/; biblio::record_entry->table( 'biblio_record_entry' ); biblio::record_entry->columns( Essential => qw/id tcn_source tcn_value creator editor - create_date edit_date source active quality + create_date edit_date source active quality owner share_depth deleted marc last_xact_id fingerprint/ ); #------------------------------------------------------------------------------- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index fec295ed6..ea1a63b04 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -60,7 +60,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0224'); -- berick +INSERT INTO config.upgrade_log (version) VALUES ('0225'); -- miker CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/010.schema.biblio.sql b/Open-ILS/src/sql/Pg/010.schema.biblio.sql index e55cecdca..afae8b327 100644 --- a/Open-ILS/src/sql/Pg/010.schema.biblio.sql +++ b/Open-ILS/src/sql/Pg/010.schema.biblio.sql @@ -39,7 +39,9 @@ CREATE TABLE biblio.record_entry ( tcn_source TEXT NOT NULL DEFAULT 'AUTOGEN', tcn_value TEXT NOT NULL DEFAULT biblio.next_autogen_tcn_value(), marc TEXT NOT NULL, - last_xact_id TEXT NOT NULL + last_xact_id TEXT NOT NULL, + owner INT, + share_depth INT ); CREATE INDEX biblio_record_entry_creator_idx ON biblio.record_entry ( creator ); CREATE INDEX biblio_record_entry_create_date_idx ON biblio.record_entry ( create_date ); diff --git a/Open-ILS/src/sql/Pg/800.fkeys.sql b/Open-ILS/src/sql/Pg/800.fkeys.sql index 4480a30a4..06de96b52 100644 --- a/Open-ILS/src/sql/Pg/800.fkeys.sql +++ b/Open-ILS/src/sql/Pg/800.fkeys.sql @@ -47,6 +47,7 @@ ALTER TABLE biblio.record_note ADD CONSTRAINT biblio_record_note_editor_fkey FOR ALTER TABLE biblio.record_entry ADD CONSTRAINT biblio_record_entry_creator_fkey FOREIGN KEY (creator) REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED; ALTER TABLE biblio.record_entry ADD CONSTRAINT biblio_record_entry_editor_fkey FOREIGN KEY (editor) REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE biblio.record_entry ADD CONSTRAINT biblio_record_entry_owner_fkey FOREIGN KEY (owner) REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED; ALTER TABLE metabib.metarecord ADD CONSTRAINT metabib_metarecord_master_record_fkey FOREIGN KEY (master_record) REFERENCES biblio.record_entry (id) DEFERRABLE INITIALLY DEFERRED; diff --git a/Open-ILS/src/sql/Pg/upgrade/0225.schema.record_ownership.sql b/Open-ILS/src/sql/Pg/upgrade/0225.schema.record_ownership.sql new file mode 100644 index 000000000..94adad7f9 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0225.schema.record_ownership.sql @@ -0,0 +1,13 @@ + +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0225'); + +ALTER TABLE biblio.record_entry ADD COLUMN owner INT REFERENCES actor.org_unit (id); +ALTER TABLE biblio.record_entry ADD COLUMN share_depth INT; + +ALTER TABLE auditor.biblio_record_entry_history ADD COLUMN owner INT; +ALTER TABLE auditor.biblio_record_entry_history ADD COLUMN share_depth INT; + +COMMIT; +