Added Auto Migrations to startup
This commit is contained in:
@@ -64,6 +64,10 @@ using (var scope = app.Services.CreateScope())
|
||||
var roleManager = scope.ServiceProvider.GetRequiredService<RoleManager<IdentityRole>>();
|
||||
var userManager = scope.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>();
|
||||
|
||||
var CouchLogDB = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
||||
|
||||
CouchLogDB.Database.Migrate();
|
||||
|
||||
string[] roleNames = { "Admin", "User" };
|
||||
IdentityResult roleResult;
|
||||
|
||||
@@ -120,8 +124,6 @@ using (var scope = app.Services.CreateScope())
|
||||
await userManager.AddToRoleAsync(adminUser, "Admin");
|
||||
}
|
||||
|
||||
var CouchLogDB = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
||||
|
||||
MediaType mediaType = new()
|
||||
{
|
||||
Name = "Movie"
|
||||
|
||||
Reference in New Issue
Block a user