mirror of https://github.com/go-gorm/gorm.git
update test
This commit is contained in:
parent
663c06cfb1
commit
22cf9719bf
|
@ -169,6 +169,7 @@ func init() {
|
||||||
db.Exec("drop table addresses")
|
db.Exec("drop table addresses")
|
||||||
db.Exec("drop table credit_cards")
|
db.Exec("drop table credit_cards")
|
||||||
db.Exec("drop table roles")
|
db.Exec("drop table roles")
|
||||||
|
db.Exec("drop table companies")
|
||||||
|
|
||||||
if err = db.CreateTable(&User{}).Error; err != nil {
|
if err = db.CreateTable(&User{}).Error; err != nil {
|
||||||
panic(fmt.Sprintf("No error should happen when create table, but got %+v", err))
|
panic(fmt.Sprintf("No error should happen when create table, but got %+v", err))
|
||||||
|
@ -194,6 +195,10 @@ func init() {
|
||||||
panic(fmt.Sprintf("No error should happen when create table, but got %+v", err))
|
panic(fmt.Sprintf("No error should happen when create table, but got %+v", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err = db.AutoMigrate(Role{}).Error; err != nil {
|
||||||
|
panic(fmt.Sprintf("No error should happen when create table, but got %+v", err))
|
||||||
|
}
|
||||||
|
|
||||||
var shortForm = "2006-01-02 15:04:05"
|
var shortForm = "2006-01-02 15:04:05"
|
||||||
t1, _ = time.Parse(shortForm, "2000-10-27 12:02:40")
|
t1, _ = time.Parse(shortForm, "2000-10-27 12:02:40")
|
||||||
t2, _ = time.Parse(shortForm, "2002-01-01 00:00:00")
|
t2, _ = time.Parse(shortForm, "2002-01-01 00:00:00")
|
||||||
|
|
Loading…
Reference in New Issue