From 22cf9719bf2a7306dd19748be83cebf96a6d55fd Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Wed, 26 Mar 2014 11:02:17 +0800 Subject: [PATCH] update test --- main_test.go | 5 +++++ 1 file changed, 5 insertions(+) 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")