revert 37d4dce036
Some checks failed
.NET Docker Build & Push / build_and_push (push) Has been cancelled

revert Added Auto Migrations to startup
This commit is contained in:
Henry Trumme
2025-12-08 21:53:19 +01:00
parent 1cd7c15182
commit b302103386

View File

@@ -64,10 +64,6 @@ using (var scope = app.Services.CreateScope())
var roleManager = scope.ServiceProvider.GetRequiredService<RoleManager<IdentityRole>>(); var roleManager = scope.ServiceProvider.GetRequiredService<RoleManager<IdentityRole>>();
var userManager = scope.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>(); var userManager = scope.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>();
var CouchLogDB = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
CouchLogDB.Database.Migrate();
string[] roleNames = { "Admin", "User" }; string[] roleNames = { "Admin", "User" };
IdentityResult roleResult; IdentityResult roleResult;
@@ -124,6 +120,8 @@ using (var scope = app.Services.CreateScope())
await userManager.AddToRoleAsync(adminUser, "Admin"); await userManager.AddToRoleAsync(adminUser, "Admin");
} }
var CouchLogDB = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
MediaType mediaType = new() MediaType mediaType = new()
{ {
Name = "Movie" Name = "Movie"