Skip to content

Commit

Permalink
Update Configure.Db.Migrations.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Nov 6, 2023
1 parent f9cd86f commit 9db8c0b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions BlazorDiffusion/Configure.Db.Migrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public void Configure(IWebHostBuilder builder) => builder
log.LogInformation("Adding Seed Users...");
AddSeedUsers(scope.ServiceProvider).Wait();

using var db = scope.ServiceProvider.GetRequiredService<IDbConnectionFactory>().Open();
var existingEmails = db.ColumnDistinct<string>(db.From<AppUser>().Select(x => x.Email));
var migrateUsers = db.Select(db.From<OldAppUser>().Where(x => !existingEmails.Contains(x.Email!)).OrderBy(x => x.Id));
//using var db = scope.ServiceProvider.GetRequiredService<IDbConnectionFactory>().Open();
//var existingEmails = db.ColumnDistinct<string>(db.From<AppUser>().Select(x => x.Email));
//var migrateUsers = db.Select(db.From<OldAppUser>().Where(x => !existingEmails.Contains(x.Email!)).OrderBy(x => x.Id));

log.LogInformation("Migrating {Count} Existing Users...", migrateUsers.Count);
MigrateExistingUsers(scope.ServiceProvider, migrateUsers).Wait();
//log.LogInformation("Migrating {Count} Existing Users...", migrateUsers.Count);
//MigrateExistingUsers(scope.ServiceProvider, migrateUsers).Wait();
}
}

Expand Down

0 comments on commit 9db8c0b

Please sign in to comment.