From 73d44a4f97c1e7ed703ca16eeb589525f15decb8 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Tue, 16 Feb 2021 08:39:04 +0800 Subject: [PATCH] Fix create duplicated constraint, close #4090 --- tests/migrate_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/migrate_test.go b/tests/migrate_test.go index 51843062..16c48405 100644 --- a/tests/migrate_test.go +++ b/tests/migrate_test.go @@ -38,7 +38,6 @@ func TestMigrate(t *testing.T) { {"user_friends", "fk_user_friends_friends"}, {"accounts", "fk_users_account"}, {"users", "fk_users_team"}, - {"users", "fk_users_manager"}, {"users", "fk_users_company"}, } { if !DB.Migrator().HasConstraint(indexes[0], indexes[1]) { @@ -335,7 +334,7 @@ func TestMigrateConstraint(t *testing.T) { t.Skip() } - names := []string{"Account", "fk_users_account", "Pets", "fk_users_pets", "Company", "fk_users_company", "Manager", "fk_users_manager", "Team", "fk_users_team", "Languages", "fk_users_languages"} + names := []string{"Account", "fk_users_account", "Pets", "fk_users_pets", "Company", "fk_users_company", "Team", "fk_users_team", "Languages", "fk_users_languages"} for _, name := range names { if !DB.Migrator().HasConstraint(&User{}, name) {