mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update mysql
This commit is contained in:
parent
d003d5e08d
commit
d0e3efd9d8
@ -341,6 +341,10 @@ namespace SqlSugar.MySqlConnector
|
|||||||
{
|
{
|
||||||
if (item.ColumnDescription != null)
|
if (item.ColumnDescription != null)
|
||||||
{
|
{
|
||||||
|
if (item.UnderType == UtilConstants.GuidType && item.Length == 0)
|
||||||
|
{
|
||||||
|
item.Length = 36;
|
||||||
|
}
|
||||||
var mySqlCodeFirst = this.Context.CodeFirst as MySqlCodeFirst;
|
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 + "'";
|
string sql = GetUpdateColumnSql(entity.DbTableName, mySqlCodeFirst.GetEntityColumnToDbColumn(entity, entity.DbTableName, item))+" "+(item.IsIdentity? "AUTO_INCREMENT" : "")+" " + " COMMENT '" + item.ColumnDescription + "'";
|
||||||
db.Ado.ExecuteCommand(sql);
|
db.Ado.ExecuteCommand(sql);
|
||||||
|
@ -342,6 +342,10 @@ namespace SqlSugar
|
|||||||
if (item.ColumnDescription != null)
|
if (item.ColumnDescription != null)
|
||||||
{
|
{
|
||||||
var mySqlCodeFirst = this.Context.CodeFirst as MySqlCodeFirst;
|
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 + "'";
|
string sql = GetUpdateColumnSql(entity.DbTableName, mySqlCodeFirst.GetEntityColumnToDbColumn(entity, entity.DbTableName, item))+" "+(item.IsIdentity? "AUTO_INCREMENT" : "")+" " + " COMMENT '" + item.ColumnDescription + "'";
|
||||||
db.Ado.ExecuteCommand(sql);
|
db.Ado.ExecuteCommand(sql);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user