From da5fa29c76680a0d35494b2c6f6d7701b7056bd4 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 6 Jul 2022 15:27:41 +0800 Subject: [PATCH] Update TableDifferenceProvider.cs --- .../Abstract/CodeFirstProvider/TableDifferenceProvider.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/TableDifferenceProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/TableDifferenceProvider.cs index 823ab625f..753c45c41 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/TableDifferenceProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/CodeFirstProvider/TableDifferenceProvider.cs @@ -58,6 +58,8 @@ namespace SqlSugar foreach (var tableInfo in tableInfos) { TableDifferenceInfo addItem = new TableDifferenceInfo(); + if (tableInfo.OldTableInfo == null) + tableInfo.OldTableInfo = new DbTableInfo(); addItem.TableName = tableInfo.OldTableInfo.Name; addItem.AddColums = GetAddColumn(tableInfo); addItem.UpdateColums = GetUpdateColumn(tableInfo);