From 01597b5dde393f80767220e1c9b8d19163a5fd05 Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Wed, 11 Dec 2024 18:41:56 +0300 Subject: [PATCH] [#135] frostfsid: Make migration idempotent Signed-off-by: Alexander Chuprov --- frostfsid/frostfsid_contract.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frostfsid/frostfsid_contract.go b/frostfsid/frostfsid_contract.go index 15099ab..250deeb 100644 --- a/frostfsid/frostfsid_contract.go +++ b/frostfsid/frostfsid_contract.go @@ -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)