Skip to content

Commit

Permalink
Merge pull request #204 from GreyOBox/increase-size-of-name-fields
Browse files Browse the repository at this point in the history
fix: increase size of name fields
  • Loading branch information
moul authored Aug 19, 2020
2 parents 8234119 + 44559f0 commit 4c947ce
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/dbmodels/dbmodels.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Setting struct {
type SSHKey struct {
// FIXME: use uuid for ID
gorm.Model
Name string `valid:"required,length(1|32),unix_user"`
Name string `valid:"required,length(1|255),unix_user"`
Type string `valid:"required"`
Length uint `valid:"required"`
Fingerprint string `valid:"optional"`
Expand All @@ -51,7 +51,7 @@ type SSHKey struct {
type Host struct {
// FIXME: use uuid for ID
gorm.Model
Name string `gorm:"size:32" valid:"required,length(1|32)"`
Name string `gorm:"size:255" valid:"required,length(1|255)"`
Addr string `valid:"optional"` // FIXME: to be removed in a future version in favor of URL
User string `valid:"optional"` // FIXME: to be removed in a future version in favor of URL
Password string `valid:"optional"` // FIXME: to be removed in a future version in favor of URL
Expand All @@ -78,7 +78,7 @@ type UserKey struct {

type UserRole struct {
gorm.Model
Name string `valid:"required,length(1|32),unix_user"`
Name string `valid:"required,length(1|255),unix_user"`
Users []*User `gorm:"many2many:user_user_roles"`
}

Expand All @@ -87,7 +87,7 @@ type User struct {
gorm.Model
Roles []*UserRole `gorm:"many2many:user_user_roles"`
Email string `valid:"required,email"`
Name string `valid:"required,length(1|32),unix_user"`
Name string `valid:"required,length(1|255),unix_user"`
Keys []*UserKey `gorm:"ForeignKey:UserID"`
Groups []*UserGroup `gorm:"many2many:user_user_groups;"`
Comment string `valid:"optional"`
Expand All @@ -96,15 +96,15 @@ type User struct {

type UserGroup struct {
gorm.Model
Name string `valid:"required,length(1|32),unix_user"`
Name string `valid:"required,length(1|255),unix_user"`
Users []*User `gorm:"many2many:user_user_groups;"`
ACLs []*ACL `gorm:"many2many:user_group_acls;"`
Comment string `valid:"optional"`
}

type HostGroup struct {
gorm.Model
Name string `valid:"required,length(1|32),unix_user"`
Name string `valid:"required,length(1|255),unix_user"`
Hosts []*Host `gorm:"many2many:host_host_groups;"`
ACLs []*ACL `gorm:"many2many:host_group_acls;"`
Comment string `valid:"optional"`
Expand Down

0 comments on commit 4c947ce

Please sign in to comment.