mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 14:04:44 +08:00
Update mysql
This commit is contained in:
parent
223fea5518
commit
2e2d4d2522
@ -489,6 +489,9 @@ WHERE EVENT_OBJECT_TABLE = '" + tableName + "'");
|
|||||||
Check.Exception(columns.IsNullOrEmpty(), "No columns found ");
|
Check.Exception(columns.IsNullOrEmpty(), "No columns found ");
|
||||||
foreach (var item in columns)
|
foreach (var item in columns)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
ConvertCreateColumnInfo(item);
|
||||||
|
|
||||||
string columnName = item.DbColumnName;
|
string columnName = item.DbColumnName;
|
||||||
string dataSize = "";
|
string dataSize = "";
|
||||||
dataSize = GetSize(item);
|
dataSize = GetSize(item);
|
||||||
@ -690,6 +693,23 @@ WHERE EVENT_OBJECT_TABLE = '" + tableName + "'");
|
|||||||
return false;
|
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
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user