diff --git a/CHANGELOG.md b/CHANGELOG.md index b3dec610b5..df0173285a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Build on and target .Net 9 rather than 8 - Simplify DB Patching Interface - Fix issue with Simple File Extractor pipeline component checking +- Improve cohort deprecation override test ## [8.4.2] - 2024-12-18 diff --git a/Rdmp.Core/CommandExecution/AtomicCommands/CohortCreationCommands/CohortCreationCommandExecution.cs b/Rdmp.Core/CommandExecution/AtomicCommands/CohortCreationCommands/CohortCreationCommandExecution.cs index 395d32eed1..7f41e9424a 100644 --- a/Rdmp.Core/CommandExecution/AtomicCommands/CohortCreationCommands/CohortCreationCommandExecution.cs +++ b/Rdmp.Core/CommandExecution/AtomicCommands/CohortCreationCommands/CohortCreationCommandExecution.cs @@ -206,8 +206,11 @@ protected void DeprecateExistingCohorts(IBasicActivateItems activator, Extractab } var cohortIDs = cohortsThatAreDeprecatedOrHaveBeenDeprecated.Select(c => c.ID).ToList(); - var extractionConfigurations = activator.RepositoryLocator.DataExportRepository.GetAllObjects().Where(ei => ei.Cohort_ID is not null && cohortIDs.Contains((int)ei.Cohort_ID)); - if (extractionConfigurations.Any() && activator.YesNo("Would you like to replace all uses of a deprecated cohort in this project with this cohort?", "Replace Deprecated Cohorts")) + var extractionConfigurations = activator.RepositoryLocator.DataExportRepository.GetAllObjects().Where(ei => !ei.IsReleased && ei.Cohort_ID is not null && cohortIDs.Contains((int)ei.Cohort_ID)); + if (extractionConfigurations.Any() && activator.YesNo(""" +Would you like to replace all uses of a deprecated cohort in this project with this cohort? +This will update all non-released Extraction configurations that use the now deprecated cohort to use the chort you have just created. +""", "Replace Deprecated Cohorts")) { foreach (var config in extractionConfigurations) {