From 1225cb7d3485053d904a6d4707032718f898ce5e Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Wed, 2 Feb 2022 12:34:36 -0800 Subject: [PATCH] AccessKey.Key unqiue index --- internal/registry/models/access_key.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/registry/models/access_key.go b/internal/registry/models/access_key.go index 3afd0ea5aa..21795f6e44 100644 --- a/internal/registry/models/access_key.go +++ b/internal/registry/models/access_key.go @@ -21,7 +21,7 @@ type AccessKey struct { // TODO: remove me with machine identities Permissions string - Key string + Key string `gorm:"<-;uniqueIndex:,where:deleted_at is NULL"` Secret string `gorm:"-"` SecretChecksum []byte }