Open Thermatix opened 3 months ago
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?
updated_at
The library doesn't support this yet.
I think db triggers is the right approach, so that the update logic isn't dependent on the ORM.
PR is welcome, and happy to answer any questions that come up.
I can have a field for setting the creation date:
but how can I have a field that is auto set every time the model is modified, I.e. an
updated_at
field?