1
0
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:
slene
2013-08-22 21:19:58 +08:00
parent 02d2990576
commit 4c061feddf
4 changed files with 90 additions and 1 deletions

View File

@ -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