mirror of
https://github.com/astaxie/beego.git
synced 2025-07-03 16:40:18 +00:00
orm support custom multi unique / index
This commit is contained in:
@ -78,6 +78,18 @@ type User struct {
|
||||
ShouldSkip string `orm:"-"`
|
||||
}
|
||||
|
||||
func (u *User) TableIndex() [][]string {
|
||||
return [][]string{
|
||||
[]string{"Id", "UserName"},
|
||||
}
|
||||
}
|
||||
|
||||
func (u *User) TableUnique() [][]string {
|
||||
return [][]string{
|
||||
[]string{"UserName", "Email"},
|
||||
}
|
||||
}
|
||||
|
||||
func NewUser() *User {
|
||||
obj := new(User)
|
||||
return obj
|
||||
|
Reference in New Issue
Block a user