1 -- Evergreen DB patch YYYY.schema.acp_status_date_changed.sql
3 -- Change trigger which updates copy status_changed_time to ignore the
4 -- Reshelving->Available status rollover
7 -- FIXME: 0039.schema.acp_status_date_changed.sql defines this the first time
8 -- around, but along with the column itself, etc. And it gets modified with
9 -- 0562.schema.copy_active_date.sql. Not sure how to use the supercedes /
10 -- deprecate stuff for upgrade scripts, if it's even applicable when a given
11 -- upgrade script is doing so much.
13 -- check whether patch can be applied
14 SELECT evergreen.upgrade_deps_block_check('0594', :eg_version);
16 CREATE OR REPLACE FUNCTION asset.acp_status_changed()
19 IF NEW.status <> OLD.status AND NOT (NEW.status = 0 AND OLD.status = 7) THEN
20 NEW.status_changed_time := now();
21 IF NEW.active_date IS NULL AND NEW.status IN (SELECT id FROM config.copy_status WHERE copy_active = true) THEN
22 NEW.active_date := now();