Add deployment
This commit is contained in:
@@ -120,13 +120,15 @@ try
|
||||
ResponseWriter = HealthCheckResponseWriter.WriteAsync
|
||||
});
|
||||
|
||||
if (!app.Environment.IsEnvironment("Testing"))
|
||||
// Startup migration is the proven path for this single-instance edge host.
|
||||
// Gate with Gateway:AutoMigrate so production can switch to an out-of-band
|
||||
// EF migration bundle later without a code change (Phase 36 Step 6).
|
||||
if (!app.Environment.IsEnvironment("Testing")
|
||||
&& builder.Configuration.GetValue("Gateway:AutoMigrate", true))
|
||||
{
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var db = scope.ServiceProvider.GetRequiredService<GatewayDbContext>();
|
||||
await db.Database.MigrateAsync();
|
||||
}
|
||||
using var scope = app.Services.CreateScope();
|
||||
var db = scope.ServiceProvider.GetRequiredService<GatewayDbContext>();
|
||||
await db.Database.MigrateAsync();
|
||||
}
|
||||
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user