From eb6515c692fe758dfaedcde6dbe841d794c0cf9a Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Fri, 22 May 2009 17:11:00 +0000 Subject: [PATCH] Fix issue #1152: Table editor tries to ADD keys in CREATE mode --- source/table_editor.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/table_editor.pas b/source/table_editor.pas index 6e74b978..90e988fd 100644 --- a/source/table_editor.pas +++ b/source/table_editor.pas @@ -521,7 +521,7 @@ begin // Add changed or added indexes for i:=0 to IndexesComposed.Count-1 do begin if OldIndexesComposed.IndexOf(IndexesComposed[i]) = -1 then - Specs.Add(IndexesComposed[i]); + Specs.Add('ADD '+IndexesComposed[i]); end; Result := 'ALTER TABLE '+Mainform.mask(AlterTableName) + CRLF + #9 + ImplodeStr(',' + CRLF + #9, Specs); @@ -606,7 +606,7 @@ var begin IndexName := Copy(IndexList[idx], 1, LastPos(REGDELIM, IndexList[idx])-1); IndexType := Copy(IndexList[idx], LastPos(REGDELIM, IndexList[idx])+1, Length(IndexList[idx])); - Result := 'ADD '; + Result := ''; if IndexType = PKEY then Result := Result + 'PRIMARY KEY ' else begin