Avoid updating records when then didn't actually change

This commit is contained in:
Max Ignatenko 2024-03-17 14:16:25 +00:00
parent 9c51a4621f
commit 0cc11e75b2
2 changed files with 12 additions and 8 deletions

View file

@ -33,7 +33,7 @@ type Repo struct {
type Record struct {
ID models.ID `gorm:"primarykey"`
CreatedAt time.Time
UpdatedAt time.Time
UpdatedAt time.Time `gorm:"autoUpdateTime:false"`
Repo models.ID `gorm:"index:idx_repo_record_key,unique,priority:1;not null;index:idx_repo_rev"`
Collection string `gorm:"index:idx_repo_record_key,unique,priority:2;not null"`
Rkey string `gorm:"index:idx_repo_record_key,unique,priority:3"`