[management] fix the issue with duplicated peers with the same key (#5053)

This commit is contained in:
Vlad
2026-01-09 11:49:26 +01:00
committed by GitHub
parent 0ad0c81899
commit 684fc0d2a2
13 changed files with 190 additions and 14 deletions

View File

@@ -19,7 +19,7 @@ type Peer struct {
// AccountID is a reference to Account that this object belongs
AccountID string `json:"-" gorm:"index"`
// WireGuard public key
Key string `gorm:"index"`
Key string // uniqueness index (check migrations)
// IP address of the Peer
IP net.IP `gorm:"serializer:json"` // uniqueness index per accountID (check migrations)
// Meta is a Peer system meta data