mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-16 13:09:33 +08:00
Synchronization code
This commit is contained in:
parent
5a39f27e41
commit
d4ce0cad3c
@ -243,6 +243,10 @@ namespace SqlSugar
|
||||
tableName = this.SqlBuilder.GetTranslationTableName(tableName);
|
||||
var columnName = string.Join(",", columnNames);
|
||||
var pkName = string.Format("PK_{0}_{1}", this.SqlBuilder.GetNoTranslationColumnName(tableName), columnName.Replace(",","_"));
|
||||
if (pkName.Length > 25 && this.Context?.CurrentConnectionConfig?.MoreSettings?.MaxParameterNameLength > 0)
|
||||
{
|
||||
pkName = "PK_" + pkName.GetNonNegativeHashCodeString();
|
||||
}
|
||||
string sql = string.Format(this.AddPrimaryKeySql, tableName,pkName, columnName);
|
||||
this.Context.Ado.ExecuteCommand(sql);
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user