ormlite icon indicating copy to clipboard operation
ormlite copied to clipboard

How to have a field be auto set every time the model is modified?

Open Thermatix opened this issue 10 months ago • 1 comments

I can have a field for setting the creation date:

#[ormlite(default_value = "chrono::Utc::now()")]
pub updated_at: Option<DateTime<Utc>>,

but how can I have a field that is auto set every time the model is modified, I.e. an updated_at field?

Thermatix avatar Apr 18 '24 14:04 Thermatix