mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-17 10:41:56 +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()
|
public class SplitInsertable<T> where T:class ,new()
|
||||||
{
|
{
|
||||||
|
private static readonly object SplitLockObj = new object();
|
||||||
public SqlSugarProvider Context;
|
public SqlSugarProvider Context;
|
||||||
internal SplitTableContext Helper;
|
internal SplitTableContext Helper;
|
||||||
public EntityInfo EntityInfo;
|
public EntityInfo EntityInfo;
|
||||||
@ -215,10 +216,16 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
if (!this.Context.DbMaintenance.IsAnyTable(item.Key, false))
|
if (!this.Context.DbMaintenance.IsAnyTable(item.Key, false))
|
||||||
{
|
{
|
||||||
if (item.Value != null)
|
lock (SplitLockObj)
|
||||||
{
|
{
|
||||||
this.Context.MappingTables.Add(EntityInfo.EntityName, item.Key);
|
if (!this.Context.DbMaintenance.IsAnyTable(item.Key, false))
|
||||||
this.Context.CodeFirst.InitTables<T>();
|
{
|
||||||
|
if (item.Value != null)
|
||||||
|
{
|
||||||
|
this.Context.MappingTables.Add(EntityInfo.EntityName, item.Key);
|
||||||
|
this.Context.CodeFirst.InitTables<T>();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user