If user disables "Allow NULL" for some column which has NULL as default value, silently change that default value to "No default", instead of "Custom text". Additionally, this fixes the default text "NULL" as literal in such cases.

This commit is contained in:
Ansgar Becker
2010-01-17 15:23:11 +00:00
parent 5890aad90f
commit c85ed71ba0

View File

@ -1204,8 +1204,10 @@ begin
5: begin 5: begin
Col.AllowNull := not Col.AllowNull; Col.AllowNull := not Col.AllowNull;
// Switch default value from NULL to Text if Allow Null is off // Switch default value from NULL to Text if Allow Null is off
if (not Col.AllowNull) and (Col.DefaultType in [cdtNull, cdtNullUpdateTS]) then if (not Col.AllowNull) and (Col.DefaultType in [cdtNull, cdtNullUpdateTS]) then begin
Col.DefaultType := cdtText; Col.DefaultType := cdtNothing;
Col.DefaultText := '';
end;
Col.Status := esModified; Col.Status := esModified;
VT.InvalidateNode(Node); VT.InvalidateNode(Node);
end; end;