Fixes .gitignore and added Auto Migration

This commit is contained in:
2025-12-08 22:42:07 +01:00
parent 7fa9830de2
commit a5fad98971
3 changed files with 52 additions and 3 deletions

View File

@@ -61,6 +61,9 @@ app.MapAdditionalIdentityEndpoints();
using (var scope = app.Services.CreateScope())
{
var CouchLogDB = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
CouchLogDB.Database.Migrate();
var roleManager = scope.ServiceProvider.GetRequiredService<RoleManager<IdentityRole>>();
var userManager = scope.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>();
@@ -120,8 +123,6 @@ using (var scope = app.Services.CreateScope())
await userManager.AddToRoleAsync(adminUser, "Admin");
}
var CouchLogDB = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
MediaType mediaType = new()
{
Name = "Movie"