From 79b60ebf518c82e5316b1dd366b32bd84bfe5869 Mon Sep 17 00:00:00 2001 From: "Dhirender Singh (Cofinity-X)" <144212607+dhiren-singh-007@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:39:09 +0200 Subject: [PATCH] fix(Registration): added agreement table in update seeder (#1011) Reviewed-By: Phil Schneider --- .../Seeder/BatchUpdateSeeder.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/portalbackend/PortalBackend.Migrations/Seeder/BatchUpdateSeeder.cs b/src/portalbackend/PortalBackend.Migrations/Seeder/BatchUpdateSeeder.cs index 6b3b9c7241..5c9d6d16db 100644 --- a/src/portalbackend/PortalBackend.Migrations/Seeder/BatchUpdateSeeder.cs +++ b/src/portalbackend/PortalBackend.Migrations/Seeder/BatchUpdateSeeder.cs @@ -158,6 +158,16 @@ await SeedTable("company_applications", dbEntry.ChecklistProcessId = entry.ChecklistProcessId; }, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); + await SeedTable("agreements", + x => x.Id, + x => x.dataEntity.Name != x.dbEntity.Name || x.dataEntity.AgreementStatusId != x.dbEntity.AgreementStatusId, + (dbEntry, entry) => + { + dbEntry.Name = entry.Name; + dbEntry.AgreementStatusId = entry.AgreementStatusId; + dbEntry.DateLastChanged = DateTimeOffset.UtcNow; + }, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); + await _context.SaveChangesAsync(cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None); _logger.LogInformation("Finished BaseEntityBatch Seeder"); }