mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Synchronization code
This commit is contained in:
parent
a0c6cf1fd6
commit
6aa268f305
@ -597,7 +597,7 @@ namespace SqlSugar
|
||||
return properyTypeName.ToLower() != dataType.ToLower();
|
||||
}
|
||||
}
|
||||
private static string GetType(string name)
|
||||
protected string GetType(string name)
|
||||
{
|
||||
if (name.IsContainsIn("UInt32", "UInt16", "UInt64"))
|
||||
{
|
||||
|
@ -81,5 +81,33 @@ namespace SqlSugar
|
||||
{
|
||||
return EntityColumnToDbColumn(entity,dbTableName,item);
|
||||
}
|
||||
|
||||
protected override void GetDbType(EntityColumnInfo item, Type propertyType, DbColumnInfo result)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.DataType))
|
||||
{
|
||||
result.DataType = item.DataType;
|
||||
}
|
||||
else if (propertyType.IsEnum())
|
||||
{
|
||||
result.DataType = this.Context.Ado.DbBind.GetDbTypeName(item.Length > 9 ? UtilConstants.LongType.Name : UtilConstants.IntType.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
var name = GetType(propertyType.Name);
|
||||
if (name == "Boolean")
|
||||
{
|
||||
result.DataType = "tinyint";
|
||||
result.Length = 1;
|
||||
result.Scale = 0;
|
||||
result.DecimalDigits = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.DataType = this.Context.Ado.DbBind.GetDbTypeName(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user