Synchronization code

This commit is contained in:
sunkaixuan 2023-09-23 17:02:52 +08:00
parent aa0f9d18af
commit 27a1b8562e
2 changed files with 10 additions and 1 deletions

View File

@ -695,6 +695,14 @@ namespace SqlSugar
{
addItem = addItem.ObjToInt();
}
else if (prop.PropertyType == UtilConstants.ShortType)
{
addItem = Convert.ToInt16(addItem);
}
else if (prop.PropertyType == UtilConstants.LongType)
{
addItem = Convert.ToInt64(addItem);
}
else if (UtilMethods.GetUnderType(prop.PropertyType) == UtilConstants.IntType && addItem != null)
{
addItem = addItem.ObjToInt();

View File

@ -571,7 +571,8 @@ WHERE table_name = '"+tableName+"'");
}
else
{
this.Context.DbMaintenance.AddPrimaryKey(tableName, string.Join(",", pkColumns.Select(it=> this.SqlBuilder.GetTranslationColumnName(it.DbColumnName)).ToArray()));
var addItems = pkColumns.Select(it => it.DbColumnName).ToArray();
this.Context.DbMaintenance.AddPrimaryKeys(tableName, addItems);
}
}
return true;