mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-16 16:50:41 +08:00
Update split table create table
This commit is contained in:
parent
704f980133
commit
6f8eeaedb3
@ -8,6 +8,7 @@ namespace SqlSugar
|
||||
{
|
||||
public class SplitInsertable<T> where T:class ,new()
|
||||
{
|
||||
private static readonly object SplitLockObj = new object();
|
||||
public SqlSugarProvider Context;
|
||||
internal SplitTableContext Helper;
|
||||
public EntityInfo EntityInfo;
|
||||
@ -212,6 +213,10 @@ namespace SqlSugar
|
||||
var isLog = this.Context.Ado.IsEnableLogEvent;
|
||||
this.Context.Ado.IsEnableLogEvent = false;
|
||||
foreach (var item in TableNames.GroupBy(it=>it.Key).Select(it=>it).ToDictionary(it=>it.Key,it=>it.First().Value))
|
||||
{
|
||||
if (!this.Context.DbMaintenance.IsAnyTable(item.Key, false))
|
||||
{
|
||||
lock (SplitLockObj)
|
||||
{
|
||||
if (!this.Context.DbMaintenance.IsAnyTable(item.Key, false))
|
||||
{
|
||||
@ -222,6 +227,8 @@ namespace SqlSugar
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.Context.Ado.IsEnableLogEvent = isLog;
|
||||
this.Context.MappingTables.Add(EntityInfo.EntityName, EntityInfo.DbTableName);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user