[#135] frostfsid: Make migration idempotent

Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
Alexander Chuprov 2024-12-11 18:41:56 +03:00 committed by Evgenii Stratonikov
parent 891e268170
commit a3021f18cf

View file

@ -103,7 +103,8 @@ func _deploy(data any, isUpdate bool) {
ctx := storage.GetContext()
args := data.(struct {
admin interop.Hash160
admin interop.Hash160
version int
})
if args.admin != nil {
@ -114,6 +115,7 @@ func _deploy(data any, isUpdate bool) {
}
if isUpdate {
common.CheckVersion(args.version)
it := storage.Find(ctx, subjectKeysPrefix, storage.ValuesOnly)
for iterator.Next(it) {
subjectRaw := iterator.Value(it)