made it migrate

This commit is contained in:
Damien Ostler 2024-02-10 01:53:38 -05:00
parent 560be3ce13
commit 7ea1897fb4

View File

@ -148,9 +148,9 @@ var app = builder.Build();
var serviceScope = app.Services var serviceScope = app.Services
.GetRequiredService<IServiceScopeFactory>() .GetRequiredService<IServiceScopeFactory>()
.CreateScope(); .CreateScope();
using var context = serviceScope.ServiceProvider using (var context = serviceScope.ServiceProvider.GetService<ApplicationDbContext>()){
.GetService<ApplicationDbContext>(); context.Database.Migrate();
context.Database.Migrate(); }
app.UseSwagger(); app.UseSwagger();
app.UseSwaggerUI(settings => app.UseSwaggerUI(settings =>
{ {