Browse Source

Update mysql

pull/14/head
sunkaixuan 3 years ago
parent
commit
d0e3efd9d8
  1. 4
      Src/Asp.Net/SqlSugar.MySqlConnector/MySql/DbMaintenance/MySqlDbMaintenance.cs
  2. 4
      Src/Asp.Net/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs

4
Src/Asp.Net/SqlSugar.MySqlConnector/MySql/DbMaintenance/MySqlDbMaintenance.cs

@ -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);

4
Src/Asp.Net/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs

@ -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);
}

Loading…
Cancel
Save