Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Feb 24, 2024
1 parent 5870c55 commit b643c56
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/BUTR.CrashReportServer/Services/DatabaseMigrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ protected override async Task ExecuteAsync(CancellationToken ct)
var idDataCount = sqlite.Set<IdEntity>().Count();
for (var i = 0; i < idDataCount % take; i+= take)
{
var data = await sqlite.Set<IdEntity>().OrderBy(x => x.FileId).Skip(i * take).Take(take).ToArrayAsync(ct);
var data = await sqlite.Set<IdEntity>().OrderBy(x => x.FileId).Skip(i * take).Take(take).AsAsyncEnumerable()
.Select(x => x with
{
Created = DateTime.SpecifyKind(x.Created, DateTimeKind.Utc)
}).ToArrayAsync(ct);
await postgres.Set<IdEntity>().AddRangeAsync(data, ct);
await postgres.SaveChangesAsync(ct);
}
Expand Down

0 comments on commit b643c56

Please sign in to comment.