Просмотр исходного кода

修复初始化种子数据的bug

富鑫 刘 4 лет назад
Родитель
Сommit
57ae425731
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs

+ 1 - 0
Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs

@@ -177,6 +177,7 @@ public static class SqlSugarSetup
             var provider = db.GetConnectionScope(tAtt == null ? SqlSugarConst.ConfigId : tAtt.configId);
 
             var seedDataTable = seedData.ToList().ToDataTable();
+            seedDataTable.TableName = db.EntityMaintenance.GetEntityInfo(entityType).DbTableName;
             if (seedDataTable.Columns.Contains(SqlSugarConst.PrimaryKey))
             {
                 var storage = provider.Storageable(seedDataTable).WhereColumns(SqlSugarConst.PrimaryKey).ToStorage();