From 2f3a677fcd2cf778edbcbd4be0bfa46ce510c2c7 Mon Sep 17 00:00:00 2001 From: ecrupper Date: Mon, 26 Jun 2023 14:42:34 -0500 Subject: [PATCH] what is your why --- database/schedule/update.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/database/schedule/update.go b/database/schedule/update.go index 1d4f00e1e..dd03f62c5 100644 --- a/database/schedule/update.go +++ b/database/schedule/update.go @@ -27,6 +27,9 @@ func (e *engine) UpdateSchedule(s *library.Schedule, fields bool) error { } // If "fields" is true, update entire record; otherwise, just update scheduled_at (part of processSchedule) + // + // we do this because Gorm will automatically set `updated_at` with the Save function + // and the `updated_at` field should reflect the last time a user updated the record, rather than the scheduler if fields { err = e.client.Table(constants.TableSchedule).Save(schedule).Error } else {