From da16f7b4756ead84856448fab67ff6aeddf91f60 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Wed, 22 Jul 2020 12:13:40 +0800 Subject: [PATCH] Create extension uuid-ossp for postgres test database --- tests/postgres_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/postgres_test.go b/tests/postgres_test.go index ab47a548..a0b1fddb 100644 --- a/tests/postgres_test.go +++ b/tests/postgres_test.go @@ -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{})