- 修复 CodeFirst + AsTable + 自动迁移,导致索性名重复的问题 #366;

This commit is contained in:
28810
2020-07-12 12:34:55 +08:00
parent 9c3b5b15c4
commit 8c38922331
30 changed files with 157 additions and 90 deletions

View File

@ -9,6 +9,7 @@ using System.Data.Common;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace FreeSql.Internal.CommonProvider
@ -124,5 +125,7 @@ namespace FreeSql.Internal.CommonProvider
}
public virtual int ExecuteDDLStatements(string ddl) => _orm.Ado.ExecuteNonQuery(CommandType.Text, ddl);
public static string ReplaceIndexName(string indexName, string tbname) => string.IsNullOrEmpty(indexName) ? indexName : Regex.Replace(indexName, @"\{\s*TableName\s*\}", tbname, RegexOptions.IgnoreCase);
}
}