|
|
@@ -367,10 +367,11 @@ public static class SqlSugarSetup
|
|
|
var db = iTenant.GetConnectionScope(config.ConfigId);
|
|
|
db.DbMaintenance.CreateDatabase();
|
|
|
|
|
|
- // 获取所有系统表-初始化租户库表结构
|
|
|
- var entityTypes = App.EffectiveTypes.Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass &&
|
|
|
- u.IsDefined(typeof(SugarTable), false) && !u.IsDefined(typeof(SysTableAttribute), false) && !u.IsDefined(typeof(TenantAttribute), false)).ToList();
|
|
|
+ // 获取所有业务表-初始化租户库表结构(排除系统表、日志表、特定库表)
|
|
|
+ var entityTypes = App.EffectiveTypes.Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass && u.IsDefined(typeof(SugarTable), false) &&
|
|
|
+ !u.IsDefined(typeof(SysTableAttribute), false) && !u.IsDefined(typeof(LogTableAttribute), false) && !u.IsDefined(typeof(TenantAttribute), false)).ToList();
|
|
|
if (!entityTypes.Any()) return;
|
|
|
+
|
|
|
foreach (var entityType in entityTypes)
|
|
|
{
|
|
|
var splitTable = entityType.GetCustomAttribute<SplitTableAttribute>();
|