add snapshot version
This commit is contained in:
1 parent
4c7e96813c
commit
909ff91b2b
8 files changed
+18
-10
No files matched your search
+6
-1
@@ -21,7 +21,12 @@ type (
|
||||
)
|
||||
|
||||
func (r snapshotRepository) Update(list []entity.Snapshot) error {
|
||||
_, err := r.getDb().Model(&list).OnConflict("(app_id) DO UPDATE WHERE EXCLUDED.version > version").Insert()
|
||||
_, err := r.getDb().Model(&list).OnConflict("(app_id) DO UPDATE").
|
||||
Set("version = EXCLUDED.version").
|
||||
Set("app_id = EXCLUDED.app_id").
|
||||
Set("limit_state = EXCLUDED.limit_state").
|
||||
Where("snapshot.version < EXCLUDED.version").
|
||||
Insert()
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user