From 58f379b098dfaa2614b5705ed97dc7ed5d01d26e Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Mon, 1 Jun 2015 11:17:51 +0800 Subject: [PATCH] Add auto migration --- main_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/main_test.go b/main_test.go index 666ba564..0dc5e337 100644 --- a/main_test.go +++ b/main_test.go @@ -66,6 +66,7 @@ func TestStringPrimaryKey(t *testing.T) { ID string `gorm:"primary_key"` Name string } + DB.AutoMigrate(&UUIDStruct{}) data := UUIDStruct{ID: "uuid", Name: "hello"} if err := DB.Save(&data).Error; err != nil || data.ID != "uuid" {