- 修复 AsTreeCte 开启自动迁移时,错误的创建了 as_tree_cte 表;#476

This commit is contained in:
28810
2020-09-26 14:30:40 +08:00
parent 5a664180c2
commit 8fb330b528
6 changed files with 99 additions and 66 deletions

View File

@ -451,6 +451,8 @@ public static partial class FreeSqlGlobalExtensions
});
sql2ctePath = $"{sql2ctePath} as cte_path, ";
}
if (select._orm.CodeFirst.IsAutoSyncStructure)
(select._orm.CodeFirst as CodeFirstProvider)._dicSycedTryAdd(tb.Type, cteName); //#476
var sql2 = select
.AsAlias((type, old) => type == tb.Type ? old.Replace("wct2", "wct1") : old)
.AsTable((type, old) => type == tb.Type ? cteName : old)