fields for supporting bib record ownership and sharing
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 1 Apr 2010 19:21:01 +0000 (19:21 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 1 Apr 2010 19:21:01 +0000 (19:21 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16094 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/biblio.pm
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/010.schema.biblio.sql
Open-ILS/src/sql/Pg/800.fkeys.sql
Open-ILS/src/sql/Pg/upgrade/0225.schema.record_ownership.sql [new file with mode: 0644]

index 0497560..9d4cc78 100644 (file)
@@ -1702,6 +1702,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
                        <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
                        <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
+                       <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
+                       <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
                        <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
@@ -1714,6 +1716,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
                <links>
+                       <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
                        <link field="editor" reltype="has_a" key="id" map="" class="au"/>
                        <link field="creator" reltype="has_a" key="id" map="" class="au"/>
                        <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
index 0a6b447..46fefaa 100644 (file)
@@ -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/ );
 
 #-------------------------------------------------------------------------------
index fec295e..ea1a63b 100644 (file)
@@ -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,
index e55cecd..afae8b3 100644 (file)
@@ -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 );
index 4480a30..06de96b 100644 (file)
@@ -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 (file)
index 0000000..94adad7
--- /dev/null
@@ -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;
+