Create extension uuid-ossp for postgres test database

This commit is contained in:
Jinzhu 2020-07-22 12:13:40 +08:00
parent 0546b59743
commit da16f7b475
1 changed files with 4 additions and 0 deletions

View File

@ -55,6 +55,10 @@ func TestMany2ManyWithDefaultValueUUID(t *testing.T) {
t.Skip()
}
if err := DB.Exec(`create extension if not exists "uuid-ossp"`).Error; err != nil {
t.Fatalf("Failed to create 'uuid-ossp' extension, but got error %v", err)
}
DB.Migrator().DropTable(&Post{}, &Category{}, "post_categories")
DB.AutoMigrate(&Post{}, &Category{})