forked from gongxuegit/tiku-backend.net
feat: enforce tenant isolation and shared question bank
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
using Tiku.Application.Security;
|
||||
using Tiku.Infrastructure.Persistence;
|
||||
|
||||
namespace Tiku.DbMigrator;
|
||||
@@ -17,6 +18,8 @@ public sealed class DesignTimeTikuDbContextFactory : IDesignTimeDbContextFactory
|
||||
npgsql.MigrationsAssembly(typeof(TikuDbContext).Assembly.FullName))
|
||||
.Options;
|
||||
|
||||
return new TikuDbContext(options);
|
||||
var tenantContext = new TenantContext();
|
||||
tenantContext.InitializeSystem(null, "EF Core design-time model generation");
|
||||
return new TikuDbContext(options, tenantContext);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user