2017-10-10 09:20:16 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
type Author struct {
|
2017-10-10 10:06:34 +00:00
|
|
|
ID int64 `xorm:"int(11) autoincr not null unique pk"`
|
2017-10-10 09:20:16 +00:00
|
|
|
Forename string `xorm:"varchar(250)"`
|
|
|
|
Lastame string `xorm:"varchar(250) not null"`
|
|
|
|
Created int64 `xorm:"created"`
|
|
|
|
Updated int64 `xorm:"updated"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (Author) TableName() string {
|
|
|
|
return "authors"
|
2017-10-10 10:06:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type AuthorBook struct {
|
|
|
|
ID int64 `xorm:"int(11) autoincr not null unique pk"`
|
|
|
|
AuthorID int64 `xorm:"int(11)"`
|
|
|
|
BookID int64 `xorm:"int(11)"`
|
|
|
|
|
|
|
|
Created int64 `xorm:"created"`
|
|
|
|
Updated int64 `xorm:"updated"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (AuthorBook) TableName() string {
|
|
|
|
return "authors_books"
|
2017-10-10 09:20:16 +00:00
|
|
|
}
|