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:
@@ -23,6 +23,10 @@ if (app.Environment.IsDevelopment())
|
|||||||
{
|
{
|
||||||
app.UseSwagger();
|
app.UseSwagger();
|
||||||
app.UseSwaggerUI();
|
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())
|
if (app.Environment.IsDevelopment())
|
||||||
|
|||||||
Reference in New Issue
Block a user