fix: seed production defaults and harden onboarding

This commit is contained in:
2026-08-22 23:18:27 +08:00
parent acf6356ba6
commit c6f98b5445
5 changed files with 182 additions and 62 deletions
+6 -3
View File
@@ -168,9 +168,12 @@ using (var scope = app.Services.CreateScope())
await db.Database.MigrateAsync();
await AppConfigDefaults.EnsureAsync(db);
await scope.ServiceProvider.GetRequiredService<AdminBootstrapService>().EnsureAsync();
if (app.Environment.IsDevelopment())
await DbSeeder.SeedAsync(db);
}
// These records are runtime defaults, not development fixtures. Production
// databases also need them for onboarding, category fallback and stickers.
// DbSeeder only inserts into an empty catalog, so existing admin-managed
// records are preserved.
await DbSeeder.SeedAsync(db);
}
if (app.Environment.IsDevelopment())
app.MapOpenApi();