From 87456425cfda7184173b1dd3785410b76d11f8da Mon Sep 17 00:00:00 2001 From: John Lambert Date: Wed, 11 Dec 2024 08:06:53 -0500 Subject: [PATCH] Fix for #564 * Migrate by adding ParallelCorpora field to all projects --- .../Configuration/IMongoDataAccessConfiguratorExtensions.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Serval/src/Serval.Translation/Configuration/IMongoDataAccessConfiguratorExtensions.cs b/src/Serval/src/Serval.Translation/Configuration/IMongoDataAccessConfiguratorExtensions.cs index d0092c0b..158ce601 100644 --- a/src/Serval/src/Serval.Translation/Configuration/IMongoDataAccessConfiguratorExtensions.cs +++ b/src/Serval/src/Serval.Translation/Configuration/IMongoDataAccessConfiguratorExtensions.cs @@ -18,6 +18,11 @@ await c.Indexes.CreateOrUpdateAsync( await c.Indexes.CreateOrUpdateAsync( new CreateIndexModel(Builders.IndexKeys.Ascending(e => e.DateCreated)) ); + // migrate to new ParallelCorpora scheme by adding ParallelCorpora to existing engines + await c.UpdateManyAsync( + Builders.Filter.Exists(e => e.ParallelCorpora, false), + Builders.Update.Set(e => e.ParallelCorpora, new List()) + ); } ); configurator.AddRepository(