Skip to content

Commit d8cd61c

Browse files
committed
fix: Initial FK names assigned in TfrmTableEditor.listForeignKeysNewText() were lacking the referencing table's table name in case the referencing table was not created yet (pr from Jochen Neubeck)
Closes #1835
1 parent 7072986 commit d8cd61c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

source/table_editor.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2998,7 +2998,7 @@ procedure TfrmTableEditor.listForeignKeysNewText(Sender: TBaseVirtualTree;
29982998
2: begin
29992999
Key.ReferenceTable := NewText;
30003000
if not Key.KeyNameWasCustomized then begin
3001-
Key.KeyName := 'FK_'+DBObject.Name+'_'+Key.ReferenceTable;
3001+
Key.KeyName := 'FK_'+editName.Text+'_'+Key.ReferenceTable;
30023002
i := 1;
30033003
NameInUse := True;
30043004
while NameInUse do begin
@@ -3008,7 +3008,7 @@ procedure TfrmTableEditor.listForeignKeysNewText(Sender: TBaseVirtualTree;
30083008
end;
30093009
if NameInUse then begin
30103010
Inc(i);
3011-
Key.KeyName := 'FK_'+DBObject.Name+'_'+Key.ReferenceTable+'_'+IntToStr(i);
3011+
Key.KeyName := 'FK_'+editName.Text+'_'+Key.ReferenceTable+'_'+IntToStr(i);
30123012
end;
30133013
end;
30143014

0 commit comments

Comments
 (0)