Remove CurrentRefund property in InvoiceData (#5494)

This commit is contained in:
Nicolas Dorier
2023-11-21 12:52:40 +09:00
committed by GitHub
parent d1bf47a5c0
commit 3ee4f43eb5
8 changed files with 43 additions and 32 deletions

View File

@@ -233,9 +233,6 @@ namespace BTCPayServer.Hosting
var rows = await query.ToListAsync();
foreach (var row in rows)
{
// There is as circular deps between invoice and refund.
if (row is InvoiceData id)
id.CurrentRefundId = null;
foreach (var prop in datetimeProperties)
{
var v = (DateTime)prop.GetValue(row)!;
@@ -262,10 +259,6 @@ namespace BTCPayServer.Hosting
await postgresContext.SaveChangesAsync();
postgresContext.ChangeTracker.Clear();
}
foreach (var invoice in otherContext.Invoices.AsNoTracking().Where(i => i.CurrentRefundId != null))
{
postgresContext.Entry(invoice).State = EntityState.Modified;
}
await postgresContext.SaveChangesAsync();
postgresContext.ChangeTracker.Clear();
await UpdateSequenceInvoiceSearch(postgresContext);