Skip to content

Commit 0a985f9

Browse files
author
James Cor
committed
feedback
1 parent c9f9abb commit 0a985f9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sql/analyzer/apply_foreign_keys.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,7 @@ func getForeignKeyRefActions(ctx *sql.Context, a *Analyzer, tbl sql.ForeignKeyTa
385385
return nil, err
386386
}
387387

388-
fkChain = fkChain.AddForeignKey(fk.Name)
389-
childEditor, err := getForeignKeyEditor(ctx, a, childTbl, cache, fkChain, checkRows)
388+
childEditor, err := getForeignKeyEditor(ctx, a, childTbl, cache, fkChain.AddForeignKey(fk.Name), checkRows)
390389
if err != nil {
391390
return nil, err
392391
}
@@ -569,6 +568,9 @@ func (chain foreignKeyChain) AddTable(dbName string, tblName string) foreignKeyC
569568
for fkName := range chain.fkNames {
570569
newFkNames[fkName] = struct{}{}
571570
}
571+
for fkTable := range chain.fkTables {
572+
newFkTables[fkTable] = struct{}{}
573+
}
572574
newFkTables[newForeignKeyTableName(dbName, tblName)] = struct{}{}
573575
return foreignKeyChain{
574576
fkNames: newFkNames,

0 commit comments

Comments
 (0)