<field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
<field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
<field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
+ <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
<field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
<field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
</fields>
<links>
<link field="owner" reltype="has_a" key="id" map="" class="aou"/>
+ <link field="record" reltype="has_a" key="id" map="" class="bre"/>
<link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
<link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
<link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0089'); -- berick
+INSERT INTO config.upgrade_log (version) VALUES ('0090'); -- miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
DEFERRABLE INITIALLY DEFERRED,
catalog_item BOOLEAN NOT NULL DEFAULT FALSE,
transferable BOOLEAN NOT NULL DEFAULT FALSE,
- CONSTRAINT brt_name_once_per_owner UNIQUE(owner, name)
+ record INT REFERENCES biblio.record_entry (id)
+ DEFERRABLE INITIALLY DEFERRED,
+ CONSTRAINT brt_name_once_per_owner UNIQUE(owner, name, record)
);
CREATE TABLE booking.resource (
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0090'); -- miker
+
+ALTER TABLE booking.resource_type DROP CONSTRAINT brt_name_once_per_owner;
+ALTER TABLE booking.resource_type ADD COLUMN record BIGINT REFERENCES biblio.record_entry (id) DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE booking.resource_type ADD CONSTRAINT brt_name_or_record_once_per_owner UNIQUE(owner, name, record);
+
+COMMIT;