Require GivenName to be unique

This commit is contained in:
Kristoffer Dalby 2022-05-16 20:33:47 +02:00
parent 9b393eb861
commit 4aae917f74

View file

@ -51,7 +51,7 @@ type Machine struct {
// //
// GivenName is the name used in all DNS related // GivenName is the name used in all DNS related
// parts of headscale. // parts of headscale.
GivenName string GivenName string `gorm:"type:varchar(63);unique_index"`
NamespaceID uint NamespaceID uint
Namespace Namespace `gorm:"foreignKey:NamespaceID"` Namespace Namespace `gorm:"foreignKey:NamespaceID"`