Update mysql

This commit is contained in:
sunkaixuan 2022-02-26 19:24:54 +08:00
parent d003d5e08d
commit d0e3efd9d8
2 changed files with 8 additions and 0 deletions

View File

@ -341,6 +341,10 @@ namespace SqlSugar.MySqlConnector
{
if (item.ColumnDescription != null)
{
if (item.UnderType == UtilConstants.GuidType && item.Length == 0)
{
item.Length = 36;
}
var mySqlCodeFirst = this.Context.CodeFirst as MySqlCodeFirst;
string sql = GetUpdateColumnSql(entity.DbTableName, mySqlCodeFirst.GetEntityColumnToDbColumn(entity, entity.DbTableName, item))+" "+(item.IsIdentity? "AUTO_INCREMENT" : "")+" " + " COMMENT '" + item.ColumnDescription + "'";
db.Ado.ExecuteCommand(sql);

View File

@ -342,6 +342,10 @@ namespace SqlSugar
if (item.ColumnDescription != null)
{
var mySqlCodeFirst = this.Context.CodeFirst as MySqlCodeFirst;
if (item.UnderType == UtilConstants.GuidType&&item.Length==0)
{
item.Length = 36;
}
string sql = GetUpdateColumnSql(entity.DbTableName, mySqlCodeFirst.GetEntityColumnToDbColumn(entity, entity.DbTableName, item))+" "+(item.IsIdentity? "AUTO_INCREMENT" : "")+" " + " COMMENT '" + item.ColumnDescription + "'";
db.Ado.ExecuteCommand(sql);
}