Skip to content

Commit 8b43afe

Browse files
committed
Forbid both custom reusable schema builders & config based reusable schema conversion
Modify: Forbid both custom reusable schema builders & config based reusable schema conversion
1 parent 56d6c5b commit 8b43afe

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

KVA/Migration.Tool.Source/Handlers/MigratePageTypesCommandHandler.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ public async Task<CommandResult> Handle(MigratePageTypesCommand request, Cancell
5252
var manuallyMappedSourceClassIDs = new HashSet<int>();
5353
var manuallyMappedSourceClassNames = manualMappings.Values.SelectMany(x => x.mappping.SourceClassNames).ToHashSet();
5454

55+
if (reusableSchemaBuilders.Any() && !string.IsNullOrWhiteSpace(toolConfiguration.CreateReusableFieldSchemaForClasses))
56+
{
57+
logger.LogError("Conversion to reusable field schema using appsettings configuration " +
58+
"is not allowed when custom class mapping reusable schema builders are " +
59+
"used. Use one option or the other. Terminating migration of page types.");
60+
return new CommandFailureResult();
61+
}
62+
5563
while (ksClasses.GetNext(out var di))
5664
{
5765
var (_, ksClass) = di;

0 commit comments

Comments
 (0)