( currval('action_trigger.event_definition_id_seq'), 'circ_lib' );
+-- Custom view depends on this
+DROP VIEW conifer.last_use;
DROP VIEW action.all_circulation;
CREATE OR REPLACE VIEW action.all_circulation AS
SELECT id,usr_post_code, usr_home_ou, usr_profile, usr_birth_year, copy_call_number, copy_location,
END;
$$ LANGUAGE 'plpgsql';
-
+-- Recreate conifer view
+CREATE VIEW conifer.last_use AS
+ SELECT ac.id,
+ COALESCE(max(actac.xact_start), ac.create_date) AS last_circ_or_create,
+ max(actac.xact_start) AS last_circ,
+ max(aih.use_time) AS last_use
+ FROM asset.copy ac
+ LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
+ LEFT JOIN action.in_house_use aih ON ac.id = aih.item
+ GROUP BY ac.id;
SELECT evergreen.upgrade_deps_block_check('1124', :eg_version);