From df4e800351acd2adf0fcb94aef0d5c60f279004d Mon Sep 17 00:00:00 2001 From: jvandaal Date: Thu, 30 May 2024 09:49:25 +0200 Subject: [PATCH] fix: last changed list should wait for new WithCount projection --- src/ParcelRegistry.Infrastructure/Schema.cs | 2 -- .../Modules/LastChangedListConsoleModule.cs | 13 +++++++------ ...istry.Projections.LastChangedList.Console.csproj | 1 + .../ParcelDetailWithCountV2/ParcelDetailV2.cs | 1 + 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/ParcelRegistry.Infrastructure/Schema.cs b/src/ParcelRegistry.Infrastructure/Schema.cs index 942562fb..f284ab5c 100755 --- a/src/ParcelRegistry.Infrastructure/Schema.cs +++ b/src/ParcelRegistry.Infrastructure/Schema.cs @@ -7,7 +7,6 @@ public static class Schema public const string Import = "ParcelRegistryImport"; public const string Legacy = "ParcelRegistryLegacy"; public const string Extract = "ParcelRegistryExtract"; - public const string Syndication = "ParcelRegistrySyndication"; public const string ConsumerAddress = "ParcelRegistryConsumerAddress"; public const string BackOffice = "ParcelRegistryBackOffice"; public const string BackOfficeProjections = "ParcelRegistryBackOfficeProjections"; @@ -23,7 +22,6 @@ public static class MigrationTables public const string Legacy = "__EFMigrationsHistoryLegacy"; public const string Extract = "__EFMigrationsHistoryExtract"; public const string RedisDataMigration = "__EFMigrationsHistoryDataMigration"; - public const string Syndication = "__EFMigrationsHistorySyndication"; public const string ConsumerAddress = "__EFMigrationsHistoryConsumerAddress"; public const string BackOffice = "__EFMigrationsHistoryBackOffice"; public const string BackOfficeProjections = "__EFMigrationsHistoryBackOfficeProjections"; diff --git a/src/ParcelRegistry.Projections.LastChangedList.Console/Infrastructure/Modules/LastChangedListConsoleModule.cs b/src/ParcelRegistry.Projections.LastChangedList.Console/Infrastructure/Modules/LastChangedListConsoleModule.cs index beedf4a3..826d647c 100644 --- a/src/ParcelRegistry.Projections.LastChangedList.Console/Infrastructure/Modules/LastChangedListConsoleModule.cs +++ b/src/ParcelRegistry.Projections.LastChangedList.Console/Infrastructure/Modules/LastChangedListConsoleModule.cs @@ -11,11 +11,12 @@ namespace ParcelRegistry.Projections.LastChangedList.Console.Infrastructure.Modu using Be.Vlaanderen.Basisregisters.Projector; using Be.Vlaanderen.Basisregisters.Projector.ConnectedProjections; using Be.Vlaanderen.Basisregisters.Projector.Modules; - using ParcelRegistry.Infrastructure; + using Legacy.ParcelDetailWithCountV2; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; - using LastChangedListContextMigrationFactory = LastChangedList.LastChangedListContextMigrationFactory; + using ParcelRegistry.Infrastructure; + using LastChangedListContextMigrationFactory = LastChangedListContextMigrationFactory; public class LastChangedListConsoleModule : Module { @@ -61,7 +62,7 @@ private void RegisterProjectionSetup(ContainerBuilder builder) private void RegisterProjections(ContainerBuilder builder) { var logger = _loggerFactory.CreateLogger(); - var connectionString = _configuration.GetConnectionString("LastChangedList"); + var connectionString = _configuration.GetConnectionString("LastChangedList")!; builder.RegisterModule(new LastChangedListModule(connectionString, _services, _loggerFactory)); @@ -73,10 +74,10 @@ private void RegisterProjections(ContainerBuilder builder) "\tTableName: {TableName}", nameof(LastChangedListContext), LastChangedListContext.Schema, LastChangedListContext.MigrationsHistoryTable); - builder.Register(c => + builder.Register(_ => new LastChangedListParcelCacheValidator( - _configuration.GetConnectionString("LegacyProjections"), - "ParcelRegistry.Projections.Legacy.ParcelDetailV2.ParcelDetailV2Projections")) + _configuration.GetConnectionString("LegacyProjections")!, + ParcelDetailV2Configuration.ProjectionStateName)) .AsSelf(); builder diff --git a/src/ParcelRegistry.Projections.LastChangedList.Console/ParcelRegistry.Projections.LastChangedList.Console.csproj b/src/ParcelRegistry.Projections.LastChangedList.Console/ParcelRegistry.Projections.LastChangedList.Console.csproj index 398be281..8f0a4cf9 100644 --- a/src/ParcelRegistry.Projections.LastChangedList.Console/ParcelRegistry.Projections.LastChangedList.Console.csproj +++ b/src/ParcelRegistry.Projections.LastChangedList.Console/ParcelRegistry.Projections.LastChangedList.Console.csproj @@ -16,6 +16,7 @@ + diff --git a/src/ParcelRegistry.Projections.Legacy/ParcelDetailWithCountV2/ParcelDetailV2.cs b/src/ParcelRegistry.Projections.Legacy/ParcelDetailWithCountV2/ParcelDetailV2.cs index 1584b21b..b0a1470d 100644 --- a/src/ParcelRegistry.Projections.Legacy/ParcelDetailWithCountV2/ParcelDetailV2.cs +++ b/src/ParcelRegistry.Projections.Legacy/ParcelDetailWithCountV2/ParcelDetailV2.cs @@ -66,6 +66,7 @@ public Instant VersionTimestamp public class ParcelDetailV2Configuration : IEntityTypeConfiguration { internal const string TableName = "ParcelDetailsWithCountV2"; + public static readonly string ProjectionStateName = typeof(ParcelDetailV2Projections).FullName!; public void Configure(EntityTypeBuilder builder) {