add tablename
This commit is contained in:
parent
d33b559293
commit
b093fecb65
@ -84,9 +84,7 @@ func TestMany2ManyWithDefaultValueUUID(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DB.Migrator().DropTable(&Post{}, &Category{}, "post_categories")
|
DB.Migrator().DropTable(&Post{}, &Category{}, "post_categories")
|
||||||
if err := DB.AutoMigrate(&Post{}, &Category{}).Error(); err != nil {
|
DB.AutoMigrate(&Post{}, &Category{})
|
||||||
t.Log(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
post := Post{
|
post := Post{
|
||||||
Title: "Hello World",
|
Title: "Hello World",
|
||||||
@ -96,7 +94,7 @@ func TestMany2ManyWithDefaultValueUUID(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := DB.Create(&post).Error; err != nil {
|
if err := DB.Table("posts").Create(&post).Error; err != nil {
|
||||||
t.Errorf("Failed, got error: %v", err)
|
t.Errorf("Failed, got error: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user