针对迁移分表tails为空的情况判断[#195]
This commit is contained in:
parent
e6d9864c94
commit
25a8c2ed02
|
@ -66,10 +66,13 @@ namespace ShardingCore.Helpers
|
|||
{
|
||||
if (migrationResult.CommandType == MigrationCommandTypeEnum.TableCommand)
|
||||
{
|
||||
if (migrationResult.IsShardingCommand)
|
||||
{
|
||||
migrationCommands.Remove(aAddCmd);
|
||||
}
|
||||
//如果是分表
|
||||
if (shardingCmds.IsNotEmpty())
|
||||
{
|
||||
migrationCommands.Remove(aAddCmd);
|
||||
//针对builder的原始表进行移除
|
||||
shardingCmds.ForEach(aShardingCmd =>
|
||||
{
|
||||
|
@ -154,6 +157,7 @@ namespace ShardingCore.Helpers
|
|||
if (migrationResult.InDataSource && !string.IsNullOrWhiteSpace(absTableName) &&
|
||||
existsShardingTables.ContainsKey(absTableName))
|
||||
{
|
||||
migrationResult.IsShardingCommand = true;
|
||||
var shardings = existsShardingTables[absTableName];
|
||||
shardings.ForEach(aShardingTable =>
|
||||
{
|
||||
|
|
|
@ -5,5 +5,6 @@ namespace ShardingCore.Helpers
|
|||
{
|
||||
public MigrationCommandTypeEnum CommandType { get; set; } = MigrationCommandTypeEnum.OtherCommand;
|
||||
public bool InDataSource { get; set; } = true;
|
||||
public bool IsShardingCommand { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue