Fix issue #1152: Table editor tries to ADD keys in CREATE mode

This commit is contained in:
Ansgar Becker
2009-05-22 17:11:00 +00:00
parent bece59d669
commit eb6515c692

View File

@@ -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