Browse Source

Updating how the migration works when swtching from docker run vs Visual Studio

pull/2128/head
Roberto Borges 1 year ago
parent
commit
771d62a43a
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      src/Services/Identity/Identity.API/SeedData.cs

+ 8
- 1
src/Services/Identity/Identity.API/SeedData.cs View File

@ -9,7 +9,14 @@ public class SeedData
await retryPolicy.ExecuteAsync(async () =>
{
await context.Database.MigrateAsync();
try
{
await context.Database.MigrateAsync();
}
catch (Exception)
{
//If running on Docker on command line Migrations will take place automaticaly
}
var userMgr = scope.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>();
var alice = await userMgr.FindByNameAsync("alice");


Loading…
Cancel
Save