1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-03 16:40:18 +00:00

orm fix create index

This commit is contained in:
slene
2013-08-25 13:50:50 +08:00
parent 7c72b2dca7
commit 6686d9235c
2 changed files with 8 additions and 1 deletions

View File

@ -81,6 +81,7 @@ type User struct {
func (u *User) TableIndex() [][]string {
return [][]string{
[]string{"Id", "UserName"},
[]string{"Id", "Created"},
}
}
@ -121,6 +122,12 @@ type Post struct {
Tags []*Tag `orm:"rel(m2m)"`
}
func (u *Post) TableIndex() [][]string {
return [][]string{
[]string{"Id", "Created"},
}
}
func NewPost() *Post {
obj := new(Post)
return obj