Set trigger event complete_time equal to its update_time for completed
events that have no complete time.
As noted in the SQL, this could be a very large update.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
--- /dev/null
+BEGIN; -- needed?
+
+-- NOTE: This could be a very large update, affecting millions of rows.
+-- It should be exectued as a separate part of any version upgrade scripts,
+-- running outside of the main transaction.
+
+-- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+\qecho
+\qecho Setting action_trigger.event.complete_time.
+\qecho This could affect many rows and take a while to run.
+\qecho
+
+UPDATE action_trigger.event
+ SET complete_time = update_time
+ WHERE state = 'complete' AND complete_time IS NULL;
+
+COMMIT;