3 SELECT evergreen.upgrade_deps_block_check('1125', :eg_version);
5 CREATE TABLE asset.latest_inventory (
7 inventory_workstation INTEGER REFERENCES actor.workstation (id) DEFERRABLE INITIALLY DEFERRED,
8 inventory_date TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
11 CREATE INDEX latest_inventory_copy_idx ON asset.latest_inventory (copy);
13 CREATE OR REPLACE FUNCTION evergreen.asset_latest_inventory_copy_inh_fkey() RETURNS TRIGGER AS $f$
15 PERFORM 1 FROM asset.copy WHERE id = NEW.copy;
17 RAISE foreign_key_violation USING MESSAGE = FORMAT(
18 $$Referenced asset.copy id not found, copy:%s$$, NEW.copy
23 $f$ LANGUAGE PLPGSQL VOLATILE COST 50;
25 CREATE CONSTRAINT TRIGGER inherit_asset_latest_inventory_copy_fkey
26 AFTER UPDATE OR INSERT ON asset.latest_inventory
27 DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_latest_inventory_copy_inh_fkey();
29 INSERT into config.workstation_setting_type (name, grp, datatype, label)
31 'eg.circ.checkin.do_inventory_update', 'circ', 'bool',
33 'eg.circ.checkin.do_inventory_update',
34 'Checkin: Update Inventory',