</actions>
</permacrud>
</class>
+ <class id="bmp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::monograph_part" oils_persist:tablename="biblio.monograph_part" reporter:label="Monograph Parts">
+ <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
+ <field name="id" reporter:datatype="id" />
+ <field name="record" reporter:datatype="link"/>
+ <field name="label" reporter:datatype="text"/>
+ </fields>
+ <links>
+ <link field="record" reltype="has_a" key="id" map="" class="bre"/>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
+ <retrieve/>
+ <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
+ <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
+ </actions>
+ </permacrud>
+ </class>
+ <class id="acpm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_part_map" oils_persist:tablename="asset.copy_part_map" reporter:label="Copy Monograph Part Map">
+ <fields oils_persist:primary="target_copy">
+ <field name="target_copy" reporter:datatype="link" />
+ <field name="part" reporter:datatype="link"/>
+ </fields>
+ <links>
+ <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
+ <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
+ <retrieve/>
+ <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
+ <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
+ </actions>
+ </permacrud>
+ </class>
<class id="aoucd" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit::closed_date" oils_persist:tablename="actor.org_unit_closed" reporter:label="Closed Dates">
<fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
<field name="close_end" reporter:datatype="timestamp" />
age_protect floating cost status_changed_time/ );
#-------------------------------------------------------------------------------
+package asset::copy_part_map;
+use base qw/asset/;
+
+__PACKAGE__->table( 'asset_copy_part_map' );
+__PACKAGE__->columns( Primary => qw/target_copy/ );
+__PACKAGE__->columns( Essential => qw/part/);
+
+#-------------------------------------------------------------------------------
package asset::stat_cat;
use base qw/asset/;
editor create_date edit_date pub/ );
#-------------------------------------------------------------------------------
+#-------------------------------------------------------------------------------
+package biblio::monograph_part;
+use base qw/biblio/;
+
+biblio::monograph_part->table( 'biblio_monograph_part' );
+biblio::monograph_part->columns( Essential => qw/id record label/ );
+#-------------------------------------------------------------------------------
+
1;
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.monograph_part (
+ id SERIAL PRIMARY KEY,
+ record BIGINT NOT NULL REFERENCES biblio.record_entry (id),
+ label TEXT NOT NULL,
+ CONSTRAINT record_label_unique UNIQUE (record,label)
+);
+
COMMIT;
CREATE INDEX cp_create_date ON asset.copy (create_date);
CREATE RULE protect_copy_delete AS ON DELETE TO asset.copy DO INSTEAD UPDATE asset.copy SET deleted = TRUE WHERE OLD.id = asset.copy.id;
+CREATE TABLE asset.copy_part_map (
+ target_copy BIGINT PRIMARY KEY, -- points o asset.copy
+ part INT NOT NULL REFERENCES biblio.monograph_part (id) ON DELETE CASCADE
+);
+
CREATE TABLE asset.opac_visible_copies (
id BIGINT primary key, -- copy id
record BIGINT,