ARCH-2: apply EF migrations on startup in Development

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-05 23:37:42 +02:00
parent cc589b13d0
commit 9b9cf2b35a

View File

@@ -23,6 +23,10 @@ if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
// Aspire provisions an empty database in dev — bring the schema up to date.
using var scope = app.Services.CreateScope();
scope.ServiceProvider.GetRequiredService<ApplicationContext>().Database.Migrate();
}
if (app.Environment.IsDevelopment())