We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d2ca3a commit a8b09edCopy full SHA for a8b09ed
2 files changed
pkg/model/repository.go
@@ -5,6 +5,6 @@ import "gorm.io/gorm"
5
type Repository struct {
6
gorm.Model
7
UserID uint
8
- Name string
9
- Desc string
+ Name string `gorm:"uniqueIndex;not null;size:24"`
+ Desc string `gorm:"not null;size:256"`
10
}
pkg/model/user.go
@@ -7,8 +7,8 @@ import (
type User struct {
- Name string `gorm:"uniqueIndex;not null" form:"username" binding:"required"`
11
- Email string `gorm:"uniqueIndex;not null" form:"email" binding:"required"`
+ Name string `gorm:"uniqueIndex;not null;size:24" form:"username"`
+ Email string `gorm:"uniqueIndex;not null;size:24" form:"email"`
12
13
Repositories []Repository
14
0 commit comments