refactor(dotnet): move collection schema init to service
Validators (Pushes and Pull Requests) / validate-ui-and-storage (push) Successful in 18s
Validators (Pushes and Pull Requests) / validate-core (push) Failing after 1m49s

This commit is contained in:
2026-07-13 01:06:02 +09:00
parent c2cd643729
commit ae32f86685
4 changed files with 65 additions and 41 deletions
+3
View File
@@ -111,6 +111,7 @@ try
builder.Services.AddScoped<ICollectionRepository>(sp => sp.GetRequiredService<CollectionRepository>());
builder.Services.AddScoped<ICollectionReadRepository>(sp => sp.GetRequiredService<CollectionRepository>());
builder.Services.AddScoped<ICollectionWriteRepository>(sp => sp.GetRequiredService<CollectionRepository>());
builder.Services.AddSingleton<ICollectionSchemaInitializer, CollectionSchemaInitializer>();
builder.Services.AddScoped<ICollectionReadModelService, CollectionReadModelService>();
builder.Services.AddSingleton<IRuntimeAuditTrailService, RuntimeAuditTrailService>();
builder.Services.AddScoped<ITokenCache, PostgresTokenCache>();
@@ -151,10 +152,12 @@ try
var migrator = scope.ServiceProvider.GetRequiredService<DbMigrator>();
var workspaceRepo = scope.ServiceProvider.GetRequiredService<IWorkspaceRepository>();
var collectionRepo = scope.ServiceProvider.GetRequiredService<ICollectionRepository>();
var collectionSchemaInitializer = scope.ServiceProvider.GetRequiredService<ICollectionSchemaInitializer>();
var tokenCache = scope.ServiceProvider.GetRequiredService<ITokenCache>();
try
{
await collectionSchemaInitializer.InitializeAsync();
migrator.Migrate();
await workspaceRepo.GetAccountsAsync();
await collectionRepo.GetDashboardStateAsync();