Update core

This commit is contained in:
sunkaixuan
2022-04-14 15:31:07 +08:00
parent 68a1710ff5
commit dc0bedc32a
2 changed files with 5 additions and 1 deletions

View File

@@ -318,6 +318,8 @@ namespace SqlSugar
string sql = string.Format(CreateIndexSql,this.SqlBuilder.GetTranslationTableName(tableName),string.Join(",",columnNames.Select(it=>this.SqlBuilder.GetTranslationColumnName(it))), string.Join("_", columnNames) + this.Context.CurrentConnectionConfig.IndexSuffix, isUnique ? "UNIQUE" : "");
sql = sql.Replace("_" + this.SqlBuilder.SqlTranslationLeft, "_");
sql = sql.Replace( this.SqlBuilder.SqlTranslationRight+"_", "_");
sql = sql.Replace(this.SqlBuilder.SqlTranslationLeft+ this.SqlBuilder.SqlTranslationLeft, this.SqlBuilder.SqlTranslationLeft);
sql = sql.Replace(this.SqlBuilder.SqlTranslationRight + this.SqlBuilder.SqlTranslationRight, this.SqlBuilder.SqlTranslationRight);
this.Context.Ado.ExecuteCommand(sql);
return true;
}
@@ -326,6 +328,8 @@ namespace SqlSugar
string sql = string.Format(CreateIndexSql, this.SqlBuilder.GetTranslationTableName(tableName), string.Join(",", columnNames.Select(it => this.SqlBuilder.GetTranslationColumnName(it))), string.Join("_", columnNames) + this.Context.CurrentConnectionConfig.IndexSuffix + "_Unique","UNIQUE" );
sql = sql.Replace("_" + this.SqlBuilder.SqlTranslationLeft, "_");
sql = sql.Replace(this.SqlBuilder.SqlTranslationRight + "_", "_");
sql = sql.Replace(this.SqlBuilder.SqlTranslationLeft + this.SqlBuilder.SqlTranslationLeft, this.SqlBuilder.SqlTranslationLeft);
sql = sql.Replace(this.SqlBuilder.SqlTranslationRight + this.SqlBuilder.SqlTranslationRight, this.SqlBuilder.SqlTranslationRight);
this.Context.Ado.ExecuteCommand(sql);
return true;
}