Exclude text and blob columns for ALTER col DROP DEFAULT query. Fixes issue #2361.

This commit is contained in:
Ansgar Becker
2011-04-17 08:50:31 +00:00
parent 77c5b3e219
commit 14d21a9925

View File

@ -488,7 +488,10 @@ begin
// ALTER TABLE ... CHANGE COLUMN query, as there is no "no default" clause, nor by
// appending an ALTER COLUMN ... DROP DEFAULT, without getting an "unknown column" error
for i:=0 to FColumns.Count-1 do begin
if (FColumns[i].FStatus = esModified) and (FColumns[i].DefaultType = cdtNothing) then
if (FColumns[i].FStatus = esModified)
and (FColumns[i].DefaultType = cdtNothing)
and (FColumns[i].DataType.HasDefault)
then
Specs.Add('ALTER '+DBObject.Connection.QuoteIdent(FColumns[i].OldName)+' DROP DEFAULT');
end;
AddQuery;