diff --git a/barkmanAPI/Program.cs b/barkmanAPI/Program.cs index 5840703..19d4ed2 100644 --- a/barkmanAPI/Program.cs +++ b/barkmanAPI/Program.cs @@ -75,5 +75,10 @@ app.MapDelete("/inventory/{id}", async (int id, BarkContext db) => return Results.Ok(new { Message = "Inventory item deleted successfully" }); }); +using (var serviceScope = app.Services.CreateScope()) +{ + var dbContext = serviceScope.ServiceProvider.GetRequiredService(); + dbContext.Database.Migrate(); +} -app.Run(); \ No newline at end of file +app.Run();