Implemented new models
Signed-off-by: kolaente <konrad@kola-entertainments.de>
This commit is contained in:
parent
c5592ad45b
commit
f8a6b57c33
|
@ -0,0 +1,13 @@
|
|||
package models
|
||||
|
||||
type Author struct {
|
||||
ID int64 `xorm:"int(11) autoincr not null unique pk"`
|
||||
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"
|
||||
}
|
|
@ -29,6 +29,8 @@ func SetEngine() (err error) {
|
|||
// Sync dat shit
|
||||
x.Sync(&Book{})
|
||||
x.Sync(&User{})
|
||||
x.Sync(&Publisher{})
|
||||
x.Sync(&Author{})
|
||||
|
||||
x.ShowSQL(true)
|
||||
return nil
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package models
|
||||
|
||||
type Publisher struct {
|
||||
ID int64 `xorm:"int(11) autoincr not null unique pk"`
|
||||
Name string `xorm:"varchar(250) not null"`
|
||||
Created int64 `xorm:"created"`
|
||||
Updated int64 `xorm:"updated"`
|
||||
}
|
||||
|
||||
func (Publisher) TableName() string {
|
||||
return "publishers"
|
||||
}
|
Loading…
Reference in New Issue