Closed ketiltrout closed 11 months ago
My original plan was to use the ON UPDATE CURRENT_TIMESTAMP
clause, which is great, but only works in MySQL, which was one problem.
More importantly, though, was that the peewee
data model doesn't really support automatically updating fields. I tried for a while to write an extension to peewee.Model
which would handle it, but it turned out to be unnecessarily complex for what I wanted to do.
I briefly mentioned removed my auto-update attempt in https://github.com/radiocosmology/alpenhorn/pull/152
I think the primary downside to not having it auto-update is other processes that modify ArchiveFileCopy
won't necessarily update it, but it's mostly a field to record when alpenhorn last checked the record, so it's probably fine.
I think these were overlooked because of my initial idea of making
ArchiveFileCopy.last_update
an automatically-updating value, which didn't pan out.