diff --git a/main_test.go b/main_test.go index 2852395b..5e8e3070 100644 --- a/main_test.go +++ b/main_test.go @@ -169,6 +169,7 @@ func init() { db.Exec("drop table addresses") db.Exec("drop table credit_cards") db.Exec("drop table roles") + db.Exec("drop table companies") if err = db.CreateTable(&User{}).Error; err != nil { 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)) } + 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" t1, _ = time.Parse(shortForm, "2000-10-27 12:02:40") t2, _ = time.Parse(shortForm, "2002-01-01 00:00:00")