mirror of https://github.com/go-gorm/gorm.git
Add auto migration
This commit is contained in:
parent
331d8ceabd
commit
58f379b098
|
@ -66,6 +66,7 @@ func TestStringPrimaryKey(t *testing.T) {
|
||||||
ID string `gorm:"primary_key"`
|
ID string `gorm:"primary_key"`
|
||||||
Name string
|
Name string
|
||||||
}
|
}
|
||||||
|
DB.AutoMigrate(&UUIDStruct{})
|
||||||
|
|
||||||
data := UUIDStruct{ID: "uuid", Name: "hello"}
|
data := UUIDStruct{ID: "uuid", Name: "hello"}
|
||||||
if err := DB.Save(&data).Error; err != nil || data.ID != "uuid" {
|
if err := DB.Save(&data).Error; err != nil || data.ID != "uuid" {
|
||||||
|
|
Loading…
Reference in New Issue