From 2e1a3b0dcc7dbaa338ccbab0d5f1409d21156d24 Mon Sep 17 00:00:00 2001 From: Drew Rautenberg Date: Sun, 12 Jan 2025 19:41:55 -0600 Subject: [PATCH] shits fucked? --- barkmanAPI/Program.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/barkmanAPI/Program.cs b/barkmanAPI/Program.cs index 5840703..35c5c5f 100644 --- a/barkmanAPI/Program.cs +++ b/barkmanAPI/Program.cs @@ -75,5 +75,12 @@ app.MapDelete("/inventory/{id}", async (int id, BarkContext db) => return Results.Ok(new { Message = "Inventory item deleted successfully" }); }); +app.Services.GetRequiredService().Database.Migrate(); -app.Run(); \ No newline at end of file +using (var serviceScope = app.Services.CreateScope()) +{ + var dbContext = serviceScope.ServiceProvider.GetRequiredService(); + dbContext.Database.Migrate(); +} + +app.Run();