From 2858606bc7eef594e876855c89a7aaca637f33f8 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Sat, 13 Nov 2021 13:57:36 +0800 Subject: [PATCH] Update migrate_test.go --- tests/migrate_test.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/tests/migrate_test.go b/tests/migrate_test.go index 789a5e45..e243406f 100644 --- a/tests/migrate_test.go +++ b/tests/migrate_test.go @@ -70,25 +70,6 @@ func TestMigrate(t *testing.T) { } } -func TestAutoMigrateSelfReferential(t *testing.T) { - type MigratePerson struct { - ID uint - Name string - ManagerID *uint - Manager *MigratePerson - } - - DB.Migrator().DropTable(&MigratePerson{}) - - if err := DB.AutoMigrate(&MigratePerson{}); err != nil { - t.Fatalf("Failed to auto migrate, but got error %v", err) - } - - if !DB.Migrator().HasConstraint("migrate_people", "fk_migrate_people_manager") { - t.Fatalf("Failed to find has one constraint between people and managers") - } -} - func TestSmartMigrateColumn(t *testing.T) { fullSupported := map[string]bool{"mysql": true, "postgres": true}[DB.Dialector.Name()]