@@ -195,31 +195,34 @@ public override string ToCreateTableStatement(Type tableType)
195195 return sql . ToString ( ) ;
196196 }
197197
198- public string GetColumnDefinition ( FieldDefinition fieldDefinition )
198+ public string GetColumnDefinition ( FieldDefinition fieldDef )
199199 {
200- if ( fieldDefinition . PropertyInfo . FirstAttribute < TextAttribute > ( ) != null )
200+ if ( fieldDef . PropertyInfo . FirstAttribute < TextAttribute > ( ) != null )
201201 {
202202 var sql = new StringBuilder ( ) ;
203- sql . AppendFormat ( "{0} {1}" , GetQuotedColumnName ( fieldDefinition . FieldName ) , TextColumnDefinition ) ;
204- sql . Append ( fieldDefinition . IsNullable ? " NULL" : " NOT NULL" ) ;
203+ sql . AppendFormat ( "{0} {1}" , GetQuotedColumnName ( fieldDef . FieldName ) , TextColumnDefinition ) ;
204+ sql . Append ( fieldDef . IsNullable ? " NULL" : " NOT NULL" ) ;
205205 return sql . ToString ( ) ;
206206 }
207207
208208 var ret = base . GetColumnDefinition (
209- fieldDefinition . FieldName ,
210- fieldDefinition . ColumnType ,
211- fieldDefinition . IsPrimaryKey ,
212- fieldDefinition . AutoIncrement ,
213- fieldDefinition . IsNullable ,
214- fieldDefinition . IsRowVersion ,
215- fieldDefinition . FieldLength ,
209+ fieldDef . FieldName ,
210+ fieldDef . ColumnType ,
211+ fieldDef . IsPrimaryKey ,
212+ fieldDef . AutoIncrement ,
213+ fieldDef . IsNullable ,
214+ fieldDef . IsRowVersion ,
215+ fieldDef . FieldLength ,
216216 null ,
217- fieldDefinition . DefaultValue ,
218- fieldDefinition . CustomFieldDefinition ) ;
217+ fieldDef . DefaultValue ,
218+ fieldDef . CustomFieldDefinition ) ;
219219
220- if ( fieldDefinition . IsRowVersion )
220+ if ( fieldDef . IsRowVersion )
221221 return ret + " DEFAULT 1" ;
222222
223+ if ( fieldDef . ColumnType == typeof ( Decimal ) )
224+ return base . ReplaceDecimalColumnDefinition ( ret , fieldDef . FieldLength , fieldDef . Scale ) ;
225+
223226 return ret ;
224227 }
225228
0 commit comments