<link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
<link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
<link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
+ <link field="hold_type" reltype="has_a" key="hold_type" map="" class="cht"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
</links>
</class>
+ <class id="cht" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_type" oils_persist:tablename="config.hold_type" reporter:label="Hold Type" oils_persist:readonly="true">
+ <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
+ <field name="id" reporter:selector="name" reporter:datatype="id"/>
+ <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
+ <field name="hold_type" reporter:datatype="text" oils_persist:i18n="true"/>
+ </fields>
+ </class>
+
<!-- ********************************************************************************************************************* -->
</IDL>
CREATE INDEX config_copy_tag_type_owner_idx
ON config.copy_tag_type (owner);
+CREATE TABLE config.hold_type (
+ id SERIAL,
+ hold_type TEXT UNIQUE,
+ description TEXT
+);
+
+INSERT INTO config.hold_type (hold_type,description) VALUES
+ ('C','Copy Hold'),
+ ('V','Volume Hold'),
+ ('T','Title Hold'),
+ ('M','Metarecord Hold'),
+ ('R','Recall Hold'),
+ ('F','Force Hold'),
+ ('I','Issuance Hold'),
+ ('P','Part Hold')
+;
+
COMMIT;
selection_ou INT NOT NULL,
selection_depth INT NOT NULL DEFAULT 0,
pickup_lib INT NOT NULL REFERENCES actor.org_unit DEFERRABLE INITIALLY DEFERRED,
- hold_type TEXT NOT NULL, -- CHECK (hold_type IN ('M','T','V','C')), -- XXX constraint too constraining...
+ hold_type TEXT REFERENCES config.hold_type (hold_type) DEFERRABLE INITIALLY DEFERRED,
holdable_formats TEXT,
phone_notify TEXT,
email_notify BOOL NOT NULL DEFAULT FALSE,
--- /dev/null
+CREATE TABLE config.hold_type (
+ id SERIAL,
+ hold_type TEXT UNIQUE,
+ description TEXT
+);
+
+INSERT INTO config.hold_type (hold_type,description) VALUES
+ ('C','Copy Hold'),
+ ('V','Volume Hold'),
+ ('T','Title Hold'),
+ ('M','Metarecord Hold'),
+ ('R','Recall Hold'),
+ ('F','Force Hold'),
+ ('I','Issuance Hold'),
+ ('P','Part Hold')
+;
+
+ALTER TABLE action.hold_request ADD CONSTRAINT hold_request_hold_type_fkey FOREIGN KEY (hold_type) REFERENCES config.hold_type(hold_type) DEFERRABLE INITIALLY DEFERRED;
+