mirror of
https://github.com/astaxie/beego.git
synced 2025-07-03 17:20:18 +00:00
orm: add inline struct test case
This commit is contained in:
@ -25,7 +25,6 @@ import (
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
_ "github.com/lib/pq"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
|
||||
// As tidb can't use go get, so disable the tidb testing now
|
||||
// _ "github.com/pingcap/tidb"
|
||||
)
|
||||
@ -352,6 +351,30 @@ type GroupPermissions struct {
|
||||
Permission *Permission `orm:"rel(fk)"`
|
||||
}
|
||||
|
||||
type ModelID struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type ModelBase struct {
|
||||
ModelID
|
||||
|
||||
Created time.Time `orm:"auto_now_add;type(datetime)"`
|
||||
Updated time.Time `orm:"auto_now;type(datetime)"`
|
||||
}
|
||||
|
||||
type InLine struct {
|
||||
// Common Fields
|
||||
ModelBase
|
||||
|
||||
// Other Fields
|
||||
Name string `orm:"unique"`
|
||||
Email string
|
||||
}
|
||||
|
||||
func NewInLine() *InLine {
|
||||
return new(InLine)
|
||||
}
|
||||
|
||||
var DBARGS = struct {
|
||||
Driver string
|
||||
Source string
|
||||
|
Reference in New Issue
Block a user