From 00dc30b658938a37a743c589561029fa1c5d76ea Mon Sep 17 00:00:00 2001 From: k1LoW Date: Fri, 1 May 2020 12:57:19 +0900 Subject: [PATCH] Remove relations of excluded tables --- config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index ccda873f..0353b1d0 100644 --- a/config/config.go +++ b/config/config.go @@ -346,7 +346,7 @@ func excludeTableFromSchema(name string, s *schema.Schema) error { // ChildRelations childRelations := []*schema.Relation{} for _, r := range c.ChildRelations { - if r.Table.Name != name { + if r.Table.Name != name && r.ParentTable.Name != name { childRelations = append(childRelations, r) } } @@ -355,7 +355,7 @@ func excludeTableFromSchema(name string, s *schema.Schema) error { // ParentRelations parentRelations := []*schema.Relation{} for _, r := range c.ParentRelations { - if r.Table.Name != name { + if r.Table.Name != name && r.ParentTable.Name != name { parentRelations = append(parentRelations, r) } }