This commit is contained in:
@@ -74,4 +74,11 @@ app.MapRazorComponents<App>()
|
||||
// Add additional endpoints required by the Identity /Account Razor components.
|
||||
app.MapAdditionalIdentityEndpoints();
|
||||
|
||||
// Appliquer les migrations automatiquement lors du démarrage
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var dbContext = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
||||
dbContext.Database.Migrate(); // Applique les migrations
|
||||
}
|
||||
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user