sublinks / sublinks-api

MIT License
68 stars 17 forks source link

#373 Resolves immutable updatedAt column #389

Closed jgrim closed 1 month ago

jgrim commented 1 month ago

Resolves #373

jgrim commented 1 month ago

@Pdzly I've thought more about this issue. I think we should remove the db triggers and let springboot manage updatedAt for the entities. Rather than removing the annotation I believe we should make the field mutable and allow springboot to handle it. I'd consider updating the annotations for update and create to be driven by the database timestamp like so:

@UpdateTimestamp(source = SourceType.DB) & @CreationTimestamp(source = SourceType.DB)

Pdzly commented 1 month ago

@Pdzly I've thought more about this issue. I think we should remove the db triggers and let springboot manage updatedAt for the entities. Rather than removing the annotation I believe we should make the field mutable and allow springboot to handle it. I'd consider updating the annotations for update and create to be driven by the database timestamp like so:

@UpdateTimestamp(source = SourceType.DB) & @CreationTimestamp(source = SourceType.DB)

Ok

Pdzly commented 1 month ago

Fixed it