diff --git a/source/dbconnection.pas b/source/dbconnection.pas index 3d3b80ad..7d3995b1 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -31,6 +31,7 @@ type TTableColumn = class(TPersistent) private FConnection: TDBConnection; + FStatus: TEditingStatus; procedure SetStatus(Value: TEditingStatus); public Name, OldName: String; @@ -42,7 +43,6 @@ type OnUpdateType: TColumnDefaultType; OnUpdateText: String; Comment, Charset, Collation, Expression, Virtuality: String; - FStatus: TEditingStatus; constructor Create(AOwner: TDBConnection; Serialized: String=''); destructor Destroy; override; procedure Assign(Source: TPersistent); override; diff --git a/source/table_editor.pas b/source/table_editor.pas index b05a9870..b10a1416 100644 --- a/source/table_editor.pas +++ b/source/table_editor.pas @@ -542,7 +542,7 @@ begin // Also, do this after the data type was altered, if from TEXT > VARCHAR e.g. for i:=0 to FColumns.Count-1 do begin if (Conn.Parameters.IsAnyMySQL or Conn.Parameters.IsAnyPostgreSQL) - and (FColumns[i].FStatus = esModified) + and (FColumns[i].Status = esModified) and (FColumns[i].DefaultType = cdtNothing) and (FColumns[i].OldDataType.HasDefault) then