mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 01:58:13 +08:00
Update mysql
This commit is contained in:
@@ -489,6 +489,9 @@ WHERE EVENT_OBJECT_TABLE = '" + tableName + "'");
|
||||
Check.Exception(columns.IsNullOrEmpty(), "No columns found ");
|
||||
foreach (var item in columns)
|
||||
{
|
||||
|
||||
ConvertCreateColumnInfo(item);
|
||||
|
||||
string columnName = item.DbColumnName;
|
||||
string dataSize = "";
|
||||
dataSize = GetSize(item);
|
||||
@@ -690,6 +693,23 @@ WHERE EVENT_OBJECT_TABLE = '" + tableName + "'");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private static void ConvertCreateColumnInfo(DbColumnInfo x)
|
||||
{
|
||||
string[] array = new string[] { "longtext","date" };
|
||||
|
||||
if (("nvarchar".EqualCase(x.DataType) || "varchar".EqualCase(x.DataType)))
|
||||
{
|
||||
if (x.Length < 1)
|
||||
{
|
||||
x.DataType = $"{x.DataType}(255)"; // 设置默认长度为 255,你可以根据需要修改
|
||||
}
|
||||
}
|
||||
else if (array.Contains(x.DataType?.ToLower()))
|
||||
{
|
||||
x.Length = 0;
|
||||
x.DecimalDigits = 0;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user