diff --git a/.gitignore b/.gitignore index 30ffa688..683357ad 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ appsettings.local.json .idea/ .vs/ *.sln.DotSettings.user -Migration.Toolkit.CLI/appsettings.local.json_ +Migration.Tool.CLI/appsettings.local.json_ diff --git a/.vscode/settings.json b/.vscode/settings.json index 82edea02..ceb76a02 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -49,7 +49,7 @@ "editor.defaultFormatter": "ms-dotnettools.csharp" }, - "dotnet.defaultSolution": "Migration.Toolkit.sln", + "dotnet.defaultSolution": "Migration.Tool.sln", "typescript.validate.enable": false, "eslint.workingDirectories": [], diff --git a/KVA/Migration.Toolkit.Source/Auxiliary/EntityIdentityImpl.cs b/KVA/Migration.Tool.Source/Auxiliary/EntityIdentityImpl.cs similarity index 97% rename from KVA/Migration.Toolkit.Source/Auxiliary/EntityIdentityImpl.cs rename to KVA/Migration.Tool.Source/Auxiliary/EntityIdentityImpl.cs index 326dd911..4bfae560 100644 --- a/KVA/Migration.Toolkit.Source/Auxiliary/EntityIdentityImpl.cs +++ b/KVA/Migration.Tool.Source/Auxiliary/EntityIdentityImpl.cs @@ -1,9 +1,9 @@ using System.Collections.Frozen; using CMS.DataEngine; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Helpers; +using Migration.Tool.Common.Helpers; -namespace Migration.Toolkit.Source.Auxiliary; +namespace Migration.Tool.Source.Auxiliary; public interface ISourceGuidContext { diff --git a/KVA/Migration.Toolkit.Source/Auxiliary/NodeXmlAdapter.cs b/KVA/Migration.Tool.Source/Auxiliary/NodeXmlAdapter.cs similarity index 97% rename from KVA/Migration.Toolkit.Source/Auxiliary/NodeXmlAdapter.cs rename to KVA/Migration.Tool.Source/Auxiliary/NodeXmlAdapter.cs index 011ba0f2..5f3288ad 100644 --- a/KVA/Migration.Toolkit.Source/Auxiliary/NodeXmlAdapter.cs +++ b/KVA/Migration.Tool.Source/Auxiliary/NodeXmlAdapter.cs @@ -1,10 +1,10 @@ using System.Xml.Linq; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Enumerations; +using Migration.Tool.Common; +using Migration.Tool.Common.Enumerations; // ReSharper disable InconsistentNaming // generated class -namespace Migration.Toolkit.Source.Auxiliary; +namespace Migration.Tool.Source.Auxiliary; internal class NodeXmlAdapter { diff --git a/KVA/Migration.Tool.Source/Behaviors/CommandConstraintBehavior.cs b/KVA/Migration.Tool.Source/Behaviors/CommandConstraintBehavior.cs new file mode 100644 index 00000000..d8bb20e8 --- /dev/null +++ b/KVA/Migration.Tool.Source/Behaviors/CommandConstraintBehavior.cs @@ -0,0 +1,107 @@ +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Behaviors; + +public class CommandConstraintBehavior( + ILogger> logger, + IMigrationProtocol protocol, + ModelFacade modelFacade) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + try + { + bool criticalCheckPassed = PerformChecks(request); + if (!criticalCheckPassed) + { + return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); + } + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogCritical(ex, "Error occured while checking command constraints"); + return (TResponse)(CommandResult)new CommandCheckFailedResult(false); + } + + return await next(); + } + + private bool PerformChecks(TRequest request) + { + bool criticalCheckPassed = true; + + var sourceSites = modelFacade.SelectAll() + .ToList(); + + foreach (var site in sourceSites) + { + criticalCheckPassed &= CheckSite(sourceSites, site.SiteID); + } + + + if (request is ICultureReliantCommand cultureReliantCommand) + { + var cultures = modelFacade.SelectAll().ToList(); + var siteCultures = modelFacade.SelectAll().ToList(); + criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites, cultures, siteCultures); + } + + return criticalCheckPassed; + } + + private bool CheckSite(List sourceSites, int sourceSiteId) + { + bool criticalCheckPassed = true; + if (sourceSites.All(s => s.SiteID != sourceSiteId)) + { + var supportedSites = sourceSites.Select(x => new { x.SiteName, x.SiteID }).ToArray(); + string supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); + logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, + supportedSitesStr); + protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") + .WithMessage("Check program argument '--siteId'") + .WithData(new { sourceSiteId, AvailableSites = supportedSites })); + criticalCheckPassed = false; + } + + return criticalCheckPassed; + } + + private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites, List cultures, List cmsSiteCultures) + { + bool criticalCheckPassed = true; + string cultureCode = cultureReliantCommand.CultureCode; + + foreach (var site in sourceSites) + { + string?[] siteCultures = cmsSiteCultures + .Where(x => x.SiteID == site.SiteID) + .Select(x => cultures.FirstOrDefault(c => c.CultureID == x.CultureID)?.CultureCode) + .Where(x => !string.IsNullOrWhiteSpace(x)) + .ToArray(); + + if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) + { + string supportedCultures = string.Join(", ", siteCultures); + logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, + site.SiteID, supportedCultures); + protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") + .WithMessage("Check program argument '--culture'") + .WithData(new { cultureCode, site.SiteID, SiteCultures = supportedCultures })); + criticalCheckPassed = false; + } + } + + return criticalCheckPassed; + } +} diff --git a/KVA/Migration.Tool.Source/Behaviors/RequestHandlingBehavior.cs b/KVA/Migration.Tool.Source/Behaviors/RequestHandlingBehavior.cs new file mode 100644 index 00000000..dc14c26e --- /dev/null +++ b/KVA/Migration.Tool.Source/Behaviors/RequestHandlingBehavior.cs @@ -0,0 +1,40 @@ +using System.Diagnostics; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; + +namespace Migration.Tool.Source.Behaviors; + +public class RequestHandlingBehavior( + ILogger> logger, + IMigrationProtocol protocol) : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + var sw = Stopwatch.StartNew(); + logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); + try + { + protocol.CommandRequest(request); + var response = await next(); + protocol.CommandFinished(request, response); + return response; + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogError(ex, "Error occured"); + throw; + } + finally + { + logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); + } + } +} diff --git a/KVA/Migration.Tool.Source/Behaviors/XbKApiContextBehavior.cs b/KVA/Migration.Tool.Source/Behaviors/XbKApiContextBehavior.cs new file mode 100644 index 00000000..a2540762 --- /dev/null +++ b/KVA/Migration.Tool.Source/Behaviors/XbKApiContextBehavior.cs @@ -0,0 +1,42 @@ +using CMS.Base; +using CMS.Membership; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KXP.Api; + +namespace Migration.Tool.Source.Behaviors; + +public class XbKApiContextBehavior( + ILogger> logger, + IMigrationProtocol protocol, + KxpApiInitializer initializer) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + initializer.EnsureApiIsInitialized(); + + var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); + if (defaultAdmin == null) + { + protocol.Append(HandbookReferences + .MissingRequiredDependency() + .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") + ); + throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); + } + + using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) + { + logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); + return await next(); + } + } +} diff --git a/KVA/Migration.Tool.Source/Contexts/PrimaryKeyMappingContext.cs b/KVA/Migration.Tool.Source/Contexts/PrimaryKeyMappingContext.cs new file mode 100644 index 00000000..aa0708df --- /dev/null +++ b/KVA/Migration.Tool.Source/Contexts/PrimaryKeyMappingContext.cs @@ -0,0 +1,287 @@ +using System.Diagnostics; +using System.Linq.Expressions; +using System.Reflection; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Source.Services; + +namespace Migration.Tool.Source.Contexts; + +public class PrimaryKeyMappingContext( + ILogger logger, + IPrimaryKeyLocatorService primaryKeyLocatorService, + ToolConfiguration toolConfiguration) + : IPrimaryKeyMappingContext +{ + private readonly Dictionary mappingCache = new(StringComparer.OrdinalIgnoreCase); + + public void SetMapping(Type type, string keyName, int sourceId, int targetId) + { + Debug.Assert(sourceId > 0, "sourceId > 0"); + Debug.Assert(targetId > 0, "targetId > 0"); + + var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) + .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); + + Debug.Assert(foundProp != null, "foundProp != null"); + + string fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; + + mappingCache[fullKeyName] = targetId; + logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); + } + + public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) + { + string fullKeyName = CreateKey(keyNameSelector, sourceId); + mappingCache[fullKeyName] = targetId; + logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); + } + + public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) + { + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sourceId); + if (sourceId == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out int targetId)) + { + SetMapping(keyNameSelector, sourceId, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) + { + targetIdResult = -1; + if (sourceId is not int sid) + { + return false; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + targetIdResult = explicitlyMappedId; + return true; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + targetIdResult = resultId; + return true; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + targetIdResult = targetId; + return true; + } + + return false; + } + + public int? MapFromSource(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + return null; + } + + public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return new MapSourceIdResult(true, null); + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return new MapSourceIdResult(true, null); + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return new MapSourceIdResult(true, explicitlyMappedId); + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return new MapSourceIdResult(true, resultId); + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return new MapSourceIdResult(true, targetId); + } + + return new MapSourceIdResult(false, null); + } + + public void PreloadDependencies(Expression> keyNameSelector) + { + foreach ((int sourceId, int targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) + { + SetMapping(keyNameSelector, sourceId, targetId); + } + } + + public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return true; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + return true; + } + + if (GetExplicitMappingOrNull(memberName, sid) is not null) + { + return true; + } + + if (mappingCache.TryGetValue(fullKeyName, out _)) + { + return true; + } + + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) + { + return true; + } + + return false; + } + + private int? GetExplicitMappingOrNull(string memberName, int? sourceId) + { + if (sourceId == null) + { + return null; + } + + var mappings = toolConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; + if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) + { + return memberMappings.GetValueOrDefault($"{sourceId}"); + } + + return null; + } + + private static string CreateKey(Expression> keyNameSelector, int sourceId) => $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; +} diff --git a/KVA/Migration.Toolkit.Source/Contexts/SourceInstanceContext.cs b/KVA/Migration.Tool.Source/Contexts/SourceInstanceContext.cs similarity index 95% rename from KVA/Migration.Toolkit.Source/Contexts/SourceInstanceContext.cs rename to KVA/Migration.Tool.Source/Contexts/SourceInstanceContext.cs index d38168c0..fdeb4203 100644 --- a/KVA/Migration.Toolkit.Source/Contexts/SourceInstanceContext.cs +++ b/KVA/Migration.Tool.Source/Contexts/SourceInstanceContext.cs @@ -1,15 +1,15 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Common; +using Migration.Tool.Common.Services.Ipc; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Contexts; +namespace Migration.Tool.Source.Contexts; public class SourceInstanceContext( IpcService ipcService, ILogger logger, - ToolkitConfiguration configuration, + ToolConfiguration configuration, ModelFacade modelFacade) { /// diff --git a/KVA/Migration.Tool.Source/Contexts/SourceObjectContext.cs b/KVA/Migration.Tool.Source/Contexts/SourceObjectContext.cs new file mode 100644 index 00000000..ee633ff9 --- /dev/null +++ b/KVA/Migration.Tool.Source/Contexts/SourceObjectContext.cs @@ -0,0 +1,7 @@ +using CMS.FormEngine; +using Migration.Tool.KXP.Api.Services.CmsClass; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Contexts; + +public record DocumentSourceObjectContext(ICmsTree CmsTree, ICmsClass NodeClass, ICmsSite Site, FormInfo OldFormInfo, FormInfo NewFormInfo, int? DocumentId) : ISourceObjectContext; diff --git a/KVA/Migration.Tool.Source/Exceptions.cs b/KVA/Migration.Tool.Source/Exceptions.cs new file mode 100644 index 00000000..31fa26a9 --- /dev/null +++ b/KVA/Migration.Tool.Source/Exceptions.cs @@ -0,0 +1,7 @@ +namespace Migration.Tool.Source; + +public class MappingFailureException(string keyName, string reason) : InvalidOperationException($"Key '{keyName}' mapping failed: {reason}") +{ + public string KeyName { get; } = keyName; + public string Reason { get; } = reason; +} diff --git a/KVA/Migration.Tool.Source/Extensions.cs b/KVA/Migration.Tool.Source/Extensions.cs new file mode 100644 index 00000000..27d1c931 --- /dev/null +++ b/KVA/Migration.Tool.Source/Extensions.cs @@ -0,0 +1,44 @@ +using System.Diagnostics.CodeAnalysis; +using System.Text; + +using Kentico.Xperience.UMT.Services; + +using Microsoft.Extensions.Logging; + +namespace Migration.Tool.Source; + +public static class Extensions +{ + public static async Task> AssertSuccess(this Task resultTask, ILogger logger) + { + switch (await resultTask) + { + case { Success: true, Imported: TResult info }: + { + return new AssertSuccessResult(true, info); + } + case { } result: + { + var sb = new StringBuilder(); + if (result.ModelValidationResults is { } validationResults) + { + validationResults.ForEach(vr => sb.Append($"[{string.Join(",", vr.MemberNames)}]: {vr.ErrorMessage}")); + } + + if (result.Exception is { } exception) + { + logger.LogError(exception, "Error occured while importing entity {ValidationErrors}", sb); + } + + return new AssertSuccessResult(false, default); + } + default: + throw new NotImplementedException("Undefined state"); + } + } + + public record AssertSuccessResult( + [property: MemberNotNullWhen(true, "Info")] bool Success, + TResult? Info + ); +} diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateAttachmentsCommandHandler.cs b/KVA/Migration.Tool.Source/Handlers/MigrateAttachmentsCommandHandler.cs similarity index 83% rename from KVA/Migration.Toolkit.Source/Handlers/MigrateAttachmentsCommandHandler.cs rename to KVA/Migration.Tool.Source/Handlers/MigrateAttachmentsCommandHandler.cs index 659a912f..a00786da 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateAttachmentsCommandHandler.cs +++ b/KVA/Migration.Tool.Source/Handlers/MigrateAttachmentsCommandHandler.cs @@ -1,11 +1,11 @@ using MediatR; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Source.Model; +using Migration.Tool.Source.Services; -namespace Migration.Toolkit.Source.Handlers; +namespace Migration.Tool.Source.Handlers; // ReSharper disable once UnusedMember.Global [implicit use] public class MigrateAttachmentsCommandHandler( diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateCategoriesCommandHandler.cs b/KVA/Migration.Tool.Source/Handlers/MigrateCategoriesCommandHandler.cs similarity index 96% rename from KVA/Migration.Toolkit.Source/Handlers/MigrateCategoriesCommandHandler.cs rename to KVA/Migration.Tool.Source/Handlers/MigrateCategoriesCommandHandler.cs index f58b879f..106d6ec1 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateCategoriesCommandHandler.cs +++ b/KVA/Migration.Tool.Source/Handlers/MigrateCategoriesCommandHandler.cs @@ -13,16 +13,16 @@ using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Source.Mappers; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Source.Mappers; +using Migration.Tool.Source.Model; +using Migration.Tool.Source.Services; using Newtonsoft.Json; -namespace Migration.Toolkit.Source.Handlers; +namespace Migration.Tool.Source.Handlers; public class MigrateCategoriesCommandHandler( ILogger logger, diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomModulesCommandHandler.cs b/KVA/Migration.Tool.Source/Handlers/MigrateCustomModulesCommandHandler.cs similarity index 95% rename from KVA/Migration.Toolkit.Source/Handlers/MigrateCustomModulesCommandHandler.cs rename to KVA/Migration.Tool.Source/Handlers/MigrateCustomModulesCommandHandler.cs index 7757e8ce..8de1f663 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomModulesCommandHandler.cs +++ b/KVA/Migration.Tool.Source/Handlers/MigrateCustomModulesCommandHandler.cs @@ -11,20 +11,20 @@ using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Api.Services.CmsClass; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Mappers; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Handlers; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Common.Services.BulkCopy; +using Migration.Tool.KXP.Api; +using Migration.Tool.KXP.Api.Services.CmsClass; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Helpers; +using Migration.Tool.Source.Mappers; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Handlers; public class MigrateCustomModulesCommandHandler( ILogger logger, @@ -32,7 +32,7 @@ public class MigrateCustomModulesCommandHandler( IEntityMapper dataClassMapper, IEntityMapper resourceMapper, IEntityMapper alternativeFormMapper, - ToolkitConfiguration toolkitConfiguration, + ToolConfiguration toolConfiguration, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol, BulkDataCopyService bulkDataCopyService, @@ -43,7 +43,7 @@ ModelFacade modelFacade { public async Task Handle(MigrateCustomModulesCommand request, CancellationToken cancellationToken) { - var entityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); + var entityConfiguration = toolConfiguration.EntityConfigurations.GetEntityConfiguration(); await MigrateResources(cancellationToken); @@ -201,7 +201,7 @@ private async Task MigrateMemberClass(CancellationToken cancellationToken) var memberFormInfo = new FormInfo(target.ClassFormDefinition); - string[] includedSystemFields = toolkitConfiguration.MemberIncludeUserSystemFields?.Split('|', StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty(); + string[] includedSystemFields = toolConfiguration.MemberIncludeUserSystemFields?.Split('|', StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty(); var memberColumns = memberFormInfo.GetColumnNames(); diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomTablesHandler.cs b/KVA/Migration.Tool.Source/Handlers/MigrateCustomTablesHandler.cs similarity index 95% rename from KVA/Migration.Toolkit.Source/Handlers/MigrateCustomTablesHandler.cs rename to KVA/Migration.Tool.Source/Handlers/MigrateCustomTablesHandler.cs index 07a4f322..57863392 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomTablesHandler.cs +++ b/KVA/Migration.Tool.Source/Handlers/MigrateCustomTablesHandler.cs @@ -9,17 +9,17 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Handlers; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Common.Services.BulkCopy; +using Migration.Tool.KXP.Api; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Helpers; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Handlers; public class MigrateCustomTablesHandler( ILogger logger, diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateFormsCommandHandler.cs b/KVA/Migration.Tool.Source/Handlers/MigrateFormsCommandHandler.cs similarity index 95% rename from KVA/Migration.Toolkit.Source/Handlers/MigrateFormsCommandHandler.cs rename to KVA/Migration.Tool.Source/Handlers/MigrateFormsCommandHandler.cs index 2c7d1349..737c1ded 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateFormsCommandHandler.cs +++ b/KVA/Migration.Tool.Source/Handlers/MigrateFormsCommandHandler.cs @@ -11,17 +11,17 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.KXP.Models; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Handlers; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Common.Services.BulkCopy; +using Migration.Tool.KXP.Api; +using Migration.Tool.KXP.Context; +using Migration.Tool.KXP.Models; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Handlers; public class MigrateFormsCommandHandler( ILogger logger, @@ -33,7 +33,7 @@ public class MigrateFormsCommandHandler( PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol, ModelFacade modelFacade, - ToolkitConfiguration configuration + ToolConfiguration configuration ) : IRequestHandler, IDisposable { diff --git a/KVA/Migration.Tool.Source/Handlers/MigrateMediaLibrariesCommandHandler.cs b/KVA/Migration.Tool.Source/Handlers/MigrateMediaLibrariesCommandHandler.cs new file mode 100644 index 00000000..f65c6219 --- /dev/null +++ b/KVA/Migration.Tool.Source/Handlers/MigrateMediaLibrariesCommandHandler.cs @@ -0,0 +1,14 @@ +using MediatR; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Source.Services; + +namespace Migration.Tool.Source.Handlers; + +public class MigrateMediaLibrariesCommandHandler( + IMediaFileMigrator mediaFileMigrator + ) + : IRequestHandler +{ + public async Task Handle(MigrateMediaLibrariesCommand request, CancellationToken cancellationToken) => await mediaFileMigrator.Handle(request, cancellationToken); +} diff --git a/KVA/Migration.Tool.Source/Handlers/MigratePageTypesCommandHandler.cs b/KVA/Migration.Tool.Source/Handlers/MigratePageTypesCommandHandler.cs new file mode 100644 index 00000000..b0f8b8eb --- /dev/null +++ b/KVA/Migration.Tool.Source/Handlers/MigratePageTypesCommandHandler.cs @@ -0,0 +1,373 @@ +using CMS.ContentEngine; +using CMS.DataEngine; +using CMS.FormEngine; +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Builders; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KXP.Api; +using Migration.Tool.KXP.Api.Services.CmsClass; +using Migration.Tool.KXP.Models; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Helpers; +using Migration.Tool.Source.Mappers; +using Migration.Tool.Source.Model; +using Migration.Tool.Source.Services; + +namespace Migration.Tool.Source.Handlers; + +public class MigratePageTypesCommandHandler( + ILogger logger, + IEntityMapper dataClassMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + KxpClassFacade kxpClassFacade, + IProtocol protocol, + ToolConfiguration toolConfiguration, + ModelFacade modelFacade, + PageTemplateMigrator pageTemplateMigrator, + ReusableSchemaService reusableSchemaService, + IEnumerable classMappings, + IFieldMigrationService fieldMigrationService, + IEnumerable reusableSchemaBuilders + ) + : IRequestHandler +{ + private const string CLASS_CMS_ROOT = "CMS.Root"; + + public async Task Handle(MigratePageTypesCommand request, CancellationToken cancellationToken) + { + var entityConfiguration = toolConfiguration.EntityConfigurations.GetEntityConfiguration(); + + using var ksClasses = EnumerableHelper.CreateDeferrableItemWrapper( + modelFacade.Select("ClassIsDocumentType=1", "ClassID") + .OrderBy(x => x.ClassID) + ); + + ExecReusableSchemaBuilders(); + + var manualMappings = new Dictionary(); + foreach (var classMapping in classMappings) + { + var newDt = DataClassInfoProvider.GetDataClassInfo(classMapping.TargetClassName) ?? DataClassInfo.New(); + classMapping.PatchTargetDataClass(newDt); + + // might not need ClassGUID + // newDt.ClassGUID = GuidHelper.CreateDataClassGuid($"{newDt.ClassName}|{newDt.ClassTableName}"); + + var cmsClasses = new List(); + foreach (string sourceClassName in classMapping.SourceClassNames) + { + cmsClasses.AddRange(modelFacade.SelectWhere("ClassName=@className", new SqlParameter("className", sourceClassName))); + } + + var nfi = string.IsNullOrWhiteSpace(newDt.ClassFormDefinition) ? new FormInfo() : new FormInfo(newDt.ClassFormDefinition); + bool hasPrimaryKey = false; + foreach (var formFieldInfo in nfi.GetFields(true, true, true, true, false)) + { + if (formFieldInfo.PrimaryKey) + { + hasPrimaryKey = true; + } + } + + if (!hasPrimaryKey) + { + if (string.IsNullOrWhiteSpace(classMapping.PrimaryKey)) + { + throw new InvalidOperationException($"Class mapping has no primary key set"); + } + else + { + var prototype = FormHelper.GetBasicFormDefinition(classMapping.PrimaryKey); + nfi.AddFormItem(prototype.GetFormField(classMapping.PrimaryKey)); + } + } + + newDt.ClassFormDefinition = nfi.GetXmlDefinition(); + + foreach (string schemaName in classMapping.ReusableSchemaNames) + { + reusableSchemaService.AddReusableSchemaToDataClass(newDt, schemaName); + } + + nfi = new FormInfo(newDt.ClassFormDefinition); + + var fieldInReusableSchemas = reusableSchemaService.GetFieldsFromReusableSchema(newDt).ToDictionary(x => x.Name, x => x); + + bool hasFieldsAlready = true; + foreach (var cmml in classMapping.Mappings.Where(m => m.IsTemplate).ToLookup(x => x.SourceFieldName)) + { + var cmm = cmml.FirstOrDefault() ?? throw new InvalidOperationException(); + if (fieldInReusableSchemas.ContainsKey(cmm.TargetFieldName)) + { + // part of reusable schema + continue; + } + + var sc = cmsClasses.FirstOrDefault(sc => sc.ClassName.Equals(cmm.SourceClassName, StringComparison.InvariantCultureIgnoreCase)) + ?? throw new NullReferenceException($"The source class '{cmm.SourceClassName}' does not exist - wrong mapping {classMapping}"); + + var fi = new FormInfo(sc.ClassFormDefinition); + if (nfi.GetFormField(cmm.TargetFieldName) is { }) + { + } + else + { + var src = fi.GetFormField(cmm.SourceFieldName); + src.Name = cmm.TargetFieldName; + nfi.AddFormItem(src); + hasFieldsAlready = false; + } + } + + if (!hasFieldsAlready) + { + FormDefinitionHelper.MapFormDefinitionFields(logger, fieldMigrationService, nfi.GetXmlDefinition(), false, true, newDt, false, false); + CmsClassMapper.PatchDataClassInfo(newDt, out _, out _); + } + + if (classMapping.TargetFieldPatchers.Count > 0) + { + nfi = new FormInfo(newDt.ClassFormDefinition); + foreach (string fieldName in classMapping.TargetFieldPatchers.Keys) + { + classMapping.TargetFieldPatchers[fieldName].Invoke(nfi.GetFormField(fieldName)); + } + + newDt.ClassFormDefinition = nfi.GetXmlDefinition(); + } + + DataClassInfoProvider.SetDataClassInfo(newDt); + foreach (var gByClass in classMapping.Mappings.GroupBy(x => x.SourceClassName)) + { + manualMappings.TryAdd(gByClass.Key, newDt); + } + + foreach (string sourceClassName in classMapping.SourceClassNames) + { + var sourceClass = cmsClasses.First(c => c.ClassName.Equals(sourceClassName, StringComparison.InvariantCultureIgnoreCase)); + foreach (var cmsClassSite in modelFacade.SelectWhere("ClassId = @classId", new SqlParameter("classId", sourceClass.ClassID))) + { + if (modelFacade.SelectById(cmsClassSite.SiteID) is { SiteGUID: var siteGuid }) + { + if (ChannelInfoProvider.ProviderObject.Get(siteGuid) is { ChannelID: var channelId }) + { + var info = new ContentTypeChannelInfo { ContentTypeChannelChannelID = channelId, ContentTypeChannelContentTypeID = newDt.ClassID }; + ContentTypeChannelInfoProvider.ProviderObject.Set(info); + } + else + { + logger.LogWarning("Channel for site with SiteGUID '{SiteGuid}' not found", siteGuid); + } + } + else + { + logger.LogWarning("Source site with SiteID '{SiteId}' not found", cmsClassSite.SiteID); + } + } + } + } + + while (ksClasses.GetNext(out var di)) + { + var (_, ksClass) = di; + + if (manualMappings.ContainsKey(ksClass.ClassName)) + { + continue; + } + + if (ksClass.ClassInheritsFromClassID is { } classInheritsFromClassId && !primaryKeyMappingContext.HasMapping(c => c.ClassID, classInheritsFromClassId)) + { + // defer migration to later stage + if (ksClasses.TryDeferItem(di)) + { + logger.LogTrace("Class {Class} inheritance parent not found, deferring migration to end. Attempt {Attempt}", Printer.GetEntityIdentityPrint(ksClass), di.Recurrence); + } + else + { + logger.LogErrorMissingDependency(ksClass, nameof(ksClass.ClassInheritsFromClassID), ksClass.ClassInheritsFromClassID, typeof(DataClassInfo)); + protocol.Append(HandbookReferences + .MissingRequiredDependency(nameof(CmsClass.ClassId), classInheritsFromClassId) + .NeedsManualAction() + ); + } + + continue; + } + + protocol.FetchedSource(ksClass); + + if (entityConfiguration.ExcludeCodeNames.Contains(ksClass.ClassName, StringComparer.InvariantCultureIgnoreCase)) + { + protocol.Warning(HandbookReferences.EntityExplicitlyExcludedByCodeName(ksClass.ClassName, "PageType"), ksClass); + logger.LogInformation("CmsClass: {ClassName} was skipped => it is explicitly excluded in configuration", ksClass.ClassName); + continue; + } + + if (string.Equals(ksClass.ClassName, CLASS_CMS_ROOT, StringComparison.InvariantCultureIgnoreCase)) + { + protocol.Warning(HandbookReferences.CmsClassCmsRootClassTypeSkip, ksClass); + logger.LogInformation("CmsClass: {ClassName} was skipped => CMS.Root cannot be migrated", ksClass.ClassName); + continue; + } + + if (string.Equals(ksClass.ClassName, "cms.site", StringComparison.InvariantCultureIgnoreCase)) + { + continue; + } + + if (ksClass.ClassName.Equals("cms.folder", StringComparison.InvariantCultureIgnoreCase)) + { + if (!toolConfiguration.UseDeprecatedFolderPageType.GetValueOrDefault(false)) + { + logger.LogInformation("Class {Class} is deprecated, skipping", Printer.GetEntityIdentityPrint(ksClass)); + continue; + } + + logger.LogWarning("Class {Class} is deprecated, but migration is enabled with configuration flag 'UseDeprecatedFolderPageType'", Printer.GetEntityIdentityPrint(ksClass)); + } + + var kxoDataClass = kxpClassFacade.GetClass(ksClass.ClassGUID); + protocol.FetchedTarget(kxoDataClass); + + if (SaveUsingKxoApi(ksClass, kxoDataClass) is { } targetClassId) + { + foreach (var cmsClassSite in modelFacade.SelectWhere("ClassID = @classId", new SqlParameter("classId", ksClass.ClassID))) + { + if (modelFacade.SelectById(cmsClassSite.SiteID) is { SiteGUID: var siteGuid }) + { + if (ChannelInfoProvider.ProviderObject.Get(siteGuid) is { ChannelID: var channelId }) + { + var info = new ContentTypeChannelInfo { ContentTypeChannelChannelID = channelId, ContentTypeChannelContentTypeID = targetClassId }; + ContentTypeChannelInfoProvider.ProviderObject.Set(info); + } + else + { + logger.LogWarning("Channel for site with SiteGUID '{SiteGuid}' not found", siteGuid); + } + } + else + { + logger.LogWarning("Source site with SiteID '{SiteId}' not found", cmsClassSite.SiteID); + } + } + } + } + + await MigratePageTemplateConfigurations(); + + return new GenericCommandResult(); + } + + private void ExecReusableSchemaBuilders() + { + foreach (var reusableSchemaBuilder in reusableSchemaBuilders) + { + reusableSchemaBuilder.AssertIsValid(); + var fieldInfos = reusableSchemaBuilder.FieldBuilders.Select(fb => + { + switch (fb) + { + case { Factory: { } factory }: + { + return factory(); + } + case { SourceFieldIdentifier: { } fieldIdentifier }: + { + var sourceClass = modelFacade.SelectWhere("ClassName=@className", new SqlParameter("className", fieldIdentifier.ClassName)).SingleOrDefault() + ?? throw new InvalidOperationException($"Invalid reusable schema field builder for field '{fieldIdentifier.ClassName}': DataClass not found, class name '{fieldIdentifier.ClassName}'"); + + if (string.IsNullOrWhiteSpace(sourceClass.ClassFormDefinition)) + { + throw new InvalidOperationException($"Invalid reusable schema field builder for field '{fieldIdentifier.ClassName}': Class '{fieldIdentifier.ClassName}' is missing field '{fieldIdentifier.FieldName}'"); + } + + // this might be cached as optimization + var patcher = new FormDefinitionPatcher( + logger, + sourceClass.ClassFormDefinition, + fieldMigrationService, + sourceClass.ClassIsForm.GetValueOrDefault(false), + sourceClass.ClassIsDocumentType, + true, + false + ); + + patcher.PatchFields(); + patcher.RemoveCategories(); + + var fi = new FormInfo(patcher.GetPatched()); + return fi.GetFormField(fieldIdentifier.FieldName) switch + { + { } field => field, + _ => throw new InvalidOperationException($"Invalid reusable schema field builder for field '{fieldIdentifier.ClassName}': Class '{fieldIdentifier.ClassName}' is missing field '{fieldIdentifier.FieldName}'") + }; + } + default: + { + throw new InvalidOperationException($"Invalid reusable schema field builder for field '{fb.TargetFieldName}'"); + } + } + }); + + reusableSchemaService.EnsureReusableFieldSchema(reusableSchemaBuilder.SchemaName, reusableSchemaBuilder.SchemaDisplayName, reusableSchemaBuilder.SchemaDescription, fieldInfos.ToArray()); + } + } + + private async Task MigratePageTemplateConfigurations() + { + if (modelFacade.IsAvailable()) + { + foreach (var ksPageTemplateConfiguration in modelFacade.SelectAll()) + { + await pageTemplateMigrator.MigratePageTemplateConfigurationAsync(ksPageTemplateConfiguration); + } + } + } + + private int? SaveUsingKxoApi(ICmsClass ksClass, DataClassInfo kxoDataClass) + { + var mapped = dataClassMapper.Map(ksClass, kxoDataClass); + protocol.MappedTarget(mapped); + + try + { + if (mapped is { Success: true }) + { + (var dataClassInfo, bool newInstance) = mapped; + ArgumentNullException.ThrowIfNull(dataClassInfo, nameof(dataClassInfo)); + + if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(dataClassInfo.ClassName)) + { + dataClassInfo = reusableSchemaService.ConvertToReusableSchema(dataClassInfo); + } + + kxpClassFacade.SetClass(dataClassInfo); + + protocol.Success(ksClass, dataClassInfo, mapped); + logger.LogEntitySetAction(newInstance, dataClassInfo); + + primaryKeyMappingContext.SetMapping( + r => r.ClassId, + ksClass.ClassID, + dataClassInfo.ClassID + ); + + return dataClassInfo.ClassID; + } + } + catch (Exception ex) + { + logger.LogError(ex, "Error while saving page type {ClassName}", ksClass.ClassName); + } + + return null; + } +} diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigratePagesCommandHandler.cs b/KVA/Migration.Tool.Source/Handlers/MigratePagesCommandHandler.cs similarity index 96% rename from KVA/Migration.Toolkit.Source/Handlers/MigratePagesCommandHandler.cs rename to KVA/Migration.Tool.Source/Handlers/MigratePagesCommandHandler.cs index 9fef20fa..4735d3e5 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigratePagesCommandHandler.cs +++ b/KVA/Migration.Tool.Source/Handlers/MigratePagesCommandHandler.cs @@ -18,34 +18,35 @@ using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Models; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Mappers; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Providers; -using Migration.Toolkit.Source.Services; -using Migration.Toolkit.Source.Services.Model; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KXP.Models; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Helpers; +using Migration.Tool.Source.Mappers; +using Migration.Tool.Source.Model; +using Migration.Tool.Source.Providers; +using Migration.Tool.Source.Services; +using Migration.Tool.Source.Services.Model; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -namespace Migration.Toolkit.Source.Handlers; +namespace Migration.Tool.Source.Handlers; // ReSharper disable once UnusedType.Global public class MigratePagesCommandHandler( ILogger logger, - ToolkitConfiguration toolkitConfiguration, + ToolConfiguration toolConfiguration, IProtocol protocol, IImporter importer, IUmtMapper mapper, ModelFacade modelFacade, DeferredPathService deferredPathService, SpoiledGuidContext spoiledGuidContext, - SourceInstanceContext sourceInstanceContext + SourceInstanceContext sourceInstanceContext, + ClassMappingProvider classMappingProvider ) : IRequestHandler { @@ -57,7 +58,7 @@ SourceInstanceContext sourceInstanceContext public async Task Handle(MigratePagesCommand request, CancellationToken cancellationToken) { - var classEntityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); + var classEntityConfiguration = toolConfiguration.EntityConfigurations.GetEntityConfiguration(); var cultureCodeToLanguageGuid = modelFacade.SelectAll() .ToDictionary(c => c.CultureCode, c => c.CultureGUID, StringComparer.InvariantCultureIgnoreCase); @@ -194,7 +195,11 @@ public async Task Handle(MigratePagesCommand request, Cancellatio ? (Guid?)null : spoiledGuidContext.EnsureNodeGuid(ksNodeParent); - var targetClass = DataClassInfoProvider.ProviderObject.Get(ksNodeClass.ClassGUID); + DataClassInfo targetClass = null!; + var classMapping = classMappingProvider.GetMapping(ksNodeClass.ClassName); + targetClass = classMapping != null + ? DataClassInfoProvider.ProviderObject.Get(classMapping.TargetClassName) + : DataClassInfoProvider.ProviderObject.Get(ksNodeClass.ClassGUID); var results = mapper.Map(new CmsTreeMapperSource( ksNode, diff --git a/KVA/Migration.Toolkit.Source/Helpers/AdminUserHelper.cs b/KVA/Migration.Tool.Source/Helpers/AdminUserHelper.cs similarity index 92% rename from KVA/Migration.Toolkit.Source/Helpers/AdminUserHelper.cs rename to KVA/Migration.Tool.Source/Helpers/AdminUserHelper.cs index 6087a0b4..58e91594 100644 --- a/KVA/Migration.Toolkit.Source/Helpers/AdminUserHelper.cs +++ b/KVA/Migration.Tool.Source/Helpers/AdminUserHelper.cs @@ -2,11 +2,11 @@ using Microsoft.Extensions.DependencyInjection; -using Migration.Toolkit.Common; -using Migration.Toolkit.KXP.Api.Auxiliary; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Common; +using Migration.Tool.KXP.Api.Auxiliary; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Helpers; +namespace Migration.Tool.Source.Helpers; public class AdminUserHelper { diff --git a/KVA/Migration.Tool.Source/Helpers/FormDefinitionHelper.cs b/KVA/Migration.Tool.Source/Helpers/FormDefinitionHelper.cs new file mode 100644 index 00000000..219d1ca2 --- /dev/null +++ b/KVA/Migration.Tool.Source/Helpers/FormDefinitionHelper.cs @@ -0,0 +1,76 @@ +using CMS.DataEngine; +using CMS.FormEngine; +using Microsoft.Extensions.Logging; +using Migration.Tool.KXP.Api.Services.CmsClass; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Helpers; + +public static class FormDefinitionHelper +{ + public static void MapFormDefinitionFields(ILogger logger, IFieldMigrationService fieldMigrationService, ICmsClass source, DataClassInfo target, bool isCustomizableSystemClass, bool classIsCustom) + { + if (!string.IsNullOrWhiteSpace(source.ClassFormDefinition)) + { + var patcher = new FormDefinitionPatcher( + logger, + source.ClassFormDefinition, + fieldMigrationService, + source.ClassIsForm.GetValueOrDefault(false), + source.ClassIsDocumentType, + isCustomizableSystemClass, + classIsCustom + ); + + patcher.PatchFields(); + patcher.RemoveCategories(); // TODO tk: 2022-10-11 remove when supported + + string? result = patcher.GetPatched(); + if (isCustomizableSystemClass) + { + result = FormHelper.MergeFormDefinitions(target.ClassFormDefinition, result); + } + + var formInfo = new FormInfo(result); + target.ClassFormDefinition = formInfo.GetXmlDefinition(); + } + else + { + target.ClassFormDefinition = new FormInfo().GetXmlDefinition(); + } + } + + public static void MapFormDefinitionFields(ILogger logger, IFieldMigrationService fieldMigrationService, + string sourceClassDefinition, bool? classIsForm, bool classIsDocumentType, + DataClassInfo target, bool isCustomizableSystemClass, bool classIsCustom) + { + if (!string.IsNullOrWhiteSpace(sourceClassDefinition)) + { + var patcher = new FormDefinitionPatcher( + logger, + sourceClassDefinition, + fieldMigrationService, + classIsForm.GetValueOrDefault(false), + classIsDocumentType, + isCustomizableSystemClass, + classIsCustom + ); + + patcher.PatchFields(); + patcher.RemoveCategories(); // TODO tk: 2022-10-11 remove when supported + + string? result = patcher.GetPatched(); + if (isCustomizableSystemClass) + { + result = FormHelper.MergeFormDefinitions(target.ClassFormDefinition, result); + } + + var formInfo = new FormInfo(result); + target.ClassFormDefinition = formInfo.GetXmlDefinition(); + } + else + { + target.ClassFormDefinition = new FormInfo().GetXmlDefinition(); + } + } +} diff --git a/KVA/Migration.Tool.Source/Helpers/KenticoHelper.cs b/KVA/Migration.Tool.Source/Helpers/KenticoHelper.cs new file mode 100644 index 00000000..d24678ee --- /dev/null +++ b/KVA/Migration.Tool.Source/Helpers/KenticoHelper.cs @@ -0,0 +1,38 @@ +using System.Globalization; +using CMS.Helpers; +using Microsoft.Data.SqlClient; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Helpers; + +public static class KenticoHelper +{ + public static void CopyCustomData(ContainerCustomData target, string? sourceXml) + { + var customNodeData = new ContainerCustomData(); + customNodeData.LoadData(sourceXml); + foreach (string? columnName in customNodeData.ColumnNames) + { + target.SetValue(columnName, customNodeData.GetValue(columnName)); + } + } + + public static string? GetSettingsKey(ModelFacade facade, int? siteId, string keyName) + { + var keys = facade.Select("KeyName = @keyName", "SiteID", new SqlParameter("keyName", keyName)).ToList(); + return (keys.FirstOrDefault(x => x.SiteID == siteId) + ?? keys.FirstOrDefault(x => x.SiteID == null))?.KeyValue; + } + + public static T? GetSettingsKey(ModelFacade facade, int? siteId, string keyName) where T : struct, IParsable + { + var keys = facade.Select("KeyName = @keyName", "SiteID", new SqlParameter("keyName", keyName)).ToList(); + string? value = (keys.FirstOrDefault(x => x.SiteID == siteId) + ?? keys.FirstOrDefault(x => x.SiteID == null))?.KeyValue; + + + return T.TryParse(value, CultureInfo.InvariantCulture, out var result) + ? result + : null; + } +} diff --git a/KVA/Migration.Toolkit.Source/Helpers/MediaHelper.cs b/KVA/Migration.Tool.Source/Helpers/MediaHelper.cs similarity index 96% rename from KVA/Migration.Toolkit.Source/Helpers/MediaHelper.cs rename to KVA/Migration.Tool.Source/Helpers/MediaHelper.cs index 5280a28b..457cc2aa 100644 --- a/KVA/Migration.Toolkit.Source/Helpers/MediaHelper.cs +++ b/KVA/Migration.Tool.Source/Helpers/MediaHelper.cs @@ -1,8 +1,8 @@ using Microsoft.Data.SqlClient; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Helpers; +namespace Migration.Tool.Source.Helpers; public static class MediaHelper { diff --git a/KVA/Migration.Toolkit.Source/Helpers/PageBuilderWidgetsPatcher.cs b/KVA/Migration.Tool.Source/Helpers/PageBuilderWidgetsPatcher.cs similarity index 95% rename from KVA/Migration.Toolkit.Source/Helpers/PageBuilderWidgetsPatcher.cs rename to KVA/Migration.Tool.Source/Helpers/PageBuilderWidgetsPatcher.cs index 6b8a91e5..0ed75294 100644 --- a/KVA/Migration.Toolkit.Source/Helpers/PageBuilderWidgetsPatcher.cs +++ b/KVA/Migration.Tool.Source/Helpers/PageBuilderWidgetsPatcher.cs @@ -1,9 +1,9 @@ -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Source.Services.Model; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Source.Services.Model; using Newtonsoft.Json.Linq; -namespace Migration.Toolkit.Source.Helpers; +namespace Migration.Tool.Source.Helpers; public static class PageBuilderWidgetsPatcher { diff --git a/KVA/Migration.Tool.Source/Helpers/PrintHelper.cs b/KVA/Migration.Tool.Source/Helpers/PrintHelper.cs new file mode 100644 index 00000000..af064c87 --- /dev/null +++ b/KVA/Migration.Tool.Source/Helpers/PrintHelper.cs @@ -0,0 +1,7 @@ +namespace Migration.Tool.Source.Helpers; + +public static class PrintHelper +{ + public static string PrintDictionary(Dictionary dictionary) => + string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); +} diff --git a/KVA/Migration.Tool.Source/Helpers/Printer.cs b/KVA/Migration.Tool.Source/Helpers/Printer.cs new file mode 100644 index 00000000..16c60951 --- /dev/null +++ b/KVA/Migration.Tool.Source/Helpers/Printer.cs @@ -0,0 +1,107 @@ +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.Globalization; +using CMS.MediaLibrary; +using CMS.Membership; +using CMS.Modules; +using CMS.Websites; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.Services; +using Migration.Tool.KXP.Models; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Helpers; + +public class Printer +{ + public static string PrintKxpModelInfo(T model) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + return model switch + { + MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", + MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", + CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", + CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", + CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", + CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", + CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", + CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", + OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", + + null => $"{currentTypeName}: ", + _ => $"TODO: {typeof(T).FullName}" + }; + } + + public static string GetEntityIdentityPrint(T model, bool printType = true) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + string Fallback(object obj) => printType + ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" + : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}"; + + string FormatModel(string inner) => printType + ? $"{currentTypeName}({inner})" + : $"{inner}"; + + return model switch + { + MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), + MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), + DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), + + CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), + StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), + + ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), + AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), + UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), + RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), + MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), + WebPageFormerUrlPathInfo item => FormatModel($"ID={item.WebPageFormerUrlPathID}, Guid=N/A Name={item.WebPageFormerUrlPath}"), + + CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), + CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), + CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), + + CmsPageTemplateConfigurationK11 item => FormatModel($"Item not exists in K11 {item}"), + CmsPageTemplateConfigurationK12 item => FormatModel($"ID={item.PageTemplateConfigurationID}, GUID={item.PageTemplateConfigurationGUID}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteID}"), + CmsPageTemplateConfigurationK13 item => FormatModel($"ID={item.PageTemplateConfigurationID}, GUID={item.PageTemplateConfigurationGUID}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteID}"), + ICmsRole item => FormatModel($"ID={item.RoleID}, GUID={item.RoleGUID}, Name={item.RoleName}, SiteId={item.SiteID}"), + ICmsAttachment item => FormatModel($"ID={item.AttachmentID}, GUID={item.AttachmentGUID}, Name={item.AttachmentName}"), + ICmsClass item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), + ICmsConsent item => FormatModel($"ID={item.ConsentID}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + ICmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveID}, GUID={item.ConsentArchiveGuid}"), + ICmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementID}, GUID={item.ConsentAgreementGuid}"), + ICmsCountry item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), + ICmsState item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), + ICmsTree item => FormatModel($"NodeID={item.NodeID}, NodeGUID={item.NodeGUID}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), + ICmsDocument item => FormatModel($"NodeID={item.DocumentNodeID}, DocumentID={item.DocumentID}, DocumentGUID={item.DocumentGUID}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), + ICmsResource item => FormatModel($"ID={item.ResourceID}, GUID={item.ResourceGUID}, Name={item.ResourceName}"), + + null => $" ref of {currentTypeName}", + _ => Fallback(model) + }; + } + + public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); + + public static string PrintEnumValues(string separator) where TEnum : struct, Enum => string.Join(separator, Enum.GetValues()); +} + +public class PrintService : IPrintService +{ + public string PrintKxpModelInfo(T model) => Printer.PrintKxpModelInfo(model); + + public string GetEntityIdentityPrint(T model, bool printType = true) => Printer.GetEntityIdentityPrint(model, printType); + + public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => Printer.GetEntityIdentityPrints(models, separator); + + public string PrintEnumValues(string separator) where TEnum : struct, Enum => Printer.PrintEnumValues(separator); +} diff --git a/KVA/Migration.Toolkit.Source/ISourceModel.cs b/KVA/Migration.Tool.Source/ISourceModel.cs similarity index 90% rename from KVA/Migration.Toolkit.Source/ISourceModel.cs rename to KVA/Migration.Tool.Source/ISourceModel.cs index 16aab42b..e03d4a58 100644 --- a/KVA/Migration.Toolkit.Source/ISourceModel.cs +++ b/KVA/Migration.Tool.Source/ISourceModel.cs @@ -1,9 +1,9 @@ using System.Collections.Frozen; using System.Data; -using Migration.Toolkit.Common; +using Migration.Tool.Common; -namespace Migration.Toolkit.Source; +namespace Migration.Tool.Source; public interface ISourceModel { diff --git a/KVA/Migration.Toolkit.Source/KsCoreDiExtensions.cs b/KVA/Migration.Tool.Source/KsCoreDiExtensions.cs similarity index 84% rename from KVA/Migration.Toolkit.Source/KsCoreDiExtensions.cs rename to KVA/Migration.Tool.Source/KsCoreDiExtensions.cs index 943d51d3..fca7f5e4 100644 --- a/KVA/Migration.Toolkit.Source/KsCoreDiExtensions.cs +++ b/KVA/Migration.Tool.Source/KsCoreDiExtensions.cs @@ -12,29 +12,30 @@ using Microsoft.Extensions.DependencyInjection; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.KXP.Models; -using Migration.Toolkit.Source.Auxiliary; -using Migration.Toolkit.Source.Behaviors; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Mappers; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services; - -namespace Migration.Toolkit.Source; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Common.Services; +using Migration.Tool.Common.Services.BulkCopy; +using Migration.Tool.Common.Services.Ipc; +using Migration.Tool.KXP.Models; +using Migration.Tool.Source.Auxiliary; +using Migration.Tool.Source.Behaviors; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Helpers; +using Migration.Tool.Source.Mappers; +using Migration.Tool.Source.Model; +using Migration.Tool.Source.Providers; +using Migration.Tool.Source.Services; + +namespace Migration.Tool.Source; public static class KsCoreDiExtensions { public static IServiceProvider ServiceProvider { get; private set; } = null!; public static void InitServiceProvider(IServiceProvider serviceProvider) => ServiceProvider = serviceProvider; - public static IServiceCollection UseKsToolkitCore(this IServiceCollection services, bool? migrateMediaToMediaLibrary = false) + public static IServiceCollection UseKsToolCore(this IServiceCollection services, bool? migrateMediaToMediaLibrary = false) { var printService = new PrintService(); services.AddSingleton(printService); @@ -52,6 +53,7 @@ public static IServiceCollection UseKsToolkitCore(this IServiceCollection servic services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); services.AddTransient(); services.AddTransient(); diff --git a/KVA/Migration.Tool.Source/Mappers/AlternativeFormMapper.cs b/KVA/Migration.Tool.Source/Mappers/AlternativeFormMapper.cs new file mode 100644 index 00000000..0b84f24b --- /dev/null +++ b/KVA/Migration.Tool.Source/Mappers/AlternativeFormMapper.cs @@ -0,0 +1,100 @@ +using CMS.DataEngine; +using CMS.FormEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KXP.Api.Services.CmsClass; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Mappers; + +public record AlternativeFormMapperSource(ICmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); + +public class AlternativeFormMapper( + ILogger logger, + PrimaryKeyMappingContext pkContext, + IProtocol protocol, + FieldMigrationService fieldMigrationService, + ModelFacade modelFacade +) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) + => AlternativeFormInfo.New(); + + protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (source, xbkFormClass) = sourceObj; + + target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassID, source.FormClassID, out int? classId) + ? classId ?? 0 + : 0; + target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassID, source.FormCoupledClassID, out int? coupledClassId) + ? coupledClassId ?? 0 + : 0; + + var formCoupledClass = modelFacade.SelectById(source.FormCoupledClassID); + var formClass = modelFacade.SelectById(source.FormClassID); + + bool coupledClassIsDeprecated = + formCoupledClass?.ClassName is { } coupledClassName && + K12SystemClass.NoLongerSupported.Contains(coupledClassName); + + bool classIsSysInternal = K12SystemClass.All.Contains(formClass.ClassName); + + string mergedDefinition = formClass.ClassFormDefinition; + if (formCoupledClass != null) + { + logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", formCoupledClass.ClassName, formClass.ClassName); + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, formCoupledClass.ClassFormDefinition); + } + + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); + + var patcher = new FormDefinitionPatcher( + logger, + mergedDefinition, + fieldMigrationService, + formClass.ClassIsForm.GetValueOrDefault(false), + formClass.ClassIsDocumentType, + false, + !classIsSysInternal, + true + ); + + var fieldNames = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); + + patcher.PatchFields(); + + var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); + + if (coupledClassIsDeprecated && formCoupledClass != null) + { + logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", formCoupledClass.ClassName); + patcher.RemoveFields(formCoupledClass.ClassFormDefinition); + + var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); + } + + string result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); + + string formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); + + target.FormDefinition = formDefinitionDifference; + + target.FormDisplayName = source.FormDisplayName; + target.FormGUID = source.FormGUID; + target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); + target.FormLastModified = source.FormLastModified; + target.FormName = source.FormName; + + return target; + } +} diff --git a/KVA/Migration.Tool.Source/Mappers/CmsAttachmentMapper.cs b/KVA/Migration.Tool.Source/Mappers/CmsAttachmentMapper.cs new file mode 100644 index 00000000..0b890325 --- /dev/null +++ b/KVA/Migration.Tool.Source/Mappers/CmsAttachmentMapper.cs @@ -0,0 +1,55 @@ +using CMS.Base; +using CMS.MediaLibrary; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Helpers; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Mappers; + +public record CmsAttachmentMapperSource(ICmsAttachment Attachment, Guid NewAttachmentGuid, int TargetLibraryId, IUploadedFile File, string LibrarySubFolder, ICmsTree? AttachmentNode); + +public class CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) + : EntityMapperBase(logger, pkContext, protocol) +{ + private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; + + protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => + // library name is generated with site name in it + new(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); + + protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + (var cmsAttachment, var newAttachmentGuid, int targetLibraryId, _, _, var attachmentNode) = args; + + target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); + target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; + target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; + target.FileExtension = cmsAttachment.AttachmentExtension; + target.FileMimeType = cmsAttachment.AttachmentMimeType; + target.FileSize = cmsAttachment.AttachmentSize; + target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; + target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; + target.FileGUID = newAttachmentGuid; + target.FileLibraryID = targetLibraryId; + + // target.FileCreatedByUserID = cmsAttachment.?; + // target.FileModifiedByUserID = cmsAttachment.?; + // target.FileCreatedWhen = cmsAttachment.?; + + target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; + + KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); + + if (attachmentNode != null) + { + target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentNode.NodeAliasPath); + } + + return target; + } +} diff --git a/KVA/Migration.Toolkit.Source/Mappers/CmsClassMapper.cs b/KVA/Migration.Tool.Source/Mappers/CmsClassMapper.cs similarity index 86% rename from KVA/Migration.Toolkit.Source/Mappers/CmsClassMapper.cs rename to KVA/Migration.Tool.Source/Mappers/CmsClassMapper.cs index bbd1df72..6d6a0e5d 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/CmsClassMapper.cs +++ b/KVA/Migration.Tool.Source/Mappers/CmsClassMapper.cs @@ -8,16 +8,17 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api.Services.CmsClass; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Mappers; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KXP.Api.Services.CmsClass; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Helpers; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Mappers; public class CmsClassMapper( ILogger logger, @@ -53,7 +54,7 @@ protected override DataClassInfo MapInternal(ICmsClass source, DataClassInfo tar logger.LogDebug("{ClassName} is {@Properties}", source.ClassName, new { isCustomizableSystemClass, classIsCustom, source.ClassResourceID, classResource?.ResourceName }); } - MapFormDefinitionFields(source, target, isCustomizableSystemClass, classIsCustom); + FormDefinitionHelper.MapFormDefinitionFields(logger, fieldMigrationService, source, target, isCustomizableSystemClass, classIsCustom); target.ClassHasUnmanagedDbSchema = false; if (!string.IsNullOrWhiteSpace(source.ClassTableName)) @@ -200,39 +201,7 @@ protected override DataClassInfo MapInternal(ICmsClass source, DataClassInfo tar return target; } - private void MapFormDefinitionFields(ICmsClass source, DataClassInfo target, bool isCustomizableSystemClass, bool classIsCustom) - { - if (!string.IsNullOrWhiteSpace(source.ClassFormDefinition)) - { - var patcher = new FormDefinitionPatcher( - logger, - source.ClassFormDefinition, - fieldMigrationService, - source.ClassIsForm.GetValueOrDefault(false), - source.ClassIsDocumentType, - isCustomizableSystemClass, - classIsCustom - ); - - patcher.PatchFields(); - patcher.RemoveCategories(); // TODO tk: 2022-10-11 remove when supported - - string? result = patcher.GetPatched(); - if (isCustomizableSystemClass) - { - result = FormHelper.MergeFormDefinitions(target.ClassFormDefinition, result); - } - - var formInfo = new FormInfo(result); - target.ClassFormDefinition = formInfo.GetXmlDefinition(); - } - else - { - target.ClassFormDefinition = new FormInfo().GetXmlDefinition(); - } - } - - private DataClassInfo PatchDataClassInfo(DataClassInfo dataClass, out string? oldPrimaryKeyName, out string? documentNameField) + public static DataClassInfo PatchDataClassInfo(DataClassInfo dataClass, out string? oldPrimaryKeyName, out string? documentNameField) { oldPrimaryKeyName = null; documentNameField = null; @@ -335,7 +304,7 @@ private static void AppendDocumentNameField(FormInfo nfi, string className, out }); } - private string AppendRequiredValidationRule(string rulesXml) + private static string AppendRequiredValidationRule(string rulesXml) { if (string.IsNullOrWhiteSpace(rulesXml)) { diff --git a/KVA/Migration.Tool.Source/Mappers/CmsFormMapper.cs b/KVA/Migration.Tool.Source/Mappers/CmsFormMapper.cs new file mode 100644 index 00000000..06f21d68 --- /dev/null +++ b/KVA/Migration.Tool.Source/Mappers/CmsFormMapper.cs @@ -0,0 +1,133 @@ +using CMS.FormEngine; +using CMS.OnlineForms; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KXP.Models; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Mappers; + +public class CmsFormMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override BizFormInfo? CreateNewInstance(ICmsForm source, MappingHelper mappingHelper, AddFailure addFailure) + { + var newBizFormInfo = BizFormInfo.New(); + newBizFormInfo.FormGUID = source.FormGUID; + return newBizFormInfo; + } + + protected override BizFormInfo MapInternal(ICmsForm source, BizFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.FormDisplayName = source.FormDisplayName; + target.FormName = source.FormName; + target.FormItems = source.FormItems; + target.FormReportFields = source.FormReportFields; + target.FormSubmitButtonText = source.FormSubmitButtonText; + target.FormAccess = source.FormAccess.AsEnum(); + target.FormSubmitButtonImage = source.FormSubmitButtonImage; + target.FormLastModified = source.FormLastModified; + switch (source) + { + case CmsFormK11 s: + { + target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); + break; + } + case CmsFormK12 s: + { + target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); + target.FormBuilderLayout = s.FormBuilderLayout; + break; + } + case CmsFormK13 s: + { + target.FormLogActivity = s.FormLogActivity; + target.FormBuilderLayout = s.FormBuilderLayout; + break; + } + + default: + break; + } + + if (mappingHelper.TranslateRequiredId(c => c.ClassID, source.FormClassID, out int formClassId)) + { + target.FormClassID = formClassId; + } + + return target; + } +} + +public class CmsFormMapperEf : EntityMapperBase +{ + public CmsFormMapperEf(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override CmsForm? CreateNewInstance(ICmsForm source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsForm MapInternal(ICmsForm source, CmsForm target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.FormDisplayName = source.FormDisplayName; + target.FormName = source.FormName; + // target.FormSendToEmail = source.FormSendToEmail; + // target.FormSendFromEmail = source.FormSendFromEmail; + // target.FormEmailSubject = source.FormEmailSubject; + // target.FormEmailTemplate = source.FormEmailTemplate; + // target.FormEmailAttachUploadedDocs = source.FormEmailAttachUploadedDocs; + target.FormItems = source.FormItems; + target.FormReportFields = source.FormReportFields; + target.FormSubmitButtonText = source.FormSubmitButtonText; + // target.FormConfirmationEmailField = source.FormConfirmationEmailField; + // target.FormConfirmationTemplate = source.FormConfirmationTemplate; + // target.FormConfirmationSendFromEmail = source.FormConfirmationSendFromEmail; + // target.FormConfirmationEmailSubject = source.FormConfirmationEmailSubject; + target.FormAccess = source.FormAccess; + target.FormSubmitButtonImage = source.FormSubmitButtonImage; + target.FormGuid = source.FormGUID; + target.FormLastModified = source.FormLastModified; + switch (source) + { + case CmsFormK11 s: + { + target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); + break; + } + case CmsFormK12 s: + { + target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); + target.FormBuilderLayout = s.FormBuilderLayout; + break; + } + case CmsFormK13 s: + { + target.FormLogActivity = s.FormLogActivity; + target.FormBuilderLayout = s.FormBuilderLayout; + break; + } + + default: + break; + } + + // TODO tk: 2022-05-20 new deduce: target.FormAfterSubmitMode = source.FormAfterSubmitMode; + // TODO tk: 2022-05-20 new deduce: target.FormAfterSubmitRelatedValue = source.FormAfterSubmitRelatedValue; + + if (mappingHelper.TranslateRequiredId(c => c.ClassID, source.FormClassID, out int classId)) + { + target.FormClassId = classId; + } + + return target; + } +} diff --git a/KVA/Migration.Tool.Source/Mappers/ContentItemMapper.cs b/KVA/Migration.Tool.Source/Mappers/ContentItemMapper.cs new file mode 100644 index 00000000..705d4cbb --- /dev/null +++ b/KVA/Migration.Tool.Source/Mappers/ContentItemMapper.cs @@ -0,0 +1,994 @@ +using System.Diagnostics; +using CMS.ContentEngine; +using CMS.ContentEngine.Internal; +using CMS.Core; +using CMS.Core.Internal; +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.MediaLibrary; +using CMS.Websites; +using CMS.Websites.Internal; +using Kentico.Xperience.UMT.Model; +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Builders; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.Services; +using Migration.Tool.Common.Services.Ipc; +using Migration.Tool.KXP.Api; +using Migration.Tool.KXP.Api.Auxiliary; +using Migration.Tool.KXP.Api.Services.CmsClass; +using Migration.Tool.Source.Auxiliary; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Helpers; +using Migration.Tool.Source.Model; +using Migration.Tool.Source.Providers; +using Migration.Tool.Source.Services; +using Migration.Tool.Source.Services.Model; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace Migration.Tool.Source.Mappers; + +public record CmsTreeMapperSource( + ICmsTree CmsTree, + string SafeNodeName, + Guid SiteGuid, + Guid? NodeParentGuid, + Dictionary CultureToLanguageGuid, + string? TargetFormDefinition, + string SourceFormDefinition, + List MigratedDocuments, + ICmsSite SourceSite +); + +public class ContentItemMapper( + ILogger logger, + CoupledDataService coupledDataService, + ClassService classService, + IAttachmentMigrator attachmentMigrator, + CmsRelationshipService relationshipService, + SourceInstanceContext sourceInstanceContext, + FieldMigrationService fieldMigrationService, + KxpMediaFileFacade mediaFileFacade, + ModelFacade modelFacade, + ReusableSchemaService reusableSchemaService, + DeferredPathService deferredPathService, + SpoiledGuidContext spoiledGuidContext, + EntityIdentityFacade entityIdentityFacade, + IAssetFacade assetFacade, + MediaLinkServiceFactory mediaLinkServiceFactory, + ToolConfiguration configuration, + ClassMappingProvider classMappingProvider +) : UmtMapperBase +{ + private const string CLASS_FIELD_CONTROL_NAME = "controlname"; + + protected override IEnumerable MapInternal(CmsTreeMapperSource source) + { + (var cmsTree, string safeNodeName, var siteGuid, var nodeParentGuid, var cultureToLanguageGuid, string? targetFormDefinition, string sourceFormDefinition, var migratedDocuments, var sourceSite) = source; + + logger.LogTrace("Mapping {Value}", new { cmsTree.NodeAliasPath, cmsTree.NodeName, cmsTree.NodeGUID, cmsTree.NodeSiteID }); + + var sourceNodeClass = modelFacade.SelectById(cmsTree.NodeClassID) ?? throw new InvalidOperationException($"Fatal: node class is missing, class id '{cmsTree.NodeClassID}'"); + var mapping = classMappingProvider.GetMapping(sourceNodeClass.ClassName); + var targetClassGuid = sourceNodeClass.ClassGUID; + if (mapping != null) + { + targetClassGuid = DataClassInfoProvider.ProviderObject.Get(mapping.TargetClassName)?.ClassGUID ?? throw new InvalidOperationException($"Unable to find target class '{mapping.TargetClassName}'"); + } + + bool migratedAsContentFolder = sourceNodeClass.ClassName.Equals("cms.folder", StringComparison.InvariantCultureIgnoreCase) && !configuration.UseDeprecatedFolderPageType.GetValueOrDefault(false); + + var contentItemGuid = spoiledGuidContext.EnsureNodeGuid(cmsTree.NodeGUID, cmsTree.NodeSiteID, cmsTree.NodeID); + yield return new ContentItemModel + { + ContentItemGUID = contentItemGuid, + ContentItemName = safeNodeName, + ContentItemIsReusable = false, // page is not reusable + ContentItemIsSecured = cmsTree.IsSecuredNode ?? false, + ContentItemDataClassGuid = migratedAsContentFolder ? null : targetClassGuid, + ContentItemChannelGuid = siteGuid + }; + + var targetWebPage = WebPageItemInfo.Provider.Get() + .WhereEquals(nameof(WebPageItemInfo.WebPageItemGUID), contentItemGuid) + .FirstOrDefault(); + string? treePath = targetWebPage?.WebPageItemTreePath; + + var websiteChannelInfo = WebsiteChannelInfoProvider.ProviderObject.Get(siteGuid); + var treePathConvertor = TreePathConvertor.GetSiteConverter(websiteChannelInfo.WebsiteChannelID); + if (treePath == null) + { + (bool treePathIsDifferent, treePath) = treePathConvertor.ConvertAndEnsureUniqueness(cmsTree.NodeAliasPath).GetAwaiter().GetResult(); + if (treePathIsDifferent) + { + logger.LogInformation($"Original node alias path '{cmsTree.NodeAliasPath}' of '{cmsTree.NodeName}' item was converted to '{treePath}' since the value does not allow original range of allowed characters."); + } + } + + foreach (var cmsDocument in migratedDocuments) + { + if (!cultureToLanguageGuid.TryGetValue(cmsDocument.DocumentCulture, out var languageGuid)) + { + logger.LogWarning("Document '{DocumentGUID}' was skipped, unknown culture", cmsDocument.DocumentGUID); + continue; + } + + bool hasDraft = cmsDocument.DocumentPublishedVersionHistoryID is not null && + cmsDocument.DocumentPublishedVersionHistoryID != cmsDocument.DocumentCheckedOutVersionHistoryID; + + var checkoutVersion = hasDraft + ? modelFacade.SelectById(cmsDocument.DocumentCheckedOutVersionHistoryID) + : null; + + bool draftMigrated = false; + if (checkoutVersion is { PublishFrom: null } draftVersion && !migratedAsContentFolder) + { + List? migratedDraft = null; + try + { + migratedDraft = MigrateDraft(draftVersion, cmsTree, sourceFormDefinition, targetFormDefinition, contentItemGuid, languageGuid, sourceNodeClass, websiteChannelInfo, sourceSite, mapping).ToList(); + draftMigrated = true; + } + catch + { + logger.LogWarning("Failed to migrate checkout version of document with DocumentID={CmsDocumentDocumentId} VersionHistoryID={CmsDocumentDocumentCheckedOutVersionHistoryId}", + cmsDocument.DocumentID, cmsDocument.DocumentCheckedOutVersionHistoryID); + draftMigrated = false; + } + + if (migratedDraft != null) + { + foreach (var umtModel in migratedDraft) + { + yield return umtModel; + } + } + } + + var versionStatus = cmsDocument switch + { + { DocumentIsArchived: true } => VersionStatus.Unpublished, + { DocumentPublishedVersionHistoryID: null, DocumentCheckedOutVersionHistoryID: null } => VersionStatus.Published, + { DocumentPublishedVersionHistoryID: { } pubId, DocumentCheckedOutVersionHistoryID: { } chId } when pubId <= chId => VersionStatus.Published, + { DocumentPublishedVersionHistoryID: null, DocumentCheckedOutVersionHistoryID: not null } => VersionStatus.InitialDraft, + _ => draftMigrated ? VersionStatus.Published : VersionStatus.InitialDraft + }; + if (migratedAsContentFolder) + { + versionStatus = VersionStatus.Published; // folder is automatically published + } + + DateTime? scheduledPublishWhen = null; + DateTime? scheduleUnpublishWhen = null; + string? contentItemCommonDataPageBuilderWidgets = null; + string? contentItemCommonDataPageTemplateConfiguration = null; + + bool ndp = false; + if (!migratedAsContentFolder) + { + if (cmsDocument.DocumentPublishFrom is { } publishFrom) + { + var now = Service.Resolve().GetDateTimeNow(); + if (publishFrom > now) + { + versionStatus = VersionStatus.Unpublished; + } + else + { + scheduledPublishWhen = publishFrom; + } + } + + if (cmsDocument.DocumentPublishTo is { } publishTo) + { + var now = Service.Resolve().GetDateTimeNow(); + if (publishTo < now) + { + versionStatus = VersionStatus.Unpublished; + } + else + { + scheduleUnpublishWhen = publishTo; + } + } + + switch (cmsDocument) + { + case CmsDocumentK11: + { + break; + } + case CmsDocumentK12 doc: + { + contentItemCommonDataPageBuilderWidgets = doc.DocumentPageBuilderWidgets; + contentItemCommonDataPageTemplateConfiguration = doc.DocumentPageTemplateConfiguration; + break; + } + case CmsDocumentK13 doc: + { + contentItemCommonDataPageBuilderWidgets = doc.DocumentPageBuilderWidgets; + contentItemCommonDataPageTemplateConfiguration = doc.DocumentPageTemplateConfiguration; + break; + } + + default: + break; + } + + PatchJsonDefinitions(source.CmsTree.NodeSiteID, ref contentItemCommonDataPageTemplateConfiguration, ref contentItemCommonDataPageBuilderWidgets, out ndp); + } + + var documentGuid = spoiledGuidContext.EnsureDocumentGuid( + cmsDocument.DocumentGUID ?? throw new InvalidOperationException("DocumentGUID is null"), + cmsTree.NodeSiteID, + cmsTree.NodeID, + cmsDocument.DocumentID + ); + + var commonDataModel = new ContentItemCommonDataModel + { + ContentItemCommonDataGUID = documentGuid, + ContentItemCommonDataContentItemGuid = contentItemGuid, + ContentItemCommonDataContentLanguageGuid = languageGuid, // DocumentCulture -> language entity needs to be created and its ID used here + ContentItemCommonDataVersionStatus = versionStatus, + ContentItemCommonDataIsLatest = !draftMigrated, // Flag for latest record to know what to retrieve for the UI + ContentItemCommonDataPageBuilderWidgets = contentItemCommonDataPageBuilderWidgets, + ContentItemCommonDataPageTemplateConfiguration = contentItemCommonDataPageTemplateConfiguration, + }; + + if (ndp) + { + deferredPathService.AddPatch( + commonDataModel.ContentItemCommonDataGUID ?? throw new InvalidOperationException("DocumentGUID is null"), + ContentItemCommonDataInfo.TYPEINFO.ObjectClassName, + websiteChannelInfo.WebsiteChannelID + ); + } + + if (!migratedAsContentFolder) + { + var dataModel = new ContentItemDataModel { ContentItemDataGUID = commonDataModel.ContentItemCommonDataGUID, ContentItemDataCommonDataGuid = commonDataModel.ContentItemCommonDataGUID, ContentItemContentTypeName = mapping?.TargetClassName ?? sourceNodeClass.ClassName }; + + var fi = new FormInfo(targetFormDefinition); + if (sourceNodeClass.ClassIsCoupledClass) + { + var sfi = new FormInfo(sourceFormDefinition); + string primaryKeyName = ""; + foreach (var sourceFieldInfo in sfi.GetFields(true, true)) + { + if (sourceFieldInfo.PrimaryKey) + { + primaryKeyName = sourceFieldInfo.Name; + } + } + + if (string.IsNullOrWhiteSpace(primaryKeyName)) + { + throw new Exception("Error, unable to find coupled data primary key"); + } + + var commonFields = UnpackReusableFieldSchemas(fi.GetFields()).ToArray(); + var targetColumns = commonFields + .Select(cf => ReusableSchemaService.RemoveClassPrefix(sourceNodeClass.ClassName, cf.Name)) + .Union(fi.GetColumnNames(false)) + .Except([CmsClassMapper.GetLegacyDocumentName(fi, sourceNodeClass.ClassName)]) + .ToList(); + + var coupledDataRow = coupledDataService.GetSourceCoupledDataRow(sourceNodeClass.ClassTableName, primaryKeyName, cmsDocument.DocumentForeignKeyValue); + // TODO tomas.krch: 2024-09-05 propagate async to root + MapCoupledDataFieldValues(dataModel.CustomProperties, + columnName => coupledDataRow?[columnName], + columnName => coupledDataRow?.ContainsKey(columnName) ?? false, + cmsTree, cmsDocument.DocumentID, + targetColumns, sfi, fi, + false, sourceNodeClass, sourceSite, mapping + ).GetAwaiter().GetResult(); + + foreach (var formFieldInfo in commonFields) + { + string originalFieldName = ReusableSchemaService.RemoveClassPrefix(sourceNodeClass.ClassName, formFieldInfo.Name); + if (dataModel.CustomProperties.TryGetValue(originalFieldName, out object? value)) + { + commonDataModel.CustomProperties ??= []; + logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' populated", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); + commonDataModel.CustomProperties[formFieldInfo.Name] = value; + dataModel.CustomProperties.Remove(originalFieldName); + } + else + { + logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' missing", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); + } + } + } + + string targetClassName = mapping?.TargetClassName ?? sourceNodeClass.ClassName; + if (CmsClassMapper.GetLegacyDocumentName(fi, targetClassName) is { } legacyDocumentNameFieldName) + { + if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(targetClassName)) + { + string fieldName = ReusableSchemaService.GetUniqueFieldName(targetClassName, legacyDocumentNameFieldName); + commonDataModel.CustomProperties.Add(fieldName, cmsDocument.DocumentName); + } + else + { + dataModel.CustomProperties.Add(legacyDocumentNameFieldName, cmsDocument.DocumentName); + } + } + + yield return commonDataModel; + yield return dataModel; + } + + Guid? documentCreatedByUserGuid = null; + if (modelFacade.TrySelectGuid(cmsDocument.DocumentCreatedByUserID, out var createdByUserGuid)) + { + documentCreatedByUserGuid = createdByUserGuid; + } + + Guid? documentModifiedByUserGuid = null; + if (modelFacade.TrySelectGuid(cmsDocument.DocumentModifiedByUserID, out var modifiedByUserGuid)) + { + documentModifiedByUserGuid = modifiedByUserGuid; + } + + var languageMetadataInfo = new ContentItemLanguageMetadataModel + { + ContentItemLanguageMetadataGUID = documentGuid, + ContentItemLanguageMetadataContentItemGuid = contentItemGuid, + ContentItemLanguageMetadataDisplayName = cmsDocument.DocumentName, // For the admin UI only + ContentItemLanguageMetadataLatestVersionStatus = draftMigrated ? VersionStatus.Draft : versionStatus, // That's the latest status of th item for admin optimization + ContentItemLanguageMetadataCreatedWhen = cmsDocument.DocumentCreatedWhen, // DocumentCreatedWhen + ContentItemLanguageMetadataModifiedWhen = cmsDocument.DocumentModifiedWhen, // DocumentModifiedWhen + ContentItemLanguageMetadataCreatedByUserGuid = documentCreatedByUserGuid, + ContentItemLanguageMetadataModifiedByUserGuid = documentModifiedByUserGuid, + // logic inaccessible, not supported + // ContentItemLanguageMetadataHasImageAsset = ContentItemAssetHasImageArbiter.HasImage(contentItemDataInfo), // This is for admin UI optimization - set to true if latest version contains a field with an image asset + ContentItemLanguageMetadataHasImageAsset = false, + ContentItemLanguageMetadataContentLanguageGuid = languageGuid, // DocumentCulture -> language entity needs to be created and its ID used here + ContentItemLanguageMetadataScheduledPublishWhen = scheduledPublishWhen, + ContentItemLanguageMetadataScheduledUnpublishWhen = scheduleUnpublishWhen + }; + yield return languageMetadataInfo; + } + + // mapping of linked nodes is not supported + Debug.Assert(cmsTree.NodeLinkedNodeID == null, "cmsTree.NodeLinkedNodeId == null"); + Debug.Assert(cmsTree.NodeLinkedNodeSiteID == null, "cmsTree.NodeLinkedNodeSiteId == null"); + + yield return new WebPageItemModel + { + WebPageItemParentGuid = nodeParentGuid, // NULL => under root + WebPageItemGUID = contentItemGuid, + WebPageItemName = safeNodeName, + WebPageItemTreePath = treePath, + WebPageItemWebsiteChannelGuid = siteGuid, + WebPageItemContentItemGuid = contentItemGuid, + WebPageItemOrder = cmsTree.NodeOrder ?? 0 // 0 is nullish value + }; + } + + private void PatchJsonDefinitions(int sourceSiteId, ref string? pageTemplateConfiguration, ref string? pageBuilderWidgets, out bool needsDeferredPatch) + { + needsDeferredPatch = false; + if (sourceInstanceContext.HasInfo) + { + if (pageTemplateConfiguration != null) + { + var pageTemplateConfigurationObj = JsonConvert.DeserializeObject(pageTemplateConfiguration); + if (pageTemplateConfigurationObj?.Identifier != null) + { + logger.LogTrace("Walk page template configuration {Identifier}", pageTemplateConfigurationObj.Identifier); + + var pageTemplateConfigurationFcs = + sourceInstanceContext.GetPageTemplateFormComponents(sourceSiteId, pageTemplateConfigurationObj?.Identifier); + if (pageTemplateConfigurationObj.Properties is { Count: > 0 }) + { + WalkProperties(sourceSiteId, pageTemplateConfigurationObj.Properties, pageTemplateConfigurationFcs, out bool ndp); + needsDeferredPatch = ndp || needsDeferredPatch; + } + + pageTemplateConfiguration = JsonConvert.SerializeObject(pageTemplateConfigurationObj); + } + } + + if (pageBuilderWidgets != null) + { + var areas = JsonConvert.DeserializeObject(pageBuilderWidgets); + if (areas?.EditableAreas is { Count: > 0 }) + { + WalkAreas(sourceSiteId, areas.EditableAreas, out bool ndp); + needsDeferredPatch = ndp || needsDeferredPatch; + } + + pageBuilderWidgets = JsonConvert.SerializeObject(areas); + } + } + } + + private IEnumerable MigrateDraft(ICmsVersionHistory checkoutVersion, ICmsTree cmsTree, string sourceFormClassDefinition, string targetFormDefinition, Guid contentItemGuid, + Guid contentLanguageGuid, ICmsClass sourceNodeClass, WebsiteChannelInfo websiteChannelInfo, ICmsSite sourceSite, IClassMapping mapping) + { + var adapter = new NodeXmlAdapter(checkoutVersion.NodeXML); + + ContentItemCommonDataModel? commonDataModel = null; + ContentItemDataModel? dataModel = null; + try + { + string? pageTemplateConfiguration = adapter.DocumentPageTemplateConfiguration; + string? pageBuildWidgets = adapter.DocumentPageBuilderWidgets; + PatchJsonDefinitions(checkoutVersion.NodeSiteID, ref pageTemplateConfiguration, ref pageBuildWidgets, out bool ndp); + + #region Find existing guid + + var contentItemCommonDataGuid = Guid.NewGuid(); + var contentItemInfo = ContentItemInfo.Provider.Get() + .WhereEquals(nameof(ContentItemInfo.ContentItemGUID), contentItemGuid) + .FirstOrDefault(); + if (contentItemInfo != null) + { + var contentItems = ContentItemCommonDataInfo.Provider.Get() + .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataContentItemID), contentItemInfo.ContentItemID) + .ToList() + ; + + var existingDraft = contentItems.FirstOrDefault(x => x.ContentItemCommonDataVersionStatus == VersionStatus.Draft); + if (existingDraft is { ContentItemCommonDataGUID: { } existingGuid }) + { + contentItemCommonDataGuid = existingGuid; + } + } + + #endregion + + commonDataModel = new ContentItemCommonDataModel + { + ContentItemCommonDataGUID = contentItemCommonDataGuid, // adapter.DocumentGUID ?? throw new InvalidOperationException($"DocumentGUID is null"), + ContentItemCommonDataContentItemGuid = contentItemGuid, + ContentItemCommonDataContentLanguageGuid = contentLanguageGuid, + ContentItemCommonDataVersionStatus = VersionStatus.Draft, + ContentItemCommonDataIsLatest = true, // Flag for latest record to know what to retrieve for the UI + ContentItemCommonDataPageBuilderWidgets = pageBuildWidgets, + ContentItemCommonDataPageTemplateConfiguration = pageTemplateConfiguration + }; + + if (ndp) + { + deferredPathService.AddPatch( + commonDataModel.ContentItemCommonDataGUID ?? throw new InvalidOperationException("DocumentGUID is null"), + ContentItemCommonDataInfo.TYPEINFO.ObjectClassName,// sourceNodeClass.ClassName, + websiteChannelInfo.WebsiteChannelID + ); + } + + dataModel = new ContentItemDataModel + { + ContentItemDataGUID = commonDataModel.ContentItemCommonDataGUID, + ContentItemDataCommonDataGuid = commonDataModel.ContentItemCommonDataGUID, + ContentItemContentTypeName = mapping?.TargetClassName ?? sourceNodeClass.ClassName + }; + + if (sourceNodeClass.ClassIsCoupledClass) + { + var fi = new FormInfo(targetFormDefinition); + var sfi = new FormInfo(sourceFormClassDefinition); + string primaryKeyName = ""; + foreach (var sourceFieldInfo in sfi.GetFields(true, true)) + { + if (sourceFieldInfo.PrimaryKey) + { + primaryKeyName = sourceFieldInfo.Name; + } + } + + if (string.IsNullOrWhiteSpace(primaryKeyName)) + { + throw new Exception("Error, unable to find coupled data primary key"); + } + + var commonFields = UnpackReusableFieldSchemas(fi.GetFields()).ToArray(); + var sourceColumns = commonFields + .Select(cf => ReusableSchemaService.RemoveClassPrefix(sourceNodeClass.ClassName, cf.Name)) + .Union(fi.GetColumnNames(false)) + .Except([CmsClassMapper.GetLegacyDocumentName(fi, sourceNodeClass.ClassName)]) + .ToList(); + + // TODO tomas.krch: 2024-09-05 propagate async to root + MapCoupledDataFieldValues(dataModel.CustomProperties, + s => adapter.GetValue(s), + s => adapter.HasValueSet(s) + , cmsTree, adapter.DocumentID, sourceColumns, sfi, fi, true, sourceNodeClass, sourceSite, mapping).GetAwaiter().GetResult(); + + foreach (var formFieldInfo in commonFields) + { + string originalFieldName = ReusableSchemaService.RemoveClassPrefix(sourceNodeClass.ClassName, formFieldInfo.Name); + if (dataModel.CustomProperties.TryGetValue(originalFieldName, out object? value)) + { + commonDataModel.CustomProperties ??= []; + logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' populated", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); + commonDataModel.CustomProperties[formFieldInfo.Name] = value; + dataModel.CustomProperties.Remove(originalFieldName); + } + else + { + logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' missing", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); + } + } + } + + // supply document name + if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(sourceNodeClass.ClassName)) + { + string fieldName = ReusableSchemaService.GetUniqueFieldName(sourceNodeClass.ClassName, "DocumentName"); + commonDataModel.CustomProperties.Add(fieldName, adapter.DocumentName); + } + else + { + dataModel.CustomProperties.Add("DocumentName", adapter.DocumentName); + } + } + catch (Exception ex) + { + Debug.WriteLine($"Failed attempt to create draft from '{checkoutVersion}' {ex}"); + throw; + } + + if (dataModel != null && commonDataModel != null) + { + yield return commonDataModel; + yield return dataModel; + } + } + + private async Task MapCoupledDataFieldValues( + Dictionary target, + Func getSourceValue, + Func containsSourceValue, + ICmsTree cmsTree, + int? documentId, + List newColumnNames, + FormInfo oldFormInfo, + FormInfo newFormInfo, + bool migratingFromVersionHistory, + ICmsClass sourceNodeClass, + ICmsSite site, + IClassMapping mapping + ) + { + Debug.Assert(sourceNodeClass.ClassTableName != null, "sourceNodeClass.ClassTableName != null"); + + foreach (string targetColumnName in newColumnNames) + { + string targetFieldName = null!; + Func valueConvertor = sourceValue => sourceValue; + switch (mapping?.GetMapping(targetColumnName, sourceNodeClass.ClassName)) + { + case FieldMappingWithConversion fieldMappingWithConversion: + { + targetFieldName = fieldMappingWithConversion.TargetFieldName; + valueConvertor = fieldMappingWithConversion.Converter; + break; + } + case FieldMapping fieldMapping: + { + targetFieldName = fieldMapping.TargetFieldName; + valueConvertor = sourceValue => sourceValue; + break; + } + case null: + { + targetFieldName = targetColumnName; + valueConvertor = sourceValue => sourceValue; + break; + } + + default: + break; + } + + if ( + targetFieldName.Equals("ContentItemDataID", StringComparison.InvariantCultureIgnoreCase) || + targetFieldName.Equals("ContentItemDataCommonDataID", StringComparison.InvariantCultureIgnoreCase) || + targetFieldName.Equals("ContentItemDataGUID", StringComparison.InvariantCultureIgnoreCase) || + targetFieldName.Equals(CmsClassMapper.GetLegacyDocumentName(newFormInfo, sourceNodeClass.ClassName), StringComparison.InvariantCultureIgnoreCase) + ) + { + logger.LogTrace("Skipping '{FieldName}'", targetFieldName); + continue; + } + +#pragma warning disable CS0618 // Type or member is obsolete + if (oldFormInfo.GetFormField(targetFieldName)?.External is true) +#pragma warning restore CS0618 // Type or member is obsolete + { + logger.LogTrace("Skipping '{FieldName}' - is external", targetFieldName); + continue; + } + + string sourceFieldName = mapping?.GetSourceFieldName(targetColumnName, sourceNodeClass.ClassName) ?? targetColumnName; + if (!containsSourceValue(sourceFieldName)) + { + if (migratingFromVersionHistory) + { + logger.LogDebug("Value is not contained in source, field '{Field}' (possibly because version existed before field was added to class form)", targetColumnName); + } + else + { + logger.LogWarning("Value is not contained in source, field '{Field}'", targetColumnName); + } + + continue; + } + + + var field = oldFormInfo.GetFormField(sourceFieldName); + string? controlName = field.Settings[CLASS_FIELD_CONTROL_NAME]?.ToString()?.ToLowerInvariant(); + + object? sourceValue = getSourceValue(sourceFieldName); + target[targetFieldName] = valueConvertor.Invoke(sourceValue); + var fvmc = new FieldMigrationContext(field.DataType, controlName, targetColumnName, new DocumentSourceObjectContext(cmsTree, sourceNodeClass, site, oldFormInfo, newFormInfo, documentId)); + var fmb = fieldMigrationService.GetFieldMigration(fvmc); + if (fmb is FieldMigration fieldMigration) + { + if (controlName != null) + { + if (fieldMigration.Actions?.Contains(TcaDirective.ConvertToPages) ?? false) + { + // relation to other document + var convertedRelation = relationshipService.GetNodeRelationships(cmsTree.NodeID, sourceNodeClass.ClassName, field.Guid) + .Select(r => new WebPageRelatedItem { WebPageGuid = spoiledGuidContext.EnsureNodeGuid(r.RightNode.NodeGUID, r.RightNode.NodeSiteID, r.RightNode.NodeID) }); + + target.SetValueAsJson(targetFieldName, valueConvertor.Invoke(convertedRelation)); + } + else + { + // leave as is + target[targetFieldName] = valueConvertor.Invoke(sourceValue); + } + + if (fieldMigration.TargetFormComponent == "webpages") + { + if (sourceValue is string pageReferenceJson) + { + var parsed = JObject.Parse(pageReferenceJson); + foreach (var jToken in parsed.DescendantsAndSelf()) + { + if (jToken.Path.EndsWith("NodeGUID", StringComparison.InvariantCultureIgnoreCase)) + { + var patchedGuid = spoiledGuidContext.EnsureNodeGuid(jToken.Value(), cmsTree.NodeSiteID); + jToken.Replace(JToken.FromObject(patchedGuid)); + } + } + + target[targetFieldName] = valueConvertor.Invoke(parsed.ToString().Replace("\"NodeGuid\"", "\"WebPageGuid\"")); + } + } + } + else + { + target[targetFieldName] = valueConvertor.Invoke(sourceValue); + } + } + else if (fmb != null) + { + switch (await fmb.MigrateValue(sourceValue, fvmc)) + { + case { Success: true } result: + { + target[targetFieldName] = valueConvertor.Invoke(result.MigratedValue); + break; + } + case { Success: false }: + { + logger.LogError("Error while migrating field '{Field}' value {Value}", targetFieldName, sourceValue); + break; + } + + default: + break; + } + } + else + { + target[targetFieldName] = valueConvertor?.Invoke(sourceValue); + } + + + var newField = newFormInfo.GetFormField(targetColumnName); + if (newField == null) + { + + var commonFields = UnpackReusableFieldSchemas(newFormInfo.GetFields()).ToArray(); + newField = commonFields + .FirstOrDefault(cf => ReusableSchemaService.RemoveClassPrefix(mapping?.TargetClassName ?? sourceNodeClass.ClassName, cf.Name).Equals(targetColumnName, StringComparison.InvariantCultureIgnoreCase)); + } + string? newControlName = newField?.Settings[CLASS_FIELD_CONTROL_NAME]?.ToString()?.ToLowerInvariant(); + if (newControlName?.Equals(FormComponents.AdminRichTextEditorComponent, StringComparison.InvariantCultureIgnoreCase) == true && target[targetColumnName] is string { } html && !string.IsNullOrWhiteSpace(html) && + !configuration.MigrateMediaToMediaLibrary) + { + var mediaLinkService = mediaLinkServiceFactory.Create(); + var htmlProcessor = new HtmlProcessor(html, mediaLinkService); + + target[targetColumnName] = await htmlProcessor.ProcessHtml(site.SiteID, async (result, original) => + { + switch (result) + { + case { LinkKind: MediaLinkKind.Guid or MediaLinkKind.DirectMediaPath, MediaKind: MediaKind.MediaFile }: + { + var mediaFile = MediaHelper.GetMediaFile(result, modelFacade); + if (mediaFile is null) + { + return original; + } + + return assetFacade.GetAssetUri(mediaFile); + } + case { LinkKind: MediaLinkKind.Guid, MediaKind: MediaKind.Attachment, MediaGuid: { } mediaGuid, LinkSiteId: var linkSiteId }: + { + var attachment = MediaHelper.GetAttachment(result, modelFacade); + if (attachment is null) + { + return original; + } + + await attachmentMigrator.MigrateAttachment(attachment); + + string? culture = null; + if (attachment.AttachmentDocumentID is { } attachmentDocumentId) + { + culture = modelFacade.SelectById(attachmentDocumentId)?.DocumentCulture; + } + + return assetFacade.GetAssetUri(attachment, culture); + } + + default: + break; + } + + return original; + }); + } + } + } + + private static IEnumerable UnpackReusableFieldSchemas(IEnumerable schemaInfos) + { + using var siEnum = schemaInfos.GetEnumerator(); + + if (siEnum.MoveNext() && FormHelper.GetFormInfo(ContentItemCommonDataInfo.TYPEINFO.ObjectClassName, true) is { } cfi) + { + do + { + var fsi = siEnum.Current; + var formFieldInfos = cfi + .GetFields(true, true) + .Where(f => string.Equals(f.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY] as string, fsi.Guid.ToString(), + StringComparison.InvariantCultureIgnoreCase)); + + foreach (var formFieldInfo in formFieldInfos) + { + yield return formFieldInfo; + } + } while (siEnum.MoveNext()); + } + } + + #region "Page template & page widget walkers" + + private void WalkAreas(int siteId, List areas, out bool needsDeferredPatch) + { + needsDeferredPatch = false; + foreach (var area in areas) + { + logger.LogTrace("Walk area {Identifier}", area.Identifier); + + if (area.Sections is { Count: > 0 }) + { + WalkSections(siteId, area.Sections, out bool ndp); + needsDeferredPatch = ndp || needsDeferredPatch; + } + } + } + + private void WalkSections(int siteId, List sections, out bool needsDeferredPatch) + { + needsDeferredPatch = false; + foreach (var section in sections) + { + logger.LogTrace("Walk section {TypeIdentifier}|{Identifier}", section.TypeIdentifier, section.Identifier); + + var sectionFcs = sourceInstanceContext.GetSectionFormComponents(siteId, section.TypeIdentifier); + WalkProperties(siteId, section.Properties, sectionFcs, out bool ndp1); + needsDeferredPatch = ndp1 || needsDeferredPatch; + + if (section.Zones is { Count: > 0 }) + { + WalkZones(siteId, section.Zones, out bool ndp); + needsDeferredPatch = ndp || needsDeferredPatch; + } + } + } + + private void WalkZones(int siteId, List zones, out bool needsDeferredPatch) + { + needsDeferredPatch = false; + foreach (var zone in zones) + { + logger.LogTrace("Walk zone {Name}|{Identifier}", zone.Name, zone.Identifier); + + if (zone.Widgets is { Count: > 0 }) + { + WalkWidgets(siteId, zone.Widgets, out bool ndp); + needsDeferredPatch = ndp || needsDeferredPatch; + } + } + } + + private void WalkWidgets(int siteId, List widgets, out bool needsDeferredPatch) + { + needsDeferredPatch = false; + foreach (var widget in widgets) + { + logger.LogTrace("Walk widget {TypeIdentifier}|{Identifier}", widget.TypeIdentifier, widget.Identifier); + + var widgetFcs = sourceInstanceContext.GetWidgetPropertyFormComponents(siteId, widget.TypeIdentifier); + foreach (var variant in widget.Variants) + { + logger.LogTrace("Walk widget variant {Name}|{Identifier}", variant.Name, variant.Identifier); + + if (variant.Properties is { Count: > 0 }) + { + WalkProperties(siteId, variant.Properties, widgetFcs, out bool ndp); + needsDeferredPatch = ndp || needsDeferredPatch; + } + } + } + } + + private void WalkProperties(int siteId, JObject properties, List? formControlModels, out bool needsDeferredPatch) + { + needsDeferredPatch = false; + foreach ((string key, var value) in properties) + { + logger.LogTrace("Walk property {Name}|{Identifier}", key, value?.ToString()); + + var editingFcm = formControlModels?.FirstOrDefault(x => x.PropertyName.Equals(key, StringComparison.InvariantCultureIgnoreCase)); + if (editingFcm != null) + { + if (FieldMappingInstance.BuiltInModel.NotSupportedInKxpLegacyMode + .SingleOrDefault(x => x.OldFormComponent == editingFcm.FormComponentIdentifier) is var (oldFormComponent, newFormComponent)) + { + logger.LogTrace("Editing form component found {FormComponentName} => no longer supported {Replacement}", editingFcm.FormComponentIdentifier, newFormComponent); + + switch (oldFormComponent) + { + case Kx13FormComponents.Kentico_MediaFilesSelector: + { + var mfis = new List(); + if (value?.ToObject>() is { Count: > 0 } items) + { + foreach (var mfsi in items) + { + if (configuration.MigrateMediaToMediaLibrary) + { + if (entityIdentityFacade.Translate(mfsi.FileGuid, siteId) is { } mf && mediaFileFacade.GetMediaFile(mf.Identity) is { } mfi) + { + mfis.Add(new Kentico.Components.Web.Mvc.FormComponents.MediaFilesSelectorItem { FileGuid = mfi.FileGUID }); + } + } + else + { + var sourceMediaFile = modelFacade.SelectWhere("FileGUID = @mediaFileGuid AND FileSiteID = @fileSiteID", new SqlParameter("mediaFileGuid", mfsi.FileGuid), new SqlParameter("fileSiteID", siteId)) + .FirstOrDefault(); + if (sourceMediaFile != null) + { + var (ownerContentItemGuid, _) = assetFacade.GetRef(sourceMediaFile); + mfis.Add(new ContentItemReference { Identifier = ownerContentItemGuid }); + } + } + } + + + properties[key] = JToken.FromObject(items.Select(x => new Kentico.Components.Web.Mvc.FormComponents.MediaFilesSelectorItem { FileGuid = entityIdentityFacade.Translate(x.FileGuid, siteId).Identity }) + .ToList()); + } + + break; + } + case Kx13FormComponents.Kentico_PathSelector: + { + if (value?.ToObject>() is { Count: > 0 } items) + { + properties[key] = JToken.FromObject(items.Select(x => new Kentico.Components.Web.Mvc.FormComponents.PathSelectorItem { TreePath = x.NodeAliasPath }).ToList()); + } + + break; + } + case Kx13FormComponents.Kentico_AttachmentSelector when newFormComponent == FormComponents.AdminAssetSelectorComponent: + { + if (value?.ToObject>() is { Count: > 0 } items) + { + var nv = new List(); + foreach (var asi in items) + { + var attachment = modelFacade.SelectWhere("AttachmentSiteID = @attachmentSiteId AND AttachmentGUID = @attachmentGUID", + new SqlParameter("attachmentSiteID", siteId), + new SqlParameter("attachmentGUID", asi.FileGuid) + ) + .FirstOrDefault(); + if (attachment != null) + { + switch (attachmentMigrator.MigrateAttachment(attachment).GetAwaiter().GetResult()) + { + case MigrateAttachmentResultMediaFile { Success: true, MediaFileInfo: { } x }: + { + nv.Add(new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }); + break; + } + case MigrateAttachmentResultContentItem { Success: true, ContentItemGuid: { } contentItemGuid }: + { + nv.Add(new ContentItemReference { Identifier = contentItemGuid }); + break; + } + default: + { + logger.LogWarning("Attachment '{AttachmentGUID}' failed to migrate", asi.FileGuid); + break; + } + } + } + else + { + logger.LogWarning("Attachment '{AttachmentGUID}' not found", asi.FileGuid); + } + } + + properties[key] = JToken.FromObject(nv); + } + + logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); + break; + } + case Kx13FormComponents.Kentico_PageSelector when newFormComponent == FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent: + { + if (value?.ToObject>() is { Count: > 0 } items) + { + properties[key] = JToken.FromObject(items.Select(x => new WebPageRelatedItem { WebPageGuid = spoiledGuidContext.EnsureNodeGuid(x.NodeGuid, siteId) }).ToList()); + } + + logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); + break; + } + + default: + break; + } + } + else if (FieldMappingInstance.BuiltInModel.SupportedInKxpLegacyMode.Contains(editingFcm.FormComponentIdentifier)) + { + // OK + logger.LogTrace("Editing form component found {FormComponentName} => supported in legacy mode", editingFcm.FormComponentIdentifier); + } + else + { + // unknown control, probably custom + logger.LogTrace("Editing form component found {FormComponentName} => custom or inlined component, don't forget to migrate code accordingly", editingFcm.FormComponentIdentifier); + } + } + + if ("NodeAliasPath".Equals(key, StringComparison.InvariantCultureIgnoreCase)) + { + needsDeferredPatch = true; + properties["TreePath"] = value; + properties.Remove(key); + } + } + } + + #endregion +} diff --git a/KVA/Migration.Toolkit.Source/Mappers/MediaFileInfoMapper.cs b/KVA/Migration.Tool.Source/Mappers/MediaFileInfoMapper.cs similarity index 92% rename from KVA/Migration.Toolkit.Source/Mappers/MediaFileInfoMapper.cs rename to KVA/Migration.Tool.Source/Mappers/MediaFileInfoMapper.cs index 21700f15..2613f2c1 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/MediaFileInfoMapper.cs +++ b/KVA/Migration.Tool.Source/Mappers/MediaFileInfoMapper.cs @@ -6,15 +6,15 @@ using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KXP.Api; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Helpers; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Mappers; +namespace Migration.Tool.Source.Mappers; public record MediaFileInfoMapperSource( string? FullMediaFilePath, @@ -31,7 +31,7 @@ public class MediaFileInfoMapper( PrimaryKeyMappingContext primaryKeyMappingContext, KxpClassFacade classFacade, IProtocol protocol, - ToolkitConfiguration toolkitConfiguration + ToolConfiguration toolConfiguration ) : EntityMapperBase(logger, primaryKeyMappingContext, protocol) { @@ -120,7 +120,7 @@ private void MigrateCustomizedFields(MediaFileInfo target, IMediaFile sourceMedi string query = $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {MediaFileInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {MediaFileInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); + using var conn = new SqlConnection(toolConfiguration.KxConnectionString); using var cmd = conn.CreateCommand(); cmd.CommandText = query; diff --git a/KVA/Migration.Toolkit.Source/Mappers/MediaLibraryInfoMapper.cs b/KVA/Migration.Tool.Source/Mappers/MediaLibraryInfoMapper.cs similarity index 90% rename from KVA/Migration.Toolkit.Source/Mappers/MediaLibraryInfoMapper.cs rename to KVA/Migration.Tool.Source/Mappers/MediaLibraryInfoMapper.cs index af2a89cf..c4e19cf5 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/MediaLibraryInfoMapper.cs +++ b/KVA/Migration.Tool.Source/Mappers/MediaLibraryInfoMapper.cs @@ -3,12 +3,12 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Mappers; +namespace Migration.Tool.Source.Mappers; public record MediaLibraryInfoMapperSource(IMediaLibrary MediaLibrary, ICmsSite Site, Guid SafeLibraryGuid, string SafeLibraryName); diff --git a/KVA/Migration.Tool.Source/Mappers/MemberInfoMapper.cs b/KVA/Migration.Tool.Source/Mappers/MemberInfoMapper.cs new file mode 100644 index 00000000..c4d3e6db --- /dev/null +++ b/KVA/Migration.Tool.Source/Mappers/MemberInfoMapper.cs @@ -0,0 +1,180 @@ +using System.Data; + +using CMS.FormEngine; +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KXP.Api; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Mappers; + +public record MemberInfoMapperSource(ICmsUser User, ICmsUserSetting UserSetting); + +public class MemberInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolConfiguration toolConfiguration, + ModelFacade modelFacade +) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + public static IReadOnlyList MigratedUserFields = new List + { + nameof(ICmsUser.UserGUID), + nameof(ICmsUser.UserName), + nameof(ICmsUser.Email), + // nameof(ICmsUser.UserPassword), + nameof(ICmsUser.UserEnabled), + nameof(ICmsUser.UserCreated), + nameof(ICmsUser.UserSecurityStamp) + }; + + protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (user, userSetting) = source; + + if (!newInstance && user.UserGUID != target.MemberGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.MemberName = user.UserName; + + // target.FirstName = source.FirstName; + // target.LastName = source.LastName; + + // target.Email = source.Email; + target.MemberEmail = user.Email; + + target.MemberPassword = null; // source.UserPassword; // not migrated + + target.MemberEnabled = user.UserEnabled; + + target.SetValue("UserCreated", user.UserCreated); + target.MemberCreated = user.UserCreated.GetValueOrDefault(); + + target.MemberGuid = user.UserGUID; + target.MemberSecurityStamp = user.UserSecurityStamp; + + // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + // OBSOLETE: target.UserIsPendingRegistration = false; + // OBSOLETE: target.UserPasswordLastChanged = null; + // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); + foreach (var customizedFieldInfo in customized) + { + string fieldName = customizedFieldInfo.FieldName; + + if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out object? value) || + ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) + { + target.SetValue(fieldName, value); + } + } + + var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(MemberInfo.TYPEINFO.ObjectClassName).ToList(); + if (userCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.User.UserID); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + + var usDci = modelFacade + .SelectAll() + .Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }) + .FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); + + if (usDci != null) + { + var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); + if (userSettingsCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; + + using var conn = new SqlConnection(toolConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsID); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userSettingsCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserSettingsInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); + } + } + } + + + return target; + } +} diff --git a/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs b/KVA/Migration.Tool.Source/Mappers/PageTemplateConfigurationMapper.cs similarity index 95% rename from KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs rename to KVA/Migration.Tool.Source/Mappers/PageTemplateConfigurationMapper.cs index fe04172b..bfcbef7d 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs +++ b/KVA/Migration.Tool.Source/Mappers/PageTemplateConfigurationMapper.cs @@ -4,23 +4,23 @@ using CMS.Websites; using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Api.Auxiliary; -using Migration.Toolkit.KXP.Api.Services.CmsClass; -using Migration.Toolkit.Source.Auxiliary; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services; -using Migration.Toolkit.Source.Services.Model; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Common.Services.Ipc; +using Migration.Tool.KXP.Api; +using Migration.Tool.KXP.Api.Auxiliary; +using Migration.Tool.KXP.Api.Services.CmsClass; +using Migration.Tool.Source.Auxiliary; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Model; +using Migration.Tool.Source.Services; +using Migration.Tool.Source.Services.Model; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -namespace Migration.Toolkit.Source.Mappers; +namespace Migration.Tool.Source.Mappers; public class PageTemplateConfigurationMapper( ILogger logger, @@ -32,7 +32,7 @@ public class PageTemplateConfigurationMapper( ModelFacade modelFacade, IAttachmentMigrator attachmentMigrator, IAssetFacade assetFacade, - ToolkitConfiguration configuration, + ToolConfiguration configuration, KxpMediaFileFacade mediaFileFacade ) : EntityMapperBase(logger, pkContext, protocol) diff --git a/KVA/Migration.Toolkit.Source/Mappers/ResourceMapper.cs b/KVA/Migration.Tool.Source/Mappers/ResourceMapper.cs similarity index 88% rename from KVA/Migration.Toolkit.Source/Mappers/ResourceMapper.cs rename to KVA/Migration.Tool.Source/Mappers/ResourceMapper.cs index 050ab944..c7882666 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/ResourceMapper.cs +++ b/KVA/Migration.Tool.Source/Mappers/ResourceMapper.cs @@ -2,13 +2,13 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Mappers; +namespace Migration.Tool.Source.Mappers; public class ResourceMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) diff --git a/KVA/Migration.Toolkit.Source/Mappers/TagMapper.cs b/KVA/Migration.Tool.Source/Mappers/TagMapper.cs similarity index 90% rename from KVA/Migration.Toolkit.Source/Mappers/TagMapper.cs rename to KVA/Migration.Tool.Source/Mappers/TagMapper.cs index ed18af0f..6d15c82f 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/TagMapper.cs +++ b/KVA/Migration.Tool.Source/Mappers/TagMapper.cs @@ -2,10 +2,10 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Mappers; +namespace Migration.Tool.Source.Mappers; public record TagModelSource(Guid TaxonomyGuid, ICmsCategory CmsCategory, Dictionary CategoryId2Guid); diff --git a/KVA/Migration.Tool.Source/Migration.Tool.Source.csproj b/KVA/Migration.Tool.Source/Migration.Tool.Source.csproj new file mode 100644 index 00000000..9821df01 --- /dev/null +++ b/KVA/Migration.Tool.Source/Migration.Tool.Source.csproj @@ -0,0 +1,23 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + + + + + IDE0060 + + diff --git a/KVA/Migration.Tool.Source/Model/CmsAlternativeForm.cs b/KVA/Migration.Tool.Source/Model/CmsAlternativeForm.cs new file mode 100644 index 00000000..526e6350 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsAlternativeForm.cs @@ -0,0 +1,87 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsAlternativeForm : ISourceModel +{ + int FormID { get; } + string FormDisplayName { get; } + string FormName { get; } + int FormClassID { get; } + string? FormDefinition { get; } + string? FormLayout { get; } + Guid FormGUID { get; } + DateTime FormLastModified { get; } + int? FormCoupledClassID { get; } + bool? FormHideNewParentFields { get; } + string? FormLayoutType { get; } + string? FormVersionGUID { get; } + string? FormCustomizedColumns { get; } + bool? FormIsCustom { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsAlternativeFormK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsAlternativeFormK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsAlternativeFormK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsAlternativeFormK11.IsAvailable(version), + { Major: 12 } => CmsAlternativeFormK12.IsAvailable(version), + { Major: 13 } => CmsAlternativeFormK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_AlternativeForm"; + static string ISourceModel.GuidColumnName => "FormGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsAlternativeForm ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsAlternativeFormK11.FromReader(reader, version), + { Major: 12 } => CmsAlternativeFormK12.FromReader(reader, version), + { Major: 13 } => CmsAlternativeFormK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsAlternativeFormK11(int FormID, string FormDisplayName, string FormName, int FormClassID, string? FormDefinition, string? FormLayout, Guid FormGUID, DateTime FormLastModified, int? FormCoupledClassID, bool? FormHideNewParentFields, string? FormLayoutType, string? FormVersionGUID, string? FormCustomizedColumns, bool? FormIsCustom) : ICmsAlternativeForm, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; + public static string TableName => "CMS_AlternativeForm"; + public static string GuidColumnName => "FormGUID"; + static CmsAlternativeFormK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") + ); + public static CmsAlternativeFormK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") + ); +}; +public partial record CmsAlternativeFormK12(int FormID, string FormDisplayName, string FormName, int FormClassID, string? FormDefinition, string? FormLayout, Guid FormGUID, DateTime FormLastModified, int? FormCoupledClassID, bool? FormHideNewParentFields, string? FormLayoutType, string? FormVersionGUID, string? FormCustomizedColumns, bool? FormIsCustom) : ICmsAlternativeForm, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; + public static string TableName => "CMS_AlternativeForm"; + public static string GuidColumnName => "FormGUID"; + static CmsAlternativeFormK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") + ); + public static CmsAlternativeFormK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") + ); +}; +public partial record CmsAlternativeFormK13(int FormID, string FormDisplayName, string FormName, int FormClassID, string? FormDefinition, string? FormLayout, Guid FormGUID, DateTime FormLastModified, int? FormCoupledClassID, bool? FormHideNewParentFields, string? FormLayoutType, string? FormVersionGUID, string? FormCustomizedColumns, bool? FormIsCustom) : ICmsAlternativeForm, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; + public static string TableName => "CMS_AlternativeForm"; + public static string GuidColumnName => "FormGUID"; + static CmsAlternativeFormK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") + ); + public static CmsAlternativeFormK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsAlternativeUrl.cs b/KVA/Migration.Tool.Source/Model/CmsAlternativeUrl.cs new file mode 100644 index 00000000..63dcc2a7 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsAlternativeUrl.cs @@ -0,0 +1,74 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsAlternativeUrl : ISourceModel +{ + + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsAlternativeUrlK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsAlternativeUrlK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsAlternativeUrlK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsAlternativeUrlK11.IsAvailable(version), + { Major: 12 } => CmsAlternativeUrlK12.IsAvailable(version), + { Major: 13 } => CmsAlternativeUrlK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_AlternativeUrl"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + static ICmsAlternativeUrl ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsAlternativeUrlK11.FromReader(reader, version), + { Major: 12 } => CmsAlternativeUrlK12.FromReader(reader, version), + { Major: 13 } => CmsAlternativeUrlK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsAlternativeUrlK11() : ICmsAlternativeUrl, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => false; + public static string GetPrimaryKeyName(SemanticVersion version) => ""; + public static string TableName => "CMS_AlternativeUrl"; + public static string GuidColumnName => ""; + static CmsAlternativeUrlK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + + ); + public static CmsAlternativeUrlK11 FromReader(IDataReader reader, SemanticVersion version) => new( + + ); +}; +public partial record CmsAlternativeUrlK12(int AlternativeUrlID, Guid AlternativeUrlGUID, int AlternativeUrlDocumentID, int AlternativeUrlSiteID, string AlternativeUrlUrl, DateTime AlternativeUrlLastModified) : ICmsAlternativeUrl, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "AlternativeUrlID"; + public static string TableName => "CMS_AlternativeUrl"; + public static string GuidColumnName => "AlternativeUrlGUID"; + static CmsAlternativeUrlK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), reader.Unbox("AlternativeUrlLastModified") + ); + public static CmsAlternativeUrlK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), reader.Unbox("AlternativeUrlLastModified") + ); +}; +public partial record CmsAlternativeUrlK13(int AlternativeUrlID, Guid AlternativeUrlGUID, int AlternativeUrlDocumentID, int AlternativeUrlSiteID, string AlternativeUrlUrl, DateTime AlternativeUrlLastModified) : ICmsAlternativeUrl, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "AlternativeUrlID"; + public static string TableName => "CMS_AlternativeUrl"; + public static string GuidColumnName => "AlternativeUrlGUID"; + static CmsAlternativeUrlK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), reader.Unbox("AlternativeUrlLastModified") + ); + public static CmsAlternativeUrlK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), reader.Unbox("AlternativeUrlLastModified") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsAttachment.cs b/KVA/Migration.Tool.Source/Model/CmsAttachment.cs new file mode 100644 index 00000000..cf46c0e2 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsAttachment.cs @@ -0,0 +1,96 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsAttachment : ISourceModel +{ + int AttachmentID { get; } + string AttachmentName { get; } + string AttachmentExtension { get; } + int AttachmentSize { get; } + string AttachmentMimeType { get; } + byte[]? AttachmentBinary { get; } + int? AttachmentImageWidth { get; } + int? AttachmentImageHeight { get; } + int? AttachmentDocumentID { get; } + Guid AttachmentGUID { get; } + int AttachmentSiteID { get; } + DateTime AttachmentLastModified { get; } + bool? AttachmentIsUnsorted { get; } + int? AttachmentOrder { get; } + Guid? AttachmentGroupGUID { get; } + Guid? AttachmentFormGUID { get; } + string? AttachmentHash { get; } + string? AttachmentTitle { get; } + string? AttachmentDescription { get; } + string? AttachmentCustomData { get; } + string? AttachmentSearchContent { get; } + string? AttachmentVariantDefinitionIdentifier { get; } + int? AttachmentVariantParentID { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsAttachmentK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsAttachmentK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsAttachmentK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsAttachmentK11.IsAvailable(version), + { Major: 12 } => CmsAttachmentK12.IsAvailable(version), + { Major: 13 } => CmsAttachmentK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_Attachment"; + static string ISourceModel.GuidColumnName => "AttachmentGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsAttachment ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsAttachmentK11.FromReader(reader, version), + { Major: 12 } => CmsAttachmentK12.FromReader(reader, version), + { Major: 13 } => CmsAttachmentK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsAttachmentK11(int AttachmentID, string AttachmentName, string AttachmentExtension, int AttachmentSize, string AttachmentMimeType, byte[]? AttachmentBinary, int? AttachmentImageWidth, int? AttachmentImageHeight, int? AttachmentDocumentID, Guid AttachmentGUID, int AttachmentSiteID, DateTime AttachmentLastModified, bool? AttachmentIsUnsorted, int? AttachmentOrder, Guid? AttachmentGroupGUID, Guid? AttachmentFormGUID, string? AttachmentHash, string? AttachmentTitle, string? AttachmentDescription, string? AttachmentCustomData, string? AttachmentSearchContent, string? AttachmentVariantDefinitionIdentifier, int? AttachmentVariantParentID) : ICmsAttachment, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "AttachmentID"; + public static string TableName => "CMS_Attachment"; + public static string GuidColumnName => "AttachmentGUID"; + static CmsAttachmentK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") + ); + public static CmsAttachmentK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") + ); +}; +public partial record CmsAttachmentK12(int AttachmentID, string AttachmentName, string AttachmentExtension, int AttachmentSize, string AttachmentMimeType, byte[]? AttachmentBinary, int? AttachmentImageWidth, int? AttachmentImageHeight, int? AttachmentDocumentID, Guid AttachmentGUID, int AttachmentSiteID, DateTime AttachmentLastModified, bool? AttachmentIsUnsorted, int? AttachmentOrder, Guid? AttachmentGroupGUID, Guid? AttachmentFormGUID, string? AttachmentHash, string? AttachmentTitle, string? AttachmentDescription, string? AttachmentCustomData, string? AttachmentSearchContent, string? AttachmentVariantDefinitionIdentifier, int? AttachmentVariantParentID) : ICmsAttachment, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "AttachmentID"; + public static string TableName => "CMS_Attachment"; + public static string GuidColumnName => "AttachmentGUID"; + static CmsAttachmentK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") + ); + public static CmsAttachmentK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") + ); +}; +public partial record CmsAttachmentK13(int AttachmentID, string AttachmentName, string AttachmentExtension, int AttachmentSize, string AttachmentMimeType, byte[]? AttachmentBinary, int? AttachmentImageWidth, int? AttachmentImageHeight, int? AttachmentDocumentID, Guid AttachmentGUID, int AttachmentSiteID, DateTime AttachmentLastModified, bool? AttachmentIsUnsorted, int? AttachmentOrder, Guid? AttachmentGroupGUID, Guid? AttachmentFormGUID, string? AttachmentHash, string? AttachmentTitle, string? AttachmentDescription, string? AttachmentCustomData, string? AttachmentSearchContent, string? AttachmentVariantDefinitionIdentifier, int? AttachmentVariantParentID) : ICmsAttachment, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "AttachmentID"; + public static string TableName => "CMS_Attachment"; + public static string GuidColumnName => "AttachmentGUID"; + static CmsAttachmentK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") + ); + public static CmsAttachmentK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsCategory.cs b/KVA/Migration.Tool.Source/Model/CmsCategory.cs new file mode 100644 index 00000000..854c2b29 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsCategory.cs @@ -0,0 +1,88 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsCategory : ISourceModel +{ + int CategoryID { get; } + string CategoryDisplayName { get; } + string? CategoryName { get; } + string? CategoryDescription { get; } + int? CategoryCount { get; } + bool CategoryEnabled { get; } + int? CategoryUserID { get; } + Guid CategoryGUID { get; } + DateTime CategoryLastModified { get; } + int? CategorySiteID { get; } + int? CategoryParentID { get; } + string? CategoryIDPath { get; } + string? CategoryNamePath { get; } + int? CategoryLevel { get; } + int? CategoryOrder { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsCategoryK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsCategoryK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsCategoryK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsCategoryK11.IsAvailable(version), + { Major: 12 } => CmsCategoryK12.IsAvailable(version), + { Major: 13 } => CmsCategoryK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_Category"; + static string ISourceModel.GuidColumnName => "CategoryGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsCategory ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsCategoryK11.FromReader(reader, version), + { Major: 12 } => CmsCategoryK12.FromReader(reader, version), + { Major: 13 } => CmsCategoryK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsCategoryK11(int CategoryID, string CategoryDisplayName, string? CategoryName, string? CategoryDescription, int? CategoryCount, bool CategoryEnabled, int? CategoryUserID, Guid CategoryGUID, DateTime CategoryLastModified, int? CategorySiteID, int? CategoryParentID, string? CategoryIDPath, string? CategoryNamePath, int? CategoryLevel, int? CategoryOrder) : ICmsCategory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; + public static string TableName => "CMS_Category"; + public static string GuidColumnName => "CategoryGUID"; + static CmsCategoryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") + ); + public static CmsCategoryK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") + ); +}; +public partial record CmsCategoryK12(int CategoryID, string CategoryDisplayName, string? CategoryName, string? CategoryDescription, int? CategoryCount, bool CategoryEnabled, int? CategoryUserID, Guid CategoryGUID, DateTime CategoryLastModified, int? CategorySiteID, int? CategoryParentID, string? CategoryIDPath, string? CategoryNamePath, int? CategoryLevel, int? CategoryOrder) : ICmsCategory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; + public static string TableName => "CMS_Category"; + public static string GuidColumnName => "CategoryGUID"; + static CmsCategoryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") + ); + public static CmsCategoryK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") + ); +}; +public partial record CmsCategoryK13(int CategoryID, string CategoryDisplayName, string? CategoryName, string? CategoryDescription, int? CategoryCount, bool CategoryEnabled, int? CategoryUserID, Guid CategoryGUID, DateTime CategoryLastModified, int? CategorySiteID, int? CategoryParentID, string? CategoryIDPath, string? CategoryNamePath, int? CategoryLevel, int? CategoryOrder) : ICmsCategory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; + public static string TableName => "CMS_Category"; + public static string GuidColumnName => "CategoryGUID"; + static CmsCategoryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") + ); + public static CmsCategoryK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsClass.cs b/KVA/Migration.Tool.Source/Model/CmsClass.cs new file mode 100644 index 00000000..7641d15c --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsClass.cs @@ -0,0 +1,119 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsClass : ISourceModel +{ + int ClassID { get; } + string ClassDisplayName { get; } + string ClassName { get; } + bool ClassUsesVersioning { get; } + bool ClassIsDocumentType { get; } + bool ClassIsCoupledClass { get; } + string ClassXmlSchema { get; } + string ClassFormDefinition { get; } + string ClassNodeNameSource { get; } + string? ClassTableName { get; } + string? ClassFormLayout { get; } + bool? ClassShowAsSystemTable { get; } + bool? ClassUsePublishFromTo { get; } + bool? ClassShowTemplateSelection { get; } + string? ClassSKUMappings { get; } + bool? ClassIsMenuItemType { get; } + string? ClassNodeAliasSource { get; } + DateTime ClassLastModified { get; } + Guid ClassGUID { get; } + bool? ClassCreateSKU { get; } + bool? ClassIsProduct { get; } + bool ClassIsCustomTable { get; } + string? ClassShowColumns { get; } + string? ClassSearchTitleColumn { get; } + string? ClassSearchContentColumn { get; } + string? ClassSearchImageColumn { get; } + string? ClassSearchCreationDateColumn { get; } + string? ClassSearchSettings { get; } + int? ClassInheritsFromClassID { get; } + bool? ClassSearchEnabled { get; } + string? ClassSKUDefaultDepartmentName { get; } + int? ClassSKUDefaultDepartmentID { get; } + string? ClassContactMapping { get; } + bool? ClassContactOverwriteEnabled { get; } + string? ClassSKUDefaultProductType { get; } + string? ClassConnectionString { get; } + bool? ClassIsProductSection { get; } + string? ClassFormLayoutType { get; } + string? ClassVersionGUID { get; } + string? ClassDefaultObjectType { get; } + bool? ClassIsForm { get; } + int? ClassResourceID { get; } + string? ClassCustomizedColumns { get; } + string? ClassCodeGenerationSettings { get; } + string? ClassIconClass { get; } + string? ClassURLPattern { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsClassK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsClassK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsClassK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsClassK11.IsAvailable(version), + { Major: 12 } => CmsClassK12.IsAvailable(version), + { Major: 13 } => CmsClassK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_Class"; + static string ISourceModel.GuidColumnName => "ClassGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsClass ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsClassK11.FromReader(reader, version), + { Major: 12 } => CmsClassK12.FromReader(reader, version), + { Major: 13 } => CmsClassK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsClassK11(int ClassID, string ClassDisplayName, string ClassName, bool ClassUsesVersioning, bool ClassIsDocumentType, bool ClassIsCoupledClass, string ClassXmlSchema, string ClassFormDefinition, string? ClassEditingPageUrl, string? ClassListPageUrl, string ClassNodeNameSource, string? ClassTableName, string? ClassViewPageUrl, string? ClassPreviewPageUrl, string? ClassFormLayout, string? ClassNewPageUrl, bool? ClassShowAsSystemTable, bool? ClassUsePublishFromTo, bool? ClassShowTemplateSelection, string? ClassSKUMappings, bool? ClassIsMenuItemType, string? ClassNodeAliasSource, int? ClassDefaultPageTemplateID, DateTime ClassLastModified, Guid ClassGUID, bool? ClassCreateSKU, bool? ClassIsProduct, bool ClassIsCustomTable, string? ClassShowColumns, string? ClassSearchTitleColumn, string? ClassSearchContentColumn, string? ClassSearchImageColumn, string? ClassSearchCreationDateColumn, string? ClassSearchSettings, int? ClassInheritsFromClassID, bool? ClassSearchEnabled, string? ClassSKUDefaultDepartmentName, int? ClassSKUDefaultDepartmentID, string? ClassContactMapping, bool? ClassContactOverwriteEnabled, string? ClassSKUDefaultProductType, string? ClassConnectionString, bool? ClassIsProductSection, int? ClassPageTemplateCategoryID, string? ClassFormLayoutType, string? ClassVersionGUID, string? ClassDefaultObjectType, bool? ClassIsForm, int? ClassResourceID, string? ClassCustomizedColumns, string? ClassCodeGenerationSettings, string? ClassIconClass, bool? ClassIsContentOnly, string? ClassURLPattern) : ICmsClass, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; + public static string TableName => "CMS_Class"; + public static string GuidColumnName => "ClassGUID"; + static CmsClassK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") + ); + public static CmsClassK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") + ); +}; +public partial record CmsClassK12(int ClassID, string ClassDisplayName, string ClassName, bool ClassUsesVersioning, bool ClassIsDocumentType, bool ClassIsCoupledClass, string ClassXmlSchema, string ClassFormDefinition, string? ClassEditingPageUrl, string? ClassListPageUrl, string ClassNodeNameSource, string? ClassTableName, string? ClassViewPageUrl, string? ClassPreviewPageUrl, string? ClassFormLayout, string? ClassNewPageUrl, bool? ClassShowAsSystemTable, bool? ClassUsePublishFromTo, bool? ClassShowTemplateSelection, string? ClassSKUMappings, bool? ClassIsMenuItemType, string? ClassNodeAliasSource, int? ClassDefaultPageTemplateID, DateTime ClassLastModified, Guid ClassGUID, bool? ClassCreateSKU, bool? ClassIsProduct, bool ClassIsCustomTable, string? ClassShowColumns, string? ClassSearchTitleColumn, string? ClassSearchContentColumn, string? ClassSearchImageColumn, string? ClassSearchCreationDateColumn, string? ClassSearchSettings, int? ClassInheritsFromClassID, bool? ClassSearchEnabled, string? ClassSKUDefaultDepartmentName, int? ClassSKUDefaultDepartmentID, string? ClassContactMapping, bool? ClassContactOverwriteEnabled, string? ClassSKUDefaultProductType, string? ClassConnectionString, bool? ClassIsProductSection, int? ClassPageTemplateCategoryID, string? ClassFormLayoutType, string? ClassVersionGUID, string? ClassDefaultObjectType, bool? ClassIsForm, int? ClassResourceID, string? ClassCustomizedColumns, string? ClassCodeGenerationSettings, string? ClassIconClass, bool? ClassIsContentOnly, string? ClassURLPattern) : ICmsClass, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; + public static string TableName => "CMS_Class"; + public static string GuidColumnName => "ClassGUID"; + static CmsClassK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") + ); + public static CmsClassK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") + ); +}; +public partial record CmsClassK13(int ClassID, string ClassDisplayName, string ClassName, bool ClassUsesVersioning, bool ClassIsDocumentType, bool ClassIsCoupledClass, string ClassXmlSchema, string ClassFormDefinition, string ClassNodeNameSource, string? ClassTableName, string? ClassFormLayout, bool? ClassShowAsSystemTable, bool? ClassUsePublishFromTo, bool? ClassShowTemplateSelection, string? ClassSKUMappings, bool? ClassIsMenuItemType, string? ClassNodeAliasSource, DateTime ClassLastModified, Guid ClassGUID, bool? ClassCreateSKU, bool? ClassIsProduct, bool ClassIsCustomTable, string? ClassShowColumns, string? ClassSearchTitleColumn, string? ClassSearchContentColumn, string? ClassSearchImageColumn, string? ClassSearchCreationDateColumn, string? ClassSearchSettings, int? ClassInheritsFromClassID, bool? ClassSearchEnabled, string? ClassSKUDefaultDepartmentName, int? ClassSKUDefaultDepartmentID, string? ClassContactMapping, bool? ClassContactOverwriteEnabled, string? ClassSKUDefaultProductType, string? ClassConnectionString, bool? ClassIsProductSection, string? ClassFormLayoutType, string? ClassVersionGUID, string? ClassDefaultObjectType, bool? ClassIsForm, int? ClassResourceID, string? ClassCustomizedColumns, string? ClassCodeGenerationSettings, string? ClassIconClass, string? ClassURLPattern, bool ClassUsesPageBuilder, bool ClassIsNavigationItem, bool ClassHasURL, bool ClassHasMetadata, int? ClassSearchIndexDataSource) : ICmsClass, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; + public static string TableName => "CMS_Class"; + public static string GuidColumnName => "ClassGUID"; + static CmsClassK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassURLPattern"), reader.Unbox("ClassUsesPageBuilder"), reader.Unbox("ClassIsNavigationItem"), reader.Unbox("ClassHasURL"), reader.Unbox("ClassHasMetadata"), reader.Unbox("ClassSearchIndexDataSource") + ); + public static CmsClassK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassURLPattern"), reader.Unbox("ClassUsesPageBuilder"), reader.Unbox("ClassIsNavigationItem"), reader.Unbox("ClassHasURL"), reader.Unbox("ClassHasMetadata"), reader.Unbox("ClassSearchIndexDataSource") + ); +}; + diff --git a/KVA/Migration.Toolkit.Source/Model/CmsClassSite.cs b/KVA/Migration.Tool.Source/Model/CmsClassSite.cs similarity index 98% rename from KVA/Migration.Toolkit.Source/Model/CmsClassSite.cs rename to KVA/Migration.Tool.Source/Model/CmsClassSite.cs index ccfcd9a7..5da88ade 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsClassSite.cs +++ b/KVA/Migration.Tool.Source/Model/CmsClassSite.cs @@ -1,9 +1,9 @@ // ReSharper disable InconsistentNaming using System.Data; -using Migration.Toolkit.Common; +using Migration.Tool.Common; -namespace Migration.Toolkit.Source.Model; +namespace Migration.Tool.Source.Model; public partial interface ICmsClassSite : ISourceModel { int ClassID { get; } diff --git a/KVA/Migration.Tool.Source/Model/CmsConsent.cs b/KVA/Migration.Tool.Source/Model/CmsConsent.cs new file mode 100644 index 00000000..0f4754d9 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsConsent.cs @@ -0,0 +1,80 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsConsent : ISourceModel +{ + int ConsentID { get; } + string ConsentDisplayName { get; } + string ConsentName { get; } + string ConsentContent { get; } + Guid ConsentGuid { get; } + DateTime ConsentLastModified { get; } + string ConsentHash { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsConsentK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsConsentK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentK11.IsAvailable(version), + { Major: 12 } => CmsConsentK12.IsAvailable(version), + { Major: 13 } => CmsConsentK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_Consent"; + static string ISourceModel.GuidColumnName => "ConsentGuid"; //assumtion, class Guid column doesn't change between versions + static ICmsConsent ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentK11.FromReader(reader, version), + { Major: 12 } => CmsConsentK12.FromReader(reader, version), + { Major: 13 } => CmsConsentK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsConsentK11(int ConsentID, string ConsentDisplayName, string ConsentName, string ConsentContent, Guid ConsentGuid, DateTime ConsentLastModified, string ConsentHash) : ICmsConsent, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentID"; + public static string TableName => "CMS_Consent"; + public static string GuidColumnName => "ConsentGuid"; + static CmsConsentK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") + ); + public static CmsConsentK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") + ); +}; +public partial record CmsConsentK12(int ConsentID, string ConsentDisplayName, string ConsentName, string ConsentContent, Guid ConsentGuid, DateTime ConsentLastModified, string ConsentHash) : ICmsConsent, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentID"; + public static string TableName => "CMS_Consent"; + public static string GuidColumnName => "ConsentGuid"; + static CmsConsentK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") + ); + public static CmsConsentK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") + ); +}; +public partial record CmsConsentK13(int ConsentID, string ConsentDisplayName, string ConsentName, string ConsentContent, Guid ConsentGuid, DateTime ConsentLastModified, string ConsentHash) : ICmsConsent, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentID"; + public static string TableName => "CMS_Consent"; + public static string GuidColumnName => "ConsentGuid"; + static CmsConsentK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") + ); + public static CmsConsentK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsConsentAgreement.cs b/KVA/Migration.Tool.Source/Model/CmsConsentAgreement.cs new file mode 100644 index 00000000..f6d522e6 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsConsentAgreement.cs @@ -0,0 +1,80 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsConsentAgreement : ISourceModel +{ + int ConsentAgreementID { get; } + Guid ConsentAgreementGuid { get; } + bool ConsentAgreementRevoked { get; } + int ConsentAgreementContactID { get; } + int ConsentAgreementConsentID { get; } + string? ConsentAgreementConsentHash { get; } + DateTime ConsentAgreementTime { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentAgreementK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsConsentAgreementK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsConsentAgreementK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentAgreementK11.IsAvailable(version), + { Major: 12 } => CmsConsentAgreementK12.IsAvailable(version), + { Major: 13 } => CmsConsentAgreementK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_ConsentAgreement"; + static string ISourceModel.GuidColumnName => "ConsentAgreementGuid"; //assumtion, class Guid column doesn't change between versions + static ICmsConsentAgreement ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentAgreementK11.FromReader(reader, version), + { Major: 12 } => CmsConsentAgreementK12.FromReader(reader, version), + { Major: 13 } => CmsConsentAgreementK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsConsentAgreementK11(int ConsentAgreementID, Guid ConsentAgreementGuid, bool ConsentAgreementRevoked, int ConsentAgreementContactID, int ConsentAgreementConsentID, string? ConsentAgreementConsentHash, DateTime ConsentAgreementTime) : ICmsConsentAgreement, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentAgreementID"; + public static string TableName => "CMS_ConsentAgreement"; + public static string GuidColumnName => "ConsentAgreementGuid"; + static CmsConsentAgreementK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") + ); + public static CmsConsentAgreementK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") + ); +}; +public partial record CmsConsentAgreementK12(int ConsentAgreementID, Guid ConsentAgreementGuid, bool ConsentAgreementRevoked, int ConsentAgreementContactID, int ConsentAgreementConsentID, string? ConsentAgreementConsentHash, DateTime ConsentAgreementTime) : ICmsConsentAgreement, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentAgreementID"; + public static string TableName => "CMS_ConsentAgreement"; + public static string GuidColumnName => "ConsentAgreementGuid"; + static CmsConsentAgreementK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") + ); + public static CmsConsentAgreementK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") + ); +}; +public partial record CmsConsentAgreementK13(int ConsentAgreementID, Guid ConsentAgreementGuid, bool ConsentAgreementRevoked, int ConsentAgreementContactID, int ConsentAgreementConsentID, string? ConsentAgreementConsentHash, DateTime ConsentAgreementTime) : ICmsConsentAgreement, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentAgreementID"; + public static string TableName => "CMS_ConsentAgreement"; + public static string GuidColumnName => "ConsentAgreementGuid"; + static CmsConsentAgreementK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") + ); + public static CmsConsentAgreementK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsConsentArchive.cs b/KVA/Migration.Tool.Source/Model/CmsConsentArchive.cs new file mode 100644 index 00000000..865bda2d --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsConsentArchive.cs @@ -0,0 +1,79 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsConsentArchive : ISourceModel +{ + int ConsentArchiveID { get; } + Guid ConsentArchiveGuid { get; } + DateTime ConsentArchiveLastModified { get; } + int ConsentArchiveConsentID { get; } + string ConsentArchiveHash { get; } + string ConsentArchiveContent { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentArchiveK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsConsentArchiveK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsConsentArchiveK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentArchiveK11.IsAvailable(version), + { Major: 12 } => CmsConsentArchiveK12.IsAvailable(version), + { Major: 13 } => CmsConsentArchiveK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_ConsentArchive"; + static string ISourceModel.GuidColumnName => "ConsentArchiveGuid"; //assumtion, class Guid column doesn't change between versions + static ICmsConsentArchive ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentArchiveK11.FromReader(reader, version), + { Major: 12 } => CmsConsentArchiveK12.FromReader(reader, version), + { Major: 13 } => CmsConsentArchiveK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsConsentArchiveK11(int ConsentArchiveID, Guid ConsentArchiveGuid, DateTime ConsentArchiveLastModified, int ConsentArchiveConsentID, string ConsentArchiveHash, string ConsentArchiveContent) : ICmsConsentArchive, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentArchiveID"; + public static string TableName => "CMS_ConsentArchive"; + public static string GuidColumnName => "ConsentArchiveGuid"; + static CmsConsentArchiveK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") + ); + public static CmsConsentArchiveK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") + ); +}; +public partial record CmsConsentArchiveK12(int ConsentArchiveID, Guid ConsentArchiveGuid, DateTime ConsentArchiveLastModified, int ConsentArchiveConsentID, string ConsentArchiveHash, string ConsentArchiveContent) : ICmsConsentArchive, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentArchiveID"; + public static string TableName => "CMS_ConsentArchive"; + public static string GuidColumnName => "ConsentArchiveGuid"; + static CmsConsentArchiveK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") + ); + public static CmsConsentArchiveK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") + ); +}; +public partial record CmsConsentArchiveK13(int ConsentArchiveID, Guid ConsentArchiveGuid, DateTime ConsentArchiveLastModified, int ConsentArchiveConsentID, string ConsentArchiveHash, string ConsentArchiveContent) : ICmsConsentArchive, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentArchiveID"; + public static string TableName => "CMS_ConsentArchive"; + public static string GuidColumnName => "ConsentArchiveGuid"; + static CmsConsentArchiveK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") + ); + public static CmsConsentArchiveK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsCountry.cs b/KVA/Migration.Tool.Source/Model/CmsCountry.cs new file mode 100644 index 00000000..8a79b17d --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsCountry.cs @@ -0,0 +1,80 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsCountry : ISourceModel +{ + int CountryID { get; } + string CountryDisplayName { get; } + string CountryName { get; } + Guid CountryGUID { get; } + DateTime CountryLastModified { get; } + string? CountryTwoLetterCode { get; } + string? CountryThreeLetterCode { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsCountryK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsCountryK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsCountryK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsCountryK11.IsAvailable(version), + { Major: 12 } => CmsCountryK12.IsAvailable(version), + { Major: 13 } => CmsCountryK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_Country"; + static string ISourceModel.GuidColumnName => "CountryGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsCountry ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsCountryK11.FromReader(reader, version), + { Major: 12 } => CmsCountryK12.FromReader(reader, version), + { Major: 13 } => CmsCountryK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsCountryK11(int CountryID, string CountryDisplayName, string CountryName, Guid CountryGUID, DateTime CountryLastModified, string? CountryTwoLetterCode, string? CountryThreeLetterCode) : ICmsCountry, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CountryID"; + public static string TableName => "CMS_Country"; + public static string GuidColumnName => "CountryGUID"; + static CmsCountryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") + ); + public static CmsCountryK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") + ); +}; +public partial record CmsCountryK12(int CountryID, string CountryDisplayName, string CountryName, Guid CountryGUID, DateTime CountryLastModified, string? CountryTwoLetterCode, string? CountryThreeLetterCode) : ICmsCountry, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CountryID"; + public static string TableName => "CMS_Country"; + public static string GuidColumnName => "CountryGUID"; + static CmsCountryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") + ); + public static CmsCountryK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") + ); +}; +public partial record CmsCountryK13(int CountryID, string CountryDisplayName, string CountryName, Guid CountryGUID, DateTime CountryLastModified, string? CountryTwoLetterCode, string? CountryThreeLetterCode) : ICmsCountry, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CountryID"; + public static string TableName => "CMS_Country"; + public static string GuidColumnName => "CountryGUID"; + static CmsCountryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") + ); + public static CmsCountryK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsCulture.cs b/KVA/Migration.Tool.Source/Model/CmsCulture.cs new file mode 100644 index 00000000..213bc5ea --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsCulture.cs @@ -0,0 +1,81 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsCulture : ISourceModel +{ + int CultureID { get; } + string CultureName { get; } + string CultureCode { get; } + string CultureShortName { get; } + Guid CultureGUID { get; } + DateTime CultureLastModified { get; } + string? CultureAlias { get; } + bool? CultureIsUICulture { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsCultureK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsCultureK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsCultureK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsCultureK11.IsAvailable(version), + { Major: 12 } => CmsCultureK12.IsAvailable(version), + { Major: 13 } => CmsCultureK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_Culture"; + static string ISourceModel.GuidColumnName => "CultureGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsCulture ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsCultureK11.FromReader(reader, version), + { Major: 12 } => CmsCultureK12.FromReader(reader, version), + { Major: 13 } => CmsCultureK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsCultureK11(int CultureID, string CultureName, string CultureCode, string CultureShortName, Guid CultureGUID, DateTime CultureLastModified, string? CultureAlias, bool? CultureIsUICulture) : ICmsCulture, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; + public static string TableName => "CMS_Culture"; + public static string GuidColumnName => "CultureGUID"; + static CmsCultureK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") + ); + public static CmsCultureK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") + ); +}; +public partial record CmsCultureK12(int CultureID, string CultureName, string CultureCode, string CultureShortName, Guid CultureGUID, DateTime CultureLastModified, string? CultureAlias, bool? CultureIsUICulture) : ICmsCulture, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; + public static string TableName => "CMS_Culture"; + public static string GuidColumnName => "CultureGUID"; + static CmsCultureK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") + ); + public static CmsCultureK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") + ); +}; +public partial record CmsCultureK13(int CultureID, string CultureName, string CultureCode, string CultureShortName, Guid CultureGUID, DateTime CultureLastModified, string? CultureAlias, bool? CultureIsUICulture) : ICmsCulture, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; + public static string TableName => "CMS_Culture"; + public static string GuidColumnName => "CultureGUID"; + static CmsCultureK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") + ); + public static CmsCultureK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsDocument.cs b/KVA/Migration.Tool.Source/Model/CmsDocument.cs new file mode 100644 index 00000000..1da4573c --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsDocument.cs @@ -0,0 +1,108 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsDocument : ISourceModel +{ + int DocumentID { get; } + string DocumentName { get; } + DateTime? DocumentModifiedWhen { get; } + int? DocumentModifiedByUserID { get; } + int? DocumentForeignKeyValue { get; } + int? DocumentCreatedByUserID { get; } + DateTime? DocumentCreatedWhen { get; } + int? DocumentCheckedOutByUserID { get; } + DateTime? DocumentCheckedOutWhen { get; } + int? DocumentCheckedOutVersionHistoryID { get; } + int? DocumentPublishedVersionHistoryID { get; } + int? DocumentWorkflowStepID { get; } + DateTime? DocumentPublishFrom { get; } + DateTime? DocumentPublishTo { get; } + string DocumentCulture { get; } + int DocumentNodeID { get; } + string? DocumentPageTitle { get; } + string? DocumentPageKeyWords { get; } + string? DocumentPageDescription { get; } + string? DocumentContent { get; } + string? DocumentCustomData { get; } + string? DocumentTags { get; } + int? DocumentTagGroupID { get; } + DateTime? DocumentLastPublished { get; } + bool? DocumentSearchExcluded { get; } + string? DocumentLastVersionNumber { get; } + bool? DocumentIsArchived { get; } + Guid? DocumentGUID { get; } + Guid? DocumentWorkflowCycleGUID { get; } + bool? DocumentIsWaitingForTranslation { get; } + string? DocumentSKUName { get; } + string? DocumentSKUDescription { get; } + string? DocumentSKUShortDescription { get; } + string? DocumentWorkflowActionStatus { get; } + bool DocumentCanBePublished { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsDocumentK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsDocumentK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsDocumentK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsDocumentK11.IsAvailable(version), + { Major: 12 } => CmsDocumentK12.IsAvailable(version), + { Major: 13 } => CmsDocumentK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_Document"; + static string ISourceModel.GuidColumnName => "DocumentGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsDocument ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsDocumentK11.FromReader(reader, version), + { Major: 12 } => CmsDocumentK12.FromReader(reader, version), + { Major: 13 } => CmsDocumentK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsDocumentK11(int DocumentID, string DocumentName, string? DocumentNamePath, DateTime? DocumentModifiedWhen, int? DocumentModifiedByUserID, int? DocumentForeignKeyValue, int? DocumentCreatedByUserID, DateTime? DocumentCreatedWhen, int? DocumentCheckedOutByUserID, DateTime? DocumentCheckedOutWhen, int? DocumentCheckedOutVersionHistoryID, int? DocumentPublishedVersionHistoryID, int? DocumentWorkflowStepID, DateTime? DocumentPublishFrom, DateTime? DocumentPublishTo, string? DocumentUrlPath, string DocumentCulture, int DocumentNodeID, string? DocumentPageTitle, string? DocumentPageKeyWords, string? DocumentPageDescription, bool DocumentShowInSiteMap, bool DocumentMenuItemHideInNavigation, string? DocumentMenuCaption, string? DocumentMenuStyle, string? DocumentMenuItemImage, string? DocumentMenuItemLeftImage, string? DocumentMenuItemRightImage, int? DocumentPageTemplateID, string? DocumentMenuJavascript, string? DocumentMenuRedirectUrl, bool? DocumentUseNamePathForUrlPath, int? DocumentStylesheetID, string? DocumentContent, string? DocumentMenuClass, string? DocumentMenuStyleHighlighted, string? DocumentMenuClassHighlighted, string? DocumentMenuItemImageHighlighted, string? DocumentMenuItemLeftImageHighlighted, string? DocumentMenuItemRightImageHighlighted, bool? DocumentMenuItemInactive, string? DocumentCustomData, string? DocumentExtensions, string? DocumentTags, int? DocumentTagGroupID, string? DocumentWildcardRule, string? DocumentWebParts, double? DocumentRatingValue, int? DocumentRatings, int? DocumentPriority, string? DocumentType, DateTime? DocumentLastPublished, bool? DocumentUseCustomExtensions, string? DocumentGroupWebParts, bool? DocumentCheckedOutAutomatically, string? DocumentTrackConversionName, string? DocumentConversionValue, bool? DocumentSearchExcluded, string? DocumentLastVersionNumber, bool? DocumentIsArchived, string? DocumentHash, bool? DocumentLogVisitActivity, Guid? DocumentGUID, Guid? DocumentWorkflowCycleGUID, string? DocumentSitemapSettings, bool? DocumentIsWaitingForTranslation, string? DocumentSKUName, string? DocumentSKUDescription, string? DocumentSKUShortDescription, string? DocumentWorkflowActionStatus, bool? DocumentMenuRedirectToFirstChild, bool DocumentCanBePublished, bool DocumentInheritsStylesheet) : ICmsDocument, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "DocumentID"; + public static string TableName => "CMS_Document"; + public static string GuidColumnName => "DocumentGUID"; + static CmsDocumentK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentInheritsStylesheet") + ); + public static CmsDocumentK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentInheritsStylesheet") + ); +}; +public partial record CmsDocumentK12(int DocumentID, string DocumentName, string? DocumentNamePath, DateTime? DocumentModifiedWhen, int? DocumentModifiedByUserID, int? DocumentForeignKeyValue, int? DocumentCreatedByUserID, DateTime? DocumentCreatedWhen, int? DocumentCheckedOutByUserID, DateTime? DocumentCheckedOutWhen, int? DocumentCheckedOutVersionHistoryID, int? DocumentPublishedVersionHistoryID, int? DocumentWorkflowStepID, DateTime? DocumentPublishFrom, DateTime? DocumentPublishTo, string? DocumentUrlPath, string DocumentCulture, int DocumentNodeID, string? DocumentPageTitle, string? DocumentPageKeyWords, string? DocumentPageDescription, bool DocumentShowInSiteMap, bool DocumentMenuItemHideInNavigation, string? DocumentMenuCaption, string? DocumentMenuStyle, string? DocumentMenuItemImage, string? DocumentMenuItemLeftImage, string? DocumentMenuItemRightImage, int? DocumentPageTemplateID, string? DocumentMenuJavascript, string? DocumentMenuRedirectUrl, bool? DocumentUseNamePathForUrlPath, int? DocumentStylesheetID, string? DocumentContent, string? DocumentMenuClass, string? DocumentMenuStyleHighlighted, string? DocumentMenuClassHighlighted, string? DocumentMenuItemImageHighlighted, string? DocumentMenuItemLeftImageHighlighted, string? DocumentMenuItemRightImageHighlighted, bool? DocumentMenuItemInactive, string? DocumentCustomData, string? DocumentExtensions, string? DocumentTags, int? DocumentTagGroupID, string? DocumentWildcardRule, string? DocumentWebParts, double? DocumentRatingValue, int? DocumentRatings, int? DocumentPriority, string? DocumentType, DateTime? DocumentLastPublished, bool? DocumentUseCustomExtensions, string? DocumentGroupWebParts, bool? DocumentCheckedOutAutomatically, string? DocumentTrackConversionName, string? DocumentConversionValue, bool? DocumentSearchExcluded, string? DocumentLastVersionNumber, bool? DocumentIsArchived, string? DocumentHash, bool? DocumentLogVisitActivity, Guid? DocumentGUID, Guid? DocumentWorkflowCycleGUID, string? DocumentSitemapSettings, bool? DocumentIsWaitingForTranslation, string? DocumentSKUName, string? DocumentSKUDescription, string? DocumentSKUShortDescription, string? DocumentWorkflowActionStatus, bool? DocumentMenuRedirectToFirstChild, bool DocumentCanBePublished, bool DocumentInheritsStylesheet, string? DocumentPageBuilderWidgets, string? DocumentPageTemplateConfiguration, string? DocumentABTestConfiguration) : ICmsDocument, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "DocumentID"; + public static string TableName => "CMS_Document"; + public static string GuidColumnName => "DocumentGUID"; + static CmsDocumentK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentInheritsStylesheet"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration") + ); + public static CmsDocumentK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentInheritsStylesheet"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration") + ); +}; +public partial record CmsDocumentK13(int DocumentID, string DocumentName, DateTime? DocumentModifiedWhen, int? DocumentModifiedByUserID, int? DocumentForeignKeyValue, int? DocumentCreatedByUserID, DateTime? DocumentCreatedWhen, int? DocumentCheckedOutByUserID, DateTime? DocumentCheckedOutWhen, int? DocumentCheckedOutVersionHistoryID, int? DocumentPublishedVersionHistoryID, int? DocumentWorkflowStepID, DateTime? DocumentPublishFrom, DateTime? DocumentPublishTo, string DocumentCulture, int DocumentNodeID, string? DocumentPageTitle, string? DocumentPageKeyWords, string? DocumentPageDescription, string? DocumentContent, string? DocumentCustomData, string? DocumentTags, int? DocumentTagGroupID, DateTime? DocumentLastPublished, bool? DocumentSearchExcluded, string? DocumentLastVersionNumber, bool? DocumentIsArchived, Guid? DocumentGUID, Guid? DocumentWorkflowCycleGUID, bool? DocumentIsWaitingForTranslation, string? DocumentSKUName, string? DocumentSKUDescription, string? DocumentSKUShortDescription, string? DocumentWorkflowActionStatus, bool DocumentCanBePublished, string? DocumentPageBuilderWidgets, string? DocumentPageTemplateConfiguration, string? DocumentABTestConfiguration, bool DocumentShowInMenu) : ICmsDocument, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "DocumentID"; + public static string TableName => "CMS_Document"; + public static string GuidColumnName => "DocumentGUID"; + static CmsDocumentK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration"), reader.Unbox("DocumentShowInMenu") + ); + public static CmsDocumentK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration"), reader.Unbox("DocumentShowInMenu") + ); +}; + diff --git a/KVA/Migration.Toolkit.Source/Model/CmsDocumentCategory.cs b/KVA/Migration.Tool.Source/Model/CmsDocumentCategory.cs similarity index 98% rename from KVA/Migration.Toolkit.Source/Model/CmsDocumentCategory.cs rename to KVA/Migration.Tool.Source/Model/CmsDocumentCategory.cs index 874637e7..0cf290d5 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsDocumentCategory.cs +++ b/KVA/Migration.Tool.Source/Model/CmsDocumentCategory.cs @@ -1,9 +1,9 @@ // ReSharper disable InconsistentNaming using System.Data; -using Migration.Toolkit.Common; +using Migration.Tool.Common; -namespace Migration.Toolkit.Source.Model; +namespace Migration.Tool.Source.Model; public partial interface ICmsDocumentCategory : ISourceModel { int DocumentID { get; } diff --git a/KVA/Migration.Tool.Source/Model/CmsForm.cs b/KVA/Migration.Tool.Source/Model/CmsForm.cs new file mode 100644 index 00000000..ee767804 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsForm.cs @@ -0,0 +1,97 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsForm : ISourceModel +{ + int FormID { get; } + string FormDisplayName { get; } + string FormName { get; } + string? FormSendToEmail { get; } + string? FormSendFromEmail { get; } + string? FormEmailSubject { get; } + string? FormEmailTemplate { get; } + bool? FormEmailAttachUploadedDocs { get; } + int FormClassID { get; } + int FormItems { get; } + string? FormReportFields { get; } + string? FormRedirectToUrl { get; } + string? FormDisplayText { get; } + bool FormClearAfterSave { get; } + string? FormSubmitButtonText { get; } + int FormSiteID { get; } + string? FormConfirmationEmailField { get; } + string? FormConfirmationTemplate { get; } + string? FormConfirmationSendFromEmail { get; } + string? FormConfirmationEmailSubject { get; } + int? FormAccess { get; } + string? FormSubmitButtonImage { get; } + Guid FormGUID { get; } + DateTime FormLastModified { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsFormK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsFormK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsFormK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsFormK11.IsAvailable(version), + { Major: 12 } => CmsFormK12.IsAvailable(version), + { Major: 13 } => CmsFormK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_Form"; + static string ISourceModel.GuidColumnName => "FormGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsForm ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsFormK11.FromReader(reader, version), + { Major: 12 } => CmsFormK12.FromReader(reader, version), + { Major: 13 } => CmsFormK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsFormK11(int FormID, string FormDisplayName, string FormName, string? FormSendToEmail, string? FormSendFromEmail, string? FormEmailSubject, string? FormEmailTemplate, bool? FormEmailAttachUploadedDocs, int FormClassID, int FormItems, string? FormReportFields, string? FormRedirectToUrl, string? FormDisplayText, bool FormClearAfterSave, string? FormSubmitButtonText, int FormSiteID, string? FormConfirmationEmailField, string? FormConfirmationTemplate, string? FormConfirmationSendFromEmail, string? FormConfirmationEmailSubject, int? FormAccess, string? FormSubmitButtonImage, Guid FormGUID, DateTime FormLastModified, bool? FormLogActivity) : ICmsForm, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; + public static string TableName => "CMS_Form"; + public static string GuidColumnName => "FormGUID"; + static CmsFormK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity") + ); + public static CmsFormK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity") + ); +}; +public partial record CmsFormK12(int FormID, string FormDisplayName, string FormName, string? FormSendToEmail, string? FormSendFromEmail, string? FormEmailSubject, string? FormEmailTemplate, bool? FormEmailAttachUploadedDocs, int FormClassID, int FormItems, string? FormReportFields, string? FormRedirectToUrl, string? FormDisplayText, bool FormClearAfterSave, string? FormSubmitButtonText, int FormSiteID, string? FormConfirmationEmailField, string? FormConfirmationTemplate, string? FormConfirmationSendFromEmail, string? FormConfirmationEmailSubject, int? FormAccess, string? FormSubmitButtonImage, Guid FormGUID, DateTime FormLastModified, bool? FormLogActivity, int FormDevelopmentModel, string? FormBuilderLayout) : ICmsForm, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; + public static string TableName => "CMS_Form"; + public static string GuidColumnName => "FormGUID"; + static CmsFormK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormDevelopmentModel"), reader.Unbox("FormBuilderLayout") + ); + public static CmsFormK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormDevelopmentModel"), reader.Unbox("FormBuilderLayout") + ); +}; +public partial record CmsFormK13(int FormID, string FormDisplayName, string FormName, string? FormSendToEmail, string? FormSendFromEmail, string? FormEmailSubject, string? FormEmailTemplate, bool? FormEmailAttachUploadedDocs, int FormClassID, int FormItems, string? FormReportFields, string? FormRedirectToUrl, string? FormDisplayText, bool FormClearAfterSave, string? FormSubmitButtonText, int FormSiteID, string? FormConfirmationEmailField, string? FormConfirmationTemplate, string? FormConfirmationSendFromEmail, string? FormConfirmationEmailSubject, int? FormAccess, string? FormSubmitButtonImage, Guid FormGUID, DateTime FormLastModified, bool FormLogActivity, string? FormBuilderLayout) : ICmsForm, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; + public static string TableName => "CMS_Form"; + public static string GuidColumnName => "FormGUID"; + static CmsFormK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormBuilderLayout") + ); + public static CmsFormK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormBuilderLayout") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsFormUserControl.cs b/KVA/Migration.Tool.Source/Model/CmsFormUserControl.cs new file mode 100644 index 00000000..4b8b728a --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsFormUserControl.cs @@ -0,0 +1,103 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsFormUserControl : ISourceModel +{ + int UserControlID { get; } + string UserControlDisplayName { get; } + string UserControlCodeName { get; } + string UserControlFileName { get; } + bool UserControlForText { get; } + bool UserControlForLongText { get; } + bool UserControlForInteger { get; } + bool UserControlForDecimal { get; } + bool UserControlForDateTime { get; } + bool UserControlForBoolean { get; } + bool UserControlForFile { get; } + bool? UserControlShowInDocumentTypes { get; } + bool? UserControlShowInSystemTables { get; } + bool? UserControlShowInWebParts { get; } + bool? UserControlShowInReports { get; } + Guid UserControlGUID { get; } + DateTime UserControlLastModified { get; } + bool UserControlForGuid { get; } + bool? UserControlShowInCustomTables { get; } + string? UserControlParameters { get; } + bool UserControlForDocAttachments { get; } + int? UserControlResourceID { get; } + int? UserControlParentID { get; } + string? UserControlDescription { get; } + int? UserControlPriority { get; } + bool? UserControlIsSystem { get; } + bool UserControlForBinary { get; } + bool UserControlForDocRelationships { get; } + string? UserControlAssemblyName { get; } + string? UserControlClassName { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsFormUserControlK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsFormUserControlK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsFormUserControlK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsFormUserControlK11.IsAvailable(version), + { Major: 12 } => CmsFormUserControlK12.IsAvailable(version), + { Major: 13 } => CmsFormUserControlK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_FormUserControl"; + static string ISourceModel.GuidColumnName => "UserControlGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsFormUserControl ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsFormUserControlK11.FromReader(reader, version), + { Major: 12 } => CmsFormUserControlK12.FromReader(reader, version), + { Major: 13 } => CmsFormUserControlK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsFormUserControlK11(int UserControlID, string UserControlDisplayName, string UserControlCodeName, string UserControlFileName, bool UserControlForText, bool UserControlForLongText, bool UserControlForInteger, bool UserControlForDecimal, bool UserControlForDateTime, bool UserControlForBoolean, bool UserControlForFile, bool UserControlShowInBizForms, string UserControlDefaultDataType, int? UserControlDefaultDataTypeSize, bool? UserControlShowInDocumentTypes, bool? UserControlShowInSystemTables, bool? UserControlShowInWebParts, bool? UserControlShowInReports, Guid UserControlGUID, DateTime UserControlLastModified, bool UserControlForGuid, bool? UserControlShowInCustomTables, bool UserControlForVisibility, string? UserControlParameters, bool UserControlForDocAttachments, int? UserControlResourceID, int? UserControlType, int? UserControlParentID, string? UserControlDescription, Guid? UserControlThumbnailGUID, int? UserControlPriority, bool? UserControlIsSystem, bool UserControlForBinary, bool UserControlForDocRelationships, string? UserControlAssemblyName, string? UserControlClassName) : ICmsFormUserControl, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserControlID"; + public static string TableName => "CMS_FormUserControl"; + public static string GuidColumnName => "UserControlGUID"; + static CmsFormUserControlK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") + ); + public static CmsFormUserControlK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") + ); +}; +public partial record CmsFormUserControlK12(int UserControlID, string UserControlDisplayName, string UserControlCodeName, string UserControlFileName, bool UserControlForText, bool UserControlForLongText, bool UserControlForInteger, bool UserControlForDecimal, bool UserControlForDateTime, bool UserControlForBoolean, bool UserControlForFile, bool UserControlShowInBizForms, string UserControlDefaultDataType, int? UserControlDefaultDataTypeSize, bool? UserControlShowInDocumentTypes, bool? UserControlShowInSystemTables, bool? UserControlShowInWebParts, bool? UserControlShowInReports, Guid UserControlGUID, DateTime UserControlLastModified, bool UserControlForGuid, bool? UserControlShowInCustomTables, bool UserControlForVisibility, string? UserControlParameters, bool UserControlForDocAttachments, int? UserControlResourceID, int? UserControlType, int? UserControlParentID, string? UserControlDescription, Guid? UserControlThumbnailGUID, int? UserControlPriority, bool? UserControlIsSystem, bool UserControlForBinary, bool UserControlForDocRelationships, string? UserControlAssemblyName, string? UserControlClassName) : ICmsFormUserControl, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserControlID"; + public static string TableName => "CMS_FormUserControl"; + public static string GuidColumnName => "UserControlGUID"; + static CmsFormUserControlK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") + ); + public static CmsFormUserControlK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") + ); +}; +public partial record CmsFormUserControlK13(int UserControlID, string UserControlDisplayName, string UserControlCodeName, string UserControlFileName, bool UserControlForText, bool UserControlForLongText, bool UserControlForInteger, bool UserControlForDecimal, bool UserControlForDateTime, bool UserControlForBoolean, bool UserControlForFile, bool? UserControlShowInDocumentTypes, bool? UserControlShowInSystemTables, bool? UserControlShowInWebParts, bool? UserControlShowInReports, Guid UserControlGUID, DateTime UserControlLastModified, bool UserControlForGuid, bool? UserControlShowInCustomTables, string? UserControlParameters, bool UserControlForDocAttachments, int? UserControlResourceID, int? UserControlParentID, string? UserControlDescription, int? UserControlPriority, bool? UserControlIsSystem, bool UserControlForBinary, bool UserControlForDocRelationships, string? UserControlAssemblyName, string? UserControlClassName) : ICmsFormUserControl, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserControlID"; + public static string TableName => "CMS_FormUserControl"; + public static string GuidColumnName => "UserControlGUID"; + static CmsFormUserControlK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") + ); + public static CmsFormUserControlK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsPageFormerUrlPath.cs b/KVA/Migration.Tool.Source/Model/CmsPageFormerUrlPath.cs new file mode 100644 index 00000000..ac30b31c --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsPageFormerUrlPath.cs @@ -0,0 +1,74 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsPageFormerUrlPath : ISourceModel +{ + + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageFormerUrlPathK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsPageFormerUrlPathK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsPageFormerUrlPathK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageFormerUrlPathK11.IsAvailable(version), + { Major: 12 } => CmsPageFormerUrlPathK12.IsAvailable(version), + { Major: 13 } => CmsPageFormerUrlPathK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_PageFormerUrlPath"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + static ICmsPageFormerUrlPath ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageFormerUrlPathK11.FromReader(reader, version), + { Major: 12 } => CmsPageFormerUrlPathK12.FromReader(reader, version), + { Major: 13 } => CmsPageFormerUrlPathK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsPageFormerUrlPathK11() : ICmsPageFormerUrlPath, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => false; + public static string GetPrimaryKeyName(SemanticVersion version) => ""; + public static string TableName => "CMS_PageFormerUrlPath"; + public static string GuidColumnName => ""; + static CmsPageFormerUrlPathK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + + ); + public static CmsPageFormerUrlPathK11 FromReader(IDataReader reader, SemanticVersion version) => new( + + ); +}; +public partial record CmsPageFormerUrlPathK12() : ICmsPageFormerUrlPath, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => false; + public static string GetPrimaryKeyName(SemanticVersion version) => ""; + public static string TableName => "CMS_PageFormerUrlPath"; + public static string GuidColumnName => ""; + static CmsPageFormerUrlPathK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + + ); + public static CmsPageFormerUrlPathK12 FromReader(IDataReader reader, SemanticVersion version) => new( + + ); +}; +public partial record CmsPageFormerUrlPathK13(int PageFormerUrlPathID, string PageFormerUrlPathUrlPath, string PageFormerUrlPathUrlPathHash, string PageFormerUrlPathCulture, int PageFormerUrlPathNodeID, int PageFormerUrlPathSiteID, DateTime PageFormerUrlPathLastModified) : ICmsPageFormerUrlPath, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "PageFormerUrlPathID"; + public static string TableName => "CMS_PageFormerUrlPath"; + public static string GuidColumnName => ""; + static CmsPageFormerUrlPathK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageFormerUrlPathID"), reader.Unbox("PageFormerUrlPathUrlPath"), reader.Unbox("PageFormerUrlPathUrlPathHash"), reader.Unbox("PageFormerUrlPathCulture"), reader.Unbox("PageFormerUrlPathNodeID"), reader.Unbox("PageFormerUrlPathSiteID"), reader.Unbox("PageFormerUrlPathLastModified") + ); + public static CmsPageFormerUrlPathK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageFormerUrlPathID"), reader.Unbox("PageFormerUrlPathUrlPath"), reader.Unbox("PageFormerUrlPathUrlPathHash"), reader.Unbox("PageFormerUrlPathCulture"), reader.Unbox("PageFormerUrlPathNodeID"), reader.Unbox("PageFormerUrlPathSiteID"), reader.Unbox("PageFormerUrlPathLastModified") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsPageTemplateConfiguration.cs b/KVA/Migration.Tool.Source/Model/CmsPageTemplateConfiguration.cs new file mode 100644 index 00000000..21a634b3 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsPageTemplateConfiguration.cs @@ -0,0 +1,74 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsPageTemplateConfiguration : ISourceModel +{ + + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageTemplateConfigurationK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsPageTemplateConfigurationK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsPageTemplateConfigurationK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageTemplateConfigurationK11.IsAvailable(version), + { Major: 12 } => CmsPageTemplateConfigurationK12.IsAvailable(version), + { Major: 13 } => CmsPageTemplateConfigurationK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_PageTemplateConfiguration"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + static ICmsPageTemplateConfiguration ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageTemplateConfigurationK11.FromReader(reader, version), + { Major: 12 } => CmsPageTemplateConfigurationK12.FromReader(reader, version), + { Major: 13 } => CmsPageTemplateConfigurationK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsPageTemplateConfigurationK11() : ICmsPageTemplateConfiguration, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => false; + public static string GetPrimaryKeyName(SemanticVersion version) => ""; + public static string TableName => "CMS_PageTemplateConfiguration"; + public static string GuidColumnName => ""; + static CmsPageTemplateConfigurationK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + + ); + public static CmsPageTemplateConfigurationK11 FromReader(IDataReader reader, SemanticVersion version) => new( + + ); +}; +public partial record CmsPageTemplateConfigurationK12(int PageTemplateConfigurationID, Guid PageTemplateConfigurationGUID, int PageTemplateConfigurationSiteID, DateTime PageTemplateConfigurationLastModified, string PageTemplateConfigurationName, string? PageTemplateConfigurationDescription, Guid? PageTemplateConfigurationThumbnailGUID, string PageTemplateConfigurationTemplate, string? PageTemplateConfigurationWidgets) : ICmsPageTemplateConfiguration, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "PageTemplateConfigurationID"; + public static string TableName => "CMS_PageTemplateConfiguration"; + public static string GuidColumnName => "PageTemplateConfigurationGUID"; + static CmsPageTemplateConfigurationK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), reader.Unbox("PageTemplateConfigurationWidgets") + ); + public static CmsPageTemplateConfigurationK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), reader.Unbox("PageTemplateConfigurationWidgets") + ); +}; +public partial record CmsPageTemplateConfigurationK13(int PageTemplateConfigurationID, Guid PageTemplateConfigurationGUID, int PageTemplateConfigurationSiteID, DateTime PageTemplateConfigurationLastModified, string PageTemplateConfigurationName, string? PageTemplateConfigurationDescription, Guid? PageTemplateConfigurationThumbnailGUID, string PageTemplateConfigurationTemplate, string? PageTemplateConfigurationWidgets) : ICmsPageTemplateConfiguration, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "PageTemplateConfigurationID"; + public static string TableName => "CMS_PageTemplateConfiguration"; + public static string GuidColumnName => "PageTemplateConfigurationGUID"; + static CmsPageTemplateConfigurationK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), reader.Unbox("PageTemplateConfigurationWidgets") + ); + public static CmsPageTemplateConfigurationK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), reader.Unbox("PageTemplateConfigurationWidgets") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsPageUrlPath.cs b/KVA/Migration.Tool.Source/Model/CmsPageUrlPath.cs new file mode 100644 index 00000000..62d0c171 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsPageUrlPath.cs @@ -0,0 +1,74 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsPageUrlPath : ISourceModel +{ + + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageUrlPathK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsPageUrlPathK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsPageUrlPathK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageUrlPathK11.IsAvailable(version), + { Major: 12 } => CmsPageUrlPathK12.IsAvailable(version), + { Major: 13 } => CmsPageUrlPathK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_PageUrlPath"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + static ICmsPageUrlPath ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageUrlPathK11.FromReader(reader, version), + { Major: 12 } => CmsPageUrlPathK12.FromReader(reader, version), + { Major: 13 } => CmsPageUrlPathK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsPageUrlPathK11() : ICmsPageUrlPath, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => false; + public static string GetPrimaryKeyName(SemanticVersion version) => ""; + public static string TableName => "CMS_PageUrlPath"; + public static string GuidColumnName => ""; + static CmsPageUrlPathK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + + ); + public static CmsPageUrlPathK11 FromReader(IDataReader reader, SemanticVersion version) => new( + + ); +}; +public partial record CmsPageUrlPathK12() : ICmsPageUrlPath, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => false; + public static string GetPrimaryKeyName(SemanticVersion version) => ""; + public static string TableName => "CMS_PageUrlPath"; + public static string GuidColumnName => ""; + static CmsPageUrlPathK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + + ); + public static CmsPageUrlPathK12 FromReader(IDataReader reader, SemanticVersion version) => new( + + ); +}; +public partial record CmsPageUrlPathK13(int PageUrlPathID, Guid PageUrlPathGUID, string PageUrlPathCulture, int PageUrlPathNodeID, string PageUrlPathUrlPath, string PageUrlPathUrlPathHash, int PageUrlPathSiteID, DateTime PageUrlPathLastModified) : ICmsPageUrlPath, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "PageUrlPathID"; + public static string TableName => "CMS_PageUrlPath"; + public static string GuidColumnName => "PageUrlPathGUID"; + static CmsPageUrlPathK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageUrlPathID"), reader.Unbox("PageUrlPathGUID"), reader.Unbox("PageUrlPathCulture"), reader.Unbox("PageUrlPathNodeID"), reader.Unbox("PageUrlPathUrlPath"), reader.Unbox("PageUrlPathUrlPathHash"), reader.Unbox("PageUrlPathSiteID"), reader.Unbox("PageUrlPathLastModified") + ); + public static CmsPageUrlPathK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageUrlPathID"), reader.Unbox("PageUrlPathGUID"), reader.Unbox("PageUrlPathCulture"), reader.Unbox("PageUrlPathNodeID"), reader.Unbox("PageUrlPathUrlPath"), reader.Unbox("PageUrlPathUrlPathHash"), reader.Unbox("PageUrlPathSiteID"), reader.Unbox("PageUrlPathLastModified") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsRelationship.cs b/KVA/Migration.Tool.Source/Model/CmsRelationship.cs new file mode 100644 index 00000000..7b81198e --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsRelationship.cs @@ -0,0 +1,80 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsRelationship : ISourceModel +{ + int RelationshipID { get; } + int LeftNodeID { get; } + int RightNodeID { get; } + int RelationshipNameID { get; } + string? RelationshipCustomData { get; } + int? RelationshipOrder { get; } + bool? RelationshipIsAdHoc { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsRelationshipK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsRelationshipK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsRelationshipK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsRelationshipK11.IsAvailable(version), + { Major: 12 } => CmsRelationshipK12.IsAvailable(version), + { Major: 13 } => CmsRelationshipK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_Relationship"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + static ICmsRelationship ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsRelationshipK11.FromReader(reader, version), + { Major: 12 } => CmsRelationshipK12.FromReader(reader, version), + { Major: 13 } => CmsRelationshipK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsRelationshipK11(int RelationshipID, int LeftNodeID, int RightNodeID, int RelationshipNameID, string? RelationshipCustomData, int? RelationshipOrder, bool? RelationshipIsAdHoc) : ICmsRelationship, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "RelationshipID"; + public static string TableName => "CMS_Relationship"; + public static string GuidColumnName => ""; + static CmsRelationshipK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") + ); + public static CmsRelationshipK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") + ); +}; +public partial record CmsRelationshipK12(int RelationshipID, int LeftNodeID, int RightNodeID, int RelationshipNameID, string? RelationshipCustomData, int? RelationshipOrder, bool? RelationshipIsAdHoc) : ICmsRelationship, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "RelationshipID"; + public static string TableName => "CMS_Relationship"; + public static string GuidColumnName => ""; + static CmsRelationshipK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") + ); + public static CmsRelationshipK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") + ); +}; +public partial record CmsRelationshipK13(int RelationshipID, int LeftNodeID, int RightNodeID, int RelationshipNameID, string? RelationshipCustomData, int? RelationshipOrder, bool? RelationshipIsAdHoc) : ICmsRelationship, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "RelationshipID"; + public static string TableName => "CMS_Relationship"; + public static string GuidColumnName => ""; + static CmsRelationshipK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") + ); + public static CmsRelationshipK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsResource.cs b/KVA/Migration.Tool.Source/Model/CmsResource.cs new file mode 100644 index 00000000..2733d74b --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsResource.cs @@ -0,0 +1,87 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsResource : ISourceModel +{ + int ResourceID { get; } + string ResourceDisplayName { get; } + string ResourceName { get; } + string? ResourceDescription { get; } + bool? ShowInDevelopment { get; } + string? ResourceURL { get; } + Guid ResourceGUID { get; } + DateTime ResourceLastModified { get; } + bool? ResourceIsInDevelopment { get; } + bool? ResourceHasFiles { get; } + string? ResourceVersion { get; } + string? ResourceAuthor { get; } + string? ResourceInstallationState { get; } + string? ResourceInstalledVersion { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsResourceK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsResourceK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsResourceK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsResourceK11.IsAvailable(version), + { Major: 12 } => CmsResourceK12.IsAvailable(version), + { Major: 13 } => CmsResourceK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_Resource"; + static string ISourceModel.GuidColumnName => "ResourceGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsResource ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsResourceK11.FromReader(reader, version), + { Major: 12 } => CmsResourceK12.FromReader(reader, version), + { Major: 13 } => CmsResourceK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsResourceK11(int ResourceID, string ResourceDisplayName, string ResourceName, string? ResourceDescription, bool? ShowInDevelopment, string? ResourceURL, Guid ResourceGUID, DateTime ResourceLastModified, bool? ResourceIsInDevelopment, bool? ResourceHasFiles, string? ResourceVersion, string? ResourceAuthor, string? ResourceInstallationState, string? ResourceInstalledVersion) : ICmsResource, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ResourceID"; + public static string TableName => "CMS_Resource"; + public static string GuidColumnName => "ResourceGUID"; + static CmsResourceK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") + ); + public static CmsResourceK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") + ); +}; +public partial record CmsResourceK12(int ResourceID, string ResourceDisplayName, string ResourceName, string? ResourceDescription, bool? ShowInDevelopment, string? ResourceURL, Guid ResourceGUID, DateTime ResourceLastModified, bool? ResourceIsInDevelopment, bool? ResourceHasFiles, string? ResourceVersion, string? ResourceAuthor, string? ResourceInstallationState, string? ResourceInstalledVersion) : ICmsResource, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ResourceID"; + public static string TableName => "CMS_Resource"; + public static string GuidColumnName => "ResourceGUID"; + static CmsResourceK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") + ); + public static CmsResourceK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") + ); +}; +public partial record CmsResourceK13(int ResourceID, string ResourceDisplayName, string ResourceName, string? ResourceDescription, bool? ShowInDevelopment, string? ResourceURL, Guid ResourceGUID, DateTime ResourceLastModified, bool? ResourceIsInDevelopment, bool? ResourceHasFiles, string? ResourceVersion, string? ResourceAuthor, string? ResourceInstallationState, string? ResourceInstalledVersion) : ICmsResource, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ResourceID"; + public static string TableName => "CMS_Resource"; + public static string GuidColumnName => "ResourceGUID"; + static CmsResourceK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") + ); + public static CmsResourceK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsRole.cs b/KVA/Migration.Tool.Source/Model/CmsRole.cs new file mode 100644 index 00000000..f7722cd8 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsRole.cs @@ -0,0 +1,81 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsRole : ISourceModel +{ + int RoleID { get; } + string RoleDisplayName { get; } + string RoleName { get; } + string? RoleDescription { get; } + int? SiteID { get; } + Guid RoleGUID { get; } + DateTime RoleLastModified { get; } + bool? RoleIsDomain { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsRoleK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsRoleK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsRoleK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsRoleK11.IsAvailable(version), + { Major: 12 } => CmsRoleK12.IsAvailable(version), + { Major: 13 } => CmsRoleK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_Role"; + static string ISourceModel.GuidColumnName => "RoleGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsRole ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsRoleK11.FromReader(reader, version), + { Major: 12 } => CmsRoleK12.FromReader(reader, version), + { Major: 13 } => CmsRoleK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsRoleK11(int RoleID, string RoleDisplayName, string RoleName, string? RoleDescription, int? SiteID, Guid RoleGUID, DateTime RoleLastModified, int? RoleGroupID, bool? RoleIsGroupAdministrator, bool? RoleIsDomain) : ICmsRole, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "RoleID"; + public static string TableName => "CMS_Role"; + public static string GuidColumnName => "RoleGUID"; + static CmsRoleK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") + ); + public static CmsRoleK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") + ); +}; +public partial record CmsRoleK12(int RoleID, string RoleDisplayName, string RoleName, string? RoleDescription, int? SiteID, Guid RoleGUID, DateTime RoleLastModified, int? RoleGroupID, bool? RoleIsGroupAdministrator, bool? RoleIsDomain) : ICmsRole, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "RoleID"; + public static string TableName => "CMS_Role"; + public static string GuidColumnName => "RoleGUID"; + static CmsRoleK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") + ); + public static CmsRoleK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") + ); +}; +public partial record CmsRoleK13(int RoleID, string RoleDisplayName, string RoleName, string? RoleDescription, int? SiteID, Guid RoleGUID, DateTime RoleLastModified, bool? RoleIsDomain) : ICmsRole, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "RoleID"; + public static string TableName => "CMS_Role"; + public static string GuidColumnName => "RoleGUID"; + static CmsRoleK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleIsDomain") + ); + public static CmsRoleK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleIsDomain") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsSettingsKey.cs b/KVA/Migration.Tool.Source/Model/CmsSettingsKey.cs new file mode 100644 index 00000000..614c1ede --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsSettingsKey.cs @@ -0,0 +1,92 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsSettingsKey : ISourceModel +{ + int KeyID { get; } + string KeyName { get; } + string KeyDisplayName { get; } + string? KeyDescription { get; } + string? KeyValue { get; } + string KeyType { get; } + int? KeyCategoryID { get; } + int? SiteID { get; } + Guid KeyGUID { get; } + DateTime KeyLastModified { get; } + int? KeyOrder { get; } + string? KeyDefaultValue { get; } + string? KeyValidation { get; } + string? KeyEditingControlPath { get; } + bool? KeyIsGlobal { get; } + bool? KeyIsCustom { get; } + bool? KeyIsHidden { get; } + string? KeyFormControlSettings { get; } + string? KeyExplanationText { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsSettingsKeyK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsSettingsKeyK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsSettingsKeyK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsSettingsKeyK11.IsAvailable(version), + { Major: 12 } => CmsSettingsKeyK12.IsAvailable(version), + { Major: 13 } => CmsSettingsKeyK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_SettingsKey"; + static string ISourceModel.GuidColumnName => "KeyGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsSettingsKey ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsSettingsKeyK11.FromReader(reader, version), + { Major: 12 } => CmsSettingsKeyK12.FromReader(reader, version), + { Major: 13 } => CmsSettingsKeyK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsSettingsKeyK11(int KeyID, string KeyName, string KeyDisplayName, string? KeyDescription, string? KeyValue, string KeyType, int? KeyCategoryID, int? SiteID, Guid KeyGUID, DateTime KeyLastModified, int? KeyOrder, string? KeyDefaultValue, string? KeyValidation, string? KeyEditingControlPath, bool? KeyIsGlobal, bool? KeyIsCustom, bool? KeyIsHidden, string? KeyFormControlSettings, string? KeyExplanationText) : ICmsSettingsKey, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "KeyID"; + public static string TableName => "CMS_SettingsKey"; + public static string GuidColumnName => "KeyGUID"; + static CmsSettingsKeyK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") + ); + public static CmsSettingsKeyK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") + ); +}; +public partial record CmsSettingsKeyK12(int KeyID, string KeyName, string KeyDisplayName, string? KeyDescription, string? KeyValue, string KeyType, int? KeyCategoryID, int? SiteID, Guid KeyGUID, DateTime KeyLastModified, int? KeyOrder, string? KeyDefaultValue, string? KeyValidation, string? KeyEditingControlPath, bool? KeyIsGlobal, bool? KeyIsCustom, bool? KeyIsHidden, string? KeyFormControlSettings, string? KeyExplanationText) : ICmsSettingsKey, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "KeyID"; + public static string TableName => "CMS_SettingsKey"; + public static string GuidColumnName => "KeyGUID"; + static CmsSettingsKeyK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") + ); + public static CmsSettingsKeyK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") + ); +}; +public partial record CmsSettingsKeyK13(int KeyID, string KeyName, string KeyDisplayName, string? KeyDescription, string? KeyValue, string KeyType, int? KeyCategoryID, int? SiteID, Guid KeyGUID, DateTime KeyLastModified, int? KeyOrder, string? KeyDefaultValue, string? KeyValidation, string? KeyEditingControlPath, bool? KeyIsGlobal, bool? KeyIsCustom, bool? KeyIsHidden, string? KeyFormControlSettings, string? KeyExplanationText) : ICmsSettingsKey, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "KeyID"; + public static string TableName => "CMS_SettingsKey"; + public static string GuidColumnName => "KeyGUID"; + static CmsSettingsKeyK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") + ); + public static CmsSettingsKeyK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsSite.cs b/KVA/Migration.Tool.Source/Model/CmsSite.cs new file mode 100644 index 00000000..53ea2306 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsSite.cs @@ -0,0 +1,82 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsSite : ISourceModel +{ + int SiteID { get; } + string SiteName { get; } + string SiteDisplayName { get; } + string? SiteDescription { get; } + string SiteStatus { get; } + string SiteDomainName { get; } + string? SiteDefaultVisitorCulture { get; } + Guid SiteGUID { get; } + DateTime SiteLastModified { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsSiteK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsSiteK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsSiteK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsSiteK11.IsAvailable(version), + { Major: 12 } => CmsSiteK12.IsAvailable(version), + { Major: 13 } => CmsSiteK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_Site"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + static ICmsSite ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsSiteK11.FromReader(reader, version), + { Major: 12 } => CmsSiteK12.FromReader(reader, version), + { Major: 13 } => CmsSiteK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsSiteK11(int SiteID, string SiteName, string SiteDisplayName, string? SiteDescription, string SiteStatus, string SiteDomainName, int? SiteDefaultStylesheetID, string? SiteDefaultVisitorCulture, int? SiteDefaultEditorStylesheet, Guid SiteGUID, DateTime SiteLastModified, bool? SiteIsOffline, string? SiteOfflineRedirectURL, string? SiteOfflineMessage, string? SitePresentationURL, bool? SiteIsContentOnly) : ICmsSite, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "SiteID"; + public static string TableName => "CMS_Site"; + public static string GuidColumnName => ""; + static CmsSiteK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") + ); + public static CmsSiteK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") + ); +}; +public partial record CmsSiteK12(int SiteID, string SiteName, string SiteDisplayName, string? SiteDescription, string SiteStatus, string SiteDomainName, int? SiteDefaultStylesheetID, string? SiteDefaultVisitorCulture, int? SiteDefaultEditorStylesheet, Guid SiteGUID, DateTime SiteLastModified, bool? SiteIsOffline, string? SiteOfflineRedirectURL, string? SiteOfflineMessage, string? SitePresentationURL, bool? SiteIsContentOnly) : ICmsSite, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "SiteID"; + public static string TableName => "CMS_Site"; + public static string GuidColumnName => ""; + static CmsSiteK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") + ); + public static CmsSiteK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") + ); +}; +public partial record CmsSiteK13(int SiteID, string SiteName, string SiteDisplayName, string? SiteDescription, string SiteStatus, string SiteDomainName, string? SiteDefaultVisitorCulture, Guid SiteGUID, DateTime SiteLastModified, string SitePresentationURL) : ICmsSite, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "SiteID"; + public static string TableName => "CMS_Site"; + public static string GuidColumnName => ""; + static CmsSiteK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SitePresentationURL") + ); + public static CmsSiteK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SitePresentationURL") + ); +}; + diff --git a/KVA/Migration.Toolkit.Source/Model/CmsSiteCulture.cs b/KVA/Migration.Tool.Source/Model/CmsSiteCulture.cs similarity index 98% rename from KVA/Migration.Toolkit.Source/Model/CmsSiteCulture.cs rename to KVA/Migration.Tool.Source/Model/CmsSiteCulture.cs index ae95a31f..05ef17c5 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsSiteCulture.cs +++ b/KVA/Migration.Tool.Source/Model/CmsSiteCulture.cs @@ -1,9 +1,9 @@ // ReSharper disable InconsistentNaming using System.Data; -using Migration.Toolkit.Common; +using Migration.Tool.Common; -namespace Migration.Toolkit.Source.Model; +namespace Migration.Tool.Source.Model; public partial interface ICmsSiteCulture : ISourceModel { int SiteID { get; } diff --git a/KVA/Migration.Tool.Source/Model/CmsState.cs b/KVA/Migration.Tool.Source/Model/CmsState.cs new file mode 100644 index 00000000..93c37013 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsState.cs @@ -0,0 +1,80 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsState : ISourceModel +{ + int StateID { get; } + string StateDisplayName { get; } + string StateName { get; } + string? StateCode { get; } + int CountryID { get; } + Guid StateGUID { get; } + DateTime StateLastModified { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsStateK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsStateK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsStateK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsStateK11.IsAvailable(version), + { Major: 12 } => CmsStateK12.IsAvailable(version), + { Major: 13 } => CmsStateK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_State"; + static string ISourceModel.GuidColumnName => "StateGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsState ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsStateK11.FromReader(reader, version), + { Major: 12 } => CmsStateK12.FromReader(reader, version), + { Major: 13 } => CmsStateK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsStateK11(int StateID, string StateDisplayName, string StateName, string? StateCode, int CountryID, Guid StateGUID, DateTime StateLastModified) : ICmsState, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "StateID"; + public static string TableName => "CMS_State"; + public static string GuidColumnName => "StateGUID"; + static CmsStateK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") + ); + public static CmsStateK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") + ); +}; +public partial record CmsStateK12(int StateID, string StateDisplayName, string StateName, string? StateCode, int CountryID, Guid StateGUID, DateTime StateLastModified) : ICmsState, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "StateID"; + public static string TableName => "CMS_State"; + public static string GuidColumnName => "StateGUID"; + static CmsStateK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") + ); + public static CmsStateK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") + ); +}; +public partial record CmsStateK13(int StateID, string StateDisplayName, string StateName, string? StateCode, int CountryID, Guid StateGUID, DateTime StateLastModified) : ICmsState, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "StateID"; + public static string TableName => "CMS_State"; + public static string GuidColumnName => "StateGUID"; + static CmsStateK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") + ); + public static CmsStateK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsTree.cs b/KVA/Migration.Tool.Source/Model/CmsTree.cs new file mode 100644 index 00000000..dce2e1a4 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsTree.cs @@ -0,0 +1,94 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsTree : ISourceModel +{ + int NodeID { get; } + string NodeAliasPath { get; } + string NodeName { get; } + string NodeAlias { get; } + int NodeClassID { get; } + int? NodeParentID { get; } + int NodeLevel { get; } + int? NodeACLID { get; } + int NodeSiteID { get; } + Guid NodeGUID { get; } + int? NodeOrder { get; } + bool? IsSecuredNode { get; } + int? NodeSKUID { get; } + int? NodeLinkedNodeID { get; } + int? NodeOwner { get; } + string? NodeCustomData { get; } + int? NodeLinkedNodeSiteID { get; } + bool? NodeHasChildren { get; } + bool? NodeHasLinks { get; } + int? NodeOriginalNodeID { get; } + bool NodeIsACLOwner { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsTreeK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsTreeK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsTreeK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsTreeK11.IsAvailable(version), + { Major: 12 } => CmsTreeK12.IsAvailable(version), + { Major: 13 } => CmsTreeK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_Tree"; + static string ISourceModel.GuidColumnName => "NodeGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsTree ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsTreeK11.FromReader(reader, version), + { Major: 12 } => CmsTreeK12.FromReader(reader, version), + { Major: 13 } => CmsTreeK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsTreeK11(int NodeID, string NodeAliasPath, string NodeName, string NodeAlias, int NodeClassID, int? NodeParentID, int NodeLevel, int? NodeACLID, int NodeSiteID, Guid NodeGUID, int? NodeOrder, bool? IsSecuredNode, int? NodeCacheMinutes, int? NodeSKUID, string? NodeDocType, string? NodeHeadTags, string? NodeBodyElementAttributes, string? NodeInheritPageLevels, int? RequiresSSL, int? NodeLinkedNodeID, int? NodeOwner, string? NodeCustomData, int? NodeGroupID, int? NodeLinkedNodeSiteID, int? NodeTemplateID, bool? NodeTemplateForAllCultures, bool? NodeInheritPageTemplate, bool? NodeAllowCacheInFileSystem, bool? NodeHasChildren, bool? NodeHasLinks, int? NodeOriginalNodeID, bool NodeIsContentOnly, bool NodeIsACLOwner, string? NodeBodyScripts) : ICmsTree, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "NodeID"; + public static string TableName => "CMS_Tree"; + public static string GuidColumnName => "NodeGUID"; + static CmsTreeK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") + ); + public static CmsTreeK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") + ); +}; +public partial record CmsTreeK12(int NodeID, string NodeAliasPath, string NodeName, string NodeAlias, int NodeClassID, int? NodeParentID, int NodeLevel, int? NodeACLID, int NodeSiteID, Guid NodeGUID, int? NodeOrder, bool? IsSecuredNode, int? NodeCacheMinutes, int? NodeSKUID, string? NodeDocType, string? NodeHeadTags, string? NodeBodyElementAttributes, string? NodeInheritPageLevels, int? RequiresSSL, int? NodeLinkedNodeID, int? NodeOwner, string? NodeCustomData, int? NodeGroupID, int? NodeLinkedNodeSiteID, int? NodeTemplateID, bool? NodeTemplateForAllCultures, bool? NodeInheritPageTemplate, bool? NodeAllowCacheInFileSystem, bool? NodeHasChildren, bool? NodeHasLinks, int? NodeOriginalNodeID, bool NodeIsContentOnly, bool NodeIsACLOwner, string? NodeBodyScripts) : ICmsTree, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "NodeID"; + public static string TableName => "CMS_Tree"; + public static string GuidColumnName => "NodeGUID"; + static CmsTreeK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") + ); + public static CmsTreeK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") + ); +}; +public partial record CmsTreeK13(int NodeID, string NodeAliasPath, string NodeName, string NodeAlias, int NodeClassID, int? NodeParentID, int NodeLevel, int? NodeACLID, int NodeSiteID, Guid NodeGUID, int? NodeOrder, bool? IsSecuredNode, int? NodeSKUID, int? NodeLinkedNodeID, int? NodeOwner, string? NodeCustomData, int? NodeLinkedNodeSiteID, bool? NodeHasChildren, bool? NodeHasLinks, int? NodeOriginalNodeID, bool NodeIsACLOwner) : ICmsTree, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "NodeID"; + public static string TableName => "CMS_Tree"; + public static string GuidColumnName => "NodeGUID"; + static CmsTreeK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsACLOwner") + ); + public static CmsTreeK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsACLOwner") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsUser.cs b/KVA/Migration.Tool.Source/Model/CmsUser.cs new file mode 100644 index 00000000..df5f2cd6 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsUser.cs @@ -0,0 +1,99 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsUser : ISourceModel +{ + int UserID { get; } + string UserName { get; } + string? FirstName { get; } + string? MiddleName { get; } + string? LastName { get; } + string? FullName { get; } + string? Email { get; } + string UserPassword { get; } + string? PreferredCultureCode { get; } + string? PreferredUICultureCode { get; } + bool UserEnabled { get; } + bool? UserIsExternal { get; } + string? UserPasswordFormat { get; } + DateTime? UserCreated { get; } + DateTime? LastLogon { get; } + string? UserStartingAliasPath { get; } + Guid UserGUID { get; } + DateTime UserLastModified { get; } + string? UserLastLogonInfo { get; } + bool? UserIsHidden { get; } + bool? UserIsDomain { get; } + bool? UserHasAllowedCultures { get; } + bool? UserMFRequired { get; } + int UserPrivilegeLevel { get; } + string? UserSecurityStamp { get; } + byte[]? UserMFSecret { get; } + long? UserMFTimestep { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsUserK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsUserK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsUserK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsUserK11.IsAvailable(version), + { Major: 12 } => CmsUserK12.IsAvailable(version), + { Major: 13 } => CmsUserK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_User"; + static string ISourceModel.GuidColumnName => "UserGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsUser ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsUserK11.FromReader(reader, version), + { Major: 12 } => CmsUserK12.FromReader(reader, version), + { Major: 13 } => CmsUserK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsUserK11(int UserID, string UserName, string? FirstName, string? MiddleName, string? LastName, string? FullName, string? Email, string UserPassword, string? PreferredCultureCode, string? PreferredUICultureCode, bool UserEnabled, bool? UserIsExternal, string? UserPasswordFormat, DateTime? UserCreated, DateTime? LastLogon, string? UserStartingAliasPath, Guid UserGUID, DateTime UserLastModified, string? UserLastLogonInfo, bool? UserIsHidden, string? UserVisibility, bool? UserIsDomain, bool? UserHasAllowedCultures, bool? UserMFRequired, int UserPrivilegeLevel, string? UserSecurityStamp, byte[]? UserMFSecret, long? UserMFTimestep, string? CUSTOM_1) : ICmsUser, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserID"; + public static string TableName => "CMS_User"; + public static string GuidColumnName => "UserGUID"; + static CmsUserK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep"), reader.Unbox("CUSTOM_1") + ); + public static CmsUserK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep"), reader.Unbox("CUSTOM_1") + ); +}; +public partial record CmsUserK12(int UserID, string UserName, string? FirstName, string? MiddleName, string? LastName, string? FullName, string? Email, string UserPassword, string? PreferredCultureCode, string? PreferredUICultureCode, bool UserEnabled, bool? UserIsExternal, string? UserPasswordFormat, DateTime? UserCreated, DateTime? LastLogon, string? UserStartingAliasPath, Guid UserGUID, DateTime UserLastModified, string? UserLastLogonInfo, bool? UserIsHidden, string? UserVisibility, bool? UserIsDomain, bool? UserHasAllowedCultures, bool? UserMFRequired, int UserPrivilegeLevel, string? UserSecurityStamp, byte[]? UserMFSecret, long? UserMFTimestep) : ICmsUser, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserID"; + public static string TableName => "CMS_User"; + public static string GuidColumnName => "UserGUID"; + static CmsUserK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") + ); + public static CmsUserK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") + ); +}; +public partial record CmsUserK13(int UserID, string UserName, string? FirstName, string? MiddleName, string? LastName, string? FullName, string? Email, string UserPassword, string? PreferredCultureCode, string? PreferredUICultureCode, bool UserEnabled, bool? UserIsExternal, string? UserPasswordFormat, DateTime? UserCreated, DateTime? LastLogon, string? UserStartingAliasPath, Guid UserGUID, DateTime UserLastModified, string? UserLastLogonInfo, bool? UserIsHidden, bool? UserIsDomain, bool? UserHasAllowedCultures, bool? UserMFRequired, int UserPrivilegeLevel, string? UserSecurityStamp, byte[]? UserMFSecret, long? UserMFTimestep) : ICmsUser, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserID"; + public static string TableName => "CMS_User"; + public static string GuidColumnName => "UserGUID"; + static CmsUserK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep")); + public static CmsUserK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsUserSetting.cs b/KVA/Migration.Tool.Source/Model/CmsUserSetting.cs new file mode 100644 index 00000000..f8fcb842 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsUserSetting.cs @@ -0,0 +1,105 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsUserSetting : ISourceModel +{ + int UserSettingsID { get; } + string? UserNickName { get; } + string? UserSignature { get; } + string? UserURLReferrer { get; } + string? UserCampaign { get; } + string? UserCustomData { get; } + string? UserRegistrationInfo { get; } + DateTime? UserActivationDate { get; } + int? UserActivatedByUserID { get; } + int? UserTimeZoneID { get; } + int? UserAvatarID { get; } + int? UserGender { get; } + DateTime? UserDateOfBirth { get; } + Guid UserSettingsUserGUID { get; } + int UserSettingsUserID { get; } + bool? UserWaitingForApproval { get; } + string? UserDialogsConfiguration { get; } + string? UserDescription { get; } + Guid? UserAuthenticationGUID { get; } + string? UserSkype { get; } + string? UserIM { get; } + string? UserPhone { get; } + string? UserPosition { get; } + bool? UserLogActivities { get; } + string? UserPasswordRequestHash { get; } + int? UserInvalidLogOnAttempts { get; } + string? UserInvalidLogOnAttemptsHash { get; } + int? UserAccountLockReason { get; } + DateTime? UserPasswordLastChanged { get; } + bool? UserShowIntroductionTile { get; } + string? UserDashboardApplications { get; } + string? UserDismissedSmartTips { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsUserSettingK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsUserSettingK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsUserSettingK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsUserSettingK11.IsAvailable(version), + { Major: 12 } => CmsUserSettingK12.IsAvailable(version), + { Major: 13 } => CmsUserSettingK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_UserSettings"; + static string ISourceModel.GuidColumnName => "UserSettingsUserGUID"; //assumtion, class Guid column doesn't change between versions + static ICmsUserSetting ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsUserSettingK11.FromReader(reader, version), + { Major: 12 } => CmsUserSettingK12.FromReader(reader, version), + { Major: 13 } => CmsUserSettingK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsUserSettingK11(int UserSettingsID, string? UserNickName, string? UserPicture, string? UserSignature, string? UserURLReferrer, string? UserCampaign, string? UserMessagingNotificationEmail, string? UserCustomData, string? UserRegistrationInfo, string? UserPreferences, DateTime? UserActivationDate, int? UserActivatedByUserID, int? UserTimeZoneID, int? UserAvatarID, int? UserBadgeID, int? UserActivityPoints, int? UserForumPosts, int? UserBlogComments, int? UserGender, DateTime? UserDateOfBirth, int? UserMessageBoardPosts, Guid UserSettingsUserGUID, int UserSettingsUserID, string? WindowsLiveID, int? UserBlogPosts, bool? UserWaitingForApproval, string? UserDialogsConfiguration, string? UserDescription, string? UserUsedWebParts, string? UserUsedWidgets, string? UserFacebookID, Guid? UserAuthenticationGUID, string? UserSkype, string? UserIM, string? UserPhone, string? UserPosition, string? UserLinkedInID, bool? UserLogActivities, string? UserPasswordRequestHash, int? UserInvalidLogOnAttempts, string? UserInvalidLogOnAttemptsHash, string? UserAvatarType, int? UserAccountLockReason, DateTime? UserPasswordLastChanged, bool? UserShowIntroductionTile, string? UserDashboardApplications, string? UserDismissedSmartTips, string? CUSTOM_2) : ICmsUserSetting, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserSettingsID"; + public static string TableName => "CMS_UserSettings"; + public static string GuidColumnName => "UserSettingsUserGUID"; + static CmsUserSettingK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserMessagingNotificationEmail"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips"), reader.Unbox("CUSTOM_2") + ); + public static CmsUserSettingK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserMessagingNotificationEmail"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips"), reader.Unbox("CUSTOM_2") + ); +}; +public partial record CmsUserSettingK12(int UserSettingsID, string? UserNickName, string? UserPicture, string? UserSignature, string? UserURLReferrer, string? UserCampaign, string? UserCustomData, string? UserRegistrationInfo, string? UserPreferences, DateTime? UserActivationDate, int? UserActivatedByUserID, int? UserTimeZoneID, int? UserAvatarID, int? UserBadgeID, int? UserActivityPoints, int? UserForumPosts, int? UserBlogComments, int? UserGender, DateTime? UserDateOfBirth, int? UserMessageBoardPosts, Guid UserSettingsUserGUID, int UserSettingsUserID, string? WindowsLiveID, int? UserBlogPosts, bool? UserWaitingForApproval, string? UserDialogsConfiguration, string? UserDescription, string? UserUsedWebParts, string? UserUsedWidgets, string? UserFacebookID, Guid? UserAuthenticationGUID, string? UserSkype, string? UserIM, string? UserPhone, string? UserPosition, string? UserLinkedInID, bool? UserLogActivities, string? UserPasswordRequestHash, int? UserInvalidLogOnAttempts, string? UserInvalidLogOnAttemptsHash, string? UserAvatarType, int? UserAccountLockReason, DateTime? UserPasswordLastChanged, bool? UserShowIntroductionTile, string? UserDashboardApplications, string? UserDismissedSmartTips) : ICmsUserSetting, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserSettingsID"; + public static string TableName => "CMS_UserSettings"; + public static string GuidColumnName => "UserSettingsUserGUID"; + static CmsUserSettingK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips") + ); + public static CmsUserSettingK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips") + ); +}; +public partial record CmsUserSettingK13(int UserSettingsID, string? UserNickName, string? UserSignature, string? UserURLReferrer, string? UserCampaign, string? UserCustomData, string? UserRegistrationInfo, DateTime? UserActivationDate, int? UserActivatedByUserID, int? UserTimeZoneID, int? UserAvatarID, int? UserGender, DateTime? UserDateOfBirth, Guid UserSettingsUserGUID, int UserSettingsUserID, bool? UserWaitingForApproval, string? UserDialogsConfiguration, string? UserDescription, Guid? UserAuthenticationGUID, string? UserSkype, string? UserIM, string? UserPhone, string? UserPosition, bool? UserLogActivities, string? UserPasswordRequestHash, int? UserInvalidLogOnAttempts, string? UserInvalidLogOnAttemptsHash, int? UserAccountLockReason, DateTime? UserPasswordLastChanged, bool? UserShowIntroductionTile, string? UserDashboardApplications, string? UserDismissedSmartTips, string? SuperSettingsCustomizedKey) : ICmsUserSetting, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserSettingsID"; + public static string TableName => "CMS_UserSettings"; + public static string GuidColumnName => "UserSettingsUserGUID"; + static CmsUserSettingK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips"), reader.Unbox("SuperSettingsCustomizedKey") + ); + public static CmsUserSettingK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips"), reader.Unbox("SuperSettingsCustomizedKey") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/CmsVersionHistory.cs b/KVA/Migration.Tool.Source/Model/CmsVersionHistory.cs new file mode 100644 index 00000000..2e0efe10 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/CmsVersionHistory.cs @@ -0,0 +1,93 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface ICmsVersionHistory : ISourceModel +{ + int VersionHistoryID { get; } + int NodeSiteID { get; } + int? DocumentID { get; } + string NodeXML { get; } + int? ModifiedByUserID { get; } + DateTime ModifiedWhen { get; } + string? VersionNumber { get; } + string? VersionComment { get; } + bool ToBePublished { get; } + DateTime? PublishFrom { get; } + DateTime? PublishTo { get; } + DateTime? WasPublishedFrom { get; } + DateTime? WasPublishedTo { get; } + string? VersionDocumentName { get; } + int? VersionClassID { get; } + int? VersionWorkflowID { get; } + int? VersionWorkflowStepID { get; } + string? VersionNodeAliasPath { get; } + int? VersionDeletedByUserID { get; } + DateTime? VersionDeletedWhen { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsVersionHistoryK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsVersionHistoryK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsVersionHistoryK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsVersionHistoryK11.IsAvailable(version), + { Major: 12 } => CmsVersionHistoryK12.IsAvailable(version), + { Major: 13 } => CmsVersionHistoryK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "CMS_VersionHistory"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + static ICmsVersionHistory ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsVersionHistoryK11.FromReader(reader, version), + { Major: 12 } => CmsVersionHistoryK12.FromReader(reader, version), + { Major: 13 } => CmsVersionHistoryK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record CmsVersionHistoryK11(int VersionHistoryID, int NodeSiteID, int? DocumentID, string DocumentNamePath, string NodeXML, int? ModifiedByUserID, DateTime ModifiedWhen, string? VersionNumber, string? VersionComment, bool ToBePublished, DateTime? PublishFrom, DateTime? PublishTo, DateTime? WasPublishedFrom, DateTime? WasPublishedTo, string? VersionDocumentName, string? VersionDocumentType, int? VersionClassID, string? VersionMenuRedirectUrl, int? VersionWorkflowID, int? VersionWorkflowStepID, string? VersionNodeAliasPath, int? VersionDeletedByUserID, DateTime? VersionDeletedWhen) : ICmsVersionHistory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "VersionHistoryID"; + public static string TableName => "CMS_VersionHistory"; + public static string GuidColumnName => ""; + static CmsVersionHistoryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") + ); + public static CmsVersionHistoryK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") + ); +}; +public partial record CmsVersionHistoryK12(int VersionHistoryID, int NodeSiteID, int? DocumentID, string DocumentNamePath, string NodeXML, int? ModifiedByUserID, DateTime ModifiedWhen, string? VersionNumber, string? VersionComment, bool ToBePublished, DateTime? PublishFrom, DateTime? PublishTo, DateTime? WasPublishedFrom, DateTime? WasPublishedTo, string? VersionDocumentName, string? VersionDocumentType, int? VersionClassID, string? VersionMenuRedirectUrl, int? VersionWorkflowID, int? VersionWorkflowStepID, string? VersionNodeAliasPath, int? VersionDeletedByUserID, DateTime? VersionDeletedWhen) : ICmsVersionHistory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "VersionHistoryID"; + public static string TableName => "CMS_VersionHistory"; + public static string GuidColumnName => ""; + static CmsVersionHistoryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") + ); + public static CmsVersionHistoryK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") + ); +}; +public partial record CmsVersionHistoryK13(int VersionHistoryID, int NodeSiteID, int? DocumentID, string NodeXML, int? ModifiedByUserID, DateTime ModifiedWhen, string? VersionNumber, string? VersionComment, bool ToBePublished, DateTime? PublishFrom, DateTime? PublishTo, DateTime? WasPublishedFrom, DateTime? WasPublishedTo, string? VersionDocumentName, int? VersionClassID, int? VersionWorkflowID, int? VersionWorkflowStepID, string? VersionNodeAliasPath, int? VersionDeletedByUserID, DateTime? VersionDeletedWhen) : ICmsVersionHistory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "VersionHistoryID"; + public static string TableName => "CMS_VersionHistory"; + public static string GuidColumnName => ""; + static CmsVersionHistoryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionClassID"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") + ); + public static CmsVersionHistoryK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionClassID"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/MediaFile.cs b/KVA/Migration.Tool.Source/Model/MediaFile.cs new file mode 100644 index 00000000..90006275 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/MediaFile.cs @@ -0,0 +1,91 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface IMediaFile : ISourceModel +{ + int FileID { get; } + string FileName { get; } + string FileTitle { get; } + string FileDescription { get; } + string FileExtension { get; } + string FileMimeType { get; } + string FilePath { get; } + long FileSize { get; } + int? FileImageWidth { get; } + int? FileImageHeight { get; } + Guid FileGUID { get; } + int FileLibraryID { get; } + int FileSiteID { get; } + int? FileCreatedByUserID { get; } + DateTime FileCreatedWhen { get; } + int? FileModifiedByUserID { get; } + DateTime FileModifiedWhen { get; } + string? FileCustomData { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => MediaFileK11.GetPrimaryKeyName(version), + { Major: 12 } => MediaFileK12.GetPrimaryKeyName(version), + { Major: 13 } => MediaFileK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => MediaFileK11.IsAvailable(version), + { Major: 12 } => MediaFileK12.IsAvailable(version), + { Major: 13 } => MediaFileK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "Media_File"; + static string ISourceModel.GuidColumnName => "FileGUID"; //assumtion, class Guid column doesn't change between versions + static IMediaFile ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => MediaFileK11.FromReader(reader, version), + { Major: 12 } => MediaFileK12.FromReader(reader, version), + { Major: 13 } => MediaFileK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record MediaFileK11(int FileID, string FileName, string FileTitle, string FileDescription, string FileExtension, string FileMimeType, string FilePath, long FileSize, int? FileImageWidth, int? FileImageHeight, Guid FileGUID, int FileLibraryID, int FileSiteID, int? FileCreatedByUserID, DateTime FileCreatedWhen, int? FileModifiedByUserID, DateTime FileModifiedWhen, string? FileCustomData) : IMediaFile, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FileID"; + public static string TableName => "Media_File"; + public static string GuidColumnName => "FileGUID"; + static MediaFileK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), reader.Unbox("FileCustomData") + ); + public static MediaFileK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), reader.Unbox("FileCustomData") + ); +}; +public partial record MediaFileK12(int FileID, string FileName, string FileTitle, string FileDescription, string FileExtension, string FileMimeType, string FilePath, long FileSize, int? FileImageWidth, int? FileImageHeight, Guid FileGUID, int FileLibraryID, int FileSiteID, int? FileCreatedByUserID, DateTime FileCreatedWhen, int? FileModifiedByUserID, DateTime FileModifiedWhen, string? FileCustomData) : IMediaFile, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FileID"; + public static string TableName => "Media_File"; + public static string GuidColumnName => "FileGUID"; + static MediaFileK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), reader.Unbox("FileCustomData") + ); + public static MediaFileK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), reader.Unbox("FileCustomData") + ); +}; +public partial record MediaFileK13(int FileID, string FileName, string FileTitle, string FileDescription, string FileExtension, string FileMimeType, string FilePath, long FileSize, int? FileImageWidth, int? FileImageHeight, Guid FileGUID, int FileLibraryID, int FileSiteID, int? FileCreatedByUserID, DateTime FileCreatedWhen, int? FileModifiedByUserID, DateTime FileModifiedWhen, string? FileCustomData) : IMediaFile, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FileID"; + public static string TableName => "Media_File"; + public static string GuidColumnName => "FileGUID"; + static MediaFileK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), reader.Unbox("FileCustomData") + ); + public static MediaFileK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), reader.Unbox("FileCustomData") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/MediaLibrary.cs b/KVA/Migration.Tool.Source/Model/MediaLibrary.cs new file mode 100644 index 00000000..648ee861 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/MediaLibrary.cs @@ -0,0 +1,84 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface IMediaLibrary : ISourceModel +{ + int LibraryID { get; } + string LibraryName { get; } + string LibraryDisplayName { get; } + string? LibraryDescription { get; } + string LibraryFolder { get; } + int? LibraryAccess { get; } + int LibrarySiteID { get; } + Guid? LibraryGUID { get; } + DateTime? LibraryLastModified { get; } + string? LibraryTeaserPath { get; } + Guid? LibraryTeaserGUID { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => MediaLibraryK11.GetPrimaryKeyName(version), + { Major: 12 } => MediaLibraryK12.GetPrimaryKeyName(version), + { Major: 13 } => MediaLibraryK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => MediaLibraryK11.IsAvailable(version), + { Major: 12 } => MediaLibraryK12.IsAvailable(version), + { Major: 13 } => MediaLibraryK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "Media_Library"; + static string ISourceModel.GuidColumnName => "LibraryGUID"; //assumtion, class Guid column doesn't change between versions + static IMediaLibrary ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => MediaLibraryK11.FromReader(reader, version), + { Major: 12 } => MediaLibraryK12.FromReader(reader, version), + { Major: 13 } => MediaLibraryK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record MediaLibraryK11(int LibraryID, string LibraryName, string LibraryDisplayName, string? LibraryDescription, string LibraryFolder, int? LibraryAccess, int? LibraryGroupID, int LibrarySiteID, Guid? LibraryGUID, DateTime? LibraryLastModified, string? LibraryTeaserPath, Guid? LibraryTeaserGUID) : IMediaLibrary, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "LibraryID"; + public static string TableName => "Media_Library"; + public static string GuidColumnName => "LibraryTeaserGUID"; + static MediaLibraryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), reader.Unbox("LibraryGroupID"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID") + ); + public static MediaLibraryK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), reader.Unbox("LibraryGroupID"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID") + ); +}; +public partial record MediaLibraryK12(int LibraryID, string LibraryName, string LibraryDisplayName, string? LibraryDescription, string LibraryFolder, int? LibraryAccess, int? LibraryGroupID, int LibrarySiteID, Guid? LibraryGUID, DateTime? LibraryLastModified, string? LibraryTeaserPath, Guid? LibraryTeaserGUID) : IMediaLibrary, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "LibraryID"; + public static string TableName => "Media_Library"; + public static string GuidColumnName => "LibraryTeaserGUID"; + static MediaLibraryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), reader.Unbox("LibraryGroupID"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID") + ); + public static MediaLibraryK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), reader.Unbox("LibraryGroupID"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID") + ); +}; +public partial record MediaLibraryK13(int LibraryID, string LibraryName, string LibraryDisplayName, string? LibraryDescription, string LibraryFolder, int? LibraryAccess, int LibrarySiteID, Guid? LibraryGUID, DateTime? LibraryLastModified, string? LibraryTeaserPath, Guid? LibraryTeaserGUID, bool? LibraryUseDirectPathForContent) : IMediaLibrary, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "LibraryID"; + public static string TableName => "Media_Library"; + public static string GuidColumnName => "LibraryTeaserGUID"; + static MediaLibraryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID"), reader.Unbox("LibraryUseDirectPathForContent") + ); + public static MediaLibraryK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID"), reader.Unbox("LibraryUseDirectPathForContent") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/OmActivity.cs b/KVA/Migration.Tool.Source/Model/OmActivity.cs new file mode 100644 index 00000000..3a8b2c64 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/OmActivity.cs @@ -0,0 +1,92 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface IOmActivity : ISourceModel +{ + int ActivityID { get; } + int ActivityContactID { get; } + DateTime? ActivityCreated { get; } + string ActivityType { get; } + int? ActivityItemID { get; } + int? ActivityItemDetailID { get; } + string? ActivityValue { get; } + string? ActivityURL { get; } + string? ActivityTitle { get; } + int ActivitySiteID { get; } + string? ActivityComment { get; } + string? ActivityCampaign { get; } + string? ActivityURLReferrer { get; } + string? ActivityCulture { get; } + int? ActivityNodeID { get; } + string? ActivityUTMSource { get; } + string? ActivityABVariantName { get; } + long ActivityURLHash { get; } + string? ActivityUTMContent { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => OmActivityK11.GetPrimaryKeyName(version), + { Major: 12 } => OmActivityK12.GetPrimaryKeyName(version), + { Major: 13 } => OmActivityK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => OmActivityK11.IsAvailable(version), + { Major: 12 } => OmActivityK12.IsAvailable(version), + { Major: 13 } => OmActivityK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "OM_Activity"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + static IOmActivity ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => OmActivityK11.FromReader(reader, version), + { Major: 12 } => OmActivityK12.FromReader(reader, version), + { Major: 13 } => OmActivityK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record OmActivityK11(int ActivityID, int ActivityContactID, DateTime? ActivityCreated, string ActivityType, int? ActivityItemID, int? ActivityItemDetailID, string? ActivityValue, string? ActivityURL, string? ActivityTitle, int ActivitySiteID, string? ActivityComment, string? ActivityCampaign, string? ActivityURLReferrer, string? ActivityCulture, int? ActivityNodeID, string? ActivityUTMSource, string? ActivityABVariantName, string? ActivityMVTCombinationName, long ActivityURLHash, string? ActivityUTMContent) : IOmActivity, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ActivityID"; + public static string TableName => "OM_Activity"; + public static string GuidColumnName => ""; + static OmActivityK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") + ); + public static OmActivityK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") + ); +}; +public partial record OmActivityK12(int ActivityID, int ActivityContactID, DateTime? ActivityCreated, string ActivityType, int? ActivityItemID, int? ActivityItemDetailID, string? ActivityValue, string? ActivityURL, string? ActivityTitle, int ActivitySiteID, string? ActivityComment, string? ActivityCampaign, string? ActivityURLReferrer, string? ActivityCulture, int? ActivityNodeID, string? ActivityUTMSource, string? ActivityABVariantName, string? ActivityMVTCombinationName, long ActivityURLHash, string? ActivityUTMContent) : IOmActivity, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ActivityID"; + public static string TableName => "OM_Activity"; + public static string GuidColumnName => ""; + static OmActivityK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") + ); + public static OmActivityK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") + ); +}; +public partial record OmActivityK13(int ActivityID, int ActivityContactID, DateTime? ActivityCreated, string ActivityType, int? ActivityItemID, int? ActivityItemDetailID, string? ActivityValue, string? ActivityURL, string? ActivityTitle, int ActivitySiteID, string? ActivityComment, string? ActivityCampaign, string? ActivityURLReferrer, string? ActivityCulture, int? ActivityNodeID, string? ActivityUTMSource, string? ActivityABVariantName, long ActivityURLHash, string? ActivityUTMContent) : IOmActivity, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ActivityID"; + public static string TableName => "OM_Activity"; + public static string GuidColumnName => ""; + static OmActivityK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") + ); + public static OmActivityK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/OmContact.cs b/KVA/Migration.Tool.Source/Model/OmContact.cs new file mode 100644 index 00000000..11e7cb51 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/OmContact.cs @@ -0,0 +1,104 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface IOmContact : ISourceModel +{ + int ContactID { get; } + string? ContactFirstName { get; } + string? ContactMiddleName { get; } + string? ContactLastName { get; } + string? ContactJobTitle { get; } + string? ContactAddress1 { get; } + string? ContactCity { get; } + string? ContactZIP { get; } + int? ContactStateID { get; } + int? ContactCountryID { get; } + string? ContactMobilePhone { get; } + string? ContactBusinessPhone { get; } + string? ContactEmail { get; } + DateTime? ContactBirthday { get; } + int? ContactGender { get; } + int? ContactStatusID { get; } + string? ContactNotes { get; } + int? ContactOwnerUserID { get; } + bool? ContactMonitored { get; } + Guid ContactGUID { get; } + DateTime ContactLastModified { get; } + DateTime ContactCreated { get; } + int? ContactBounces { get; } + string? ContactCampaign { get; } + string? ContactSalesForceLeadID { get; } + bool? ContactSalesForceLeadReplicationDisabled { get; } + DateTime? ContactSalesForceLeadReplicationDateTime { get; } + DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; } + string? ContactCompanyName { get; } + bool? ContactSalesForceLeadReplicationRequired { get; } + int? ContactPersonaID { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => OmContactK11.GetPrimaryKeyName(version), + { Major: 12 } => OmContactK12.GetPrimaryKeyName(version), + { Major: 13 } => OmContactK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => OmContactK11.IsAvailable(version), + { Major: 12 } => OmContactK12.IsAvailable(version), + { Major: 13 } => OmContactK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "OM_Contact"; + static string ISourceModel.GuidColumnName => "ContactGUID"; //assumtion, class Guid column doesn't change between versions + static IOmContact ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => OmContactK11.FromReader(reader, version), + { Major: 12 } => OmContactK12.FromReader(reader, version), + { Major: 13 } => OmContactK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record OmContactK11(int ContactID, string? ContactFirstName, string? ContactMiddleName, string? ContactLastName, string? ContactJobTitle, string? ContactAddress1, string? ContactCity, string? ContactZIP, int? ContactStateID, int? ContactCountryID, string? ContactMobilePhone, string? ContactBusinessPhone, string? ContactEmail, DateTime? ContactBirthday, int? ContactGender, int? ContactStatusID, string? ContactNotes, int? ContactOwnerUserID, bool? ContactMonitored, Guid ContactGUID, DateTime ContactLastModified, DateTime ContactCreated, int? ContactBounces, string? ContactCampaign, string? ContactSalesForceLeadID, bool? ContactSalesForceLeadReplicationDisabled, DateTime? ContactSalesForceLeadReplicationDateTime, DateTime? ContactSalesForceLeadReplicationSuspensionDateTime, string? ContactCompanyName, bool? ContactSalesForceLeadReplicationRequired, int? ContactPersonaID) : IOmContact, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ContactID"; + public static string TableName => "OM_Contact"; + public static string GuidColumnName => "ContactGUID"; + static OmContactK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") + ); + public static OmContactK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") + ); +}; +public partial record OmContactK12(int ContactID, string? ContactFirstName, string? ContactMiddleName, string? ContactLastName, string? ContactJobTitle, string? ContactAddress1, string? ContactCity, string? ContactZIP, int? ContactStateID, int? ContactCountryID, string? ContactMobilePhone, string? ContactBusinessPhone, string? ContactEmail, DateTime? ContactBirthday, int? ContactGender, int? ContactStatusID, string? ContactNotes, int? ContactOwnerUserID, bool? ContactMonitored, Guid ContactGUID, DateTime ContactLastModified, DateTime ContactCreated, int? ContactBounces, string? ContactCampaign, string? ContactSalesForceLeadID, bool? ContactSalesForceLeadReplicationDisabled, DateTime? ContactSalesForceLeadReplicationDateTime, DateTime? ContactSalesForceLeadReplicationSuspensionDateTime, string? ContactCompanyName, bool? ContactSalesForceLeadReplicationRequired, int? ContactPersonaID, string? FirstUserAgent, string? FirstIPAddress, string? FirstRequestUrl, string? KenticoUrlReferrer, string? KenticoContactRegionName, string? KenticoContactRegionCode, string? KenticoContactPostalCode, string? KenticoContactCampaignSource, string? KenticoContactCampaignContent, bool? NeedRecalculation, int? ProfileScore, int? EngagementScore, int? TotalScore, int? Zone, Guid? DynamicsLeadGuid, Guid? DynamicsContactGuid, string? DynamicsAccountType, string? DynamicsAccountStatus, bool? LegitimateInterest, string? DynamicsActivePartnerships, DateTime? DynamicsDateOfSync, bool? PairedWithDynamicsCrm, DateTime? FirstPairDate, int? PairedBy, bool? IsArchived, DateTime? ArchivationDate, bool? HasFreeEmail, int? SameDomainContacts, string? AreYouLookingForCMS, string? Role, string? KenticoContactBusinessType, string? MarketingAutomationVariant, string? KontentIntercomUserID, string? KontentGoogleAnalyticsUserID, string? KontentAmplitudeUserID) : IOmContact, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ContactID"; + public static string TableName => "OM_Contact"; + public static string GuidColumnName => "ContactGUID"; + static OmContactK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID"), reader.Unbox("FirstUserAgent"), reader.Unbox("FirstIPAddress"), reader.Unbox("FirstRequestUrl"), reader.Unbox("KenticoUrlReferrer"), reader.Unbox("KenticoContactRegionName"), reader.Unbox("KenticoContactRegionCode"), reader.Unbox("KenticoContactPostalCode"), reader.Unbox("KenticoContactCampaignSource"), reader.Unbox("KenticoContactCampaignContent"), reader.Unbox("NeedRecalculation"), reader.Unbox("ProfileScore"), reader.Unbox("EngagementScore"), reader.Unbox("TotalScore"), reader.Unbox("Zone"), reader.Unbox("DynamicsLeadGuid"), reader.Unbox("DynamicsContactGuid"), reader.Unbox("DynamicsAccountType"), reader.Unbox("DynamicsAccountStatus"), reader.Unbox("LegitimateInterest"), reader.Unbox("DynamicsActivePartnerships"), reader.Unbox("DynamicsDateOfSync"), reader.Unbox("PairedWithDynamicsCrm"), reader.Unbox("FirstPairDate"), reader.Unbox("PairedBy"), reader.Unbox("IsArchived"), reader.Unbox("ArchivationDate"), reader.Unbox("HasFreeEmail"), reader.Unbox("SameDomainContacts"), reader.Unbox("AreYouLookingForCMS"), reader.Unbox("Role"), reader.Unbox("KenticoContactBusinessType"), reader.Unbox("MarketingAutomationVariant"), reader.Unbox("KontentIntercomUserID"), reader.Unbox("KontentGoogleAnalyticsUserID"), reader.Unbox("KontentAmplitudeUserID") + ); + public static OmContactK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID"), reader.Unbox("FirstUserAgent"), reader.Unbox("FirstIPAddress"), reader.Unbox("FirstRequestUrl"), reader.Unbox("KenticoUrlReferrer"), reader.Unbox("KenticoContactRegionName"), reader.Unbox("KenticoContactRegionCode"), reader.Unbox("KenticoContactPostalCode"), reader.Unbox("KenticoContactCampaignSource"), reader.Unbox("KenticoContactCampaignContent"), reader.Unbox("NeedRecalculation"), reader.Unbox("ProfileScore"), reader.Unbox("EngagementScore"), reader.Unbox("TotalScore"), reader.Unbox("Zone"), reader.Unbox("DynamicsLeadGuid"), reader.Unbox("DynamicsContactGuid"), reader.Unbox("DynamicsAccountType"), reader.Unbox("DynamicsAccountStatus"), reader.Unbox("LegitimateInterest"), reader.Unbox("DynamicsActivePartnerships"), reader.Unbox("DynamicsDateOfSync"), reader.Unbox("PairedWithDynamicsCrm"), reader.Unbox("FirstPairDate"), reader.Unbox("PairedBy"), reader.Unbox("IsArchived"), reader.Unbox("ArchivationDate"), reader.Unbox("HasFreeEmail"), reader.Unbox("SameDomainContacts"), reader.Unbox("AreYouLookingForCMS"), reader.Unbox("Role"), reader.Unbox("KenticoContactBusinessType"), reader.Unbox("MarketingAutomationVariant"), reader.Unbox("KontentIntercomUserID"), reader.Unbox("KontentGoogleAnalyticsUserID"), reader.Unbox("KontentAmplitudeUserID") + ); +}; +public partial record OmContactK13(int ContactID, string? ContactFirstName, string? ContactMiddleName, string? ContactLastName, string? ContactJobTitle, string? ContactAddress1, string? ContactCity, string? ContactZIP, int? ContactStateID, int? ContactCountryID, string? ContactMobilePhone, string? ContactBusinessPhone, string? ContactEmail, DateTime? ContactBirthday, int? ContactGender, int? ContactStatusID, string? ContactNotes, int? ContactOwnerUserID, bool? ContactMonitored, Guid ContactGUID, DateTime ContactLastModified, DateTime ContactCreated, int? ContactBounces, string? ContactCampaign, string? ContactSalesForceLeadID, bool? ContactSalesForceLeadReplicationDisabled, DateTime? ContactSalesForceLeadReplicationDateTime, DateTime? ContactSalesForceLeadReplicationSuspensionDateTime, string? ContactCompanyName, bool? ContactSalesForceLeadReplicationRequired, int? ContactPersonaID) : IOmContact, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ContactID"; + public static string TableName => "OM_Contact"; + public static string GuidColumnName => "ContactGUID"; + static OmContactK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") + ); + public static OmContactK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") + ); +}; + diff --git a/KVA/Migration.Tool.Source/Model/OmContactStatus.cs b/KVA/Migration.Tool.Source/Model/OmContactStatus.cs new file mode 100644 index 00000000..15280750 --- /dev/null +++ b/KVA/Migration.Tool.Source/Model/OmContactStatus.cs @@ -0,0 +1,77 @@ +// ReSharper disable InconsistentNaming + +using System.Data; +using Migration.Tool.Common; + +namespace Migration.Tool.Source.Model; +public partial interface IOmContactStatus : ISourceModel +{ + int ContactStatusID { get; } + string ContactStatusName { get; } + string ContactStatusDisplayName { get; } + string? ContactStatusDescription { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => OmContactStatusK11.GetPrimaryKeyName(version), + { Major: 12 } => OmContactStatusK12.GetPrimaryKeyName(version), + { Major: 13 } => OmContactStatusK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => OmContactStatusK11.IsAvailable(version), + { Major: 12 } => OmContactStatusK12.IsAvailable(version), + { Major: 13 } => OmContactStatusK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + static string ISourceModel.TableName => "OM_ContactStatus"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + static IOmContactStatus ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => OmContactStatusK11.FromReader(reader, version), + { Major: 12 } => OmContactStatusK12.FromReader(reader, version), + { Major: 13 } => OmContactStatusK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} +public partial record OmContactStatusK11(int ContactStatusID, string ContactStatusName, string ContactStatusDisplayName, string? ContactStatusDescription) : IOmContactStatus, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ContactStatusID"; + public static string TableName => "OM_ContactStatus"; + public static string GuidColumnName => ""; + static OmContactStatusK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") + ); + public static OmContactStatusK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") + ); +}; +public partial record OmContactStatusK12(int ContactStatusID, string ContactStatusName, string ContactStatusDisplayName, string? ContactStatusDescription) : IOmContactStatus, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ContactStatusID"; + public static string TableName => "OM_ContactStatus"; + public static string GuidColumnName => ""; + static OmContactStatusK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") + ); + public static OmContactStatusK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") + ); +}; +public partial record OmContactStatusK13(int ContactStatusID, string ContactStatusName, string ContactStatusDisplayName, string? ContactStatusDescription) : IOmContactStatus, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ContactStatusID"; + public static string TableName => "OM_ContactStatus"; + public static string GuidColumnName => ""; + static OmContactStatusK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") + ); + public static OmContactStatusK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") + ); +}; + diff --git a/KVA/Migration.Toolkit.Source/ModelExtensions/ICmsAttachment.cs b/KVA/Migration.Tool.Source/ModelExtensions/ICmsAttachment.cs similarity index 91% rename from KVA/Migration.Toolkit.Source/ModelExtensions/ICmsAttachment.cs rename to KVA/Migration.Tool.Source/ModelExtensions/ICmsAttachment.cs index d21b8194..8105f000 100644 --- a/KVA/Migration.Toolkit.Source/ModelExtensions/ICmsAttachment.cs +++ b/KVA/Migration.Tool.Source/ModelExtensions/ICmsAttachment.cs @@ -1,7 +1,7 @@ using System.Collections.Frozen; -using Migration.Toolkit.Common; +using Migration.Tool.Common; -namespace Migration.Toolkit.Source.Model; +namespace Migration.Tool.Source.Model; public partial interface ICmsAttachment : ISourceGuidEntity { diff --git a/KVA/Migration.Toolkit.Source/ModelExtensions/ICmsPageTemplateConfiguration.cs b/KVA/Migration.Tool.Source/ModelExtensions/ICmsPageTemplateConfiguration.cs similarity index 94% rename from KVA/Migration.Toolkit.Source/ModelExtensions/ICmsPageTemplateConfiguration.cs rename to KVA/Migration.Tool.Source/ModelExtensions/ICmsPageTemplateConfiguration.cs index 51d39c77..9eba28eb 100644 --- a/KVA/Migration.Toolkit.Source/ModelExtensions/ICmsPageTemplateConfiguration.cs +++ b/KVA/Migration.Tool.Source/ModelExtensions/ICmsPageTemplateConfiguration.cs @@ -1,4 +1,4 @@ -namespace Migration.Toolkit.Source.Model; +namespace Migration.Tool.Source.Model; public interface ICmsPageTemplateConfigurationK12K13 { diff --git a/KVA/Migration.Toolkit.Source/ModelExtensions/IMediaFile.cs b/KVA/Migration.Tool.Source/ModelExtensions/IMediaFile.cs similarity index 90% rename from KVA/Migration.Toolkit.Source/ModelExtensions/IMediaFile.cs rename to KVA/Migration.Tool.Source/ModelExtensions/IMediaFile.cs index 9e538302..e3894214 100644 --- a/KVA/Migration.Toolkit.Source/ModelExtensions/IMediaFile.cs +++ b/KVA/Migration.Tool.Source/ModelExtensions/IMediaFile.cs @@ -1,7 +1,7 @@ using System.Collections.Frozen; -using Migration.Toolkit.Common; +using Migration.Tool.Common; -namespace Migration.Toolkit.Source.Model; +namespace Migration.Tool.Source.Model; public partial interface IMediaFile : ISourceGuidEntity { diff --git a/KVA/Migration.Toolkit.Source/ModelExtensions/IMediaLibrary.cs b/KVA/Migration.Tool.Source/ModelExtensions/IMediaLibrary.cs similarity index 89% rename from KVA/Migration.Toolkit.Source/ModelExtensions/IMediaLibrary.cs rename to KVA/Migration.Tool.Source/ModelExtensions/IMediaLibrary.cs index c2daba07..a7a6e640 100644 --- a/KVA/Migration.Toolkit.Source/ModelExtensions/IMediaLibrary.cs +++ b/KVA/Migration.Tool.Source/ModelExtensions/IMediaLibrary.cs @@ -1,8 +1,8 @@ using System.Collections.Frozen; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Helpers; +using Migration.Tool.Common; +using Migration.Tool.Common.Helpers; -namespace Migration.Toolkit.Source.Model; +namespace Migration.Tool.Source.Model; public partial interface IMediaLibrary : ISourceGuidEntity { diff --git a/KVA/Migration.Toolkit.Source/ModelFacade.cs b/KVA/Migration.Tool.Source/ModelFacade.cs similarity index 98% rename from KVA/Migration.Toolkit.Source/ModelFacade.cs rename to KVA/Migration.Tool.Source/ModelFacade.cs index 9cb95ca4..a8e88ef6 100644 --- a/KVA/Migration.Toolkit.Source/ModelFacade.cs +++ b/KVA/Migration.Tool.Source/ModelFacade.cs @@ -2,11 +2,11 @@ using Microsoft.Data.SqlClient; -using Migration.Toolkit.Common; +using Migration.Tool.Common; -namespace Migration.Toolkit.Source; +namespace Migration.Tool.Source; -public class ModelFacade(ToolkitConfiguration configuration) +public class ModelFacade(ToolConfiguration configuration) { private SemanticVersion? semanticVersion; diff --git a/KVA/Migration.Tool.Source/Providers/ClassMappingProvider.cs b/KVA/Migration.Tool.Source/Providers/ClassMappingProvider.cs new file mode 100644 index 00000000..ca303ff9 --- /dev/null +++ b/KVA/Migration.Tool.Source/Providers/ClassMappingProvider.cs @@ -0,0 +1,22 @@ +using Migration.Tool.Common.Builders; + +namespace Migration.Tool.Source.Providers; + +public class ClassMappingProvider(IEnumerable classMappings) +{ + private readonly Dictionary mappingsByClassName = classMappings.Aggregate(new Dictionary(StringComparer.InvariantCultureIgnoreCase), + (current, sourceClassMapping) => + { + foreach (string s2Cl in sourceClassMapping.SourceClassNames) + { + if (!current.TryAdd(s2Cl, sourceClassMapping)) + { + throw new InvalidOperationException($"Incorrectly defined class mapping - duplicate found for class '{s2Cl}'. Fix mapping before proceeding with migration."); + } + } + + return current; + }); + + public IClassMapping? GetMapping(string className) => mappingsByClassName.GetValueOrDefault(className); +} diff --git a/KVA/Migration.Tool.Source/Providers/ContentItemNameProvider.cs b/KVA/Migration.Tool.Source/Providers/ContentItemNameProvider.cs new file mode 100644 index 00000000..bc84811f --- /dev/null +++ b/KVA/Migration.Tool.Source/Providers/ContentItemNameProvider.cs @@ -0,0 +1,42 @@ +using CMS.Base; +using CMS.ContentEngine.Internal; +using CMS.Helpers; + +namespace Migration.Tool.Source.Providers; + +internal class ContentItemNameProvider +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) => this.codeNameValidator = codeNameValidator; + + public Task Get(string name) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); + } + + async Task Get(string name) + { + string codeName = ValidationHelper.GetCodeName(name, useUnicode: false); + + bool isCodeNameValid = ValidationHelper.IsCodeName(codeName); + + if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) + { + codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); + } + + var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); + + return await uniqueCodeNameProvider.GetUniqueValue(codeName); + } + + return Get(name); + } +} diff --git a/KVA/Migration.Tool.Source/Providers/ContentItemNameValidator.cs b/KVA/Migration.Tool.Source/Providers/ContentItemNameValidator.cs new file mode 100644 index 00000000..7dcaa5b3 --- /dev/null +++ b/KVA/Migration.Tool.Source/Providers/ContentItemNameValidator.cs @@ -0,0 +1,18 @@ +using CMS.ContentEngine.Internal; + +namespace Migration.Tool.Source.Providers; + +internal class ContentItemNameValidator : IContentItemNameValidator +{ + /// + public bool IsUnique(string name) => IsUnique(0, name); + + + /// + public bool IsUnique(int id, string name) + { + var contentItemInfo = new ContentItemInfo { ContentItemID = id, ContentItemName = name }; + + return contentItemInfo.CheckUniqueCodeName(); + } +} diff --git a/KVA/Migration.Tool.Source/Providers/UniqueContentItemNameProvider.cs b/KVA/Migration.Tool.Source/Providers/UniqueContentItemNameProvider.cs new file mode 100644 index 00000000..7e2e3287 --- /dev/null +++ b/KVA/Migration.Tool.Source/Providers/UniqueContentItemNameProvider.cs @@ -0,0 +1,38 @@ +using CMS.Base; +using CMS.ContentEngine.Internal; + +namespace Migration.Tool.Source.Providers; + +internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) + : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) => this.codeNameValidator = codeNameValidator; + + public override Task GetUniqueValue(string inputValue) => base.GetUniqueValue(AddSuffix(inputValue)); + + + private string AddSuffix(string codeName) + { + string randomSuffix = GetRandomSuffix(); + string codeNameWithSuffix = codeName += randomSuffix; + + if (codeNameWithSuffix.Length > MaxLength) + { + int availableLength = MaxLength - randomSuffix.Length; + + codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; + } + + return codeNameWithSuffix; + } + + + /// + protected override Task IsValueUnique(string value) => Task.FromResult(codeNameValidator.IsUnique(value)); +} diff --git a/KVA/Migration.Toolkit.Source/Services/AssetFacade.cs b/KVA/Migration.Tool.Source/Services/AssetFacade.cs similarity index 92% rename from KVA/Migration.Toolkit.Source/Services/AssetFacade.cs rename to KVA/Migration.Tool.Source/Services/AssetFacade.cs index a8b09220..c4d11ad9 100644 --- a/KVA/Migration.Toolkit.Source/Services/AssetFacade.cs +++ b/KVA/Migration.Tool.Source/Services/AssetFacade.cs @@ -7,14 +7,14 @@ using Kentico.Xperience.UMT.Model; using Kentico.Xperience.UMT.Services; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Source.Auxiliary; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Common; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Source.Auxiliary; +using Migration.Tool.Source.Helpers; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Services; +namespace Migration.Tool.Source.Services; public interface IAssetFacade { @@ -56,13 +56,13 @@ public interface IAssetFacade } public class AssetFacade( - EntityIdentityFacade entityIdentityFacade, - ToolkitConfiguration toolkitConfiguration, - ModelFacade modelFacade, - IImporter importer, - ILogger logger, - IProtocol protocol - ) : IAssetFacade + EntityIdentityFacade entityIdentityFacade, + ToolConfiguration toolConfiguration, + ModelFacade modelFacade, + IImporter importer, + ILogger logger, + IProtocol protocol + ) : IAssetFacade { public string DefaultContentLanguage { @@ -83,8 +83,8 @@ public async Task FromMediaFile(IMediaFile mediaFile Debug.Assert(mediaFile.FileLibraryID == mediaLibrary.LibraryID, "mediaFile.FileLibraryID == mediaLibrary.LibraryID"); Debug.Assert(mediaLibrary.LibrarySiteID == site.SiteID, "mediaLibrary.LibrarySiteID == site.SiteID"); - string? mediaLibraryAbsolutePath = GetMediaLibraryAbsolutePath(toolkitConfiguration, site, mediaLibrary, modelFacade); - if (toolkitConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(false)) + string? mediaLibraryAbsolutePath = GetMediaLibraryAbsolutePath(toolConfiguration, site, mediaLibrary, modelFacade); + if (toolConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(false)) { throw new InvalidOperationException($"Configuration 'Settings.MigrateOnlyMediaFileInfo' is set to to 'true', for migration of media files to content items this setting is required to be 'false'"); } @@ -96,12 +96,12 @@ public async Task FromMediaFile(IMediaFile mediaFile string mediaFilePath = Path.Combine(mediaLibraryAbsolutePath, mediaFile.FilePath); int? createdByUserId = AdminUserHelper.MapTargetAdminUser( - mediaFile.FileCreatedByUserID, - CMSActionContext.CurrentUser.UserID, - () => protocol.Append(HandbookReferences - .MissingRequiredDependency(nameof(mediaFile.FileCreatedByUserID), mediaFile.FileCreatedByUserID) - .NeedsManualAction() - ) + mediaFile.FileCreatedByUserID, + CMSActionContext.CurrentUser.UserID, + () => protocol.Append(HandbookReferences + .MissingRequiredDependency(nameof(mediaFile.FileCreatedByUserID), mediaFile.FileCreatedByUserID) + .NeedsManualAction() + ) ); var createdByUser = createdByUserId.HasValue ? modelFacade.SelectById(createdByUserId) : null; @@ -382,9 +382,9 @@ private void AssertSuccess(IImportResult importResult, IUmtModel model) ClassHasUnmanagedDbSchema = false, ClassWebPageHasUrl = false, Fields = - [ - LegacyMediaFileAssetField - ] + [ + LegacyMediaFileAssetField + ] }; internal static readonly FormField LegacyAttachmentAssetField = new() @@ -410,9 +410,9 @@ private void AssertSuccess(IImportResult importResult, IUmtModel model) ClassHasUnmanagedDbSchema = false, ClassWebPageHasUrl = false, Fields = - [ - LegacyAttachmentAssetField - ] + [ + LegacyAttachmentAssetField + ] }; internal static ContentFolderModel GetAssetFolder(ICmsSite site) @@ -429,7 +429,7 @@ internal static ContentFolderModel GetAssetFolder(ICmsSite site) } private static readonly IUmtModel[] prerequisites = [ - LegacyMediaFileContentType, + LegacyMediaFileContentType, LegacyAttachmentContentType ]; @@ -437,14 +437,14 @@ internal static ContentFolderModel GetAssetFolder(ICmsSite site) #endregion private const string DirMedia = "media"; - public static string? GetMediaLibraryAbsolutePath(ToolkitConfiguration toolkitConfiguration, ICmsSite ksSite, IMediaLibrary ksMediaLibrary, ModelFacade modelFacade) + public static string? GetMediaLibraryAbsolutePath(ToolConfiguration toolConfiguration, ICmsSite ksSite, IMediaLibrary ksMediaLibrary, ModelFacade modelFacade) { string? cmsMediaLibrariesFolder = KenticoHelper.GetSettingsKey(modelFacade, ksSite.SiteID, "CMSMediaLibrariesFolder"); bool cmsUseMediaLibrariesSiteFolder = !"false".Equals(KenticoHelper.GetSettingsKey(modelFacade, ksSite.SiteID, "CMSUseMediaLibrariesSiteFolder"), StringComparison.InvariantCultureIgnoreCase); string? sourceMediaLibraryPath = null; - if (!toolkitConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(false) && - !string.IsNullOrWhiteSpace(toolkitConfiguration.KxCmsDirPath)) + if (!toolConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(false) && + !string.IsNullOrWhiteSpace(toolConfiguration.KxCmsDirPath)) { var pathParts = new List(); if (cmsMediaLibrariesFolder != null) @@ -463,7 +463,7 @@ internal static ContentFolderModel GetAssetFolder(ICmsSite site) if (cmsMediaLibrariesFolder.StartsWith("~/")) { string cleared = $"{cmsMediaLibrariesFolder[2..]}".Replace("/", "\\"); - pathParts.Add(toolkitConfiguration.KxCmsDirPath); + pathParts.Add(toolConfiguration.KxCmsDirPath); pathParts.Add(cleared); if (cmsUseMediaLibrariesSiteFolder) { @@ -473,7 +473,7 @@ internal static ContentFolderModel GetAssetFolder(ICmsSite site) } else { - pathParts.Add(toolkitConfiguration.KxCmsDirPath); + pathParts.Add(toolConfiguration.KxCmsDirPath); pathParts.Add(cmsMediaLibrariesFolder); if (cmsUseMediaLibrariesSiteFolder) { @@ -485,7 +485,7 @@ internal static ContentFolderModel GetAssetFolder(ICmsSite site) } else { - pathParts.Add(toolkitConfiguration.KxCmsDirPath); + pathParts.Add(toolConfiguration.KxCmsDirPath); if (cmsUseMediaLibrariesSiteFolder) { pathParts.Add(ksSite.SiteName); diff --git a/KVA/Migration.Toolkit.Source/Services/AttachmentMigratorToContentItem.cs b/KVA/Migration.Tool.Source/Services/AttachmentMigratorToContentItem.cs similarity index 97% rename from KVA/Migration.Toolkit.Source/Services/AttachmentMigratorToContentItem.cs rename to KVA/Migration.Tool.Source/Services/AttachmentMigratorToContentItem.cs index d50bd8d5..2bf4bc36 100644 --- a/KVA/Migration.Toolkit.Source/Services/AttachmentMigratorToContentItem.cs +++ b/KVA/Migration.Tool.Source/Services/AttachmentMigratorToContentItem.cs @@ -4,11 +4,11 @@ using Kentico.Xperience.UMT.Services; using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Source.Auxiliary; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Source.Auxiliary; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Services; +namespace Migration.Tool.Source.Services; public class AttachmentMigratorToContentItem( ILogger logger, diff --git a/KVA/Migration.Toolkit.Source/Services/AttachmentMigratorToMediaLibrary.cs b/KVA/Migration.Tool.Source/Services/AttachmentMigratorToMediaLibrary.cs similarity index 95% rename from KVA/Migration.Toolkit.Source/Services/AttachmentMigratorToMediaLibrary.cs rename to KVA/Migration.Tool.Source/Services/AttachmentMigratorToMediaLibrary.cs index 960acbbd..99241a9f 100644 --- a/KVA/Migration.Toolkit.Source/Services/AttachmentMigratorToMediaLibrary.cs +++ b/KVA/Migration.Tool.Source/Services/AttachmentMigratorToMediaLibrary.cs @@ -7,17 +7,17 @@ using Microsoft.Data.SqlClient; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Api.Auxiliary; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.Source.Auxiliary; -using Migration.Toolkit.Source.Mappers; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Services; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KXP.Api; +using Migration.Tool.KXP.Api.Auxiliary; +using Migration.Tool.KXP.Context; +using Migration.Tool.Source.Auxiliary; +using Migration.Tool.Source.Mappers; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Services; public class AttachmentMigratorToMediaLibrary( ILogger logger, @@ -257,7 +257,7 @@ private static int MediaLibraryFactory((string libraryName, int siteId) arg, Med } return tml?.LibraryId ?? context.MediaFileFacade - .CreateMediaLibrary(siteId, libraryDirectory, "Created by Xperience Migration.Toolkit", context.TargetLibraryCodeName, context.TargetLibraryDisplayName).LibraryID; + .CreateMediaLibrary(siteId, libraryDirectory, "Created by Xperience Migration.Tool", context.TargetLibraryCodeName, context.TargetLibraryDisplayName).LibraryID; } private record MediaLibraryFactoryContext(KxpMediaFileFacade MediaFileFacade, string TargetLibraryCodeName, string TargetLibraryDisplayName, KxpContext DbContext); diff --git a/KVA/Migration.Toolkit.Source/Services/ClassService.cs b/KVA/Migration.Tool.Source/Services/ClassService.cs similarity index 92% rename from KVA/Migration.Toolkit.Source/Services/ClassService.cs rename to KVA/Migration.Tool.Source/Services/ClassService.cs index 7e4bcc3f..158fbb21 100644 --- a/KVA/Migration.Toolkit.Source/Services/ClassService.cs +++ b/KVA/Migration.Tool.Source/Services/ClassService.cs @@ -3,9 +3,9 @@ using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Services; +namespace Migration.Tool.Source.Services; public class ClassService(ILogger logger, ModelFacade modelFacade) { diff --git a/KVA/Migration.Toolkit.Source/Services/CmsRelationshipService.cs b/KVA/Migration.Tool.Source/Services/CmsRelationshipService.cs similarity index 94% rename from KVA/Migration.Toolkit.Source/Services/CmsRelationshipService.cs rename to KVA/Migration.Tool.Source/Services/CmsRelationshipService.cs index 21e8de7c..591a7630 100644 --- a/KVA/Migration.Toolkit.Source/Services/CmsRelationshipService.cs +++ b/KVA/Migration.Tool.Source/Services/CmsRelationshipService.cs @@ -1,8 +1,8 @@ using Microsoft.Data.SqlClient; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Services; +namespace Migration.Tool.Source.Services; public class CmsRelationshipService( ModelFacade modelFacade) diff --git a/KVA/Migration.Toolkit.Source/Services/DeferredPathService.cs b/KVA/Migration.Tool.Source/Services/DeferredPathService.cs similarity index 91% rename from KVA/Migration.Toolkit.Source/Services/DeferredPathService.cs rename to KVA/Migration.Tool.Source/Services/DeferredPathService.cs index 281bf51c..852e24f7 100644 --- a/KVA/Migration.Toolkit.Source/Services/DeferredPathService.cs +++ b/KVA/Migration.Tool.Source/Services/DeferredPathService.cs @@ -1,4 +1,4 @@ -namespace Migration.Toolkit.Source.Services; +namespace Migration.Tool.Source.Services; public class DeferredPathService { diff --git a/KVA/Migration.Toolkit.Source/Services/IAttachmentMigrator.cs b/KVA/Migration.Tool.Source/Services/IAttachmentMigrator.cs similarity index 93% rename from KVA/Migration.Toolkit.Source/Services/IAttachmentMigrator.cs rename to KVA/Migration.Tool.Source/Services/IAttachmentMigrator.cs index a75d1a0e..65c63037 100644 --- a/KVA/Migration.Toolkit.Source/Services/IAttachmentMigrator.cs +++ b/KVA/Migration.Tool.Source/Services/IAttachmentMigrator.cs @@ -1,7 +1,7 @@ using CMS.MediaLibrary; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Services; +namespace Migration.Tool.Source.Services; public interface IAttachmentMigrator { diff --git a/KVA/Migration.Tool.Source/Services/IMediaFileMigrator.cs b/KVA/Migration.Tool.Source/Services/IMediaFileMigrator.cs new file mode 100644 index 00000000..187d638b --- /dev/null +++ b/KVA/Migration.Tool.Source/Services/IMediaFileMigrator.cs @@ -0,0 +1,9 @@ +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; + +namespace Migration.Tool.Source.Services; + +public interface IMediaFileMigrator +{ + Task Handle(MigrateMediaLibrariesCommand request, CancellationToken cancellationToken); +} diff --git a/KVA/Migration.Tool.Source/Services/IPrimaryKeyLocatorService.cs b/KVA/Migration.Tool.Source/Services/IPrimaryKeyLocatorService.cs new file mode 100644 index 00000000..ac6df8a2 --- /dev/null +++ b/KVA/Migration.Tool.Source/Services/IPrimaryKeyLocatorService.cs @@ -0,0 +1,11 @@ +using System.Linq.Expressions; + +namespace Migration.Tool.Source.Services; + +public record SourceTargetKeyMapping(int SourceId, int TargetId); + +public interface IPrimaryKeyLocatorService +{ + bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); + IEnumerable SelectAll(Expression> keyNameSelector); +} diff --git a/KVA/Migration.Toolkit.Source/Services/MediaFileMigrator.cs b/KVA/Migration.Tool.Source/Services/MediaFileMigrator.cs similarity index 92% rename from KVA/Migration.Toolkit.Source/Services/MediaFileMigrator.cs rename to KVA/Migration.Tool.Source/Services/MediaFileMigrator.cs index 1e261f43..ab7c4e59 100644 --- a/KVA/Migration.Toolkit.Source/Services/MediaFileMigrator.cs +++ b/KVA/Migration.Tool.Source/Services/MediaFileMigrator.cs @@ -4,20 +4,20 @@ using Microsoft.Data.SqlClient; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Api.Auxiliary; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.KXP.Models; -using Migration.Toolkit.Source.Auxiliary; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Handlers; -using Migration.Toolkit.Source.Mappers; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Services; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KXP.Api; +using Migration.Tool.KXP.Api.Auxiliary; +using Migration.Tool.KXP.Context; +using Migration.Tool.KXP.Models; +using Migration.Tool.Source.Auxiliary; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Handlers; +using Migration.Tool.Source.Mappers; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Services; public class MediaFileMigrator( ILogger logger, @@ -26,7 +26,7 @@ public class MediaFileMigrator( KxpMediaFileFacade mediaFileFacade, IEntityMapper mediaFileInfoMapper, IEntityMapper mediaLibraryInfoMapper, - ToolkitConfiguration toolkitConfiguration, + ToolConfiguration toolConfiguration, PrimaryKeyMappingContext primaryKeyMappingContext, EntityIdentityFacade entityIdentityFacade, IProtocol protocol @@ -144,7 +144,7 @@ private async Task RequireMigratedMediaFiles(List<(IMediaLibrary sourceLibrary, { foreach (var (ksMediaLibrary, ksSite, targetMediaLibrary) in migratedMediaLibraries) { - string? sourceMediaLibraryPath = AssetFacade.GetMediaLibraryAbsolutePath(toolkitConfiguration, ksSite, ksMediaLibrary, modelFacade); + string? sourceMediaLibraryPath = AssetFacade.GetMediaLibraryAbsolutePath(toolConfiguration, ksSite, ksMediaLibrary, modelFacade); bool loadMediaFileData = !string.IsNullOrWhiteSpace(sourceMediaLibraryPath); var ksMediaFiles = modelFacade.SelectWhere("FileLibraryID = @FileLibraryId", new SqlParameter("FileLibraryId", ksMediaLibrary.LibraryID)); @@ -177,7 +177,7 @@ private async Task RequireMigratedMediaFiles(List<(IMediaLibrary sourceLibrary, protocol.FetchedTarget(kxoMediaFile); var source = new MediaFileInfoMapperSource(fullMediaPath, ksMediaFile, targetMediaLibrary.LibraryID, found ? uploadedFile : null, - librarySubfolder, toolkitConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(false), safeMediaFileGuid); + librarySubfolder, toolConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(false), safeMediaFileGuid); var mapped = mediaFileInfoMapper.Map(source, kxoMediaFile); protocol.MappedTarget(mapped); diff --git a/KVA/Migration.Toolkit.Source/Services/MediaFileMigratorToContentItem.cs b/KVA/Migration.Tool.Source/Services/MediaFileMigratorToContentItem.cs similarity index 93% rename from KVA/Migration.Toolkit.Source/Services/MediaFileMigratorToContentItem.cs rename to KVA/Migration.Tool.Source/Services/MediaFileMigratorToContentItem.cs index f661d132..f45f1d1a 100644 --- a/KVA/Migration.Toolkit.Source/Services/MediaFileMigratorToContentItem.cs +++ b/KVA/Migration.Tool.Source/Services/MediaFileMigratorToContentItem.cs @@ -3,12 +3,12 @@ using CMS.Core; using Kentico.Xperience.UMT.Services; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Source.Handlers; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Source.Handlers; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Services; +namespace Migration.Tool.Source.Services; public class MediaFileMigratorToContentItem( ILogger logger, diff --git a/KVA/Migration.Toolkit.Source/Services/MediaLinkServiceFactory.cs b/KVA/Migration.Tool.Source/Services/MediaLinkServiceFactory.cs similarity index 93% rename from KVA/Migration.Toolkit.Source/Services/MediaLinkServiceFactory.cs rename to KVA/Migration.Tool.Source/Services/MediaLinkServiceFactory.cs index 9be1ea42..dc23c8df 100644 --- a/KVA/Migration.Toolkit.Source/Services/MediaLinkServiceFactory.cs +++ b/KVA/Migration.Tool.Source/Services/MediaLinkServiceFactory.cs @@ -1,8 +1,8 @@ using System.Collections.Immutable; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Services; +namespace Migration.Tool.Source.Services; public class MediaLinkServiceFactory(ModelFacade modelFacade) { diff --git a/KVA/Migration.Tool.Source/Services/Model/AttachmentSelectorItem.cs b/KVA/Migration.Tool.Source/Services/Model/AttachmentSelectorItem.cs new file mode 100644 index 00000000..422875a3 --- /dev/null +++ b/KVA/Migration.Tool.Source/Services/Model/AttachmentSelectorItem.cs @@ -0,0 +1,11 @@ +using Newtonsoft.Json; + +namespace Migration.Tool.Source.Services.Model; + +/// Represents an item for the attachment selector. +public class AttachmentSelectorItem +{ + /// Attachment GUID. + [JsonProperty("fileGuid")] + public Guid FileGuid { get; set; } +} diff --git a/KVA/Migration.Tool.Source/Services/Model/EditableAreasConfiguration.cs b/KVA/Migration.Tool.Source/Services/Model/EditableAreasConfiguration.cs new file mode 100644 index 00000000..efe472ba --- /dev/null +++ b/KVA/Migration.Tool.Source/Services/Model/EditableAreasConfiguration.cs @@ -0,0 +1,192 @@ +using System.Runtime.Serialization; + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace Migration.Tool.Source.Services.Model; + +#region Copied from Kentico assembly + +[DataContract(Name = "Configuration", Namespace = "")] +public sealed class EditableAreasConfiguration +{ + /// + /// Creates an instance of class. + /// + public EditableAreasConfiguration() => EditableAreas = []; + + /// Editable areas within the page. + [DataMember] + [JsonProperty("editableAreas")] + public List EditableAreas { get; private set; } +} + +/// +/// Represents configuration of editable area within the instance. +/// +[DataContract(Name = "EditableArea", Namespace = "")] +public sealed class EditableAreaConfiguration +{ + /// + /// Creates an instance of class. + /// + public EditableAreaConfiguration() => Sections = []; + + /// Identifier of the editable area. + [DataMember] + [JsonProperty("identifier")] + public string Identifier { get; set; } + + /// Sections within editable area. + [DataMember] + [JsonProperty("sections")] + public List Sections { get; private set; } + + /// + /// A flag indicating whether the output of the individual widgets within the editable area can be cached. The default + /// value is false. + /// + public bool AllowWidgetOutputCache { get; set; } + + /// + /// An absolute expiration date for the cached output of the individual widgets. + /// + public DateTimeOffset? WidgetOutputCacheExpiresOn { get; set; } + + /// + /// The length of time from the first request to cache the output of the individual widgets. + /// + public TimeSpan? WidgetOutputCacheExpiresAfter { get; set; } + + /// + /// The time after which the cached output of the individual widgets should be evicted if it has not been accessed. + /// + public TimeSpan? WidgetOutputCacheExpiresSliding { get; set; } +} + +/// +/// Represents configuration of section within the +/// instance. +/// +[DataContract(Name = "Section", Namespace = "")] +public sealed class SectionConfiguration +{ + /// + /// Creates an instance of class. + /// + public SectionConfiguration() => Zones = []; + + /// Identifier of the section. + [DataMember] + [JsonProperty("identifier")] + public Guid Identifier { get; set; } + + /// Type section identifier. + [DataMember] + [JsonProperty("type")] + public string TypeIdentifier { get; set; } + + /// Section properties. + [DataMember] + [JsonProperty("properties")] + // public ISectionProperties Properties { get; set; } + public JObject Properties { get; set; } + + /// Zones within the section. + [DataMember] + [JsonProperty("zones")] + public List Zones { get; private set; } +} + +/// +/// Represents the zone within the +/// configuration class. +/// +[DataContract(Name = "Zone", Namespace = "")] +public sealed class ZoneConfiguration +{ + /// + /// Creates an instance of class. + /// + public ZoneConfiguration() => Widgets = []; + + /// Identifier of the widget zone. + [DataMember] + [JsonProperty("identifier")] + public Guid Identifier { get; set; } + + /// Name of the widget zone. + [DataMember] + [JsonProperty("name")] + public string Name { get; set; } + + /// List of widgets within the zone. + [DataMember] + [JsonProperty("widgets")] + public List Widgets { get; private set; } +} + +/// +/// Represents the configuration of a widget within the +/// list. +/// +[DataContract(Name = "Widget", Namespace = "")] +public sealed class WidgetConfiguration +{ + /// + /// Creates an instance of class. + /// + public WidgetConfiguration() => Variants = []; + + /// Identifier of the widget instance. + [DataMember] + [JsonProperty("identifier")] + public Guid Identifier { get; set; } + + /// Type widget identifier. + [DataMember] + [JsonProperty("type")] + public string TypeIdentifier { get; set; } + + /// Personalization condition type identifier. + [DataMember] + [JsonProperty("conditionType")] + public string PersonalizationConditionTypeIdentifier { get; set; } + + /// List of widget variants. + [DataMember] + [JsonProperty("variants")] + public List Variants { get; set; } +} + +/// +/// Represents the configuration variant of a widget within the +/// list. +/// +[DataContract(Name = "Variant", Namespace = "")] +public sealed class WidgetVariantConfiguration +{ + /// Identifier of the variant instance. + [DataMember] + [JsonProperty("identifier")] + public Guid Identifier { get; set; } + + /// Widget variant name. + [DataMember] + [JsonProperty("name")] + public string Name { get; set; } + + /// Widget variant properties. + [DataMember] + [JsonProperty("properties")] + // public IWidgetProperties Properties { get; set; } + public JObject Properties { get; set; } + + /// Widget variant personalization condition type. + /// Only personalization condition type parameters are serialized to JSON. + [DataMember] + [JsonProperty("conditionTypeParameters")] + public JObject PersonalizationConditionType { get; set; } +} + +#endregion diff --git a/KVA/Migration.Toolkit.Source/Services/Model/MediaFilesSelectorItem.cs b/KVA/Migration.Tool.Source/Services/Model/MediaFilesSelectorItem.cs similarity index 83% rename from KVA/Migration.Toolkit.Source/Services/Model/MediaFilesSelectorItem.cs rename to KVA/Migration.Tool.Source/Services/Model/MediaFilesSelectorItem.cs index 79e4dda3..6cf7929b 100644 --- a/KVA/Migration.Toolkit.Source/Services/Model/MediaFilesSelectorItem.cs +++ b/KVA/Migration.Tool.Source/Services/Model/MediaFilesSelectorItem.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace Migration.Toolkit.Source.Services.Model; +namespace Migration.Tool.Source.Services.Model; // // Summary: diff --git a/KVA/Migration.Tool.Source/Services/Model/PageSelectorItem.cs b/KVA/Migration.Tool.Source/Services/Model/PageSelectorItem.cs new file mode 100644 index 00000000..44ed7d38 --- /dev/null +++ b/KVA/Migration.Tool.Source/Services/Model/PageSelectorItem.cs @@ -0,0 +1,11 @@ +using Newtonsoft.Json; + +namespace Migration.Tool.Source.Services.Model; + +/// Represents an item for a page selector. +public class PageSelectorItem +{ + /// Node Guid of a page. + [JsonProperty("nodeGuid")] + public Guid NodeGuid { get; set; } +} diff --git a/KVA/Migration.Tool.Source/Services/Model/PageTemplateConfiguration.cs b/KVA/Migration.Tool.Source/Services/Model/PageTemplateConfiguration.cs new file mode 100644 index 00000000..f6173d08 --- /dev/null +++ b/KVA/Migration.Tool.Source/Services/Model/PageTemplateConfiguration.cs @@ -0,0 +1,30 @@ +using System.Runtime.Serialization; + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace Migration.Tool.Source.Services.Model; + +/// +/// Page template configuration for the instance. +/// +[DataContract(Name = "PageTemplate", Namespace = "")] +public class PageTemplateConfiguration +{ + /// Identifier of the page template. + [DataMember] + [JsonProperty("identifier")] + public string Identifier { get; set; } + + /// + /// Identifier of the page template configuration based on which the page was created. + /// + [DataMember] + [JsonProperty("configurationIdentifier")] + public Guid ConfigurationIdentifier { get; set; } + + /// Page template properties. + [DataMember] + [JsonProperty("properties")] + public JObject Properties { get; set; } +} diff --git a/KVA/Migration.Toolkit.Source/Services/Model/PathSelectorItem.cs b/KVA/Migration.Tool.Source/Services/Model/PathSelectorItem.cs similarity index 83% rename from KVA/Migration.Toolkit.Source/Services/Model/PathSelectorItem.cs rename to KVA/Migration.Tool.Source/Services/Model/PathSelectorItem.cs index d02e73a1..65eb4443 100644 --- a/KVA/Migration.Toolkit.Source/Services/Model/PathSelectorItem.cs +++ b/KVA/Migration.Tool.Source/Services/Model/PathSelectorItem.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace Migration.Toolkit.Source.Services.Model; +namespace Migration.Tool.Source.Services.Model; // // Summary: diff --git a/KVA/Migration.Toolkit.Source/Services/ModuleLoader.cs b/KVA/Migration.Tool.Source/Services/ModuleLoader.cs similarity index 82% rename from KVA/Migration.Toolkit.Source/Services/ModuleLoader.cs rename to KVA/Migration.Tool.Source/Services/ModuleLoader.cs index 73bdd520..698145b8 100644 --- a/KVA/Migration.Toolkit.Source/Services/ModuleLoader.cs +++ b/KVA/Migration.Tool.Source/Services/ModuleLoader.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.Source.Contexts; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Services.Ipc; +using Migration.Tool.Source.Contexts; -namespace Migration.Toolkit.Source.Services; +namespace Migration.Tool.Source.Services; public class ModuleLoader( IpcService ipc, diff --git a/KVA/Migration.Toolkit.Source/Services/PageTemplateMigrator.cs b/KVA/Migration.Tool.Source/Services/PageTemplateMigrator.cs similarity index 91% rename from KVA/Migration.Toolkit.Source/Services/PageTemplateMigrator.cs rename to KVA/Migration.Tool.Source/Services/PageTemplateMigrator.cs index 6a9e1791..37acd53f 100644 --- a/KVA/Migration.Toolkit.Source/Services/PageTemplateMigrator.cs +++ b/KVA/Migration.Tool.Source/Services/PageTemplateMigrator.cs @@ -3,11 +3,11 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Services; +namespace Migration.Tool.Source.Services; public class PageTemplateMigrator( ILogger logger, diff --git a/KVA/Migration.Tool.Source/Services/PrimaryKeyLocatorService.cs b/KVA/Migration.Tool.Source/Services/PrimaryKeyLocatorService.cs new file mode 100644 index 00000000..6864a9bc --- /dev/null +++ b/KVA/Migration.Tool.Source/Services/PrimaryKeyLocatorService.cs @@ -0,0 +1,216 @@ +using System.Linq.Expressions; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.KXP.Context; +using Migration.Tool.Source.Model; + +namespace Migration.Tool.Source.Services; + +public class PrimaryKeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + ModelFacade modelFacade +) : IPrimaryKeyLocatorService +{ + public IEnumerable SelectAll(Expression> keyNameSelector) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + string memberName = keyNameSelector.GetMemberName(); + + logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); + + if (sourceType == typeof(ICmsUser) && memberName == nameof(ICmsUser.UserID)) + { + var sourceUsers = modelFacade.SelectAll().ToList(); + var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); + + var result = sourceUsers.Join(targetUsers, + a => new CmsUserKey(a.UserGUID, a.UserName), + b => new CmsUserKey(b.UserGuid, b.UserName), + (a, b) => new SourceTargetKeyMapping(a.UserID, b.UserId), + new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(IOmContact) && memberName == nameof(IOmContact.ContactID)) + { + var source = modelFacade.SelectAll() + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactID, x.ContactGUID }).ToList(); + var target = kxpContext.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + + var result = source.Join(target, + a => a.ContactGUID, + b => b.ContactGuid, + (a, b) => new SourceTargetKeyMapping(a.ContactID, b.ContactId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(ICmsState) && memberName == nameof(ICmsState.StateID)) + { + var source = modelFacade.SelectAll().Select(x => new { x.StateID, x.StateName }).ToList(); + var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + + var result = source.Join(target, + a => a.StateName, + b => b.StateName, + (a, b) => new SourceTargetKeyMapping(a.StateID, b.StateId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(ICmsCountry) && memberName == nameof(ICmsCountry.CountryID)) + { + var source = modelFacade.SelectAll().Select(x => new { x.CountryID, x.CountryName }).ToList(); + var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + + var result = source.Join(target, + a => a.CountryName, + b => b.CountryName, + (a, b) => new SourceTargetKeyMapping(a.CountryID, b.CountryId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + + throw new NotImplementedException(); + } + + public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + targetId = -1; + try + { + if (sourceType == typeof(ICmsResource)) + { + var sourceGuid = modelFacade.SelectById(sourceId)?.ResourceGUID; + targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == sourceGuid).Select(x => x.ResourceId).Single(); + return true; + } + + if (sourceType == typeof(ICmsClass)) + { + var sourceGuid = modelFacade.SelectById(sourceId)?.ClassGUID; + targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == sourceGuid).Select(x => x.ClassId).Single(); + return true; + } + + if (sourceType == typeof(ICmsUser)) + { + var source = modelFacade.SelectById(sourceId); + targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == source.UserGUID || x.UserName == source.UserName).Select(x => x.UserId).Single(); + return true; + } + + if (sourceType == typeof(ICmsRole)) + { + var sourceGuid = modelFacade.SelectById(sourceId)?.RoleGUID; + targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == sourceGuid).Select(x => x.RoleId).Single(); + return true; + } + + if (sourceType == typeof(ICmsSite)) + { + var sourceGuid = modelFacade.SelectById(sourceId)?.SiteGUID; + targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == sourceGuid).Select(x => x.ChannelId).Single(); + return true; + } + + if (sourceType == typeof(ICmsState)) + { + string? sourceName = modelFacade.SelectById(sourceId)?.StateName; + targetId = kxpContext.CmsStates.Where(x => x.StateName == sourceName).Select(x => x.StateId).Single(); + return true; + } + + if (sourceType == typeof(ICmsCountry)) + { + string? sourceName = modelFacade.SelectById(sourceId)?.CountryName; + targetId = kxpContext.CmsCountries.Where(x => x.CountryName == sourceName).Select(x => x.CountryId).Single(); + return true; + } + + if (sourceType == typeof(IOmContactStatus)) + { + string? sourceName = modelFacade.SelectById(sourceId)?.ContactStatusName; + targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == sourceName).Select(x => x.ContactStatusId).Single(); + return true; + } + + if (sourceType == typeof(IOmContact)) + { + var sourceGuid = modelFacade.SelectById(sourceId)?.ContactGUID; + targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == sourceGuid).Select(x => x.ContactId).Single(); + return true; + } + } + catch (InvalidOperationException ioex) + { + if (ioex.Message.StartsWith("Sequence contains no elements")) + { + logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + else + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + + return false; + } + finally + { + if (targetId != -1) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); + } + } + + logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); + targetId = -1; + return false; + } + + private class KeyEqualityComparerWithLambda(Func equalityComparer) : IEqualityComparer + { + public bool Equals(T? x, T? y) => equalityComparer.Invoke(x, y); + + public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; + } + + private record CmsUserKey(Guid UserGuid, string UserName); +} diff --git a/KVA/Migration.Toolkit.Source/Services/ReusableSchemaService.cs b/KVA/Migration.Tool.Source/Services/ReusableSchemaService.cs similarity index 82% rename from KVA/Migration.Toolkit.Source/Services/ReusableSchemaService.cs rename to KVA/Migration.Tool.Source/Services/ReusableSchemaService.cs index 384d5f92..ef34de15 100644 --- a/KVA/Migration.Toolkit.Source/Services/ReusableSchemaService.cs +++ b/KVA/Migration.Tool.Source/Services/ReusableSchemaService.cs @@ -5,12 +5,12 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Helpers; +using Migration.Tool.Common; +using Migration.Tool.Common.Helpers; -namespace Migration.Toolkit.Source.Services; +namespace Migration.Tool.Source.Services; -public class ReusableSchemaService(ILogger logger, ToolkitConfiguration configuration) +public class ReusableSchemaService(ILogger logger, ToolConfiguration configuration) { private readonly IReusableFieldSchemaManager reusableFieldSchemaManager = Service.Resolve(); @@ -84,9 +84,29 @@ public void AddReusableSchemaToDataClass(DataClassInfo dataClassInfo, Guid reusa dataClassInfo.ClassFormDefinition = formInfo.GetXmlDefinition(); } - public Guid EnsureReusableFieldSchema(string name, string displayName, string description, params FormFieldInfo[] fields) + public void AddReusableSchemaToDataClass(DataClassInfo dataClassInfo, string reusableFieldSchemaName) { - var reusableSchemaGuid = GuidHelper.CreateReusableSchemaGuid($"{name}|{displayName}"); + var formInfo = new FormInfo(dataClassInfo.ClassFormDefinition); + var schema = reusableFieldSchemaManager.Get(reusableFieldSchemaName); + formInfo.AddFormItem(new FormSchemaInfo { Name = dataClassInfo.ClassName, Guid = schema.Guid }); + dataClassInfo.ClassFormDefinition = formInfo.GetXmlDefinition(); + } + + public IEnumerable GetFieldsFromReusableSchema(DataClassInfo dataClassInfo) + { + var formInfo = new FormInfo(dataClassInfo.ClassFormDefinition); + foreach (var formSchemaInfo in formInfo.GetFields()) + { + foreach (var formFieldInfo in reusableFieldSchemaManager.GetSchemaFields(formSchemaInfo.Name)) + { + yield return formFieldInfo; + } + } + } + + public Guid EnsureReusableFieldSchema(string name, string displayName, string? description, params FormFieldInfo[] fields) + { + var reusableSchemaGuid = GuidHelper.CreateReusableSchemaGuid($"{name}"); var schema = reusableFieldSchemaManager.Get(reusableSchemaGuid); if (schema == null) { diff --git a/KVA/Migration.Toolkit.Source/Services/SpoiledGuidContext.cs b/KVA/Migration.Tool.Source/Services/SpoiledGuidContext.cs similarity index 96% rename from KVA/Migration.Toolkit.Source/Services/SpoiledGuidContext.cs rename to KVA/Migration.Tool.Source/Services/SpoiledGuidContext.cs index a65750cb..2fbcab54 100644 --- a/KVA/Migration.Toolkit.Source/Services/SpoiledGuidContext.cs +++ b/KVA/Migration.Tool.Source/Services/SpoiledGuidContext.cs @@ -4,12 +4,12 @@ using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Source.Model; +using Migration.Tool.Common; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.Services; +using Migration.Tool.Source.Model; -namespace Migration.Toolkit.Source.Services; +namespace Migration.Tool.Source.Services; /// /// in cases where consumer exported site with documents and created new site with that particular export, GUID diff --git a/KVA/Migration.Toolkit.Source/Behaviors/CommandConstraintBehavior.cs b/KVA/Migration.Toolkit.Source/Behaviors/CommandConstraintBehavior.cs deleted file mode 100644 index d9228b24..00000000 --- a/KVA/Migration.Toolkit.Source/Behaviors/CommandConstraintBehavior.cs +++ /dev/null @@ -1,107 +0,0 @@ -using MediatR; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Behaviors; - -public class CommandConstraintBehavior( - ILogger> logger, - IMigrationProtocol protocol, - ModelFacade modelFacade) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) - { - try - { - bool criticalCheckPassed = PerformChecks(request); - if (!criticalCheckPassed) - { - return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); - } - } - catch (Exception ex) - { - protocol.CommandError(ex, request); - logger.LogCritical(ex, "Error occured while checking command constraints"); - return (TResponse)(CommandResult)new CommandCheckFailedResult(false); - } - - return await next(); - } - - private bool PerformChecks(TRequest request) - { - bool criticalCheckPassed = true; - - var sourceSites = modelFacade.SelectAll() - .ToList(); - - foreach (var site in sourceSites) - { - criticalCheckPassed &= CheckSite(sourceSites, site.SiteID); - } - - - if (request is ICultureReliantCommand cultureReliantCommand) - { - var cultures = modelFacade.SelectAll().ToList(); - var siteCultures = modelFacade.SelectAll().ToList(); - criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites, cultures, siteCultures); - } - - return criticalCheckPassed; - } - - private bool CheckSite(List sourceSites, int sourceSiteId) - { - bool criticalCheckPassed = true; - if (sourceSites.All(s => s.SiteID != sourceSiteId)) - { - var supportedSites = sourceSites.Select(x => new { x.SiteName, x.SiteID }).ToArray(); - string supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); - logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, - supportedSitesStr); - protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") - .WithMessage("Check program argument '--siteId'") - .WithData(new { sourceSiteId, AvailableSites = supportedSites })); - criticalCheckPassed = false; - } - - return criticalCheckPassed; - } - - private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites, List cultures, List cmsSiteCultures) - { - bool criticalCheckPassed = true; - string cultureCode = cultureReliantCommand.CultureCode; - - foreach (var site in sourceSites) - { - string?[] siteCultures = cmsSiteCultures - .Where(x => x.SiteID == site.SiteID) - .Select(x => cultures.FirstOrDefault(c => c.CultureID == x.CultureID)?.CultureCode) - .Where(x => !string.IsNullOrWhiteSpace(x)) - .ToArray(); - - if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) - { - string supportedCultures = string.Join(", ", siteCultures); - logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, - site.SiteID, supportedCultures); - protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") - .WithMessage("Check program argument '--culture'") - .WithData(new { cultureCode, site.SiteID, SiteCultures = supportedCultures })); - criticalCheckPassed = false; - } - } - - return criticalCheckPassed; - } -} diff --git a/KVA/Migration.Toolkit.Source/Behaviors/RequestHandlingBehavior.cs b/KVA/Migration.Toolkit.Source/Behaviors/RequestHandlingBehavior.cs deleted file mode 100644 index 82407e94..00000000 --- a/KVA/Migration.Toolkit.Source/Behaviors/RequestHandlingBehavior.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Diagnostics; - -using MediatR; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; - -namespace Migration.Toolkit.Source.Behaviors; - -public class RequestHandlingBehavior( - ILogger> logger, - IMigrationProtocol protocol) : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) - { - var sw = Stopwatch.StartNew(); - logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); - try - { - protocol.CommandRequest(request); - var response = await next(); - protocol.CommandFinished(request, response); - return response; - } - catch (Exception ex) - { - protocol.CommandError(ex, request); - logger.LogError(ex, "Error occured"); - throw; - } - finally - { - logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); - } - } -} diff --git a/KVA/Migration.Toolkit.Source/Behaviors/XbKApiContextBehavior.cs b/KVA/Migration.Toolkit.Source/Behaviors/XbKApiContextBehavior.cs deleted file mode 100644 index f2a87906..00000000 --- a/KVA/Migration.Toolkit.Source/Behaviors/XbKApiContextBehavior.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CMS.Base; -using CMS.Membership; - -using MediatR; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; - -namespace Migration.Toolkit.Source.Behaviors; - -public class XbKApiContextBehavior( - ILogger> logger, - IMigrationProtocol protocol, - KxpApiInitializer initializer) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) - { - initializer.EnsureApiIsInitialized(); - - var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); - if (defaultAdmin == null) - { - protocol.Append(HandbookReferences - .MissingRequiredDependency() - .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") - ); - throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); - } - - using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) - { - logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); - return await next(); - } - } -} diff --git a/KVA/Migration.Toolkit.Source/Contexts/PrimaryKeyMappingContext.cs b/KVA/Migration.Toolkit.Source/Contexts/PrimaryKeyMappingContext.cs deleted file mode 100644 index 4647025e..00000000 --- a/KVA/Migration.Toolkit.Source/Contexts/PrimaryKeyMappingContext.cs +++ /dev/null @@ -1,287 +0,0 @@ -using System.Diagnostics; -using System.Linq.Expressions; -using System.Reflection; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Source.Services; - -namespace Migration.Toolkit.Source.Contexts; - -public class PrimaryKeyMappingContext( - ILogger logger, - IPrimaryKeyLocatorService primaryKeyLocatorService, - ToolkitConfiguration toolkitConfiguration) - : IPrimaryKeyMappingContext -{ - private readonly Dictionary mappingCache = new(StringComparer.OrdinalIgnoreCase); - - public void SetMapping(Type type, string keyName, int sourceId, int targetId) - { - Debug.Assert(sourceId > 0, "sourceId > 0"); - Debug.Assert(targetId > 0, "targetId > 0"); - - var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) - .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); - - Debug.Assert(foundProp != null, "foundProp != null"); - - string fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; - - mappingCache[fullKeyName] = targetId; - logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); - } - - public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) - { - string fullKeyName = CreateKey(keyNameSelector, sourceId); - mappingCache[fullKeyName] = targetId; - logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); - } - - public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) - { - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sourceId); - if (sourceId == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (mappingCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out int targetId)) - { - SetMapping(keyNameSelector, sourceId, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, "Target entity is missing"); - } - - public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) - { - targetIdResult = -1; - if (sourceId is not int sid) - { - return false; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - targetIdResult = explicitlyMappedId; - return true; - } - - if (mappingCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - targetIdResult = resultId; - return true; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - targetIdResult = targetId; - return true; - } - - return false; - } - - public int? MapFromSource(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (mappingCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, "Target entity is missing"); - } - - public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (mappingCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - return null; - } - - public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return new MapSourceIdResult(true, null); - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return new MapSourceIdResult(true, null); - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return new MapSourceIdResult(true, explicitlyMappedId); - } - - if (mappingCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return new MapSourceIdResult(true, resultId); - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return new MapSourceIdResult(true, targetId); - } - - return new MapSourceIdResult(false, null); - } - - public void PreloadDependencies(Expression> keyNameSelector) - { - foreach ((int sourceId, int targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) - { - SetMapping(keyNameSelector, sourceId, targetId); - } - } - - public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return true; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - return true; - } - - if (GetExplicitMappingOrNull(memberName, sid) is not null) - { - return true; - } - - if (mappingCache.TryGetValue(fullKeyName, out _)) - { - return true; - } - - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) - { - return true; - } - - return false; - } - - private int? GetExplicitMappingOrNull(string memberName, int? sourceId) - { - if (sourceId == null) - { - return null; - } - - var mappings = toolkitConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; - if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) - { - return memberMappings.GetValueOrDefault($"{sourceId}"); - } - - return null; - } - - private static string CreateKey(Expression> keyNameSelector, int sourceId) => $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; -} diff --git a/KVA/Migration.Toolkit.Source/Exceptions.cs b/KVA/Migration.Toolkit.Source/Exceptions.cs deleted file mode 100644 index 213fc741..00000000 --- a/KVA/Migration.Toolkit.Source/Exceptions.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Migration.Toolkit.Source; - -public class MappingFailureException(string keyName, string reason) : InvalidOperationException($"Key '{keyName}' mapping failed: {reason}") -{ - public string KeyName { get; } = keyName; - public string Reason { get; } = reason; -} diff --git a/KVA/Migration.Toolkit.Source/Extensions.cs b/KVA/Migration.Toolkit.Source/Extensions.cs deleted file mode 100644 index 35f77f33..00000000 --- a/KVA/Migration.Toolkit.Source/Extensions.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using System.Text; - -using Kentico.Xperience.UMT.Services; - -using Microsoft.Extensions.Logging; - -namespace Migration.Toolkit.Source; - -public static class Extensions -{ - public static async Task> AssertSuccess(this Task resultTask, ILogger logger) - { - switch (await resultTask) - { - case { Success: true, Imported: TResult info }: - { - return new AssertSuccessResult(true, info); - } - case { } result: - { - var sb = new StringBuilder(); - if (result.ModelValidationResults is { } validationResults) - { - validationResults.ForEach(vr => sb.Append($"[{string.Join(",", vr.MemberNames)}]: {vr.ErrorMessage}")); - } - - if (result.Exception is { } exception) - { - logger.LogError(exception, "Error occured while importing entity {ValidationErrors}", sb); - } - - return new AssertSuccessResult(false, default); - } - default: - throw new NotImplementedException("Undefined state"); - } - } - - public record AssertSuccessResult( - [property: MemberNotNullWhen(true, "Info")] bool Success, - TResult? Info - ); -} diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateMediaLibrariesCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigrateMediaLibrariesCommandHandler.cs deleted file mode 100644 index bd7901ad..00000000 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateMediaLibrariesCommandHandler.cs +++ /dev/null @@ -1,14 +0,0 @@ -using MediatR; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Source.Services; - -namespace Migration.Toolkit.Source.Handlers; - -public class MigrateMediaLibrariesCommandHandler( - IMediaFileMigrator mediaFileMigrator - ) - : IRequestHandler -{ - public async Task Handle(MigrateMediaLibrariesCommand request, CancellationToken cancellationToken) => await mediaFileMigrator.Handle(request, cancellationToken); -} diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigratePageTypesCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigratePageTypesCommandHandler.cs deleted file mode 100644 index fda271bb..00000000 --- a/KVA/Migration.Toolkit.Source/Handlers/MigratePageTypesCommandHandler.cs +++ /dev/null @@ -1,182 +0,0 @@ -using CMS.ContentEngine; -using CMS.DataEngine; - -using MediatR; - -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Models; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services; - -namespace Migration.Toolkit.Source.Handlers; - -public class MigratePageTypesCommandHandler( - ILogger logger, - IEntityMapper dataClassMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - KxpClassFacade kxpClassFacade, - IProtocol protocol, - ToolkitConfiguration toolkitConfiguration, - ModelFacade modelFacade, - PageTemplateMigrator pageTemplateMigrator, - ReusableSchemaService reusableSchemaService -) - : IRequestHandler -{ - private const string CLASS_CMS_ROOT = "CMS.Root"; - - public async Task Handle(MigratePageTypesCommand request, CancellationToken cancellationToken) - { - var entityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); - - using var ksClasses = EnumerableHelper.CreateDeferrableItemWrapper( - modelFacade.Select("ClassIsDocumentType=1", "ClassID") - .OrderBy(x => x.ClassID) - ); - - while (ksClasses.GetNext(out var di)) - { - var (_, ksClass) = di; - - if (ksClass.ClassInheritsFromClassID is { } classInheritsFromClassId && !primaryKeyMappingContext.HasMapping(c => c.ClassID, classInheritsFromClassId)) - { - // defer migration to later stage - if (ksClasses.TryDeferItem(di)) - { - logger.LogTrace("Class {Class} inheritance parent not found, deferring migration to end. Attempt {Attempt}", Printer.GetEntityIdentityPrint(ksClass), di.Recurrence); - } - else - { - logger.LogErrorMissingDependency(ksClass, nameof(ksClass.ClassInheritsFromClassID), ksClass.ClassInheritsFromClassID, typeof(DataClassInfo)); - protocol.Append(HandbookReferences - .MissingRequiredDependency(nameof(CmsClass.ClassId), classInheritsFromClassId) - .NeedsManualAction() - ); - } - - continue; - } - - protocol.FetchedSource(ksClass); - - if (entityConfiguration.ExcludeCodeNames.Contains(ksClass.ClassName, StringComparer.InvariantCultureIgnoreCase)) - { - protocol.Warning(HandbookReferences.EntityExplicitlyExcludedByCodeName(ksClass.ClassName, "PageType"), ksClass); - logger.LogInformation("CmsClass: {ClassName} was skipped => it is explicitly excluded in configuration", ksClass.ClassName); - continue; - } - - if (string.Equals(ksClass.ClassName, CLASS_CMS_ROOT, StringComparison.InvariantCultureIgnoreCase)) - { - protocol.Warning(HandbookReferences.CmsClassCmsRootClassTypeSkip, ksClass); - logger.LogInformation("CmsClass: {ClassName} was skipped => CMS.Root cannot be migrated", ksClass.ClassName); - continue; - } - - if (string.Equals(ksClass.ClassName, "cms.site", StringComparison.InvariantCultureIgnoreCase)) - { - continue; - } - - if (ksClass.ClassName.Equals("cms.folder", StringComparison.InvariantCultureIgnoreCase)) - { - if (!toolkitConfiguration.UseDeprecatedFolderPageType.GetValueOrDefault(false)) - { - logger.LogInformation("Class {Class} is deprecated, skipping", Printer.GetEntityIdentityPrint(ksClass)); - continue; - } - - logger.LogWarning("Class {Class} is deprecated, but migration is enabled with configuration flag 'UseDeprecatedFolderPageType'", Printer.GetEntityIdentityPrint(ksClass)); - } - - var kxoDataClass = kxpClassFacade.GetClass(ksClass.ClassGUID); - protocol.FetchedTarget(kxoDataClass); - - if (SaveUsingKxoApi(ksClass, kxoDataClass) is { } targetClassId) - { - foreach (var cmsClassSite in modelFacade.SelectWhere("ClassID = @classId", new SqlParameter("classId", ksClass.ClassID))) - { - if (modelFacade.SelectById(cmsClassSite.SiteID) is { SiteGUID: var siteGuid }) - { - if (ChannelInfoProvider.ProviderObject.Get(siteGuid) is { ChannelID: var channelId }) - { - var info = new ContentTypeChannelInfo { ContentTypeChannelChannelID = channelId, ContentTypeChannelContentTypeID = targetClassId }; - ContentTypeChannelInfoProvider.ProviderObject.Set(info); - } - else - { - logger.LogWarning("Channel for site with SiteGUID '{SiteGuid}' not found", siteGuid); - } - } - else - { - logger.LogWarning("Source site with SiteID '{SiteId}' not found", cmsClassSite.SiteID); - } - } - } - } - - await MigratePageTemplateConfigurations(); - - return new GenericCommandResult(); - } - - private async Task MigratePageTemplateConfigurations() - { - if (modelFacade.IsAvailable()) - { - foreach (var ksPageTemplateConfiguration in modelFacade.SelectAll()) - { - await pageTemplateMigrator.MigratePageTemplateConfigurationAsync(ksPageTemplateConfiguration); - } - } - } - - private int? SaveUsingKxoApi(ICmsClass ksClass, DataClassInfo kxoDataClass) - { - var mapped = dataClassMapper.Map(ksClass, kxoDataClass); - protocol.MappedTarget(mapped); - - try - { - if (mapped is { Success: true }) - { - (var dataClassInfo, bool newInstance) = mapped; - ArgumentNullException.ThrowIfNull(dataClassInfo, nameof(dataClassInfo)); - - if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(dataClassInfo.ClassName)) - { - dataClassInfo = reusableSchemaService.ConvertToReusableSchema(dataClassInfo); - } - - kxpClassFacade.SetClass(dataClassInfo); - - protocol.Success(ksClass, dataClassInfo, mapped); - logger.LogEntitySetAction(newInstance, dataClassInfo); - - primaryKeyMappingContext.SetMapping( - r => r.ClassId, - ksClass.ClassID, - dataClassInfo.ClassID - ); - - return dataClassInfo.ClassID; - } - } - catch (Exception ex) - { - logger.LogError(ex, "Error while saving page type {ClassName}", ksClass.ClassName); - } - - return null; - } -} diff --git a/KVA/Migration.Toolkit.Source/Helpers/KenticoHelper.cs b/KVA/Migration.Toolkit.Source/Helpers/KenticoHelper.cs deleted file mode 100644 index e0bc02cd..00000000 --- a/KVA/Migration.Toolkit.Source/Helpers/KenticoHelper.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Globalization; -using CMS.Helpers; -using Microsoft.Data.SqlClient; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Helpers; - -public static class KenticoHelper -{ - public static void CopyCustomData(ContainerCustomData target, string? sourceXml) - { - var customNodeData = new ContainerCustomData(); - customNodeData.LoadData(sourceXml); - foreach (string? columnName in customNodeData.ColumnNames) - { - target.SetValue(columnName, customNodeData.GetValue(columnName)); - } - } - - public static string? GetSettingsKey(ModelFacade facade, int? siteId, string keyName) - { - var keys = facade.Select("KeyName = @keyName", "SiteID", new SqlParameter("keyName", keyName)).ToList(); - return (keys.FirstOrDefault(x => x.SiteID == siteId) - ?? keys.FirstOrDefault(x => x.SiteID == null))?.KeyValue; - } - - public static T? GetSettingsKey(ModelFacade facade, int? siteId, string keyName) where T : struct, IParsable - { - var keys = facade.Select("KeyName = @keyName", "SiteID", new SqlParameter("keyName", keyName)).ToList(); - string? value = (keys.FirstOrDefault(x => x.SiteID == siteId) - ?? keys.FirstOrDefault(x => x.SiteID == null))?.KeyValue; - - - return T.TryParse(value, CultureInfo.InvariantCulture, out var result) - ? result - : null; - } -} diff --git a/KVA/Migration.Toolkit.Source/Helpers/PrintHelper.cs b/KVA/Migration.Toolkit.Source/Helpers/PrintHelper.cs deleted file mode 100644 index c2bf9524..00000000 --- a/KVA/Migration.Toolkit.Source/Helpers/PrintHelper.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Migration.Toolkit.Source.Helpers; - -public static class PrintHelper -{ - public static string PrintDictionary(Dictionary dictionary) => - string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); -} diff --git a/KVA/Migration.Toolkit.Source/Helpers/Printer.cs b/KVA/Migration.Toolkit.Source/Helpers/Printer.cs deleted file mode 100644 index 021efae8..00000000 --- a/KVA/Migration.Toolkit.Source/Helpers/Printer.cs +++ /dev/null @@ -1,107 +0,0 @@ -using CMS.DataEngine; -using CMS.FormEngine; -using CMS.Globalization; -using CMS.MediaLibrary; -using CMS.Membership; -using CMS.Modules; -using CMS.Websites; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.KXP.Models; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Helpers; - -public class Printer -{ - public static string PrintKxpModelInfo(T model) - { - string currentTypeName = ReflectionHelper.CurrentType.Name; - - return model switch - { - MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", - MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", - CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", - CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", - CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", - CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", - CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", - CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", - OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", - - null => $"{currentTypeName}: ", - _ => $"TODO: {typeof(T).FullName}" - }; - } - - public static string GetEntityIdentityPrint(T model, bool printType = true) - { - string currentTypeName = ReflectionHelper.CurrentType.Name; - - string Fallback(object obj) => printType - ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" - : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}"; - - string FormatModel(string inner) => printType - ? $"{currentTypeName}({inner})" - : $"{inner}"; - - return model switch - { - MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), - MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), - DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), - - CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), - StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), - - ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), - AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), - UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), - RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), - MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), - WebPageFormerUrlPathInfo item => FormatModel($"ID={item.WebPageFormerUrlPathID}, Guid=N/A Name={item.WebPageFormerUrlPath}"), - - CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), - CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), - CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), - - CmsPageTemplateConfigurationK11 item => FormatModel($"Item not exists in K11 {item}"), - CmsPageTemplateConfigurationK12 item => FormatModel($"ID={item.PageTemplateConfigurationID}, GUID={item.PageTemplateConfigurationGUID}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteID}"), - CmsPageTemplateConfigurationK13 item => FormatModel($"ID={item.PageTemplateConfigurationID}, GUID={item.PageTemplateConfigurationGUID}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteID}"), - ICmsRole item => FormatModel($"ID={item.RoleID}, GUID={item.RoleGUID}, Name={item.RoleName}, SiteId={item.SiteID}"), - ICmsAttachment item => FormatModel($"ID={item.AttachmentID}, GUID={item.AttachmentGUID}, Name={item.AttachmentName}"), - ICmsClass item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), - ICmsConsent item => FormatModel($"ID={item.ConsentID}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - ICmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveID}, GUID={item.ConsentArchiveGuid}"), - ICmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementID}, GUID={item.ConsentAgreementGuid}"), - ICmsCountry item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), - ICmsState item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), - ICmsTree item => FormatModel($"NodeID={item.NodeID}, NodeGUID={item.NodeGUID}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), - ICmsDocument item => FormatModel($"NodeID={item.DocumentNodeID}, DocumentID={item.DocumentID}, DocumentGUID={item.DocumentGUID}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), - ICmsResource item => FormatModel($"ID={item.ResourceID}, GUID={item.ResourceGUID}, Name={item.ResourceName}"), - - null => $" ref of {currentTypeName}", - _ => Fallback(model) - }; - } - - public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); - - public static string PrintEnumValues(string separator) where TEnum : struct, Enum => string.Join(separator, Enum.GetValues()); -} - -public class PrintService : IPrintService -{ - public string PrintKxpModelInfo(T model) => Printer.PrintKxpModelInfo(model); - - public string GetEntityIdentityPrint(T model, bool printType = true) => Printer.GetEntityIdentityPrint(model, printType); - - public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => Printer.GetEntityIdentityPrints(models, separator); - - public string PrintEnumValues(string separator) where TEnum : struct, Enum => Printer.PrintEnumValues(separator); -} diff --git a/KVA/Migration.Toolkit.Source/Mappers/AlternativeFormMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/AlternativeFormMapper.cs deleted file mode 100644 index df043c3f..00000000 --- a/KVA/Migration.Toolkit.Source/Mappers/AlternativeFormMapper.cs +++ /dev/null @@ -1,100 +0,0 @@ -using CMS.DataEngine; -using CMS.FormEngine; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api.Services.CmsClass; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Mappers; - -public record AlternativeFormMapperSource(ICmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); - -public class AlternativeFormMapper( - ILogger logger, - PrimaryKeyMappingContext pkContext, - IProtocol protocol, - FieldMigrationService fieldMigrationService, - ModelFacade modelFacade -) - : EntityMapperBase(logger, pkContext, protocol) -{ - protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - => AlternativeFormInfo.New(); - - protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (source, xbkFormClass) = sourceObj; - - target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassID, source.FormClassID, out int? classId) - ? classId ?? 0 - : 0; - target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassID, source.FormCoupledClassID, out int? coupledClassId) - ? coupledClassId ?? 0 - : 0; - - var formCoupledClass = modelFacade.SelectById(source.FormCoupledClassID); - var formClass = modelFacade.SelectById(source.FormClassID); - - bool coupledClassIsDeprecated = - formCoupledClass?.ClassName is { } coupledClassName && - K12SystemClass.NoLongerSupported.Contains(coupledClassName); - - bool classIsSysInternal = K12SystemClass.All.Contains(formClass.ClassName); - - string mergedDefinition = formClass.ClassFormDefinition; - if (formCoupledClass != null) - { - logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", formCoupledClass.ClassName, formClass.ClassName); - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, formCoupledClass.ClassFormDefinition); - } - - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); - - var patcher = new FormDefinitionPatcher( - logger, - mergedDefinition, - fieldMigrationService, - formClass.ClassIsForm.GetValueOrDefault(false), - formClass.ClassIsDocumentType, - false, - !classIsSysInternal, - true - ); - - var fieldNames = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); - - patcher.PatchFields(); - - var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); - - if (coupledClassIsDeprecated && formCoupledClass != null) - { - logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", formCoupledClass.ClassName); - patcher.RemoveFields(formCoupledClass.ClassFormDefinition); - - var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); - } - - string result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); - - string formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); - - target.FormDefinition = formDefinitionDifference; - - target.FormDisplayName = source.FormDisplayName; - target.FormGUID = source.FormGUID; - target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); - target.FormLastModified = source.FormLastModified; - target.FormName = source.FormName; - - return target; - } -} diff --git a/KVA/Migration.Toolkit.Source/Mappers/CmsAttachmentMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/CmsAttachmentMapper.cs deleted file mode 100644 index b9df0d81..00000000 --- a/KVA/Migration.Toolkit.Source/Mappers/CmsAttachmentMapper.cs +++ /dev/null @@ -1,55 +0,0 @@ -using CMS.Base; -using CMS.MediaLibrary; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Mappers; - -public record CmsAttachmentMapperSource(ICmsAttachment Attachment, Guid NewAttachmentGuid, int TargetLibraryId, IUploadedFile File, string LibrarySubFolder, ICmsTree? AttachmentNode); - -public class CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) - : EntityMapperBase(logger, pkContext, protocol) -{ - private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; - - protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => - // library name is generated with site name in it - new(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); - - protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - (var cmsAttachment, var newAttachmentGuid, int targetLibraryId, _, _, var attachmentNode) = args; - - target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); - target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; - target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; - target.FileExtension = cmsAttachment.AttachmentExtension; - target.FileMimeType = cmsAttachment.AttachmentMimeType; - target.FileSize = cmsAttachment.AttachmentSize; - target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; - target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; - target.FileGUID = newAttachmentGuid; - target.FileLibraryID = targetLibraryId; - - // target.FileCreatedByUserID = cmsAttachment.?; - // target.FileModifiedByUserID = cmsAttachment.?; - // target.FileCreatedWhen = cmsAttachment.?; - - target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; - - KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); - - if (attachmentNode != null) - { - target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentNode.NodeAliasPath); - } - - return target; - } -} diff --git a/KVA/Migration.Toolkit.Source/Mappers/CmsFormMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/CmsFormMapper.cs deleted file mode 100644 index f38ed79a..00000000 --- a/KVA/Migration.Toolkit.Source/Mappers/CmsFormMapper.cs +++ /dev/null @@ -1,133 +0,0 @@ -using CMS.FormEngine; -using CMS.OnlineForms; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Models; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Mappers; - -public class CmsFormMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override BizFormInfo? CreateNewInstance(ICmsForm source, MappingHelper mappingHelper, AddFailure addFailure) - { - var newBizFormInfo = BizFormInfo.New(); - newBizFormInfo.FormGUID = source.FormGUID; - return newBizFormInfo; - } - - protected override BizFormInfo MapInternal(ICmsForm source, BizFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.FormDisplayName = source.FormDisplayName; - target.FormName = source.FormName; - target.FormItems = source.FormItems; - target.FormReportFields = source.FormReportFields; - target.FormSubmitButtonText = source.FormSubmitButtonText; - target.FormAccess = source.FormAccess.AsEnum(); - target.FormSubmitButtonImage = source.FormSubmitButtonImage; - target.FormLastModified = source.FormLastModified; - switch (source) - { - case CmsFormK11 s: - { - target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); - break; - } - case CmsFormK12 s: - { - target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); - target.FormBuilderLayout = s.FormBuilderLayout; - break; - } - case CmsFormK13 s: - { - target.FormLogActivity = s.FormLogActivity; - target.FormBuilderLayout = s.FormBuilderLayout; - break; - } - - default: - break; - } - - if (mappingHelper.TranslateRequiredId(c => c.ClassID, source.FormClassID, out int formClassId)) - { - target.FormClassID = formClassId; - } - - return target; - } -} - -public class CmsFormMapperEf : EntityMapperBase -{ - public CmsFormMapperEf(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override CmsForm? CreateNewInstance(ICmsForm source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsForm MapInternal(ICmsForm source, CmsForm target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.FormDisplayName = source.FormDisplayName; - target.FormName = source.FormName; - // target.FormSendToEmail = source.FormSendToEmail; - // target.FormSendFromEmail = source.FormSendFromEmail; - // target.FormEmailSubject = source.FormEmailSubject; - // target.FormEmailTemplate = source.FormEmailTemplate; - // target.FormEmailAttachUploadedDocs = source.FormEmailAttachUploadedDocs; - target.FormItems = source.FormItems; - target.FormReportFields = source.FormReportFields; - target.FormSubmitButtonText = source.FormSubmitButtonText; - // target.FormConfirmationEmailField = source.FormConfirmationEmailField; - // target.FormConfirmationTemplate = source.FormConfirmationTemplate; - // target.FormConfirmationSendFromEmail = source.FormConfirmationSendFromEmail; - // target.FormConfirmationEmailSubject = source.FormConfirmationEmailSubject; - target.FormAccess = source.FormAccess; - target.FormSubmitButtonImage = source.FormSubmitButtonImage; - target.FormGuid = source.FormGUID; - target.FormLastModified = source.FormLastModified; - switch (source) - { - case CmsFormK11 s: - { - target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); - break; - } - case CmsFormK12 s: - { - target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); - target.FormBuilderLayout = s.FormBuilderLayout; - break; - } - case CmsFormK13 s: - { - target.FormLogActivity = s.FormLogActivity; - target.FormBuilderLayout = s.FormBuilderLayout; - break; - } - - default: - break; - } - - // TODO tk: 2022-05-20 new deduce: target.FormAfterSubmitMode = source.FormAfterSubmitMode; - // TODO tk: 2022-05-20 new deduce: target.FormAfterSubmitRelatedValue = source.FormAfterSubmitRelatedValue; - - if (mappingHelper.TranslateRequiredId(c => c.ClassID, source.FormClassID, out int classId)) - { - target.FormClassId = classId; - } - - return target; - } -} diff --git a/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs deleted file mode 100644 index 4012c8fd..00000000 --- a/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs +++ /dev/null @@ -1,1163 +0,0 @@ -using System.Diagnostics; -using CMS.ContentEngine; -using CMS.ContentEngine.Internal; -using CMS.Core; -using CMS.Core.Internal; -using CMS.FormEngine; -using CMS.MediaLibrary; -using CMS.Websites; -using CMS.Websites.Internal; -using Kentico.Xperience.UMT.Model; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Api.Auxiliary; -using Migration.Toolkit.KXP.Api.Services.CmsClass; -using Migration.Toolkit.Source.Auxiliary; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services; -using Migration.Toolkit.Source.Services.Model; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Migration.Toolkit.Source.Mappers; - -public record CmsTreeMapperSource( - ICmsTree CmsTree, - string SafeNodeName, - Guid SiteGuid, - Guid? NodeParentGuid, - Dictionary CultureToLanguageGuid, - string? TargetFormDefinition, - string SourceFormDefinition, - List MigratedDocuments, - ICmsSite SourceSite -); - -public class ContentItemMapper( - ILogger logger, - CoupledDataService coupledDataService, - ClassService classService, - IAttachmentMigrator attachmentMigrator, - CmsRelationshipService relationshipService, - SourceInstanceContext sourceInstanceContext, - FieldMigrationService fieldMigrationService, - KxpMediaFileFacade mediaFileFacade, - ModelFacade modelFacade, - ReusableSchemaService reusableSchemaService, - DeferredPathService deferredPathService, - SpoiledGuidContext spoiledGuidContext, - EntityIdentityFacade entityIdentityFacade, - IAssetFacade assetFacade, - ToolkitConfiguration configuration, - MediaLinkServiceFactory mediaLinkServiceFactory -) : UmtMapperBase -{ - private const string CLASS_FIELD_CONTROL_NAME = "controlname"; - - protected override IEnumerable MapInternal(CmsTreeMapperSource source) - { - (var cmsTree, string safeNodeName, var siteGuid, var nodeParentGuid, var cultureToLanguageGuid, string targetFormDefinition, string sourceFormDefinition, var migratedDocuments, var sourceSite) = source; - - logger.LogTrace("Mapping {Value}", new { cmsTree.NodeAliasPath, cmsTree.NodeName, cmsTree.NodeGUID, cmsTree.NodeSiteID }); - - var nodeClass = modelFacade.SelectById(cmsTree.NodeClassID) ?? throw new InvalidOperationException($"Fatal: node class is missing, class id '{cmsTree.NodeClassID}'"); - - bool migratedAsContentFolder = nodeClass.ClassName.Equals("cms.folder", StringComparison.InvariantCultureIgnoreCase) && !configuration.UseDeprecatedFolderPageType.GetValueOrDefault(false); - - var contentItemGuid = spoiledGuidContext.EnsureNodeGuid(cmsTree.NodeGUID, cmsTree.NodeSiteID, cmsTree.NodeID); - yield return new ContentItemModel - { - ContentItemGUID = contentItemGuid, - ContentItemName = safeNodeName, - ContentItemIsReusable = false, // page is not reusable - ContentItemIsSecured = cmsTree.IsSecuredNode ?? false, - ContentItemDataClassGuid = migratedAsContentFolder ? null : nodeClass.ClassGUID, - ContentItemChannelGuid = siteGuid - }; - - var targetWebPage = WebPageItemInfo.Provider.Get() - .WhereEquals(nameof(WebPageItemInfo.WebPageItemGUID), contentItemGuid) - .FirstOrDefault(); - string? treePath = targetWebPage?.WebPageItemTreePath; - - var websiteChannelInfo = WebsiteChannelInfoProvider.ProviderObject.Get(siteGuid); - var treePathConvertor = TreePathConvertor.GetSiteConverter(websiteChannelInfo.WebsiteChannelID); - if (treePath == null) - { - (bool treePathIsDifferent, treePath) = treePathConvertor.ConvertAndEnsureUniqueness(cmsTree.NodeAliasPath).GetAwaiter().GetResult(); - if (treePathIsDifferent) - { - logger.LogInformation($"Original node alias path '{cmsTree.NodeAliasPath}' of '{cmsTree.NodeName}' item was converted to '{treePath}' since the value does not allow original range of allowed characters."); - } - } - - foreach (var cmsDocument in migratedDocuments) - { - if (!cultureToLanguageGuid.TryGetValue(cmsDocument.DocumentCulture, out var languageGuid)) - { - logger.LogWarning("Document '{DocumentGUID}' was skipped, unknown culture", cmsDocument.DocumentGUID); - continue; - } - - bool hasDraft = cmsDocument.DocumentPublishedVersionHistoryID is not null && - cmsDocument.DocumentPublishedVersionHistoryID != cmsDocument.DocumentCheckedOutVersionHistoryID; - - var checkoutVersion = hasDraft - ? modelFacade.SelectById(cmsDocument.DocumentCheckedOutVersionHistoryID) - : null; - - bool draftMigrated = false; - if (checkoutVersion is { PublishFrom: null } draftVersion && !migratedAsContentFolder) - { - List? migratedDraft = null; - try - { - migratedDraft = MigrateDraft(draftVersion, cmsTree, sourceFormDefinition, targetFormDefinition, contentItemGuid, languageGuid, nodeClass, websiteChannelInfo, sourceSite).ToList(); - draftMigrated = true; - } - catch - { - logger.LogWarning("Failed to migrate checkout version of document with DocumentID={CmsDocumentDocumentId} VersionHistoryID={CmsDocumentDocumentCheckedOutVersionHistoryId}", - cmsDocument.DocumentID, cmsDocument.DocumentCheckedOutVersionHistoryID); - draftMigrated = false; - } - - if (migratedDraft != null) - { - foreach (var umtModel in migratedDraft) - { - yield return umtModel; - } - } - } - - var versionStatus = cmsDocument switch - { - { DocumentIsArchived: true } => VersionStatus.Unpublished, - { DocumentPublishedVersionHistoryID: null, DocumentCheckedOutVersionHistoryID: null } => VersionStatus.Published, - { DocumentPublishedVersionHistoryID: { } pubId, DocumentCheckedOutVersionHistoryID: { } chId } when pubId <= chId => VersionStatus.Published, - { DocumentPublishedVersionHistoryID: null, DocumentCheckedOutVersionHistoryID: not null } => VersionStatus.InitialDraft, - _ => draftMigrated ? VersionStatus.Published : VersionStatus.InitialDraft - }; - if (migratedAsContentFolder) - { - versionStatus = VersionStatus.Published; // folder is automatically published - } - - DateTime? scheduledPublishWhen = null; - DateTime? scheduleUnpublishWhen = null; - string? contentItemCommonDataPageBuilderWidgets = null; - string? contentItemCommonDataPageTemplateConfiguration = null; - - bool ndp = false; - if (!migratedAsContentFolder) - { - if (cmsDocument.DocumentPublishFrom is { } publishFrom) - { - var now = Service.Resolve().GetDateTimeNow(); - if (publishFrom > now) - { - versionStatus = VersionStatus.Unpublished; - } - else - { - scheduledPublishWhen = publishFrom; - } - } - - if (cmsDocument.DocumentPublishTo is { } publishTo) - { - var now = Service.Resolve().GetDateTimeNow(); - if (publishTo < now) - { - versionStatus = VersionStatus.Unpublished; - } - else - { - scheduleUnpublishWhen = publishTo; - } - } - - switch (cmsDocument) - { - case CmsDocumentK11: - { - break; - } - case CmsDocumentK12 doc: - { - contentItemCommonDataPageBuilderWidgets = doc.DocumentPageBuilderWidgets; - contentItemCommonDataPageTemplateConfiguration = doc.DocumentPageTemplateConfiguration; - break; - } - case CmsDocumentK13 doc: - { - contentItemCommonDataPageBuilderWidgets = doc.DocumentPageBuilderWidgets; - contentItemCommonDataPageTemplateConfiguration = doc.DocumentPageTemplateConfiguration; - break; - } - - default: - break; - } - - PatchJsonDefinitions(source.CmsTree.NodeSiteID, ref contentItemCommonDataPageTemplateConfiguration, ref contentItemCommonDataPageBuilderWidgets, out ndp); - } - - var documentGuid = spoiledGuidContext.EnsureDocumentGuid( - cmsDocument.DocumentGUID ?? throw new InvalidOperationException("DocumentGUID is null"), - cmsTree.NodeSiteID, - cmsTree.NodeID, - cmsDocument.DocumentID - ); - - var commonDataModel = new ContentItemCommonDataModel - { - ContentItemCommonDataGUID = documentGuid, - ContentItemCommonDataContentItemGuid = contentItemGuid, - ContentItemCommonDataContentLanguageGuid = languageGuid, // DocumentCulture -> language entity needs to be created and its ID used here - ContentItemCommonDataVersionStatus = versionStatus, - ContentItemCommonDataIsLatest = !draftMigrated, // Flag for latest record to know what to retrieve for the UI - ContentItemCommonDataPageBuilderWidgets = contentItemCommonDataPageBuilderWidgets, - ContentItemCommonDataPageTemplateConfiguration = contentItemCommonDataPageTemplateConfiguration, - }; - - if (ndp) - { - deferredPathService.AddPatch( - commonDataModel.ContentItemCommonDataGUID ?? throw new InvalidOperationException("DocumentGUID is null"), - nodeClass.ClassName, - websiteChannelInfo.WebsiteChannelID - ); - } - - if (!migratedAsContentFolder) - { - var dataModel = new ContentItemDataModel { ContentItemDataGUID = commonDataModel.ContentItemCommonDataGUID, ContentItemDataCommonDataGuid = commonDataModel.ContentItemCommonDataGUID, ContentItemContentTypeName = nodeClass.ClassName }; - - var fi = new FormInfo(targetFormDefinition); - if (nodeClass.ClassIsCoupledClass) - { - var sfi = new FormInfo(sourceFormDefinition); - string primaryKeyName = ""; - foreach (var sourceFieldInfo in sfi.GetFields(true, true)) - { - if (sourceFieldInfo.PrimaryKey) - { - primaryKeyName = sourceFieldInfo.Name; - } - } - - if (string.IsNullOrWhiteSpace(primaryKeyName)) - { - throw new Exception("Error, unable to find coupled data primary key"); - } - - var commonFields = UnpackReusableFieldSchemas(fi.GetFields()).ToArray(); - var sourceColumns = commonFields - .Select(cf => ReusableSchemaService.RemoveClassPrefix(nodeClass.ClassName, cf.Name)) - .Union(fi.GetColumnNames(false)) - .Except([CmsClassMapper.GetLegacyDocumentName(fi, nodeClass.ClassName)]) - .ToList(); - - var coupledDataRow = coupledDataService.GetSourceCoupledDataRow(nodeClass.ClassTableName, primaryKeyName, cmsDocument.DocumentForeignKeyValue); - // TODO tomas.krch: 2024-09-05 propagate async to root - MapCoupledDataFieldValues(dataModel.CustomProperties, - columnName => coupledDataRow?[columnName], - columnName => coupledDataRow?.ContainsKey(columnName) ?? false, - cmsTree, cmsDocument.DocumentID, sourceColumns, sfi, fi, false, nodeClass, sourceSite - ).GetAwaiter().GetResult(); - - foreach (var formFieldInfo in commonFields) - { - string originalFieldName = ReusableSchemaService.RemoveClassPrefix(nodeClass.ClassName, formFieldInfo.Name); - if (dataModel.CustomProperties.TryGetValue(originalFieldName, out object? value)) - { - commonDataModel.CustomProperties ??= []; - logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' populated", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); - commonDataModel.CustomProperties[formFieldInfo.Name] = value; - dataModel.CustomProperties.Remove(originalFieldName); - } - else - { - logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' missing", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); - } - } - } - - if (CmsClassMapper.GetLegacyDocumentName(fi, nodeClass.ClassName) is { } legacyDocumentNameFieldName) - { - if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(nodeClass.ClassName)) - { - string fieldName = ReusableSchemaService.GetUniqueFieldName(nodeClass.ClassName, legacyDocumentNameFieldName); - commonDataModel.CustomProperties.Add(fieldName, cmsDocument.DocumentName); - } - else - { - dataModel.CustomProperties.Add(legacyDocumentNameFieldName, cmsDocument.DocumentName); - } - } - - yield return commonDataModel; - yield return dataModel; - } - - Guid? documentCreatedByUserGuid = null; - if (modelFacade.TrySelectGuid(cmsDocument.DocumentCreatedByUserID, out var createdByUserGuid)) - { - documentCreatedByUserGuid = createdByUserGuid; - } - - Guid? documentModifiedByUserGuid = null; - if (modelFacade.TrySelectGuid(cmsDocument.DocumentModifiedByUserID, out var modifiedByUserGuid)) - { - documentModifiedByUserGuid = modifiedByUserGuid; - } - - var languageMetadataInfo = new ContentItemLanguageMetadataModel - { - ContentItemLanguageMetadataGUID = documentGuid, - ContentItemLanguageMetadataContentItemGuid = contentItemGuid, - ContentItemLanguageMetadataDisplayName = cmsDocument.DocumentName, // For the admin UI only - ContentItemLanguageMetadataLatestVersionStatus = draftMigrated ? VersionStatus.Draft : versionStatus, // That's the latest status of th item for admin optimization - ContentItemLanguageMetadataCreatedWhen = cmsDocument.DocumentCreatedWhen, // DocumentCreatedWhen - ContentItemLanguageMetadataModifiedWhen = cmsDocument.DocumentModifiedWhen, // DocumentModifiedWhen - ContentItemLanguageMetadataCreatedByUserGuid = documentCreatedByUserGuid, - ContentItemLanguageMetadataModifiedByUserGuid = documentModifiedByUserGuid, - // logic inaccessible, not supported - // ContentItemLanguageMetadataHasImageAsset = ContentItemAssetHasImageArbiter.HasImage(contentItemDataInfo), // This is for admin UI optimization - set to true if latest version contains a field with an image asset - ContentItemLanguageMetadataHasImageAsset = false, - ContentItemLanguageMetadataContentLanguageGuid = languageGuid, // DocumentCulture -> language entity needs to be created and its ID used here - ContentItemLanguageMetadataScheduledPublishWhen = scheduledPublishWhen, - ContentItemLanguageMetadataScheduledUnpublishWhen = scheduleUnpublishWhen - }; - yield return languageMetadataInfo; - } - - // mapping of linked nodes is not supported - Debug.Assert(cmsTree.NodeLinkedNodeID == null, "cmsTree.NodeLinkedNodeId == null"); - Debug.Assert(cmsTree.NodeLinkedNodeSiteID == null, "cmsTree.NodeLinkedNodeSiteId == null"); - - yield return new WebPageItemModel - { - WebPageItemParentGuid = nodeParentGuid, // NULL => under root - WebPageItemGUID = contentItemGuid, - WebPageItemName = safeNodeName, - WebPageItemTreePath = treePath, - WebPageItemWebsiteChannelGuid = siteGuid, - WebPageItemContentItemGuid = contentItemGuid, - WebPageItemOrder = cmsTree.NodeOrder ?? 0 // 0 is nullish value - }; - } - - private void PatchJsonDefinitions(int sourceSiteId, ref string? pageTemplateConfiguration, ref string? pageBuilderWidgets, out bool needsDeferredPatch) - { - needsDeferredPatch = false; - if (sourceInstanceContext.HasInfo) - { - if (pageTemplateConfiguration != null) - { - var pageTemplateConfigurationObj = JsonConvert.DeserializeObject(pageTemplateConfiguration); - if (pageTemplateConfigurationObj?.Identifier != null) - { - logger.LogTrace("Walk page template configuration {Identifier}", pageTemplateConfigurationObj.Identifier); - - var pageTemplateConfigurationFcs = - sourceInstanceContext.GetPageTemplateFormComponents(sourceSiteId, pageTemplateConfigurationObj?.Identifier); - if (pageTemplateConfigurationObj.Properties is { Count: > 0 }) - { - WalkProperties(sourceSiteId, pageTemplateConfigurationObj.Properties, pageTemplateConfigurationFcs, out bool ndp); - needsDeferredPatch = ndp || needsDeferredPatch; - } - - pageTemplateConfiguration = JsonConvert.SerializeObject(pageTemplateConfigurationObj); - } - } - - if (pageBuilderWidgets != null) - { - var areas = JsonConvert.DeserializeObject(pageBuilderWidgets); - if (areas?.EditableAreas is { Count: > 0 }) - { - WalkAreas(sourceSiteId, areas.EditableAreas, out bool ndp); - needsDeferredPatch = ndp || needsDeferredPatch; - } - - pageBuilderWidgets = JsonConvert.SerializeObject(areas); - } - } - } - - private IEnumerable MigrateDraft(ICmsVersionHistory checkoutVersion, ICmsTree cmsTree, string sourceFormClassDefinition, string targetFormDefinition, Guid contentItemGuid, - Guid contentLanguageGuid, ICmsClass nodeClass, WebsiteChannelInfo websiteChannelInfo, ICmsSite sourceSite) - { - var adapter = new NodeXmlAdapter(checkoutVersion.NodeXML); - - ContentItemCommonDataModel? commonDataModel = null; - ContentItemDataModel? dataModel = null; - try - { - string? pageTemplateConfiguration = adapter.DocumentPageTemplateConfiguration; - string? pageBuildWidgets = adapter.DocumentPageBuilderWidgets; - PatchJsonDefinitions(checkoutVersion.NodeSiteID, ref pageTemplateConfiguration, ref pageBuildWidgets, out bool ndp); - - #region Find existing guid - - var contentItemCommonDataGuid = Guid.NewGuid(); - var contentItemInfo = ContentItemInfo.Provider.Get() - .WhereEquals(nameof(ContentItemInfo.ContentItemGUID), contentItemGuid) - .FirstOrDefault(); - if (contentItemInfo != null) - { - var contentItems = ContentItemCommonDataInfo.Provider.Get() - .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataContentItemID), contentItemInfo.ContentItemID) - .ToList() - ; - - var existingDraft = contentItems.FirstOrDefault(x => x.ContentItemCommonDataVersionStatus == VersionStatus.Draft); - if (existingDraft is { ContentItemCommonDataGUID: { } existingGuid }) - { - contentItemCommonDataGuid = existingGuid; - } - } - - #endregion - - commonDataModel = new ContentItemCommonDataModel - { - ContentItemCommonDataGUID = contentItemCommonDataGuid, // adapter.DocumentGUID ?? throw new InvalidOperationException($"DocumentGUID is null"), - ContentItemCommonDataContentItemGuid = contentItemGuid, - ContentItemCommonDataContentLanguageGuid = contentLanguageGuid, - ContentItemCommonDataVersionStatus = VersionStatus.Draft, - ContentItemCommonDataIsLatest = true, // Flag for latest record to know what to retrieve for the UI - ContentItemCommonDataPageBuilderWidgets = pageBuildWidgets, - ContentItemCommonDataPageTemplateConfiguration = pageTemplateConfiguration - }; - - if (ndp) - { - deferredPathService.AddPatch( - commonDataModel.ContentItemCommonDataGUID ?? throw new InvalidOperationException("DocumentGUID is null"), - nodeClass.ClassName, - websiteChannelInfo.WebsiteChannelID - ); - } - - dataModel = new ContentItemDataModel { ContentItemDataGUID = commonDataModel.ContentItemCommonDataGUID, ContentItemDataCommonDataGuid = commonDataModel.ContentItemCommonDataGUID, ContentItemContentTypeName = nodeClass.ClassName }; - - if (nodeClass.ClassIsCoupledClass) - { - var fi = new FormInfo(targetFormDefinition); - var sfi = new FormInfo(sourceFormClassDefinition); - string primaryKeyName = ""; - foreach (var sourceFieldInfo in sfi.GetFields(true, true)) - { - if (sourceFieldInfo.PrimaryKey) - { - primaryKeyName = sourceFieldInfo.Name; - } - } - - if (string.IsNullOrWhiteSpace(primaryKeyName)) - { - throw new Exception("Error, unable to find coupled data primary key"); - } - - var commonFields = UnpackReusableFieldSchemas(fi.GetFields()).ToArray(); - var sourceColumns = commonFields - .Select(cf => ReusableSchemaService.RemoveClassPrefix(nodeClass.ClassName, cf.Name)) - .Union(fi.GetColumnNames(false)) - .Except([CmsClassMapper.GetLegacyDocumentName(fi, nodeClass.ClassName)]) - .ToList(); - - // TODO tomas.krch: 2024-09-05 propagate async to root - MapCoupledDataFieldValues(dataModel.CustomProperties, - s => adapter.GetValue(s), - s => adapter.HasValueSet(s) - , cmsTree, adapter.DocumentID, sourceColumns, sfi, fi, true, nodeClass, sourceSite).GetAwaiter().GetResult(); - - foreach (var formFieldInfo in commonFields) - { - string originalFieldName = ReusableSchemaService.RemoveClassPrefix(nodeClass.ClassName, formFieldInfo.Name); - if (dataModel.CustomProperties.TryGetValue(originalFieldName, out object? value)) - { - commonDataModel.CustomProperties ??= []; - logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' populated", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); - commonDataModel.CustomProperties[formFieldInfo.Name] = value; - dataModel.CustomProperties.Remove(originalFieldName); - } - else - { - logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' missing", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); - } - } - } - - // supply document name - if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(nodeClass.ClassName)) - { - string fieldName = ReusableSchemaService.GetUniqueFieldName(nodeClass.ClassName, "DocumentName"); - commonDataModel.CustomProperties.Add(fieldName, adapter.DocumentName); - } - else - { - dataModel.CustomProperties.Add("DocumentName", adapter.DocumentName); - } - } - catch (Exception ex) - { - Debug.WriteLine($"Failed attempt to create draft from '{checkoutVersion}' {ex}"); - throw; - } - - if (dataModel != null && commonDataModel != null) - { - yield return commonDataModel; - yield return dataModel; - } - } - - private async Task MapCoupledDataFieldValues( - Dictionary target, - Func getSourceValue, - Func containsSourceValue, - ICmsTree cmsTree, - int? documentId, - List newColumnNames, - FormInfo oldFormInfo, - FormInfo newFormInfo, - bool migratingFromVersionHistory, - ICmsClass nodeClass, - ICmsSite site - ) - { - Debug.Assert(nodeClass.ClassTableName != null, "cmsTree.NodeClass.ClassTableName != null"); - - foreach (string columnName in newColumnNames) - { - if ( - columnName.Equals("ContentItemDataID", StringComparison.InvariantCultureIgnoreCase) || - columnName.Equals("ContentItemDataCommonDataID", StringComparison.InvariantCultureIgnoreCase) || - columnName.Equals("ContentItemDataGUID", StringComparison.InvariantCultureIgnoreCase) || - columnName.Equals(CmsClassMapper.GetLegacyDocumentName(newFormInfo, nodeClass.ClassName), StringComparison.InvariantCultureIgnoreCase) - ) - { - logger.LogTrace("Skipping '{FieldName}'", columnName); - continue; - } - -#pragma warning disable CS0618 // Type or member is obsolete - if (oldFormInfo.GetFormField(columnName)?.External is true) -#pragma warning restore CS0618 // Type or member is obsolete - { - logger.LogTrace("Skipping '{FieldName}' - is external", columnName); - continue; - } - - if (!containsSourceValue(columnName)) - { - if (migratingFromVersionHistory) - { - logger.LogDebug("Value is not contained in source, field '{Field}' (possibly because version existed before field was added to class form)", columnName); - } - else - { - logger.LogWarning("Value is not contained in source, field '{Field}'", columnName); - } - - continue; - } - - - var field = oldFormInfo.GetFormField(columnName); - string? controlName = field.Settings[CLASS_FIELD_CONTROL_NAME]?.ToString()?.ToLowerInvariant(); - - object? value = getSourceValue(columnName); - target[columnName] = value; - - var fieldMigration = fieldMigrationService.GetFieldMigration(field.DataType, controlName, columnName); - if (fieldMigration?.Actions?.Contains(TcaDirective.ConvertToAsset) ?? false) - { - await ConvertToAsset(target, cmsTree, documentId, value, columnName, controlName, field, fieldMigration, site); - continue; - } - - if (controlName != null) - { - if (fieldMigration.Actions?.Contains(TcaDirective.ConvertToPages) ?? false) - { - // relation to other document - var convertedRelation = relationshipService.GetNodeRelationships(cmsTree.NodeID, nodeClass.ClassName, field.Guid) - .Select(r => new WebPageRelatedItem { WebPageGuid = spoiledGuidContext.EnsureNodeGuid(r.RightNode.NodeGUID, r.RightNode.NodeSiteID, r.RightNode.NodeID) }); - - target.SetValueAsJson(columnName, convertedRelation); - } - else - { - // leave as is - target[columnName] = value; - } - - if (fieldMigration.TargetFormComponent == "webpages") - { - if (value is string pageReferenceJson) - { - var parsed = JObject.Parse(pageReferenceJson); - foreach (var jToken in parsed.DescendantsAndSelf()) - { - if (jToken.Path.EndsWith("NodeGUID", StringComparison.InvariantCultureIgnoreCase)) - { - var patchedGuid = spoiledGuidContext.EnsureNodeGuid(jToken.Value(), cmsTree.NodeSiteID); - jToken.Replace(JToken.FromObject(patchedGuid)); - } - } - - target[columnName] = parsed.ToString().Replace("\"NodeGuid\"", "\"WebPageGuid\""); - } - } - } - else - { - target[columnName] = value; - } - - - var newField = newFormInfo.GetFormField(columnName); - if (newField == null) - { - var commonFields = UnpackReusableFieldSchemas(newFormInfo.GetFields()).ToArray(); - newField = commonFields - .FirstOrDefault(cf => ReusableSchemaService.RemoveClassPrefix(nodeClass.ClassName, cf.Name).Equals(columnName, StringComparison.InvariantCultureIgnoreCase)); - } - string? newControlName = newField?.Settings[CLASS_FIELD_CONTROL_NAME]?.ToString()?.ToLowerInvariant(); - if (newControlName?.Equals(FormComponents.AdminRichTextEditorComponent, StringComparison.InvariantCultureIgnoreCase) == true && target[columnName] is string { } html && !string.IsNullOrWhiteSpace(html) && - !configuration.MigrateMediaToMediaLibrary) - { - var mediaLinkService = mediaLinkServiceFactory.Create(); - var htmlProcessor = new HtmlProcessor(html, mediaLinkService); - - target[columnName] = await htmlProcessor.ProcessHtml(site.SiteID, async (result, original) => - { - switch (result) - { - case { LinkKind: MediaLinkKind.Guid or MediaLinkKind.DirectMediaPath, MediaKind: MediaKind.MediaFile }: - { - var mediaFile = MediaHelper.GetMediaFile(result, modelFacade); - if (mediaFile is null) - { - return original; - } - - return assetFacade.GetAssetUri(mediaFile); - } - case { LinkKind: MediaLinkKind.Guid, MediaKind: MediaKind.Attachment, MediaGuid: { } mediaGuid, LinkSiteId: var linkSiteId }: - { - var attachment = MediaHelper.GetAttachment(result, modelFacade); - if (attachment is null) - { - return original; - } - - await attachmentMigrator.MigrateAttachment(attachment); - - string? culture = null; - if (attachment.AttachmentDocumentID is { } attachmentDocumentId) - { - culture = modelFacade.SelectById(attachmentDocumentId)?.DocumentCulture; - } - - return assetFacade.GetAssetUri(attachment, culture); - } - - default: - break; - } - - return original; - }); - } - } - } - - private async Task ConvertToAsset(Dictionary target, ICmsTree cmsTree, int? documentId, object? value, string columnName, string? controlName, FormFieldInfo field, FieldMigration fieldMigration, ICmsSite site) - { - List mfis = []; - bool hasMigratedAsset = false; - if (value is string link && - mediaLinkServiceFactory.Create().MatchMediaLink(link, site.SiteID) is (true, var mediaLinkKind, var mediaKind, var path, var mediaGuid, var linkSiteId, var libraryDir) result) - { - if (mediaLinkKind == MediaLinkKind.Path) - { - // path needs to be converted to GUID - if (mediaKind == MediaKind.Attachment && path != null) - { - switch (await attachmentMigrator.TryMigrateAttachmentByPath(path, $"__{columnName}")) - { - case MigrateAttachmentResultMediaFile(true, _, var x, _): - { - mfis = [new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }]; - hasMigratedAsset = true; - logger.LogTrace("'{FieldName}' migrated Match={Value}", columnName, result); - break; - } - case MigrateAttachmentResultContentItem { Success: true, ContentItemGuid: { } contentItemGuid }: - { - mfis = - [ - new ContentItemReference { Identifier = contentItemGuid } - ]; - hasMigratedAsset = true; - logger.LogTrace("'{FieldName}' migrated Match={Value}", columnName, result); - break; - } - default: - { - logger.LogTrace("Unsuccessful attachment migration '{Field}': '{Value}' - {Match}", columnName, path, result); - break; - } - } - } - - if (mediaKind == MediaKind.MediaFile) - { - logger.LogTrace("'{FieldName}' Skipped Match={Value}", columnName, result); - } - } - - if (mediaGuid is { } mg) - { - if (mediaKind == MediaKind.Attachment) - { - switch (await attachmentMigrator.MigrateAttachment(mg, $"__{columnName}", cmsTree.NodeSiteID)) - { - case MigrateAttachmentResultMediaFile(true, _, var x, _): - { - mfis = [new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }]; - hasMigratedAsset = true; - logger.LogTrace("MediaFile migrated from attachment '{Field}': '{Value}'", columnName, mg); - break; - } - case MigrateAttachmentResultContentItem { Success: true, ContentItemGuid: { } contentItemGuid }: - { - mfis = - [ - new ContentItemReference { Identifier = contentItemGuid } - ]; - hasMigratedAsset = true; - logger.LogTrace("Content item migrated from attachment '{Field}': '{Value}' to {ContentItemGUID}", columnName, mg, contentItemGuid); - break; - } - default: - { - break; - } - } - } - - if (mediaKind == MediaKind.MediaFile) - { - var sourceMediaFile = modelFacade.SelectWhere("FileGUID = @mediaFileGuid AND FileSiteID = @fileSiteID", new SqlParameter("mediaFileGuid", mg), new SqlParameter("fileSiteID", site.SiteID)) - .FirstOrDefault(); - if (sourceMediaFile != null) - { - if (configuration.MigrateMediaToMediaLibrary) - { - if (entityIdentityFacade.Translate(sourceMediaFile) is { } mf && mediaFileFacade.GetMediaFile(mf.Identity) is { } x) - { - mfis = [new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }]; - hasMigratedAsset = true; - } - } - else - { - var (ownerContentItemGuid, _) = assetFacade.GetRef(sourceMediaFile); - mfis = - [ - new ContentItemReference { Identifier = ownerContentItemGuid } - ]; - hasMigratedAsset = true; - logger.LogTrace("MediaFile migrated from media file '{Field}': '{Value}'", columnName, mg); - } - } - } - } - } - else if (classService.GetFormControlDefinition(controlName) is { } formControl) - { - switch (formControl) - { - case { UserControlForFile: true }: - { - if (value is Guid attachmentGuid) - { - switch (await attachmentMigrator.MigrateAttachment(attachmentGuid, $"__{columnName}", cmsTree.NodeSiteID)) - { - case MigrateAttachmentResultMediaFile(true, _, var mfi, _): - { - mfis = [new AssetRelatedItem { Identifier = mfi.FileGUID, Dimensions = new AssetDimensions { Height = mfi.FileImageHeight, Width = mfi.FileImageWidth }, Name = mfi.FileName, Size = mfi.FileSize }]; - hasMigratedAsset = true; - logger.LogTrace("MediaFile migrated from attachment '{Field}': '{Value}'", columnName, attachmentGuid); - break; - } - case MigrateAttachmentResultContentItem { Success: true, ContentItemGuid: { } contentItemGuid }: - { - mfis = - [ - new ContentItemReference { Identifier = contentItemGuid } - ]; - hasMigratedAsset = true; - logger.LogTrace("Content item migrated from attachment '{Field}': '{Value}' to {ContentItemGUID}", columnName, attachmentGuid, contentItemGuid); - break; - } - default: - { - logger.LogTrace("'{FieldName}' UserControlForFile Success={Success} AttachmentGUID={attachmentGuid}", columnName, false, attachmentGuid); - break; - } - } - } - else if (value is string attachmentGuidStr && Guid.TryParse(attachmentGuidStr, out attachmentGuid)) - { - switch (await attachmentMigrator.MigrateAttachment(attachmentGuid, $"__{columnName}", cmsTree.NodeSiteID)) - { - case MigrateAttachmentResultMediaFile { Success: true, MediaFileInfo: { } x }: - { - mfis = [new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }]; - hasMigratedAsset = true; - logger.LogTrace("MediaFile migrated from attachment '{Field}': '{Value}' (parsed)", columnName, attachmentGuid); - break; - } - case MigrateAttachmentResultContentItem { Success: true, ContentItemGuid: { } contentItemGuid }: - { - mfis = - [ - new ContentItemReference { Identifier = contentItemGuid } - ]; - hasMigratedAsset = true; - logger.LogTrace("Content item migrated from attachment '{Field}': '{Value}' to {ContentItemGUID}", columnName, attachmentGuid, contentItemGuid); - break; - } - default: - { - logger.LogTrace("'{FieldName}' UserControlForFile Success={Success} AttachmentGUID={attachmentGuid}", columnName, false, attachmentGuid); - break; - } - } - } - else - { - logger.LogTrace("'{FieldName}' UserControlForFile AttachmentGUID={Value}", columnName, value); - } - - break; - } - case { UserControlForDocAttachments: true }: - { - // new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize } - if (documentId is { } docId) - { - var mfisl = new List(); - await foreach (var migResult in attachmentMigrator.MigrateGroupedAttachments(docId, field.Guid, field.Name)) - { - switch (migResult) - { - case MigrateAttachmentResultMediaFile { Success: true, MediaFileInfo: { } x }: - { - mfisl.Add(new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }); - hasMigratedAsset = true; - break; - } - case MigrateAttachmentResultContentItem { Success: true, ContentItemGuid: { } contentItemGuid }: - { - mfis = - [ - new ContentItemReference { Identifier = contentItemGuid } - ]; - hasMigratedAsset = true; - logger.LogTrace("Content item migrated from document '{DocumentID}' attachment '{FiledName}' to {ContentItemGUID}", docId, field.Name, contentItemGuid); - break; - } - default: - { - hasMigratedAsset = false; - break; - } - } - } - - mfis = mfisl; - } - else - { - logger.LogTrace("'{FieldName}' UserControlForDocAttachments DocumentID={Value}", columnName, documentId); - } - - break; - } - - default: - break; - } - } - else - { - logger.LogWarning("Unable to map value based on selected migration '{Migration}', value: '{Value}'", fieldMigration, value); - return; - } - - if (hasMigratedAsset && mfis is { Count: > 0 }) - { - target.SetValueAsJson(columnName, mfis); - logger.LogTrace("'{FieldName}' setting '{Value}'", columnName, target.GetValueOrDefault(columnName)); - } - else - { - logger.LogTrace("'{FieldName}' leaving '{Value}'", columnName, target.GetValueOrDefault(columnName)); - } - } - - private static IEnumerable UnpackReusableFieldSchemas(IEnumerable schemaInfos) - { - using var siEnum = schemaInfos.GetEnumerator(); - - if (siEnum.MoveNext() && FormHelper.GetFormInfo(ContentItemCommonDataInfo.TYPEINFO.ObjectClassName, true) is { } cfi) - { - do - { - var fsi = siEnum.Current; - var formFieldInfos = cfi - .GetFields(true, true) - .Where(f => string.Equals(f.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY] as string, fsi.Guid.ToString(), - StringComparison.InvariantCultureIgnoreCase)); - - foreach (var formFieldInfo in formFieldInfos) - { - yield return formFieldInfo; - } - } while (siEnum.MoveNext()); - } - } - - #region "Page template & page widget walkers" - - private void WalkAreas(int siteId, List areas, out bool needsDeferredPatch) - { - needsDeferredPatch = false; - foreach (var area in areas) - { - logger.LogTrace("Walk area {Identifier}", area.Identifier); - - if (area.Sections is { Count: > 0 }) - { - WalkSections(siteId, area.Sections, out bool ndp); - needsDeferredPatch = ndp || needsDeferredPatch; - } - } - } - - private void WalkSections(int siteId, List sections, out bool needsDeferredPatch) - { - needsDeferredPatch = false; - foreach (var section in sections) - { - logger.LogTrace("Walk section {TypeIdentifier}|{Identifier}", section.TypeIdentifier, section.Identifier); - - var sectionFcs = sourceInstanceContext.GetSectionFormComponents(siteId, section.TypeIdentifier); - WalkProperties(siteId, section.Properties, sectionFcs, out bool ndp1); - needsDeferredPatch = ndp1 || needsDeferredPatch; - - if (section.Zones is { Count: > 0 }) - { - WalkZones(siteId, section.Zones, out bool ndp); - needsDeferredPatch = ndp || needsDeferredPatch; - } - } - } - - private void WalkZones(int siteId, List zones, out bool needsDeferredPatch) - { - needsDeferredPatch = false; - foreach (var zone in zones) - { - logger.LogTrace("Walk zone {Name}|{Identifier}", zone.Name, zone.Identifier); - - if (zone.Widgets is { Count: > 0 }) - { - WalkWidgets(siteId, zone.Widgets, out bool ndp); - needsDeferredPatch = ndp || needsDeferredPatch; - } - } - } - - private void WalkWidgets(int siteId, List widgets, out bool needsDeferredPatch) - { - needsDeferredPatch = false; - foreach (var widget in widgets) - { - logger.LogTrace("Walk widget {TypeIdentifier}|{Identifier}", widget.TypeIdentifier, widget.Identifier); - - var widgetFcs = sourceInstanceContext.GetWidgetPropertyFormComponents(siteId, widget.TypeIdentifier); - foreach (var variant in widget.Variants) - { - logger.LogTrace("Walk widget variant {Name}|{Identifier}", variant.Name, variant.Identifier); - - if (variant.Properties is { Count: > 0 }) - { - WalkProperties(siteId, variant.Properties, widgetFcs, out bool ndp); - needsDeferredPatch = ndp || needsDeferredPatch; - } - } - } - } - - private void WalkProperties(int siteId, JObject properties, List? formControlModels, out bool needsDeferredPatch) - { - needsDeferredPatch = false; - foreach ((string key, var value) in properties) - { - logger.LogTrace("Walk property {Name}|{Identifier}", key, value?.ToString()); - - var editingFcm = formControlModels?.FirstOrDefault(x => x.PropertyName.Equals(key, StringComparison.InvariantCultureIgnoreCase)); - if (editingFcm != null) - { - if (FieldMappingInstance.BuiltInModel.NotSupportedInKxpLegacyMode - .SingleOrDefault(x => x.OldFormComponent == editingFcm.FormComponentIdentifier) is var (oldFormComponent, newFormComponent)) - { - logger.LogTrace("Editing form component found {FormComponentName} => no longer supported {Replacement}", editingFcm.FormComponentIdentifier, newFormComponent); - - switch (oldFormComponent) - { - case Kx13FormComponents.Kentico_MediaFilesSelector: - { - var mfis = new List(); - if (value?.ToObject>() is { Count: > 0 } items) - { - foreach (var mfsi in items) - { - if (configuration.MigrateMediaToMediaLibrary) - { - if (entityIdentityFacade.Translate(mfsi.FileGuid, siteId) is { } mf && mediaFileFacade.GetMediaFile(mf.Identity) is { } mfi) - { - mfis.Add(new Kentico.Components.Web.Mvc.FormComponents.MediaFilesSelectorItem { FileGuid = mfi.FileGUID }); - } - } - else - { - var sourceMediaFile = modelFacade.SelectWhere("FileGUID = @mediaFileGuid AND FileSiteID = @fileSiteID", new SqlParameter("mediaFileGuid", mfsi.FileGuid), new SqlParameter("fileSiteID", siteId)) - .FirstOrDefault(); - if (sourceMediaFile != null) - { - var (ownerContentItemGuid, _) = assetFacade.GetRef(sourceMediaFile); - mfis.Add(new ContentItemReference { Identifier = ownerContentItemGuid }); - } - } - } - - - properties[key] = JToken.FromObject(items.Select(x => new Kentico.Components.Web.Mvc.FormComponents.MediaFilesSelectorItem { FileGuid = entityIdentityFacade.Translate(x.FileGuid, siteId).Identity }) - .ToList()); - } - - break; - } - case Kx13FormComponents.Kentico_PathSelector: - { - if (value?.ToObject>() is { Count: > 0 } items) - { - properties[key] = JToken.FromObject(items.Select(x => new Kentico.Components.Web.Mvc.FormComponents.PathSelectorItem { TreePath = x.NodeAliasPath }).ToList()); - } - - break; - } - case Kx13FormComponents.Kentico_AttachmentSelector when newFormComponent == FormComponents.AdminAssetSelectorComponent: - { - if (value?.ToObject>() is { Count: > 0 } items) - { - var nv = new List(); - foreach (var asi in items) - { - var attachment = modelFacade.SelectWhere("AttachmentSiteID = @attachmentSiteId AND AttachmentGUID = @attachmentGUID", - new SqlParameter("attachmentSiteID", siteId), - new SqlParameter("attachmentGUID", asi.FileGuid) - ) - .FirstOrDefault(); - if (attachment != null) - { - switch (attachmentMigrator.MigrateAttachment(attachment).GetAwaiter().GetResult()) - { - case MigrateAttachmentResultMediaFile { Success: true, MediaFileInfo: { } x }: - { - nv.Add(new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }); - break; - } - case MigrateAttachmentResultContentItem { Success: true, ContentItemGuid: { } contentItemGuid }: - { - nv.Add(new ContentItemReference { Identifier = contentItemGuid }); - break; - } - default: - { - logger.LogWarning("Attachment '{AttachmentGUID}' failed to migrate", asi.FileGuid); - break; - } - } - } - else - { - logger.LogWarning("Attachment '{AttachmentGUID}' not found", asi.FileGuid); - } - } - - properties[key] = JToken.FromObject(nv); - } - - logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); - break; - } - case Kx13FormComponents.Kentico_PageSelector when newFormComponent == FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent: - { - if (value?.ToObject>() is { Count: > 0 } items) - { - properties[key] = JToken.FromObject(items.Select(x => new WebPageRelatedItem { WebPageGuid = spoiledGuidContext.EnsureNodeGuid(x.NodeGuid, siteId) }).ToList()); - } - - logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); - break; - } - - default: - break; - } - } - else if (FieldMappingInstance.BuiltInModel.SupportedInKxpLegacyMode.Contains(editingFcm.FormComponentIdentifier)) - { - // OK - logger.LogTrace("Editing form component found {FormComponentName} => supported in legacy mode", editingFcm.FormComponentIdentifier); - } - else - { - // unknown control, probably custom - logger.LogTrace("Editing form component found {FormComponentName} => custom or inlined component, don't forget to migrate code accordingly", editingFcm.FormComponentIdentifier); - } - } - - if ("NodeAliasPath".Equals(key, StringComparison.InvariantCultureIgnoreCase)) - { - needsDeferredPatch = true; - properties["TreePath"] = value; - properties.Remove(key); - } - } - } - - #endregion -} diff --git a/KVA/Migration.Toolkit.Source/Mappers/MemberInfoMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/MemberInfoMapper.cs deleted file mode 100644 index 5eb7bc8b..00000000 --- a/KVA/Migration.Toolkit.Source/Mappers/MemberInfoMapper.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System.Data; - -using CMS.FormEngine; -using CMS.Membership; - -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Mappers; - -public record MemberInfoMapperSource(ICmsUser User, ICmsUserSetting UserSetting); - -public class MemberInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration, - ModelFacade modelFacade -) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - public static IReadOnlyList MigratedUserFields = new List - { - nameof(ICmsUser.UserGUID), - nameof(ICmsUser.UserName), - nameof(ICmsUser.Email), - // nameof(ICmsUser.UserPassword), - nameof(ICmsUser.UserEnabled), - nameof(ICmsUser.UserCreated), - nameof(ICmsUser.UserSecurityStamp) - }; - - protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (user, userSetting) = source; - - if (!newInstance && user.UserGUID != target.MemberGuid) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.MemberName = user.UserName; - - // target.FirstName = source.FirstName; - // target.LastName = source.LastName; - - // target.Email = source.Email; - target.MemberEmail = user.Email; - - target.MemberPassword = null; // source.UserPassword; // not migrated - - target.MemberEnabled = user.UserEnabled; - - target.SetValue("UserCreated", user.UserCreated); - target.MemberCreated = user.UserCreated.GetValueOrDefault(); - - target.MemberGuid = user.UserGUID; - target.MemberSecurityStamp = user.UserSecurityStamp; - - // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - // OBSOLETE: target.UserIsPendingRegistration = false; - // OBSOLETE: target.UserPasswordLastChanged = null; - // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); - foreach (var customizedFieldInfo in customized) - { - string fieldName = customizedFieldInfo.FieldName; - - if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out object? value) || - ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) - { - target.SetValue(fieldName, value); - } - } - - var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(MemberInfo.TYPEINFO.ObjectClassName).ToList(); - if (userCustomizedFields.Count > 0) - { - try - { - string query = - $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.User.UserID); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - - var usDci = modelFacade - .SelectAll() - .Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }) - .FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); - - if (usDci != null) - { - var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); - if (userSettingsCustomizedFields.Count > 0) - { - try - { - string query = - $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsID); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userSettingsCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserSettingsInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); - } - } - } - - - return target; - } -} diff --git a/KVA/Migration.Toolkit.Source/Migration.Toolkit.Source.csproj b/KVA/Migration.Toolkit.Source/Migration.Toolkit.Source.csproj deleted file mode 100644 index 85502eab..00000000 --- a/KVA/Migration.Toolkit.Source/Migration.Toolkit.Source.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - - - - - - - - - IDE0060 - - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsAlternativeForm.cs b/KVA/Migration.Toolkit.Source/Model/CmsAlternativeForm.cs deleted file mode 100644 index 4f93a639..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsAlternativeForm.cs +++ /dev/null @@ -1,87 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsAlternativeForm : ISourceModel -{ - int FormID { get; } - string FormDisplayName { get; } - string FormName { get; } - int FormClassID { get; } - string? FormDefinition { get; } - string? FormLayout { get; } - Guid FormGUID { get; } - DateTime FormLastModified { get; } - int? FormCoupledClassID { get; } - bool? FormHideNewParentFields { get; } - string? FormLayoutType { get; } - string? FormVersionGUID { get; } - string? FormCustomizedColumns { get; } - bool? FormIsCustom { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsAlternativeFormK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsAlternativeFormK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsAlternativeFormK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsAlternativeFormK11.IsAvailable(version), - { Major: 12 } => CmsAlternativeFormK12.IsAvailable(version), - { Major: 13 } => CmsAlternativeFormK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_AlternativeForm"; - static string ISourceModel.GuidColumnName => "FormGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsAlternativeForm ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsAlternativeFormK11.FromReader(reader, version), - { Major: 12 } => CmsAlternativeFormK12.FromReader(reader, version), - { Major: 13 } => CmsAlternativeFormK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsAlternativeFormK11(int FormID, string FormDisplayName, string FormName, int FormClassID, string? FormDefinition, string? FormLayout, Guid FormGUID, DateTime FormLastModified, int? FormCoupledClassID, bool? FormHideNewParentFields, string? FormLayoutType, string? FormVersionGUID, string? FormCustomizedColumns, bool? FormIsCustom) : ICmsAlternativeForm, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; - public static string TableName => "CMS_AlternativeForm"; - public static string GuidColumnName => "FormGUID"; - static CmsAlternativeFormK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") - ); - public static CmsAlternativeFormK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") - ); -}; -public partial record CmsAlternativeFormK12(int FormID, string FormDisplayName, string FormName, int FormClassID, string? FormDefinition, string? FormLayout, Guid FormGUID, DateTime FormLastModified, int? FormCoupledClassID, bool? FormHideNewParentFields, string? FormLayoutType, string? FormVersionGUID, string? FormCustomizedColumns, bool? FormIsCustom) : ICmsAlternativeForm, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; - public static string TableName => "CMS_AlternativeForm"; - public static string GuidColumnName => "FormGUID"; - static CmsAlternativeFormK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") - ); - public static CmsAlternativeFormK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") - ); -}; -public partial record CmsAlternativeFormK13(int FormID, string FormDisplayName, string FormName, int FormClassID, string? FormDefinition, string? FormLayout, Guid FormGUID, DateTime FormLastModified, int? FormCoupledClassID, bool? FormHideNewParentFields, string? FormLayoutType, string? FormVersionGUID, string? FormCustomizedColumns, bool? FormIsCustom) : ICmsAlternativeForm, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; - public static string TableName => "CMS_AlternativeForm"; - public static string GuidColumnName => "FormGUID"; - static CmsAlternativeFormK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") - ); - public static CmsAlternativeFormK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsAlternativeUrl.cs b/KVA/Migration.Toolkit.Source/Model/CmsAlternativeUrl.cs deleted file mode 100644 index 7fe9acb0..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsAlternativeUrl.cs +++ /dev/null @@ -1,74 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsAlternativeUrl : ISourceModel -{ - - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsAlternativeUrlK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsAlternativeUrlK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsAlternativeUrlK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsAlternativeUrlK11.IsAvailable(version), - { Major: 12 } => CmsAlternativeUrlK12.IsAvailable(version), - { Major: 13 } => CmsAlternativeUrlK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_AlternativeUrl"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsAlternativeUrl ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsAlternativeUrlK11.FromReader(reader, version), - { Major: 12 } => CmsAlternativeUrlK12.FromReader(reader, version), - { Major: 13 } => CmsAlternativeUrlK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsAlternativeUrlK11() : ICmsAlternativeUrl, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => false; - public static string GetPrimaryKeyName(SemanticVersion version) => ""; - public static string TableName => "CMS_AlternativeUrl"; - public static string GuidColumnName => ""; - static CmsAlternativeUrlK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - - ); - public static CmsAlternativeUrlK11 FromReader(IDataReader reader, SemanticVersion version) => new( - - ); -}; -public partial record CmsAlternativeUrlK12(int AlternativeUrlID, Guid AlternativeUrlGUID, int AlternativeUrlDocumentID, int AlternativeUrlSiteID, string AlternativeUrlUrl, DateTime AlternativeUrlLastModified) : ICmsAlternativeUrl, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "AlternativeUrlID"; - public static string TableName => "CMS_AlternativeUrl"; - public static string GuidColumnName => "AlternativeUrlGUID"; - static CmsAlternativeUrlK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), reader.Unbox("AlternativeUrlLastModified") - ); - public static CmsAlternativeUrlK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), reader.Unbox("AlternativeUrlLastModified") - ); -}; -public partial record CmsAlternativeUrlK13(int AlternativeUrlID, Guid AlternativeUrlGUID, int AlternativeUrlDocumentID, int AlternativeUrlSiteID, string AlternativeUrlUrl, DateTime AlternativeUrlLastModified) : ICmsAlternativeUrl, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "AlternativeUrlID"; - public static string TableName => "CMS_AlternativeUrl"; - public static string GuidColumnName => "AlternativeUrlGUID"; - static CmsAlternativeUrlK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), reader.Unbox("AlternativeUrlLastModified") - ); - public static CmsAlternativeUrlK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), reader.Unbox("AlternativeUrlLastModified") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsAttachment.cs b/KVA/Migration.Toolkit.Source/Model/CmsAttachment.cs deleted file mode 100644 index ff0077a7..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsAttachment.cs +++ /dev/null @@ -1,96 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsAttachment : ISourceModel -{ - int AttachmentID { get; } - string AttachmentName { get; } - string AttachmentExtension { get; } - int AttachmentSize { get; } - string AttachmentMimeType { get; } - byte[]? AttachmentBinary { get; } - int? AttachmentImageWidth { get; } - int? AttachmentImageHeight { get; } - int? AttachmentDocumentID { get; } - Guid AttachmentGUID { get; } - int AttachmentSiteID { get; } - DateTime AttachmentLastModified { get; } - bool? AttachmentIsUnsorted { get; } - int? AttachmentOrder { get; } - Guid? AttachmentGroupGUID { get; } - Guid? AttachmentFormGUID { get; } - string? AttachmentHash { get; } - string? AttachmentTitle { get; } - string? AttachmentDescription { get; } - string? AttachmentCustomData { get; } - string? AttachmentSearchContent { get; } - string? AttachmentVariantDefinitionIdentifier { get; } - int? AttachmentVariantParentID { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsAttachmentK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsAttachmentK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsAttachmentK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsAttachmentK11.IsAvailable(version), - { Major: 12 } => CmsAttachmentK12.IsAvailable(version), - { Major: 13 } => CmsAttachmentK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_Attachment"; - static string ISourceModel.GuidColumnName => "AttachmentGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsAttachment ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsAttachmentK11.FromReader(reader, version), - { Major: 12 } => CmsAttachmentK12.FromReader(reader, version), - { Major: 13 } => CmsAttachmentK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsAttachmentK11(int AttachmentID, string AttachmentName, string AttachmentExtension, int AttachmentSize, string AttachmentMimeType, byte[]? AttachmentBinary, int? AttachmentImageWidth, int? AttachmentImageHeight, int? AttachmentDocumentID, Guid AttachmentGUID, int AttachmentSiteID, DateTime AttachmentLastModified, bool? AttachmentIsUnsorted, int? AttachmentOrder, Guid? AttachmentGroupGUID, Guid? AttachmentFormGUID, string? AttachmentHash, string? AttachmentTitle, string? AttachmentDescription, string? AttachmentCustomData, string? AttachmentSearchContent, string? AttachmentVariantDefinitionIdentifier, int? AttachmentVariantParentID) : ICmsAttachment, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "AttachmentID"; - public static string TableName => "CMS_Attachment"; - public static string GuidColumnName => "AttachmentGUID"; - static CmsAttachmentK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") - ); - public static CmsAttachmentK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") - ); -}; -public partial record CmsAttachmentK12(int AttachmentID, string AttachmentName, string AttachmentExtension, int AttachmentSize, string AttachmentMimeType, byte[]? AttachmentBinary, int? AttachmentImageWidth, int? AttachmentImageHeight, int? AttachmentDocumentID, Guid AttachmentGUID, int AttachmentSiteID, DateTime AttachmentLastModified, bool? AttachmentIsUnsorted, int? AttachmentOrder, Guid? AttachmentGroupGUID, Guid? AttachmentFormGUID, string? AttachmentHash, string? AttachmentTitle, string? AttachmentDescription, string? AttachmentCustomData, string? AttachmentSearchContent, string? AttachmentVariantDefinitionIdentifier, int? AttachmentVariantParentID) : ICmsAttachment, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "AttachmentID"; - public static string TableName => "CMS_Attachment"; - public static string GuidColumnName => "AttachmentGUID"; - static CmsAttachmentK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") - ); - public static CmsAttachmentK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") - ); -}; -public partial record CmsAttachmentK13(int AttachmentID, string AttachmentName, string AttachmentExtension, int AttachmentSize, string AttachmentMimeType, byte[]? AttachmentBinary, int? AttachmentImageWidth, int? AttachmentImageHeight, int? AttachmentDocumentID, Guid AttachmentGUID, int AttachmentSiteID, DateTime AttachmentLastModified, bool? AttachmentIsUnsorted, int? AttachmentOrder, Guid? AttachmentGroupGUID, Guid? AttachmentFormGUID, string? AttachmentHash, string? AttachmentTitle, string? AttachmentDescription, string? AttachmentCustomData, string? AttachmentSearchContent, string? AttachmentVariantDefinitionIdentifier, int? AttachmentVariantParentID) : ICmsAttachment, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "AttachmentID"; - public static string TableName => "CMS_Attachment"; - public static string GuidColumnName => "AttachmentGUID"; - static CmsAttachmentK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") - ); - public static CmsAttachmentK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsCategory.cs b/KVA/Migration.Toolkit.Source/Model/CmsCategory.cs deleted file mode 100644 index 18944168..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsCategory.cs +++ /dev/null @@ -1,88 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsCategory : ISourceModel -{ - int CategoryID { get; } - string CategoryDisplayName { get; } - string? CategoryName { get; } - string? CategoryDescription { get; } - int? CategoryCount { get; } - bool CategoryEnabled { get; } - int? CategoryUserID { get; } - Guid CategoryGUID { get; } - DateTime CategoryLastModified { get; } - int? CategorySiteID { get; } - int? CategoryParentID { get; } - string? CategoryIDPath { get; } - string? CategoryNamePath { get; } - int? CategoryLevel { get; } - int? CategoryOrder { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsCategoryK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsCategoryK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsCategoryK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsCategoryK11.IsAvailable(version), - { Major: 12 } => CmsCategoryK12.IsAvailable(version), - { Major: 13 } => CmsCategoryK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_Category"; - static string ISourceModel.GuidColumnName => "CategoryGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsCategory ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsCategoryK11.FromReader(reader, version), - { Major: 12 } => CmsCategoryK12.FromReader(reader, version), - { Major: 13 } => CmsCategoryK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsCategoryK11(int CategoryID, string CategoryDisplayName, string? CategoryName, string? CategoryDescription, int? CategoryCount, bool CategoryEnabled, int? CategoryUserID, Guid CategoryGUID, DateTime CategoryLastModified, int? CategorySiteID, int? CategoryParentID, string? CategoryIDPath, string? CategoryNamePath, int? CategoryLevel, int? CategoryOrder) : ICmsCategory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; - public static string TableName => "CMS_Category"; - public static string GuidColumnName => "CategoryGUID"; - static CmsCategoryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") - ); - public static CmsCategoryK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") - ); -}; -public partial record CmsCategoryK12(int CategoryID, string CategoryDisplayName, string? CategoryName, string? CategoryDescription, int? CategoryCount, bool CategoryEnabled, int? CategoryUserID, Guid CategoryGUID, DateTime CategoryLastModified, int? CategorySiteID, int? CategoryParentID, string? CategoryIDPath, string? CategoryNamePath, int? CategoryLevel, int? CategoryOrder) : ICmsCategory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; - public static string TableName => "CMS_Category"; - public static string GuidColumnName => "CategoryGUID"; - static CmsCategoryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") - ); - public static CmsCategoryK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") - ); -}; -public partial record CmsCategoryK13(int CategoryID, string CategoryDisplayName, string? CategoryName, string? CategoryDescription, int? CategoryCount, bool CategoryEnabled, int? CategoryUserID, Guid CategoryGUID, DateTime CategoryLastModified, int? CategorySiteID, int? CategoryParentID, string? CategoryIDPath, string? CategoryNamePath, int? CategoryLevel, int? CategoryOrder) : ICmsCategory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; - public static string TableName => "CMS_Category"; - public static string GuidColumnName => "CategoryGUID"; - static CmsCategoryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") - ); - public static CmsCategoryK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsClass.cs b/KVA/Migration.Toolkit.Source/Model/CmsClass.cs deleted file mode 100644 index a8bfab2b..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsClass.cs +++ /dev/null @@ -1,119 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsClass : ISourceModel -{ - int ClassID { get; } - string ClassDisplayName { get; } - string ClassName { get; } - bool ClassUsesVersioning { get; } - bool ClassIsDocumentType { get; } - bool ClassIsCoupledClass { get; } - string ClassXmlSchema { get; } - string ClassFormDefinition { get; } - string ClassNodeNameSource { get; } - string? ClassTableName { get; } - string? ClassFormLayout { get; } - bool? ClassShowAsSystemTable { get; } - bool? ClassUsePublishFromTo { get; } - bool? ClassShowTemplateSelection { get; } - string? ClassSKUMappings { get; } - bool? ClassIsMenuItemType { get; } - string? ClassNodeAliasSource { get; } - DateTime ClassLastModified { get; } - Guid ClassGUID { get; } - bool? ClassCreateSKU { get; } - bool? ClassIsProduct { get; } - bool ClassIsCustomTable { get; } - string? ClassShowColumns { get; } - string? ClassSearchTitleColumn { get; } - string? ClassSearchContentColumn { get; } - string? ClassSearchImageColumn { get; } - string? ClassSearchCreationDateColumn { get; } - string? ClassSearchSettings { get; } - int? ClassInheritsFromClassID { get; } - bool? ClassSearchEnabled { get; } - string? ClassSKUDefaultDepartmentName { get; } - int? ClassSKUDefaultDepartmentID { get; } - string? ClassContactMapping { get; } - bool? ClassContactOverwriteEnabled { get; } - string? ClassSKUDefaultProductType { get; } - string? ClassConnectionString { get; } - bool? ClassIsProductSection { get; } - string? ClassFormLayoutType { get; } - string? ClassVersionGUID { get; } - string? ClassDefaultObjectType { get; } - bool? ClassIsForm { get; } - int? ClassResourceID { get; } - string? ClassCustomizedColumns { get; } - string? ClassCodeGenerationSettings { get; } - string? ClassIconClass { get; } - string? ClassURLPattern { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsClassK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsClassK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsClassK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsClassK11.IsAvailable(version), - { Major: 12 } => CmsClassK12.IsAvailable(version), - { Major: 13 } => CmsClassK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_Class"; - static string ISourceModel.GuidColumnName => "ClassGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsClass ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsClassK11.FromReader(reader, version), - { Major: 12 } => CmsClassK12.FromReader(reader, version), - { Major: 13 } => CmsClassK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsClassK11(int ClassID, string ClassDisplayName, string ClassName, bool ClassUsesVersioning, bool ClassIsDocumentType, bool ClassIsCoupledClass, string ClassXmlSchema, string ClassFormDefinition, string? ClassEditingPageUrl, string? ClassListPageUrl, string ClassNodeNameSource, string? ClassTableName, string? ClassViewPageUrl, string? ClassPreviewPageUrl, string? ClassFormLayout, string? ClassNewPageUrl, bool? ClassShowAsSystemTable, bool? ClassUsePublishFromTo, bool? ClassShowTemplateSelection, string? ClassSKUMappings, bool? ClassIsMenuItemType, string? ClassNodeAliasSource, int? ClassDefaultPageTemplateID, DateTime ClassLastModified, Guid ClassGUID, bool? ClassCreateSKU, bool? ClassIsProduct, bool ClassIsCustomTable, string? ClassShowColumns, string? ClassSearchTitleColumn, string? ClassSearchContentColumn, string? ClassSearchImageColumn, string? ClassSearchCreationDateColumn, string? ClassSearchSettings, int? ClassInheritsFromClassID, bool? ClassSearchEnabled, string? ClassSKUDefaultDepartmentName, int? ClassSKUDefaultDepartmentID, string? ClassContactMapping, bool? ClassContactOverwriteEnabled, string? ClassSKUDefaultProductType, string? ClassConnectionString, bool? ClassIsProductSection, int? ClassPageTemplateCategoryID, string? ClassFormLayoutType, string? ClassVersionGUID, string? ClassDefaultObjectType, bool? ClassIsForm, int? ClassResourceID, string? ClassCustomizedColumns, string? ClassCodeGenerationSettings, string? ClassIconClass, bool? ClassIsContentOnly, string? ClassURLPattern) : ICmsClass, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; - public static string TableName => "CMS_Class"; - public static string GuidColumnName => "ClassGUID"; - static CmsClassK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") - ); - public static CmsClassK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") - ); -}; -public partial record CmsClassK12(int ClassID, string ClassDisplayName, string ClassName, bool ClassUsesVersioning, bool ClassIsDocumentType, bool ClassIsCoupledClass, string ClassXmlSchema, string ClassFormDefinition, string? ClassEditingPageUrl, string? ClassListPageUrl, string ClassNodeNameSource, string? ClassTableName, string? ClassViewPageUrl, string? ClassPreviewPageUrl, string? ClassFormLayout, string? ClassNewPageUrl, bool? ClassShowAsSystemTable, bool? ClassUsePublishFromTo, bool? ClassShowTemplateSelection, string? ClassSKUMappings, bool? ClassIsMenuItemType, string? ClassNodeAliasSource, int? ClassDefaultPageTemplateID, DateTime ClassLastModified, Guid ClassGUID, bool? ClassCreateSKU, bool? ClassIsProduct, bool ClassIsCustomTable, string? ClassShowColumns, string? ClassSearchTitleColumn, string? ClassSearchContentColumn, string? ClassSearchImageColumn, string? ClassSearchCreationDateColumn, string? ClassSearchSettings, int? ClassInheritsFromClassID, bool? ClassSearchEnabled, string? ClassSKUDefaultDepartmentName, int? ClassSKUDefaultDepartmentID, string? ClassContactMapping, bool? ClassContactOverwriteEnabled, string? ClassSKUDefaultProductType, string? ClassConnectionString, bool? ClassIsProductSection, int? ClassPageTemplateCategoryID, string? ClassFormLayoutType, string? ClassVersionGUID, string? ClassDefaultObjectType, bool? ClassIsForm, int? ClassResourceID, string? ClassCustomizedColumns, string? ClassCodeGenerationSettings, string? ClassIconClass, bool? ClassIsContentOnly, string? ClassURLPattern) : ICmsClass, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; - public static string TableName => "CMS_Class"; - public static string GuidColumnName => "ClassGUID"; - static CmsClassK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") - ); - public static CmsClassK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") - ); -}; -public partial record CmsClassK13(int ClassID, string ClassDisplayName, string ClassName, bool ClassUsesVersioning, bool ClassIsDocumentType, bool ClassIsCoupledClass, string ClassXmlSchema, string ClassFormDefinition, string ClassNodeNameSource, string? ClassTableName, string? ClassFormLayout, bool? ClassShowAsSystemTable, bool? ClassUsePublishFromTo, bool? ClassShowTemplateSelection, string? ClassSKUMappings, bool? ClassIsMenuItemType, string? ClassNodeAliasSource, DateTime ClassLastModified, Guid ClassGUID, bool? ClassCreateSKU, bool? ClassIsProduct, bool ClassIsCustomTable, string? ClassShowColumns, string? ClassSearchTitleColumn, string? ClassSearchContentColumn, string? ClassSearchImageColumn, string? ClassSearchCreationDateColumn, string? ClassSearchSettings, int? ClassInheritsFromClassID, bool? ClassSearchEnabled, string? ClassSKUDefaultDepartmentName, int? ClassSKUDefaultDepartmentID, string? ClassContactMapping, bool? ClassContactOverwriteEnabled, string? ClassSKUDefaultProductType, string? ClassConnectionString, bool? ClassIsProductSection, string? ClassFormLayoutType, string? ClassVersionGUID, string? ClassDefaultObjectType, bool? ClassIsForm, int? ClassResourceID, string? ClassCustomizedColumns, string? ClassCodeGenerationSettings, string? ClassIconClass, string? ClassURLPattern, bool ClassUsesPageBuilder, bool ClassIsNavigationItem, bool ClassHasURL, bool ClassHasMetadata, int? ClassSearchIndexDataSource) : ICmsClass, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; - public static string TableName => "CMS_Class"; - public static string GuidColumnName => "ClassGUID"; - static CmsClassK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassURLPattern"), reader.Unbox("ClassUsesPageBuilder"), reader.Unbox("ClassIsNavigationItem"), reader.Unbox("ClassHasURL"), reader.Unbox("ClassHasMetadata"), reader.Unbox("ClassSearchIndexDataSource") - ); - public static CmsClassK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassURLPattern"), reader.Unbox("ClassUsesPageBuilder"), reader.Unbox("ClassIsNavigationItem"), reader.Unbox("ClassHasURL"), reader.Unbox("ClassHasMetadata"), reader.Unbox("ClassSearchIndexDataSource") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsConsent.cs b/KVA/Migration.Toolkit.Source/Model/CmsConsent.cs deleted file mode 100644 index a60d77c1..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsConsent.cs +++ /dev/null @@ -1,80 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsConsent : ISourceModel -{ - int ConsentID { get; } - string ConsentDisplayName { get; } - string ConsentName { get; } - string ConsentContent { get; } - Guid ConsentGuid { get; } - DateTime ConsentLastModified { get; } - string ConsentHash { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsConsentK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsConsentK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsConsentK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsConsentK11.IsAvailable(version), - { Major: 12 } => CmsConsentK12.IsAvailable(version), - { Major: 13 } => CmsConsentK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_Consent"; - static string ISourceModel.GuidColumnName => "ConsentGuid"; //assumtion, class Guid column doesn't change between versions - static ICmsConsent ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsConsentK11.FromReader(reader, version), - { Major: 12 } => CmsConsentK12.FromReader(reader, version), - { Major: 13 } => CmsConsentK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsConsentK11(int ConsentID, string ConsentDisplayName, string ConsentName, string ConsentContent, Guid ConsentGuid, DateTime ConsentLastModified, string ConsentHash) : ICmsConsent, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentID"; - public static string TableName => "CMS_Consent"; - public static string GuidColumnName => "ConsentGuid"; - static CmsConsentK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") - ); - public static CmsConsentK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") - ); -}; -public partial record CmsConsentK12(int ConsentID, string ConsentDisplayName, string ConsentName, string ConsentContent, Guid ConsentGuid, DateTime ConsentLastModified, string ConsentHash) : ICmsConsent, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentID"; - public static string TableName => "CMS_Consent"; - public static string GuidColumnName => "ConsentGuid"; - static CmsConsentK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") - ); - public static CmsConsentK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") - ); -}; -public partial record CmsConsentK13(int ConsentID, string ConsentDisplayName, string ConsentName, string ConsentContent, Guid ConsentGuid, DateTime ConsentLastModified, string ConsentHash) : ICmsConsent, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentID"; - public static string TableName => "CMS_Consent"; - public static string GuidColumnName => "ConsentGuid"; - static CmsConsentK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") - ); - public static CmsConsentK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsConsentAgreement.cs b/KVA/Migration.Toolkit.Source/Model/CmsConsentAgreement.cs deleted file mode 100644 index d45ca6eb..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsConsentAgreement.cs +++ /dev/null @@ -1,80 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsConsentAgreement : ISourceModel -{ - int ConsentAgreementID { get; } - Guid ConsentAgreementGuid { get; } - bool ConsentAgreementRevoked { get; } - int ConsentAgreementContactID { get; } - int ConsentAgreementConsentID { get; } - string? ConsentAgreementConsentHash { get; } - DateTime ConsentAgreementTime { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsConsentAgreementK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsConsentAgreementK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsConsentAgreementK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsConsentAgreementK11.IsAvailable(version), - { Major: 12 } => CmsConsentAgreementK12.IsAvailable(version), - { Major: 13 } => CmsConsentAgreementK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_ConsentAgreement"; - static string ISourceModel.GuidColumnName => "ConsentAgreementGuid"; //assumtion, class Guid column doesn't change between versions - static ICmsConsentAgreement ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsConsentAgreementK11.FromReader(reader, version), - { Major: 12 } => CmsConsentAgreementK12.FromReader(reader, version), - { Major: 13 } => CmsConsentAgreementK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsConsentAgreementK11(int ConsentAgreementID, Guid ConsentAgreementGuid, bool ConsentAgreementRevoked, int ConsentAgreementContactID, int ConsentAgreementConsentID, string? ConsentAgreementConsentHash, DateTime ConsentAgreementTime) : ICmsConsentAgreement, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentAgreementID"; - public static string TableName => "CMS_ConsentAgreement"; - public static string GuidColumnName => "ConsentAgreementGuid"; - static CmsConsentAgreementK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") - ); - public static CmsConsentAgreementK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") - ); -}; -public partial record CmsConsentAgreementK12(int ConsentAgreementID, Guid ConsentAgreementGuid, bool ConsentAgreementRevoked, int ConsentAgreementContactID, int ConsentAgreementConsentID, string? ConsentAgreementConsentHash, DateTime ConsentAgreementTime) : ICmsConsentAgreement, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentAgreementID"; - public static string TableName => "CMS_ConsentAgreement"; - public static string GuidColumnName => "ConsentAgreementGuid"; - static CmsConsentAgreementK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") - ); - public static CmsConsentAgreementK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") - ); -}; -public partial record CmsConsentAgreementK13(int ConsentAgreementID, Guid ConsentAgreementGuid, bool ConsentAgreementRevoked, int ConsentAgreementContactID, int ConsentAgreementConsentID, string? ConsentAgreementConsentHash, DateTime ConsentAgreementTime) : ICmsConsentAgreement, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentAgreementID"; - public static string TableName => "CMS_ConsentAgreement"; - public static string GuidColumnName => "ConsentAgreementGuid"; - static CmsConsentAgreementK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") - ); - public static CmsConsentAgreementK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsConsentArchive.cs b/KVA/Migration.Toolkit.Source/Model/CmsConsentArchive.cs deleted file mode 100644 index 67ac2667..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsConsentArchive.cs +++ /dev/null @@ -1,79 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsConsentArchive : ISourceModel -{ - int ConsentArchiveID { get; } - Guid ConsentArchiveGuid { get; } - DateTime ConsentArchiveLastModified { get; } - int ConsentArchiveConsentID { get; } - string ConsentArchiveHash { get; } - string ConsentArchiveContent { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsConsentArchiveK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsConsentArchiveK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsConsentArchiveK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsConsentArchiveK11.IsAvailable(version), - { Major: 12 } => CmsConsentArchiveK12.IsAvailable(version), - { Major: 13 } => CmsConsentArchiveK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_ConsentArchive"; - static string ISourceModel.GuidColumnName => "ConsentArchiveGuid"; //assumtion, class Guid column doesn't change between versions - static ICmsConsentArchive ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsConsentArchiveK11.FromReader(reader, version), - { Major: 12 } => CmsConsentArchiveK12.FromReader(reader, version), - { Major: 13 } => CmsConsentArchiveK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsConsentArchiveK11(int ConsentArchiveID, Guid ConsentArchiveGuid, DateTime ConsentArchiveLastModified, int ConsentArchiveConsentID, string ConsentArchiveHash, string ConsentArchiveContent) : ICmsConsentArchive, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentArchiveID"; - public static string TableName => "CMS_ConsentArchive"; - public static string GuidColumnName => "ConsentArchiveGuid"; - static CmsConsentArchiveK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") - ); - public static CmsConsentArchiveK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") - ); -}; -public partial record CmsConsentArchiveK12(int ConsentArchiveID, Guid ConsentArchiveGuid, DateTime ConsentArchiveLastModified, int ConsentArchiveConsentID, string ConsentArchiveHash, string ConsentArchiveContent) : ICmsConsentArchive, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentArchiveID"; - public static string TableName => "CMS_ConsentArchive"; - public static string GuidColumnName => "ConsentArchiveGuid"; - static CmsConsentArchiveK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") - ); - public static CmsConsentArchiveK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") - ); -}; -public partial record CmsConsentArchiveK13(int ConsentArchiveID, Guid ConsentArchiveGuid, DateTime ConsentArchiveLastModified, int ConsentArchiveConsentID, string ConsentArchiveHash, string ConsentArchiveContent) : ICmsConsentArchive, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentArchiveID"; - public static string TableName => "CMS_ConsentArchive"; - public static string GuidColumnName => "ConsentArchiveGuid"; - static CmsConsentArchiveK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") - ); - public static CmsConsentArchiveK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsCountry.cs b/KVA/Migration.Toolkit.Source/Model/CmsCountry.cs deleted file mode 100644 index 790a6256..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsCountry.cs +++ /dev/null @@ -1,80 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsCountry : ISourceModel -{ - int CountryID { get; } - string CountryDisplayName { get; } - string CountryName { get; } - Guid CountryGUID { get; } - DateTime CountryLastModified { get; } - string? CountryTwoLetterCode { get; } - string? CountryThreeLetterCode { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsCountryK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsCountryK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsCountryK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsCountryK11.IsAvailable(version), - { Major: 12 } => CmsCountryK12.IsAvailable(version), - { Major: 13 } => CmsCountryK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_Country"; - static string ISourceModel.GuidColumnName => "CountryGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsCountry ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsCountryK11.FromReader(reader, version), - { Major: 12 } => CmsCountryK12.FromReader(reader, version), - { Major: 13 } => CmsCountryK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsCountryK11(int CountryID, string CountryDisplayName, string CountryName, Guid CountryGUID, DateTime CountryLastModified, string? CountryTwoLetterCode, string? CountryThreeLetterCode) : ICmsCountry, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CountryID"; - public static string TableName => "CMS_Country"; - public static string GuidColumnName => "CountryGUID"; - static CmsCountryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") - ); - public static CmsCountryK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") - ); -}; -public partial record CmsCountryK12(int CountryID, string CountryDisplayName, string CountryName, Guid CountryGUID, DateTime CountryLastModified, string? CountryTwoLetterCode, string? CountryThreeLetterCode) : ICmsCountry, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CountryID"; - public static string TableName => "CMS_Country"; - public static string GuidColumnName => "CountryGUID"; - static CmsCountryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") - ); - public static CmsCountryK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") - ); -}; -public partial record CmsCountryK13(int CountryID, string CountryDisplayName, string CountryName, Guid CountryGUID, DateTime CountryLastModified, string? CountryTwoLetterCode, string? CountryThreeLetterCode) : ICmsCountry, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CountryID"; - public static string TableName => "CMS_Country"; - public static string GuidColumnName => "CountryGUID"; - static CmsCountryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") - ); - public static CmsCountryK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsCulture.cs b/KVA/Migration.Toolkit.Source/Model/CmsCulture.cs deleted file mode 100644 index 6e02c889..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsCulture.cs +++ /dev/null @@ -1,81 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsCulture : ISourceModel -{ - int CultureID { get; } - string CultureName { get; } - string CultureCode { get; } - string CultureShortName { get; } - Guid CultureGUID { get; } - DateTime CultureLastModified { get; } - string? CultureAlias { get; } - bool? CultureIsUICulture { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsCultureK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsCultureK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsCultureK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsCultureK11.IsAvailable(version), - { Major: 12 } => CmsCultureK12.IsAvailable(version), - { Major: 13 } => CmsCultureK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_Culture"; - static string ISourceModel.GuidColumnName => "CultureGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsCulture ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsCultureK11.FromReader(reader, version), - { Major: 12 } => CmsCultureK12.FromReader(reader, version), - { Major: 13 } => CmsCultureK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsCultureK11(int CultureID, string CultureName, string CultureCode, string CultureShortName, Guid CultureGUID, DateTime CultureLastModified, string? CultureAlias, bool? CultureIsUICulture) : ICmsCulture, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; - public static string TableName => "CMS_Culture"; - public static string GuidColumnName => "CultureGUID"; - static CmsCultureK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") - ); - public static CmsCultureK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") - ); -}; -public partial record CmsCultureK12(int CultureID, string CultureName, string CultureCode, string CultureShortName, Guid CultureGUID, DateTime CultureLastModified, string? CultureAlias, bool? CultureIsUICulture) : ICmsCulture, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; - public static string TableName => "CMS_Culture"; - public static string GuidColumnName => "CultureGUID"; - static CmsCultureK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") - ); - public static CmsCultureK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") - ); -}; -public partial record CmsCultureK13(int CultureID, string CultureName, string CultureCode, string CultureShortName, Guid CultureGUID, DateTime CultureLastModified, string? CultureAlias, bool? CultureIsUICulture) : ICmsCulture, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; - public static string TableName => "CMS_Culture"; - public static string GuidColumnName => "CultureGUID"; - static CmsCultureK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") - ); - public static CmsCultureK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsDocument.cs b/KVA/Migration.Toolkit.Source/Model/CmsDocument.cs deleted file mode 100644 index 253e04a6..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsDocument.cs +++ /dev/null @@ -1,108 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsDocument : ISourceModel -{ - int DocumentID { get; } - string DocumentName { get; } - DateTime? DocumentModifiedWhen { get; } - int? DocumentModifiedByUserID { get; } - int? DocumentForeignKeyValue { get; } - int? DocumentCreatedByUserID { get; } - DateTime? DocumentCreatedWhen { get; } - int? DocumentCheckedOutByUserID { get; } - DateTime? DocumentCheckedOutWhen { get; } - int? DocumentCheckedOutVersionHistoryID { get; } - int? DocumentPublishedVersionHistoryID { get; } - int? DocumentWorkflowStepID { get; } - DateTime? DocumentPublishFrom { get; } - DateTime? DocumentPublishTo { get; } - string DocumentCulture { get; } - int DocumentNodeID { get; } - string? DocumentPageTitle { get; } - string? DocumentPageKeyWords { get; } - string? DocumentPageDescription { get; } - string? DocumentContent { get; } - string? DocumentCustomData { get; } - string? DocumentTags { get; } - int? DocumentTagGroupID { get; } - DateTime? DocumentLastPublished { get; } - bool? DocumentSearchExcluded { get; } - string? DocumentLastVersionNumber { get; } - bool? DocumentIsArchived { get; } - Guid? DocumentGUID { get; } - Guid? DocumentWorkflowCycleGUID { get; } - bool? DocumentIsWaitingForTranslation { get; } - string? DocumentSKUName { get; } - string? DocumentSKUDescription { get; } - string? DocumentSKUShortDescription { get; } - string? DocumentWorkflowActionStatus { get; } - bool DocumentCanBePublished { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsDocumentK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsDocumentK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsDocumentK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsDocumentK11.IsAvailable(version), - { Major: 12 } => CmsDocumentK12.IsAvailable(version), - { Major: 13 } => CmsDocumentK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_Document"; - static string ISourceModel.GuidColumnName => "DocumentGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsDocument ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsDocumentK11.FromReader(reader, version), - { Major: 12 } => CmsDocumentK12.FromReader(reader, version), - { Major: 13 } => CmsDocumentK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsDocumentK11(int DocumentID, string DocumentName, string? DocumentNamePath, DateTime? DocumentModifiedWhen, int? DocumentModifiedByUserID, int? DocumentForeignKeyValue, int? DocumentCreatedByUserID, DateTime? DocumentCreatedWhen, int? DocumentCheckedOutByUserID, DateTime? DocumentCheckedOutWhen, int? DocumentCheckedOutVersionHistoryID, int? DocumentPublishedVersionHistoryID, int? DocumentWorkflowStepID, DateTime? DocumentPublishFrom, DateTime? DocumentPublishTo, string? DocumentUrlPath, string DocumentCulture, int DocumentNodeID, string? DocumentPageTitle, string? DocumentPageKeyWords, string? DocumentPageDescription, bool DocumentShowInSiteMap, bool DocumentMenuItemHideInNavigation, string? DocumentMenuCaption, string? DocumentMenuStyle, string? DocumentMenuItemImage, string? DocumentMenuItemLeftImage, string? DocumentMenuItemRightImage, int? DocumentPageTemplateID, string? DocumentMenuJavascript, string? DocumentMenuRedirectUrl, bool? DocumentUseNamePathForUrlPath, int? DocumentStylesheetID, string? DocumentContent, string? DocumentMenuClass, string? DocumentMenuStyleHighlighted, string? DocumentMenuClassHighlighted, string? DocumentMenuItemImageHighlighted, string? DocumentMenuItemLeftImageHighlighted, string? DocumentMenuItemRightImageHighlighted, bool? DocumentMenuItemInactive, string? DocumentCustomData, string? DocumentExtensions, string? DocumentTags, int? DocumentTagGroupID, string? DocumentWildcardRule, string? DocumentWebParts, double? DocumentRatingValue, int? DocumentRatings, int? DocumentPriority, string? DocumentType, DateTime? DocumentLastPublished, bool? DocumentUseCustomExtensions, string? DocumentGroupWebParts, bool? DocumentCheckedOutAutomatically, string? DocumentTrackConversionName, string? DocumentConversionValue, bool? DocumentSearchExcluded, string? DocumentLastVersionNumber, bool? DocumentIsArchived, string? DocumentHash, bool? DocumentLogVisitActivity, Guid? DocumentGUID, Guid? DocumentWorkflowCycleGUID, string? DocumentSitemapSettings, bool? DocumentIsWaitingForTranslation, string? DocumentSKUName, string? DocumentSKUDescription, string? DocumentSKUShortDescription, string? DocumentWorkflowActionStatus, bool? DocumentMenuRedirectToFirstChild, bool DocumentCanBePublished, bool DocumentInheritsStylesheet) : ICmsDocument, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "DocumentID"; - public static string TableName => "CMS_Document"; - public static string GuidColumnName => "DocumentGUID"; - static CmsDocumentK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentInheritsStylesheet") - ); - public static CmsDocumentK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentInheritsStylesheet") - ); -}; -public partial record CmsDocumentK12(int DocumentID, string DocumentName, string? DocumentNamePath, DateTime? DocumentModifiedWhen, int? DocumentModifiedByUserID, int? DocumentForeignKeyValue, int? DocumentCreatedByUserID, DateTime? DocumentCreatedWhen, int? DocumentCheckedOutByUserID, DateTime? DocumentCheckedOutWhen, int? DocumentCheckedOutVersionHistoryID, int? DocumentPublishedVersionHistoryID, int? DocumentWorkflowStepID, DateTime? DocumentPublishFrom, DateTime? DocumentPublishTo, string? DocumentUrlPath, string DocumentCulture, int DocumentNodeID, string? DocumentPageTitle, string? DocumentPageKeyWords, string? DocumentPageDescription, bool DocumentShowInSiteMap, bool DocumentMenuItemHideInNavigation, string? DocumentMenuCaption, string? DocumentMenuStyle, string? DocumentMenuItemImage, string? DocumentMenuItemLeftImage, string? DocumentMenuItemRightImage, int? DocumentPageTemplateID, string? DocumentMenuJavascript, string? DocumentMenuRedirectUrl, bool? DocumentUseNamePathForUrlPath, int? DocumentStylesheetID, string? DocumentContent, string? DocumentMenuClass, string? DocumentMenuStyleHighlighted, string? DocumentMenuClassHighlighted, string? DocumentMenuItemImageHighlighted, string? DocumentMenuItemLeftImageHighlighted, string? DocumentMenuItemRightImageHighlighted, bool? DocumentMenuItemInactive, string? DocumentCustomData, string? DocumentExtensions, string? DocumentTags, int? DocumentTagGroupID, string? DocumentWildcardRule, string? DocumentWebParts, double? DocumentRatingValue, int? DocumentRatings, int? DocumentPriority, string? DocumentType, DateTime? DocumentLastPublished, bool? DocumentUseCustomExtensions, string? DocumentGroupWebParts, bool? DocumentCheckedOutAutomatically, string? DocumentTrackConversionName, string? DocumentConversionValue, bool? DocumentSearchExcluded, string? DocumentLastVersionNumber, bool? DocumentIsArchived, string? DocumentHash, bool? DocumentLogVisitActivity, Guid? DocumentGUID, Guid? DocumentWorkflowCycleGUID, string? DocumentSitemapSettings, bool? DocumentIsWaitingForTranslation, string? DocumentSKUName, string? DocumentSKUDescription, string? DocumentSKUShortDescription, string? DocumentWorkflowActionStatus, bool? DocumentMenuRedirectToFirstChild, bool DocumentCanBePublished, bool DocumentInheritsStylesheet, string? DocumentPageBuilderWidgets, string? DocumentPageTemplateConfiguration, string? DocumentABTestConfiguration) : ICmsDocument, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "DocumentID"; - public static string TableName => "CMS_Document"; - public static string GuidColumnName => "DocumentGUID"; - static CmsDocumentK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentInheritsStylesheet"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration") - ); - public static CmsDocumentK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentInheritsStylesheet"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration") - ); -}; -public partial record CmsDocumentK13(int DocumentID, string DocumentName, DateTime? DocumentModifiedWhen, int? DocumentModifiedByUserID, int? DocumentForeignKeyValue, int? DocumentCreatedByUserID, DateTime? DocumentCreatedWhen, int? DocumentCheckedOutByUserID, DateTime? DocumentCheckedOutWhen, int? DocumentCheckedOutVersionHistoryID, int? DocumentPublishedVersionHistoryID, int? DocumentWorkflowStepID, DateTime? DocumentPublishFrom, DateTime? DocumentPublishTo, string DocumentCulture, int DocumentNodeID, string? DocumentPageTitle, string? DocumentPageKeyWords, string? DocumentPageDescription, string? DocumentContent, string? DocumentCustomData, string? DocumentTags, int? DocumentTagGroupID, DateTime? DocumentLastPublished, bool? DocumentSearchExcluded, string? DocumentLastVersionNumber, bool? DocumentIsArchived, Guid? DocumentGUID, Guid? DocumentWorkflowCycleGUID, bool? DocumentIsWaitingForTranslation, string? DocumentSKUName, string? DocumentSKUDescription, string? DocumentSKUShortDescription, string? DocumentWorkflowActionStatus, bool DocumentCanBePublished, string? DocumentPageBuilderWidgets, string? DocumentPageTemplateConfiguration, string? DocumentABTestConfiguration, bool DocumentShowInMenu) : ICmsDocument, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "DocumentID"; - public static string TableName => "CMS_Document"; - public static string GuidColumnName => "DocumentGUID"; - static CmsDocumentK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration"), reader.Unbox("DocumentShowInMenu") - ); - public static CmsDocumentK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration"), reader.Unbox("DocumentShowInMenu") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsForm.cs b/KVA/Migration.Toolkit.Source/Model/CmsForm.cs deleted file mode 100644 index 23ef0e6c..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsForm.cs +++ /dev/null @@ -1,97 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsForm : ISourceModel -{ - int FormID { get; } - string FormDisplayName { get; } - string FormName { get; } - string? FormSendToEmail { get; } - string? FormSendFromEmail { get; } - string? FormEmailSubject { get; } - string? FormEmailTemplate { get; } - bool? FormEmailAttachUploadedDocs { get; } - int FormClassID { get; } - int FormItems { get; } - string? FormReportFields { get; } - string? FormRedirectToUrl { get; } - string? FormDisplayText { get; } - bool FormClearAfterSave { get; } - string? FormSubmitButtonText { get; } - int FormSiteID { get; } - string? FormConfirmationEmailField { get; } - string? FormConfirmationTemplate { get; } - string? FormConfirmationSendFromEmail { get; } - string? FormConfirmationEmailSubject { get; } - int? FormAccess { get; } - string? FormSubmitButtonImage { get; } - Guid FormGUID { get; } - DateTime FormLastModified { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsFormK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsFormK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsFormK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsFormK11.IsAvailable(version), - { Major: 12 } => CmsFormK12.IsAvailable(version), - { Major: 13 } => CmsFormK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_Form"; - static string ISourceModel.GuidColumnName => "FormGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsForm ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsFormK11.FromReader(reader, version), - { Major: 12 } => CmsFormK12.FromReader(reader, version), - { Major: 13 } => CmsFormK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsFormK11(int FormID, string FormDisplayName, string FormName, string? FormSendToEmail, string? FormSendFromEmail, string? FormEmailSubject, string? FormEmailTemplate, bool? FormEmailAttachUploadedDocs, int FormClassID, int FormItems, string? FormReportFields, string? FormRedirectToUrl, string? FormDisplayText, bool FormClearAfterSave, string? FormSubmitButtonText, int FormSiteID, string? FormConfirmationEmailField, string? FormConfirmationTemplate, string? FormConfirmationSendFromEmail, string? FormConfirmationEmailSubject, int? FormAccess, string? FormSubmitButtonImage, Guid FormGUID, DateTime FormLastModified, bool? FormLogActivity) : ICmsForm, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; - public static string TableName => "CMS_Form"; - public static string GuidColumnName => "FormGUID"; - static CmsFormK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity") - ); - public static CmsFormK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity") - ); -}; -public partial record CmsFormK12(int FormID, string FormDisplayName, string FormName, string? FormSendToEmail, string? FormSendFromEmail, string? FormEmailSubject, string? FormEmailTemplate, bool? FormEmailAttachUploadedDocs, int FormClassID, int FormItems, string? FormReportFields, string? FormRedirectToUrl, string? FormDisplayText, bool FormClearAfterSave, string? FormSubmitButtonText, int FormSiteID, string? FormConfirmationEmailField, string? FormConfirmationTemplate, string? FormConfirmationSendFromEmail, string? FormConfirmationEmailSubject, int? FormAccess, string? FormSubmitButtonImage, Guid FormGUID, DateTime FormLastModified, bool? FormLogActivity, int FormDevelopmentModel, string? FormBuilderLayout) : ICmsForm, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; - public static string TableName => "CMS_Form"; - public static string GuidColumnName => "FormGUID"; - static CmsFormK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormDevelopmentModel"), reader.Unbox("FormBuilderLayout") - ); - public static CmsFormK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormDevelopmentModel"), reader.Unbox("FormBuilderLayout") - ); -}; -public partial record CmsFormK13(int FormID, string FormDisplayName, string FormName, string? FormSendToEmail, string? FormSendFromEmail, string? FormEmailSubject, string? FormEmailTemplate, bool? FormEmailAttachUploadedDocs, int FormClassID, int FormItems, string? FormReportFields, string? FormRedirectToUrl, string? FormDisplayText, bool FormClearAfterSave, string? FormSubmitButtonText, int FormSiteID, string? FormConfirmationEmailField, string? FormConfirmationTemplate, string? FormConfirmationSendFromEmail, string? FormConfirmationEmailSubject, int? FormAccess, string? FormSubmitButtonImage, Guid FormGUID, DateTime FormLastModified, bool FormLogActivity, string? FormBuilderLayout) : ICmsForm, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; - public static string TableName => "CMS_Form"; - public static string GuidColumnName => "FormGUID"; - static CmsFormK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormBuilderLayout") - ); - public static CmsFormK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormBuilderLayout") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsFormUserControl.cs b/KVA/Migration.Toolkit.Source/Model/CmsFormUserControl.cs deleted file mode 100644 index 53906ec0..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsFormUserControl.cs +++ /dev/null @@ -1,103 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsFormUserControl : ISourceModel -{ - int UserControlID { get; } - string UserControlDisplayName { get; } - string UserControlCodeName { get; } - string UserControlFileName { get; } - bool UserControlForText { get; } - bool UserControlForLongText { get; } - bool UserControlForInteger { get; } - bool UserControlForDecimal { get; } - bool UserControlForDateTime { get; } - bool UserControlForBoolean { get; } - bool UserControlForFile { get; } - bool? UserControlShowInDocumentTypes { get; } - bool? UserControlShowInSystemTables { get; } - bool? UserControlShowInWebParts { get; } - bool? UserControlShowInReports { get; } - Guid UserControlGUID { get; } - DateTime UserControlLastModified { get; } - bool UserControlForGuid { get; } - bool? UserControlShowInCustomTables { get; } - string? UserControlParameters { get; } - bool UserControlForDocAttachments { get; } - int? UserControlResourceID { get; } - int? UserControlParentID { get; } - string? UserControlDescription { get; } - int? UserControlPriority { get; } - bool? UserControlIsSystem { get; } - bool UserControlForBinary { get; } - bool UserControlForDocRelationships { get; } - string? UserControlAssemblyName { get; } - string? UserControlClassName { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsFormUserControlK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsFormUserControlK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsFormUserControlK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsFormUserControlK11.IsAvailable(version), - { Major: 12 } => CmsFormUserControlK12.IsAvailable(version), - { Major: 13 } => CmsFormUserControlK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_FormUserControl"; - static string ISourceModel.GuidColumnName => "UserControlGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsFormUserControl ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsFormUserControlK11.FromReader(reader, version), - { Major: 12 } => CmsFormUserControlK12.FromReader(reader, version), - { Major: 13 } => CmsFormUserControlK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsFormUserControlK11(int UserControlID, string UserControlDisplayName, string UserControlCodeName, string UserControlFileName, bool UserControlForText, bool UserControlForLongText, bool UserControlForInteger, bool UserControlForDecimal, bool UserControlForDateTime, bool UserControlForBoolean, bool UserControlForFile, bool UserControlShowInBizForms, string UserControlDefaultDataType, int? UserControlDefaultDataTypeSize, bool? UserControlShowInDocumentTypes, bool? UserControlShowInSystemTables, bool? UserControlShowInWebParts, bool? UserControlShowInReports, Guid UserControlGUID, DateTime UserControlLastModified, bool UserControlForGuid, bool? UserControlShowInCustomTables, bool UserControlForVisibility, string? UserControlParameters, bool UserControlForDocAttachments, int? UserControlResourceID, int? UserControlType, int? UserControlParentID, string? UserControlDescription, Guid? UserControlThumbnailGUID, int? UserControlPriority, bool? UserControlIsSystem, bool UserControlForBinary, bool UserControlForDocRelationships, string? UserControlAssemblyName, string? UserControlClassName) : ICmsFormUserControl, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserControlID"; - public static string TableName => "CMS_FormUserControl"; - public static string GuidColumnName => "UserControlGUID"; - static CmsFormUserControlK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") - ); - public static CmsFormUserControlK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") - ); -}; -public partial record CmsFormUserControlK12(int UserControlID, string UserControlDisplayName, string UserControlCodeName, string UserControlFileName, bool UserControlForText, bool UserControlForLongText, bool UserControlForInteger, bool UserControlForDecimal, bool UserControlForDateTime, bool UserControlForBoolean, bool UserControlForFile, bool UserControlShowInBizForms, string UserControlDefaultDataType, int? UserControlDefaultDataTypeSize, bool? UserControlShowInDocumentTypes, bool? UserControlShowInSystemTables, bool? UserControlShowInWebParts, bool? UserControlShowInReports, Guid UserControlGUID, DateTime UserControlLastModified, bool UserControlForGuid, bool? UserControlShowInCustomTables, bool UserControlForVisibility, string? UserControlParameters, bool UserControlForDocAttachments, int? UserControlResourceID, int? UserControlType, int? UserControlParentID, string? UserControlDescription, Guid? UserControlThumbnailGUID, int? UserControlPriority, bool? UserControlIsSystem, bool UserControlForBinary, bool UserControlForDocRelationships, string? UserControlAssemblyName, string? UserControlClassName) : ICmsFormUserControl, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserControlID"; - public static string TableName => "CMS_FormUserControl"; - public static string GuidColumnName => "UserControlGUID"; - static CmsFormUserControlK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") - ); - public static CmsFormUserControlK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") - ); -}; -public partial record CmsFormUserControlK13(int UserControlID, string UserControlDisplayName, string UserControlCodeName, string UserControlFileName, bool UserControlForText, bool UserControlForLongText, bool UserControlForInteger, bool UserControlForDecimal, bool UserControlForDateTime, bool UserControlForBoolean, bool UserControlForFile, bool? UserControlShowInDocumentTypes, bool? UserControlShowInSystemTables, bool? UserControlShowInWebParts, bool? UserControlShowInReports, Guid UserControlGUID, DateTime UserControlLastModified, bool UserControlForGuid, bool? UserControlShowInCustomTables, string? UserControlParameters, bool UserControlForDocAttachments, int? UserControlResourceID, int? UserControlParentID, string? UserControlDescription, int? UserControlPriority, bool? UserControlIsSystem, bool UserControlForBinary, bool UserControlForDocRelationships, string? UserControlAssemblyName, string? UserControlClassName) : ICmsFormUserControl, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserControlID"; - public static string TableName => "CMS_FormUserControl"; - public static string GuidColumnName => "UserControlGUID"; - static CmsFormUserControlK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") - ); - public static CmsFormUserControlK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsPageFormerUrlPath.cs b/KVA/Migration.Toolkit.Source/Model/CmsPageFormerUrlPath.cs deleted file mode 100644 index 5a110e73..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsPageFormerUrlPath.cs +++ /dev/null @@ -1,74 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsPageFormerUrlPath : ISourceModel -{ - - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsPageFormerUrlPathK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsPageFormerUrlPathK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsPageFormerUrlPathK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsPageFormerUrlPathK11.IsAvailable(version), - { Major: 12 } => CmsPageFormerUrlPathK12.IsAvailable(version), - { Major: 13 } => CmsPageFormerUrlPathK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_PageFormerUrlPath"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsPageFormerUrlPath ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsPageFormerUrlPathK11.FromReader(reader, version), - { Major: 12 } => CmsPageFormerUrlPathK12.FromReader(reader, version), - { Major: 13 } => CmsPageFormerUrlPathK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsPageFormerUrlPathK11() : ICmsPageFormerUrlPath, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => false; - public static string GetPrimaryKeyName(SemanticVersion version) => ""; - public static string TableName => "CMS_PageFormerUrlPath"; - public static string GuidColumnName => ""; - static CmsPageFormerUrlPathK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - - ); - public static CmsPageFormerUrlPathK11 FromReader(IDataReader reader, SemanticVersion version) => new( - - ); -}; -public partial record CmsPageFormerUrlPathK12() : ICmsPageFormerUrlPath, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => false; - public static string GetPrimaryKeyName(SemanticVersion version) => ""; - public static string TableName => "CMS_PageFormerUrlPath"; - public static string GuidColumnName => ""; - static CmsPageFormerUrlPathK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - - ); - public static CmsPageFormerUrlPathK12 FromReader(IDataReader reader, SemanticVersion version) => new( - - ); -}; -public partial record CmsPageFormerUrlPathK13(int PageFormerUrlPathID, string PageFormerUrlPathUrlPath, string PageFormerUrlPathUrlPathHash, string PageFormerUrlPathCulture, int PageFormerUrlPathNodeID, int PageFormerUrlPathSiteID, DateTime PageFormerUrlPathLastModified) : ICmsPageFormerUrlPath, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "PageFormerUrlPathID"; - public static string TableName => "CMS_PageFormerUrlPath"; - public static string GuidColumnName => ""; - static CmsPageFormerUrlPathK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("PageFormerUrlPathID"), reader.Unbox("PageFormerUrlPathUrlPath"), reader.Unbox("PageFormerUrlPathUrlPathHash"), reader.Unbox("PageFormerUrlPathCulture"), reader.Unbox("PageFormerUrlPathNodeID"), reader.Unbox("PageFormerUrlPathSiteID"), reader.Unbox("PageFormerUrlPathLastModified") - ); - public static CmsPageFormerUrlPathK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("PageFormerUrlPathID"), reader.Unbox("PageFormerUrlPathUrlPath"), reader.Unbox("PageFormerUrlPathUrlPathHash"), reader.Unbox("PageFormerUrlPathCulture"), reader.Unbox("PageFormerUrlPathNodeID"), reader.Unbox("PageFormerUrlPathSiteID"), reader.Unbox("PageFormerUrlPathLastModified") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsPageTemplateConfiguration.cs b/KVA/Migration.Toolkit.Source/Model/CmsPageTemplateConfiguration.cs deleted file mode 100644 index 857bf381..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsPageTemplateConfiguration.cs +++ /dev/null @@ -1,74 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsPageTemplateConfiguration : ISourceModel -{ - - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsPageTemplateConfigurationK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsPageTemplateConfigurationK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsPageTemplateConfigurationK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsPageTemplateConfigurationK11.IsAvailable(version), - { Major: 12 } => CmsPageTemplateConfigurationK12.IsAvailable(version), - { Major: 13 } => CmsPageTemplateConfigurationK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_PageTemplateConfiguration"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsPageTemplateConfiguration ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsPageTemplateConfigurationK11.FromReader(reader, version), - { Major: 12 } => CmsPageTemplateConfigurationK12.FromReader(reader, version), - { Major: 13 } => CmsPageTemplateConfigurationK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsPageTemplateConfigurationK11() : ICmsPageTemplateConfiguration, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => false; - public static string GetPrimaryKeyName(SemanticVersion version) => ""; - public static string TableName => "CMS_PageTemplateConfiguration"; - public static string GuidColumnName => ""; - static CmsPageTemplateConfigurationK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - - ); - public static CmsPageTemplateConfigurationK11 FromReader(IDataReader reader, SemanticVersion version) => new( - - ); -}; -public partial record CmsPageTemplateConfigurationK12(int PageTemplateConfigurationID, Guid PageTemplateConfigurationGUID, int PageTemplateConfigurationSiteID, DateTime PageTemplateConfigurationLastModified, string PageTemplateConfigurationName, string? PageTemplateConfigurationDescription, Guid? PageTemplateConfigurationThumbnailGUID, string PageTemplateConfigurationTemplate, string? PageTemplateConfigurationWidgets) : ICmsPageTemplateConfiguration, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "PageTemplateConfigurationID"; - public static string TableName => "CMS_PageTemplateConfiguration"; - public static string GuidColumnName => "PageTemplateConfigurationGUID"; - static CmsPageTemplateConfigurationK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), reader.Unbox("PageTemplateConfigurationWidgets") - ); - public static CmsPageTemplateConfigurationK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), reader.Unbox("PageTemplateConfigurationWidgets") - ); -}; -public partial record CmsPageTemplateConfigurationK13(int PageTemplateConfigurationID, Guid PageTemplateConfigurationGUID, int PageTemplateConfigurationSiteID, DateTime PageTemplateConfigurationLastModified, string PageTemplateConfigurationName, string? PageTemplateConfigurationDescription, Guid? PageTemplateConfigurationThumbnailGUID, string PageTemplateConfigurationTemplate, string? PageTemplateConfigurationWidgets) : ICmsPageTemplateConfiguration, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "PageTemplateConfigurationID"; - public static string TableName => "CMS_PageTemplateConfiguration"; - public static string GuidColumnName => "PageTemplateConfigurationGUID"; - static CmsPageTemplateConfigurationK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), reader.Unbox("PageTemplateConfigurationWidgets") - ); - public static CmsPageTemplateConfigurationK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), reader.Unbox("PageTemplateConfigurationWidgets") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsPageUrlPath.cs b/KVA/Migration.Toolkit.Source/Model/CmsPageUrlPath.cs deleted file mode 100644 index 4f155075..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsPageUrlPath.cs +++ /dev/null @@ -1,74 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsPageUrlPath : ISourceModel -{ - - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsPageUrlPathK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsPageUrlPathK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsPageUrlPathK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsPageUrlPathK11.IsAvailable(version), - { Major: 12 } => CmsPageUrlPathK12.IsAvailable(version), - { Major: 13 } => CmsPageUrlPathK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_PageUrlPath"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsPageUrlPath ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsPageUrlPathK11.FromReader(reader, version), - { Major: 12 } => CmsPageUrlPathK12.FromReader(reader, version), - { Major: 13 } => CmsPageUrlPathK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsPageUrlPathK11() : ICmsPageUrlPath, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => false; - public static string GetPrimaryKeyName(SemanticVersion version) => ""; - public static string TableName => "CMS_PageUrlPath"; - public static string GuidColumnName => ""; - static CmsPageUrlPathK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - - ); - public static CmsPageUrlPathK11 FromReader(IDataReader reader, SemanticVersion version) => new( - - ); -}; -public partial record CmsPageUrlPathK12() : ICmsPageUrlPath, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => false; - public static string GetPrimaryKeyName(SemanticVersion version) => ""; - public static string TableName => "CMS_PageUrlPath"; - public static string GuidColumnName => ""; - static CmsPageUrlPathK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - - ); - public static CmsPageUrlPathK12 FromReader(IDataReader reader, SemanticVersion version) => new( - - ); -}; -public partial record CmsPageUrlPathK13(int PageUrlPathID, Guid PageUrlPathGUID, string PageUrlPathCulture, int PageUrlPathNodeID, string PageUrlPathUrlPath, string PageUrlPathUrlPathHash, int PageUrlPathSiteID, DateTime PageUrlPathLastModified) : ICmsPageUrlPath, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "PageUrlPathID"; - public static string TableName => "CMS_PageUrlPath"; - public static string GuidColumnName => "PageUrlPathGUID"; - static CmsPageUrlPathK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("PageUrlPathID"), reader.Unbox("PageUrlPathGUID"), reader.Unbox("PageUrlPathCulture"), reader.Unbox("PageUrlPathNodeID"), reader.Unbox("PageUrlPathUrlPath"), reader.Unbox("PageUrlPathUrlPathHash"), reader.Unbox("PageUrlPathSiteID"), reader.Unbox("PageUrlPathLastModified") - ); - public static CmsPageUrlPathK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("PageUrlPathID"), reader.Unbox("PageUrlPathGUID"), reader.Unbox("PageUrlPathCulture"), reader.Unbox("PageUrlPathNodeID"), reader.Unbox("PageUrlPathUrlPath"), reader.Unbox("PageUrlPathUrlPathHash"), reader.Unbox("PageUrlPathSiteID"), reader.Unbox("PageUrlPathLastModified") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsRelationship.cs b/KVA/Migration.Toolkit.Source/Model/CmsRelationship.cs deleted file mode 100644 index e19f6c91..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsRelationship.cs +++ /dev/null @@ -1,80 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsRelationship : ISourceModel -{ - int RelationshipID { get; } - int LeftNodeID { get; } - int RightNodeID { get; } - int RelationshipNameID { get; } - string? RelationshipCustomData { get; } - int? RelationshipOrder { get; } - bool? RelationshipIsAdHoc { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsRelationshipK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsRelationshipK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsRelationshipK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsRelationshipK11.IsAvailable(version), - { Major: 12 } => CmsRelationshipK12.IsAvailable(version), - { Major: 13 } => CmsRelationshipK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_Relationship"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsRelationship ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsRelationshipK11.FromReader(reader, version), - { Major: 12 } => CmsRelationshipK12.FromReader(reader, version), - { Major: 13 } => CmsRelationshipK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsRelationshipK11(int RelationshipID, int LeftNodeID, int RightNodeID, int RelationshipNameID, string? RelationshipCustomData, int? RelationshipOrder, bool? RelationshipIsAdHoc) : ICmsRelationship, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "RelationshipID"; - public static string TableName => "CMS_Relationship"; - public static string GuidColumnName => ""; - static CmsRelationshipK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") - ); - public static CmsRelationshipK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") - ); -}; -public partial record CmsRelationshipK12(int RelationshipID, int LeftNodeID, int RightNodeID, int RelationshipNameID, string? RelationshipCustomData, int? RelationshipOrder, bool? RelationshipIsAdHoc) : ICmsRelationship, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "RelationshipID"; - public static string TableName => "CMS_Relationship"; - public static string GuidColumnName => ""; - static CmsRelationshipK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") - ); - public static CmsRelationshipK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") - ); -}; -public partial record CmsRelationshipK13(int RelationshipID, int LeftNodeID, int RightNodeID, int RelationshipNameID, string? RelationshipCustomData, int? RelationshipOrder, bool? RelationshipIsAdHoc) : ICmsRelationship, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "RelationshipID"; - public static string TableName => "CMS_Relationship"; - public static string GuidColumnName => ""; - static CmsRelationshipK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") - ); - public static CmsRelationshipK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsResource.cs b/KVA/Migration.Toolkit.Source/Model/CmsResource.cs deleted file mode 100644 index 497cd596..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsResource.cs +++ /dev/null @@ -1,87 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsResource : ISourceModel -{ - int ResourceID { get; } - string ResourceDisplayName { get; } - string ResourceName { get; } - string? ResourceDescription { get; } - bool? ShowInDevelopment { get; } - string? ResourceURL { get; } - Guid ResourceGUID { get; } - DateTime ResourceLastModified { get; } - bool? ResourceIsInDevelopment { get; } - bool? ResourceHasFiles { get; } - string? ResourceVersion { get; } - string? ResourceAuthor { get; } - string? ResourceInstallationState { get; } - string? ResourceInstalledVersion { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsResourceK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsResourceK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsResourceK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsResourceK11.IsAvailable(version), - { Major: 12 } => CmsResourceK12.IsAvailable(version), - { Major: 13 } => CmsResourceK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_Resource"; - static string ISourceModel.GuidColumnName => "ResourceGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsResource ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsResourceK11.FromReader(reader, version), - { Major: 12 } => CmsResourceK12.FromReader(reader, version), - { Major: 13 } => CmsResourceK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsResourceK11(int ResourceID, string ResourceDisplayName, string ResourceName, string? ResourceDescription, bool? ShowInDevelopment, string? ResourceURL, Guid ResourceGUID, DateTime ResourceLastModified, bool? ResourceIsInDevelopment, bool? ResourceHasFiles, string? ResourceVersion, string? ResourceAuthor, string? ResourceInstallationState, string? ResourceInstalledVersion) : ICmsResource, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ResourceID"; - public static string TableName => "CMS_Resource"; - public static string GuidColumnName => "ResourceGUID"; - static CmsResourceK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") - ); - public static CmsResourceK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") - ); -}; -public partial record CmsResourceK12(int ResourceID, string ResourceDisplayName, string ResourceName, string? ResourceDescription, bool? ShowInDevelopment, string? ResourceURL, Guid ResourceGUID, DateTime ResourceLastModified, bool? ResourceIsInDevelopment, bool? ResourceHasFiles, string? ResourceVersion, string? ResourceAuthor, string? ResourceInstallationState, string? ResourceInstalledVersion) : ICmsResource, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ResourceID"; - public static string TableName => "CMS_Resource"; - public static string GuidColumnName => "ResourceGUID"; - static CmsResourceK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") - ); - public static CmsResourceK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") - ); -}; -public partial record CmsResourceK13(int ResourceID, string ResourceDisplayName, string ResourceName, string? ResourceDescription, bool? ShowInDevelopment, string? ResourceURL, Guid ResourceGUID, DateTime ResourceLastModified, bool? ResourceIsInDevelopment, bool? ResourceHasFiles, string? ResourceVersion, string? ResourceAuthor, string? ResourceInstallationState, string? ResourceInstalledVersion) : ICmsResource, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ResourceID"; - public static string TableName => "CMS_Resource"; - public static string GuidColumnName => "ResourceGUID"; - static CmsResourceK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") - ); - public static CmsResourceK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsRole.cs b/KVA/Migration.Toolkit.Source/Model/CmsRole.cs deleted file mode 100644 index 35a75ec7..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsRole.cs +++ /dev/null @@ -1,81 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsRole : ISourceModel -{ - int RoleID { get; } - string RoleDisplayName { get; } - string RoleName { get; } - string? RoleDescription { get; } - int? SiteID { get; } - Guid RoleGUID { get; } - DateTime RoleLastModified { get; } - bool? RoleIsDomain { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsRoleK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsRoleK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsRoleK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsRoleK11.IsAvailable(version), - { Major: 12 } => CmsRoleK12.IsAvailable(version), - { Major: 13 } => CmsRoleK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_Role"; - static string ISourceModel.GuidColumnName => "RoleGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsRole ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsRoleK11.FromReader(reader, version), - { Major: 12 } => CmsRoleK12.FromReader(reader, version), - { Major: 13 } => CmsRoleK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsRoleK11(int RoleID, string RoleDisplayName, string RoleName, string? RoleDescription, int? SiteID, Guid RoleGUID, DateTime RoleLastModified, int? RoleGroupID, bool? RoleIsGroupAdministrator, bool? RoleIsDomain) : ICmsRole, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "RoleID"; - public static string TableName => "CMS_Role"; - public static string GuidColumnName => "RoleGUID"; - static CmsRoleK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") - ); - public static CmsRoleK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") - ); -}; -public partial record CmsRoleK12(int RoleID, string RoleDisplayName, string RoleName, string? RoleDescription, int? SiteID, Guid RoleGUID, DateTime RoleLastModified, int? RoleGroupID, bool? RoleIsGroupAdministrator, bool? RoleIsDomain) : ICmsRole, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "RoleID"; - public static string TableName => "CMS_Role"; - public static string GuidColumnName => "RoleGUID"; - static CmsRoleK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") - ); - public static CmsRoleK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") - ); -}; -public partial record CmsRoleK13(int RoleID, string RoleDisplayName, string RoleName, string? RoleDescription, int? SiteID, Guid RoleGUID, DateTime RoleLastModified, bool? RoleIsDomain) : ICmsRole, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "RoleID"; - public static string TableName => "CMS_Role"; - public static string GuidColumnName => "RoleGUID"; - static CmsRoleK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleIsDomain") - ); - public static CmsRoleK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleIsDomain") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsSettingsKey.cs b/KVA/Migration.Toolkit.Source/Model/CmsSettingsKey.cs deleted file mode 100644 index 6f43ac89..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsSettingsKey.cs +++ /dev/null @@ -1,92 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsSettingsKey : ISourceModel -{ - int KeyID { get; } - string KeyName { get; } - string KeyDisplayName { get; } - string? KeyDescription { get; } - string? KeyValue { get; } - string KeyType { get; } - int? KeyCategoryID { get; } - int? SiteID { get; } - Guid KeyGUID { get; } - DateTime KeyLastModified { get; } - int? KeyOrder { get; } - string? KeyDefaultValue { get; } - string? KeyValidation { get; } - string? KeyEditingControlPath { get; } - bool? KeyIsGlobal { get; } - bool? KeyIsCustom { get; } - bool? KeyIsHidden { get; } - string? KeyFormControlSettings { get; } - string? KeyExplanationText { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsSettingsKeyK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsSettingsKeyK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsSettingsKeyK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsSettingsKeyK11.IsAvailable(version), - { Major: 12 } => CmsSettingsKeyK12.IsAvailable(version), - { Major: 13 } => CmsSettingsKeyK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_SettingsKey"; - static string ISourceModel.GuidColumnName => "KeyGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsSettingsKey ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsSettingsKeyK11.FromReader(reader, version), - { Major: 12 } => CmsSettingsKeyK12.FromReader(reader, version), - { Major: 13 } => CmsSettingsKeyK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsSettingsKeyK11(int KeyID, string KeyName, string KeyDisplayName, string? KeyDescription, string? KeyValue, string KeyType, int? KeyCategoryID, int? SiteID, Guid KeyGUID, DateTime KeyLastModified, int? KeyOrder, string? KeyDefaultValue, string? KeyValidation, string? KeyEditingControlPath, bool? KeyIsGlobal, bool? KeyIsCustom, bool? KeyIsHidden, string? KeyFormControlSettings, string? KeyExplanationText) : ICmsSettingsKey, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "KeyID"; - public static string TableName => "CMS_SettingsKey"; - public static string GuidColumnName => "KeyGUID"; - static CmsSettingsKeyK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") - ); - public static CmsSettingsKeyK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") - ); -}; -public partial record CmsSettingsKeyK12(int KeyID, string KeyName, string KeyDisplayName, string? KeyDescription, string? KeyValue, string KeyType, int? KeyCategoryID, int? SiteID, Guid KeyGUID, DateTime KeyLastModified, int? KeyOrder, string? KeyDefaultValue, string? KeyValidation, string? KeyEditingControlPath, bool? KeyIsGlobal, bool? KeyIsCustom, bool? KeyIsHidden, string? KeyFormControlSettings, string? KeyExplanationText) : ICmsSettingsKey, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "KeyID"; - public static string TableName => "CMS_SettingsKey"; - public static string GuidColumnName => "KeyGUID"; - static CmsSettingsKeyK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") - ); - public static CmsSettingsKeyK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") - ); -}; -public partial record CmsSettingsKeyK13(int KeyID, string KeyName, string KeyDisplayName, string? KeyDescription, string? KeyValue, string KeyType, int? KeyCategoryID, int? SiteID, Guid KeyGUID, DateTime KeyLastModified, int? KeyOrder, string? KeyDefaultValue, string? KeyValidation, string? KeyEditingControlPath, bool? KeyIsGlobal, bool? KeyIsCustom, bool? KeyIsHidden, string? KeyFormControlSettings, string? KeyExplanationText) : ICmsSettingsKey, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "KeyID"; - public static string TableName => "CMS_SettingsKey"; - public static string GuidColumnName => "KeyGUID"; - static CmsSettingsKeyK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") - ); - public static CmsSettingsKeyK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsSite.cs b/KVA/Migration.Toolkit.Source/Model/CmsSite.cs deleted file mode 100644 index 1e0c2316..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsSite.cs +++ /dev/null @@ -1,82 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsSite : ISourceModel -{ - int SiteID { get; } - string SiteName { get; } - string SiteDisplayName { get; } - string? SiteDescription { get; } - string SiteStatus { get; } - string SiteDomainName { get; } - string? SiteDefaultVisitorCulture { get; } - Guid SiteGUID { get; } - DateTime SiteLastModified { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsSiteK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsSiteK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsSiteK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsSiteK11.IsAvailable(version), - { Major: 12 } => CmsSiteK12.IsAvailable(version), - { Major: 13 } => CmsSiteK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_Site"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsSite ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsSiteK11.FromReader(reader, version), - { Major: 12 } => CmsSiteK12.FromReader(reader, version), - { Major: 13 } => CmsSiteK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsSiteK11(int SiteID, string SiteName, string SiteDisplayName, string? SiteDescription, string SiteStatus, string SiteDomainName, int? SiteDefaultStylesheetID, string? SiteDefaultVisitorCulture, int? SiteDefaultEditorStylesheet, Guid SiteGUID, DateTime SiteLastModified, bool? SiteIsOffline, string? SiteOfflineRedirectURL, string? SiteOfflineMessage, string? SitePresentationURL, bool? SiteIsContentOnly) : ICmsSite, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "SiteID"; - public static string TableName => "CMS_Site"; - public static string GuidColumnName => ""; - static CmsSiteK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") - ); - public static CmsSiteK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") - ); -}; -public partial record CmsSiteK12(int SiteID, string SiteName, string SiteDisplayName, string? SiteDescription, string SiteStatus, string SiteDomainName, int? SiteDefaultStylesheetID, string? SiteDefaultVisitorCulture, int? SiteDefaultEditorStylesheet, Guid SiteGUID, DateTime SiteLastModified, bool? SiteIsOffline, string? SiteOfflineRedirectURL, string? SiteOfflineMessage, string? SitePresentationURL, bool? SiteIsContentOnly) : ICmsSite, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "SiteID"; - public static string TableName => "CMS_Site"; - public static string GuidColumnName => ""; - static CmsSiteK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") - ); - public static CmsSiteK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") - ); -}; -public partial record CmsSiteK13(int SiteID, string SiteName, string SiteDisplayName, string? SiteDescription, string SiteStatus, string SiteDomainName, string? SiteDefaultVisitorCulture, Guid SiteGUID, DateTime SiteLastModified, string SitePresentationURL) : ICmsSite, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "SiteID"; - public static string TableName => "CMS_Site"; - public static string GuidColumnName => ""; - static CmsSiteK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SitePresentationURL") - ); - public static CmsSiteK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SitePresentationURL") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsState.cs b/KVA/Migration.Toolkit.Source/Model/CmsState.cs deleted file mode 100644 index fc7bf1d7..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsState.cs +++ /dev/null @@ -1,80 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsState : ISourceModel -{ - int StateID { get; } - string StateDisplayName { get; } - string StateName { get; } - string? StateCode { get; } - int CountryID { get; } - Guid StateGUID { get; } - DateTime StateLastModified { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsStateK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsStateK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsStateK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsStateK11.IsAvailable(version), - { Major: 12 } => CmsStateK12.IsAvailable(version), - { Major: 13 } => CmsStateK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_State"; - static string ISourceModel.GuidColumnName => "StateGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsState ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsStateK11.FromReader(reader, version), - { Major: 12 } => CmsStateK12.FromReader(reader, version), - { Major: 13 } => CmsStateK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsStateK11(int StateID, string StateDisplayName, string StateName, string? StateCode, int CountryID, Guid StateGUID, DateTime StateLastModified) : ICmsState, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "StateID"; - public static string TableName => "CMS_State"; - public static string GuidColumnName => "StateGUID"; - static CmsStateK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") - ); - public static CmsStateK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") - ); -}; -public partial record CmsStateK12(int StateID, string StateDisplayName, string StateName, string? StateCode, int CountryID, Guid StateGUID, DateTime StateLastModified) : ICmsState, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "StateID"; - public static string TableName => "CMS_State"; - public static string GuidColumnName => "StateGUID"; - static CmsStateK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") - ); - public static CmsStateK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") - ); -}; -public partial record CmsStateK13(int StateID, string StateDisplayName, string StateName, string? StateCode, int CountryID, Guid StateGUID, DateTime StateLastModified) : ICmsState, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "StateID"; - public static string TableName => "CMS_State"; - public static string GuidColumnName => "StateGUID"; - static CmsStateK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") - ); - public static CmsStateK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsTree.cs b/KVA/Migration.Toolkit.Source/Model/CmsTree.cs deleted file mode 100644 index 92e10eb0..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsTree.cs +++ /dev/null @@ -1,94 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsTree : ISourceModel -{ - int NodeID { get; } - string NodeAliasPath { get; } - string NodeName { get; } - string NodeAlias { get; } - int NodeClassID { get; } - int? NodeParentID { get; } - int NodeLevel { get; } - int? NodeACLID { get; } - int NodeSiteID { get; } - Guid NodeGUID { get; } - int? NodeOrder { get; } - bool? IsSecuredNode { get; } - int? NodeSKUID { get; } - int? NodeLinkedNodeID { get; } - int? NodeOwner { get; } - string? NodeCustomData { get; } - int? NodeLinkedNodeSiteID { get; } - bool? NodeHasChildren { get; } - bool? NodeHasLinks { get; } - int? NodeOriginalNodeID { get; } - bool NodeIsACLOwner { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsTreeK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsTreeK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsTreeK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsTreeK11.IsAvailable(version), - { Major: 12 } => CmsTreeK12.IsAvailable(version), - { Major: 13 } => CmsTreeK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_Tree"; - static string ISourceModel.GuidColumnName => "NodeGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsTree ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsTreeK11.FromReader(reader, version), - { Major: 12 } => CmsTreeK12.FromReader(reader, version), - { Major: 13 } => CmsTreeK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsTreeK11(int NodeID, string NodeAliasPath, string NodeName, string NodeAlias, int NodeClassID, int? NodeParentID, int NodeLevel, int? NodeACLID, int NodeSiteID, Guid NodeGUID, int? NodeOrder, bool? IsSecuredNode, int? NodeCacheMinutes, int? NodeSKUID, string? NodeDocType, string? NodeHeadTags, string? NodeBodyElementAttributes, string? NodeInheritPageLevels, int? RequiresSSL, int? NodeLinkedNodeID, int? NodeOwner, string? NodeCustomData, int? NodeGroupID, int? NodeLinkedNodeSiteID, int? NodeTemplateID, bool? NodeTemplateForAllCultures, bool? NodeInheritPageTemplate, bool? NodeAllowCacheInFileSystem, bool? NodeHasChildren, bool? NodeHasLinks, int? NodeOriginalNodeID, bool NodeIsContentOnly, bool NodeIsACLOwner, string? NodeBodyScripts) : ICmsTree, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "NodeID"; - public static string TableName => "CMS_Tree"; - public static string GuidColumnName => "NodeGUID"; - static CmsTreeK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") - ); - public static CmsTreeK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") - ); -}; -public partial record CmsTreeK12(int NodeID, string NodeAliasPath, string NodeName, string NodeAlias, int NodeClassID, int? NodeParentID, int NodeLevel, int? NodeACLID, int NodeSiteID, Guid NodeGUID, int? NodeOrder, bool? IsSecuredNode, int? NodeCacheMinutes, int? NodeSKUID, string? NodeDocType, string? NodeHeadTags, string? NodeBodyElementAttributes, string? NodeInheritPageLevels, int? RequiresSSL, int? NodeLinkedNodeID, int? NodeOwner, string? NodeCustomData, int? NodeGroupID, int? NodeLinkedNodeSiteID, int? NodeTemplateID, bool? NodeTemplateForAllCultures, bool? NodeInheritPageTemplate, bool? NodeAllowCacheInFileSystem, bool? NodeHasChildren, bool? NodeHasLinks, int? NodeOriginalNodeID, bool NodeIsContentOnly, bool NodeIsACLOwner, string? NodeBodyScripts) : ICmsTree, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "NodeID"; - public static string TableName => "CMS_Tree"; - public static string GuidColumnName => "NodeGUID"; - static CmsTreeK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") - ); - public static CmsTreeK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") - ); -}; -public partial record CmsTreeK13(int NodeID, string NodeAliasPath, string NodeName, string NodeAlias, int NodeClassID, int? NodeParentID, int NodeLevel, int? NodeACLID, int NodeSiteID, Guid NodeGUID, int? NodeOrder, bool? IsSecuredNode, int? NodeSKUID, int? NodeLinkedNodeID, int? NodeOwner, string? NodeCustomData, int? NodeLinkedNodeSiteID, bool? NodeHasChildren, bool? NodeHasLinks, int? NodeOriginalNodeID, bool NodeIsACLOwner) : ICmsTree, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "NodeID"; - public static string TableName => "CMS_Tree"; - public static string GuidColumnName => "NodeGUID"; - static CmsTreeK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsACLOwner") - ); - public static CmsTreeK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsACLOwner") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsUser.cs b/KVA/Migration.Toolkit.Source/Model/CmsUser.cs deleted file mode 100644 index 1a7e7678..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsUser.cs +++ /dev/null @@ -1,99 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsUser : ISourceModel -{ - int UserID { get; } - string UserName { get; } - string? FirstName { get; } - string? MiddleName { get; } - string? LastName { get; } - string? FullName { get; } - string? Email { get; } - string UserPassword { get; } - string? PreferredCultureCode { get; } - string? PreferredUICultureCode { get; } - bool UserEnabled { get; } - bool? UserIsExternal { get; } - string? UserPasswordFormat { get; } - DateTime? UserCreated { get; } - DateTime? LastLogon { get; } - string? UserStartingAliasPath { get; } - Guid UserGUID { get; } - DateTime UserLastModified { get; } - string? UserLastLogonInfo { get; } - bool? UserIsHidden { get; } - bool? UserIsDomain { get; } - bool? UserHasAllowedCultures { get; } - bool? UserMFRequired { get; } - int UserPrivilegeLevel { get; } - string? UserSecurityStamp { get; } - byte[]? UserMFSecret { get; } - long? UserMFTimestep { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsUserK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsUserK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsUserK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsUserK11.IsAvailable(version), - { Major: 12 } => CmsUserK12.IsAvailable(version), - { Major: 13 } => CmsUserK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_User"; - static string ISourceModel.GuidColumnName => "UserGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsUser ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsUserK11.FromReader(reader, version), - { Major: 12 } => CmsUserK12.FromReader(reader, version), - { Major: 13 } => CmsUserK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsUserK11(int UserID, string UserName, string? FirstName, string? MiddleName, string? LastName, string? FullName, string? Email, string UserPassword, string? PreferredCultureCode, string? PreferredUICultureCode, bool UserEnabled, bool? UserIsExternal, string? UserPasswordFormat, DateTime? UserCreated, DateTime? LastLogon, string? UserStartingAliasPath, Guid UserGUID, DateTime UserLastModified, string? UserLastLogonInfo, bool? UserIsHidden, string? UserVisibility, bool? UserIsDomain, bool? UserHasAllowedCultures, bool? UserMFRequired, int UserPrivilegeLevel, string? UserSecurityStamp, byte[]? UserMFSecret, long? UserMFTimestep, string? CUSTOM_1) : ICmsUser, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserID"; - public static string TableName => "CMS_User"; - public static string GuidColumnName => "UserGUID"; - static CmsUserK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep"), reader.Unbox("CUSTOM_1") - ); - public static CmsUserK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep"), reader.Unbox("CUSTOM_1") - ); -}; -public partial record CmsUserK12(int UserID, string UserName, string? FirstName, string? MiddleName, string? LastName, string? FullName, string? Email, string UserPassword, string? PreferredCultureCode, string? PreferredUICultureCode, bool UserEnabled, bool? UserIsExternal, string? UserPasswordFormat, DateTime? UserCreated, DateTime? LastLogon, string? UserStartingAliasPath, Guid UserGUID, DateTime UserLastModified, string? UserLastLogonInfo, bool? UserIsHidden, string? UserVisibility, bool? UserIsDomain, bool? UserHasAllowedCultures, bool? UserMFRequired, int UserPrivilegeLevel, string? UserSecurityStamp, byte[]? UserMFSecret, long? UserMFTimestep) : ICmsUser, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserID"; - public static string TableName => "CMS_User"; - public static string GuidColumnName => "UserGUID"; - static CmsUserK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") - ); - public static CmsUserK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") - ); -}; -public partial record CmsUserK13(int UserID, string UserName, string? FirstName, string? MiddleName, string? LastName, string? FullName, string? Email, string UserPassword, string? PreferredCultureCode, string? PreferredUICultureCode, bool UserEnabled, bool? UserIsExternal, string? UserPasswordFormat, DateTime? UserCreated, DateTime? LastLogon, string? UserStartingAliasPath, Guid UserGUID, DateTime UserLastModified, string? UserLastLogonInfo, bool? UserIsHidden, bool? UserIsDomain, bool? UserHasAllowedCultures, bool? UserMFRequired, int UserPrivilegeLevel, string? UserSecurityStamp, byte[]? UserMFSecret, long? UserMFTimestep) : ICmsUser, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserID"; - public static string TableName => "CMS_User"; - public static string GuidColumnName => "UserGUID"; - static CmsUserK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep")); - public static CmsUserK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsUserSetting.cs b/KVA/Migration.Toolkit.Source/Model/CmsUserSetting.cs deleted file mode 100644 index e9505747..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsUserSetting.cs +++ /dev/null @@ -1,105 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsUserSetting : ISourceModel -{ - int UserSettingsID { get; } - string? UserNickName { get; } - string? UserSignature { get; } - string? UserURLReferrer { get; } - string? UserCampaign { get; } - string? UserCustomData { get; } - string? UserRegistrationInfo { get; } - DateTime? UserActivationDate { get; } - int? UserActivatedByUserID { get; } - int? UserTimeZoneID { get; } - int? UserAvatarID { get; } - int? UserGender { get; } - DateTime? UserDateOfBirth { get; } - Guid UserSettingsUserGUID { get; } - int UserSettingsUserID { get; } - bool? UserWaitingForApproval { get; } - string? UserDialogsConfiguration { get; } - string? UserDescription { get; } - Guid? UserAuthenticationGUID { get; } - string? UserSkype { get; } - string? UserIM { get; } - string? UserPhone { get; } - string? UserPosition { get; } - bool? UserLogActivities { get; } - string? UserPasswordRequestHash { get; } - int? UserInvalidLogOnAttempts { get; } - string? UserInvalidLogOnAttemptsHash { get; } - int? UserAccountLockReason { get; } - DateTime? UserPasswordLastChanged { get; } - bool? UserShowIntroductionTile { get; } - string? UserDashboardApplications { get; } - string? UserDismissedSmartTips { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsUserSettingK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsUserSettingK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsUserSettingK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsUserSettingK11.IsAvailable(version), - { Major: 12 } => CmsUserSettingK12.IsAvailable(version), - { Major: 13 } => CmsUserSettingK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_UserSettings"; - static string ISourceModel.GuidColumnName => "UserSettingsUserGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsUserSetting ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsUserSettingK11.FromReader(reader, version), - { Major: 12 } => CmsUserSettingK12.FromReader(reader, version), - { Major: 13 } => CmsUserSettingK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsUserSettingK11(int UserSettingsID, string? UserNickName, string? UserPicture, string? UserSignature, string? UserURLReferrer, string? UserCampaign, string? UserMessagingNotificationEmail, string? UserCustomData, string? UserRegistrationInfo, string? UserPreferences, DateTime? UserActivationDate, int? UserActivatedByUserID, int? UserTimeZoneID, int? UserAvatarID, int? UserBadgeID, int? UserActivityPoints, int? UserForumPosts, int? UserBlogComments, int? UserGender, DateTime? UserDateOfBirth, int? UserMessageBoardPosts, Guid UserSettingsUserGUID, int UserSettingsUserID, string? WindowsLiveID, int? UserBlogPosts, bool? UserWaitingForApproval, string? UserDialogsConfiguration, string? UserDescription, string? UserUsedWebParts, string? UserUsedWidgets, string? UserFacebookID, Guid? UserAuthenticationGUID, string? UserSkype, string? UserIM, string? UserPhone, string? UserPosition, string? UserLinkedInID, bool? UserLogActivities, string? UserPasswordRequestHash, int? UserInvalidLogOnAttempts, string? UserInvalidLogOnAttemptsHash, string? UserAvatarType, int? UserAccountLockReason, DateTime? UserPasswordLastChanged, bool? UserShowIntroductionTile, string? UserDashboardApplications, string? UserDismissedSmartTips, string? CUSTOM_2) : ICmsUserSetting, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserSettingsID"; - public static string TableName => "CMS_UserSettings"; - public static string GuidColumnName => "UserSettingsUserGUID"; - static CmsUserSettingK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserMessagingNotificationEmail"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips"), reader.Unbox("CUSTOM_2") - ); - public static CmsUserSettingK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserMessagingNotificationEmail"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips"), reader.Unbox("CUSTOM_2") - ); -}; -public partial record CmsUserSettingK12(int UserSettingsID, string? UserNickName, string? UserPicture, string? UserSignature, string? UserURLReferrer, string? UserCampaign, string? UserCustomData, string? UserRegistrationInfo, string? UserPreferences, DateTime? UserActivationDate, int? UserActivatedByUserID, int? UserTimeZoneID, int? UserAvatarID, int? UserBadgeID, int? UserActivityPoints, int? UserForumPosts, int? UserBlogComments, int? UserGender, DateTime? UserDateOfBirth, int? UserMessageBoardPosts, Guid UserSettingsUserGUID, int UserSettingsUserID, string? WindowsLiveID, int? UserBlogPosts, bool? UserWaitingForApproval, string? UserDialogsConfiguration, string? UserDescription, string? UserUsedWebParts, string? UserUsedWidgets, string? UserFacebookID, Guid? UserAuthenticationGUID, string? UserSkype, string? UserIM, string? UserPhone, string? UserPosition, string? UserLinkedInID, bool? UserLogActivities, string? UserPasswordRequestHash, int? UserInvalidLogOnAttempts, string? UserInvalidLogOnAttemptsHash, string? UserAvatarType, int? UserAccountLockReason, DateTime? UserPasswordLastChanged, bool? UserShowIntroductionTile, string? UserDashboardApplications, string? UserDismissedSmartTips) : ICmsUserSetting, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserSettingsID"; - public static string TableName => "CMS_UserSettings"; - public static string GuidColumnName => "UserSettingsUserGUID"; - static CmsUserSettingK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips") - ); - public static CmsUserSettingK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips") - ); -}; -public partial record CmsUserSettingK13(int UserSettingsID, string? UserNickName, string? UserSignature, string? UserURLReferrer, string? UserCampaign, string? UserCustomData, string? UserRegistrationInfo, DateTime? UserActivationDate, int? UserActivatedByUserID, int? UserTimeZoneID, int? UserAvatarID, int? UserGender, DateTime? UserDateOfBirth, Guid UserSettingsUserGUID, int UserSettingsUserID, bool? UserWaitingForApproval, string? UserDialogsConfiguration, string? UserDescription, Guid? UserAuthenticationGUID, string? UserSkype, string? UserIM, string? UserPhone, string? UserPosition, bool? UserLogActivities, string? UserPasswordRequestHash, int? UserInvalidLogOnAttempts, string? UserInvalidLogOnAttemptsHash, int? UserAccountLockReason, DateTime? UserPasswordLastChanged, bool? UserShowIntroductionTile, string? UserDashboardApplications, string? UserDismissedSmartTips, string? SuperSettingsCustomizedKey) : ICmsUserSetting, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserSettingsID"; - public static string TableName => "CMS_UserSettings"; - public static string GuidColumnName => "UserSettingsUserGUID"; - static CmsUserSettingK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips"), reader.Unbox("SuperSettingsCustomizedKey") - ); - public static CmsUserSettingK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips"), reader.Unbox("SuperSettingsCustomizedKey") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/CmsVersionHistory.cs b/KVA/Migration.Toolkit.Source/Model/CmsVersionHistory.cs deleted file mode 100644 index b348bda1..00000000 --- a/KVA/Migration.Toolkit.Source/Model/CmsVersionHistory.cs +++ /dev/null @@ -1,93 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface ICmsVersionHistory : ISourceModel -{ - int VersionHistoryID { get; } - int NodeSiteID { get; } - int? DocumentID { get; } - string NodeXML { get; } - int? ModifiedByUserID { get; } - DateTime ModifiedWhen { get; } - string? VersionNumber { get; } - string? VersionComment { get; } - bool ToBePublished { get; } - DateTime? PublishFrom { get; } - DateTime? PublishTo { get; } - DateTime? WasPublishedFrom { get; } - DateTime? WasPublishedTo { get; } - string? VersionDocumentName { get; } - int? VersionClassID { get; } - int? VersionWorkflowID { get; } - int? VersionWorkflowStepID { get; } - string? VersionNodeAliasPath { get; } - int? VersionDeletedByUserID { get; } - DateTime? VersionDeletedWhen { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => CmsVersionHistoryK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsVersionHistoryK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsVersionHistoryK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => CmsVersionHistoryK11.IsAvailable(version), - { Major: 12 } => CmsVersionHistoryK12.IsAvailable(version), - { Major: 13 } => CmsVersionHistoryK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "CMS_VersionHistory"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsVersionHistory ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => CmsVersionHistoryK11.FromReader(reader, version), - { Major: 12 } => CmsVersionHistoryK12.FromReader(reader, version), - { Major: 13 } => CmsVersionHistoryK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record CmsVersionHistoryK11(int VersionHistoryID, int NodeSiteID, int? DocumentID, string DocumentNamePath, string NodeXML, int? ModifiedByUserID, DateTime ModifiedWhen, string? VersionNumber, string? VersionComment, bool ToBePublished, DateTime? PublishFrom, DateTime? PublishTo, DateTime? WasPublishedFrom, DateTime? WasPublishedTo, string? VersionDocumentName, string? VersionDocumentType, int? VersionClassID, string? VersionMenuRedirectUrl, int? VersionWorkflowID, int? VersionWorkflowStepID, string? VersionNodeAliasPath, int? VersionDeletedByUserID, DateTime? VersionDeletedWhen) : ICmsVersionHistory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "VersionHistoryID"; - public static string TableName => "CMS_VersionHistory"; - public static string GuidColumnName => ""; - static CmsVersionHistoryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") - ); - public static CmsVersionHistoryK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") - ); -}; -public partial record CmsVersionHistoryK12(int VersionHistoryID, int NodeSiteID, int? DocumentID, string DocumentNamePath, string NodeXML, int? ModifiedByUserID, DateTime ModifiedWhen, string? VersionNumber, string? VersionComment, bool ToBePublished, DateTime? PublishFrom, DateTime? PublishTo, DateTime? WasPublishedFrom, DateTime? WasPublishedTo, string? VersionDocumentName, string? VersionDocumentType, int? VersionClassID, string? VersionMenuRedirectUrl, int? VersionWorkflowID, int? VersionWorkflowStepID, string? VersionNodeAliasPath, int? VersionDeletedByUserID, DateTime? VersionDeletedWhen) : ICmsVersionHistory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "VersionHistoryID"; - public static string TableName => "CMS_VersionHistory"; - public static string GuidColumnName => ""; - static CmsVersionHistoryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") - ); - public static CmsVersionHistoryK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") - ); -}; -public partial record CmsVersionHistoryK13(int VersionHistoryID, int NodeSiteID, int? DocumentID, string NodeXML, int? ModifiedByUserID, DateTime ModifiedWhen, string? VersionNumber, string? VersionComment, bool ToBePublished, DateTime? PublishFrom, DateTime? PublishTo, DateTime? WasPublishedFrom, DateTime? WasPublishedTo, string? VersionDocumentName, int? VersionClassID, int? VersionWorkflowID, int? VersionWorkflowStepID, string? VersionNodeAliasPath, int? VersionDeletedByUserID, DateTime? VersionDeletedWhen) : ICmsVersionHistory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "VersionHistoryID"; - public static string TableName => "CMS_VersionHistory"; - public static string GuidColumnName => ""; - static CmsVersionHistoryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionClassID"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") - ); - public static CmsVersionHistoryK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionClassID"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/MediaFile.cs b/KVA/Migration.Toolkit.Source/Model/MediaFile.cs deleted file mode 100644 index 25732d1e..00000000 --- a/KVA/Migration.Toolkit.Source/Model/MediaFile.cs +++ /dev/null @@ -1,91 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface IMediaFile : ISourceModel -{ - int FileID { get; } - string FileName { get; } - string FileTitle { get; } - string FileDescription { get; } - string FileExtension { get; } - string FileMimeType { get; } - string FilePath { get; } - long FileSize { get; } - int? FileImageWidth { get; } - int? FileImageHeight { get; } - Guid FileGUID { get; } - int FileLibraryID { get; } - int FileSiteID { get; } - int? FileCreatedByUserID { get; } - DateTime FileCreatedWhen { get; } - int? FileModifiedByUserID { get; } - DateTime FileModifiedWhen { get; } - string? FileCustomData { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => MediaFileK11.GetPrimaryKeyName(version), - { Major: 12 } => MediaFileK12.GetPrimaryKeyName(version), - { Major: 13 } => MediaFileK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => MediaFileK11.IsAvailable(version), - { Major: 12 } => MediaFileK12.IsAvailable(version), - { Major: 13 } => MediaFileK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "Media_File"; - static string ISourceModel.GuidColumnName => "FileGUID"; //assumtion, class Guid column doesn't change between versions - static IMediaFile ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => MediaFileK11.FromReader(reader, version), - { Major: 12 } => MediaFileK12.FromReader(reader, version), - { Major: 13 } => MediaFileK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record MediaFileK11(int FileID, string FileName, string FileTitle, string FileDescription, string FileExtension, string FileMimeType, string FilePath, long FileSize, int? FileImageWidth, int? FileImageHeight, Guid FileGUID, int FileLibraryID, int FileSiteID, int? FileCreatedByUserID, DateTime FileCreatedWhen, int? FileModifiedByUserID, DateTime FileModifiedWhen, string? FileCustomData) : IMediaFile, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FileID"; - public static string TableName => "Media_File"; - public static string GuidColumnName => "FileGUID"; - static MediaFileK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), reader.Unbox("FileCustomData") - ); - public static MediaFileK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), reader.Unbox("FileCustomData") - ); -}; -public partial record MediaFileK12(int FileID, string FileName, string FileTitle, string FileDescription, string FileExtension, string FileMimeType, string FilePath, long FileSize, int? FileImageWidth, int? FileImageHeight, Guid FileGUID, int FileLibraryID, int FileSiteID, int? FileCreatedByUserID, DateTime FileCreatedWhen, int? FileModifiedByUserID, DateTime FileModifiedWhen, string? FileCustomData) : IMediaFile, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FileID"; - public static string TableName => "Media_File"; - public static string GuidColumnName => "FileGUID"; - static MediaFileK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), reader.Unbox("FileCustomData") - ); - public static MediaFileK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), reader.Unbox("FileCustomData") - ); -}; -public partial record MediaFileK13(int FileID, string FileName, string FileTitle, string FileDescription, string FileExtension, string FileMimeType, string FilePath, long FileSize, int? FileImageWidth, int? FileImageHeight, Guid FileGUID, int FileLibraryID, int FileSiteID, int? FileCreatedByUserID, DateTime FileCreatedWhen, int? FileModifiedByUserID, DateTime FileModifiedWhen, string? FileCustomData) : IMediaFile, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FileID"; - public static string TableName => "Media_File"; - public static string GuidColumnName => "FileGUID"; - static MediaFileK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), reader.Unbox("FileCustomData") - ); - public static MediaFileK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), reader.Unbox("FileCustomData") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/MediaLibrary.cs b/KVA/Migration.Toolkit.Source/Model/MediaLibrary.cs deleted file mode 100644 index 61665711..00000000 --- a/KVA/Migration.Toolkit.Source/Model/MediaLibrary.cs +++ /dev/null @@ -1,84 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface IMediaLibrary : ISourceModel -{ - int LibraryID { get; } - string LibraryName { get; } - string LibraryDisplayName { get; } - string? LibraryDescription { get; } - string LibraryFolder { get; } - int? LibraryAccess { get; } - int LibrarySiteID { get; } - Guid? LibraryGUID { get; } - DateTime? LibraryLastModified { get; } - string? LibraryTeaserPath { get; } - Guid? LibraryTeaserGUID { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => MediaLibraryK11.GetPrimaryKeyName(version), - { Major: 12 } => MediaLibraryK12.GetPrimaryKeyName(version), - { Major: 13 } => MediaLibraryK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => MediaLibraryK11.IsAvailable(version), - { Major: 12 } => MediaLibraryK12.IsAvailable(version), - { Major: 13 } => MediaLibraryK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "Media_Library"; - static string ISourceModel.GuidColumnName => "LibraryGUID"; //assumtion, class Guid column doesn't change between versions - static IMediaLibrary ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => MediaLibraryK11.FromReader(reader, version), - { Major: 12 } => MediaLibraryK12.FromReader(reader, version), - { Major: 13 } => MediaLibraryK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record MediaLibraryK11(int LibraryID, string LibraryName, string LibraryDisplayName, string? LibraryDescription, string LibraryFolder, int? LibraryAccess, int? LibraryGroupID, int LibrarySiteID, Guid? LibraryGUID, DateTime? LibraryLastModified, string? LibraryTeaserPath, Guid? LibraryTeaserGUID) : IMediaLibrary, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "LibraryID"; - public static string TableName => "Media_Library"; - public static string GuidColumnName => "LibraryTeaserGUID"; - static MediaLibraryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), reader.Unbox("LibraryGroupID"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID") - ); - public static MediaLibraryK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), reader.Unbox("LibraryGroupID"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID") - ); -}; -public partial record MediaLibraryK12(int LibraryID, string LibraryName, string LibraryDisplayName, string? LibraryDescription, string LibraryFolder, int? LibraryAccess, int? LibraryGroupID, int LibrarySiteID, Guid? LibraryGUID, DateTime? LibraryLastModified, string? LibraryTeaserPath, Guid? LibraryTeaserGUID) : IMediaLibrary, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "LibraryID"; - public static string TableName => "Media_Library"; - public static string GuidColumnName => "LibraryTeaserGUID"; - static MediaLibraryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), reader.Unbox("LibraryGroupID"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID") - ); - public static MediaLibraryK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), reader.Unbox("LibraryGroupID"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID") - ); -}; -public partial record MediaLibraryK13(int LibraryID, string LibraryName, string LibraryDisplayName, string? LibraryDescription, string LibraryFolder, int? LibraryAccess, int LibrarySiteID, Guid? LibraryGUID, DateTime? LibraryLastModified, string? LibraryTeaserPath, Guid? LibraryTeaserGUID, bool? LibraryUseDirectPathForContent) : IMediaLibrary, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "LibraryID"; - public static string TableName => "Media_Library"; - public static string GuidColumnName => "LibraryTeaserGUID"; - static MediaLibraryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID"), reader.Unbox("LibraryUseDirectPathForContent") - ); - public static MediaLibraryK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID"), reader.Unbox("LibraryUseDirectPathForContent") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/OmActivity.cs b/KVA/Migration.Toolkit.Source/Model/OmActivity.cs deleted file mode 100644 index d6191618..00000000 --- a/KVA/Migration.Toolkit.Source/Model/OmActivity.cs +++ /dev/null @@ -1,92 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface IOmActivity : ISourceModel -{ - int ActivityID { get; } - int ActivityContactID { get; } - DateTime? ActivityCreated { get; } - string ActivityType { get; } - int? ActivityItemID { get; } - int? ActivityItemDetailID { get; } - string? ActivityValue { get; } - string? ActivityURL { get; } - string? ActivityTitle { get; } - int ActivitySiteID { get; } - string? ActivityComment { get; } - string? ActivityCampaign { get; } - string? ActivityURLReferrer { get; } - string? ActivityCulture { get; } - int? ActivityNodeID { get; } - string? ActivityUTMSource { get; } - string? ActivityABVariantName { get; } - long ActivityURLHash { get; } - string? ActivityUTMContent { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => OmActivityK11.GetPrimaryKeyName(version), - { Major: 12 } => OmActivityK12.GetPrimaryKeyName(version), - { Major: 13 } => OmActivityK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => OmActivityK11.IsAvailable(version), - { Major: 12 } => OmActivityK12.IsAvailable(version), - { Major: 13 } => OmActivityK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "OM_Activity"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static IOmActivity ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => OmActivityK11.FromReader(reader, version), - { Major: 12 } => OmActivityK12.FromReader(reader, version), - { Major: 13 } => OmActivityK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record OmActivityK11(int ActivityID, int ActivityContactID, DateTime? ActivityCreated, string ActivityType, int? ActivityItemID, int? ActivityItemDetailID, string? ActivityValue, string? ActivityURL, string? ActivityTitle, int ActivitySiteID, string? ActivityComment, string? ActivityCampaign, string? ActivityURLReferrer, string? ActivityCulture, int? ActivityNodeID, string? ActivityUTMSource, string? ActivityABVariantName, string? ActivityMVTCombinationName, long ActivityURLHash, string? ActivityUTMContent) : IOmActivity, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ActivityID"; - public static string TableName => "OM_Activity"; - public static string GuidColumnName => ""; - static OmActivityK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") - ); - public static OmActivityK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") - ); -}; -public partial record OmActivityK12(int ActivityID, int ActivityContactID, DateTime? ActivityCreated, string ActivityType, int? ActivityItemID, int? ActivityItemDetailID, string? ActivityValue, string? ActivityURL, string? ActivityTitle, int ActivitySiteID, string? ActivityComment, string? ActivityCampaign, string? ActivityURLReferrer, string? ActivityCulture, int? ActivityNodeID, string? ActivityUTMSource, string? ActivityABVariantName, string? ActivityMVTCombinationName, long ActivityURLHash, string? ActivityUTMContent) : IOmActivity, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ActivityID"; - public static string TableName => "OM_Activity"; - public static string GuidColumnName => ""; - static OmActivityK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") - ); - public static OmActivityK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") - ); -}; -public partial record OmActivityK13(int ActivityID, int ActivityContactID, DateTime? ActivityCreated, string ActivityType, int? ActivityItemID, int? ActivityItemDetailID, string? ActivityValue, string? ActivityURL, string? ActivityTitle, int ActivitySiteID, string? ActivityComment, string? ActivityCampaign, string? ActivityURLReferrer, string? ActivityCulture, int? ActivityNodeID, string? ActivityUTMSource, string? ActivityABVariantName, long ActivityURLHash, string? ActivityUTMContent) : IOmActivity, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ActivityID"; - public static string TableName => "OM_Activity"; - public static string GuidColumnName => ""; - static OmActivityK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") - ); - public static OmActivityK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/OmContact.cs b/KVA/Migration.Toolkit.Source/Model/OmContact.cs deleted file mode 100644 index d0729534..00000000 --- a/KVA/Migration.Toolkit.Source/Model/OmContact.cs +++ /dev/null @@ -1,104 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface IOmContact : ISourceModel -{ - int ContactID { get; } - string? ContactFirstName { get; } - string? ContactMiddleName { get; } - string? ContactLastName { get; } - string? ContactJobTitle { get; } - string? ContactAddress1 { get; } - string? ContactCity { get; } - string? ContactZIP { get; } - int? ContactStateID { get; } - int? ContactCountryID { get; } - string? ContactMobilePhone { get; } - string? ContactBusinessPhone { get; } - string? ContactEmail { get; } - DateTime? ContactBirthday { get; } - int? ContactGender { get; } - int? ContactStatusID { get; } - string? ContactNotes { get; } - int? ContactOwnerUserID { get; } - bool? ContactMonitored { get; } - Guid ContactGUID { get; } - DateTime ContactLastModified { get; } - DateTime ContactCreated { get; } - int? ContactBounces { get; } - string? ContactCampaign { get; } - string? ContactSalesForceLeadID { get; } - bool? ContactSalesForceLeadReplicationDisabled { get; } - DateTime? ContactSalesForceLeadReplicationDateTime { get; } - DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; } - string? ContactCompanyName { get; } - bool? ContactSalesForceLeadReplicationRequired { get; } - int? ContactPersonaID { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => OmContactK11.GetPrimaryKeyName(version), - { Major: 12 } => OmContactK12.GetPrimaryKeyName(version), - { Major: 13 } => OmContactK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => OmContactK11.IsAvailable(version), - { Major: 12 } => OmContactK12.IsAvailable(version), - { Major: 13 } => OmContactK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "OM_Contact"; - static string ISourceModel.GuidColumnName => "ContactGUID"; //assumtion, class Guid column doesn't change between versions - static IOmContact ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => OmContactK11.FromReader(reader, version), - { Major: 12 } => OmContactK12.FromReader(reader, version), - { Major: 13 } => OmContactK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record OmContactK11(int ContactID, string? ContactFirstName, string? ContactMiddleName, string? ContactLastName, string? ContactJobTitle, string? ContactAddress1, string? ContactCity, string? ContactZIP, int? ContactStateID, int? ContactCountryID, string? ContactMobilePhone, string? ContactBusinessPhone, string? ContactEmail, DateTime? ContactBirthday, int? ContactGender, int? ContactStatusID, string? ContactNotes, int? ContactOwnerUserID, bool? ContactMonitored, Guid ContactGUID, DateTime ContactLastModified, DateTime ContactCreated, int? ContactBounces, string? ContactCampaign, string? ContactSalesForceLeadID, bool? ContactSalesForceLeadReplicationDisabled, DateTime? ContactSalesForceLeadReplicationDateTime, DateTime? ContactSalesForceLeadReplicationSuspensionDateTime, string? ContactCompanyName, bool? ContactSalesForceLeadReplicationRequired, int? ContactPersonaID) : IOmContact, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ContactID"; - public static string TableName => "OM_Contact"; - public static string GuidColumnName => "ContactGUID"; - static OmContactK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") - ); - public static OmContactK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") - ); -}; -public partial record OmContactK12(int ContactID, string? ContactFirstName, string? ContactMiddleName, string? ContactLastName, string? ContactJobTitle, string? ContactAddress1, string? ContactCity, string? ContactZIP, int? ContactStateID, int? ContactCountryID, string? ContactMobilePhone, string? ContactBusinessPhone, string? ContactEmail, DateTime? ContactBirthday, int? ContactGender, int? ContactStatusID, string? ContactNotes, int? ContactOwnerUserID, bool? ContactMonitored, Guid ContactGUID, DateTime ContactLastModified, DateTime ContactCreated, int? ContactBounces, string? ContactCampaign, string? ContactSalesForceLeadID, bool? ContactSalesForceLeadReplicationDisabled, DateTime? ContactSalesForceLeadReplicationDateTime, DateTime? ContactSalesForceLeadReplicationSuspensionDateTime, string? ContactCompanyName, bool? ContactSalesForceLeadReplicationRequired, int? ContactPersonaID, string? FirstUserAgent, string? FirstIPAddress, string? FirstRequestUrl, string? KenticoUrlReferrer, string? KenticoContactRegionName, string? KenticoContactRegionCode, string? KenticoContactPostalCode, string? KenticoContactCampaignSource, string? KenticoContactCampaignContent, bool? NeedRecalculation, int? ProfileScore, int? EngagementScore, int? TotalScore, int? Zone, Guid? DynamicsLeadGuid, Guid? DynamicsContactGuid, string? DynamicsAccountType, string? DynamicsAccountStatus, bool? LegitimateInterest, string? DynamicsActivePartnerships, DateTime? DynamicsDateOfSync, bool? PairedWithDynamicsCrm, DateTime? FirstPairDate, int? PairedBy, bool? IsArchived, DateTime? ArchivationDate, bool? HasFreeEmail, int? SameDomainContacts, string? AreYouLookingForCMS, string? Role, string? KenticoContactBusinessType, string? MarketingAutomationVariant, string? KontentIntercomUserID, string? KontentGoogleAnalyticsUserID, string? KontentAmplitudeUserID) : IOmContact, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ContactID"; - public static string TableName => "OM_Contact"; - public static string GuidColumnName => "ContactGUID"; - static OmContactK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID"), reader.Unbox("FirstUserAgent"), reader.Unbox("FirstIPAddress"), reader.Unbox("FirstRequestUrl"), reader.Unbox("KenticoUrlReferrer"), reader.Unbox("KenticoContactRegionName"), reader.Unbox("KenticoContactRegionCode"), reader.Unbox("KenticoContactPostalCode"), reader.Unbox("KenticoContactCampaignSource"), reader.Unbox("KenticoContactCampaignContent"), reader.Unbox("NeedRecalculation"), reader.Unbox("ProfileScore"), reader.Unbox("EngagementScore"), reader.Unbox("TotalScore"), reader.Unbox("Zone"), reader.Unbox("DynamicsLeadGuid"), reader.Unbox("DynamicsContactGuid"), reader.Unbox("DynamicsAccountType"), reader.Unbox("DynamicsAccountStatus"), reader.Unbox("LegitimateInterest"), reader.Unbox("DynamicsActivePartnerships"), reader.Unbox("DynamicsDateOfSync"), reader.Unbox("PairedWithDynamicsCrm"), reader.Unbox("FirstPairDate"), reader.Unbox("PairedBy"), reader.Unbox("IsArchived"), reader.Unbox("ArchivationDate"), reader.Unbox("HasFreeEmail"), reader.Unbox("SameDomainContacts"), reader.Unbox("AreYouLookingForCMS"), reader.Unbox("Role"), reader.Unbox("KenticoContactBusinessType"), reader.Unbox("MarketingAutomationVariant"), reader.Unbox("KontentIntercomUserID"), reader.Unbox("KontentGoogleAnalyticsUserID"), reader.Unbox("KontentAmplitudeUserID") - ); - public static OmContactK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID"), reader.Unbox("FirstUserAgent"), reader.Unbox("FirstIPAddress"), reader.Unbox("FirstRequestUrl"), reader.Unbox("KenticoUrlReferrer"), reader.Unbox("KenticoContactRegionName"), reader.Unbox("KenticoContactRegionCode"), reader.Unbox("KenticoContactPostalCode"), reader.Unbox("KenticoContactCampaignSource"), reader.Unbox("KenticoContactCampaignContent"), reader.Unbox("NeedRecalculation"), reader.Unbox("ProfileScore"), reader.Unbox("EngagementScore"), reader.Unbox("TotalScore"), reader.Unbox("Zone"), reader.Unbox("DynamicsLeadGuid"), reader.Unbox("DynamicsContactGuid"), reader.Unbox("DynamicsAccountType"), reader.Unbox("DynamicsAccountStatus"), reader.Unbox("LegitimateInterest"), reader.Unbox("DynamicsActivePartnerships"), reader.Unbox("DynamicsDateOfSync"), reader.Unbox("PairedWithDynamicsCrm"), reader.Unbox("FirstPairDate"), reader.Unbox("PairedBy"), reader.Unbox("IsArchived"), reader.Unbox("ArchivationDate"), reader.Unbox("HasFreeEmail"), reader.Unbox("SameDomainContacts"), reader.Unbox("AreYouLookingForCMS"), reader.Unbox("Role"), reader.Unbox("KenticoContactBusinessType"), reader.Unbox("MarketingAutomationVariant"), reader.Unbox("KontentIntercomUserID"), reader.Unbox("KontentGoogleAnalyticsUserID"), reader.Unbox("KontentAmplitudeUserID") - ); -}; -public partial record OmContactK13(int ContactID, string? ContactFirstName, string? ContactMiddleName, string? ContactLastName, string? ContactJobTitle, string? ContactAddress1, string? ContactCity, string? ContactZIP, int? ContactStateID, int? ContactCountryID, string? ContactMobilePhone, string? ContactBusinessPhone, string? ContactEmail, DateTime? ContactBirthday, int? ContactGender, int? ContactStatusID, string? ContactNotes, int? ContactOwnerUserID, bool? ContactMonitored, Guid ContactGUID, DateTime ContactLastModified, DateTime ContactCreated, int? ContactBounces, string? ContactCampaign, string? ContactSalesForceLeadID, bool? ContactSalesForceLeadReplicationDisabled, DateTime? ContactSalesForceLeadReplicationDateTime, DateTime? ContactSalesForceLeadReplicationSuspensionDateTime, string? ContactCompanyName, bool? ContactSalesForceLeadReplicationRequired, int? ContactPersonaID) : IOmContact, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ContactID"; - public static string TableName => "OM_Contact"; - public static string GuidColumnName => "ContactGUID"; - static OmContactK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") - ); - public static OmContactK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Model/OmContactStatus.cs b/KVA/Migration.Toolkit.Source/Model/OmContactStatus.cs deleted file mode 100644 index a9286d44..00000000 --- a/KVA/Migration.Toolkit.Source/Model/OmContactStatus.cs +++ /dev/null @@ -1,77 +0,0 @@ -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.Source.Model; -public partial interface IOmContactStatus : ISourceModel -{ - int ContactStatusID { get; } - string ContactStatusName { get; } - string ContactStatusDisplayName { get; } - string? ContactStatusDescription { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch - { - { Major: 11 } => OmContactStatusK11.GetPrimaryKeyName(version), - { Major: 12 } => OmContactStatusK12.GetPrimaryKeyName(version), - { Major: 13 } => OmContactStatusK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch - { - { Major: 11 } => OmContactStatusK11.IsAvailable(version), - { Major: 12 } => OmContactStatusK12.IsAvailable(version), - { Major: 13 } => OmContactStatusK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - static string ISourceModel.TableName => "OM_ContactStatus"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static IOmContactStatus ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch - { - { Major: 11 } => OmContactStatusK11.FromReader(reader, version), - { Major: 12 } => OmContactStatusK12.FromReader(reader, version), - { Major: 13 } => OmContactStatusK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; -} -public partial record OmContactStatusK11(int ContactStatusID, string ContactStatusName, string ContactStatusDisplayName, string? ContactStatusDescription) : IOmContactStatus, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ContactStatusID"; - public static string TableName => "OM_ContactStatus"; - public static string GuidColumnName => ""; - static OmContactStatusK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") - ); - public static OmContactStatusK11 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") - ); -}; -public partial record OmContactStatusK12(int ContactStatusID, string ContactStatusName, string ContactStatusDisplayName, string? ContactStatusDescription) : IOmContactStatus, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ContactStatusID"; - public static string TableName => "OM_ContactStatus"; - public static string GuidColumnName => ""; - static OmContactStatusK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") - ); - public static OmContactStatusK12 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") - ); -}; -public partial record OmContactStatusK13(int ContactStatusID, string ContactStatusName, string ContactStatusDisplayName, string? ContactStatusDescription) : IOmContactStatus, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ContactStatusID"; - public static string TableName => "OM_ContactStatus"; - public static string GuidColumnName => ""; - static OmContactStatusK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") - ); - public static OmContactStatusK13 FromReader(IDataReader reader, SemanticVersion version) => new( - reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") - ); -}; - diff --git a/KVA/Migration.Toolkit.Source/Providers/ContentItemNameProvider.cs b/KVA/Migration.Toolkit.Source/Providers/ContentItemNameProvider.cs deleted file mode 100644 index 8dd1bc87..00000000 --- a/KVA/Migration.Toolkit.Source/Providers/ContentItemNameProvider.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CMS.Base; -using CMS.ContentEngine.Internal; -using CMS.Helpers; - -namespace Migration.Toolkit.Source.Providers; - -internal class ContentItemNameProvider -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) => this.codeNameValidator = codeNameValidator; - - public Task Get(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); - } - - async Task Get(string name) - { - string codeName = ValidationHelper.GetCodeName(name, useUnicode: false); - - bool isCodeNameValid = ValidationHelper.IsCodeName(codeName); - - if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) - { - codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); - } - - var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); - - return await uniqueCodeNameProvider.GetUniqueValue(codeName); - } - - return Get(name); - } -} diff --git a/KVA/Migration.Toolkit.Source/Providers/ContentItemNameValidator.cs b/KVA/Migration.Toolkit.Source/Providers/ContentItemNameValidator.cs deleted file mode 100644 index e8200cb0..00000000 --- a/KVA/Migration.Toolkit.Source/Providers/ContentItemNameValidator.cs +++ /dev/null @@ -1,18 +0,0 @@ -using CMS.ContentEngine.Internal; - -namespace Migration.Toolkit.Source.Providers; - -internal class ContentItemNameValidator : IContentItemNameValidator -{ - /// - public bool IsUnique(string name) => IsUnique(0, name); - - - /// - public bool IsUnique(int id, string name) - { - var contentItemInfo = new ContentItemInfo { ContentItemID = id, ContentItemName = name }; - - return contentItemInfo.CheckUniqueCodeName(); - } -} diff --git a/KVA/Migration.Toolkit.Source/Providers/UniqueContentItemNameProvider.cs b/KVA/Migration.Toolkit.Source/Providers/UniqueContentItemNameProvider.cs deleted file mode 100644 index 24e0dd5c..00000000 --- a/KVA/Migration.Toolkit.Source/Providers/UniqueContentItemNameProvider.cs +++ /dev/null @@ -1,38 +0,0 @@ -using CMS.Base; -using CMS.ContentEngine.Internal; - -namespace Migration.Toolkit.Source.Providers; - -internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) - : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) => this.codeNameValidator = codeNameValidator; - - public override Task GetUniqueValue(string inputValue) => base.GetUniqueValue(AddSuffix(inputValue)); - - - private string AddSuffix(string codeName) - { - string randomSuffix = GetRandomSuffix(); - string codeNameWithSuffix = codeName += randomSuffix; - - if (codeNameWithSuffix.Length > MaxLength) - { - int availableLength = MaxLength - randomSuffix.Length; - - codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; - } - - return codeNameWithSuffix; - } - - - /// - protected override Task IsValueUnique(string value) => Task.FromResult(codeNameValidator.IsUnique(value)); -} diff --git a/KVA/Migration.Toolkit.Source/Services/IMediaFileMigrator.cs b/KVA/Migration.Toolkit.Source/Services/IMediaFileMigrator.cs deleted file mode 100644 index 0e7a9237..00000000 --- a/KVA/Migration.Toolkit.Source/Services/IMediaFileMigrator.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; - -namespace Migration.Toolkit.Source.Services; - -public interface IMediaFileMigrator -{ - Task Handle(MigrateMediaLibrariesCommand request, CancellationToken cancellationToken); -} diff --git a/KVA/Migration.Toolkit.Source/Services/IPrimaryKeyLocatorService.cs b/KVA/Migration.Toolkit.Source/Services/IPrimaryKeyLocatorService.cs deleted file mode 100644 index b48944a2..00000000 --- a/KVA/Migration.Toolkit.Source/Services/IPrimaryKeyLocatorService.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Linq.Expressions; - -namespace Migration.Toolkit.Source.Services; - -public record SourceTargetKeyMapping(int SourceId, int TargetId); - -public interface IPrimaryKeyLocatorService -{ - bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); - IEnumerable SelectAll(Expression> keyNameSelector); -} diff --git a/KVA/Migration.Toolkit.Source/Services/Model/AttachmentSelectorItem.cs b/KVA/Migration.Toolkit.Source/Services/Model/AttachmentSelectorItem.cs deleted file mode 100644 index 3951a5d9..00000000 --- a/KVA/Migration.Toolkit.Source/Services/Model/AttachmentSelectorItem.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Newtonsoft.Json; - -namespace Migration.Toolkit.Source.Services.Model; - -/// Represents an item for the attachment selector. -public class AttachmentSelectorItem -{ - /// Attachment GUID. - [JsonProperty("fileGuid")] - public Guid FileGuid { get; set; } -} diff --git a/KVA/Migration.Toolkit.Source/Services/Model/EditableAreasConfiguration.cs b/KVA/Migration.Toolkit.Source/Services/Model/EditableAreasConfiguration.cs deleted file mode 100644 index 0f789398..00000000 --- a/KVA/Migration.Toolkit.Source/Services/Model/EditableAreasConfiguration.cs +++ /dev/null @@ -1,192 +0,0 @@ -using System.Runtime.Serialization; - -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Migration.Toolkit.Source.Services.Model; - -#region Copied from Kentico assembly - -[DataContract(Name = "Configuration", Namespace = "")] -public sealed class EditableAreasConfiguration -{ - /// - /// Creates an instance of class. - /// - public EditableAreasConfiguration() => EditableAreas = []; - - /// Editable areas within the page. - [DataMember] - [JsonProperty("editableAreas")] - public List EditableAreas { get; private set; } -} - -/// -/// Represents configuration of editable area within the instance. -/// -[DataContract(Name = "EditableArea", Namespace = "")] -public sealed class EditableAreaConfiguration -{ - /// - /// Creates an instance of class. - /// - public EditableAreaConfiguration() => Sections = []; - - /// Identifier of the editable area. - [DataMember] - [JsonProperty("identifier")] - public string Identifier { get; set; } - - /// Sections within editable area. - [DataMember] - [JsonProperty("sections")] - public List Sections { get; private set; } - - /// - /// A flag indicating whether the output of the individual widgets within the editable area can be cached. The default - /// value is false. - /// - public bool AllowWidgetOutputCache { get; set; } - - /// - /// An absolute expiration date for the cached output of the individual widgets. - /// - public DateTimeOffset? WidgetOutputCacheExpiresOn { get; set; } - - /// - /// The length of time from the first request to cache the output of the individual widgets. - /// - public TimeSpan? WidgetOutputCacheExpiresAfter { get; set; } - - /// - /// The time after which the cached output of the individual widgets should be evicted if it has not been accessed. - /// - public TimeSpan? WidgetOutputCacheExpiresSliding { get; set; } -} - -/// -/// Represents configuration of section within the -/// instance. -/// -[DataContract(Name = "Section", Namespace = "")] -public sealed class SectionConfiguration -{ - /// - /// Creates an instance of class. - /// - public SectionConfiguration() => Zones = []; - - /// Identifier of the section. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Type section identifier. - [DataMember] - [JsonProperty("type")] - public string TypeIdentifier { get; set; } - - /// Section properties. - [DataMember] - [JsonProperty("properties")] - // public ISectionProperties Properties { get; set; } - public JObject Properties { get; set; } - - /// Zones within the section. - [DataMember] - [JsonProperty("zones")] - public List Zones { get; private set; } -} - -/// -/// Represents the zone within the -/// configuration class. -/// -[DataContract(Name = "Zone", Namespace = "")] -public sealed class ZoneConfiguration -{ - /// - /// Creates an instance of class. - /// - public ZoneConfiguration() => Widgets = []; - - /// Identifier of the widget zone. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Name of the widget zone. - [DataMember] - [JsonProperty("name")] - public string Name { get; set; } - - /// List of widgets within the zone. - [DataMember] - [JsonProperty("widgets")] - public List Widgets { get; private set; } -} - -/// -/// Represents the configuration of a widget within the -/// list. -/// -[DataContract(Name = "Widget", Namespace = "")] -public sealed class WidgetConfiguration -{ - /// - /// Creates an instance of class. - /// - public WidgetConfiguration() => Variants = []; - - /// Identifier of the widget instance. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Type widget identifier. - [DataMember] - [JsonProperty("type")] - public string TypeIdentifier { get; set; } - - /// Personalization condition type identifier. - [DataMember] - [JsonProperty("conditionType")] - public string PersonalizationConditionTypeIdentifier { get; set; } - - /// List of widget variants. - [DataMember] - [JsonProperty("variants")] - public List Variants { get; set; } -} - -/// -/// Represents the configuration variant of a widget within the -/// list. -/// -[DataContract(Name = "Variant", Namespace = "")] -public sealed class WidgetVariantConfiguration -{ - /// Identifier of the variant instance. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Widget variant name. - [DataMember] - [JsonProperty("name")] - public string Name { get; set; } - - /// Widget variant properties. - [DataMember] - [JsonProperty("properties")] - // public IWidgetProperties Properties { get; set; } - public JObject Properties { get; set; } - - /// Widget variant personalization condition type. - /// Only personalization condition type parameters are serialized to JSON. - [DataMember] - [JsonProperty("conditionTypeParameters")] - public JObject PersonalizationConditionType { get; set; } -} - -#endregion diff --git a/KVA/Migration.Toolkit.Source/Services/Model/PageSelectorItem.cs b/KVA/Migration.Toolkit.Source/Services/Model/PageSelectorItem.cs deleted file mode 100644 index 25c44f01..00000000 --- a/KVA/Migration.Toolkit.Source/Services/Model/PageSelectorItem.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Newtonsoft.Json; - -namespace Migration.Toolkit.Source.Services.Model; - -/// Represents an item for a page selector. -public class PageSelectorItem -{ - /// Node Guid of a page. - [JsonProperty("nodeGuid")] - public Guid NodeGuid { get; set; } -} diff --git a/KVA/Migration.Toolkit.Source/Services/Model/PageTemplateConfiguration.cs b/KVA/Migration.Toolkit.Source/Services/Model/PageTemplateConfiguration.cs deleted file mode 100644 index 0ab5cc46..00000000 --- a/KVA/Migration.Toolkit.Source/Services/Model/PageTemplateConfiguration.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Runtime.Serialization; - -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Migration.Toolkit.Source.Services.Model; - -/// -/// Page template configuration for the instance. -/// -[DataContract(Name = "PageTemplate", Namespace = "")] -public class PageTemplateConfiguration -{ - /// Identifier of the page template. - [DataMember] - [JsonProperty("identifier")] - public string Identifier { get; set; } - - /// - /// Identifier of the page template configuration based on which the page was created. - /// - [DataMember] - [JsonProperty("configurationIdentifier")] - public Guid ConfigurationIdentifier { get; set; } - - /// Page template properties. - [DataMember] - [JsonProperty("properties")] - public JObject Properties { get; set; } -} diff --git a/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs b/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs deleted file mode 100644 index 91b0079f..00000000 --- a/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs +++ /dev/null @@ -1,216 +0,0 @@ -using System.Linq.Expressions; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.Source.Model; - -namespace Migration.Toolkit.Source.Services; - -public class PrimaryKeyLocatorService( - ILogger logger, - IDbContextFactory kxpContextFactory, - ModelFacade modelFacade -) : IPrimaryKeyLocatorService -{ - public IEnumerable SelectAll(Expression> keyNameSelector) - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - string memberName = keyNameSelector.GetMemberName(); - - logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); - - if (sourceType == typeof(ICmsUser) && memberName == nameof(ICmsUser.UserID)) - { - var sourceUsers = modelFacade.SelectAll().ToList(); - var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); - - var result = sourceUsers.Join(targetUsers, - a => new CmsUserKey(a.UserGUID, a.UserName), - b => new CmsUserKey(b.UserGuid, b.UserName), - (a, b) => new SourceTargetKeyMapping(a.UserID, b.UserId), - new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(IOmContact) && memberName == nameof(IOmContact.ContactID)) - { - var source = modelFacade.SelectAll() - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactID, x.ContactGUID }).ToList(); - var target = kxpContext.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - - var result = source.Join(target, - a => a.ContactGUID, - b => b.ContactGuid, - (a, b) => new SourceTargetKeyMapping(a.ContactID, b.ContactId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(ICmsState) && memberName == nameof(ICmsState.StateID)) - { - var source = modelFacade.SelectAll().Select(x => new { x.StateID, x.StateName }).ToList(); - var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - - var result = source.Join(target, - a => a.StateName, - b => b.StateName, - (a, b) => new SourceTargetKeyMapping(a.StateID, b.StateId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(ICmsCountry) && memberName == nameof(ICmsCountry.CountryID)) - { - var source = modelFacade.SelectAll().Select(x => new { x.CountryID, x.CountryName }).ToList(); - var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - - var result = source.Join(target, - a => a.CountryName, - b => b.CountryName, - (a, b) => new SourceTargetKeyMapping(a.CountryID, b.CountryId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - - throw new NotImplementedException(); - } - - public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - targetId = -1; - try - { - if (sourceType == typeof(ICmsResource)) - { - var sourceGuid = modelFacade.SelectById(sourceId)?.ResourceGUID; - targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == sourceGuid).Select(x => x.ResourceId).Single(); - return true; - } - - if (sourceType == typeof(ICmsClass)) - { - var sourceGuid = modelFacade.SelectById(sourceId)?.ClassGUID; - targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == sourceGuid).Select(x => x.ClassId).Single(); - return true; - } - - if (sourceType == typeof(ICmsUser)) - { - var source = modelFacade.SelectById(sourceId); - targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == source.UserGUID || x.UserName == source.UserName).Select(x => x.UserId).Single(); - return true; - } - - if (sourceType == typeof(ICmsRole)) - { - var sourceGuid = modelFacade.SelectById(sourceId)?.RoleGUID; - targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == sourceGuid).Select(x => x.RoleId).Single(); - return true; - } - - if (sourceType == typeof(ICmsSite)) - { - var sourceGuid = modelFacade.SelectById(sourceId)?.SiteGUID; - targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == sourceGuid).Select(x => x.ChannelId).Single(); - return true; - } - - if (sourceType == typeof(ICmsState)) - { - string? sourceName = modelFacade.SelectById(sourceId)?.StateName; - targetId = kxpContext.CmsStates.Where(x => x.StateName == sourceName).Select(x => x.StateId).Single(); - return true; - } - - if (sourceType == typeof(ICmsCountry)) - { - string? sourceName = modelFacade.SelectById(sourceId)?.CountryName; - targetId = kxpContext.CmsCountries.Where(x => x.CountryName == sourceName).Select(x => x.CountryId).Single(); - return true; - } - - if (sourceType == typeof(IOmContactStatus)) - { - string? sourceName = modelFacade.SelectById(sourceId)?.ContactStatusName; - targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == sourceName).Select(x => x.ContactStatusId).Single(); - return true; - } - - if (sourceType == typeof(IOmContact)) - { - var sourceGuid = modelFacade.SelectById(sourceId)?.ContactGUID; - targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == sourceGuid).Select(x => x.ContactId).Single(); - return true; - } - } - catch (InvalidOperationException ioex) - { - if (ioex.Message.StartsWith("Sequence contains no elements")) - { - logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - else - { - logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - - return false; - } - finally - { - if (targetId != -1) - { - logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); - } - } - - logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); - targetId = -1; - return false; - } - - private class KeyEqualityComparerWithLambda(Func equalityComparer) : IEqualityComparer - { - public bool Equals(T? x, T? y) => equalityComparer.Invoke(x, y); - - public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; - } - - private record CmsUserKey(Guid UserGuid, string UserName); -} diff --git a/KX13.Extensions/ToolApiController.cs b/KX13.Extensions/ToolApiController.cs new file mode 100644 index 00000000..e6fc4f0d --- /dev/null +++ b/KX13.Extensions/ToolApiController.cs @@ -0,0 +1,246 @@ +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Reflection; +using CMS.Core; +using CMS.DocumentEngine; +using CMS.SiteProvider; +using Kentico.Content.Web.Mvc; +using Kentico.Forms.Web.Mvc; +using Kentico.PageBuilder.Web.Mvc; +using Kentico.PageBuilder.Web.Mvc.PageTemplates; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +public class ToolApiController : Controller +{ + // TODO configure your own secret + private const string Secret = "secret_used_for_http_posts_to_source_instance_change_to_random_key"; + + private readonly IHttpContextAccessor _httpContextAccessor; + + public ToolApiController(IHttpContextAccessor httpContextAccessor) + { + this._httpContextAccessor = httpContextAccessor; + } + + public class ToolInfo + { + public Dictionary> WidgetProperties { get; set; } + public Dictionary> PageTemplateProperties { get; set; } + public Dictionary> SectionProperties { get; set; } + public List PageModels { get; set; } + public string SiteName { get; set; } + } + + public class BodyModel + { + public string Secret { get; set; } + } + + [HttpPost()] + public IActionResult Test([FromBody] BodyModel body) + { + if (!IsLocal(_httpContextAccessor.HttpContext.Request)) + { + return Forbid(); + } + + if (Secret != body?.Secret) + { + return Forbid(); + } + + return Ok(new + { + pong = true + }); + } + + [HttpPost()] + public IActionResult GetAllDefinitions([FromBody] BodyModel body) + { + if (!IsLocal(_httpContextAccessor.HttpContext.Request)) + { + return Forbid(); + } + + if (Secret != body?.Secret) + { + return Forbid(); + } + + var widgetPropertiesResult = new Dictionary>(); + var pageTemplatePropertiesResult = new Dictionary>(); + var sectionPropertiesResult = new Dictionary>(); + var result = new ToolInfo + { + WidgetProperties = widgetPropertiesResult, + PageTemplateProperties = pageTemplatePropertiesResult, + SectionProperties = sectionPropertiesResult, + SiteName = SiteContext.CurrentSiteName + }; + + var allWidgetDefinitions = new ComponentDefinitionProvider().GetAll(); + + foreach (var widgetDefinition in allWidgetDefinitions) + { + var editingFormControlModels = new List(); + widgetPropertiesResult.Add(widgetDefinition.Identifier, editingFormControlModels); + if (widgetDefinition.PropertiesType == null) continue; + foreach (var propertyInfo in widgetDefinition.PropertiesType.GetProperties()) + { + var editingComponent = propertyInfo.GetCustomAttribute(); + if (editingComponent != null) + { + var model = new EditingFormControlModel + { + PropertyName = propertyInfo.Name, + Label = editingComponent.Label, + DefaultValue = editingComponent.DefaultValue, + ExplanationText = editingComponent.ExplanationText, + Tooltip = editingComponent.Tooltip, + Order = editingComponent.Order, + FormComponentIdentifier = editingComponent.FormComponentIdentifier, + }; + editingFormControlModels.Add(model); + } + } + } + + var allPageTemplates = new ComponentDefinitionProvider().GetAll(); + foreach (var pageTemplateDef in allPageTemplates) + { + var results = new List(); + pageTemplatePropertiesResult.Add(pageTemplateDef.Identifier, results); + if (pageTemplateDef.PropertiesType == null) continue; + foreach (var propertyInfo in pageTemplateDef.PropertiesType.GetProperties()) + { + var editingComponent = propertyInfo.GetCustomAttribute(); + if (editingComponent != null) + { + var model = new EditingFormControlModel + { + PropertyName = propertyInfo.Name, + Label = editingComponent.Label, + DefaultValue = editingComponent.DefaultValue, + ExplanationText = editingComponent.ExplanationText, + Tooltip = editingComponent.Tooltip, + Order = editingComponent.Order, + FormComponentIdentifier = editingComponent.FormComponentIdentifier, + }; + results.Add(model); + } + } + } + + var allSectionProperties = new ComponentDefinitionProvider().GetAll(); + foreach (var definition in allSectionProperties) + { + var results = new List(); + sectionPropertiesResult.Add(definition.Identifier, results); + if (definition.PropertiesType == null) continue; + foreach (var propertyInfo in definition.PropertiesType.GetProperties()) + { + var editingComponent = propertyInfo.GetCustomAttribute(); + if (editingComponent != null) + { + var model = new EditingFormControlModel + { + PropertyName = propertyInfo.Name, + Label = editingComponent.Label, + DefaultValue = editingComponent.DefaultValue, + ExplanationText = editingComponent.ExplanationText, + Tooltip = editingComponent.Tooltip, + Order = editingComponent.Order, + FormComponentIdentifier = editingComponent.FormComponentIdentifier, + }; + results.Add(model); + } + } + } + + var allFormComponents = new ComponentDefinitionProvider().GetAll(); + result.PageModels = Service.Resolve().RetrieveMultiple(q => q.AllCultures()).Select(x => (object)new + { + x.NodeSiteName, + x.DocumentID, + x.DocumentCulture, + x.DocumentGUID, + x.NodeGUID, + x.NodeID, + CultureUrl = DocumentURLProvider.GetUrlForCulture(x, x.DocumentCulture), + Url = DocumentURLProvider.GetUrl(x), + }).ToList(); + + return Ok(result); + } + + [HttpPost()] + public IActionResult GetAllFormComponents([FromBody] BodyModel body) + { + if (!IsLocal(_httpContextAccessor.HttpContext.Request)) + { + return Forbid(); + } + + if (Secret != body?.Secret) + { + return Forbid(); + } + + var allFormComponents = new ComponentDefinitionProvider().GetAll(); + + return Ok(allFormComponents.Select(x => new + { + x.Name, + x.Identifier, + })); + } + + private static bool IsLocal(HttpRequest req) + { + var connection = req.HttpContext.Connection; + return connection.RemoteIpAddress != null + ? connection.LocalIpAddress != null + ? connection.RemoteIpAddress.Equals(connection.LocalIpAddress) + : IPAddress.IsLoopback(connection.RemoteIpAddress) + : connection.RemoteIpAddress == null && connection.LocalIpAddress == null; + } + + public class EditingFormControlModel + { + /// + /// Identifier of the form component to be used for editing. + /// + /// + /// The identifier defines a registered via . + /// + /// + public string FormComponentIdentifier { get; set; } + + /// Gets or sets the label of the form component. + /// + public string Label { get; set; } + + /// Gets or sets the default value of the form component. + /// + public object DefaultValue { get; set; } + + /// + /// Gets or sets the explanation text of the form component. + /// + /// + public string ExplanationText { get; set; } + + /// Gets or sets the tooltip of the form component. + /// + public string Tooltip { get; set; } + + /// Gets or sets the order weight of the form component. + /// + public int Order { get; set; } + + public string PropertyName { get; set; } + } +} diff --git a/KX13.Extensions/ToolkitApiController.cs b/KX13.Extensions/ToolkitApiController.cs deleted file mode 100644 index 683f255a..00000000 --- a/KX13.Extensions/ToolkitApiController.cs +++ /dev/null @@ -1,246 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Reflection; -using CMS.Core; -using CMS.DocumentEngine; -using CMS.SiteProvider; -using Kentico.Content.Web.Mvc; -using Kentico.Forms.Web.Mvc; -using Kentico.PageBuilder.Web.Mvc; -using Kentico.PageBuilder.Web.Mvc.PageTemplates; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -public class ToolkitApiController : Controller -{ - // TODO configure your own secret - private const string Secret = "secret_used_for_http_posts_to_source_instance_change_to_random_key"; - - private readonly IHttpContextAccessor _httpContextAccessor; - - public ToolkitApiController(IHttpContextAccessor httpContextAccessor) - { - this._httpContextAccessor = httpContextAccessor; - } - - public class ToolkitInfo - { - public Dictionary> WidgetProperties { get; set; } - public Dictionary> PageTemplateProperties { get; set; } - public Dictionary> SectionProperties { get; set; } - public List PageModels { get; set; } - public string SiteName { get; set; } - } - - public class BodyModel - { - public string Secret { get; set; } - } - - [HttpPost()] - public IActionResult Test([FromBody] BodyModel body) - { - if (!IsLocal(_httpContextAccessor.HttpContext.Request)) - { - return Forbid(); - } - - if (Secret != body?.Secret) - { - return Forbid(); - } - - return Ok(new - { - pong = true - }); - } - - [HttpPost()] - public IActionResult GetAllDefinitions([FromBody] BodyModel body) - { - if (!IsLocal(_httpContextAccessor.HttpContext.Request)) - { - return Forbid(); - } - - if (Secret != body?.Secret) - { - return Forbid(); - } - - var widgetPropertiesResult = new Dictionary>(); - var pageTemplatePropertiesResult = new Dictionary>(); - var sectionPropertiesResult = new Dictionary>(); - var result = new ToolkitInfo - { - WidgetProperties = widgetPropertiesResult, - PageTemplateProperties = pageTemplatePropertiesResult, - SectionProperties = sectionPropertiesResult, - SiteName = SiteContext.CurrentSiteName - }; - - var allWidgetDefinitions = new ComponentDefinitionProvider().GetAll(); - - foreach (var widgetDefinition in allWidgetDefinitions) - { - var editingFormControlModels = new List(); - widgetPropertiesResult.Add(widgetDefinition.Identifier, editingFormControlModels); - if (widgetDefinition.PropertiesType == null) continue; - foreach (var propertyInfo in widgetDefinition.PropertiesType.GetProperties()) - { - var editingComponent = propertyInfo.GetCustomAttribute(); - if (editingComponent != null) - { - var model = new EditingFormControlModel - { - PropertyName = propertyInfo.Name, - Label = editingComponent.Label, - DefaultValue = editingComponent.DefaultValue, - ExplanationText = editingComponent.ExplanationText, - Tooltip = editingComponent.Tooltip, - Order = editingComponent.Order, - FormComponentIdentifier = editingComponent.FormComponentIdentifier, - }; - editingFormControlModels.Add(model); - } - } - } - - var allPageTemplates = new ComponentDefinitionProvider().GetAll(); - foreach (var pageTemplateDef in allPageTemplates) - { - var results = new List(); - pageTemplatePropertiesResult.Add(pageTemplateDef.Identifier, results); - if (pageTemplateDef.PropertiesType == null) continue; - foreach (var propertyInfo in pageTemplateDef.PropertiesType.GetProperties()) - { - var editingComponent = propertyInfo.GetCustomAttribute(); - if (editingComponent != null) - { - var model = new EditingFormControlModel - { - PropertyName = propertyInfo.Name, - Label = editingComponent.Label, - DefaultValue = editingComponent.DefaultValue, - ExplanationText = editingComponent.ExplanationText, - Tooltip = editingComponent.Tooltip, - Order = editingComponent.Order, - FormComponentIdentifier = editingComponent.FormComponentIdentifier, - }; - results.Add(model); - } - } - } - - var allSectionProperties = new ComponentDefinitionProvider().GetAll(); - foreach (var definition in allSectionProperties) - { - var results = new List(); - sectionPropertiesResult.Add(definition.Identifier, results); - if (definition.PropertiesType == null) continue; - foreach (var propertyInfo in definition.PropertiesType.GetProperties()) - { - var editingComponent = propertyInfo.GetCustomAttribute(); - if (editingComponent != null) - { - var model = new EditingFormControlModel - { - PropertyName = propertyInfo.Name, - Label = editingComponent.Label, - DefaultValue = editingComponent.DefaultValue, - ExplanationText = editingComponent.ExplanationText, - Tooltip = editingComponent.Tooltip, - Order = editingComponent.Order, - FormComponentIdentifier = editingComponent.FormComponentIdentifier, - }; - results.Add(model); - } - } - } - - var allFormComponents = new ComponentDefinitionProvider().GetAll(); - result.PageModels = Service.Resolve().RetrieveMultiple(q => q.AllCultures()).Select(x => (object)new - { - x.NodeSiteName, - x.DocumentID, - x.DocumentCulture, - x.DocumentGUID, - x.NodeGUID, - x.NodeID, - CultureUrl = DocumentURLProvider.GetUrlForCulture(x, x.DocumentCulture), - Url = DocumentURLProvider.GetUrl(x), - }).ToList(); - - return Ok(result); - } - - [HttpPost()] - public IActionResult GetAllFormComponents([FromBody] BodyModel body) - { - if (!IsLocal(_httpContextAccessor.HttpContext.Request)) - { - return Forbid(); - } - - if (Secret != body?.Secret) - { - return Forbid(); - } - - var allFormComponents = new ComponentDefinitionProvider().GetAll(); - - return Ok(allFormComponents.Select(x => new - { - x.Name, - x.Identifier, - })); - } - - private static bool IsLocal(HttpRequest req) - { - var connection = req.HttpContext.Connection; - return connection.RemoteIpAddress != null - ? connection.LocalIpAddress != null - ? connection.RemoteIpAddress.Equals(connection.LocalIpAddress) - : IPAddress.IsLoopback(connection.RemoteIpAddress) - : connection.RemoteIpAddress == null && connection.LocalIpAddress == null; - } - - public class EditingFormControlModel - { - /// - /// Identifier of the form component to be used for editing. - /// - /// - /// The identifier defines a registered via . - /// - /// - public string FormComponentIdentifier { get; set; } - - /// Gets or sets the label of the form component. - /// - public string Label { get; set; } - - /// Gets or sets the default value of the form component. - /// - public object DefaultValue { get; set; } - - /// - /// Gets or sets the explanation text of the form component. - /// - /// - public string ExplanationText { get; set; } - - /// Gets or sets the tooltip of the form component. - /// - public string Tooltip { get; set; } - - /// Gets or sets the order weight of the form component. - /// - public int Order { get; set; } - - public string PropertyName { get; set; } - } -} diff --git a/KX13.NET48.Extensions/KX13.NET48.Extensions.csproj.sample b/KX13.NET48.Extensions/KX13.NET48.Extensions.csproj.sample index ac751b01..b4076a5c 100644 --- a/KX13.NET48.Extensions/KX13.NET48.Extensions.csproj.sample +++ b/KX13.NET48.Extensions/KX13.NET48.Extensions.csproj.sample @@ -619,7 +619,7 @@ - + diff --git a/KX13.NET48.Extensions/ToolApiController.NET48.cs b/KX13.NET48.Extensions/ToolApiController.NET48.cs new file mode 100644 index 00000000..3328d724 --- /dev/null +++ b/KX13.NET48.Extensions/ToolApiController.NET48.cs @@ -0,0 +1,237 @@ +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Web.Mvc; +using CMS.Core; +using CMS.DocumentEngine; +using CMS.SiteProvider; +using Kentico.Content.Web.Mvc; +using Kentico.Forms.Web.Mvc; +using Kentico.PageBuilder.Web.Mvc; +using Kentico.PageBuilder.Web.Mvc.PageTemplates; +using Newtonsoft.Json; + +public class ToolApiController : Controller +{ + // TODO configure your own secret + private const string Secret = "secret_used_for_http_posts_to_source_instance_change_to_random_key"; + + public ToolApiController() { } + + public class ToolInfo + { + public Dictionary> WidgetProperties { get; set; } + public Dictionary> PageTemplateProperties { get; set; } + public Dictionary> SectionProperties { get; set; } + public List PageModels { get; set; } + public string SiteName { get; set; } + } + + public class BodyModel + { + public string Secret { get; set; } + } + + [HttpPost()] + public ActionResult Test(BodyModel body) + { + if (!HttpContext.Request.IsLocal) + { + return new HttpNotFoundResult(); + } + + if (Secret != body?.Secret) + { + return new HttpNotFoundResult(); + } + + return ToJsonResult(new + { + pong = true + }); + } + + [HttpPost()] + public ActionResult GetAllDefinitions(BodyModel body) + { + if (!HttpContext.Request.IsLocal) + { + return new HttpNotFoundResult(); + } + + if (Secret != body?.Secret) + { + return new HttpNotFoundResult(); + } + + var widgetPropertiesResult = new Dictionary>(); + var pageTemplatePropertiesResult = new Dictionary>(); + var sectionPropertiesResult = new Dictionary>(); + var result = new ToolInfo + { + WidgetProperties = widgetPropertiesResult, + PageTemplateProperties = pageTemplatePropertiesResult, + SectionProperties = sectionPropertiesResult, + SiteName = SiteContext.CurrentSiteName + }; + + var allWidgetDefinitions = new ComponentDefinitionProvider().GetAll(); + + foreach (var widgetDefinition in allWidgetDefinitions) + { + var editingFormControlModels = new List(); + widgetPropertiesResult.Add(widgetDefinition.Identifier, editingFormControlModels); + if (widgetDefinition.PropertiesType == null) continue; + foreach (var propertyInfo in widgetDefinition.PropertiesType.GetProperties()) + { + var editingComponent = propertyInfo.GetCustomAttribute(); + if (editingComponent != null) + { + var model = new EditingFormControlModel + { + PropertyName = propertyInfo.Name, + Label = editingComponent.Label, + DefaultValue = editingComponent.DefaultValue, + ExplanationText = editingComponent.ExplanationText, + Tooltip = editingComponent.Tooltip, + Order = editingComponent.Order, + FormComponentIdentifier = editingComponent.FormComponentIdentifier, + }; + editingFormControlModels.Add(model); + } + } + } + + var allPageTemplates = new ComponentDefinitionProvider().GetAll(); + foreach (var pageTemplateDef in allPageTemplates) + { + var results = new List(); + pageTemplatePropertiesResult.Add(pageTemplateDef.Identifier, results); + if (pageTemplateDef.PropertiesType == null) continue; + foreach (var propertyInfo in pageTemplateDef.PropertiesType.GetProperties()) + { + var editingComponent = propertyInfo.GetCustomAttribute(); + if (editingComponent != null) + { + var model = new EditingFormControlModel + { + PropertyName = propertyInfo.Name, + Label = editingComponent.Label, + DefaultValue = editingComponent.DefaultValue, + ExplanationText = editingComponent.ExplanationText, + Tooltip = editingComponent.Tooltip, + Order = editingComponent.Order, + FormComponentIdentifier = editingComponent.FormComponentIdentifier, + }; + results.Add(model); + } + } + } + + var allSectionProperties = new ComponentDefinitionProvider().GetAll(); + foreach (var definition in allSectionProperties) + { + var results = new List(); + sectionPropertiesResult.Add(definition.Identifier, results); + if (definition.PropertiesType == null) continue; + foreach (var propertyInfo in definition.PropertiesType.GetProperties()) + { + var editingComponent = propertyInfo.GetCustomAttribute(); + if (editingComponent != null) + { + var model = new EditingFormControlModel + { + PropertyName = propertyInfo.Name, + Label = editingComponent.Label, + DefaultValue = editingComponent.DefaultValue, + ExplanationText = editingComponent.ExplanationText, + Tooltip = editingComponent.Tooltip, + Order = editingComponent.Order, + FormComponentIdentifier = editingComponent.FormComponentIdentifier, + }; + results.Add(model); + } + } + } + + result.PageModels = Service.Resolve().RetrieveMultiple(q => q.AllCultures()).Select(x => (object)new + { + x.NodeSiteName, + x.DocumentID, + x.DocumentCulture, + x.DocumentGUID, + x.NodeGUID, + x.NodeID, + CultureUrl = DocumentURLProvider.GetUrlForCulture(x, x.DocumentCulture), + Url = DocumentURLProvider.GetUrl(x), + }).ToList(); + + return ToJsonResult(result); + } + + [HttpPost()] + public ActionResult GetAllFormComponents(BodyModel body) + { + if (!HttpContext.Request.IsLocal) + { + return new HttpNotFoundResult(); + } + + if (Secret != body?.Secret) + { + return new HttpNotFoundResult(); + } + + var allFormComponents = new ComponentDefinitionProvider().GetAll(); + + return ToJsonResult(allFormComponents.Select(x => new + { + x.Name, + x.Identifier, + })); + } + + public static ActionResult ToJsonResult(object obj) + { + var content = new ContentResult(); + content.Content = JsonConvert.SerializeObject(obj, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); + content.ContentType = "application/json"; + return content; + } + + public class EditingFormControlModel + { + /// + /// Identifier of the form component to be used for editing. + /// + /// + /// The identifier defines a registered via . + /// + /// + public string FormComponentIdentifier { get; set; } + + /// Gets or sets the label of the form component. + /// + public string Label { get; set; } + + /// Gets or sets the default value of the form component. + /// + public object DefaultValue { get; set; } + + /// + /// Gets or sets the explanation text of the form component. + /// + /// + public string ExplanationText { get; set; } + + /// Gets or sets the tooltip of the form component. + /// + public string Tooltip { get; set; } + + /// Gets or sets the order weight of the form component. + /// + public int Order { get; set; } + + public string PropertyName { get; set; } + } +} diff --git a/KX13.NET48.Extensions/ToolkitApiController.NET48.cs b/KX13.NET48.Extensions/ToolkitApiController.NET48.cs deleted file mode 100644 index d2a6060f..00000000 --- a/KX13.NET48.Extensions/ToolkitApiController.NET48.cs +++ /dev/null @@ -1,237 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Web.Mvc; -using CMS.Core; -using CMS.DocumentEngine; -using CMS.SiteProvider; -using Kentico.Content.Web.Mvc; -using Kentico.Forms.Web.Mvc; -using Kentico.PageBuilder.Web.Mvc; -using Kentico.PageBuilder.Web.Mvc.PageTemplates; -using Newtonsoft.Json; - -public class ToolkitApiController : Controller -{ - // TODO configure your own secret - private const string Secret = "secret_used_for_http_posts_to_source_instance_change_to_random_key"; - - public ToolkitApiController() { } - - public class ToolkitInfo - { - public Dictionary> WidgetProperties { get; set; } - public Dictionary> PageTemplateProperties { get; set; } - public Dictionary> SectionProperties { get; set; } - public List PageModels { get; set; } - public string SiteName { get; set; } - } - - public class BodyModel - { - public string Secret { get; set; } - } - - [HttpPost()] - public ActionResult Test(BodyModel body) - { - if (!HttpContext.Request.IsLocal) - { - return new HttpNotFoundResult(); - } - - if (Secret != body?.Secret) - { - return new HttpNotFoundResult(); - } - - return ToJsonResult(new - { - pong = true - }); - } - - [HttpPost()] - public ActionResult GetAllDefinitions(BodyModel body) - { - if (!HttpContext.Request.IsLocal) - { - return new HttpNotFoundResult(); - } - - if (Secret != body?.Secret) - { - return new HttpNotFoundResult(); - } - - var widgetPropertiesResult = new Dictionary>(); - var pageTemplatePropertiesResult = new Dictionary>(); - var sectionPropertiesResult = new Dictionary>(); - var result = new ToolkitInfo - { - WidgetProperties = widgetPropertiesResult, - PageTemplateProperties = pageTemplatePropertiesResult, - SectionProperties = sectionPropertiesResult, - SiteName = SiteContext.CurrentSiteName - }; - - var allWidgetDefinitions = new ComponentDefinitionProvider().GetAll(); - - foreach (var widgetDefinition in allWidgetDefinitions) - { - var editingFormControlModels = new List(); - widgetPropertiesResult.Add(widgetDefinition.Identifier, editingFormControlModels); - if (widgetDefinition.PropertiesType == null) continue; - foreach (var propertyInfo in widgetDefinition.PropertiesType.GetProperties()) - { - var editingComponent = propertyInfo.GetCustomAttribute(); - if (editingComponent != null) - { - var model = new EditingFormControlModel - { - PropertyName = propertyInfo.Name, - Label = editingComponent.Label, - DefaultValue = editingComponent.DefaultValue, - ExplanationText = editingComponent.ExplanationText, - Tooltip = editingComponent.Tooltip, - Order = editingComponent.Order, - FormComponentIdentifier = editingComponent.FormComponentIdentifier, - }; - editingFormControlModels.Add(model); - } - } - } - - var allPageTemplates = new ComponentDefinitionProvider().GetAll(); - foreach (var pageTemplateDef in allPageTemplates) - { - var results = new List(); - pageTemplatePropertiesResult.Add(pageTemplateDef.Identifier, results); - if (pageTemplateDef.PropertiesType == null) continue; - foreach (var propertyInfo in pageTemplateDef.PropertiesType.GetProperties()) - { - var editingComponent = propertyInfo.GetCustomAttribute(); - if (editingComponent != null) - { - var model = new EditingFormControlModel - { - PropertyName = propertyInfo.Name, - Label = editingComponent.Label, - DefaultValue = editingComponent.DefaultValue, - ExplanationText = editingComponent.ExplanationText, - Tooltip = editingComponent.Tooltip, - Order = editingComponent.Order, - FormComponentIdentifier = editingComponent.FormComponentIdentifier, - }; - results.Add(model); - } - } - } - - var allSectionProperties = new ComponentDefinitionProvider().GetAll(); - foreach (var definition in allSectionProperties) - { - var results = new List(); - sectionPropertiesResult.Add(definition.Identifier, results); - if (definition.PropertiesType == null) continue; - foreach (var propertyInfo in definition.PropertiesType.GetProperties()) - { - var editingComponent = propertyInfo.GetCustomAttribute(); - if (editingComponent != null) - { - var model = new EditingFormControlModel - { - PropertyName = propertyInfo.Name, - Label = editingComponent.Label, - DefaultValue = editingComponent.DefaultValue, - ExplanationText = editingComponent.ExplanationText, - Tooltip = editingComponent.Tooltip, - Order = editingComponent.Order, - FormComponentIdentifier = editingComponent.FormComponentIdentifier, - }; - results.Add(model); - } - } - } - - result.PageModels = Service.Resolve().RetrieveMultiple(q => q.AllCultures()).Select(x => (object)new - { - x.NodeSiteName, - x.DocumentID, - x.DocumentCulture, - x.DocumentGUID, - x.NodeGUID, - x.NodeID, - CultureUrl = DocumentURLProvider.GetUrlForCulture(x, x.DocumentCulture), - Url = DocumentURLProvider.GetUrl(x), - }).ToList(); - - return ToJsonResult(result); - } - - [HttpPost()] - public ActionResult GetAllFormComponents(BodyModel body) - { - if (!HttpContext.Request.IsLocal) - { - return new HttpNotFoundResult(); - } - - if (Secret != body?.Secret) - { - return new HttpNotFoundResult(); - } - - var allFormComponents = new ComponentDefinitionProvider().GetAll(); - - return ToJsonResult(allFormComponents.Select(x => new - { - x.Name, - x.Identifier, - })); - } - - public static ActionResult ToJsonResult(object obj) - { - var content = new ContentResult(); - content.Content = JsonConvert.SerializeObject(obj, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); - content.ContentType = "application/json"; - return content; - } - - public class EditingFormControlModel - { - /// - /// Identifier of the form component to be used for editing. - /// - /// - /// The identifier defines a registered via . - /// - /// - public string FormComponentIdentifier { get; set; } - - /// Gets or sets the label of the form component. - /// - public string Label { get; set; } - - /// Gets or sets the default value of the form component. - /// - public object DefaultValue { get; set; } - - /// - /// Gets or sets the explanation text of the form component. - /// - /// - public string ExplanationText { get; set; } - - /// Gets or sets the tooltip of the form component. - /// - public string Tooltip { get; set; } - - /// Gets or sets the order weight of the form component. - /// - public int Order { get; set; } - - public string PropertyName { get; set; } - } -} diff --git a/Migration.Toolkit.CLI/ConfigurationValidator.cs b/Migration.Tool.CLI/ConfigurationValidator.cs similarity index 98% rename from Migration.Toolkit.CLI/ConfigurationValidator.cs rename to Migration.Tool.CLI/ConfigurationValidator.cs index 6b59d9b4..e47b2521 100644 --- a/Migration.Toolkit.CLI/ConfigurationValidator.cs +++ b/Migration.Tool.CLI/ConfigurationValidator.cs @@ -2,11 +2,11 @@ using Microsoft.Extensions.Configuration; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Core.KX13.Helpers; +using Migration.Tool.Common; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Core.KX13.Helpers; -namespace Migration.Toolkit.CLI; +namespace Migration.Tool.CLI; public enum ValidationMessageType { diff --git a/Migration.Toolkit.CLI/MIGRATION_PROTOCOL_REFERENCE.md b/Migration.Tool.CLI/MIGRATION_PROTOCOL_REFERENCE.md similarity index 92% rename from Migration.Toolkit.CLI/MIGRATION_PROTOCOL_REFERENCE.md rename to Migration.Tool.CLI/MIGRATION_PROTOCOL_REFERENCE.md index 16802d2a..2c00cea5 100644 --- a/Migration.Toolkit.CLI/MIGRATION_PROTOCOL_REFERENCE.md +++ b/Migration.Tool.CLI/MIGRATION_PROTOCOL_REFERENCE.md @@ -1,11 +1,11 @@ ## Migration Protocol Reference -Running the `Migration.Toolkit.CLI.exe migrate` command ( -see [`Migration.Toolkit.CLI/README.md`](/Migration.Toolkit.CLI/README.md)) generates a **migration protocol file**. The +Running the `Migration.Tool.CLI.exe migrate` command ( +see [`Migration.Tool.CLI/README.md`](/Migration.Tool.CLI/README.md)) generates a **migration protocol file**. The protocol provides information about the result of the migration, lists required manual steps, etc. You can find the protocol file in the location specified by -the `Settings.MigrationProtocolPath` [configuration option](/Migration.Toolkit.CLI/README.md#Configuration). +the `Settings.MigrationProtocolPath` [configuration option](/Migration.Tool.CLI/README.md#Configuration). ## Common Migration Protocol Warnings & Errors @@ -21,17 +21,17 @@ the `Settings.MigrationProtocolPath` [configuration option](/Migration.Toolkit.C | DbConstraintBroken | Error | General error message indicating that the target database cannot hold migrated data, due to duplicate values in unique columns (e.g., primary keys) or due to a missing dependency.

**Fix**: Manually migrate the object (specified object by the ID in the message), or check if dependencies required by the object were successfully migrated. | | EntityExplicitlyExcludedByCodeName | Warning | The object is excluded via the `Settings.EntityConfigurations..ExcludeCodeNames` configuration option.

**Fix**: If you wish to migrate the object, remove the given code name from the configuration. | | ErrorSavingTargetInstance | Error | A general error that prevents data from being saved in the target Xperience by Kentico database. For example, can be caused by a database timeout or temporary outage. | -| FailedToCreateTargetInstance | Error | General error when the creation of the target entity failed. Can be caused by a problem with the source data or by an error in the Migration toolkit.

**Fix**: Check if the related source data is compatible with the target or report a Migration toolkit issue. | +| FailedToCreateTargetInstance | Error | General error when the creation of the target entity failed. Can be caused by a problem with the source data or by an error in the Migration tool.

**Fix**: Check if the related source data is compatible with the target or report a Migration tool issue. | | FailedToUpdateTargetInstance / FailedToUpdateTargetInstance | Error | General error when updating / inserting an object on the target instance.

**Fix**: Depends on the details in the error message. Can have various causes, such as an interrupted database connection or malformed/incorrect data. | | FormComponentNotSupportedInLegacyMode | Warning | Logged when Page Builder content on the source instance contains a property using a form component that is not supported by the Page Builder legacy mode in Xperience by Kentico. | | InvalidSourceData | Warning | The source instance is missing required data or data is malformed.

**Fix**: Review the message details and try to look for differences between the source and target database schema. | | LinkedDataAlreadyMaterializedInTargetInstance | Warning | A linked page already exists in the target instance and an update is not possible.

**Fix**: No actions required. The update is probably not required. | | MediaFileIsMissingOnSourceFilesystem | Error | Occurs when a media file is missing from the source project's file system and the `Settings.MigrateOnlyMediaFileInfo` configuration option is `false`.

**Fix**: Manually migrate the source media file to the target instance's file system. | | -| MissingConfiguration | Error | The migrate command is missing required configuration.

**Fix**: Add required configuration according to the error message. See [`Migration.Toolkit.CLI/README.md`](/Migration.Toolkit.CLI/README.md). | +| MissingConfiguration | Error | The migrate command is missing required configuration.

**Fix**: Add required configuration according to the error message. See [`Migration.Tool.CLI/README.md`](/Migration.Tool.CLI/README.md). | | MissingRequiredDependency | Error | An object from the source is missing a dependency required on the target instance.

**Fix**: Add the missing dependency on the source instance or delete the object completely. | -| NotCurrentlySupportedSkip | Warning | Xperience by Kentico currently does not support all types of objects from Kentico Xperience 13, so they cannot be migrated via the toolkit. Support may be added in future versions of Xperience by Kentico and the Migration toolkit.

**Fix**: Implement custom migration. | +| NotCurrentlySupportedSkip | Warning | Xperience by Kentico currently does not support all types of objects from Kentico Xperience 13, so they cannot be migrated via the tool. Support may be added in future versions of Xperience by Kentico and the Migration tool.

**Fix**: Implement custom migration. | | NotSupportedSkip | Information | Occurs for data that is not supported in Xperience by Kentico. Migration is not supported, and is not planned for upcoming versions.

**Fix**: Implement custom migration. | -| SourceEntityIsNull | Error | Probably an error while loading source data. Can be caused by malformed source data or by an error in the Migration toolkit.**Fix**: Check the related source data. If everything looks correct, report a Migration toolkit issue. | +| SourceEntityIsNull | Error | Probably an error while loading source data. Can be caused by malformed source data or by an error in the Migration tool.**Fix**: Check the related source data. If everything looks correct, report a Migration tool issue. | | SourcePageIsNotPublished | Warning | Only published pages are included in the migration. This warning occurs when a page on the source is not published.

**Fix**: Publish all pages that you wish to migrate in the source instance. | | SourceValueIsRequired | Error | A source object instance has a missing value in a required field.

**Fix**: Review the message and fill in the missing value on the source instance. | | TemporaryAttachmentMigrationIsNotSupported | Warning | Temporary page attachments are created when a file upload is not finished correctly. The migration does not include temporary attachments.

**Fix**: No actions required. If you wish to migrate the file, re-upload the attachment on the source instance to create a standard attachment. | @@ -42,4 +42,4 @@ the `Settings.MigrationProtocolPath` [configuration option](/Migration.Toolkit.C See [`CONTRIBUTING.md`](/CONTRIBUTING.md). When submitting issues, please provide all available information about the problem or error. If possible, include the -command line output log file and migration protocol generated for your `Migration.Toolkit.CLI.exe migrate` command. +command line output log file and migration protocol generated for your `Migration.Tool.CLI.exe migrate` command. diff --git a/Migration.Tool.CLI/Migration.Tool.CLI.csproj b/Migration.Tool.CLI/Migration.Tool.CLI.csproj new file mode 100644 index 00000000..577ceaea --- /dev/null +++ b/Migration.Tool.CLI/Migration.Tool.CLI.csproj @@ -0,0 +1,38 @@ + + + + Exe + + + + + + + + + + + + + + + + + + + + + + + + + + + Always + + + Always + + + + diff --git a/Migration.Toolkit.CLI/Migration.Toolkit.CLI.csproj.DotSettings.user b/Migration.Tool.CLI/Migration.Tool.CLI.csproj.DotSettings.user similarity index 100% rename from Migration.Toolkit.CLI/Migration.Toolkit.CLI.csproj.DotSettings.user rename to Migration.Tool.CLI/Migration.Tool.CLI.csproj.DotSettings.user diff --git a/Migration.Toolkit.CLI/Program.cs b/Migration.Tool.CLI/Program.cs similarity index 87% rename from Migration.Toolkit.CLI/Program.cs rename to Migration.Tool.CLI/Program.cs index 8bb02253..5d5164f1 100644 --- a/Migration.Toolkit.CLI/Program.cs +++ b/Migration.Tool.CLI/Program.cs @@ -1,31 +1,28 @@ using System.Reflection; - using MediatR; - using Microsoft.Data.SqlClient; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; - -using Migration.Toolkit.CLI; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Core.K11; -using Migration.Toolkit.Core.KX12; -using Migration.Toolkit.Core.KX13; -using Migration.Toolkit.K11; -using Migration.Toolkit.KX12; -using Migration.Toolkit.KX13; -using Migration.Toolkit.KXP; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Api.Services.CmsClass; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.Source; - -using static Migration.Toolkit.Common.Helpers.ConsoleHelper; +using Migration.Tool.CLI; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.Services; +using Migration.Tool.Core.K11; +using Migration.Tool.Core.KX12; +using Migration.Tool.Core.KX13; +using Migration.Tool.Extensions; +using Migration.Tool.K11; +using Migration.Tool.KX12; +using Migration.Tool.KX13; +using Migration.Tool.KXP; +using Migration.Tool.KXP.Api; +using Migration.Tool.KXP.Api.Services.CmsClass; +using Migration.Tool.KXP.Context; +using Migration.Tool.Source; +using static Migration.Tool.Common.Helpers.ConsoleHelper; EnableVirtualTerminalProcessing(); @@ -90,7 +87,7 @@ } var settingsSection = config.GetRequiredSection(ConfigurationNames.Settings); -var settings = settingsSection.Get() ?? new ToolkitConfiguration(); +var settings = settingsSection.Get() ?? new ToolConfiguration(); var kxpApiSettings = settingsSection.GetSection(ConfigurationNames.XbKApiSettings); settings.SetXbKConnectionStringIfNotEmpty(kxpApiSettings["ConnectionStrings:CMSConnectionString"]); @@ -112,7 +109,9 @@ }); -services.UseKsToolkitCore(settings.MigrateMediaToMediaLibrary); +services.UseKsToolCore(settings.MigrateMediaToMediaLibrary); +services.UseCustomizations(); + await using var conn = new SqlConnection(settings.KxConnectionString); try { @@ -122,21 +121,21 @@ case { Major: 11 }: { services.UseK11DbContext(settings); - services.UseK11ToolkitCore(); + services.UseK11ToolCore(); Console.WriteLine($@"Source instance {Green("version 11")} detected."); break; } case { Major: 12 }: { services.UseKx12DbContext(settings); - services.UseKx12ToolkitCore(); + services.UseKx12ToolCore(); Console.WriteLine($@"Source instance {Green("version 12")} detected"); break; } case { Major: 13 }: { services.UseKx13DbContext(settings); - services.UseKx13ToolkitCore(); + services.UseKx13ToolCore(); Console.WriteLine($@"Source instance {Green("version 13")} detected"); break; } @@ -166,7 +165,7 @@ services.UseKxpApi(kxpApiSettings, settings.XbKDirPath); services.AddSingleton(settings); services.AddSingleton(); -services.UseToolkitCommon(); +services.UseToolCommon(); await using var serviceProvider = services.BuildServiceProvider(); KsCoreDiExtensions.InitServiceProvider(serviceProvider); diff --git a/Migration.Tool.CLI/README.md b/Migration.Tool.CLI/README.md new file mode 100644 index 00000000..f35dd1f5 --- /dev/null +++ b/Migration.Tool.CLI/README.md @@ -0,0 +1,736 @@ +# Migration CLI + +The [Xperience by Kentico: Kentico Migration Tool](/README.md) transfers content and other data from **Kentico Xperience +13**, **Kentico 12** or **Kentico 11** to **Xperience by Kentico**. + +The migration is performed by running a command for the .NET CLI. + +## Set up the source instance + +The source instance of Kentico must **not** use a [separated contact management database](https://docs.kentico.com/x/4giRBg), it is recommended that you [rejoin the contact management database](https://docs.kentico.com/x/5giRBg) before proceeding with the migration. + +## Set up the target instance + +The target of the migration must be an Xperience by Kentico instance that fulfills the following requirements: + +* The instance's database and file system must be accessible from the environment where you run the migration. +* The target application *must not be running* when you start the migration. +* The target instance must be empty except for data from the source instance created by previous runs of this tool. +* For performance optimization, the migration transfers certain objects using bulk SQL queries. As a result, you always + need to delete all objects of the following types before running repeated migrations: + * **Contacts**, including their **Activities** (when using the `migrate --contact-management` parameter) + * **Consent agreements** (when using the `migrate --data-protection` parameter) + * **Form submissions** (when using the `migrate --forms` parameter) + * **Custom module class data** (when using the `--custom-modules` parameter) + +To create a suitable target instance, [install a new Xperience by Kentico project](https://docs.xperience.io/x/DQKQC) +using the **Boilerplate** project template. + +## Migrate data + +To perform the migration: + +1. Make sure the [target instance is set up correctly](#set-up-the-target-instance). +2. [Configure](#configuration) the options in the `Migration.Tool.CLI` project's `appsettings.json` file. +3. Compile the `Migration.Tool.CLI` project. +4. Open the command line prompt. +5. Navigate to the project's output directory. +6. Run the `Migration.Tool.CLI.exe migrate` command with parameters according to your requirements. +7. Observe the command line output and review the [migration protocol](./MIGRATION_PROTOCOL_REFERENCE.md), which + provides information about the result of the migration, lists required manual steps, etc. +8. On SaaS projects, you need to manually move content item asset files. See [Content items](#content-items) for more information. + +### Migrate command parameters + +Command usage: + +```powershell +Migration.Tool.CLI.exe migrate --sites --custom-modules --users --members --forms --media-libraries --attachments --page-types --pages --settings-keys --contact-management --data-protection +``` + +| Parameter | Description | Dependencies | +|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------| +| `--sites` | Enables migration of sites to [website channels](https://docs.xperience.io/x/34HFC). The site's basic properties and settings are transferred to the target instance. | | +| `--custom-modules` | Enables migration of custom modules, [custom module classes and their data](https://docs.xperience.io/x/AKDWCQ), and [custom fields in supported system classes](https://docs.xperience.io/x/V6rWCQ).

See: [Migration details for specific object types - Custom modules and classes](#custom-modules-and-classes) | `--sites` | +| `--custom-tables` | Enables migration of [custom tables](https://docs.kentico.com/x/eQ2RBg).

See: [Migration details for specific object types - Custom tables](#custom-tables) | | +| `--users` | Enables migration of [users](https://docs.xperience.io/x/8ILWCQ) and [roles](https://docs.xperience.io/x/7IVwCg).

See: [Migration details for specific object types - Users](#users) | `--sites`, `--custom-modules` | +| `--members` | Enables migration of live site user accounts to [members](https://docs.xperience.io/x/BIsuCw).

See: [Migration details for specific object types - Members](#members) | `--sites`, `--custom-modules` | +| `--settings-keys` | Enables migration of values for [settings](https://docs.xperience.io/x/7YjFC) that are available in Xperience by Kentico. | `--sites` | +| `--page-types` | Enables migration of [content types](https://docs.xperience.io/x/gYHWCQ) (originally *page types* in Kentico Xperience 13) and [preset page templates](https://docs.xperience.io/x/KZnWCQ) (originally *custom page templates*). Required to migrate Pages.

See: [Migration details for specific object types - Content types](#content-types) | `--sites` | +| `--pages` | Enables migration of [pages](https://docs.xperience.io/x/bxzfBw).

The target instance must not contain pages other than those created by previous runs of the Kentico Migration Tool.

See: [Migration details for specific object types - Pages](#pages) | `--sites`, `--users`, `--page-types` | +| `--categories` | Enables migration of categories to taxonomies. Xperience by Kentico uses a different approach to categorization. Categories are migrated to [taxonomies](https://docs.kentico.com/x/taxonomies_xp) and selected categories for each page are assigned to pages in the target instance via a [reusable field schema](https://docs.kentico.com/x/D4_OD). See [`Categories`](#categories). | `--sites`, `--users`, `--pagetypes`, `--pages` | +| `--attachments` | Enables migration of page attachments to [content hub](https://docs.kentico.com/x/barWCQ) as content item assets (page attachments are not supported in Xperience by Kentico).

See: [Migration details for specific object types - Attachments](#attachments) | `--sites`, `--custom-modules` | +| `--contact-management` | Enables migration of [contacts](https://docs.xperience.io/x/nYPWCQ) and [activities](https://docs.xperience.io/x/oYPWCQ). The target instance must not contain any contacts or activities. May run for a long time depending on the number of contacts in the source database. | `--users`, `--custom-modules` | +| `--data-protection` | Enables migration of [consents](https://docs.xperience.io/x/zoB1CQ) and consent agreements. | `--sites`, `--users`, `--contact management` | +| `--forms` | Enables migration of [forms](https://docs.xperience.io/x/WAKiCQ) and submitted form data.

See: [Migration details for specific object types - Forms](#forms) | `--sites`, `--custom-modules`, `--users` | +| `--media-libraries` | Enables migration of [media libraries](https://docs.xperience.io/x/agKiCQ) to [content hub](https://docs.kentico.com/x/barWCQ) as content item assets. This behavior can be adjusted by `MigrateOnlyMediaFileInfo` and `MigrateMediaToMediaLibrary` [configuration options](#configuration). | `--sites`, `--custom-modules`, `--users` | +| `--countries` | Enables migration of countries and states. Xperience by Kentico currently uses countries and states to fill selectors when editing contacts and contact group conditions. | | +| `--bypass-dependency-check` | Skips the migrate command's dependency check. Use for repeated runs of the migration if you know that dependencies were already migrated successfully (for example `--page types` when migrating pages). | | + +### Examples + +* `Migration.Tool.CLI.exe migrate --sites --custom-modules --users --settings-keys --media-libraries --page-types --pages` + * First migration that includes the site object, custom modules and classes, users, setting key values, media + libraries, page types and pages +* `Migration.Tool.CLI.exe migrate --page-types --pages --bypass-dependency-check` + * Repeated migration only for page types and pages, if you know that sites and users were already migrated + successfully. +* `Migration.Tool.CLI.exe migrate --pages --bypass-dependency-check` + * Repeated migration only for pages, if you know that page types, sites, and users were already migrated + successfully. + +### Migration details for specific object types + +#### Content types + +Content types are named **Page types** in earlier Kentico products. + +Xperience by Kentico currently does not support: + +* Macro expressions in page type field default values or other settings. Content type fields containing macros will not + work correctly after the migration. +* Page type inheritance. You cannot migrate page types that inherit fields from other types. +* Categories for page type fields. Field categories are not migrated with page types. + +The Kentico Migration Tool attempts to map the *Data type* and *Form control* of page type fields to an appropriate +equivalent in Xperience by Kentico. This is not always possible, and cannot be done for custom data types or form +controls. We recommend that you check your content type fields after the migration and adjust them if necessary. + +The following table describes how the Kentico Migration Tool maps the data types and form controls/components of page +type fields: + +| KX13/12/11 Data type | XbK Data type | KX13/12/11 Form control | XbK Form component | +|--------------------------|--------------------------|-------------------------|-----------------------------------------------------------------------------------------| +| Text | Text | Text box | Text input | +| Text | Text | Drop-down list | Dropdown selector | +| Text | Text | Radio buttons | Radio button group | +| Text | Text | Text area | Text area | +| Text | Text | *other* | Text input | +| Long text | Long text | Rich text editor | Rich text editor | +| Long text | Long text | Text box | Text input | +| Long text | Long text | Drop-down list | Dropdown selector | +| Long text | Long text | Text area | Text area | +| Long text | Long text | *other* | Rich text editor | +| Integer number | Integer number | *any* | Number input | +| Long integer number | Long integer number | *any* | Number input | +| Floating-point number | Floating-point number | *any* | Number input | +| Decimal number | Decimal number | *any* | Decimal number input | +| Date and time | Date and time | *any* | Datetime input | +| Date | Date | *any* | Date input | +| Time interval | Time interval | *any* | None (not supported) | +| Boolean (Yes/No) | Boolean (Yes/No) | *any* | Checkbox | +| Attachments | Media files | *any* (Attachments) | Media file selector
(the [attachments](#attachments) are converted to media files) | +| File | Media files | *any* (Direct uploader) | Media file selector
(the [attachments](#attachments) are converted to media files) | +| Unique identifier (Guid) | Unique identifier (Guid) | *any* | None (not supported) | +| Pages | Pages | *any* (Pages) | Page selector | + +Additionally, you can enable the Conversion of text fields with media links (*Media selection* form control) to content item assets or media +library files by setting +the `OptInFeatures.CustomMigration.FieldMigrations` [configuration option](#convert-text-fields-with-media-links). + +Some [Form components](https://docs.xperience.io/x/5ASiCQ) used by content type fields in Xperience by Kentico store +data differently than their equivalent Form control in Xperience 13. To ensure that content is displayed correctly on +pages, you must manually adjust your website's implementation to match the new data format. +See [Editing components in Xperience by Kentico](https://docs.xperience.io/x/wIfWCQ) to learn more about some of the +most common components and selectors. + +#### Reusable field schemas + +You can create [reusable field schemas](https://docs.kentico.com/x/D4_OD) from page types from which other page types +inherit, by setting +the `Settings.CreateReusableFieldSchemaForClasses` [configuration option](#convert-page-types-to-reusable-field-schemas). + +#### Content items + +If the target instance is a [SaaS project](https://docs.kentico.com/x/saas_xp) ([installed](https://docs.kentico.com/x/DQKQC) with the `--cloud` option) you need to manually move any content item asset binary files from the default location (`~/assets`) to the location specified in the `StorageInitializationModule.cs` file, which is `~/$StorageAssets/default/assets` by default. This is necessary to enable the system to map the asset binary files to the [Azure Blob storage](https://docs.kentico.com/x/5IfWCQ). + +#### Pages + +* The migration includes the following versions of pages: + * _Published_ + * _Latest draft version_ - for published pages, the version is migrated to the + _Draft_ [workflow step](https://docs.xperience.io/x/JwKQC#Pages-Pageworkflow); for pages that do not have a + published version, the version is migrated to the _Draft (initial)_ workflow step. + * _Archived_ +* URLs are migrated depending on the source instance version: + * For Kentico Xperience 13, the migration: + * includes the URL paths of pages and Former URLs + * does not include Alternative URLs + * For Kentico 12 and Kentico 11, URL paths are not migrated. Instead, a default URL path is created from + the `DocumentUrlPath` or `NodeAliasPath`. +* Linked pages are currently not supported in Xperience by Kentico. The migration creates standard page copies for any + linked pages on the source instance. +* Page permissions (ACLs) are currently not migrated into Xperience by Kentico. +* Migration of Page Builder content is only available for Kentico Xperience 13. + +#### Page Builder content + +> :warning: Page Builder content migration is only available when migrating from Kentico Xperience 13. + +By default, JSON data storing the Page Builder content of pages and custom page templates is migrated directly without +modifications. On the target Xperience by Kentico instance, the migrated data can work in the Page Builder's legacy +compatibility mode. However, we strongly recommend updating your codebase to the new Xperience by Kentico components. + +The Kentico Migration Tool provides an advanced migration mode for Page Builder content that utilizes API discovery on +the source instance. To learn more details and how to configure this feature, +see [Source instance API discovery](#source-instance-api-discovery). + +#### Categories + +Xperience by Kentico uses a different approach to categorization than older Kentico +versions. [Categories](https://docs.kentico.com/13/configuring-xperience/configuring-the-environment-for-content-editors/configuring-categories) +were replaced by [taxonomies](https://docs.kentico.com/developers-and-admins/configuration/taxonomies) and selected +categories for each page are assigned to pages in the target instance via +a [reusable field schema](https://docs.kentico.com/x/D4_OD). The key differences are: + +* Categories in older versions can be added to any page via the *Properties -> Categories* tab. Taxonomies can only be + used for content items (pages, emails...) that have a field with the *Taxonomy* data type. +* Categories can be global or site-specific. Taxonomies are always global, as there are no sites in Xperience by + Kentico. +* Categories are assigned to pages regardless of their workflow step. Taxonomies are stored as a field and are covered + by workflow. As a result, assigned tags can be different in each workflow step. +* [Categories stored as a field](https://docs.kentico.com/x/wA_RBg) + and [personal categories](https://docs.kentico.com/x/IgqRBg) are not supported by the migration. + +The migration process for categories performs the following steps: + +1. A new [taxonomy](https://docs.kentico.com/developers-and-admins/configuration/taxonomies) named **Categories** (code + name `categories`) is created to house all categories from the source instance. +2. A new [reusable field schema](https://docs.kentico.com/x/D4_OD) named **Categories container** (code + name `categories_container`) is created to allow linking tags to pages. + +* The schema contains one field, **Categories_Legacy** (data type **Taxonomy**, configured to enable selection from the + *Categories* taxonomy). + +3. On the target instance, the *Categories container* reusable field schema is added to all content types where at least + one page had a category assigned in the source instance. +4. Supported categories from the source instance are migrated as tags to the *Categories* taxonomy in the target + instance. The category hierarchy from the source instance is maintained in the target instance. +5. On the target instance, tags are assigned to pages according to the source instance. + +* Each [language variant](https://docs.kentico.com/business-users/website-content/translate-pages) of a page is treated + individually and receives its corresponding group of tags based on the source instance. +* Tags from the source page are added to all + available [workflow steps](https://docs.kentico.com/developers-and-admins/configuration/workflows) of the target page. + +#### Custom modules and classes + +The migration includes the following: + +* Custom modules + * Note: The `CMS.` prefix/namespace is reserved for system modules and not allowed in custom module code names. If + present, this code name prefix is removed during the migration. +* All classes belonging under custom modules +* All data stored within custom module classes +* The following customizable system classes and their custom fields: + * *Membership > User* + * *Media libraries > Media file* + * *Contact management > Contact management - Account* (however, accounts are currently not supported in Xperience by + Kentico) + * *Contact management > Contact management - Contact* + +Module and class migration does NOT include: + +* UI elements and all related user interface settings. The administration of Xperience by Kentico uses a different + technology stack than Kentico Xperience 13 and is incompatible. To learn how to build the administration UI, + see [Extend the administration interface](https://docs.xperience.io/x/GwKQC) + and [Example - Offices management application](https://docs.xperience.io/x/hIFwCg). +* Alternative forms under classes and UI-related configuration of class fields (field labels, Form controls, etc.). You + need to manually create appropriate [UI forms](https://docs.xperience.io/x/V6rWCQ) in Xperience by Kentico after the + migration. +* Custom settings under modules, which are currently not supported in Xperience by Kentico +* Module permissions (permissions work differently in Xperience by Kentico, + see [Role management](https://docs.xperience.io/x/7IVwCg) + and [UI page permission checks](https://docs.xperience.io/x/8IKyCg)) + +As with all object types, the Kentico Migration Tool does not transfer code files to the target project. You need to +manually move all code files generated for your custom classes (*Info*, *InfoProvider*, etc.). + +To learn more about custom modules and classes in Xperience by Kentico, see +the [Object types](https://docs.xperience.io/x/AKDWCQ) documentation. + +#### Custom tables + +The migration includes the following: + +* Basic information about custom tables (from the `CMS_Class` table) is migrated to the custom module + table (`CMS_Resource`) as a special `customtables` resource. +* Content of individual custom tables is migrated as module classes. + +Custom table migration does NOT include: + +* Any other data related to custom tables (queries, alternative forms) are discarded by the migration. +* UI elements related to custom tables such as listings and filters are not migrated and need to be implemented. The + administration of Xperience by Kentico uses a different technology stack than Kentico Xperience 13 and is + incompatible. To learn how to build the administration UI, + see [Extend the administration interface](https://docs.xperience.io/x/GwKQC) + and [Example - Offices management application](https://docs.xperience.io/x/hIFwCg). + +#### Media libraries + +Media library files are migrated as content item assets to the [content hub](https://docs.kentico.com/x/barWCQ) into a content folder `/`. All assets are created in the default language of the respective site. Migrated assets are created as content items of a *Legacy media file* content type (code name `Legacy.Mediafile`) created by the tool. + +If required, you can [configure the tool](#convert-attachments-and-media-library-files-to-media-libraries-instead-of-content-item-assets) to instead migrate media libraries as media libraries on the target instance. + +#### Attachments + +Attachment files are migrated as content item assets to the [content hub](https://docs.kentico.com/x/barWCQ) into a content folder `/__Attachments`. Assets are created in the specified language if the language is available (e.g., attachments of pages). Migrated assets are created as content items of a *Legacy attachment* content type (code name `Legacy.Attachment`) created by the tool. + +If required, you can [configure the tool](#convert-attachments-and-media-library-files-to-media-libraries-instead-of-content-item-assets) to instead migrate attachments as media libraries on the target instance. + +#### Forms + +The migration does not include the content of form autoresponder and notification emails. + +You can migrate form autoresponders to Xperience by Kentico manually by copying your HTML code and content into Email +templates and Emails. See [Emails](https://docs.xperience.io/x/IaDWCQ). + +#### Users + +**Note**: Xperience by Kentico uses separate entities for users with access to the administration interface (*CMS_User* +table) and live site visitor accounts (*CMS_Member* table). Consequently, only users whose *Privilege level* is set to +*Editor* and above are migrated (*Users* -> edit a user -> *General* tab) via the `--users` command. To migrate live +site accounts as well, use [`--members`](#migrate-command-parameters). + +The command migrates all users with access to the administration interface. Note the following expected behavior: + +* The 'administrator' user account is only transferred from the source if it does not exist on the target instance. +* The 'public' system user is updated, and all bindings (e.g., the site binding) are mapped automatically on the target + instance. +* Site bindings are updated automatically for all migrated users. +* Users in Xperience by Kentico must have an email address. Migration is only supported for users with a **unique** + email address on the source instance. + * If you encounter issues related to email validation, you can change the default validation behavior via + the `CMSEmailValidationRegex` [application key](https://docs.xperience.io/x/yA6RBg). +* Custom user fields can be migrated together with *module classes*. + +Additionally, the command migrates all roles and user-role bindings for users whose *Privilege level* is *Editor* or +higher. + +Because Xperience by Kentico uses a different [permission model](https://docs.xperience.io/x/7IVwCg), no existing role +permissions or UI personalization settings are migrated. After the migration, the permissions for each role must be +configured again. + +#### Members + +In Xperience by Kentico, live site users are represented using a separate **Member** entity and stored in the +*CMS_Member* table. + +The migration identifies live site users as those without access to the administration interface. That is, only those +accounts whose *Privilege level* is set to *None* (Users -> edit a user -> General tab) are migrated. + +The migration includes: + +* All system fields from the *CMS_User* and *CMS_UserSettings* tables. You can customize which fields are migrated via + the `MemberIncludeUserSystemFields` configuration option. See [configuration](#configuration). +* All custom fields added to the *CMS_User* and *CMS_UserSettings* tables are migrated under `CMS_Member`. + > If you are migrating custom fields, the `--custom-modules` migration command must be run before the `--members` + command. For example: + + ```powershell + Migration.Tool.CLI.exe migrate --sites --custom-modules --users --members + ``` + +The migration ***DOES NOT*** include: + +* External login information associated with each account (e.g., Google or Facebook logins). +* User password hashes from the `CMS_User.UserPassword` column. + + After the migration, the corresponding `CMS_Member.MemberPassword` in the target Xperience by Kentico instance + is `NULL`. This means that the migrated accounts **CANNOT** be used to sign in to the system under any circumstances. + The account owners must first reset their password via ASP.NET Identity. + + See [Forms authentication](https://docs.xperience.io/x/t4ouCw) for a sample password reset process that can be adapted + for this scenario. The general flow consists of these steps: + + 1. Select the migrated member accounts. + + ```csharp + // Selects members whose password is null and who don't use external providers to sign in + var migratedMembers = + MemberInfo.Provider + .Get() + .WhereNull("MemberPassword") + .WhereEquals("MemberIsExternal", 0); + ``` + + 2. Generate password reset tokens for each account using `UserManager.GeneratePasswordResetTokenAsync(member)`. + 3. Send the password reset email to each account using `IEmailService`. + + ```csharp + await emailService + .SendEmail(new EmailMessage() + { + Recipients = member.Email, + Subject = "Password reset request", + // {resetURL} targets a controller action with the password reset form + Body = $"To reset your account's password, click here." + }); + ``` + +#### Contacts + +* Custom contact fields can be migrated together with *module classes*. +* For performance reasons, contacts and related objects are migrated using bulk SQL queries. As a result, you always + need to delete all Contacts, Activities and Consent agreements before running the migration (when using + the `migrate --contact-management` parameter). + +## Configuration + +Before you run the migration, configure options in the `Migration.Tool.CLI/appsettings.json` file. + +Add the options under the `Settings` section in the configuration file. + +| Configuration | Description | +|-------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| KxConnectionString | The connection string to the source Kentico Xperience 13 database. | +| KxCmsDirPath | The absolute file system path of the **CMS** folder in the source Kentico Xperience 13 administration project. Required to migrate media library files. | +| XbKDirPath | The absolute file system path of the root of the target Xperience by Kentico project. Required to migrate media library and page attachment files. | +| XbKApiSettings | Configuration options set for the API when creating migrated objects in the target application.

The `ConnectionStrings.CMSConnectionString`option is required - set the connection string to the target Xperience by Kentico database (the same value as `XbKConnectionString`). | +| MigrationProtocolPath | The absolute file system path of the location where the [migration protocol file](./MIGRATION_PROTOCOL_REFERENCE.md) is generated.

For example: `"C:\\Logs\\Migration.Tool.Protocol.log"` | +| MigrateOnlyMediaFileInfo | If set to `true`, only the database representations of media files are migrated, without the files in the media folder in the project's file system. For example, enable this option if your media library files are mapped to a shared directory or Cloud storage.

If `false`, media files are migrated based on the `KxCmsDirPath` location. | +| MigrateMediaToMediaLibrary | Determines whether media library files and attachments from the source instance are migrated to the target instance as media libraries or as [content item assets](https://docs.kentico.com/x/barWCQ) in the content hub. The default value is `false` – media files and attachments are migrated as content item assets.

See [Convert attachments and media library files to media libraries instad of content item assets](#convert-attachments-and-media-library-files-to-media-libraries-instead-of-content-item-assets) | +| MemberIncludeUserSystemFields | Determines which system fields from the *CMS_User* and *CMS_UserSettings* tables are migrated to *CMS_Member* in Xperience by Kentico. Fields that do not exist in *CMS_Member* are automatically created.

The sample `appsettings.json` file included with the tool by default includes all user fields that can be migrated from Kentico Xperience 13. Exclude specific fields from the migration by removing them from this configuration option. | +| UseOmActivityNodeRelationAutofix | Determines how the migration handles references from Contact management activities to non-existing pages.

Possible options:
`DiscardData` - faulty references are removed,
`AttemptFix` - references are updated to the IDs of corresponding pages created by the migration,
`Error` - an error is reported and the reference can be translated or otherwise handled manually | +| UseOmActivitySiteRelationAutofix | Determines how the migration handles site references from Contact management activities.

Possible options: `DiscardData`,`AttemptFix`,`Error` | +| EntityConfigurations | Contains options that allow you to fine-tune the migration of specific object types. | +| EntityConfigurations.*<object table name>*.ExcludeCodeNames | Excludes objects with the specified code names from the migration. | +| CreateReusableFieldSchemaForClasses | Specifies which page types are also converted to [reusable field schemas](#convert-page-types-to-reusable-field-schemas). | +| OptInFeatures.QuerySourceInstanceApi.Enabled | If `true`, [source instance API discovery](#source-instance-api-discovery) is enabled to allow advanced migration of Page Builder content for pages and page templates. | +| OptInFeatures.QuerySourceInstanceApi.Connections | To use [source instance API discovery](#source-instance-api-discovery), you need to add a connection JSON object containing the following values:
`SourceInstanceUri` - the base URI where the source instance's live site application is running.
`Secret` - the secret that you set in the *ToolkitApiController.cs* file on the source instance. | +| OptInFeatures.CustomMigration.FieldMigrations | Enables conversion of media selection text fields to content item assets or media library files. See [Convert text fields with media links](#convert-text-fields-with-media-links) for more information. | + +### Example + +```json +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "System": "Warning", + "Microsoft": "Warning" + }, + "MinimumLevel": { + "Default": "Information", + "System": "Warning", + "Microsoft": "Warning" + }, + "pathFormat": "logs/log.txt" + }, + "Settings": { + "KxConnectionString": "Data Source=myserver;Initial Catalog=Xperience13;Integrated Security=True;Persist Security Info=False;Connect Timeout=120;Encrypt=False;Current Language=English;", + "KxCmsDirPath": "C:\\inetpub\\wwwroot\\Xperience13\\CMS", + "XbKDirPath": "C:\\inetpub\\wwwroot\\XP_Target", + "XbKApiSettings": { + "ConnectionStrings": { + "CMSConnectionString": "Data Source=myserver;Initial Catalog=XperienceByKentico;Integrated Security=True;Persist Security Info=False;Connect Timeout=120;Encrypt=False;Current Language=English;" + } + }, + "MigrationProtocolPath": "C:\\_Development\\xperience-migration-toolkit-master\\Migration.Toolkit.Protocol.log", + "MemberIncludeUserSystemFields": "FirstName|MiddleName|LastName|FullName|UserPrivilegeLevel|UserIsExternal|LastLogon|UserLastModified|UserGender|UserDateOfBirth", + "MigrateOnlyMediaFileInfo": false, + "MigrateMediaToMediaLibrary": false, + "UseOmActivityNodeRelationAutofix": "AttemptFix", + "UseOmActivitySiteRelationAutofix": "AttemptFix", + "EntityConfigurations": { + "CMS_Site": { + "ExplicitPrimaryKeyMapping": { + "SiteID": { + "1": 1 + } + } + }, + "CMS_Class": { + "ExcludeCodeNames": [ + "CMS.File", + "CMS.MenuItem", + "ACME.News", + "ACME.Office", + "CMS.Blog", + "CMS.BlogPost" + ] + }, + "CMS_SettingsKey": { + "ExcludeCodeNames": [ + "CMSHomePagePath" + ] + } + }, + "OptInFeatures":{ + "QuerySourceInstanceApi": { + "Enabled": true, + "Connections": [ + { "SourceInstanceUri": "http://localhost:60527", "Secret": "__your secret string__" } + ] + }, + "FieldMigrations": { + "SourceDataType": "text", + "TargetDataType": "assets", + "SourceFormControl": "MediaSelectionControl", + "TargetFormComponent": "Kentico.Administration.AssetSelector", + "Actions": [ "convert to asset" ], + "FieldNameRegex": ".*" + } + } + } +} +``` + +## Source instance API discovery + +> :warning: **Warning** – source instance API discovery is only available when migrating from Kentico Xperience 13. + +By default, JSON data storing the Page Builder content of pages and custom page templates is migrated directly without +modifications. Within this content, Page Builder components (widgets, sections, etc.) with properties have their +configuration based on Kentico Xperience 13 form components, which are assigned to the properties on the source +instance. On the target Xperience by Kentico instance, the migrated data can work in the Page Builder's legacy +compatibility mode. + +However, we strongly recommend updating your codebase to the new Xperience by Kentico components. +See [Editing components in Xperience by Kentico](https://docs.xperience.io/x/wIfWCQ) to learn more. + +To convert Page Builder data to a format suitable for the Xperience by Kentico components, the Kentico Migration Tool +provides an advanced migration mode that utilizes API discovery on the source instance. The advanced mode currently +provides the following data conversion: + +* **Attachment selector** properties - converted to a format suitable for the Xperience by Kentico **Media selector** + component, with `IEnumerable` values. +* **Page selector** properties - converted to a format suitable for the Xperience by Kentico Page selector component, + with `IEnumerable` values. + +### Prerequisites and Limitations + +* To use source instance API discovery, the live site application of your source instance must be running and available + during the migration. +* Using the advanced Page Builder data migration **prevents the data from being used in the Page Builder's legacy + compatibility mode**. With this approach, you need to update all Page Builder component code files to + the [Xperience by Kentico format](https://docs.xperience.io/x/wIfWCQ). +* The source instance API discovery feature only processes component properties defined using `[EditingComponent]` + attribute notation. Other implementations, such as properties edited via custom view components in the Razer view, are + not supported. + +```csharp +public class MyWidgetProperties : IWidgetProperties +{ + // Supported + [EditingComponent(PageSelector.IDENTIFIER, Label = "Selected products", Order = 1)] + public IEnumerable SelectedProducts { get; set; } = new List(); + + // NOT supported + public IEnumerable Images { get; set; } = new List(); +} +``` + +### API discovery setup + +1. Copy the `ToolApiController.cs` file to the `Controllers` folder in the **live site project** of your Kentico + Xperience 13 source instance. Get the file from the following location in the Kentico Migration Tool repository: + + * For .NET Core projects: `KX13.Extensions\ToolApiController.cs` + * For MVC 5 (.NET Framework 4.8) projects: `KX13.NET48.Extensions\ToolApiController.NET48.cs` + +2. Register routes for the `ToolApi` controller's actions into the source instance's live site application. + + * For .NET Core projects, add endpoints in the project's `Startup.cs` or `Program.cs` file: + + ```csharp + app.UseEndpoints(endpoints => + { + endpoints.MapControllerRoute( + name: "ToolExtendedFeatures", + pattern: "{controller}/{action}", + constraints: new + { + controller = "ToolApi" + } + ); + + // other routes ... + }); + ``` + + * For MVC 5 projects, map the routes in your application's `RouteCollection` (e.g., in + the `/App_Start/RouteConfig.cs` file): + + ```csharp + public static void RegisterRoutes(RouteCollection routes) + { + // Maps routes for Xperience handlers and enabled features + routes.Kentico().MapRoutes() + + routes.MapRoute( + name: "ToolExtendedFeatures", + url: "{controller}/{action}", + defaults: new { }, + constraints: new + { + controller = "ToolApi" + } + ); + + // other routes ... + } + ``` + +3. Edit `ToolApiController.cs` and set a value for the `Secret` constant: + + ```csharp + private const string Secret = "__your secret string__"; + ``` + +4. Configure the `Settings.OptInFeatures.QuerySourceInstanceApi` [configuration options](#configuration) for the + Migration Tool: + + ```json + "OptInFeatures":{ + "QuerySourceInstanceApi": { + "Enabled": true, + "Connections": [ + { "SourceInstanceUri": "http://localhost:60527", "Secret": "__your secret string__" } + ] + } + }, + ``` + +You can test the source instance API discovery by making a POST request +to `/ToolApi/Test` with `{ "secret":"__your secret string__" }` in the body. If your +setup is correct, the response should be: `{ "pong": true }` + +When you now [migrate data](#migrate-data), the tool performs API discovery of Page Builder component code on the source +instance and advanced migration of Page Builder data. + +## Convert page types to reusable field schemas + +It is not possible to migrate any page types that inherit fields from other page types. However, to make the manual +migration of such page types easier, you can create [reusable field schemas](https://docs.kentico.com/x/D4_OD) from +specified parent page types. Specify a list of page types to be converted to reusable field schemas (separated with +either `;` or `,`) in the `Settings.CreateReusableFieldSchemaForClasses` [configuration option](#configuration). + +The following example specifies two page types from which reusable schemas are created: + +```json +"Settings":{ + ... + + "CreateReusableFieldSchemaForClasses": "Acme.SeoFields;Acme.ArticleFields" +}, +``` + +> :warning: **Notes** +> +> * Conversion of page types to reusable field schemas works best when all field names of page types are unique (i.e., + prefixed with the page type name). If multiple page types converted to reusable field schemas have fields with the + same code name, the code name is prefixed with the content type name in the converted reusable field schemas. +> * Page types specified by this configuration option are also migrated as content types into to the target instance. + +## Convert text fields with media links + +By default, page type and module class fields with the _Text_ data type and the _Media +selection_ [form control](https://docs.xperience.io/x/0A_RBg) from the source instance are converted to plain _Text_ +fields in the target instance. You can instead configure the Kentico Migration Tool to convert these fields to the +_Content items_ data type and use the _Content item selector_ form component, or _Media files_ data type and use the _Media file selector_ form component if you choose to [convert attachments and media library files to media libraries instead of content item assets](#convert-attachments-and-media-library-files-to-media-libraries-instead-of-content-item-assets). + +> :warning: **Notes** +> +> * Only media libraries using the **Permanent** [file URL format](https://docs.xperience.io/x/xQ_RBg) are supported. + Content from media libraries with enabled **Use direct path for files in content** setting will not be converted. +> * If you enable this feature, you also need to change retrieval and handling of affected files in your code, as the + structure of the stored data changes from a text path ( + e.g.,`~/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100`) to a _Media files_ data + type (internally stored as + e.g., `[{"Identifier":"CCEAD0F0-E2BF-459B-814A-36699E5C773E","Some file":"somefile.jpeg","Size":11803,"Dimensions":{"Width":300,"Height":100}}]`). + The value of the field now needs to be [retrieved as a media library file](https://docs.xperience.io/x/LA2RBg). +> * If the target instance is a [SaaS project](https://docs.kentico.com/x/saas_xp), you need to manually move content + item asset files. See [Content items](#content-items) for more information. + +### Convert to content item assets + +To enable this feature, configure the `OptInFeatures.CustomMigration.FieldMigrations` [options](#configuration) for this +tool. Use the values in the code snippet below: + +```json +"OptInFeatures": { + "CustomMigration": { + "FieldMigrations": [ + { + "SourceDataType": "text", + "TargetDataType": "contentitemreference", + "SourceFormControl": "MediaSelectionControl", + "TargetFormComponent": "Kentico.Administration.ContentItemSelector", + "Actions": [ + "convert to asset" + ], + "FieldNameRegex": ".*" + } + ] + } +} +``` + +`FieldNameRegex` - a regular expression used to filter what fields are converted. Only fields with field names that +match the regular expressions are converted. Use `.*` to match all fields. + +### Convert to media libraries + +* Attachment links (containing a `getattachment` handler) are migrated as [attachments](#attachments) and changed to the + _Media files_ data type. +* Media file links (containing a `getmedia` handler) are changed to the _Media files_ data type. It is expected that the + media library containing the targeted file has been migrated. + +To enable this feature, configure the `OptInFeatures.CustomMigration.FieldMigrations` [options](#configuration) for this +tool. Use the values in the code snippet below: + +```json +"OptInFeatures":{ + "CustomMigration":{ + "FieldMigrations": [ + { + "SourceDataType": "text", + "TargetDataType": "assets", + "SourceFormControl": "MediaSelectionControl", + "TargetFormComponent": "Kentico.Administration.AssetSelector", + "Actions": [ "convert to asset" ], + "FieldNameRegex": ".*" + } + ] + } +} +``` + +`FieldNameRegex` - a regular expression used to filter what fields are converted. Only fields with field names that +match the regular expressions are converted. Use `.*` to match all fields. + +## Convert attachments and media library files to media libraries instead of content item assets + +By default, media libraries and attachments are migrated as content item assets in the target instance, which is the recommended approach to ensure future-proofing of project and improve the [content model](https://docs.kentico.com/x/f4HWCQ). You can modify this behavior by configuring the value of the `MigrateMediaToMediaLibrary` setting to `true` and convert media library files and attachments to media libraries if you want to continue using media libraries. When set to `false`, media libraries and attachments are migrated as content item assets in the target instance. + +### Media libraries + +* In Xperience by Kentico, Media libraries are global instead of site-specific. +* The code name of each media library on the target instance is `{SiteName}_{LibraryCodeName}`. +* Media library permissions are currently not supported in Xperience by Kentico and are not migrated. + +### Attachments + +* Page attachments are migrated into a media library named: *"Attachments for site \"* +* The media library contains folders matching the content tree structure for all pages with attachments (including empty folders for parent pages without attachments). The folders are named after the *node alias* of the source pages. +* Each page's folder directly contains all unsorted attachments (files added on the *Attachments* tab in the source's *Pages* application). +* Attachments stored in specific page fields are placed into subfolders, named in format: *"__fieldname"*. These subfolders can include multiple files for fields of the *Attachments* type, or a single file for *File* type fields. +* Any "floating" attachments without an associated page are migrated into the media library root folder. +* The migration does not include temporary attachments (created when a file upload is not finished correctly). If any are present on the source instance, a warning is logged in the [migration protocol](./MIGRATION_PROTOCOL_REFERENCE.md). + +The following is an example of a media library created by the Kentico Migration Tool for page attachments: + +* **Articles** (empty parent folder) + * **Coffee-processing-techniques** (contains any unsorted attachments of the '/Articles/Coffee-processing-techniques' page) + * **__Teaser** (contains attachments stored in the page's 'Teaser' field) + * **Which-brewing-fits-you** + * **__Teaser** + * ... + +Additionally, any attachments placed into the content of migrated pages **will no longer work** in Xperience by Kentico. +This includes images and file download links that use **/getattachment** and **/getimage** URLs. + +If you wish to continue using these legacy attachment URLs from earlier Kentico versions, you need to add a custom +handler to your Xperience by Kentico project. +See [`Migration.Toolkit.KXP.Extensions/README.MD`](/Migration.Toolkit.KXP.Extensions/README.MD) for instructions. diff --git a/Migration.Toolkit.CLI/appsettings.json b/Migration.Tool.CLI/appsettings.json similarity index 97% rename from Migration.Toolkit.CLI/appsettings.json rename to Migration.Tool.CLI/appsettings.json index dcdcc2be..24fbbacf 100644 --- a/Migration.Toolkit.CLI/appsettings.json +++ b/Migration.Tool.CLI/appsettings.json @@ -11,7 +11,7 @@ "System": "Warning", "Microsoft": "Warning" }, - "pathFormat": "logs/migration.toolkit.log", + "pathFormat": "logs/migration.tool.log", "OutputTemplate": "{Timestamp:o} ({SourceContext}) [{Level:u3}] {Message} ({EventId:x8}){NewLine}{Exception}" } }, diff --git a/Migration.Toolkit.Common/Abstractions/Command.cs b/Migration.Tool.Common/Abstractions/Command.cs similarity index 88% rename from Migration.Toolkit.Common/Abstractions/Command.cs rename to Migration.Tool.Common/Abstractions/Command.cs index 58e19401..32b5e611 100644 --- a/Migration.Toolkit.Common/Abstractions/Command.cs +++ b/Migration.Tool.Common/Abstractions/Command.cs @@ -1,6 +1,6 @@ using System.Reflection; -namespace Migration.Toolkit.Common.Abstractions; +namespace Migration.Tool.Common.Abstractions; public interface ICommand { diff --git a/Migration.Toolkit.Common/Abstractions/CommandResult.cs b/Migration.Tool.Common/Abstractions/CommandResult.cs similarity index 81% rename from Migration.Toolkit.Common/Abstractions/CommandResult.cs rename to Migration.Tool.Common/Abstractions/CommandResult.cs index 6b491e5e..40be9da3 100644 --- a/Migration.Toolkit.Common/Abstractions/CommandResult.cs +++ b/Migration.Tool.Common/Abstractions/CommandResult.cs @@ -1,4 +1,4 @@ -namespace Migration.Toolkit.Common.Abstractions; +namespace Migration.Tool.Common.Abstractions; public abstract record CommandResult; diff --git a/Migration.Toolkit.Common/Abstractions/EntityMapperBase.cs b/Migration.Tool.Common/Abstractions/EntityMapperBase.cs similarity index 98% rename from Migration.Toolkit.Common/Abstractions/EntityMapperBase.cs rename to Migration.Tool.Common/Abstractions/EntityMapperBase.cs index b3dd38d5..bbb40ff9 100644 --- a/Migration.Toolkit.Common/Abstractions/EntityMapperBase.cs +++ b/Migration.Tool.Common/Abstractions/EntityMapperBase.cs @@ -2,9 +2,9 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Tool.Common.MigrationProtocol; -namespace Migration.Toolkit.Common.Abstractions; +namespace Migration.Tool.Common.Abstractions; public abstract class EntityMapperBase(ILogger logger, IPrimaryKeyMappingContext pkContext, IProtocol protocol) : IEntityMapper { diff --git a/Migration.Toolkit.Common/Abstractions/IEntityMapper.cs b/Migration.Tool.Common/Abstractions/IEntityMapper.cs similarity index 85% rename from Migration.Toolkit.Common/Abstractions/IEntityMapper.cs rename to Migration.Tool.Common/Abstractions/IEntityMapper.cs index dea3c5ce..88d39008 100644 --- a/Migration.Toolkit.Common/Abstractions/IEntityMapper.cs +++ b/Migration.Tool.Common/Abstractions/IEntityMapper.cs @@ -1,6 +1,6 @@ using Kentico.Xperience.UMT.Model; -namespace Migration.Toolkit.Common.Abstractions; +namespace Migration.Tool.Common.Abstractions; public interface IEntityMapper { diff --git a/Migration.Tool.Common/Abstractions/IModuleLoader.cs b/Migration.Tool.Common/Abstractions/IModuleLoader.cs new file mode 100644 index 00000000..fb7fd41f --- /dev/null +++ b/Migration.Tool.Common/Abstractions/IModuleLoader.cs @@ -0,0 +1,6 @@ +namespace Migration.Tool.Common.Abstractions; + +public interface IModuleLoader +{ + Task LoadAsync(); +} diff --git a/Migration.Toolkit.Common/Abstractions/ModelMappingResult.cs b/Migration.Tool.Common/Abstractions/ModelMappingResult.cs similarity index 93% rename from Migration.Toolkit.Common/Abstractions/ModelMappingResult.cs rename to Migration.Tool.Common/Abstractions/ModelMappingResult.cs index dc3e5b09..6464ab27 100644 --- a/Migration.Toolkit.Common/Abstractions/ModelMappingResult.cs +++ b/Migration.Tool.Common/Abstractions/ModelMappingResult.cs @@ -1,6 +1,6 @@ -using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Tool.Common.MigrationProtocol; -namespace Migration.Toolkit.Common.Abstractions; +namespace Migration.Tool.Common.Abstractions; public interface IModelMappingResult { diff --git a/Migration.Toolkit.Common/Abstractions/UmtMapperBase.cs b/Migration.Tool.Common/Abstractions/UmtMapperBase.cs similarity index 85% rename from Migration.Toolkit.Common/Abstractions/UmtMapperBase.cs rename to Migration.Tool.Common/Abstractions/UmtMapperBase.cs index 6483555b..5e607a34 100644 --- a/Migration.Toolkit.Common/Abstractions/UmtMapperBase.cs +++ b/Migration.Tool.Common/Abstractions/UmtMapperBase.cs @@ -1,6 +1,6 @@ using Kentico.Xperience.UMT.Model; -namespace Migration.Toolkit.Common.Abstractions; +namespace Migration.Tool.Common.Abstractions; public abstract class UmtMapperBase : IUmtMapper { diff --git a/Migration.Tool.Common/Builders/ClassMapper.cs b/Migration.Tool.Common/Builders/ClassMapper.cs new file mode 100644 index 00000000..7b479567 --- /dev/null +++ b/Migration.Tool.Common/Builders/ClassMapper.cs @@ -0,0 +1,130 @@ +using CMS.DataEngine; +using CMS.FormEngine; + +namespace Migration.Tool.Common.Builders; + +public interface IClassMapping +{ + string TargetClassName { get; } + + bool IsMatch(string sourceClassName); + void PatchTargetDataClass(DataClassInfo target); + ICollection SourceClassNames { get; } + string PrimaryKey { get; } + IList Mappings { get; } + IDictionary> TargetFieldPatchers { get; } + IFieldMapping? GetMapping(string targetColumnName, string sourceClassName); + + string? GetTargetFieldName(string sourceColumnName, string sourceClassName); + string GetSourceFieldName(string targetColumnName, string nodeClassClassName); + + void UseResusableSchema(string reusableSchemaName); + IList ReusableSchemaNames { get; } +} + +public interface IFieldMapping +{ + bool IsTemplate { get; } + string SourceFieldName { get; } + string SourceClassName { get; } + string TargetFieldName { get; } +} + +public record FieldMapping(string TargetFieldName, string SourceClassName, string SourceFieldName, bool IsTemplate) : IFieldMapping; + +public record FieldMappingWithConversion(string TargetFieldName, string SourceClassName, string SourceFieldName, bool IsTemplate, Func Converter) : IFieldMapping; + +public class MultiClassMapping(string targetClassName, Action classPatcher) : IClassMapping +{ + public void PatchTargetDataClass(DataClassInfo target) => classPatcher(target); + + ICollection IClassMapping.SourceClassNames => SourceClassNames; + IList IClassMapping.Mappings => Mappings; + IDictionary> IClassMapping.TargetFieldPatchers => TargetFieldPatchers; + public IDictionary> TargetFieldPatchers = new Dictionary>(); + + public IFieldMapping? GetMapping(string targetColumnName, string sourceClassName) => Mappings.SingleOrDefault(x => x.TargetFieldName.Equals(targetColumnName, StringComparison.InvariantCultureIgnoreCase) && x.SourceClassName.Equals(sourceClassName, StringComparison.InvariantCultureIgnoreCase)); + + public string? GetTargetFieldName(string sourceColumnName, string sourceClassName) => + Mappings.SingleOrDefault(x => x.SourceFieldName.Equals(sourceColumnName, StringComparison.InvariantCultureIgnoreCase) && x.SourceClassName.Equals(sourceClassName, StringComparison.InvariantCultureIgnoreCase)) switch + { + { } m => m.TargetFieldName, + _ => sourceColumnName + }; + + public string GetSourceFieldName(string targetColumnName, string sourceClassName) => GetMapping(targetColumnName, sourceClassName) switch + { + null => targetColumnName, + FieldMapping fm => fm.SourceFieldName, + FieldMappingWithConversion fm => fm.SourceFieldName, + _ => targetColumnName + }; + + string IClassMapping.TargetClassName => targetClassName; + + public List Mappings { get; } = []; + public string PrimaryKey { get; set; } + + public HashSet SourceClassNames = new(StringComparer.InvariantCultureIgnoreCase); + + public FieldBuilder BuildField(string targetFieldName) + { + if (Mappings.Any(x => x.TargetFieldName.Equals(targetFieldName, StringComparison.InvariantCultureIgnoreCase))) + { + throw new InvalidOperationException($"Field mapping is already defined for field '{targetFieldName}'"); + } + return new FieldBuilder(this, targetFieldName); + } + + public bool IsMatch(string sourceClassName) => SourceClassNames.Contains(sourceClassName); + + public void UseResusableSchema(string reusableSchemaName) + { + ArgumentException.ThrowIfNullOrWhiteSpace(reusableSchemaName); + + if (reusableSchemaNames.Contains(reusableSchemaName)) + { + throw new Exception($"The reusable Schema {reusableSchemaName} is already assigned"); + } + reusableSchemaNames.Add(reusableSchemaName); + } + + private readonly IList reusableSchemaNames = []; + IList IClassMapping.ReusableSchemaNames => reusableSchemaNames; +} + +public class FieldBuilder(MultiClassMapping multiClassMapping, string targetFieldName) +{ + private IFieldMapping? currentFieldMapping; + + public FieldBuilder SetFrom(string sourceClassName, string sourceFieldName, bool isTemplate = false) + { + currentFieldMapping = new FieldMapping(targetFieldName, sourceClassName, sourceFieldName, isTemplate); + multiClassMapping.Mappings.Add(currentFieldMapping); + multiClassMapping.SourceClassNames.Add(sourceClassName); + return this; + } + + public FieldBuilder ConvertFrom(string sourceClassName, string sourceFieldName, bool isTemplate, Func converter) + { + currentFieldMapping = new FieldMappingWithConversion(targetFieldName, sourceClassName, sourceFieldName, isTemplate, converter); + multiClassMapping.Mappings.Add(currentFieldMapping); + multiClassMapping.SourceClassNames.Add(sourceClassName); + return this; + } + + public FieldBuilder WithFieldPatch(Action fieldInfoPatcher) + { + if (!multiClassMapping.TargetFieldPatchers.TryAdd(targetFieldName, fieldInfoPatcher)) + { + throw new InvalidOperationException($"Target field mapper can be dined only once for each field, field '{targetFieldName}' has one already defined"); + } + return this; + } + + public MultiClassMapping AsPrimaryKey() + { + multiClassMapping.PrimaryKey = targetFieldName; + return multiClassMapping; + } +} diff --git a/Migration.Tool.Common/Builders/ReusableSchemaBuilder.cs b/Migration.Tool.Common/Builders/ReusableSchemaBuilder.cs new file mode 100644 index 00000000..84f7c4b0 --- /dev/null +++ b/Migration.Tool.Common/Builders/ReusableSchemaBuilder.cs @@ -0,0 +1,93 @@ +using CMS.FormEngine; + +namespace Migration.Tool.Common.Builders; + +public record SourceFieldIdentifier(string ClassName, string FieldName); + +public interface IReusableSchemaBuilder +{ + string SchemaName { get; } + string SchemaDisplayName { get; } + string? SchemaDescription { get; } + IList FieldBuilders { get; } + IReusableFieldBuilder BuildField(string targetFieldName); + void AssertIsValid(); +} + +public class ReusableSchemaBuilder(string schemaName, string displayName, string? schemaDescription) : IReusableSchemaBuilder +{ + public string SchemaName { get; } = schemaName; + public string SchemaDisplayName { get; } = displayName; + public string? SchemaDescription { get; } = schemaDescription; + public IList FieldBuilders { get; set; } = []; + + public IReusableFieldBuilder BuildField(string targetFieldName) + { + if (FieldBuilders.Any(fb => fb.TargetFieldName.Equals(targetFieldName, StringComparison.InvariantCultureIgnoreCase))) + { + throw new InvalidOperationException($"Target field '{targetFieldName}' already exists"); + } + + var newFieldBuilder = new ReusableFieldBuilder(targetFieldName); + FieldBuilders.Add(newFieldBuilder); + return newFieldBuilder; + } + + public void AssertIsValid() + { + ArgumentException.ThrowIfNullOrWhiteSpace(SchemaName, nameof(SchemaName)); + ArgumentException.ThrowIfNullOrWhiteSpace(SchemaDisplayName, nameof(SchemaDisplayName)); + + foreach (var reusableFieldBuilder in FieldBuilders) + { + reusableFieldBuilder.AssertIsValid(); + } + } +} + +public interface IReusableFieldBuilder +{ + string TargetFieldName { get; } + Func? Factory { get; } + SourceFieldIdentifier? SourceFieldIdentifier { get; } + + void AssertIsValid(); + IReusableFieldBuilder WithFactory(Func formFieldFactory); + IReusableFieldBuilder CreateFrom(string sourceClassName, string sourceFieldName); +} + +public class ReusableFieldBuilder(string targetFieldName) : IReusableFieldBuilder +{ + public string TargetFieldName { get; } = targetFieldName; + public Func? Factory { get; private set; } + public SourceFieldIdentifier? SourceFieldIdentifier { get; private set; } + + public void AssertIsValid() + { + if (Factory == null && SourceFieldIdentifier == null) + { + throw new NullReferenceException($"Reusable field builder is not valid for field '{TargetFieldName}' call 'WithFactory' or 'CreateFrom' to define source of field value"); + } + + if (Factory != null && SourceFieldIdentifier != null) + { + throw new InvalidOperationException($"Reusable field builder is not valid for field '{TargetFieldName}' you cannot call both 'WithFactory' and 'CreateFrom' to define source of field value"); + } + } + + public IReusableFieldBuilder WithFactory(Func formFieldFactory) + { + ArgumentNullException.ThrowIfNull(formFieldFactory); + Factory = formFieldFactory; + return this; + } + + public IReusableFieldBuilder CreateFrom(string sourceClassName, string sourceFieldName) + { + ArgumentException.ThrowIfNullOrWhiteSpace(sourceClassName, nameof(sourceClassName)); + ArgumentException.ThrowIfNullOrWhiteSpace(sourceFieldName, nameof(sourceFieldName)); + + SourceFieldIdentifier = new SourceFieldIdentifier(sourceClassName, sourceFieldName); + return this; + } +} diff --git a/Migration.Toolkit.Common/Commands.cs b/Migration.Tool.Common/Commands.cs similarity index 98% rename from Migration.Toolkit.Common/Commands.cs rename to Migration.Tool.Common/Commands.cs index 461e9bb0..fa3a5715 100644 --- a/Migration.Toolkit.Common/Commands.cs +++ b/Migration.Tool.Common/Commands.cs @@ -1,8 +1,8 @@ using MediatR; -using Migration.Toolkit.Common.Abstractions; +using Migration.Tool.Common.Abstractions; -namespace Migration.Toolkit.Common; +namespace Migration.Tool.Common; public record MigrateSitesCommand : IRequest, ICommand { diff --git a/Migration.Tool.Common/CommonDiExtensions.cs b/Migration.Tool.Common/CommonDiExtensions.cs new file mode 100644 index 00000000..ee57949b --- /dev/null +++ b/Migration.Tool.Common/CommonDiExtensions.cs @@ -0,0 +1,17 @@ +using Microsoft.Extensions.DependencyInjection; + +using Migration.Tool.Common.MigrationProtocol; + +namespace Migration.Tool.Common; + +public static class CommonDiExtensions +{ + public static IServiceCollection UseToolCommon(this IServiceCollection services) + { + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + return services; + } +} diff --git a/Migration.Toolkit.Common/ConfigurationNames.cs b/Migration.Tool.Common/ConfigurationNames.cs similarity index 98% rename from Migration.Toolkit.Common/ConfigurationNames.cs rename to Migration.Tool.Common/ConfigurationNames.cs index 9231d760..75bbb894 100644 --- a/Migration.Toolkit.Common/ConfigurationNames.cs +++ b/Migration.Tool.Common/ConfigurationNames.cs @@ -1,4 +1,4 @@ -namespace Migration.Toolkit.Common; +namespace Migration.Tool.Common; public class ConfigurationNames { diff --git a/Migration.Toolkit.Common/EntityConfiguration.cs b/Migration.Tool.Common/EntityConfiguration.cs similarity index 95% rename from Migration.Toolkit.Common/EntityConfiguration.cs rename to Migration.Tool.Common/EntityConfiguration.cs index 0e080f5f..ede8ebef 100644 --- a/Migration.Toolkit.Common/EntityConfiguration.cs +++ b/Migration.Tool.Common/EntityConfiguration.cs @@ -1,9 +1,9 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; -using Migration.Toolkit.Common.Helpers; +using Migration.Tool.Common.Helpers; -namespace Migration.Toolkit.Common; +namespace Migration.Tool.Common; public class EntityConfigurations : Dictionary { diff --git a/Migration.Toolkit.Common/Enumerations/K12SystemClass.cs b/Migration.Tool.Common/Enumerations/K12SystemClass.cs similarity index 99% rename from Migration.Toolkit.Common/Enumerations/K12SystemClass.cs rename to Migration.Tool.Common/Enumerations/K12SystemClass.cs index 389deb82..54abb92a 100644 --- a/Migration.Toolkit.Common/Enumerations/K12SystemClass.cs +++ b/Migration.Tool.Common/Enumerations/K12SystemClass.cs @@ -1,6 +1,6 @@ // ReSharper disable InconsistentNaming -namespace Migration.Toolkit.Common.Enumerations; +namespace Migration.Tool.Common.Enumerations; #pragma warning disable IDE1006 public class K12SystemClass { diff --git a/Migration.Toolkit.Common/Enumerations/K12SystemResource.cs b/Migration.Tool.Common/Enumerations/K12SystemResource.cs similarity index 99% rename from Migration.Toolkit.Common/Enumerations/K12SystemResource.cs rename to Migration.Tool.Common/Enumerations/K12SystemResource.cs index 9aec23ed..28d87483 100644 --- a/Migration.Toolkit.Common/Enumerations/K12SystemResource.cs +++ b/Migration.Tool.Common/Enumerations/K12SystemResource.cs @@ -1,6 +1,6 @@ // ReSharper disable InconsistentNaming -namespace Migration.Toolkit.Common.Enumerations; +namespace Migration.Tool.Common.Enumerations; #pragma warning disable IDE1006 public class K12SystemResource { diff --git a/Migration.Toolkit.Common/Enumerations/KsFieldDataType.cs b/Migration.Tool.Common/Enumerations/KsFieldDataType.cs similarity index 97% rename from Migration.Toolkit.Common/Enumerations/KsFieldDataType.cs rename to Migration.Tool.Common/Enumerations/KsFieldDataType.cs index dfc2b765..07b8b82e 100644 --- a/Migration.Toolkit.Common/Enumerations/KsFieldDataType.cs +++ b/Migration.Tool.Common/Enumerations/KsFieldDataType.cs @@ -1,4 +1,4 @@ -namespace Migration.Toolkit.Common.Enumerations; +namespace Migration.Tool.Common.Enumerations; /// /// field data types are same in major versions 11 / 12 / 13 diff --git a/Migration.Tool.Common/Enumerations/Kx13FormControls.cs b/Migration.Tool.Common/Enumerations/Kx13FormControls.cs new file mode 100644 index 00000000..62ae02f0 --- /dev/null +++ b/Migration.Tool.Common/Enumerations/Kx13FormControls.cs @@ -0,0 +1,267 @@ +// ReSharper disable InconsistentNaming + +namespace Migration.Tool.Common.Enumerations; +#pragma warning disable IDE1006 +public class Kx13FormControls +{ + public class UserControlForText + { + public const string AbTestConversionTypeSelector = "ABTestConversionTypeSelector"; + public const string ActivityTypeSelector = "ActivityTypeSelector"; + public const string AllowedExtensionsSelector = "AllowedExtensionsSelector"; + public const string Selectalternativeform = "selectalternativeform"; + public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; + public const string AssemblyClassSelector = "AssemblyClassSelector"; + public const string Fieldselector = "fieldselector"; + public const string BizFormSelector = "BizFormSelector"; + public const string BundleInventoryTypeSelector = "BundleInventoryTypeSelector"; + public const string CampaignSelector = "CampaignSelector"; + public const string CategorySelector = "CategorySelector"; + public const string ClassFieldSelector = "ClassFieldSelector"; + public const string ClassFields = "Class_fields"; + public const string CodeName = "CodeName"; + public const string CodeNameWithPrefix = "CodeNameWithPrefix"; + public const string Selectcolor = "selectcolor"; + public const string Columns = "Columns"; + public const string ConnectionStringSelector = "Connection_string_selector"; + public const string ContactClassFields = "Contact_class_fields"; + public const string CountrySelector = "countrySelector"; + public const string CssStylesEditor = "CSS_Styles_Editor"; + public const string Selectculture = "selectculture"; + public const string CultureSelectorForSettings = "CultureSelectorForSettings"; + public const string CurrencySelector = "currencySelector"; + public const string CustomTableItemSelector = "CustomTableItemSelector"; + public const string CustomTableSelector = "CustomTableSelector"; + public const string Selectcolumns = "selectcolumns"; + public const string DepartmentSelector = "DepartmentSelector"; + public const string DropDownListControl = "DropDownListControl"; + public const string DueDateSelector = "Due_date_selector"; + public const string Emailinput = "emailinput"; + public const string EmailTemplateSelector = "Email_template_selector"; + public const string EmailTemplateTypeSelector = "Email_template_type_selector"; + public const string EncodingTextBox = "EncodingTextBox"; + public const string EncryptedPassword = "EncryptedPassword"; + public const string EnumSelector = "EnumSelector"; + public const string EventLogTypeSelector = "EventLogTypeSelector"; + public const string FacebookAutoPost = "Facebook_auto_post"; + public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; + public const string FileSystemSelector = "FileSystemSelector"; + public const string FontIconSelector = "FontIconSelector"; + public const string FormFieldSelector = "FormFieldSelector"; + public const string FormPassword = "FormPassword"; + public const string FullMediaLibrarySelector = "FullMediaLibrarySelector"; + public const string GetGoogleTranslatorApiKey = "Get_Google_Translator_API_key"; + public const string GetMsTranslatorTextApiKey = "GetMSTranslatorTextAPIKey"; + public const string GoToExternalUrl = "Go_to_external_URL"; + public const string GoogleAnalyticsParameterSelector = "Google_Analytics_parameter_selector"; + public const string Html5Input = "HTML5Input"; + public const string IconSelector = "IconSelector"; + public const string InternalStatusSelector = "InternalStatusSelector"; + public const string Internationalphone = "internationalphone"; + public const string LabelControl = "LabelControl"; + public const string LargeTextArea = "LargeTextArea"; + public const string LicenseSelector = "LicenseSelector"; + public const string LinkedInAutoPost = "LinkedInAutoPost"; + public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; + public const string ListBoxControl = "ListBoxControl"; + public const string LocalizableTextArea = "LocalizableTextArea"; + public const string LocalizableTextBox = "LocalizableTextBox"; + public const string MacroAnyAllBoolSelector = "Macro_any-all_bool_selector"; + public const string MacroAnyAllSelector = "MacroAnyAllSelector"; + public const string MacroDateOperator = "Macro_date_operator"; + public const string MacroEditor = "MacroEditor"; + public const string MacroEqualityOperator = "MacroEqualityOperator"; + public const string MacroNegationOperator = "MacroNegationOperator"; + public const string MacroNumericOperator = "Macro_numeric_operator"; + public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; + public const string MacroTextOperator = "Macro_text_operator"; + public const string MacroType = "MacroType"; + public const string ManufacturerSelector = "ManufacturerSelector"; + public const string MediaLibrarySelector = "MediaLibrarySelector"; + public const string MediaSelectionControl = "MediaSelectionControl"; + public const string MembershipSelector = "MembershipSelector"; + public const string MetafileUploaderControl = "MetafileUploaderControl"; + public const string ModuleSelector = "ModuleSelector"; + public const string MultipleCategoriesSelector = "MultipleCategoriesSelector"; + public const string MultipleChoiceControl = "MultipleChoiceControl"; + public const string RoleCheckboxSelector = "RoleCheckboxSelector"; + public const string SimpleCheckboxRoleSelector = "SimpleCheckboxRoleSelector"; + public const string SimpleCheckboxSiteSelector = "SimpleCheckboxSiteSelector"; + public const string MultipleUserSelector = "MultipleUserSelector"; + public const string NewsletterSelector = "NewsletterSelector"; + public const string NewsletterSelectorSimple = "NewsletterSelectorSimple"; + public const string NumericUpDown = "NumericUpDown"; + public const string ObjectColumnSelector = "ObjectColumnSelector"; + public const string ObjectSelector = "ObjectSelector"; + public const string ObjectTransformation = "ObjectTransformation"; + public const string ObjectTypeBinSelector = "ObjectTypeBinSelector"; + public const string ObjectTypeSelector = "ObjectTypeSelector"; + public const string OptionCategoryProductOptionSelector = "OptionCategoryProductOptionSelector"; + public const string OptionCategorySelectionTypeSelector = "OptionCategorySelectionTypeSelector"; + public const string OrderBy = "OrderBy"; + public const string OrderStatusSelector = "OrderStatusSelector"; + public const string DocumentCultureFilter = "DocumentCultureFilter"; + public const string PageLayoutCode = "Page_layout_code"; + public const string Selectdocument = "selectdocument"; + public const string PageTemplateLevels = "PageTemplateLevels"; + public const string Selectpagetemplate = "selectpagetemplate"; + public const string DocumentTypeIconSelector = "DocumentTypeIconSelector"; + public const string Selectclassnames = "selectclassnames"; + public const string Password = "Password"; + public const string PasswordStrength = "PasswordStrength"; + public const string PasswordConfirmator = "PasswordConfirmator"; + public const string Selectpath = "selectpath"; + public const string PaymentSelector = "paymentSelector"; + public const string ProductImageSelector = "ProductImageSelector"; + public const string ProductRelationshipNameSelector = "ProductRelationshipNameSelector"; + public const string ProductSectionsSelector = "ProductSectionsSelector"; + public const string ProductTypeSelector = "ProductTypeSelector"; + public const string PublicStatusSelector = "PublicStatusSelector"; + public const string Selectquery = "selectquery"; + public const string RadioButtonsControl = "RadioButtonsControl"; + public const string AgeRangeSelector = "AgeRangeSelector"; + public const string RelatedDocuments = "RelatedDocuments"; + public const string Relationshipconfiguration = "relationshipconfiguration"; + public const string SelectRelationshipName = "SelectRelationshipName"; + public const string ReportSelectorDropDown = "ReportSelectorDropDown"; + public const string RoleSelector = "RoleSelector"; + public const string SearchClassNameSelector = "SearchClassNameSelector"; + public const string SearchIndexSelector = "SearchIndexSelector"; + public const string SearchIndexTypeSelector = "SearchIndexTypeSelector"; + public const string SelectCmsVersion = "SelectCMSVersion"; + public const string SettingsKeyControlSelector = "SettingsKeyControlSelector"; + public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; + public const string SharePointListSelector = "SharePointListSelector"; + public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; + public const string ShippingSelector = "shippingSelector"; + public const string ShippingServiceSelector = "ShippingServiceSelector"; + public const string Selectsinglepath = "selectsinglepath"; + public const string SinglePathSelectorWithPermissions = "SinglePathSelectorWithPermissions"; + public const string SiteContentCulture = "SiteContentCulture"; + public const string SiteCultureSelector = "SiteCultureSelector"; + public const string SiteCultureSelectorAll = "SiteCultureSelectorAll"; + public const string Selectsite = "selectsite"; + public const string SiteSelectorWithAllFieldForGlobalAdmin = "SiteSelectorWithAllFieldForGlobalAdmin"; + public const string SkuSelector = "SKUSelector"; + public const string StopWordsSelector = "StopWordsSelector"; + public const string SupplierSelector = "SupplierSelector"; + public const string SupportedCultureSelector = "SupportedCultureSelector"; + public const string TableConversionSettings = "TableConversionSettings"; + public const string TagGroupSelector = "TagGroupSelector"; + public const string TagSelector = "TagSelector"; + public const string TaxAddressTypeSelector = "TaxAddressTypeSelector"; + public const string TextAreaControl = "TextAreaControl"; + public const string TextBoxControl = "TextBoxControl"; + public const string TextFilter = "TextFilter"; + public const string TextboxDefaultValueFromSetting = "Textbox_default_value_from_setting"; + public const string TextboxDoubleValidator = "Textbox_double_validator"; + public const string TimeZoneSelector = "TimeZoneSelector"; + public const string TimeZoneTypeSelector = "TimeZoneTypeSelector"; + public const string ToggleButton = "ToggleButton"; + public const string Selecttransformation = "selecttransformation"; + public const string TranslationServiceSelector = "Translation_service_selector"; + public const string TwitterAutoPost = "Twitter_auto_post"; + public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; + public const string Usphone = "usphone"; + public const string Uszipcode = "uszipcode"; + public const string UiCultureSelector = "UICultureSelector"; + public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; + public const string UniSelector = "Uni_selector"; + public const string UrlChecker = "UrlChecker"; + public const string UrlSelector = "URLSelector"; + public const string SmurlShortenerSelector = "SMURLShortenerSelector"; + public const string UserName = "UserName"; + public const string UserNameSelector = "UserNameSelector"; + public const string UserSelector = "UserSelector"; + public const string ValiditySelector = "ValiditySelector"; + public const string ViewSecureText = "ViewSecureText"; + public const string WhereCondition = "WhereCondition"; + public const string WorkflowScopeDefinition = "WorkflowScopeDefinition"; + } + + public class UserControlForLongText + { + public const string AbTestConversionSelector = "ABTestConversionSelector"; + public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; + public const string BbEditorControl = "BBEditorControl"; + public const string CacheDependencies = "CacheDependencies"; + public const string ClassFields = "Class_fields"; + public const string Columns = "Columns"; + public const string ConditionBuilder = "ConditionBuilder"; + public const string ContactClassFields = "Contact_class_fields"; + public const string CssStylesEditor = "CSS_Styles_Editor"; + public const string Selectcolumns = "selectcolumns"; + public const string DropDownListControl = "DropDownListControl"; + public const string FacebookAutoPost = "Facebook_auto_post"; + public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; + public const string FileSystemSelector = "FileSystemSelector"; + public const string Html5Input = "HTML5Input"; + public const string AutoResizeConfiguration = "AutoResizeConfiguration"; + public const string LabelControl = "LabelControl"; + public const string LargeTextArea = "LargeTextArea"; + public const string LinkedInAutoPost = "LinkedInAutoPost"; + public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; + public const string LocalizableTextArea = "LocalizableTextArea"; + public const string LocalizableTextBox = "LocalizableTextBox"; + public const string MacroEditor = "MacroEditor"; + public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; + public const string MultipleObjectBindingControl = "MultipleObjectBindingControl"; + public const string ObjectTypeSelector = "ObjectTypeSelector"; + public const string OptionsSelector = "OptionsSelector"; + public const string OrderBy = "OrderBy"; + public const string PageLayoutCode = "Page_layout_code"; + public const string ProductSectionsSelector = "ProductSectionsSelector"; + public const string RelatedDocuments = "RelatedDocuments"; + public const string ReportGraphSelector = "ReportGraphSelector"; + public const string ReportTableSelector = "ReportTableSelector"; + public const string ReportValueSelector = "ReportValueSelector"; + public const string HtmlAreaControl = "HtmlAreaControl"; + public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; + public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; + public const string TagSelector = "TagSelector"; + public const string TextAreaControl = "TextAreaControl"; + public const string TextBoxControl = "TextBoxControl"; + public const string TextFilter = "TextFilter"; + public const string TranslationServiceSelector = "Translation_service_selector"; + public const string TwitterAutoPost = "Twitter_auto_post"; + public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; + public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; + public const string UniSelector = "Uni_selector"; + public const string SmurlShortenerSelector = "SMURLShortenerSelector"; + public const string ViewSecureText = "ViewSecureText"; + public const string WhereCondition = "WhereCondition"; + } +} + +public class Kx13FormComponents +{ + public const string Kentico_BoolFieldValueTypeSelector = "Kentico.BoolFieldValueTypeSelector"; + public const string Kentico_CheckBox = "Kentico.CheckBox"; + public const string Kentico_CompareToFieldSelector = "Kentico.CompareToFieldSelector"; + public const string Kentico_ConsentAgreement = "Kentico.ConsentAgreement"; + public const string Kentico_ConsentSelector = "Kentico.ConsentSelector"; + public const string Kentico_DropDown = "Kentico.DropDown"; + public const string Kentico_EmailInput = "Kentico.EmailInput"; + public const string Kentico_FileUploader = "Kentico.FileUploader"; + public const string Kentico_HiddenGuidInput = "Kentico.HiddenGuidInput"; + public const string Kentico_IntInput = "Kentico.IntInput"; + public const string Kentico_MultipleChoice = "Kentico.MultipleChoice"; + public const string Kentico_Name = "Kentico.Name"; + public const string Kentico_NumericFieldComparisonTypeSelector = "Kentico.NumericFieldComparisonTypeSelector"; + public const string Kentico_RadioButtons = "Kentico.RadioButtons"; + public const string Kentico_Recaptcha = "Kentico.Recaptcha"; + public const string Kentico_StringFieldComparisonTypeSelector = "Kentico.StringFieldComparisonTypeSelector"; + public const string Kentico_TextArea = "Kentico.TextArea"; + public const string Kentico_TextInput = "Kentico.TextInput"; + public const string Kentico_USPhone = "Kentico.USPhone"; + public const string Kentico_Invalid = "Kentico.Invalid"; + public const string Kentico_RichText = "Kentico.RichText"; + public const string Kentico_AttachmentSelector = "Kentico.AttachmentSelector"; + public const string Kentico_MediaFilesSelector = "Kentico.MediaFilesSelector"; + public const string Kentico_GeneralSelector = "Kentico.GeneralSelector"; + public const string Kentico_ObjectSelector = "Kentico.ObjectSelector"; + public const string Kentico_PageSelector = "Kentico.PageSelector"; + public const string Kentico_PathSelector = "Kentico.PathSelector"; + public const string Kentico_UrlSelector = "Kentico.UrlSelector"; +} +#pragma warning enable IDE1006 diff --git a/Migration.Toolkit.Common/Enumerations/Kx13SystemClasses.cs b/Migration.Tool.Common/Enumerations/Kx13SystemClasses.cs similarity index 99% rename from Migration.Toolkit.Common/Enumerations/Kx13SystemClasses.cs rename to Migration.Tool.Common/Enumerations/Kx13SystemClasses.cs index 23e2074e..c6fa1c1b 100644 --- a/Migration.Toolkit.Common/Enumerations/Kx13SystemClasses.cs +++ b/Migration.Tool.Common/Enumerations/Kx13SystemClasses.cs @@ -1,6 +1,6 @@ // ReSharper disable InconsistentNaming -namespace Migration.Toolkit.Common.Enumerations; +namespace Migration.Tool.Common.Enumerations; #pragma warning disable IDE1006 public static class Kx13SystemClass { diff --git a/Migration.Toolkit.Common/Enumerations/Kx13SystemResource.cs b/Migration.Tool.Common/Enumerations/Kx13SystemResource.cs similarity index 98% rename from Migration.Toolkit.Common/Enumerations/Kx13SystemResource.cs rename to Migration.Tool.Common/Enumerations/Kx13SystemResource.cs index a2243557..99e0d79c 100644 --- a/Migration.Toolkit.Common/Enumerations/Kx13SystemResource.cs +++ b/Migration.Tool.Common/Enumerations/Kx13SystemResource.cs @@ -1,6 +1,6 @@ // ReSharper disable InconsistentNaming -namespace Migration.Toolkit.Common.Enumerations; +namespace Migration.Tool.Common.Enumerations; #pragma warning disable IDE1006 public static class Kx13SystemResource { diff --git a/Migration.Toolkit.Common/Enumerations/NodeXmlColumns.cs b/Migration.Tool.Common/Enumerations/NodeXmlColumns.cs similarity index 97% rename from Migration.Toolkit.Common/Enumerations/NodeXmlColumns.cs rename to Migration.Tool.Common/Enumerations/NodeXmlColumns.cs index 9e51c0a4..25942b5b 100644 --- a/Migration.Toolkit.Common/Enumerations/NodeXmlColumns.cs +++ b/Migration.Tool.Common/Enumerations/NodeXmlColumns.cs @@ -1,4 +1,4 @@ -namespace Migration.Toolkit.Common.Enumerations; +namespace Migration.Tool.Common.Enumerations; public class NodeXmlColumns { diff --git a/Migration.Toolkit.Common/Enumerations/XbKSystemClasses.cs b/Migration.Tool.Common/Enumerations/XbKSystemClasses.cs similarity index 99% rename from Migration.Toolkit.Common/Enumerations/XbKSystemClasses.cs rename to Migration.Tool.Common/Enumerations/XbKSystemClasses.cs index aa7e2edc..c3a23b8f 100644 --- a/Migration.Toolkit.Common/Enumerations/XbKSystemClasses.cs +++ b/Migration.Tool.Common/Enumerations/XbKSystemClasses.cs @@ -1,6 +1,6 @@ // ReSharper disable InconsistentNaming -namespace Migration.Toolkit.Common.Enumerations; +namespace Migration.Tool.Common.Enumerations; #pragma warning disable IDE1006 public class XbKSystemClasses { diff --git a/Migration.Toolkit.Common/Enumerations/XbkSystemResource.cs b/Migration.Tool.Common/Enumerations/XbkSystemResource.cs similarity index 98% rename from Migration.Toolkit.Common/Enumerations/XbkSystemResource.cs rename to Migration.Tool.Common/Enumerations/XbkSystemResource.cs index 386f22c1..32edaf2b 100644 --- a/Migration.Toolkit.Common/Enumerations/XbkSystemResource.cs +++ b/Migration.Tool.Common/Enumerations/XbkSystemResource.cs @@ -1,6 +1,6 @@ // ReSharper disable InconsistentNaming -namespace Migration.Toolkit.Common.Enumerations; +namespace Migration.Tool.Common.Enumerations; public static class XbkSystemResource { diff --git a/Migration.Tool.Common/Extensions.cs b/Migration.Tool.Common/Extensions.cs new file mode 100644 index 00000000..de64cb87 --- /dev/null +++ b/Migration.Tool.Common/Extensions.cs @@ -0,0 +1,210 @@ +using System.Data; +using System.Data.Common; +using System.Linq.Expressions; +using System.Xml.Linq; + +using CMS.Base; +using CMS.Helpers; + +using Newtonsoft.Json; + +namespace Migration.Tool.Common; + +public static class Extensions +{ + public static T Unbox(this IDataReader reader, string propertyName) + { + if (reader.GetOrdinal(propertyName) < 0) + { + throw new InvalidOperationException($"Property '{propertyName}' not exists"); + } + + return reader[propertyName] switch + { + T r => r, + DBNull => default!, + _ => throw new InvalidCastException($"Unboxing property '{propertyName}' of type '{reader[propertyName].GetType().FullName}' to type '{typeof(T).FullName}' failed") + }; + } + + public static bool IsIn(this T value, params T[] values) => values.Contains(value); + + public static string GetMemberName(this Expression> expr) + { + var stack = new Stack(); + + var me = expr.Body.NodeType switch + { + ExpressionType.Convert => (expr.Body is UnaryExpression ue ? ue.Operand : null) as MemberExpression, + ExpressionType.ConvertChecked => (expr.Body is UnaryExpression ue ? ue.Operand : null) as MemberExpression, + ExpressionType.Add => throw new NotImplementedException(), + ExpressionType.AddChecked => throw new NotImplementedException(), + ExpressionType.And => throw new NotImplementedException(), + ExpressionType.AndAlso => throw new NotImplementedException(), + ExpressionType.ArrayLength => throw new NotImplementedException(), + ExpressionType.ArrayIndex => throw new NotImplementedException(), + ExpressionType.Call => throw new NotImplementedException(), + ExpressionType.Coalesce => throw new NotImplementedException(), + ExpressionType.Conditional => throw new NotImplementedException(), + ExpressionType.Constant => throw new NotImplementedException(), + ExpressionType.Divide => throw new NotImplementedException(), + ExpressionType.Equal => throw new NotImplementedException(), + ExpressionType.ExclusiveOr => throw new NotImplementedException(), + ExpressionType.GreaterThan => throw new NotImplementedException(), + ExpressionType.GreaterThanOrEqual => throw new NotImplementedException(), + ExpressionType.Invoke => throw new NotImplementedException(), + ExpressionType.Lambda => throw new NotImplementedException(), + ExpressionType.LeftShift => throw new NotImplementedException(), + ExpressionType.LessThan => throw new NotImplementedException(), + ExpressionType.LessThanOrEqual => throw new NotImplementedException(), + ExpressionType.ListInit => throw new NotImplementedException(), + ExpressionType.MemberAccess => throw new NotImplementedException(), + ExpressionType.MemberInit => throw new NotImplementedException(), + ExpressionType.Modulo => throw new NotImplementedException(), + ExpressionType.Multiply => throw new NotImplementedException(), + ExpressionType.MultiplyChecked => throw new NotImplementedException(), + ExpressionType.Negate => throw new NotImplementedException(), + ExpressionType.UnaryPlus => throw new NotImplementedException(), + ExpressionType.NegateChecked => throw new NotImplementedException(), + ExpressionType.New => throw new NotImplementedException(), + ExpressionType.NewArrayInit => throw new NotImplementedException(), + ExpressionType.NewArrayBounds => throw new NotImplementedException(), + ExpressionType.Not => throw new NotImplementedException(), + ExpressionType.NotEqual => throw new NotImplementedException(), + ExpressionType.Or => throw new NotImplementedException(), + ExpressionType.OrElse => throw new NotImplementedException(), + ExpressionType.Parameter => throw new NotImplementedException(), + ExpressionType.Power => throw new NotImplementedException(), + ExpressionType.Quote => throw new NotImplementedException(), + ExpressionType.RightShift => throw new NotImplementedException(), + ExpressionType.Subtract => throw new NotImplementedException(), + ExpressionType.SubtractChecked => throw new NotImplementedException(), + ExpressionType.TypeAs => throw new NotImplementedException(), + ExpressionType.TypeIs => throw new NotImplementedException(), + ExpressionType.Assign => throw new NotImplementedException(), + ExpressionType.Block => throw new NotImplementedException(), + ExpressionType.DebugInfo => throw new NotImplementedException(), + ExpressionType.Decrement => throw new NotImplementedException(), + ExpressionType.Dynamic => throw new NotImplementedException(), + ExpressionType.Default => throw new NotImplementedException(), + ExpressionType.Extension => throw new NotImplementedException(), + ExpressionType.Goto => throw new NotImplementedException(), + ExpressionType.Increment => throw new NotImplementedException(), + ExpressionType.Index => throw new NotImplementedException(), + ExpressionType.Label => throw new NotImplementedException(), + ExpressionType.RuntimeVariables => throw new NotImplementedException(), + ExpressionType.Loop => throw new NotImplementedException(), + ExpressionType.Switch => throw new NotImplementedException(), + ExpressionType.Throw => throw new NotImplementedException(), + ExpressionType.Try => throw new NotImplementedException(), + ExpressionType.Unbox => throw new NotImplementedException(), + ExpressionType.AddAssign => throw new NotImplementedException(), + ExpressionType.AndAssign => throw new NotImplementedException(), + ExpressionType.DivideAssign => throw new NotImplementedException(), + ExpressionType.ExclusiveOrAssign => throw new NotImplementedException(), + ExpressionType.LeftShiftAssign => throw new NotImplementedException(), + ExpressionType.ModuloAssign => throw new NotImplementedException(), + ExpressionType.MultiplyAssign => throw new NotImplementedException(), + ExpressionType.OrAssign => throw new NotImplementedException(), + ExpressionType.PowerAssign => throw new NotImplementedException(), + ExpressionType.RightShiftAssign => throw new NotImplementedException(), + ExpressionType.SubtractAssign => throw new NotImplementedException(), + ExpressionType.AddAssignChecked => throw new NotImplementedException(), + ExpressionType.MultiplyAssignChecked => throw new NotImplementedException(), + ExpressionType.SubtractAssignChecked => throw new NotImplementedException(), + ExpressionType.PreIncrementAssign => throw new NotImplementedException(), + ExpressionType.PreDecrementAssign => throw new NotImplementedException(), + ExpressionType.PostIncrementAssign => throw new NotImplementedException(), + ExpressionType.PostDecrementAssign => throw new NotImplementedException(), + ExpressionType.TypeEqual => throw new NotImplementedException(), + ExpressionType.OnesComplement => throw new NotImplementedException(), + ExpressionType.IsTrue => throw new NotImplementedException(), + ExpressionType.IsFalse => throw new NotImplementedException(), + _ => expr.Body as MemberExpression + }; + + while (me != null) + { + stack.Push(me.Member.Name); + me = me.Expression as MemberExpression; + } + + return string.Join(".", stack.ToArray()); + } + + public static bool UseKenticoDefault(this bool? value) => value ?? false; + public static int UseKenticoDefault(this int? value) => value ?? 0; + + public static TEnum AsEnum(this int? value) where TEnum : Enum + => (TEnum)Enum.ToObject(typeof(TEnum), value ?? 0); + + public static TEnum AsEnum(this string? value) where TEnum : struct, Enum + => Enum.TryParse(value, out var val) ? val : default; + + public static int? NullIfZero(this int? value) => value == 0 ? null : value; + public static int? NullIfZero(this int value) => value == 0 ? null : value; + + public static string? NullIf(this string? s, string value) => s == value ? null : s; + + public static void SetValueAsJson(this ISimpleDataContainer container, string column, TValue value) => container.SetValue(column, !value?.Equals(default) ?? false ? JsonConvert.SerializeObject(value) : null); + + public static void SetValueAsJson(this ISimpleDataContainer container, string column, IEnumerable values) => container.SetValue(column, values.Any() ? JsonConvert.SerializeObject(values) : null); + + public static void SetValueAsJson(this Dictionary container, string column, TValue value) => container[column] = value?.Equals(default) ?? true ? null : JsonConvert.SerializeObject(value); + + public static void SetValueAsJson(this Dictionary container, string column, IEnumerable values) => container[column] = values.Any() ? JsonConvert.SerializeObject(values) : null; + + #region System.Xml.Linq extensions + + /// + /// + /// + /// + /// + /// Returns ensured XElement + public static XElement EnsureElement(this XElement element, XName name, Action? elementUpdate = null) + { + if (element.Element(name) is { } result) + { + elementUpdate?.Invoke(result); + return result; + } + + var newElement = new XElement(name); + elementUpdate?.Invoke(newElement); + element.Add(newElement); + return newElement; + } + + #endregion + + public static T Unbox(this DbDataReader reader, string propertyName) + { + if (reader.GetOrdinal(propertyName) < 0) + { + throw new InvalidOperationException($"Property '{propertyName}' not exists"); + } + + return reader[propertyName] switch + { + T r => r, + DBNull => default, + _ => throw new InvalidCastException($"Unboxing property '{propertyName}' of type '{reader[propertyName].GetType().FullName}' to type '{typeof(T).FullName}' failed") + }; + } + + public static T Value(this XElement element) => element?.Value == default + ? default + : ValidationHelper.GetValue(element.Value); + + + public static bool? ValueAsBool(this XElement element) + { + if (element != null && bool.TryParse(element.Value, out bool value)) + { + return value; + } + + return default; + } +} diff --git a/Migration.Toolkit.Common/Helpers/AlignResult.cs b/Migration.Tool.Common/Helpers/AlignResult.cs similarity index 94% rename from Migration.Toolkit.Common/Helpers/AlignResult.cs rename to Migration.Tool.Common/Helpers/AlignResult.cs index 1c500076..e32bbe5f 100644 --- a/Migration.Toolkit.Common/Helpers/AlignResult.cs +++ b/Migration.Tool.Common/Helpers/AlignResult.cs @@ -1,4 +1,4 @@ -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public abstract record SimpleAlignResult(TLeft? A, TRight? B, TKey? Key); diff --git a/Migration.Toolkit.Common/Helpers/ConsoleHelper.cs b/Migration.Tool.Common/Helpers/ConsoleHelper.cs similarity index 96% rename from Migration.Toolkit.Common/Helpers/ConsoleHelper.cs rename to Migration.Tool.Common/Helpers/ConsoleHelper.cs index 3f2e3325..c29f7815 100644 --- a/Migration.Toolkit.Common/Helpers/ConsoleHelper.cs +++ b/Migration.Tool.Common/Helpers/ConsoleHelper.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public static class ConsoleHelper { diff --git a/Migration.Toolkit.Common/Helpers/DeferrableItemEnumerableWrapper.cs b/Migration.Tool.Common/Helpers/DeferrableItemEnumerableWrapper.cs similarity index 96% rename from Migration.Toolkit.Common/Helpers/DeferrableItemEnumerableWrapper.cs rename to Migration.Tool.Common/Helpers/DeferrableItemEnumerableWrapper.cs index 0084847f..ac4ae208 100644 --- a/Migration.Toolkit.Common/Helpers/DeferrableItemEnumerableWrapper.cs +++ b/Migration.Tool.Common/Helpers/DeferrableItemEnumerableWrapper.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public class DeferrableItemEnumerableWrapper(IEnumerable innerEnumerable, int maxRecurrenceLimit = 5) : IDisposable { diff --git a/Migration.Toolkit.Common/Helpers/EnumerableHelper.cs b/Migration.Tool.Common/Helpers/EnumerableHelper.cs similarity index 94% rename from Migration.Toolkit.Common/Helpers/EnumerableHelper.cs rename to Migration.Tool.Common/Helpers/EnumerableHelper.cs index a0377dbd..e97b8436 100644 --- a/Migration.Toolkit.Common/Helpers/EnumerableHelper.cs +++ b/Migration.Tool.Common/Helpers/EnumerableHelper.cs @@ -1,4 +1,4 @@ -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public class EnumerableHelper { diff --git a/Migration.Toolkit.Common/Helpers/GuidHelper.cs b/Migration.Tool.Common/Helpers/GuidHelper.cs similarity index 87% rename from Migration.Toolkit.Common/Helpers/GuidHelper.cs rename to Migration.Tool.Common/Helpers/GuidHelper.cs index 5aa2ac58..6b46fcde 100644 --- a/Migration.Toolkit.Common/Helpers/GuidHelper.cs +++ b/Migration.Tool.Common/Helpers/GuidHelper.cs @@ -1,4 +1,4 @@ -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public static class GuidHelper { @@ -10,6 +10,7 @@ public static class GuidHelper public static readonly Guid GuidNsDocumentNameField = new("8935FCE5-1BDC-4677-A4CA-6DFD32F65A0F"); public static readonly Guid GuidNsAsset = new("9CC6DE90-8993-42D8-B4C1-1429B2F780A2"); public static readonly Guid GuidNsFolder = new("E21255AC-70F3-4A95-881A-E4AD908AF27C"); + public static readonly Guid GuidNsDataClass = new("E21255AC-70F3-4A95-881A-E4AD908AF27C"); public static Guid CreateWebPageUrlPathGuid(string hash) => GuidV5.NewNameBased(GuidNsWebPageUrlPathInfo, hash); public static Guid CreateReusableSchemaGuid(string name) => GuidV5.NewNameBased(GuidNsReusableSchema, name); @@ -18,7 +19,8 @@ public static class GuidHelper public static Guid CreateTaxonomyGuid(string name) => GuidV5.NewNameBased(GuidNsTaxonomy, name); public static Guid CreateDocumentNameFieldGuid(string name) => GuidV5.NewNameBased(GuidNsDocumentNameField, name); public static Guid CreateAssetGuid(Guid newMediaFileGuid, string contentLanguageCode) => GuidV5.NewNameBased(GuidNsAsset, $"{newMediaFileGuid}|{contentLanguageCode}"); - public static Guid CreateFolderGuid(string path) => GuidV5.NewNameBased(GuidNsDocumentNameField, path); + public static Guid CreateFolderGuid(string path) => GuidV5.NewNameBased(GuidNsFolder, path); + public static Guid CreateDataClassGuid(string key) => GuidV5.NewNameBased(GuidNsDataClass, key); public static readonly Guid GuidNsLibraryFallback = new("8935FCE5-1BDC-4677-A4CA-6DFD32F65A0F"); diff --git a/Migration.Toolkit.Common/Helpers/GuidV5.cs b/Migration.Tool.Common/Helpers/GuidV5.cs similarity index 98% rename from Migration.Toolkit.Common/Helpers/GuidV5.cs rename to Migration.Tool.Common/Helpers/GuidV5.cs index c045c756..1272cd93 100644 --- a/Migration.Toolkit.Common/Helpers/GuidV5.cs +++ b/Migration.Tool.Common/Helpers/GuidV5.cs @@ -1,7 +1,7 @@ using System.Security.Cryptography; using System.Text; -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public static class GuidV5 { diff --git a/Migration.Toolkit.Common/Helpers/HtmlProcessor.cs b/Migration.Tool.Common/Helpers/HtmlProcessor.cs similarity index 98% rename from Migration.Toolkit.Common/Helpers/HtmlProcessor.cs rename to Migration.Tool.Common/Helpers/HtmlProcessor.cs index 6ff29d73..0e25f8a4 100644 --- a/Migration.Toolkit.Common/Helpers/HtmlProcessor.cs +++ b/Migration.Tool.Common/Helpers/HtmlProcessor.cs @@ -1,6 +1,6 @@ using HtmlAgilityPack; -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public class HtmlProcessor { diff --git a/Migration.Toolkit.Common/Helpers/MediaLinkService.cs b/Migration.Tool.Common/Helpers/MediaLinkService.cs similarity index 99% rename from Migration.Toolkit.Common/Helpers/MediaLinkService.cs rename to Migration.Tool.Common/Helpers/MediaLinkService.cs index 91dc7d9b..291fcaff 100644 --- a/Migration.Toolkit.Common/Helpers/MediaLinkService.cs +++ b/Migration.Tool.Common/Helpers/MediaLinkService.cs @@ -1,6 +1,6 @@ using System.Collections.Immutable; -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public enum MediaKind { diff --git a/Migration.Toolkit.Common/Helpers/ReflectionHelper.cs b/Migration.Tool.Common/Helpers/ReflectionHelper.cs similarity index 99% rename from Migration.Toolkit.Common/Helpers/ReflectionHelper.cs rename to Migration.Tool.Common/Helpers/ReflectionHelper.cs index 5f225c87..95a06b0c 100644 --- a/Migration.Toolkit.Common/Helpers/ReflectionHelper.cs +++ b/Migration.Tool.Common/Helpers/ReflectionHelper.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using System.Reflection; -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public static class ReflectionHelper { diff --git a/Migration.Toolkit.Common/Helpers/SerializationHelper.cs b/Migration.Tool.Common/Helpers/SerializationHelper.cs similarity index 90% rename from Migration.Toolkit.Common/Helpers/SerializationHelper.cs rename to Migration.Tool.Common/Helpers/SerializationHelper.cs index 1c538d76..f464923e 100644 --- a/Migration.Toolkit.Common/Helpers/SerializationHelper.cs +++ b/Migration.Tool.Common/Helpers/SerializationHelper.cs @@ -4,13 +4,15 @@ using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public class SerializationHelper { public static string SerializeOnlyNonComplexProperties(T obj) => JsonConvert.SerializeObject(obj, Formatting.Indented, new JsonSerializerSettings { ContractResolver = new ShouldSerializeContractResolver(), ReferenceLoopHandling = ReferenceLoopHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore, MaxDepth = 1 }); + public static string Serialize(T obj) => JsonConvert.SerializeObject(obj); + public class ShouldSerializeContractResolver : DefaultContractResolver { public static readonly ShouldSerializeContractResolver Instance = new(); diff --git a/Migration.Toolkit.Common/Helpers/SimpleAligner.cs b/Migration.Tool.Common/Helpers/SimpleAligner.cs similarity index 98% rename from Migration.Toolkit.Common/Helpers/SimpleAligner.cs rename to Migration.Tool.Common/Helpers/SimpleAligner.cs index fae26b28..c5c1ac9f 100644 --- a/Migration.Toolkit.Common/Helpers/SimpleAligner.cs +++ b/Migration.Tool.Common/Helpers/SimpleAligner.cs @@ -1,6 +1,6 @@ using System.Collections; -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public class SimpleAligner : IEnumerator> where TLeft : class where TRight : class { diff --git a/Migration.Toolkit.Common/Helpers/TreePathConvertor.cs b/Migration.Tool.Common/Helpers/TreePathConvertor.cs similarity index 98% rename from Migration.Toolkit.Common/Helpers/TreePathConvertor.cs rename to Migration.Tool.Common/Helpers/TreePathConvertor.cs index b0cae6bb..26598ee3 100644 --- a/Migration.Toolkit.Common/Helpers/TreePathConvertor.cs +++ b/Migration.Tool.Common/Helpers/TreePathConvertor.cs @@ -2,7 +2,7 @@ using CMS.Core; using CMS.Websites.Internal; -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public class TreePathConvertor(int webSiteChannel) { diff --git a/Migration.Toolkit.Common/Helpers/UniqueTreePathProvider.cs b/Migration.Tool.Common/Helpers/UniqueTreePathProvider.cs similarity index 98% rename from Migration.Toolkit.Common/Helpers/UniqueTreePathProvider.cs rename to Migration.Tool.Common/Helpers/UniqueTreePathProvider.cs index 814f2c51..cc4ba51f 100644 --- a/Migration.Toolkit.Common/Helpers/UniqueTreePathProvider.cs +++ b/Migration.Tool.Common/Helpers/UniqueTreePathProvider.cs @@ -1,7 +1,7 @@ using CMS.ContentEngine.Internal; using CMS.Websites.Internal; -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; /// /// Provides unique tree path. diff --git a/Migration.Toolkit.Common/Helpers/UriHelper.cs b/Migration.Tool.Common/Helpers/UriHelper.cs similarity index 97% rename from Migration.Toolkit.Common/Helpers/UriHelper.cs rename to Migration.Tool.Common/Helpers/UriHelper.cs index fa5f7a76..9f2b4896 100644 --- a/Migration.Toolkit.Common/Helpers/UriHelper.cs +++ b/Migration.Tool.Common/Helpers/UriHelper.cs @@ -1,6 +1,6 @@ using System.Text; -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public static class UriHelper { diff --git a/Migration.Toolkit.Common/Helpers/VersionHelper.cs b/Migration.Tool.Common/Helpers/VersionHelper.cs similarity index 91% rename from Migration.Toolkit.Common/Helpers/VersionHelper.cs rename to Migration.Tool.Common/Helpers/VersionHelper.cs index ccb126e2..40cab06a 100644 --- a/Migration.Toolkit.Common/Helpers/VersionHelper.cs +++ b/Migration.Tool.Common/Helpers/VersionHelper.cs @@ -1,6 +1,6 @@ using Microsoft.Data.SqlClient; -namespace Migration.Toolkit.Common.Helpers; +namespace Migration.Tool.Common.Helpers; public static class VersionHelper { diff --git a/Migration.Toolkit.Common/IPrimaryKeyMappingContext.cs b/Migration.Tool.Common/IPrimaryKeyMappingContext.cs similarity index 96% rename from Migration.Toolkit.Common/IPrimaryKeyMappingContext.cs rename to Migration.Tool.Common/IPrimaryKeyMappingContext.cs index 69038e5a..e3a1060d 100644 --- a/Migration.Toolkit.Common/IPrimaryKeyMappingContext.cs +++ b/Migration.Tool.Common/IPrimaryKeyMappingContext.cs @@ -1,6 +1,6 @@ using System.Linq.Expressions; -namespace Migration.Toolkit.Common; +namespace Migration.Tool.Common; public record MapSourceIdResult(bool Success, int? MappedId); diff --git a/Migration.Toolkit.Common/IPrinter.cs b/Migration.Tool.Common/IPrinter.cs similarity index 91% rename from Migration.Toolkit.Common/IPrinter.cs rename to Migration.Tool.Common/IPrinter.cs index 29a3f7f9..afd518a0 100644 --- a/Migration.Toolkit.Common/IPrinter.cs +++ b/Migration.Tool.Common/IPrinter.cs @@ -1,4 +1,4 @@ -namespace Migration.Toolkit.Common; +namespace Migration.Tool.Common; // public interface IPrinter // { diff --git a/Migration.Toolkit.Common/LogExtensions.cs b/Migration.Tool.Common/LogExtensions.cs similarity index 93% rename from Migration.Toolkit.Common/LogExtensions.cs rename to Migration.Tool.Common/LogExtensions.cs index c729d9ef..6c63e340 100644 --- a/Migration.Toolkit.Common/LogExtensions.cs +++ b/Migration.Tool.Common/LogExtensions.cs @@ -1,11 +1,11 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Common.Services; -namespace Migration.Toolkit.Common; +namespace Migration.Tool.Common; public static class LogExtensions { diff --git a/Migration.Toolkit.Common/Migration.Toolkit.Common.csproj b/Migration.Tool.Common/Migration.Tool.Common.csproj similarity index 100% rename from Migration.Toolkit.Common/Migration.Toolkit.Common.csproj rename to Migration.Tool.Common/Migration.Tool.Common.csproj diff --git a/Migration.Toolkit.Common/Migration.Toolkit.Common.csproj.DotSettings.user b/Migration.Tool.Common/Migration.Tool.Common.csproj.DotSettings.user similarity index 100% rename from Migration.Toolkit.Common/Migration.Toolkit.Common.csproj.DotSettings.user rename to Migration.Tool.Common/Migration.Tool.Common.csproj.DotSettings.user diff --git a/Migration.Toolkit.Common/MigrationProtocol/DebugMigrationProtocol.cs b/Migration.Tool.Common/MigrationProtocol/DebugMigrationProtocol.cs similarity index 93% rename from Migration.Toolkit.Common/MigrationProtocol/DebugMigrationProtocol.cs rename to Migration.Tool.Common/MigrationProtocol/DebugMigrationProtocol.cs index 60dc6f9f..e76c7406 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/DebugMigrationProtocol.cs +++ b/Migration.Tool.Common/MigrationProtocol/DebugMigrationProtocol.cs @@ -2,9 +2,9 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; +using Migration.Tool.Common.Abstractions; -namespace Migration.Toolkit.Common.MigrationProtocol; +namespace Migration.Tool.Common.MigrationProtocol; public class DebugMigrationProtocol(ILogger logger) : IMigrationProtocol { diff --git a/Migration.Toolkit.Common/MigrationProtocol/HandbookReference.cs b/Migration.Tool.Common/MigrationProtocol/HandbookReference.cs similarity index 98% rename from Migration.Toolkit.Common/MigrationProtocol/HandbookReference.cs rename to Migration.Tool.Common/MigrationProtocol/HandbookReference.cs index 40c9cdf0..6a0d8dd4 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/HandbookReference.cs +++ b/Migration.Tool.Common/MigrationProtocol/HandbookReference.cs @@ -1,9 +1,9 @@ using System.Reflection; using System.Text; -using Migration.Toolkit.Common.Services; +using Migration.Tool.Common.Services; -namespace Migration.Toolkit.Common.MigrationProtocol; +namespace Migration.Tool.Common.MigrationProtocol; public class HandbookReference { diff --git a/Migration.Toolkit.Common/MigrationProtocol/HandbookReferences.cs b/Migration.Tool.Common/MigrationProtocol/HandbookReferences.cs similarity index 98% rename from Migration.Toolkit.Common/MigrationProtocol/HandbookReferences.cs rename to Migration.Tool.Common/MigrationProtocol/HandbookReferences.cs index 3c230d1f..4be9f138 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/HandbookReferences.cs +++ b/Migration.Tool.Common/MigrationProtocol/HandbookReferences.cs @@ -1,8 +1,8 @@ using Microsoft.Data.SqlClient; -using Migration.Toolkit.Common.Helpers; +using Migration.Tool.Common.Helpers; -namespace Migration.Toolkit.Common.MigrationProtocol; +namespace Migration.Tool.Common.MigrationProtocol; public static class HandbookReferences { diff --git a/Migration.Toolkit.Common/MigrationProtocol/IMigrationProtocol.cs b/Migration.Tool.Common/MigrationProtocol/IMigrationProtocol.cs similarity index 89% rename from Migration.Toolkit.Common/MigrationProtocol/IMigrationProtocol.cs rename to Migration.Tool.Common/MigrationProtocol/IMigrationProtocol.cs index c1eb9bc8..c0ef6eb7 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/IMigrationProtocol.cs +++ b/Migration.Tool.Common/MigrationProtocol/IMigrationProtocol.cs @@ -1,8 +1,8 @@ using MediatR; -using Migration.Toolkit.Common.Abstractions; +using Migration.Tool.Common.Abstractions; -namespace Migration.Toolkit.Common.MigrationProtocol; +namespace Migration.Tool.Common.MigrationProtocol; public interface IMigrationProtocol { diff --git a/Migration.Tool.Common/MigrationProtocol/IProtocol.cs b/Migration.Tool.Common/MigrationProtocol/IProtocol.cs new file mode 100644 index 00000000..9283f232 --- /dev/null +++ b/Migration.Tool.Common/MigrationProtocol/IProtocol.cs @@ -0,0 +1,5 @@ +namespace Migration.Tool.Common.MigrationProtocol; + +public interface IProtocol : IMigrationProtocol +{ +} diff --git a/Migration.Toolkit.Common/MigrationProtocol/NullMigrationProtocol.cs b/Migration.Tool.Common/MigrationProtocol/NullMigrationProtocol.cs similarity index 91% rename from Migration.Toolkit.Common/MigrationProtocol/NullMigrationProtocol.cs rename to Migration.Tool.Common/MigrationProtocol/NullMigrationProtocol.cs index 6fd8fb57..1553821d 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/NullMigrationProtocol.cs +++ b/Migration.Tool.Common/MigrationProtocol/NullMigrationProtocol.cs @@ -1,8 +1,8 @@ using MediatR; -using Migration.Toolkit.Common.Abstractions; +using Migration.Tool.Common.Abstractions; -namespace Migration.Toolkit.Common.MigrationProtocol; +namespace Migration.Tool.Common.MigrationProtocol; public class NullMigrationProtocol : IMigrationProtocol { diff --git a/Migration.Toolkit.Common/MigrationProtocol/Protocol.cs b/Migration.Tool.Common/MigrationProtocol/Protocol.cs similarity index 95% rename from Migration.Toolkit.Common/MigrationProtocol/Protocol.cs rename to Migration.Tool.Common/MigrationProtocol/Protocol.cs index 88baf2f0..2ea6e946 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/Protocol.cs +++ b/Migration.Tool.Common/MigrationProtocol/Protocol.cs @@ -1,8 +1,8 @@ using MediatR; -using Migration.Toolkit.Common.Abstractions; +using Migration.Tool.Common.Abstractions; -namespace Migration.Toolkit.Common.MigrationProtocol; +namespace Migration.Tool.Common.MigrationProtocol; public class Protocol(IEnumerable protocols) : IProtocol { diff --git a/Migration.Toolkit.Common/MigrationProtocol/TextMigrationProtocol.cs b/Migration.Tool.Common/MigrationProtocol/TextMigrationProtocol.cs similarity index 92% rename from Migration.Toolkit.Common/MigrationProtocol/TextMigrationProtocol.cs rename to Migration.Tool.Common/MigrationProtocol/TextMigrationProtocol.cs index 6ebbd28a..62d74ce3 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/TextMigrationProtocol.cs +++ b/Migration.Tool.Common/MigrationProtocol/TextMigrationProtocol.cs @@ -2,17 +2,17 @@ using MediatR; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Services; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Services; -namespace Migration.Toolkit.Common.MigrationProtocol; +namespace Migration.Tool.Common.MigrationProtocol; public class TextMigrationProtocol : IMigrationProtocol, IDisposable { private readonly IPrintService printService; private readonly StreamWriter streamWriter; - public TextMigrationProtocol(ToolkitConfiguration configuration, IPrintService printService) + public TextMigrationProtocol(ToolConfiguration configuration, IPrintService printService) { this.printService = printService; diff --git a/Migration.Toolkit.Common/OptInFeatures.cs b/Migration.Tool.Common/OptInFeatures.cs similarity index 98% rename from Migration.Toolkit.Common/OptInFeatures.cs rename to Migration.Tool.Common/OptInFeatures.cs index 3050c298..96daac14 100644 --- a/Migration.Toolkit.Common/OptInFeatures.cs +++ b/Migration.Tool.Common/OptInFeatures.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Configuration; -namespace Migration.Toolkit.Common; +namespace Migration.Tool.Common; // ReSharper disable once ClassNeverInstantiated.Global public class OptInFeatures diff --git a/Migration.Toolkit.Common/Resources.Designer.cs b/Migration.Tool.Common/Resources.Designer.cs similarity index 98% rename from Migration.Toolkit.Common/Resources.Designer.cs rename to Migration.Tool.Common/Resources.Designer.cs index ebe1faf1..64997567 100644 --- a/Migration.Toolkit.Common/Resources.Designer.cs +++ b/Migration.Tool.Common/Resources.Designer.cs @@ -1,13 +1,14 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace Migration.Toolkit.Common { +namespace Migration.Tool.Common { using System; @@ -38,7 +39,7 @@ internal Resources() { public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Migration.Toolkit.Common.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Migration.Tool.Common.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/Migration.Toolkit.Common/Resources.resx b/Migration.Tool.Common/Resources.resx similarity index 100% rename from Migration.Toolkit.Common/Resources.resx rename to Migration.Tool.Common/Resources.resx diff --git a/Migration.Toolkit.Common/SemanticVersion.cs b/Migration.Tool.Common/SemanticVersion.cs similarity index 98% rename from Migration.Toolkit.Common/SemanticVersion.cs rename to Migration.Tool.Common/SemanticVersion.cs index 5dcbb63e..7f99af67 100644 --- a/Migration.Toolkit.Common/SemanticVersion.cs +++ b/Migration.Tool.Common/SemanticVersion.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; using System.Text; -namespace Migration.Toolkit.Common; +namespace Migration.Tool.Common; /// /// simplified implementation of semantic version object for this use-case diff --git a/Migration.Toolkit.Common/Services/BulkCopy/BulkCopyRequest.cs b/Migration.Tool.Common/Services/BulkCopy/BulkCopyRequest.cs similarity index 96% rename from Migration.Toolkit.Common/Services/BulkCopy/BulkCopyRequest.cs rename to Migration.Tool.Common/Services/BulkCopy/BulkCopyRequest.cs index 24015d96..b688d65e 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/BulkCopyRequest.cs +++ b/Migration.Tool.Common/Services/BulkCopy/BulkCopyRequest.cs @@ -1,6 +1,6 @@ using System.Data; -namespace Migration.Toolkit.Common.Services.BulkCopy; +namespace Migration.Tool.Common.Services.BulkCopy; /// /// Request definition for bulk copy service diff --git a/Migration.Toolkit.Common/Services/BulkCopy/BulkDataCopyService.cs b/Migration.Tool.Common/Services/BulkCopy/BulkDataCopyService.cs similarity index 98% rename from Migration.Toolkit.Common/Services/BulkCopy/BulkDataCopyService.cs rename to Migration.Tool.Common/Services/BulkCopy/BulkDataCopyService.cs index 12bb6a72..3ac6cd6a 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/BulkDataCopyService.cs +++ b/Migration.Tool.Common/Services/BulkCopy/BulkDataCopyService.cs @@ -4,13 +4,13 @@ using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Helpers; +using Migration.Tool.Common.Helpers; -namespace Migration.Toolkit.Common.Services.BulkCopy; +namespace Migration.Tool.Common.Services.BulkCopy; public record SqlColumn(string ColumnName, int OrdinalPosition); -public class BulkDataCopyService(ToolkitConfiguration configuration, ILogger logger) +public class BulkDataCopyService(ToolConfiguration configuration, ILogger logger) { public bool CheckIfDataExistsInTargetTable(string tableName) { diff --git a/Migration.Toolkit.Common/Services/BulkCopy/DataReaderProxyBase.cs b/Migration.Tool.Common/Services/BulkCopy/DataReaderProxyBase.cs similarity index 98% rename from Migration.Toolkit.Common/Services/BulkCopy/DataReaderProxyBase.cs rename to Migration.Tool.Common/Services/BulkCopy/DataReaderProxyBase.cs index 82891467..ce9fb167 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/DataReaderProxyBase.cs +++ b/Migration.Tool.Common/Services/BulkCopy/DataReaderProxyBase.cs @@ -1,6 +1,6 @@ using System.Data; -namespace Migration.Toolkit.Common.Services.BulkCopy; +namespace Migration.Tool.Common.Services.BulkCopy; public class DataReaderProxyBase(IDataReader innerReader) : IDataReader { diff --git a/Migration.Toolkit.Common/Services/BulkCopy/FilteredDbDataReader.cs b/Migration.Tool.Common/Services/BulkCopy/FilteredDbDataReader.cs similarity index 92% rename from Migration.Toolkit.Common/Services/BulkCopy/FilteredDbDataReader.cs rename to Migration.Tool.Common/Services/BulkCopy/FilteredDbDataReader.cs index 26c483d5..bd43f3db 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/FilteredDbDataReader.cs +++ b/Migration.Tool.Common/Services/BulkCopy/FilteredDbDataReader.cs @@ -1,6 +1,6 @@ using System.Data; -namespace Migration.Toolkit.Common.Services.BulkCopy; +namespace Migration.Tool.Common.Services.BulkCopy; public class FilteredDbDataReader(IDataReader innerReader, Func includePredicate) : DataReaderProxyBase(innerReader) where TReader : IDataReader diff --git a/Migration.Toolkit.Common/Services/BulkCopy/ValueInterceptingReader.cs b/Migration.Tool.Common/Services/BulkCopy/ValueInterceptingReader.cs similarity index 97% rename from Migration.Toolkit.Common/Services/BulkCopy/ValueInterceptingReader.cs rename to Migration.Tool.Common/Services/BulkCopy/ValueInterceptingReader.cs index f8632608..fd0fb521 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/ValueInterceptingReader.cs +++ b/Migration.Tool.Common/Services/BulkCopy/ValueInterceptingReader.cs @@ -1,6 +1,6 @@ using System.Data; -namespace Migration.Toolkit.Common.Services.BulkCopy; +namespace Migration.Tool.Common.Services.BulkCopy; public record ValueInterceptorResult(object? Value = null, bool OverwriteValue = false, bool SkipDataRow = false) { diff --git a/Migration.Toolkit.Common/Services/CommandParser.cs b/Migration.Tool.Common/Services/CommandParser.cs similarity index 97% rename from Migration.Toolkit.Common/Services/CommandParser.cs rename to Migration.Tool.Common/Services/CommandParser.cs index 53a461f2..2fbef1b3 100644 --- a/Migration.Toolkit.Common/Services/CommandParser.cs +++ b/Migration.Tool.Common/Services/CommandParser.cs @@ -1,8 +1,8 @@ -using Migration.Toolkit.Common.Abstractions; +using Migration.Tool.Common.Abstractions; -using static Migration.Toolkit.Common.Helpers.ConsoleHelper; +using static Migration.Tool.Common.Helpers.ConsoleHelper; -namespace Migration.Toolkit.Common.Services; +namespace Migration.Tool.Common.Services; public class CommandParser : ICommandParser { diff --git a/Migration.Toolkit.Common/Services/CoupledDataService.cs b/Migration.Tool.Common/Services/CoupledDataService.cs similarity index 90% rename from Migration.Toolkit.Common/Services/CoupledDataService.cs rename to Migration.Tool.Common/Services/CoupledDataService.cs index b39c5e01..677f5a80 100644 --- a/Migration.Toolkit.Common/Services/CoupledDataService.cs +++ b/Migration.Tool.Common/Services/CoupledDataService.cs @@ -1,8 +1,8 @@ using Microsoft.Data.SqlClient; -namespace Migration.Toolkit.Common.Services; +namespace Migration.Tool.Common.Services; -public class CoupledDataService(ToolkitConfiguration configuration) +public class CoupledDataService(ToolConfiguration configuration) { public Dictionary? GetSourceCoupledDataRow(string tableName, string primaryKeyColumn, int? coupledDataId) { diff --git a/Migration.Tool.Common/Services/ICommandParser.cs b/Migration.Tool.Common/Services/ICommandParser.cs new file mode 100644 index 00000000..164b1f3b --- /dev/null +++ b/Migration.Tool.Common/Services/ICommandParser.cs @@ -0,0 +1,8 @@ +using Migration.Tool.Common.Abstractions; + +namespace Migration.Tool.Common.Services; + +public interface ICommandParser +{ + List Parse(Queue args, ref bool bypassDependencyCheck, bool firstHaveToBeMigrate = true); +} diff --git a/Migration.Toolkit.Common/Services/IPrintService.cs b/Migration.Tool.Common/Services/IPrintService.cs similarity index 87% rename from Migration.Toolkit.Common/Services/IPrintService.cs rename to Migration.Tool.Common/Services/IPrintService.cs index 5a0fee6f..0a6ed9c2 100644 --- a/Migration.Toolkit.Common/Services/IPrintService.cs +++ b/Migration.Tool.Common/Services/IPrintService.cs @@ -1,4 +1,4 @@ -namespace Migration.Toolkit.Common.Services; +namespace Migration.Tool.Common.Services; public interface IPrintService { diff --git a/Migration.Toolkit.Common/Services/ISpoiledGuidContext.cs b/Migration.Tool.Common/Services/ISpoiledGuidContext.cs similarity index 86% rename from Migration.Toolkit.Common/Services/ISpoiledGuidContext.cs rename to Migration.Tool.Common/Services/ISpoiledGuidContext.cs index 37cef9a2..ae158d38 100644 --- a/Migration.Toolkit.Common/Services/ISpoiledGuidContext.cs +++ b/Migration.Tool.Common/Services/ISpoiledGuidContext.cs @@ -1,4 +1,4 @@ -namespace Migration.Toolkit.Common.Services; +namespace Migration.Tool.Common.Services; public interface ISpoiledGuidContext { diff --git a/Migration.Toolkit.Common/Services/Ipc/IpcService.cs b/Migration.Tool.Common/Services/Ipc/IpcService.cs similarity index 88% rename from Migration.Toolkit.Common/Services/Ipc/IpcService.cs rename to Migration.Tool.Common/Services/Ipc/IpcService.cs index 9a01a943..cd362a3d 100644 --- a/Migration.Toolkit.Common/Services/Ipc/IpcService.cs +++ b/Migration.Tool.Common/Services/Ipc/IpcService.cs @@ -4,16 +4,16 @@ using Newtonsoft.Json; -namespace Migration.Toolkit.Common.Services.Ipc; +namespace Migration.Tool.Common.Services.Ipc; -public class IpcService(ToolkitConfiguration toolkitConfiguration, ILogger logger) +public class IpcService(ToolConfiguration toolConfiguration, ILogger logger) { - private const string IPC_PING_PATH = "/ToolkitApi/Test"; - private const string IPC_DISCOVERED_INFO_PATH = "/ToolkitApi/GetAllDefinitions"; + private const string IPC_PING_PATH = "/ToolApi/Test"; + private const string IPC_DISCOVERED_INFO_PATH = "/ToolApi/GetAllDefinitions"; public async Task IsConfiguredAsync() { - var advancedFeatures = toolkitConfiguration.OptInFeatures?.QuerySourceInstanceApi; + var advancedFeatures = toolConfiguration.OptInFeatures?.QuerySourceInstanceApi; var connections = advancedFeatures?.Connections ?? []; if (!(advancedFeatures?.Enabled ?? false)) @@ -77,7 +77,7 @@ public async Task IsConfiguredAsync() public async Task> GetSourceInstanceDiscoveredInfos() { - var advancedFeatures = toolkitConfiguration.OptInFeatures?.QuerySourceInstanceApi; + var advancedFeatures = toolConfiguration.OptInFeatures?.QuerySourceInstanceApi; var connections = advancedFeatures?.Connections ?? []; var discoveredInfoList = new Dictionary(StringComparer.InvariantCultureIgnoreCase); diff --git a/Migration.Toolkit.Common/Services/Ipc/Model.cs b/Migration.Tool.Common/Services/Ipc/Model.cs similarity index 97% rename from Migration.Toolkit.Common/Services/Ipc/Model.cs rename to Migration.Tool.Common/Services/Ipc/Model.cs index 9a695942..6a8eed06 100644 --- a/Migration.Toolkit.Common/Services/Ipc/Model.cs +++ b/Migration.Tool.Common/Services/Ipc/Model.cs @@ -1,5 +1,5 @@ // ReSharper disable InconsistentNaming -namespace Migration.Toolkit.Common.Services.Ipc; +namespace Migration.Tool.Common.Services.Ipc; public class SourceInstanceDiscoveredInfo { diff --git a/Migration.Tool.Common/ToolConfiguration.cs b/Migration.Tool.Common/ToolConfiguration.cs new file mode 100644 index 00000000..6ffa1922 --- /dev/null +++ b/Migration.Tool.Common/ToolConfiguration.cs @@ -0,0 +1,109 @@ +using Microsoft.Extensions.Configuration; + +namespace Migration.Tool.Common; + +/// +/// Autofix enum +/// +/// do not update value names, they are used in json configuration +public enum AutofixEnum +{ + DiscardData, + AttemptFix, + Error +} + +public class ToolConfiguration +{ + #region Path to CMS dir of source instance + + [ConfigurationKeyName(ConfigurationNames.KxCmsDirPath)] + public string? KxCmsDirPath { get; set; } + + #endregion + + [ConfigurationKeyName(ConfigurationNames.EntityConfigurations)] + public EntityConfigurations EntityConfigurations { get; set; } = []; + + [ConfigurationKeyName(ConfigurationNames.MigrateOnlyMediaFileInfo)] + public bool? MigrateOnlyMediaFileInfo { get; set; } = false; + + [ConfigurationKeyName(ConfigurationNames.UseOmActivityNodeRelationAutofix)] + public AutofixEnum? UseOmActivityNodeRelationAutofix { get; set; } = AutofixEnum.Error; + + [ConfigurationKeyName(ConfigurationNames.UseOmActivitySiteRelationAutofix)] + public AutofixEnum? UseOmActivitySiteRelationAutofix { get; set; } = AutofixEnum.Error; + + [ConfigurationKeyName(ConfigurationNames.MigrationProtocolPath)] + public string? MigrationProtocolPath { get; set; } + + [ConfigurationKeyName(ConfigurationNames.MemberIncludeUserSystemFields)] + public string? MemberIncludeUserSystemFields { get; set; } + + [ConfigurationKeyName(ConfigurationNames.MigrateMediaToMediaLibrary)] + public bool MigrateMediaToMediaLibrary { get; set; } + + [ConfigurationKeyName(ConfigurationNames.UseDeprecatedFolderPageType)] + public bool? UseDeprecatedFolderPageType { get; set; } + + [ConfigurationKeyName(ConfigurationNames.CreateReusableFieldSchemaForClasses)] + public string? CreateReusableFieldSchemaForClasses { get; set; } + + + public IReadOnlySet ClassNamesCreateReusableSchema => classNamesCreateReusableSchema ??= new HashSet( + (CreateReusableFieldSchemaForClasses?.Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries) ?? []).Select(x => x.Trim()), + StringComparer.InvariantCultureIgnoreCase + ); + + #region Opt-in features + + [ConfigurationKeyName(ConfigurationNames.OptInFeatures)] + public OptInFeatures? OptInFeatures { get; set; } + + #endregion + + #region Connection string of source instance + + private string? kxConnectionString; + + [ConfigurationKeyName(ConfigurationNames.KxConnectionString)] + public string KxConnectionString + { + get => kxConnectionString!; + set => kxConnectionString = value; + } + + #endregion + + #region Connection string of target instance + + [ConfigurationKeyName(ConfigurationNames.XbKConnectionString)] + public string XbKConnectionString + { + get => xbKConnectionString!; + set => xbKConnectionString = value; + } + + public void SetXbKConnectionStringIfNotEmpty(string? connectionString) + { + if (!string.IsNullOrWhiteSpace(connectionString)) + { + xbKConnectionString = connectionString; + } + } + + #endregion + + #region Path to root directory of target instance + + private HashSet? classNamesCreateReusableSchema; + private string? xbKConnectionString; + + [ConfigurationKeyName(ConfigurationNames.XbKDirPath)] + public string? XbKDirPath { get; set; } = null; + + #endregion + + [ConfigurationKeyName(ConfigurationNames.UrlProtocol)] + public string? UrlProtocol { get; set; } +} diff --git a/Migration.Toolkit.Common/UrlProtocol.cs b/Migration.Tool.Common/UrlProtocol.cs similarity index 88% rename from Migration.Toolkit.Common/UrlProtocol.cs rename to Migration.Tool.Common/UrlProtocol.cs index 1b616456..661bedf8 100644 --- a/Migration.Toolkit.Common/UrlProtocol.cs +++ b/Migration.Tool.Common/UrlProtocol.cs @@ -1,22 +1,22 @@ -namespace Migration.Toolkit.Common; +namespace Migration.Tool.Common; public class UrlProtocol : IDisposable, IAsyncDisposable { private readonly bool migrationToAssets; private readonly StreamWriter streamWriter; - public UrlProtocol(ToolkitConfiguration toolkitConfiguration) + public UrlProtocol(ToolConfiguration toolConfiguration) { - string? dirName = Path.GetDirectoryName(toolkitConfiguration.UrlProtocol); - string? fileName = Path.GetFileNameWithoutExtension(toolkitConfiguration.UrlProtocol); - string? extension = Path.GetExtension(toolkitConfiguration.UrlProtocol); + string? dirName = Path.GetDirectoryName(toolConfiguration.UrlProtocol); + string? fileName = Path.GetFileNameWithoutExtension(toolConfiguration.UrlProtocol); + string? extension = Path.GetExtension(toolConfiguration.UrlProtocol); if (!Directory.Exists(dirName)) { throw new InvalidOperationException($"Directory {dirName} does not exist"); } streamWriter = new StreamWriter(Path.Combine(dirName, $"{fileName}_{DateTime.UtcNow:yyyyMMdd_hhmm}{extension}")); - migrationToAssets = !toolkitConfiguration.MigrateMediaToMediaLibrary; + migrationToAssets = !toolConfiguration.MigrateMediaToMediaLibrary; } #region Media file urls diff --git a/Migration.Tool.Core.K11/Behaviors/CommandConstraintBehavior.cs b/Migration.Tool.Core.K11/Behaviors/CommandConstraintBehavior.cs new file mode 100644 index 00000000..7efe7f90 --- /dev/null +++ b/Migration.Tool.Core.K11/Behaviors/CommandConstraintBehavior.cs @@ -0,0 +1,109 @@ +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.K11; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Behaviors; + +public class CommandConstraintBehavior( + ILogger> logger, + IMigrationProtocol protocol, + IDbContextFactory k11ContextFactory +) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + try + { + var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + + bool criticalCheckPassed = PerformChecks(request, k11Context); + if (!criticalCheckPassed) + { + return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); + } + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogCritical(ex, "Error occured while checking command constraints"); + return (TResponse)(CommandResult)new CommandCheckFailedResult(false); + } + + return await next(); + } + + private bool PerformChecks(TRequest request, K11Context k11Context) + { + bool criticalCheckPassed = true; + var sourceSites = k11Context.CmsSites + .Include(s => s.Cultures) + .ToList(); + + foreach (var site in sourceSites) + { + criticalCheckPassed &= CheckSite(sourceSites, site.SiteId); + } + + if (request is ICultureReliantCommand cultureReliantCommand) + { + criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites); + } + + return criticalCheckPassed; + } + + private bool CheckSite(List sourceSites, int sourceSiteId) + { + bool criticalCheckPassed = true; + if (sourceSites.All(s => s.SiteId != sourceSiteId)) + { + var supportedSites = sourceSites.Select(x => new { x.SiteName, x.SiteId }).ToArray(); + string supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); + logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, + supportedSitesStr); + protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") + .WithMessage("Check program argument '--siteId'") + .WithData(new { sourceSiteId, AvailableSites = supportedSites })); + criticalCheckPassed = false; + } + + return criticalCheckPassed; + } + + private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites) + { + bool criticalCheckPassed = true; + string cultureCode = cultureReliantCommand.CultureCode; + var siteCultureLookup = sourceSites + .ToDictionary(x => x.SiteId, x => x.Cultures.Select(s => s.CultureCode.ToLowerInvariant())); + + foreach (var site in sourceSites) + { + if (siteCultureLookup.TryGetValue(site.SiteId, out var value)) + { + string[] siteCultures = value.ToArray(); + if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) + { + string supportedCultures = string.Join(", ", siteCultures); + logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, + site.SiteId, supportedCultures); + protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") + .WithMessage("Check program argument '--culture'") + .WithData(new { cultureCode, site.SiteId, SiteCultures = supportedCultures })); + criticalCheckPassed = false; + } + } + } + + return criticalCheckPassed; + } +} diff --git a/Migration.Tool.Core.K11/Behaviors/RequestHandlingBehavior.cs b/Migration.Tool.Core.K11/Behaviors/RequestHandlingBehavior.cs new file mode 100644 index 00000000..f9939215 --- /dev/null +++ b/Migration.Tool.Core.K11/Behaviors/RequestHandlingBehavior.cs @@ -0,0 +1,39 @@ +using System.Diagnostics; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; + +namespace Migration.Tool.Core.K11.Behaviors; + +public class RequestHandlingBehavior(ILogger> logger, IMigrationProtocol protocol) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + var sw = Stopwatch.StartNew(); + logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); + try + { + protocol.CommandRequest(request); + var response = await next(); + protocol.CommandFinished(request, response); + return response; + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogError(ex, "Error occured"); + throw; + } + finally + { + logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); + } + } +} diff --git a/Migration.Tool.Core.K11/Behaviors/XbKApiContextBehavior.cs b/Migration.Tool.Core.K11/Behaviors/XbKApiContextBehavior.cs new file mode 100644 index 00000000..c2ee4cff --- /dev/null +++ b/Migration.Tool.Core.K11/Behaviors/XbKApiContextBehavior.cs @@ -0,0 +1,45 @@ +using CMS.Base; +using CMS.Membership; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KXP.Api; + +namespace Migration.Tool.Core.K11.Behaviors; + +public class XbKApiContextBehavior( + ILogger> logger, + IMigrationProtocol protocol, + KxpApiInitializer initializer) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + initializer.EnsureApiIsInitialized(); + + var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); + if (defaultAdmin == null) + { + protocol.Append(HandbookReferences + .MissingRequiredDependency() + .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") + ); + throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); + } + + using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) + { + // TODO tk: 2022-11-25 revise in future + // MembershipContext.AuthenticatedUser = defaultAdmin; + + logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); + return await next(); + } + } +} diff --git a/Migration.Tool.Core.K11/Contexts/KeyMappingContext.cs b/Migration.Tool.Core.K11/Contexts/KeyMappingContext.cs new file mode 100644 index 00000000..d406a5bf --- /dev/null +++ b/Migration.Tool.Core.K11/Contexts/KeyMappingContext.cs @@ -0,0 +1,34 @@ +using System.Linq.Expressions; + +using Migration.Tool.Core.K11.Services; + +namespace Migration.Tool.Core.K11.Contexts; + +public record MapSourceKeyResult(bool Success, TMapped? Mapped); + +public class KeyMappingContext(PrimaryKeyMappingContext primaryKeyMappingContext, KeyLocatorService keyLocatorService) +{ + public MapSourceKeyResult MapSourceKey(Expression> sourceKeySelector, + Expression> sourceGuidSelector, + object? sourceKey, + Expression> targetKeySelector, + Expression> targetGuidSelector) where TSource : class where TTarget : class + { + if (sourceKey is int id && primaryKeyMappingContext.MapSourceId(sourceKeySelector, id) is { Success: true, MappedId: TTargetKey targetKey }) + { + return new MapSourceKeyResult(true, targetKey); + } + + if (keyLocatorService.TryLocate(sourceKeySelector, targetKeySelector, sourceGuidSelector, targetGuidSelector, sourceKey, out var located)) + { + return new MapSourceKeyResult(true, located); + } + + return new MapSourceKeyResult(false, default); + } + + public MapSourceKeyResult GetGuid(Expression> keySelector, Expression> guidSelector, object? key) where T : class => + keyLocatorService.TryGetSourceGuid(keySelector, guidSelector, key, out var located) + ? new MapSourceKeyResult(true, located) + : new MapSourceKeyResult(false, null); +} diff --git a/Migration.Tool.Core.K11/Contexts/PrimaryKeyMappingContext.cs b/Migration.Tool.Core.K11/Contexts/PrimaryKeyMappingContext.cs new file mode 100644 index 00000000..3e1541a0 --- /dev/null +++ b/Migration.Tool.Core.K11/Contexts/PrimaryKeyMappingContext.cs @@ -0,0 +1,287 @@ +using System.Diagnostics; +using System.Linq.Expressions; +using System.Reflection; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Core.K11.Services; + +namespace Migration.Tool.Core.K11.Contexts; + +public class PrimaryKeyMappingContext( + ILogger logger, + IPrimaryKeyLocatorService primaryKeyLocatorService, + ToolConfiguration toolConfiguration) + : IPrimaryKeyMappingContext +{ + private readonly Dictionary mappingCache = new(StringComparer.OrdinalIgnoreCase); + + public void SetMapping(Type type, string keyName, int sourceId, int targetId) + { + Debug.Assert(sourceId > 0, "sourceId > 0"); + Debug.Assert(targetId > 0, "targetId > 0"); + + var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) + .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); + + Debug.Assert(foundProp != null, "foundProp != null"); + + string fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; + + mappingCache[fullKeyName] = targetId; + logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); + } + + public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) + { + string fullKeyName = CreateKey(keyNameSelector, sourceId); + mappingCache[fullKeyName] = targetId; + logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); + } + + public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) + { + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sourceId); + if (sourceId == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out int targetId)) + { + SetMapping(keyNameSelector, sourceId, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) + { + targetIdResult = -1; + if (sourceId is not int sid) + { + return false; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + targetIdResult = explicitlyMappedId; + return true; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + targetIdResult = resultId; + return true; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + targetIdResult = targetId; + return true; + } + + return false; + } + + public int? MapFromSource(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + return null; + } + + public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return new MapSourceIdResult(true, null); + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return new MapSourceIdResult(true, null); + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return new MapSourceIdResult(true, explicitlyMappedId); + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return new MapSourceIdResult(true, resultId); + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return new MapSourceIdResult(true, targetId); + } + + return new MapSourceIdResult(false, null); + } + + public void PreloadDependencies(Expression> keyNameSelector) + { + foreach ((int sourceId, int targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) + { + SetMapping(keyNameSelector, sourceId, targetId); + } + } + + public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return true; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + return true; + } + + if (GetExplicitMappingOrNull(memberName, sid) is not null) + { + return true; + } + + if (mappingCache.TryGetValue(fullKeyName, out _)) + { + return true; + } + + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) + { + return true; + } + + return false; + } + + private int? GetExplicitMappingOrNull(string memberName, int? sourceId) + { + if (sourceId == null) + { + return null; + } + + var mappings = toolConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; + if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) + { + return memberMappings.TryGetValue($"{sourceId}", out int? mappedId) ? mappedId : null; + } + + return null; + } + + private static string CreateKey(Expression> keyNameSelector, int sourceId) => $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; +} diff --git a/Migration.Tool.Core.K11/Exceptions.cs b/Migration.Tool.Core.K11/Exceptions.cs new file mode 100644 index 00000000..a0212a6d --- /dev/null +++ b/Migration.Tool.Core.K11/Exceptions.cs @@ -0,0 +1,7 @@ +namespace Migration.Tool.Core.K11; + +public class MappingFailureException(string keyName, string reason) : InvalidOperationException($"Key '{keyName}' mapping failed: {reason}") +{ + public string KeyName { get; } = keyName; + public string Reason { get; } = reason; +} diff --git a/Migration.Toolkit.Core.K11/GlobalUsings.cs b/Migration.Tool.Core.K11/GlobalUsings.cs similarity index 100% rename from Migration.Toolkit.Core.K11/GlobalUsings.cs rename to Migration.Tool.Core.K11/GlobalUsings.cs diff --git a/Migration.Tool.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs b/Migration.Tool.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs new file mode 100644 index 00000000..6690e0ef --- /dev/null +++ b/Migration.Tool.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs @@ -0,0 +1,388 @@ +using CMS.Activities; +using CMS.ContactManagement; +using CMS.ContentEngine; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Common.Services; +using Migration.Tool.Common.Services.BulkCopy; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.Core.K11.Helpers; +using Migration.Tool.Core.K11.Services; +using Migration.Tool.K11.Models; +using Migration.Tool.KXP.Api; +using Migration.Tool.KXP.Context; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.K11.Handlers; + +public class MigrateContactManagementCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + BulkDataCopyService bulkDataCopyService, + ToolConfiguration toolConfiguration, + PrimaryKeyMappingContext primaryKeyMappingContext, + KeyMappingContext keyMappingContext, + CountryMigrator countryMigrator, + KxpClassFacade kxpClassFacade, + ISpoiledGuidContext spoiledGuidContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private readonly KxpContext kxpContext = kxpContextFactory.CreateDbContext(); + + public void Dispose() => kxpContext.Dispose(); + + public Task Handle(MigrateContactManagementCommand request, CancellationToken cancellationToken) + { + countryMigrator.MigrateCountriesAndStates(); + + if (MigrateContacts() is { } ccr) + { + return Task.FromResult(ccr); + } + + if (MigrateContactActivities() is { } acr) + { + return Task.FromResult(acr); + } + + return Task.FromResult(new GenericCommandResult()); + } + + #region "Migrate contacts" + + private CommandResult? MigrateContacts() + { + var requiredColumnsForContactMigration = new Dictionary + { + { nameof(Tool.K11.Models.OmContact.ContactId), nameof(KXP.Models.OmContact.ContactId) }, + { nameof(Tool.K11.Models.OmContact.ContactFirstName), nameof(KXP.Models.OmContact.ContactFirstName) }, + { nameof(Tool.K11.Models.OmContact.ContactMiddleName), nameof(KXP.Models.OmContact.ContactMiddleName) }, + { nameof(Tool.K11.Models.OmContact.ContactLastName), nameof(KXP.Models.OmContact.ContactLastName) }, + { nameof(Tool.K11.Models.OmContact.ContactJobTitle), nameof(KXP.Models.OmContact.ContactJobTitle) }, + { nameof(Tool.K11.Models.OmContact.ContactAddress1), nameof(KXP.Models.OmContact.ContactAddress1) }, + { nameof(Tool.K11.Models.OmContact.ContactCity), nameof(KXP.Models.OmContact.ContactCity) }, + { nameof(Tool.K11.Models.OmContact.ContactZip), nameof(KXP.Models.OmContact.ContactZip) }, + { nameof(Tool.K11.Models.OmContact.ContactStateId), nameof(KXP.Models.OmContact.ContactStateId) }, + { nameof(Tool.K11.Models.OmContact.ContactCountryId), nameof(KXP.Models.OmContact.ContactCountryId) }, + { nameof(Tool.K11.Models.OmContact.ContactMobilePhone), nameof(KXP.Models.OmContact.ContactMobilePhone) }, + { nameof(Tool.K11.Models.OmContact.ContactBusinessPhone), nameof(KXP.Models.OmContact.ContactBusinessPhone) }, + { nameof(Tool.K11.Models.OmContact.ContactEmail), nameof(KXP.Models.OmContact.ContactEmail) }, + // No support 2022-07-07 { nameof(OmContact.ContactBirthday), nameof(KXO.Models.OmContact.ContactBirthday) }, + { nameof(Tool.K11.Models.OmContact.ContactGender), nameof(KXP.Models.OmContact.ContactGender) }, + // { nameof(OmContact.ContactStatusId), nameof(KXO.Models.OmContact.ContactStatusId) }, // No support 2022-07-07 but needs to be mapped because of constraint + { nameof(Tool.K11.Models.OmContact.ContactNotes), nameof(KXP.Models.OmContact.ContactNotes) }, + { nameof(Tool.K11.Models.OmContact.ContactOwnerUserId), nameof(KXP.Models.OmContact.ContactOwnerUserId) }, + // No support 2022-07-07 { nameof(OmContact.ContactMonitored), nameof(KXO.Models.OmContact.ContactMonitored) }, + { nameof(Tool.K11.Models.OmContact.ContactGuid), nameof(KXP.Models.OmContact.ContactGuid) }, + { nameof(Tool.K11.Models.OmContact.ContactLastModified), nameof(KXP.Models.OmContact.ContactLastModified) }, + { nameof(Tool.K11.Models.OmContact.ContactCreated), nameof(KXP.Models.OmContact.ContactCreated) }, + // No support 2022-07-07 { nameof(OmContact.ContactBounces), nameof(KXO.Models.OmContact.ContactBounces) }, + { nameof(Tool.K11.Models.OmContact.ContactCampaign), nameof(KXP.Models.OmContact.ContactCampaign) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadId), nameof(KXO.Models.OmContact.ContactSalesForceLeadId) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDisabled), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDisabled) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDateTime) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationSuspensionDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationSuspensionDateTime) }, + { nameof(Tool.K11.Models.OmContact.ContactCompanyName), nameof(KXP.Models.OmContact.ContactCompanyName) } + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationRequired), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationRequired) }, + }; + + foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ContactInfo.TYPEINFO.ObjectClassName)) + { + requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); + } + + if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Contact")) + { + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Contact")); + logger.LogError("Data must not exist in target instance table, remove data before proceeding"); + return new CommandFailureResult(); + } + + if (bulkDataCopyService.CheckForTableColumnsDifferences("OM_Contact", requiredColumnsForContactMigration, out var differences)) + { + protocol.Append(HandbookReferences + .BulkCopyColumnMismatch("OM_Contact") + .NeedsManualAction() + .WithData(differences) + ); + logger.LogError("Table {TableName} columns do not match, fix columns before proceeding", "OM_Contact"); + { + return new CommandFailureResult(); + } + } + + primaryKeyMappingContext.PreloadDependencies(u => u.UserId); + primaryKeyMappingContext.PreloadDependencies(u => u.StateId); + primaryKeyMappingContext.PreloadDependencies(u => u.CountryId); + + var bulkCopyRequest = new BulkCopyRequest("OM_Contact", + s => true, // s => s != "ContactID", + _ => true, + 50000, + requiredColumnsForContactMigration.Keys.ToList(), + ContactValueInterceptor, + current => logger.LogError("Contact skipped due error, contact: {Contact}", PrintHelper.PrintDictionary(current)), + "ContactID" + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + try + { + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to migrate contacts"); + return new CommandFailureResult(); + } + + return null; + } + + private ValueInterceptorResult ContactValueInterceptor(int ordinal, string columnName, object value, Dictionary currentRow) + { + if (columnName.Equals(nameof(KXP.Models.OmContact.ContactCompanyName), StringComparison.InvariantCultureIgnoreCase)) + { + // autofix removed in favor of error report and data consistency + // var truncatedValue = SqlDataTypeHelper.TruncateString(value, 100); + // return new ValueInterceptorResult(truncatedValue, true, false); + + if (value is string { Length: > 100 } s) + { + protocol.Append(HandbookReferences.ValueTruncationSkip("OM_Contact") + .WithData(new + { + value, + maxLength = 100, + s.Length, + columnName, + contact = PrintHelper.PrintDictionary(currentRow) + }) + ); + return ValueInterceptorResult.SkipRow; + } + } + + if (columnName.Equals(nameof(KXP.Models.OmContact.ContactOwnerUserId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceUserId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.UserId, sourceUserId)) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + // try search member + if (keyMappingContext.MapSourceKey( + s => s.UserId, + s => s.UserGuid, + sourceUserId, + t => t.MemberId, + t => t.MemberGuid + ) is { Success: true, Mapped: { } memberId }) + { + return ValueInterceptorResult.ReplaceValue(memberId); + } + + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + if (columnName.Equals(nameof(KXP.Models.OmContact.ContactStateId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceStateId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.StateId, sourceStateId.NullIfZero())) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + if (columnName.Equals(nameof(KXP.Models.OmContact.ContactCountryId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceCountryId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.CountryId, sourceCountryId.NullIfZero())) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + + return ValueInterceptorResult.DoNothing; + } + + #endregion + + #region "Migrate contact activities" + + private CommandResult? MigrateContactActivities() + { + var requiredColumnsForContactMigration = new Dictionary + { + { nameof(Tool.K11.Models.OmActivity.ActivityId), nameof(KXP.Models.OmActivity.ActivityId) }, + { nameof(Tool.K11.Models.OmActivity.ActivityContactId), nameof(KXP.Models.OmActivity.ActivityContactId) }, + { nameof(Tool.K11.Models.OmActivity.ActivityCreated), nameof(KXP.Models.OmActivity.ActivityCreated) }, + { nameof(Tool.K11.Models.OmActivity.ActivityType), nameof(KXP.Models.OmActivity.ActivityType) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityItemId), nameof(KXO.Models.OmActivity.ActivityItemId) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityItemDetailId), nameof(KXO.Models.OmActivity.ActivityItemDetailId) }, + { nameof(Tool.K11.Models.OmActivity.ActivityValue), nameof(KXP.Models.OmActivity.ActivityValue) }, + { nameof(Tool.K11.Models.OmActivity.ActivityUrl), nameof(KXP.Models.OmActivity.ActivityUrl) }, + { nameof(Tool.K11.Models.OmActivity.ActivityTitle), nameof(KXP.Models.OmActivity.ActivityTitle) }, + { nameof(Tool.K11.Models.OmActivity.ActivitySiteId), nameof(KXP.Models.OmActivity.ActivityChannelId) }, + { nameof(Tool.K11.Models.OmActivity.ActivityComment), nameof(KXP.Models.OmActivity.ActivityComment) }, + // { nameof(OmActivity.ActivityCampaign), nameof(KXP.Models.OmActivity.ActivityCampaign) }, // deprecated without replacement in v27 + { nameof(Tool.K11.Models.OmActivity.ActivityUrlreferrer), nameof(KXP.Models.OmActivity.ActivityUrlreferrer) }, + { nameof(Tool.K11.Models.OmActivity.ActivityCulture), nameof(KXP.Models.OmActivity.ActivityLanguageId) }, + { nameof(Tool.K11.Models.OmActivity.ActivityNodeId), nameof(KXP.Models.OmActivity.ActivityWebPageItemGuid) }, + { nameof(Tool.K11.Models.OmActivity.ActivityUtmsource), nameof(KXP.Models.OmActivity.ActivityUtmsource) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityAbvariantName), nameof(KXO.Models.OmActivity.ActivityAbvariantName) }, + // OBSOLETE 26.0.0: { nameof(OmActivity.ActivityUrlhash), nameof(KXP.Models.OmActivity.ActivityUrlhash) }, + { nameof(Tool.K11.Models.OmActivity.ActivityUtmcontent), nameof(KXP.Models.OmActivity.ActivityUtmcontent) } + }; + + foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ActivityInfo.TYPEINFO.ObjectClassName)) + { + requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); + } + + if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Activity")) + { + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Activity")); + logger.LogError("Data must not exist in target instance table, remove data before proceeding"); + return new CommandFailureResult(); + } + + var bulkCopyRequest = new BulkCopyRequestExtended("OM_Activity", + s => true, // s => s != "ActivityID", + reader => true, + 50000, + requiredColumnsForContactMigration, + ActivityValueInterceptor, + current => logger.LogError("Contact activity skipped due error, activity: {Activity}", PrintHelper.PrintDictionary(current)), + "ActivityID" + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + + try + { + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to migrate activities"); + return new CommandFailureResult(); + } + + return null; + } + + private ValueInterceptorResult ActivityValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow) + { + if (columnName.Equals(nameof(Tool.K11.Models.OmActivity.ActivitySiteId), StringComparison.InvariantCultureIgnoreCase) && + value is int sourceActivitySiteId) + { + var result = keyMappingContext.MapSourceKey( + s => s.SiteId, + s => s.SiteGuid, + sourceActivitySiteId.NullIfZero(), + t => t.ChannelId, + t => t.ChannelGuid + ); + switch (result) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id ?? 0); + case { Success: false }: + { + switch (toolConfiguration.UseOmActivitySiteRelationAutofix ?? AutofixEnum.Error) + { + case AutofixEnum.DiscardData: + logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => discard data", sourceActivitySiteId); + return ValueInterceptorResult.SkipRow; + case AutofixEnum.AttemptFix: + logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => ActivityNodeId=0", sourceActivitySiteId); + return ValueInterceptorResult.ReplaceValue(0); + case AutofixEnum.Error: + default: //error + protocol.Append(HandbookReferences + .MissingRequiredDependency(columnName, value) + .WithData(currentRow) + ); + return ValueInterceptorResult.SkipRow; + } + } + + default: + break; + } + } + + if (columnName.Equals(nameof(Tool.K11.Models.OmActivity.ActivityNodeId), StringComparison.InvariantCultureIgnoreCase) && value is int activityNodeId) + { + if (currentRow.TryGetValue(nameof(Tool.K11.Models.OmActivity.ActivitySiteId), out object? mSiteId) && mSiteId is int siteId) + { + if (spoiledGuidContext.GetNodeGuid(siteId, activityNodeId) is { } nodeGuid) + { + return ValueInterceptorResult.ReplaceValue(nodeGuid); + } + } + + switch (toolConfiguration.UseOmActivityNodeRelationAutofix ?? AutofixEnum.Error) + { + case AutofixEnum.DiscardData: + logger.LogTrace("Autofix (ActivitySiteId={NodeId} not exists) => discard data", activityNodeId); + return ValueInterceptorResult.SkipRow; + case AutofixEnum.AttemptFix: + logger.LogTrace("Autofix (ActivityNodeId={NodeId} not exists) => ActivityNodeId=0", activityNodeId); + return ValueInterceptorResult.ReplaceValue(null); + case AutofixEnum.Error: + default: //error + protocol.Append(HandbookReferences + .MissingRequiredDependency(columnName, value) + .WithData(currentRow) + ); + return ValueInterceptorResult.SkipRow; + } + } + + if (columnName.Equals(nameof(KXP.Models.OmActivity.ActivityLanguageId), StringComparison.InvariantCultureIgnoreCase) && value is string cultureCode) + { + return ValueInterceptorResult.ReplaceValue(ContentLanguageInfoProvider.ProviderObject.Get(cultureCode)?.ContentLanguageID); + } + + return ValueInterceptorResult.DoNothing; + } + + #endregion +} diff --git a/Migration.Tool.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs b/Migration.Tool.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs new file mode 100644 index 00000000..a9d7db1b --- /dev/null +++ b/Migration.Tool.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs @@ -0,0 +1,281 @@ +using CMS.DataProtection; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11; +using Migration.Tool.K11.Models; +using Migration.Tool.KXP.Context; + +namespace Migration.Tool.Core.K11.Handlers; + +public class MigrateDataProtectionCommandHandler : IRequestHandler, IDisposable +{ + private static readonly int batchSize = 1000; + private readonly IEntityMapper consentAgreementMapper; + private readonly IEntityMapper consentArchiveMapper; + private readonly IEntityMapper consentMapper; + private readonly IDbContextFactory k11ContextFactory; + private readonly IDbContextFactory kxpContextFactory; + private readonly ILogger logger; + private readonly PrimaryKeyMappingContext primaryKeyMappingContext; + private readonly IProtocol protocol; + + private KxpContext kxpContext; + + public MigrateDataProtectionCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory k11ContextFactory, + IEntityMapper consentMapper, + IEntityMapper consentArchiveMapper, + IEntityMapper consentAgreementMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) + { + this.logger = logger; + this.kxpContextFactory = kxpContextFactory; + this.k11ContextFactory = k11ContextFactory; + this.consentMapper = consentMapper; + this.consentArchiveMapper = consentArchiveMapper; + this.consentAgreementMapper = consentAgreementMapper; + this.primaryKeyMappingContext = primaryKeyMappingContext; + this.protocol = protocol; + kxpContext = this.kxpContextFactory.CreateDbContext(); + } + + public void Dispose() => kxpContext.Dispose(); + + public async Task Handle(MigrateDataProtectionCommand request, CancellationToken cancellationToken) + { + await MigrateConsent(cancellationToken); + await MigrateConsentArchive(cancellationToken); + await MigrateConsentAgreement(cancellationToken, batchSize); + + return new GenericCommandResult(); + } + + private async Task MigrateConsent(CancellationToken cancellationToken) + { + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + + foreach (var k11Consent in k11Context.CmsConsents) + { + protocol.FetchedSource(k11Consent); + logger.LogTrace("Migrating consent {ConsentName} with ConsentGuid {ConsentGuid}", k11Consent.ConsentName, k11Consent.ConsentGuid); + + var kxoConsent = await kxpContext.CmsConsents.FirstOrDefaultAsync(consent => consent.ConsentGuid == k11Consent.ConsentGuid, cancellationToken); + protocol.FetchedTarget(kxoConsent); + + var mapped = consentMapper.Map(k11Consent, kxoConsent); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsent, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsent, nameof(cmsConsent)); + + if (newInstance) + { + kxpContext.CmsConsents.Add(cmsConsent); + } + else + { + kxpContext.CmsConsents.Update(cmsConsent); + } + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + protocol.Success(k11Consent, cmsConsent, mapped); + logger.LogEntitySetAction(newInstance, cmsConsent); + primaryKeyMappingContext.SetMapping(r => r.ConsentId, k11Consent.ConsentId, cmsConsent.ConsentId); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, k11Consent); + protocol.Append(HandbookReferences + .DbConstraintBroken(sqlException, k11Consent) + .WithMessage("Failed to migrate consent, target database constraint broken.") + ); + + await kxpContext.DisposeAsync(); + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + } + } + + return new GenericCommandResult(); + } + + private async Task MigrateConsentArchive(CancellationToken cancellationToken) + { + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + + foreach (var k11ArchiveConsent in k11Context.CmsConsentArchives) + { + protocol.FetchedSource(k11ArchiveConsent); + logger.LogTrace("Migrating consent archive with ConsentArchiveGuid {ConsentGuid}", k11ArchiveConsent.ConsentArchiveGuid); + + var kxoConsentArchive = await kxpContext.CmsConsentArchives.FirstOrDefaultAsync(consentArchive => consentArchive.ConsentArchiveGuid == k11ArchiveConsent.ConsentArchiveGuid, cancellationToken); + protocol.FetchedTarget(kxoConsentArchive); + + var mapped = consentArchiveMapper.Map(k11ArchiveConsent, kxoConsentArchive); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsentArchive, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsentArchive, nameof(cmsConsentArchive)); + + if (newInstance) + { + kxpContext.CmsConsentArchives.Add(cmsConsentArchive); + } + else + { + kxpContext.CmsConsentArchives.Update(cmsConsentArchive); + } + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + protocol.Success(k11ArchiveConsent, cmsConsentArchive, mapped); + logger.LogEntitySetAction(newInstance, cmsConsentArchive); + primaryKeyMappingContext.SetMapping(r => r.ConsentArchiveGuid, + k11ArchiveConsent.ConsentArchiveId, cmsConsentArchive.ConsentArchiveId); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, k11ArchiveConsent); + protocol.Append(HandbookReferences + .DbConstraintBroken(sqlException, k11ArchiveConsent) + .WithMessage("Failed to migrate consent archive, target database constraint broken.") + ); + + await kxpContext.DisposeAsync(); + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + } + } + + return new GenericCommandResult(); + } + + private async Task MigrateConsentAgreement(CancellationToken cancellationToken, int batchSize) + { + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + int index = 0; + int indexFull = 0; + var consentAgreementUpdates = new List(); + var consentAgreementNews = new List(); + int itemsCount = k11Context.CmsConsentAgreements.Count(); + + foreach (var k11ConsentAgreement in k11Context.CmsConsentAgreements) + { + protocol.FetchedSource(k11ConsentAgreement); + logger.LogTrace("Migrating consent agreement with ConsentAgreementGuid {ConsentAgreementGuid}", k11ConsentAgreement.ConsentAgreementGuid); + + var kxoConsentAgreement = await kxpContext.CmsConsentAgreements.FirstOrDefaultAsync(consentAgreement => consentAgreement.ConsentAgreementGuid == k11ConsentAgreement.ConsentAgreementGuid, cancellationToken); + protocol.FetchedTarget(kxoConsentAgreement); + + var mapped = consentAgreementMapper.Map(k11ConsentAgreement, kxoConsentAgreement); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsentAgreement, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsentAgreement, nameof(cmsConsentAgreement)); + + if (newInstance) + { + consentAgreementNews.Add(cmsConsentAgreement); + } + else + { + consentAgreementUpdates.Add(cmsConsentAgreement); + } + } + + index++; + indexFull++; + + if (index == batchSize || indexFull == itemsCount) + { + kxpContext.CmsConsentAgreements.AddRange(consentAgreementNews); + kxpContext.CmsConsentAgreements.UpdateRange(consentAgreementUpdates); + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + foreach (var newK11ConsentAgreement in consentAgreementNews) + { + protocol.Success(k11ConsentAgreement, newK11ConsentAgreement, mapped); + logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was inserted", + newK11ConsentAgreement.ConsentAgreementGuid); + } + + foreach (var updateK11ConsentAgreement in consentAgreementUpdates) + { + protocol.Success(k11ConsentAgreement, updateK11ConsentAgreement, mapped); + logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was updated", + updateK11ConsentAgreement.ConsentAgreementGuid); + } + } + catch (DbUpdateException dbUpdateException) when ( + dbUpdateException.InnerException is SqlException sqlException && + sqlException.Message.Contains("Cannot insert duplicate key row in object") + ) + { + await kxpContext.DisposeAsync(); + + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrints(consentAgreementNews) + ); + logger.LogEntitiesSetError(dbUpdateException, true, consentAgreementNews); + + + protocol.Append(HandbookReferences + .ErrorUpdatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrints(consentAgreementUpdates) + ); + + var cai = ConsentAgreementInfo.New(); + protocol.Append(HandbookReferences + .ErrorUpdatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrint(cai) + ); + + logger.LogEntitiesSetError(dbUpdateException, false, consentAgreementUpdates); + + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + finally + { + index = 0; + consentAgreementUpdates = []; + consentAgreementNews = []; + } + } + } + + return new GenericCommandResult(); + } +} diff --git a/Migration.Tool.Core.K11/Handlers/MigrateMembersCommandHandler.cs b/Migration.Tool.Core.K11/Handlers/MigrateMembersCommandHandler.cs new file mode 100644 index 00000000..2ae74522 --- /dev/null +++ b/Migration.Tool.Core.K11/Handlers/MigrateMembersCommandHandler.cs @@ -0,0 +1,104 @@ +using CMS.Membership; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.Core.K11.Mappers; +using Migration.Tool.K11; +using Migration.Tool.K11.Models; +using Migration.Tool.KXP.Api.Enums; + +namespace Migration.Tool.Core.K11.Handlers; + +public class MigrateMembersCommandHandler( + ILogger logger, + IDbContextFactory k11ContextFactory, + IEntityMapper memberInfoMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private const string USER_PUBLIC = "public"; + + public void Dispose() + { + } + + public async Task Handle(MigrateMembersCommand request, CancellationToken cancellationToken) + { + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + + var k11CmsUsers = k11Context.CmsUsers + .Include(u => u.CmsUserSettingUserSettingsUserNavigation) + .Where(u => u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.None) + ; + + foreach (var k11User in k11CmsUsers) + { + protocol.FetchedSource(k11User); + logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid} to member", k11User.UserName, k11User.UserGuid); + + var xbkMemberInfo = MemberInfoProvider.ProviderObject.Get(k11User.UserGuid); + + protocol.FetchedTarget(xbkMemberInfo); + + + if (xbkMemberInfo?.MemberName == USER_PUBLIC || k11User.UserName == USER_PUBLIC) + { + continue; + } + + var mapped = memberInfoMapper.Map(new MemberInfoMapperSource(k11User, k11User.CmsUserSettingUserSettingsUserNavigation), xbkMemberInfo); + protocol.MappedTarget(mapped); + + SaveUserUsingKenticoApi(mapped, k11User); + } + + return new GenericCommandResult(); + } + + private void SaveUserUsingKenticoApi(IModelMappingResult mapped, CmsUser k11User) + { + if (mapped is { Success: true } result) + { + (var memberInfo, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(memberInfo); + + try + { + MemberInfoProvider.ProviderObject.Set(memberInfo); + + protocol.Success(k11User, memberInfo, mapped); + logger.LogEntitySetAction(newInstance, memberInfo); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, memberInfo); + protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k11User) + .WithData(new { k11User.UserName, k11User.UserGuid, k11User.UserId }) + .WithMessage("Failed to migrate user, target database broken.") + ); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, memberInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(memberInfo) + ); + } + + // left for OM_Activity + primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, memberInfo.MemberID); + } + } +} diff --git a/Migration.Tool.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs b/Migration.Tool.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs new file mode 100644 index 00000000..671ab98a --- /dev/null +++ b/Migration.Tool.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs @@ -0,0 +1,85 @@ +using CMS.DataEngine; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.K11; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Handlers; + +public class MigrateSettingKeysCommandHandler( + ILogger logger, + IEntityMapper mapper, + IDbContextFactory k11ContextFactory, + ToolConfiguration toolConfiguration, + IProtocol protocol) + : IRequestHandler +{ + public async Task Handle(MigrateSettingKeysCommand request, CancellationToken cancellationToken) + { + var entityConfiguration = toolConfiguration.EntityConfigurations.GetEntityConfiguration(); + + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + + logger.LogInformation("CmsSettingsKey synchronization starting"); + var cmsSettingsKeys = k11Context.CmsSettingsKeys + .Where(csk => csk.SiteId == null) + .AsNoTrackingWithIdentityResolution() + ; + + foreach (var k11CmsSettingsKey in cmsSettingsKeys) + { + protocol.FetchedSource(k11CmsSettingsKey); + + var kxoGlobalSettingsKey = GetKxoSettingsKey(k11CmsSettingsKey); + + bool canBeMigrated = !kxoGlobalSettingsKey?.KeyIsHidden ?? false; + var kxoCmsSettingsKey = k11CmsSettingsKey.SiteId is null ? kxoGlobalSettingsKey : GetKxoSettingsKey(k11CmsSettingsKey); + + if (!canBeMigrated) + { + logger.LogInformation("Setting with key '{KeyName}' is currently not supported for migration", k11CmsSettingsKey.KeyName); + protocol.Append( + HandbookReferences + .NotCurrentlySupportedSkip() + .WithId(nameof(k11CmsSettingsKey.KeyId), k11CmsSettingsKey.KeyId) + .WithMessage("Settings key is not supported in target instance") + .WithData(new { k11CmsSettingsKey.KeyName, k11CmsSettingsKey.SiteId, k11CmsSettingsKey.KeyGuid }) + ); + continue; + } + + protocol.FetchedTarget(kxoCmsSettingsKey); + + if (entityConfiguration.ExcludeCodeNames.Contains(k11CmsSettingsKey.KeyName)) + { + protocol.Warning(HandbookReferences.CmsSettingsKeyExclusionListSkip, k11CmsSettingsKey); + logger.LogWarning("KeyName {KeyName} is excluded => skipping", k11CmsSettingsKey.KeyName); + continue; + } + + var mapped = mapper.Map(k11CmsSettingsKey, kxoCmsSettingsKey); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + ArgumentNullException.ThrowIfNull(result.Item, nameof(result.Item)); + + SettingsKeyInfoProvider.ProviderObject.Set(result.Item); + + protocol.Success(k11CmsSettingsKey, kxoCmsSettingsKey, mapped); + logger.LogEntitySetAction(result.NewInstance, result.Item); + } + } + + return new GenericCommandResult(); + } + + private SettingsKeyInfo? GetKxoSettingsKey(CmsSettingsKey k11CmsSettingsKey) => SettingsKeyInfoProvider.ProviderObject.Get(k11CmsSettingsKey.KeyName); +} diff --git a/Migration.Tool.Core.K11/Handlers/MigrateSitesCommandHandler.cs b/Migration.Tool.Core.K11/Handlers/MigrateSitesCommandHandler.cs new file mode 100644 index 00000000..968ebd99 --- /dev/null +++ b/Migration.Tool.Core.K11/Handlers/MigrateSitesCommandHandler.cs @@ -0,0 +1,239 @@ +using CMS.ContentEngine; +using CMS.Websites; + +using Kentico.Xperience.UMT.Model; +using Kentico.Xperience.UMT.Services; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Helpers; +using Migration.Tool.K11; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Handlers; + +// ReSharper disable once UnusedType.Global +public class MigrateSitesCommandHandler( + ILogger logger, + IDbContextFactory k11ContextFactory, + IProtocol protocol, + IImporter importer) + : IRequestHandler +{ + public async Task Handle(MigrateSitesCommand request, CancellationToken cancellationToken) + { + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + var migratedCultureCodes = new Dictionary(StringComparer.CurrentCultureIgnoreCase); + int fallbackDomainPort = 5000; + var migratedDomains = new HashSet(StringComparer.CurrentCultureIgnoreCase); + + foreach (var k11CmsSite in k11Context.CmsSites.Include(s => s.Cultures).Include(cmsSite => cmsSite.CmsSiteDomainAliases)) + { + protocol.FetchedSource(k11CmsSite); + logger.LogTrace("Migrating site {SiteName} with SiteGuid {SiteGuid}", k11CmsSite.SiteName, k11CmsSite.SiteGuid); + + string defaultCultureCode = GetSiteCulture(k11CmsSite); + var migratedSiteCultures = k11CmsSite.Cultures.ToList(); + if (!migratedSiteCultures.Any(x => x.CultureCode.Equals(defaultCultureCode, StringComparison.InvariantCultureIgnoreCase))) + { + await using var ctx = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + if (ctx.CmsCultures.FirstOrDefault(c => c.CultureCode == defaultCultureCode) is { } defaultCulture) + { + migratedSiteCultures.Add(defaultCulture); + } + } + + foreach (var cmsCulture in migratedSiteCultures) + { + var existing = ContentLanguageInfoProvider.ProviderObject.Get() + .WhereEquals(nameof(ContentLanguageInfo.ContentLanguageCultureFormat), cmsCulture.CultureCode) + .FirstOrDefault(); + + if (existing != null && existing.ContentLanguageGUID != cmsCulture.CultureGuid) + { + existing.ContentLanguageGUID = cmsCulture.CultureGuid; + existing.Update(); + } + + if (migratedCultureCodes.ContainsKey(cmsCulture.CultureCode)) + { + continue; + } + + var langResult = await importer.ImportAsync(new ContentLanguageModel + { + ContentLanguageGUID = cmsCulture.CultureGuid, + ContentLanguageDisplayName = cmsCulture.CultureName, + ContentLanguageName = cmsCulture.CultureCode, + ContentLanguageIsDefault = true, + ContentLanguageFallbackContentLanguageGuid = null, + ContentLanguageCultureFormat = cmsCulture.CultureCode + }); + + if (langResult is { Success: true, Imported: ContentLanguageInfo importedLanguage }) + { + migratedCultureCodes.TryAdd(cmsCulture.CultureCode, importedLanguage); + logger.LogTrace("Imported language {Language} from {Culture}", importedLanguage.ContentLanguageName, cmsCulture.CultureCode); + } + } + + // TODO tomas.krch 2024-02-23: treepath migration when upgrade to recent XbyK occurs + string? homePageNodeAliasPath = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, SettingsKeys.CMSDefaultAliasPath); + int? cookieLevel = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, SettingsKeys.CMSDefaultCookieLevel) switch + { + "all" => CookieLevelConstants.ALL, + "visitor" => CookieLevelConstants.VISITOR, + "editor" => CookieLevelConstants.EDITOR, + "system" => CookieLevelConstants.SYSTEM, + "essential" => CookieLevelConstants.ESSENTIAL, + _ => null + }; + bool? storeFormerUrls = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSStoreFormerUrls") is { } storeFormerUrlsStr + ? bool.TryParse(storeFormerUrlsStr, out bool sfu) ? sfu : null + : true; + + var result = UriHelper.GetUniqueDomainCandidate( + k11CmsSite.SiteDomainName, + ref fallbackDomainPort, + candidate => !migratedDomains.Contains(candidate) + ); + + string webSiteChannelDomain; + switch (result) + { + case (true, false, var candidate, null): + { + webSiteChannelDomain = candidate; + break; + } + case (true, true, var candidate, null): + { + webSiteChannelDomain = candidate; + logger.LogWarning("Domain '{Domain}' of site '{SiteName}' is not unique. '{Fallback}' is used instead", k11CmsSite.SiteDomainName, k11CmsSite.SiteName, candidate); + protocol.Warning(HandbookReferences + .InvalidSourceData() + .WithMessage($"Domain '{k11CmsSite.SiteDomainName}' of site '{k11CmsSite.SiteName}' is not unique. '{candidate}' is used instead"), k11CmsSite); + break; + } + case { Success: false, Fallback: { } fallback }: + { + webSiteChannelDomain = fallback; + logger.LogWarning("Unable to use domain '{Domain}' of site '{SiteName}' as channel domain. Fallback '{Fallback}' is used", k11CmsSite.SiteDomainName, k11CmsSite.SiteName, fallback); + protocol.Warning(HandbookReferences + .InvalidSourceData() + .WithMessage($"Non-unique domain name '{k11CmsSite.SiteDomainName}', fallback '{fallback}' used"), k11CmsSite); + break; + } + default: + { + logger.LogError("Unable to use domain '{Domain}' of site '{SiteName}' as channel domain. No fallback available, skipping site", k11CmsSite.SiteDomainName, k11CmsSite.SiteName); + protocol.Warning(HandbookReferences + .InvalidSourceData() + .WithMessage($"Invalid domain name for migration '{k11CmsSite.SiteDomainName}'"), k11CmsSite); + continue; + } + } + + await importer.ImportAsync(new ChannelModel { ChannelDisplayName = k11CmsSite.SiteDisplayName, ChannelName = k11CmsSite.SiteName, ChannelGUID = k11CmsSite.SiteGuid, ChannelType = ChannelType.Website }); + + var webSiteChannelResult = await importer.ImportAsync(new WebsiteChannelModel + { + WebsiteChannelGUID = k11CmsSite.SiteGuid, + WebsiteChannelChannelGuid = k11CmsSite.SiteGuid, + WebsiteChannelDomain = webSiteChannelDomain, + WebsiteChannelHomePage = homePageNodeAliasPath ?? "/", + WebsiteChannelPrimaryContentLanguageGuid = migratedCultureCodes[defaultCultureCode].ContentLanguageGUID, + WebsiteChannelDefaultCookieLevel = cookieLevel, + WebsiteChannelStoreFormerUrls = storeFormerUrls + }); + + if (!webSiteChannelResult.Success) + { + if (webSiteChannelResult.ModelValidationResults != null) + { + foreach (var mvr in webSiteChannelResult.ModelValidationResults) + { + logger.LogError("Invalid channel properties {Members}: {ErrorMessage}", string.Join(", ", mvr.MemberNames), mvr.ErrorMessage); + } + } + else + { + logger.LogError(webSiteChannelResult.Exception, "Failed to migrate site"); + } + + return new CommandFailureResult(); + } + + if (webSiteChannelResult.Imported is WebsiteChannelInfo webSiteChannel) + { + migratedDomains.Add(webSiteChannelDomain); + + string? cmsReCaptchaPublicKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSReCaptchaPublicKey"); + string? cmsReCaptchaPrivateKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSReCaptchaPrivateKey"); + + WebsiteCaptchaSettingsInfo? reCaptchaSettings = null; + string? cmsReCaptchaV3PrivateKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSReCaptchaV3PrivateKey"); + string? cmsRecaptchaV3PublicKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSRecaptchaV3PublicKey"); + double? cmsRecaptchaV3Threshold = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSRecaptchaV3Threshold"); + + if (!string.IsNullOrWhiteSpace(cmsReCaptchaV3PrivateKey) || !string.IsNullOrWhiteSpace(cmsRecaptchaV3PublicKey)) + { + reCaptchaSettings = new WebsiteCaptchaSettingsInfo + { + WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, + WebsiteCaptchaSettingsReCaptchaSiteKey = cmsRecaptchaV3PublicKey, + WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaV3PrivateKey, + WebsiteCaptchaSettingsReCaptchaThreshold = cmsRecaptchaV3Threshold ?? 0.5d, + WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV3 + }; + } + + if (!string.IsNullOrWhiteSpace(cmsReCaptchaPublicKey) || !string.IsNullOrWhiteSpace(cmsReCaptchaPrivateKey)) + { + if (reCaptchaSettings is not null) + { + logger.LogError(""" + Conflicting settings found, ReCaptchaV2 and ReCaptchaV3 is set simultaneously. + Remove setting keys 'CMSReCaptchaPublicKey', 'CMSReCaptchaPrivateKey' + or remove setting keys 'CMSReCaptchaV3PrivateKey', 'CMSRecaptchaV3PublicKey', 'CMSRecaptchaV3Threshold'. + """); + throw new InvalidOperationException("Invalid ReCaptcha settings"); + } + + reCaptchaSettings = new WebsiteCaptchaSettingsInfo + { + WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, + WebsiteCaptchaSettingsReCaptchaSiteKey = cmsReCaptchaPublicKey, + WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaPrivateKey, + WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV2 + }; + } + + if (reCaptchaSettings != null) + { + WebsiteCaptchaSettingsInfo.Provider.Set(reCaptchaSettings); + } + } + } + + return new GenericCommandResult(); + } + + private string GetSiteCulture(CmsSite site) + { + // simplified logic from CMS.DocumentEngine.DefaultPreferredCultureEvaluator.Evaluate() + // domain alias skipped, HttpContext logic skipped + string? siteCulture = site.SiteDefaultVisitorCulture.NullIf(string.Empty) + ?? KenticoHelper.GetSettingsKey(k11ContextFactory, site.SiteId, SettingsKeys.CMSDefaultCultureCode); + + return siteCulture + ?? throw new InvalidOperationException("Unknown site culture"); + } +} diff --git a/Migration.Tool.Core.K11/Handlers/MigrateUsersCommandHandler.cs b/Migration.Tool.Core.K11/Handlers/MigrateUsersCommandHandler.cs new file mode 100644 index 00000000..939385e8 --- /dev/null +++ b/Migration.Tool.Core.K11/Handlers/MigrateUsersCommandHandler.cs @@ -0,0 +1,272 @@ +using CMS.Membership; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11; +using Migration.Tool.K11.Models; +using Migration.Tool.KXP.Api.Enums; + +namespace Migration.Tool.Core.K11.Handlers; + +public class MigrateUsersCommandHandler( + ILogger logger, + IDbContextFactory k11ContextFactory, + IEntityMapper userInfoMapper, + IEntityMapper roleMapper, + IEntityMapper userRoleMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private const string USER_PUBLIC = "public"; + + public void Dispose() + { + } + + public async Task Handle(MigrateUsersCommand request, CancellationToken cancellationToken) + { + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + + var k11CmsUsers = k11Context.CmsUsers + .Where(u => u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) + ; + + foreach (var k11User in k11CmsUsers) + { + protocol.FetchedSource(k11User); + logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid}", k11User.UserName, k11User.UserGuid); + + var xbkUserInfo = UserInfoProvider.ProviderObject.Get(k11User.UserGuid); + + protocol.FetchedTarget(xbkUserInfo); + + if (k11User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin && xbkUserInfo != null) + { + protocol.Append(HandbookReferences.CmsUserAdminUserSkip.WithIdentityPrint(xbkUserInfo)); + logger.LogInformation("User with guid {UserGuid} is administrator, you need to update administrators manually => skipping", k11User.UserGuid); + primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, xbkUserInfo.UserID); + continue; + } + + if (xbkUserInfo?.UserName == USER_PUBLIC || k11User.UserName == USER_PUBLIC) + { + protocol.Append(HandbookReferences.CmsUserPublicUserSkip.WithIdentityPrint(xbkUserInfo)); + logger.LogInformation("User with guid {UserGuid} is public user, special case that can't be migrated => skipping", xbkUserInfo?.UserGUID ?? k11User.UserGuid); + if (xbkUserInfo != null) + { + primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, xbkUserInfo.UserID); + } + + continue; + } + + var mapped = userInfoMapper.Map(k11User, xbkUserInfo); + protocol.MappedTarget(mapped); + + SaveUserUsingKenticoApi(mapped, k11User); + } + + await MigrateUserCmsRoles(k11Context, cancellationToken); + + return new GenericCommandResult(); + } + + private bool SaveUserUsingKenticoApi(IModelMappingResult mapped, CmsUser k11User) + { + if (mapped is { Success: true } result) + { + (var userInfo, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(userInfo); + + try + { + UserInfoProvider.ProviderObject.Set(userInfo); + + protocol.Success(k11User, userInfo, mapped); + logger.LogEntitySetAction(newInstance, userInfo); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, userInfo); + protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k11User) + .WithData(new { k11User.UserName, k11User.UserGuid, k11User.UserId }) + .WithMessage("Failed to migrate user, target database broken.") + ); + return false; + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, userInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(userInfo) + ); + return false; + } + + primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, userInfo.UserID); + return true; + } + + return false; + } + + private async Task MigrateUserCmsRoles(K11Context k11Context, CancellationToken cancellationToken) + { + var groupedRoles = k11Context.CmsRoles + .Where(r => + r.CmsUserRoles.Any(ur => ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) + ) + .GroupBy(x => x.RoleName) + .AsNoTracking(); + + var skippedRoles = new HashSet(); + foreach (var groupedRole in groupedRoles) + { + if (groupedRole.Count() <= 1) + { + continue; + } + + logger.LogError(""" + Roles with RoleGuid ({RoleGuids}) have same RoleName '{RoleName}', due to removal of sites and role globalization it is required to set unique RoleName + """, string.Join(",", groupedRole.Select(l => l.RoleGuid)), groupedRole.Key); + + foreach (var r in groupedRole) + { + skippedRoles.Add(r.RoleGuid); + protocol.Append(HandbookReferences.NotCurrentlySupportedSkip() + .WithMessage($"Role '{r.RoleName}' with RoleGUID '{r.RoleGuid}' doesn't satisfy unique RoleName condition for migration") + .WithIdentityPrint(r) + .WithData(new { r.RoleGuid, r.RoleName, r.SiteId }) + ); + } + } + + var k11CmsRoles = k11Context.CmsRoles + .Where(r => + r.CmsUserRoles.Any(ur => ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) + ) + .AsNoTracking() + .AsAsyncEnumerable(); + + await foreach (var k11CmsRole in k11CmsRoles.WithCancellation(cancellationToken)) + { + if (skippedRoles.Contains(k11CmsRole.RoleGuid)) + { + continue; + } + + protocol.FetchedSource(k11CmsRole); + + var xbkRoleInfo = RoleInfoProvider.ProviderObject.Get(k11CmsRole.RoleGuid); + protocol.FetchedTarget(xbkRoleInfo); + var mapped = roleMapper.Map(k11CmsRole, xbkRoleInfo); + protocol.MappedTarget(mapped); + + if (mapped is not (var roleInfo, var newInstance) { Success: true }) + { + continue; + } + + ArgumentNullException.ThrowIfNull(roleInfo, nameof(roleInfo)); + try + { + RoleInfoProvider.ProviderObject.Set(roleInfo); + + protocol.Success(k11CmsRole, roleInfo, mapped); + logger.LogEntitySetAction(newInstance, roleInfo); + + primaryKeyMappingContext.SetMapping( + r => r.RoleId, + k11CmsRole.RoleId, + roleInfo.RoleID + ); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, roleInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(roleInfo) + ); + continue; + } + + await MigrateUserRole(k11CmsRole.RoleId); + } + } + + private async Task MigrateUserRole(int k11RoleId) + { + var k11Context = await k11ContextFactory.CreateDbContextAsync(); + var k11UserRoles = k11Context.CmsUserRoles + .Where(ur => + ur.RoleId == k11RoleId && ( + ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin + ) + ) + .AsNoTracking() + .AsAsyncEnumerable(); + + await foreach (var k11UserRole in k11UserRoles) + { + protocol.FetchedSource(k11UserRole); + if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.RoleId, k11RoleId, out int xbkRoleId)) + { + var handbookRef = HandbookReferences + .MissingRequiredDependency(nameof(UserRoleInfo.RoleID), k11UserRole.RoleId) + .NeedsManualAction(); + + protocol.Append(handbookRef); + logger.LogWarning("Unable to locate role in target instance with source RoleID '{RoleID}'", k11UserRole.RoleId); + continue; + } + + if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.UserId, k11UserRole.UserId, out int xbkUserId)) + { + continue; + } + + var xbkUserRole = UserRoleInfoProvider.ProviderObject.Get(xbkUserId, xbkRoleId); + protocol.FetchedTarget(xbkUserRole); + + var mapped = userRoleMapper.Map(k11UserRole, xbkUserRole); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true }) + { + (var userRoleInfo, bool newInstance) = mapped; + ArgumentNullException.ThrowIfNull(userRoleInfo); + + try + { + UserRoleInfoProvider.ProviderObject.Set(userRoleInfo); + + protocol.Success(k11UserRole, userRoleInfo, mapped); + logger.LogEntitySetAction(newInstance, userRoleInfo); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, userRoleInfo); + protocol.Append(HandbookReferences.ErrorSavingTargetInstance(ex) + .WithData(new { k11UserRole.UserRoleId, k11UserRole.UserId, k11UserRole.RoleId }) + .WithMessage("Failed to migrate user role") + ); + } + } + } + } +} diff --git a/Migration.Tool.Core.K11/Helpers/KenticoHelper.cs b/Migration.Tool.Core.K11/Helpers/KenticoHelper.cs new file mode 100644 index 00000000..f4be3f5d --- /dev/null +++ b/Migration.Tool.Core.K11/Helpers/KenticoHelper.cs @@ -0,0 +1,46 @@ +using System.Globalization; + +using CMS.Helpers; + +using Microsoft.EntityFrameworkCore; + +using Migration.Tool.K11; + +namespace Migration.Tool.Core.K11.Helpers; + +public static class KenticoHelper +{ + public static void CopyCustomData(ContainerCustomData target, string? sourceXml) + { + var customNodeData = new ContainerCustomData(); + customNodeData.LoadData(sourceXml); + foreach (string? columnName in customNodeData.ColumnNames) + { + target.SetValue(columnName, customNodeData.GetValue(columnName)); + } + } + + public static string? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) + { + using var k11Context = ctxf.CreateDbContext(); + var keys = k11Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); + + return (keys.FirstOrDefault(x => x.SiteId == siteId) + ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; + } + + public static T? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) where T : struct, IParsable + { + using var k11Context = ctxf.CreateDbContext(); + var keys = k11Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); + string? value = (keys.FirstOrDefault(x => x.SiteId == siteId) + ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; + + + return T.TryParse(value, CultureInfo.InvariantCulture, out var result) + ? result + : null; + } + + public static bool? TryGetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName, out T? result) where T : IParsable => T.TryParse(GetSettingsKey(ctxf, siteId, keyName), CultureInfo.InvariantCulture, out result); +} diff --git a/Migration.Tool.Core.K11/Helpers/PrintHelper.cs b/Migration.Tool.Core.K11/Helpers/PrintHelper.cs new file mode 100644 index 00000000..86bac60f --- /dev/null +++ b/Migration.Tool.Core.K11/Helpers/PrintHelper.cs @@ -0,0 +1,7 @@ +namespace Migration.Tool.Core.K11.Helpers; + +public static class PrintHelper +{ + public static string PrintDictionary(Dictionary dictionary) => + string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); +} diff --git a/Migration.Tool.Core.K11/Helpers/Printer.cs b/Migration.Tool.Core.K11/Helpers/Printer.cs new file mode 100644 index 00000000..f115401f --- /dev/null +++ b/Migration.Tool.Core.K11/Helpers/Printer.cs @@ -0,0 +1,102 @@ +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.Globalization; +using CMS.MediaLibrary; +using CMS.Membership; +using CMS.Modules; + +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.Services; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Helpers; + +public class Printer +{ + public static string PrintKxpModelInfo(T model) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + return model switch + { + KXP.Models.MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", + KXP.Models.MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", + KXP.Models.CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", + KXP.Models.CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", + KXP.Models.CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", + KXP.Models.CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", + KXP.Models.CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", + KXP.Models.CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", + KXP.Models.OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", + + null => $"{currentTypeName}: ", + _ => $"TODO: {typeof(T).FullName}" + }; + } + + public static string GetEntityIdentityPrint(T model, bool printType = true) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + string Fallback(object obj) => printType + ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" + : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}"; + + string FormatModel(string inner) => printType + ? $"{currentTypeName}({inner})" + : $"{inner}"; + + return model switch + { + MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), + MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), + DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), + + CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), + StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), + + ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), + AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), + UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), + RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), + MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), + + KXP.Models.CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), + KXP.Models.CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), + KXP.Models.CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + KXP.Models.CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + KXP.Models.CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + KXP.Models.CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), + + CmsRole item => FormatModel($"ID={item.RoleId}, GUID={item.RoleGuid}, Name={item.RoleName}, SiteId={item.SiteId}"), + CmsAttachment item => FormatModel($"ID={item.AttachmentId}, GUID={item.AttachmentGuid}, Name={item.AttachmentName}"), + CmsClass item => FormatModel($"ID={item.ClassId}, GUID={item.ClassGuid}, Name={item.ClassName}"), + CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + CmsCountry item => FormatModel($"ID={item.CountryId}, GUID={item.CountryGuid}, Name={item.CountryName}"), + CmsState item => FormatModel($"ID={item.StateId}, GUID={item.StateGuid}, Name={item.StateName}"), + CmsTree item => FormatModel($"NodeID={item.NodeId}, NodeGUID={item.NodeGuid}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), + CmsDocument item => FormatModel($"NodeID={item.DocumentNodeId}, DocumentID={item.DocumentId}, DocumentGUID={item.DocumentGuid}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), + CmsResource item => FormatModel($"ID={item.ResourceId}, GUID={item.ResourceGuid}, Name={item.ResourceName}"), + + null => $" ref of {currentTypeName}", + _ => Fallback(model) + }; + } + + public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); + + public static string PrintEnumValues(string separator) where TEnum : struct, Enum => string.Join(separator, Enum.GetValues()); +} + +public class PrintService : IPrintService +{ + public string PrintKxpModelInfo(T model) => Printer.PrintKxpModelInfo(model); + + public string GetEntityIdentityPrint(T model, bool printType = true) => Printer.GetEntityIdentityPrint(model, printType); + + public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => Printer.GetEntityIdentityPrints(models, separator); + + public string PrintEnumValues(string separator) where TEnum : struct, Enum => Printer.PrintEnumValues(separator); +} diff --git a/Migration.Toolkit.Core.K11/K11CoreDiExtensions.cs b/Migration.Tool.Core.K11/K11CoreDiExtensions.cs similarity index 83% rename from Migration.Toolkit.Core.K11/K11CoreDiExtensions.cs rename to Migration.Tool.Core.K11/K11CoreDiExtensions.cs index 928e1414..3bb74816 100644 --- a/Migration.Toolkit.Core.K11/K11CoreDiExtensions.cs +++ b/Migration.Tool.Core.K11/K11CoreDiExtensions.cs @@ -8,23 +8,23 @@ using MediatR; using Microsoft.Extensions.DependencyInjection; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Core.K11.Behaviors; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.Core.K11.Helpers; -using Migration.Toolkit.Core.K11.Mappers; -using Migration.Toolkit.Core.K11.Services; -using Migration.Toolkit.K11.Models; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Common.Services; +using Migration.Tool.Common.Services.BulkCopy; +using Migration.Tool.Core.K11.Behaviors; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.Core.K11.Helpers; +using Migration.Tool.Core.K11.Mappers; +using Migration.Tool.Core.K11.Services; +using Migration.Tool.K11.Models; -namespace Migration.Toolkit.Core.K11; +namespace Migration.Tool.Core.K11; public static class K11CoreDiExtensions { - public static IServiceCollection UseK11ToolkitCore(this IServiceCollection services) + public static IServiceCollection UseK11ToolCore(this IServiceCollection services) { var printService = new PrintService(); services.AddSingleton(printService); diff --git a/Migration.Tool.Core.K11/Mappers/AlternativeFormMapper.cs b/Migration.Tool.Core.K11/Mappers/AlternativeFormMapper.cs new file mode 100644 index 00000000..c769163b --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/AlternativeFormMapper.cs @@ -0,0 +1,91 @@ +using CMS.DataEngine; +using CMS.FormEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; +using Migration.Tool.KXP.Api.Services.CmsClass; + +namespace Migration.Tool.Core.K11.Mappers; + +public record AlternativeFormMapperSource(CmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); + +public class AlternativeFormMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, FieldMigrationService fieldMigrationService) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) + => AlternativeFormInfo.New(); + + protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (source, xbkFormClass) = sourceObj; + + target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormClassId, out int? classId) + ? classId ?? 0 + : 0; + target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormCoupledClassId, out int? coupledClassId) + ? coupledClassId ?? 0 + : 0; + + bool coupledClassIsDeprecated = + source.FormCoupledClass?.ClassName is { } coupledClassName && + K12SystemClass.NoLongerSupported.Contains(coupledClassName); + + bool classIsSysInternal = K12SystemClass.All.Contains(source.FormClass.ClassName); + + string mergedDefinition = source.FormClass.ClassFormDefinition; + if (source.FormCoupledClass != null) + { + logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", source.FormCoupledClass.ClassName, source.FormClass.ClassName); + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormCoupledClass.ClassFormDefinition); + } + + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); + + var patcher = new FormDefinitionPatcher( + logger, + mergedDefinition, + fieldMigrationService, + source.FormClass.ClassIsForm.GetValueOrDefault(false), + source.FormClass.ClassIsDocumentType, + false, + !classIsSysInternal, + true + ); + + var fieldNames = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); + + patcher.PatchFields(); + + var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); + + if (coupledClassIsDeprecated && source.FormCoupledClass != null) + { + logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", source.FormCoupledClass.ClassName); + patcher.RemoveFields(source.FormCoupledClass.ClassFormDefinition); + + var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); + } + + string result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); + + string formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); + + target.FormDefinition = formDefinitionDifference; + + target.FormDisplayName = source.FormDisplayName; + target.FormGUID = source.FormGuid; + target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); + target.FormLastModified = source.FormLastModified; + target.FormName = source.FormName; + + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/CmsAttachmentMapper.cs b/Migration.Tool.Core.K11/Mappers/CmsAttachmentMapper.cs new file mode 100644 index 00000000..cc13e4af --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/CmsAttachmentMapper.cs @@ -0,0 +1,59 @@ +using CMS.Base; +using CMS.MediaLibrary; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.Core.K11.Helpers; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public record CmsAttachmentMapperSource( + CmsAttachment Attachment, + int TargetLibraryId, + IUploadedFile File, + string LibrarySubFolder, + CmsDocument? AttachmentDocument); + +public class CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; + + protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => + // library name is generated with site name in it + new(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); + + protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + (var cmsAttachment, int targetLibraryId, _, _, var attachmentDocument) = args; + + target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); + target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; + target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; + target.FileExtension = cmsAttachment.AttachmentExtension; + target.FileMimeType = cmsAttachment.AttachmentMimeType; + target.FileSize = cmsAttachment.AttachmentSize; + target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; + target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; + target.FileGUID = cmsAttachment.AttachmentGuid; + target.FileLibraryID = targetLibraryId; + + // target.FileCreatedByUserID = cmsAttachment.?; + // target.FileModifiedByUserID = cmsAttachment.?; + // target.FileCreatedWhen = cmsAttachment.?; + + target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; + + KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); + + if (attachmentDocument != null) + { + target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentDocument.DocumentNode.NodeAliasPath); + } + + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/CmsConsentAgreementMapper.cs b/Migration.Tool.Core.K11/Mappers/CmsConsentAgreementMapper.cs new file mode 100644 index 00000000..7757d929 --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/CmsConsentAgreementMapper.cs @@ -0,0 +1,34 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public class CmsConsentAgreementMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override KXP.Models.CmsConsentAgreement? CreateNewInstance(CmsConsentAgreement source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override KXP.Models.CmsConsentAgreement MapInternal(CmsConsentAgreement source, KXP.Models.CmsConsentAgreement target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentAgreementGuid = source.ConsentAgreementGuid; + target.ConsentAgreementRevoked = source.ConsentAgreementRevoked; + target.ConsentAgreementConsentHash = source.ConsentAgreementConsentHash; + target.ConsentAgreementTime = source.ConsentAgreementTime; + + if (mappingHelper.TranslateRequiredId(c => c.ContactId, source.ConsentAgreementContactId, out int contactId)) + { + target.ConsentAgreementContactId = contactId; + } + + if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentAgreementConsentId, out int consentId)) + { + target.ConsentAgreementConsentId = consentId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/CmsConsentArchiveMapper.cs b/Migration.Tool.Core.K11/Mappers/CmsConsentArchiveMapper.cs new file mode 100644 index 00000000..42f36c93 --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/CmsConsentArchiveMapper.cs @@ -0,0 +1,33 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public class CmsConsentArchiveMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override KXP.Models.CmsConsentArchive? CreateNewInstance(CmsConsentArchive source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override KXP.Models.CmsConsentArchive MapInternal(CmsConsentArchive source, KXP.Models.CmsConsentArchive target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentArchiveContent = source.ConsentArchiveContent; + target.ConsentArchiveGuid = source.ConsentArchiveGuid; + target.ConsentArchiveLastModified = source.ConsentArchiveLastModified; + target.ConsentArchiveHash = source.ConsentArchiveHash; + + if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentArchiveConsentId, out int consentId)) + { + target.ConsentArchiveConsentId = consentId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/CmsConsentMapper.cs b/Migration.Tool.Core.K11/Mappers/CmsConsentMapper.cs new file mode 100644 index 00000000..d8f6b6e1 --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/CmsConsentMapper.cs @@ -0,0 +1,79 @@ +using System.Text; +using System.Xml.Linq; +using System.Xml.XPath; + +using CMS.ContentEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public class CmsConsentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + protected override KXP.Models.CmsConsent? CreateNewInstance(CmsConsent source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override KXP.Models.CmsConsent MapInternal(CmsConsent source, KXP.Models.CmsConsent target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentDisplayName = source.ConsentDisplayName; + var defaultContentLanguageInfo = ContentLanguageInfo.Provider.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageIsDefault), true).FirstOrDefault() ?? throw new InvalidCastException("Missing default content language"); + target.ConsentName = source.ConsentName; + target.ConsentContent = ConsentContentPatcher.PatchConsentContent(source.ConsentContent, defaultContentLanguageInfo); + target.ConsentGuid = source.ConsentGuid; + target.ConsentLastModified = source.ConsentLastModified; + target.ConsentHash = source.ConsentHash; + + return target; + } +} + +static file class ConsentContentPatcher +{ + public static string PatchConsentContent(string content, ContentLanguageInfo defaultContentLanguage) + { + if (string.IsNullOrWhiteSpace(content)) + { + return content; + } + + XDocument doc; + try + { + doc = XDocument.Parse(content); + } + catch (Exception) + { + // cannot patch xml that cannot be parsed + return content; + } + + foreach (var cultureCodeElement in doc.XPathSelectElements("//CultureCode")) + { + cultureCodeElement.Name = "LanguageName"; + if (!string.Equals(defaultContentLanguage.ContentLanguageName, cultureCodeElement.Value, StringComparison.InvariantCultureIgnoreCase)) + { + // mLogger.LogWarning($"Consent '{consentInfo.ConsentName}' has unknown content language set '{cultureCodeElement.Value}'"); + } + + // if elements are not swapped, FULLTEXT is not shown in UI + var p = cultureCodeElement.NextNode; + if (p is XElement e && e.Name == "FullText") + { + p.ReplaceWith(cultureCodeElement); + cultureCodeElement.ReplaceWith(p); + } + } + + var builder = new StringBuilder(); + using (var writer = new CMS.IO.StringWriter(builder)) + { + doc.Save(writer); + } + + return builder.ToString(); + } +} diff --git a/Migration.Tool.Core.K11/Mappers/CmsFormMapper.cs b/Migration.Tool.Core.K11/Mappers/CmsFormMapper.cs new file mode 100644 index 00000000..ea8865c5 --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/CmsFormMapper.cs @@ -0,0 +1,83 @@ +using CMS.FormEngine; +using CMS.OnlineForms; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public class CmsFormMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override BizFormInfo? CreateNewInstance(CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) + { + var newBizFormInfo = BizFormInfo.New(); + newBizFormInfo.FormGUID = source.FormGuid; + return newBizFormInfo; + } + + protected override BizFormInfo MapInternal(CmsForm source, BizFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.FormDisplayName = source.FormDisplayName; + target.FormName = source.FormName; + target.FormItems = source.FormItems; + target.FormReportFields = source.FormReportFields; + target.FormSubmitButtonText = source.FormSubmitButtonText; + target.FormAccess = source.FormAccess.AsEnum(); + target.FormSubmitButtonImage = source.FormSubmitButtonImage; + target.FormLastModified = source.FormLastModified; + target.FormLogActivity = source.FormLogActivity.UseKenticoDefault(); + // target.FormBuilderLayout = source.FormBuilderLayout; + + if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out int formClassId)) + { + target.FormClassID = formClassId; + } + + return target; + } +} + +public class CmsFormMapperEf(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + protected override KXP.Models.CmsForm? CreateNewInstance(CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override KXP.Models.CmsForm MapInternal(CmsForm source, KXP.Models.CmsForm target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.FormDisplayName = source.FormDisplayName; + target.FormName = source.FormName; + // target.FormSendToEmail = source.FormSendToEmail; + // target.FormSendFromEmail = source.FormSendFromEmail; + // target.FormEmailSubject = source.FormEmailSubject; + // target.FormEmailTemplate = source.FormEmailTemplate; + // target.FormEmailAttachUploadedDocs = source.FormEmailAttachUploadedDocs; + target.FormItems = source.FormItems; + target.FormReportFields = source.FormReportFields; + target.FormSubmitButtonText = source.FormSubmitButtonText; + // target.FormConfirmationEmailField = source.FormConfirmationEmailField; + // target.FormConfirmationTemplate = source.FormConfirmationTemplate; + // target.FormConfirmationSendFromEmail = source.FormConfirmationSendFromEmail; + // target.FormConfirmationEmailSubject = source.FormConfirmationEmailSubject; + target.FormAccess = source.FormAccess; + target.FormSubmitButtonImage = source.FormSubmitButtonImage; + target.FormGuid = source.FormGuid; + target.FormLastModified = source.FormLastModified; + target.FormLogActivity = source.FormLogActivity ?? false; + // target.FormBuilderLayout = source.FormBuilderLayout; + + if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out int classId)) + { + target.FormClassId = classId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/CmsSettingsCategoryMapper.cs b/Migration.Tool.Core.K11/Mappers/CmsSettingsCategoryMapper.cs new file mode 100644 index 00000000..8801a70a --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/CmsSettingsCategoryMapper.cs @@ -0,0 +1,97 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public class CmsSettingsCategoryMapper( + ILogger logger, + PrimaryKeyMappingContext pkContext, + IProtocol protocol, + IEntityMapper cmsResourceMapper) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override KXP.Models.CmsSettingsCategory? CreateNewInstance(CmsSettingsCategory source, MappingHelper mappingHelper, + AddFailure addFailure) => new(); + + + protected override KXP.Models.CmsSettingsCategory MapInternal(CmsSettingsCategory source, KXP.Models.CmsSettingsCategory target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + // no category guid to match on... + if (newInstance) + { + target.CategoryOrder = source.CategoryOrder; + target.CategoryName = source.CategoryName; + target.CategoryDisplayName = source.CategoryDisplayName; + target.CategoryIdpath = source.CategoryIdpath; + target.CategoryLevel = source.CategoryLevel; + target.CategoryChildCount = source.CategoryChildCount; + target.CategoryIconPath = source.CategoryIconPath; + target.CategoryIsGroup = source.CategoryIsGroup; + target.CategoryIsCustom = source.CategoryIsCustom; + } + + if (source.CategoryResource != null) + { + if (target.CategoryResource != null && source.CategoryResourceId != null && target.CategoryResourceId != null) + { + // skip if target is present + logger.LogTrace("Skipping category resource '{ResourceGuid}', already present in target instance", target.CategoryResource.ResourceGuid); + pkContext.SetMapping(r => r.ResourceId, source.CategoryResourceId.Value, target.CategoryResourceId.Value); + } + else + { + switch (cmsResourceMapper.Map(source.CategoryResource, target.CategoryResource)) + { + case { Success: true } result: + { + target.CategoryResource = result.Item; + break; + } + case { Success: false } result: + { + addFailure(new MapperResultFailure(result.HandbookReference)); + break; + } + + default: + break; + } + } + } + else if (mappingHelper.TranslateIdAllowNulls(r => r.ResourceId, source.CategoryResourceId, out int? categoryResourceId)) + { + target.CategoryResourceId = categoryResourceId; + } + + if (source.CategoryParent != null) + { + switch (Map(source.CategoryParent, target.CategoryParent)) + { + case { Success: true } result: + { + target.CategoryParent = result.Item; + break; + } + case { Success: false } result: + { + addFailure(new MapperResultFailure(result.HandbookReference)); + break; + } + + default: + break; + } + } + else if (mappingHelper.TranslateIdAllowNulls(c => c.CategoryId, source.CategoryParentId, out int? categoryParentId)) + { + target.CategoryParentId = categoryParentId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/CmsSettingsKeyMapper.cs b/Migration.Tool.Core.K11/Mappers/CmsSettingsKeyMapper.cs new file mode 100644 index 00000000..a2bf0621 --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/CmsSettingsKeyMapper.cs @@ -0,0 +1,67 @@ +using System.Diagnostics; + +using CMS.DataEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public class CmsSettingsKeyMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + private const string SOURCE_KEY_NAME = "CMSDefaultUserID"; + + protected override SettingsKeyInfo CreateNewInstance(CmsSettingsKey source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override SettingsKeyInfo MapInternal(CmsSettingsKey source, SettingsKeyInfo target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + if (newInstance) + { + target.KeyName = source.KeyName; + target.KeyDisplayName = source.KeyDisplayName; + target.KeyDescription = source.KeyDescription; + target.KeyType = source.KeyType; + target.KeyGUID = source.KeyGuid; + target.KeyValidation = source.KeyValidation; + target.KeyEditingControlPath = source.KeyEditingControlPath; + target.KeyFormControlSettings = source.KeyFormControlSettings; + target.KeyExplanationText = source.KeyExplanationText; + } + else + { + target.KeyName = source.KeyName; + target.KeyDescription = source.KeyDescription; + target.KeyType = source.KeyType; + target.KeyValidation = source.KeyValidation; + target.KeyEditingControlPath = source.KeyEditingControlPath; + target.KeyFormControlSettings = source.KeyFormControlSettings; + target.KeyExplanationText = source.KeyExplanationText; + } + + // special migrations for keys + switch (source.KeyName) + { + case SOURCE_KEY_NAME: + { + target.KeyValue = int.TryParse(source.KeyValue, out int cmsDefaultUserId) + ? mappingHelper.TranslateRequiredId(u => u.UserId, cmsDefaultUserId, out int targetCmsDefaultUserId) + ? targetCmsDefaultUserId.ToString() + : source.KeyValue + : source.KeyValue; + break; + } + default: + target.KeyValue = source.KeyValue; + break; + } + + Debug.Assert(!source.SiteId.HasValue, "!source.SiteId.HasValue"); + target.KeyLastModified = source.KeyLastModified; + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/CmsUserMapper.cs b/Migration.Tool.Core.K11/Mappers/CmsUserMapper.cs new file mode 100644 index 00000000..6ee235a0 --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/CmsUserMapper.cs @@ -0,0 +1,56 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public class CmsUserMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override KXP.Models.CmsUser CreateNewInstance(CmsUser tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override KXP.Models.CmsUser MapInternal(CmsUser source, KXP.Models.CmsUser target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (!newInstance && source.UserGuid != target.UserGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.UserName = source.UserName; + target.FirstName = source.FirstName; + target.LastName = source.LastName; + target.Email = source.Email; + target.UserPassword = source.UserPassword; + target.UserEnabled = source.UserEnabled; + target.UserCreated = source.UserCreated; + target.LastLogon = source.LastLogon; + target.UserGuid = source.UserGuid; + target.UserLastModified = source.UserLastModified; + target.UserSecurityStamp = source.UserSecurityStamp; + target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + target.UserIsPendingRegistration = false; + target.UserPasswordLastChanged = null; + target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + foreach (var sourceCmsUserRole in source.CmsUserRoles) + { + if (mappingHelper.TranslateRequiredId(r => r.RoleId, sourceCmsUserRole.RoleId, out int targetRoleId)) + { + if (target.CmsUserRoles.All(x => x.RoleId != targetRoleId)) + { + target.CmsUserRoles.Add(new KXP.Models.CmsUserRole { RoleId = targetRoleId, User = target }); + } + } + } + + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/CountryInfoMapper.cs b/Migration.Tool.Core.K11/Mappers/CountryInfoMapper.cs new file mode 100644 index 00000000..e7a41790 --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/CountryInfoMapper.cs @@ -0,0 +1,27 @@ +using CMS.Globalization; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public class CountryInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + protected override CountryInfo? CreateNewInstance(CmsCountry source, MappingHelper mappingHelper, AddFailure addFailure) + => CountryInfo.New(); + + protected override CountryInfo MapInternal(CmsCountry source, CountryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.CountryName = source.CountryName; + target.CountryDisplayName = source.CountryDisplayName; + target.CountryGUID = source.CountryGuid; + target.CountryLastModified = source.CountryLastModified; + target.CountryThreeLetterCode = source.CountryThreeLetterCode; + target.CountryTwoLetterCode = source.CountryTwoLetterCode; + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/MemberInfoMapper.cs b/Migration.Tool.Core.K11/Mappers/MemberInfoMapper.cs new file mode 100644 index 00000000..f31640ac --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/MemberInfoMapper.cs @@ -0,0 +1,184 @@ +using System.Data; + +using CMS.FormEngine; +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11; +using Migration.Tool.K11.Models; +using Migration.Tool.KXP.Api; + +namespace Migration.Tool.Core.K11.Mappers; + +public record MemberInfoMapperSource(CmsUser User, CmsUserSetting UserSetting); + +public class MemberInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolConfiguration toolConfiguration, + IDbContextFactory k11DbContextFactory) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + public static IReadOnlyList MigratedUserFields = new List + { + nameof(CmsUser.UserGuid), + nameof(CmsUser.UserName), + nameof(CmsUser.Email), + // nameof(KX12M.CmsUser.UserPassword), + nameof(CmsUser.UserEnabled), + nameof(CmsUser.UserCreated), + nameof(CmsUser.UserSecurityStamp) + }; + + protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (user, userSetting) = source; + + if (!newInstance && user.UserGuid != target.MemberGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + // target.UserName = source.UserName; + target.MemberName = user.UserName; + + // target.Email = source.Email; + target.MemberEmail = user.Email; + + // target.SetValue("UserPassword", source.UserPassword); + target.MemberPassword = null; // source.UserPassword; // not migrated + + // target.UserEnabled = source.UserEnabled; + target.MemberEnabled = user.UserEnabled; + + target.SetValue("UserCreated", user.UserCreated); + target.MemberCreated = user.UserCreated.GetValueOrDefault(); + + // target.UserGUID = source.UserGuid; + target.MemberGuid = user.UserGuid; + + target.MemberSecurityStamp = user.UserSecurityStamp; + + // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + // OBSOLETE: target.UserIsPendingRegistration = false; + // OBSOLETE: target.UserPasswordLastChanged = null; + // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); + foreach (var customizedFieldInfo in customized) + { + string fieldName = customizedFieldInfo.FieldName; + + if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out object? value) || + ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) + { + target.SetValue(fieldName, value); + } + } + + using var k11Context = k11DbContextFactory.CreateDbContext(); + var uDci = k11Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_user); + if (uDci != null) + { + var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(uDci?.ClassFormDefinition)).ToList(); + if (userCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.User.UserId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + } + + var usDci = k11Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); + if (usDci != null) + { + var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); + if (userSettingsCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; + + using var conn = new SqlConnection(toolConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userSettingsCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserSettingsInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); + } + } + } + + + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/OmContactGroupMapper.cs b/Migration.Tool.Core.K11/Mappers/OmContactGroupMapper.cs new file mode 100644 index 00000000..608590f3 --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/OmContactGroupMapper.cs @@ -0,0 +1,32 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public class OmContactGroupMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override KXP.Models.OmContactGroup? CreateNewInstance(OmContactGroup tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override KXP.Models.OmContactGroup MapInternal(OmContactGroup source, KXP.Models.OmContactGroup target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ContactGroupName = source.ContactGroupName; + target.ContactGroupDisplayName = source.ContactGroupDisplayName; + target.ContactGroupDescription = source.ContactGroupDescription; + target.ContactGroupDynamicCondition = source.ContactGroupDynamicCondition; + target.ContactGroupEnabled = source.ContactGroupEnabled; + target.ContactGroupLastModified = source.ContactGroupLastModified; + target.ContactGroupGuid = source.ContactGroupGuid; + target.ContactGroupStatus = source.ContactGroupStatus; + + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/OmContactStatusMapper.cs b/Migration.Tool.Core.K11/Mappers/OmContactStatusMapper.cs new file mode 100644 index 00000000..91345ae6 --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/OmContactStatusMapper.cs @@ -0,0 +1,28 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public class OmContactStatusMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override KXP.Models.OmContactStatus? CreateNewInstance(OmContactStatus tSourceEntity, MappingHelper mappingHelper, + AddFailure addFailure) => new(); + + protected override KXP.Models.OmContactStatus MapInternal(OmContactStatus source, KXP.Models.OmContactStatus target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ContactStatusName = source.ContactStatusName; + target.ContactStatusDisplayName = source.ContactStatusDisplayName; + target.ContactStatusDescription = source.ContactStatusDescription; + + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/RoleInfoMapper.cs b/Migration.Tool.Core.K11/Mappers/RoleInfoMapper.cs new file mode 100644 index 00000000..002eba8f --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/RoleInfoMapper.cs @@ -0,0 +1,29 @@ +using CMS.Membership; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public class RoleInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override RoleInfo? CreateNewInstance(CmsRole source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override RoleInfo MapInternal(CmsRole source, RoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.RoleDisplayName = source.RoleDisplayName; + target.RoleName = source.RoleName; + target.RoleDescription = source.RoleDescription; + target.RoleGUID = source.RoleGuid; + target.RoleLastModified = source.RoleLastModified; + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/StateInfoMapper.cs b/Migration.Tool.Core.K11/Mappers/StateInfoMapper.cs new file mode 100644 index 00000000..16c5247f --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/StateInfoMapper.cs @@ -0,0 +1,32 @@ +using CMS.Globalization; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public class StateInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + protected override StateInfo? CreateNewInstance(CmsState source, MappingHelper mappingHelper, AddFailure addFailure) + => StateInfo.New(); + + protected override StateInfo MapInternal(CmsState source, StateInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.StateName = source.StateName; + target.StateDisplayName = source.StateDisplayName; + target.StateLastModified = source.StateLastModified; + target.StateGUID = source.StateGuid; + target.StateCode = source.StateCode; + + if (mappingHelper.TranslateRequiredId(k => k.CountryId, source.CountryId, out int countryId)) + { + target.CountryID = countryId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/UserInfoMapper.cs b/Migration.Tool.Core.K11/Mappers/UserInfoMapper.cs new file mode 100644 index 00000000..4ae19083 --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/UserInfoMapper.cs @@ -0,0 +1,96 @@ +using System.Data; + +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; +using Migration.Tool.KXP.Api; + +namespace Migration.Tool.Core.K11.Mappers; + +public class UserInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolConfiguration toolConfiguration) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override UserInfo CreateNewInstance(CmsUser source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override UserInfo MapInternal(CmsUser source, UserInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (!newInstance && source.UserGuid != target.UserGUID) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.UserName = source.UserName; + target.FirstName = source.FirstName; + target.LastName = source.LastName; + target.Email = source.Email; + // target.UserPassword = source.UserPassword; + target.SetValue("UserPassword", source.UserPassword); + target.UserEnabled = source.UserEnabled; + target.SetValue("UserCreated", source.UserCreated); + // target.UserCreated = source.UserCreated; + target.SetValue("LastLogon", source.LastLogon); + // target.LastLogon = source.LastLogon; + target.UserGUID = source.UserGuid; + target.UserLastModified = source.UserLastModified; + target.UserSecurityStamp = source.UserSecurityStamp; + target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + target.UserIsPendingRegistration = false; + target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + var customizedFields = kxpClassFacade.GetCustomizedFieldInfos(UserInfo.TYPEINFO.ObjectClassName).ToList(); + if (customizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in customizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + + + return target; + } +} diff --git a/Migration.Tool.Core.K11/Mappers/UserRoleInfoMapper.cs b/Migration.Tool.Core.K11/Mappers/UserRoleInfoMapper.cs new file mode 100644 index 00000000..120bfc08 --- /dev/null +++ b/Migration.Tool.Core.K11/Mappers/UserRoleInfoMapper.cs @@ -0,0 +1,31 @@ +using CMS.Membership; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11.Models; + +namespace Migration.Tool.Core.K11.Mappers; + +public class UserRoleInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + protected override UserRoleInfo? CreateNewInstance(CmsUserRole source, MappingHelper mappingHelper, AddFailure addFailure) + => UserRoleInfo.New(); + + protected override UserRoleInfo MapInternal(CmsUserRole source, UserRoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (mappingHelper.TranslateRequiredId(r => r.RoleId, source.RoleId, out int xbkRoleId)) + { + target.RoleID = xbkRoleId; + } + + if (mappingHelper.TranslateRequiredId(r => r.UserId, source.UserId, out int xbkUserId)) + { + target.UserID = xbkUserId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.K11/Migration.Tool.Core.K11.csproj b/Migration.Tool.Core.K11/Migration.Tool.Core.K11.csproj new file mode 100644 index 00000000..db4305e0 --- /dev/null +++ b/Migration.Tool.Core.K11/Migration.Tool.Core.K11.csproj @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/Migration.Tool.Core.K11/Providers/ContentItemNameProvider.cs b/Migration.Tool.Core.K11/Providers/ContentItemNameProvider.cs new file mode 100644 index 00000000..0dfe5b39 --- /dev/null +++ b/Migration.Tool.Core.K11/Providers/ContentItemNameProvider.cs @@ -0,0 +1,42 @@ +using CMS.Base; +using CMS.ContentEngine.Internal; +using CMS.Helpers; + +namespace Migration.Tool.Core.K11.Providers; + +internal class ContentItemNameProvider +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) => this.codeNameValidator = codeNameValidator; + + public Task Get(string name) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); + } + + async Task Get(string name) + { + string codeName = ValidationHelper.GetCodeName(name, useUnicode: false); + + bool isCodeNameValid = ValidationHelper.IsCodeName(codeName); + + if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) + { + codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); + } + + var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); + + return await uniqueCodeNameProvider.GetUniqueValue(codeName); + } + + return Get(name); + } +} diff --git a/Migration.Tool.Core.K11/Providers/ContentItemNameValidator.cs b/Migration.Tool.Core.K11/Providers/ContentItemNameValidator.cs new file mode 100644 index 00000000..de7fdcac --- /dev/null +++ b/Migration.Tool.Core.K11/Providers/ContentItemNameValidator.cs @@ -0,0 +1,18 @@ +using CMS.ContentEngine.Internal; + +namespace Migration.Tool.Core.K11.Providers; + +internal class ContentItemNameValidator : IContentItemNameValidator +{ + /// + public bool IsUnique(string name) => IsUnique(0, name); + + + /// + public bool IsUnique(int id, string name) + { + var contentItemInfo = new ContentItemInfo { ContentItemID = id, ContentItemName = name }; + + return contentItemInfo.CheckUniqueCodeName(); + } +} diff --git a/Migration.Tool.Core.K11/Providers/UniqueContentItemNameProvider.cs b/Migration.Tool.Core.K11/Providers/UniqueContentItemNameProvider.cs new file mode 100644 index 00000000..bad499f8 --- /dev/null +++ b/Migration.Tool.Core.K11/Providers/UniqueContentItemNameProvider.cs @@ -0,0 +1,38 @@ +using CMS.Base; +using CMS.ContentEngine.Internal; + +namespace Migration.Tool.Core.K11.Providers; + +internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) + : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) => this.codeNameValidator = codeNameValidator; + + public override Task GetUniqueValue(string inputValue) => base.GetUniqueValue(AddSuffix(inputValue)); + + + private string AddSuffix(string codeName) + { + string randomSuffix = GetRandomSuffix(); + string codeNameWithSuffix = codeName += randomSuffix; + + if (codeNameWithSuffix.Length > MaxLength) + { + int availableLength = MaxLength - randomSuffix.Length; + + codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; + } + + return codeNameWithSuffix; + } + + + /// + protected override Task IsValueUnique(string value) => Task.FromResult(codeNameValidator.IsUnique(value)); +} diff --git a/Migration.Tool.Core.K11/Services/CmsClass/AttachmentSelectorItem.cs b/Migration.Tool.Core.K11/Services/CmsClass/AttachmentSelectorItem.cs new file mode 100644 index 00000000..c1c61e86 --- /dev/null +++ b/Migration.Tool.Core.K11/Services/CmsClass/AttachmentSelectorItem.cs @@ -0,0 +1,11 @@ +using Newtonsoft.Json; + +namespace Migration.Tool.Core.K11.Services.CmsClass; + +/// Represents an item for the attachment selector. +public class AttachmentSelectorItem +{ + /// Attachment GUID. + [JsonProperty("fileGuid")] + public Guid FileGuid { get; set; } +} diff --git a/Migration.Tool.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs b/Migration.Tool.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs new file mode 100644 index 00000000..e2b7c856 --- /dev/null +++ b/Migration.Tool.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs @@ -0,0 +1,189 @@ +// namespace Migration.Tool.Core.K11.Services.CmsClass; +// +// using System.Runtime.Serialization; +// using Newtonsoft.Json; +// using Newtonsoft.Json.Linq; +// +// #region Copied from Kentico assembly +// +// [DataContract(Name = "Configuration", Namespace = "")] +// public sealed class EditableAreasConfiguration +// { +// /// Editable areas within the page. +// [DataMember] +// [JsonProperty("editableAreas")] +// public List EditableAreas { get; private set; } +// +// /// +// /// Creates an instance of class. +// /// +// public EditableAreasConfiguration() => this.EditableAreas = new List(); +// } +// +// /// +// /// Represents configuration of editable area within the instance. +// /// +// [DataContract(Name = "EditableArea", Namespace = "")] +// public sealed class EditableAreaConfiguration +// { +// /// Identifier of the editable area. +// [DataMember] +// [JsonProperty("identifier")] +// public string Identifier { get; set; } +// +// /// Sections within editable area. +// [DataMember] +// [JsonProperty("sections")] +// public List Sections { get; private set; } +// +// /// +// /// A flag indicating whether the output of the individual widgets within the editable area can be cached. The default value is false. +// /// +// public bool AllowWidgetOutputCache { get; set; } +// +// /// +// /// An absolute expiration date for the cached output of the individual widgets. +// /// +// public DateTimeOffset? WidgetOutputCacheExpiresOn { get; set; } +// +// /// +// /// The length of time from the first request to cache the output of the individual widgets. +// /// +// public TimeSpan? WidgetOutputCacheExpiresAfter { get; set; } +// +// /// +// /// The time after which the cached output of the individual widgets should be evicted if it has not been accessed. +// /// +// public TimeSpan? WidgetOutputCacheExpiresSliding { get; set; } +// +// /// +// /// Creates an instance of class. +// /// +// public EditableAreaConfiguration() => this.Sections = new List(); +// } +// +// /// +// /// Represents configuration of section within the instance. +// /// +// [DataContract(Name = "Section", Namespace = "")] +// public sealed class SectionConfiguration +// { +// /// Identifier of the section. +// [DataMember] +// [JsonProperty("identifier")] +// public Guid Identifier { get; set; } +// +// /// Type section identifier. +// [DataMember] +// [JsonProperty("type")] +// public string TypeIdentifier { get; set; } +// +// /// Section properties. +// [DataMember] +// [JsonProperty("properties")] +// // public ISectionProperties Properties { get; set; } +// public JObject Properties { get; set; } +// +// /// Zones within the section. +// [DataMember] +// [JsonProperty("zones")] +// public List Zones { get; private set; } +// +// /// +// /// Creates an instance of class. +// /// +// public SectionConfiguration() => this.Zones = new List(); +// } +// +// /// +// /// Represents the zone within the configuration class. +// /// +// [DataContract(Name = "Zone", Namespace = "")] +// public sealed class ZoneConfiguration +// { +// /// Identifier of the widget zone. +// [DataMember] +// [JsonProperty("identifier")] +// public Guid Identifier { get; set; } +// +// /// Name of the widget zone. +// [DataMember] +// [JsonProperty("name")] +// public string Name { get; set; } +// +// /// List of widgets within the zone. +// [DataMember] +// [JsonProperty("widgets")] +// public List Widgets { get; private set; } +// +// /// +// /// Creates an instance of class. +// /// +// public ZoneConfiguration() => this.Widgets = new List(); +// } +// +// /// +// /// Represents the configuration of a widget within the list. +// /// +// [DataContract(Name = "Widget", Namespace = "")] +// public sealed class WidgetConfiguration +// { +// /// Identifier of the widget instance. +// [DataMember] +// [JsonProperty("identifier")] +// public Guid Identifier { get; set; } +// +// /// Type widget identifier. +// [DataMember] +// [JsonProperty("type")] +// public string TypeIdentifier { get; set; } +// +// /// Personalization condition type identifier. +// [DataMember] +// [JsonProperty("conditionType")] +// public string PersonalizationConditionTypeIdentifier { get; set; } +// +// /// List of widget variants. +// [DataMember] +// [JsonProperty("variants")] +// public List Variants { get; set; } +// +// /// +// /// Creates an instance of class. +// /// +// public WidgetConfiguration() => this.Variants = new List(); +// } +// +// /// +// /// Represents the configuration variant of a widget within the list. +// /// +// [DataContract(Name = "Variant", Namespace = "")] +// public sealed class WidgetVariantConfiguration +// { +// /// Identifier of the variant instance. +// [DataMember] +// [JsonProperty("identifier")] +// public Guid Identifier { get; set; } +// +// /// Widget variant name. +// [DataMember] +// [JsonProperty("name")] +// public string Name { get; set; } +// +// /// Widget variant properties. +// [DataMember] +// [JsonProperty("properties")] +// // public IWidgetProperties Properties { get; set; } +// public JObject Properties { get; set; } +// +// /// Widget variant personalization condition type. +// /// Only personalization condition type parameters are serialized to JSON. +// [DataMember] +// [JsonProperty("conditionTypeParameters")] +// public JObject PersonalizationConditionType { get; set; } +// } +// +// #endregion +// + + diff --git a/Migration.Tool.Core.K11/Services/CmsClass/PageSelectorItem.cs b/Migration.Tool.Core.K11/Services/CmsClass/PageSelectorItem.cs new file mode 100644 index 00000000..ce76615d --- /dev/null +++ b/Migration.Tool.Core.K11/Services/CmsClass/PageSelectorItem.cs @@ -0,0 +1,13 @@ +// namespace Migration.Tool.Core.K11.Services.CmsClass; +// +// using Newtonsoft.Json; +// +// /// Represents an item for a page selector. +// public class PageSelectorItem +// { +// /// Node Guid of a page. +// [JsonProperty("nodeGuid")] +// public Guid NodeGuid { get; set; } +// } + + diff --git a/Migration.Tool.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs b/Migration.Tool.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs new file mode 100644 index 00000000..bfeac645 --- /dev/null +++ b/Migration.Tool.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs @@ -0,0 +1,31 @@ +// namespace Migration.Tool.Core.K11.Services.CmsClass; +// +// using System.Runtime.Serialization; +// using Newtonsoft.Json; +// using Newtonsoft.Json.Linq; +// +// /// +// /// Page template configuration for the instance. +// /// +// [DataContract(Name = "PageTemplate", Namespace = "")] +// public class PageTemplateConfiguration +// { +// /// Identifier of the page template. +// [DataMember] +// [JsonProperty("identifier")] +// public string Identifier { get; set; } +// +// /// +// /// Identifier of the page template configuration based on which the page was created. +// /// +// [DataMember] +// [JsonProperty("configurationIdentifier")] +// public Guid ConfigurationIdentifier { get; set; } +// +// /// Page template properties. +// [DataMember] +// [JsonProperty("properties")] +// public JObject Properties { get; set; } +// } + + diff --git a/Migration.Tool.Core.K11/Services/CountryMigrator.cs b/Migration.Tool.Core.K11/Services/CountryMigrator.cs new file mode 100644 index 00000000..e452db31 --- /dev/null +++ b/Migration.Tool.Core.K11/Services/CountryMigrator.cs @@ -0,0 +1,105 @@ +using CMS.Globalization; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.K11.Contexts; +using Migration.Tool.K11; +using Migration.Tool.K11.Models; +using Migration.Tool.KXP.Api; + +namespace Migration.Tool.Core.K11.Services; + +public class CountryMigrator( + ILogger logger, + IDbContextFactory k11ContextFactory, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + IEntityMapper countryMapper, + IEntityMapper stateMapper, + KxpApiInitializer kxpApiInitializer) +{ + public void MigrateCountriesAndStates() + { + if (!kxpApiInitializer.EnsureApiIsInitialized()) + { + throw new InvalidOperationException("Falied to initialize kentico API. Please check configuration."); + } + + var k11Context = k11ContextFactory.CreateDbContext(); + + var k11Countries = k11Context.CmsCountries.AsNoTracking(); + foreach (var k11CmsCountry in k11Countries) + { + var kxpCountryInfo = CountryInfoProvider.ProviderObject.Get(k11CmsCountry.CountryName); + + if (kxpCountryInfo != null) // do not update when exists + { + continue; + } + + var mapped = countryMapper.Map(k11CmsCountry, null); + protocol.MappedTarget(mapped); + + if (mapped is (var countryInfo, var newInstance) { Success: true }) + { + try + { + CountryInfoProvider.ProviderObject.Set(countryInfo); + + protocol.Success(k11CmsCountry, countryInfo, mapped); + logger.LogEntitySetAction(newInstance, countryInfo); + + primaryKeyMappingContext.SetMapping(r => r.CountryId, k11CmsCountry.CountryId, countryInfo.CountryID); + } + catch (Exception exception) + { + logger.LogEntitySetError(exception, newInstance, countryInfo); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithIdentityPrint(countryInfo) + ); + } + } + } + + + var k11States = k11Context.CmsStates.AsNoTracking(); + foreach (var k11CmsState in k11States) + { + var kxpStateInfo = StateInfoProvider.ProviderObject.Get(k11CmsState.StateName); + + if (kxpStateInfo != null) // do not update when exists + { + continue; + } + + var mapped = stateMapper.Map(k11CmsState, null); + protocol.MappedTarget(mapped); + + if (mapped is (var stateInfo, var newInstance) { Success: true }) + { + try + { + StateInfoProvider.ProviderObject.Set(stateInfo); + + protocol.Success(k11CmsState, stateInfo, mapped); + logger.LogEntitySetAction(newInstance, stateInfo); + + primaryKeyMappingContext.SetMapping(r => r.StateId, k11CmsState.StateId, stateInfo.StateID); + } + catch (Exception exception) + { + logger.LogEntitySetError(exception, newInstance, stateInfo); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithIdentityPrint(stateInfo) + ); + } + } + } + } +} diff --git a/Migration.Tool.Core.K11/Services/IPrimaryKeyLocatorService.cs b/Migration.Tool.Core.K11/Services/IPrimaryKeyLocatorService.cs new file mode 100644 index 00000000..592e6d4c --- /dev/null +++ b/Migration.Tool.Core.K11/Services/IPrimaryKeyLocatorService.cs @@ -0,0 +1,11 @@ +using System.Linq.Expressions; + +namespace Migration.Tool.Core.K11.Services; + +public record SourceTargetKeyMapping(int SourceId, int TargetId); + +public interface IPrimaryKeyLocatorService +{ + bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); + IEnumerable SelectAll(Expression> keyNameSelector); +} diff --git a/Migration.Tool.Core.K11/Services/KeyLocatorService.cs b/Migration.Tool.Core.K11/Services/KeyLocatorService.cs new file mode 100644 index 00000000..19ffe713 --- /dev/null +++ b/Migration.Tool.Core.K11/Services/KeyLocatorService.cs @@ -0,0 +1,108 @@ +using System.Linq.Expressions; +using System.Runtime.CompilerServices; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.K11; +using Migration.Tool.KXP.Context; + +namespace Migration.Tool.Core.K11.Services; + +public class KeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory k11ContextFactory) +{ + public bool TryLocate( + Expression> sourceKeySelector, + Expression> targetKeySelector, + Expression> sourceGuidSelector, + Expression> targetGuidSelector, + object? sourceKey, out TTargetKey targetId + ) where TSource : class where TTarget : class + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var k11Context = k11ContextFactory.CreateDbContext(); + + var sourceType = typeof(TSource); + Unsafe.SkipInit(out targetId); + + try + { + if (sourceKey is null) + { + return false; + } + + var sourceEquals = Expression.Equal( + sourceKeySelector.Body, + Expression.Convert(Expression.Constant(sourceKey, sourceKey.GetType()), typeof(object)) + ); + var sourcePredicate = Expression.Lambda>(sourceEquals, sourceKeySelector.Parameters[0]); + var k11Guid = k11Context.Set().Where(sourcePredicate).Select(sourceGuidSelector).Single(); + + var param = Expression.Parameter(typeof(TTarget), "t"); + var member = targetGuidSelector.Body as MemberExpression ?? throw new InvalidOperationException($"Expression SHALL NOT be other than member expression, expression: {targetGuidSelector}"); + var targetEquals = Expression.Equal( + Expression.MakeMemberAccess(param, member.Member), + Expression.Constant(k11Guid, typeof(Guid)) + ); + var targetPredicate = Expression.Lambda>(targetEquals, param); + + var query = kxpContext.Set().Where(targetPredicate); + var selector = Expression.Lambda>(targetKeySelector.Body, targetKeySelector.Parameters[0]); + targetId = query.Select(selector).Single(); + return true; + } + catch (InvalidOperationException ioex) + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceKey, ioex.Message); + return false; + } + finally + { + if (!targetId?.Equals(default) ?? false) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceKey, targetId); + } + } + } + + public bool TryGetSourceGuid(Expression> keySelector, Expression> guidSelector, object? key, out Guid? guid) + where T : class + { + using var KX12Context = k11ContextFactory.CreateDbContext(); + + var type = typeof(T); + Unsafe.SkipInit(out guid); + + try + { + if (key is null) + { + return false; + } + + var sourceEquals = Expression.Equal( + keySelector.Body, + Expression.Convert(Expression.Constant(key, key.GetType()), typeof(object)) + ); + var sourcePredicate = Expression.Lambda>(sourceEquals, keySelector.Parameters[0]); + guid = KX12Context.Set().Where(sourcePredicate).Select(guidSelector).Single(); + return true; + } + catch (InvalidOperationException ioex) + { + logger.LogWarning("Guid locator {SourceFullType} primary key: {Key} failed, {Message}", type.FullName, key, ioex.Message); + return false; + } + finally + { + if (!guid?.Equals(default) ?? false) + { + logger.LogTrace("Guid locator {SourceFullType} primary key: {Key} located {Guid}", type.FullName, key, guid); + } + } + } +} diff --git a/Migration.Tool.Core.K11/Services/PrimaryKeyLocatorService.cs b/Migration.Tool.Core.K11/Services/PrimaryKeyLocatorService.cs new file mode 100644 index 00000000..32f89341 --- /dev/null +++ b/Migration.Tool.Core.K11/Services/PrimaryKeyLocatorService.cs @@ -0,0 +1,220 @@ +using System.Linq.Expressions; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.K11; +using Migration.Tool.K11.Models; +using Migration.Tool.KXP.Context; + +namespace Migration.Tool.Core.K11.Services; + +public class PrimaryKeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory k11ContextFactory) + : IPrimaryKeyLocatorService +{ + public IEnumerable SelectAll(Expression> keyNameSelector) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var k11Context = k11ContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + string memberName = keyNameSelector.GetMemberName(); + + logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); + + if (sourceType == typeof(CmsUser) && memberName == nameof(CmsUser.UserId)) + { + var sourceUsers = k11Context.CmsUsers.Select(x => new { x.UserId, x.UserGuid, x.UserName }).ToList(); + var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); + + var result = sourceUsers.Join(targetUsers, + a => new CmsUserKey(a.UserGuid, a.UserName), + b => new CmsUserKey(b.UserGuid, b.UserName), + (a, b) => new SourceTargetKeyMapping(a.UserId, b.UserId), + new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(OmContact) && memberName == nameof(OmContact.ContactId)) + { + var source = k11Context.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + var target = kxpContext.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + + var result = source.Join(target, + a => a.ContactGuid, + b => b.ContactGuid, + (a, b) => new SourceTargetKeyMapping(a.ContactId, b.ContactId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(CmsState) && memberName == nameof(CmsState.StateId)) + { + var source = k11Context.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + + var result = source.Join(target, + a => a.StateName, + b => b.StateName, + (a, b) => new SourceTargetKeyMapping(a.StateId, b.StateId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(CmsCountry) && memberName == nameof(CmsCountry.CountryId)) + { + var source = k11Context.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + + var result = source.Join(target, + a => a.CountryName, + b => b.CountryName, + (a, b) => new SourceTargetKeyMapping(a.CountryId, b.CountryId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + + throw new NotImplementedException(); + } + + public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var KX12Context = k11ContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + targetId = -1; + try + { + if (sourceType == typeof(CmsResource)) + { + var k11Guid = KX12Context.CmsResources.Where(c => c.ResourceId == sourceId).Select(x => x.ResourceGuid).Single(); + targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == k11Guid).Select(x => x.ResourceId).Single(); + return true; + } + + if (sourceType == typeof(Tool.K11.Models.CmsClass)) + { + var k11Guid = KX12Context.CmsClasses.Where(c => c.ClassId == sourceId).Select(x => x.ClassGuid).Single(); + targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == k11Guid).Select(x => x.ClassId).Single(); + return true; + } + + if (sourceType == typeof(CmsUser)) + { + var k11User = KX12Context.CmsUsers.Where(c => c.UserId == sourceId).Select(x => new { x.UserGuid, x.UserName }).Single(); + targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == k11User.UserGuid || x.UserName == k11User.UserName).Select(x => x.UserId).Single(); + return true; + } + + if (sourceType == typeof(CmsRole)) + { + var k11Role = KX12Context.CmsRoles.Where(c => c.RoleId == sourceId).Select(x => new { x.RoleGuid }).Single(); + targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == k11Role.RoleGuid).Select(x => x.RoleId).Single(); + return true; + } + + if (sourceType == typeof(CmsSite)) + { + var k11Guid = KX12Context.CmsSites.Where(c => c.SiteId == sourceId).Select(x => x.SiteGuid).Single(); + targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == k11Guid).Select(x => x.ChannelId).Single(); + return true; + } + + if (sourceType == typeof(CmsState)) + { + string k11CodeName = KX12Context.CmsStates.Where(c => c.StateId == sourceId).Select(x => x.StateName).Single(); + targetId = kxpContext.CmsStates.Where(x => x.StateName == k11CodeName).Select(x => x.StateId).Single(); + return true; + } + + if (sourceType == typeof(CmsCountry)) + { + string k11CodeName = KX12Context.CmsCountries.Where(c => c.CountryId == sourceId).Select(x => x.CountryName).Single(); + targetId = kxpContext.CmsCountries.Where(x => x.CountryName == k11CodeName).Select(x => x.CountryId).Single(); + return true; + } + + if (sourceType == typeof(OmContactStatus)) + { + string k11Guid = KX12Context.OmContactStatuses.Where(c => c.ContactStatusId == sourceId).Select(x => x.ContactStatusName).Single(); + targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == k11Guid).Select(x => x.ContactStatusId).Single(); + return true; + } + + if (sourceType == typeof(OmContact)) + { + var k11Guid = KX12Context.OmContacts.Where(c => c.ContactId == sourceId).Select(x => x.ContactGuid).Single(); + targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == k11Guid).Select(x => x.ContactId).Single(); + return true; + } + } + catch (InvalidOperationException ioex) + { + if (ioex.Message.StartsWith("Sequence contains no elements")) + { + logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + else + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + + return false; + } + finally + { + if (targetId != -1) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); + } + } + + logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); + targetId = -1; + return false; + } + + private class KeyEqualityComparerWithLambda(Func equalityComparer) : IEqualityComparer + { + public bool Equals(T? x, T? y) => equalityComparer.Invoke(x, y); + + public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; + } + + private record CmsUserKey(Guid UserGuid, string UserName); +} diff --git a/Migration.Toolkit.Core.K11/Services/TableReflectionService.cs b/Migration.Tool.Core.K11/Services/TableReflectionService.cs similarity index 92% rename from Migration.Toolkit.Core.K11/Services/TableReflectionService.cs rename to Migration.Tool.Core.K11/Services/TableReflectionService.cs index 8226b38d..d85c4c37 100644 --- a/Migration.Toolkit.Core.K11/Services/TableReflectionService.cs +++ b/Migration.Tool.Core.K11/Services/TableReflectionService.cs @@ -1,9 +1,9 @@ // using System.ComponentModel.DataAnnotations.Schema; // using Microsoft.Extensions.Logging; -// using Migration.Toolkit.Common.Helpers; -// using Migration.Toolkit.K11; +// using Migration.Tool.Common.Helpers; +// using Migration.Tool.K11; // -// namespace Migration.Toolkit.Core.K11.Services; +// namespace Migration.Tool.Core.K11.Services; // // public class TableReflectionService // { diff --git a/Migration.Tool.Core.KX12/Behaviors/CommandConstraintBehavior.cs b/Migration.Tool.Core.KX12/Behaviors/CommandConstraintBehavior.cs new file mode 100644 index 00000000..c02697db --- /dev/null +++ b/Migration.Tool.Core.KX12/Behaviors/CommandConstraintBehavior.cs @@ -0,0 +1,229 @@ +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KX12; +using Migration.Tool.KX12.Context; + +namespace Migration.Tool.Core.KX12.Behaviors; + +public class CommandConstraintBehavior( + ILogger> logger, + IMigrationProtocol protocol, + IDbContextFactory kx12ContextFactory) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + try + { + var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + + bool criticalCheckPassed = PerformChecks(request, kx12Context); + if (!criticalCheckPassed) + { + return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); + } + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogCritical(ex, "Error occured while checking command constraints"); + return (TResponse)(CommandResult)new CommandCheckFailedResult(false); + } + + return await next(); + } + + private bool PerformChecks(TRequest request, KX12Context kx12Context) + { + bool criticalCheckPassed = true; + const string supportedVersion = "12.0.20"; + if (SemanticVersion.TryParse(supportedVersion, out var minimalVersion)) + { + criticalCheckPassed &= CheckVersion(kx12Context, minimalVersion); + } + + var sourceSites = kx12Context.CmsSites + .Include(s => s.Cultures) + .ToList(); + + foreach (var site in sourceSites) + { + criticalCheckPassed &= CheckSite(sourceSites, site.SiteId); + } + + if (request is ICultureReliantCommand cultureReliantCommand) + { + criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites); + } + + return criticalCheckPassed; + } + + private bool CheckVersion(KX12Context kx12Context, SemanticVersion minimalVersion) + { + bool criticalCheckPassed = true; + + #region Check conclusion methods + + void UnableToReadVersionKey(string keyName) + { + logger.LogCritical("Unable to read CMS version (incorrect format) - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { ErrorKind = "Settings key value incorrect format", SettingsKeyName = keyName, SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + void VersionKeyNotFound(string keyName) + { + logger.LogCritical("CMS version not found - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { ErrorKind = "Settings key not found", SettingsKeyName = keyName, SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + void UpgradeNeeded(string keyName, string currentVersion) + { + logger.LogCritical("{Key} '{CurrentVersion}' is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentVersion, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { CurrentVersion = currentVersion, SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + void LowHotfix(string keyName, int currentHotfix) + { + logger.LogCritical("{Key} '{CurrentVersion}' hotfix is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentHotfix, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { CurrentHotfix = currentHotfix.ToString(), SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + #endregion + + if (kx12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDataVersion) is { } cmsDataVersion) + { + if (SemanticVersion.TryParse(cmsDataVersion.KeyValue, out var cmsDataVer)) + { + if (cmsDataVer.IsLesserThan(minimalVersion)) + { + UpgradeNeeded(SettingsKeys.CMSDataVersion, cmsDataVer.ToString()); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSDataVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSDataVersion); + } + + if (kx12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDBVersion) is { } cmsDbVersion) + { + if (SemanticVersion.TryParse(cmsDbVersion.KeyValue, out var cmsDataVer)) + { + if (cmsDataVer.IsLesserThan(minimalVersion)) + { + UpgradeNeeded(SettingsKeys.CMSDBVersion, cmsDataVer.ToString()); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSDBVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSDBVersion); + } + + if (kx12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixDataVersion) is { } cmsHotfixDataVersion) + { + if (int.TryParse(cmsHotfixDataVersion.KeyValue, out int version)) + { + if (version < minimalVersion.Hotfix) + { + LowHotfix(SettingsKeys.CMSHotfixDataVersion, version); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSHotfixDataVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSHotfixDataVersion); + } + + if (kx12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixVersion) is { } cmsHotfixVersion) + { + if (int.TryParse(cmsHotfixVersion.KeyValue, out int version)) + { + if (version < minimalVersion.Hotfix) + { + LowHotfix(SettingsKeys.CMSHotfixVersion, version); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSHotfixVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSHotfixVersion); + } + + return criticalCheckPassed; + } + + private bool CheckSite(List sourceSites, int sourceSiteId) + { + bool criticalCheckPassed = true; + if (sourceSites.All(s => s.SiteId != sourceSiteId)) + { + var supportedSites = sourceSites.Select(x => new { x.SiteName, x.SiteId }).ToArray(); + string supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); + logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, + supportedSitesStr); + protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") + .WithMessage("Check program argument '--siteId'") + .WithData(new { sourceSiteId, AvailableSites = supportedSites })); + criticalCheckPassed = false; + } + + return criticalCheckPassed; + } + + private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites) + { + bool criticalCheckPassed = true; + string cultureCode = cultureReliantCommand.CultureCode; + var siteCultureLookup = sourceSites + .ToDictionary(x => x.SiteId, x => x.Cultures.Select(s => s.CultureCode.ToLowerInvariant())); + + foreach (var site in sourceSites) + { + if (siteCultureLookup.TryGetValue(site.SiteId, out var value)) + { + string[] siteCultures = value.ToArray(); + if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) + { + string supportedCultures = string.Join(", ", siteCultures); + logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, site.SiteId, supportedCultures); + protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") + .WithMessage("Check program argument '--culture'") + .WithData(new { cultureCode, site.SiteId, SiteCultures = supportedCultures })); + criticalCheckPassed = false; + } + } + } + + return criticalCheckPassed; + } +} diff --git a/Migration.Tool.Core.KX12/Behaviors/RequestHandlingBehavior.cs b/Migration.Tool.Core.KX12/Behaviors/RequestHandlingBehavior.cs new file mode 100644 index 00000000..dce0f26c --- /dev/null +++ b/Migration.Tool.Core.KX12/Behaviors/RequestHandlingBehavior.cs @@ -0,0 +1,39 @@ +using System.Diagnostics; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; + +namespace Migration.Tool.Core.KX12.Behaviors; + +public class RequestHandlingBehavior(ILogger> logger, IMigrationProtocol protocol) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + var sw = Stopwatch.StartNew(); + logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); + try + { + protocol.CommandRequest(request); + var response = await next(); + protocol.CommandFinished(request, response); + return response; + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogError(ex, "Error occured"); + throw; + } + finally + { + logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); + } + } +} diff --git a/Migration.Tool.Core.KX12/Behaviors/XbKApiContextBehavior.cs b/Migration.Tool.Core.KX12/Behaviors/XbKApiContextBehavior.cs new file mode 100644 index 00000000..d28c5e07 --- /dev/null +++ b/Migration.Tool.Core.KX12/Behaviors/XbKApiContextBehavior.cs @@ -0,0 +1,42 @@ +using CMS.Base; +using CMS.Membership; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KXP.Api; + +namespace Migration.Tool.Core.KX12.Behaviors; + +public class XbKApiContextBehavior( + ILogger> logger, + IMigrationProtocol protocol, + KxpApiInitializer initializer) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + initializer.EnsureApiIsInitialized(); + + var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); + if (defaultAdmin == null) + { + protocol.Append(HandbookReferences + .MissingRequiredDependency() + .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") + ); + throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); + } + + using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) + { + logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); + return await next(); + } + } +} diff --git a/Migration.Tool.Core.KX12/Contexts/KeyMappingContext.cs b/Migration.Tool.Core.KX12/Contexts/KeyMappingContext.cs new file mode 100644 index 00000000..a8babd1e --- /dev/null +++ b/Migration.Tool.Core.KX12/Contexts/KeyMappingContext.cs @@ -0,0 +1,34 @@ +using System.Linq.Expressions; + +using Migration.Tool.Core.KX12.Services; + +namespace Migration.Tool.Core.KX12.Contexts; + +public record MapSourceKeyResult(bool Success, TMapped? Mapped); + +public class KeyMappingContext(PrimaryKeyMappingContext primaryKeyMappingContext, KeyLocatorService keyLocatorService) +{ + public MapSourceKeyResult MapSourceKey(Expression> sourceKeySelector, + Expression> sourceGuidSelector, + object? sourceKey, + Expression> targetKeySelector, + Expression> targetGuidSelector) where TSource : class where TTarget : class + { + if (sourceKey is int id && primaryKeyMappingContext.MapSourceId(sourceKeySelector, id) is { Success: true, MappedId: TTargetKey targetKey }) + { + return new MapSourceKeyResult(true, targetKey); + } + + if (keyLocatorService.TryLocate(sourceKeySelector, targetKeySelector, sourceGuidSelector, targetGuidSelector, sourceKey, out var located)) + { + return new MapSourceKeyResult(true, located); + } + + return new MapSourceKeyResult(false, default); + } + + public MapSourceKeyResult GetGuid(Expression> keySelector, Expression> guidSelector, object? key) where T : class => + keyLocatorService.TryGetSourceGuid(keySelector, guidSelector, key, out var located) + ? new MapSourceKeyResult(true, located) + : new MapSourceKeyResult(false, null); +} diff --git a/Migration.Tool.Core.KX12/Contexts/PrimaryKeyMappingContext.cs b/Migration.Tool.Core.KX12/Contexts/PrimaryKeyMappingContext.cs new file mode 100644 index 00000000..bc0bb0bf --- /dev/null +++ b/Migration.Tool.Core.KX12/Contexts/PrimaryKeyMappingContext.cs @@ -0,0 +1,287 @@ +using System.Diagnostics; +using System.Linq.Expressions; +using System.Reflection; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Core.KX12.Services; + +namespace Migration.Tool.Core.KX12.Contexts; + +public class PrimaryKeyMappingContext( + ILogger logger, + IPrimaryKeyLocatorService primaryKeyLocatorService, + ToolConfiguration toolConfiguration) + : IPrimaryKeyMappingContext +{ + private readonly Dictionary mappingsCache = new(StringComparer.OrdinalIgnoreCase); + + public void SetMapping(Type type, string keyName, int sourceId, int targetId) + { + Debug.Assert(sourceId > 0, "sourceId > 0"); + Debug.Assert(targetId > 0, "targetId > 0"); + + var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) + .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); + + Debug.Assert(foundProp != null, "foundProp != null"); + + string fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; + + mappingsCache[fullKeyName] = targetId; + logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); + } + + public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) + { + string fullKeyName = CreateKey(keyNameSelector, sourceId); + mappingsCache[fullKeyName] = targetId; + logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); + } + + public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) + { + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sourceId); + if (sourceId == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out int targetId)) + { + SetMapping(keyNameSelector, sourceId, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) + { + targetIdResult = -1; + if (sourceId is not int sid) + { + return false; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + targetIdResult = explicitlyMappedId; + return true; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + targetIdResult = resultId; + return true; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + targetIdResult = targetId; + return true; + } + + return false; + } + + public int? MapFromSource(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + return null; + } + + public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return new MapSourceIdResult(true, null); + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return new MapSourceIdResult(true, null); + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return new MapSourceIdResult(true, explicitlyMappedId); + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return new MapSourceIdResult(true, resultId); + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return new MapSourceIdResult(true, targetId); + } + + return new MapSourceIdResult(false, null); + } + + public void PreloadDependencies(Expression> keyNameSelector) + { + foreach ((int sourceId, int targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) + { + SetMapping(keyNameSelector, sourceId, targetId); + } + } + + public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return true; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + return true; + } + + if (GetExplicitMappingOrNull(memberName, sid) is not null) + { + return true; + } + + if (mappingsCache.TryGetValue(fullKeyName, out _)) + { + return true; + } + + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) + { + return true; + } + + return false; + } + + private int? GetExplicitMappingOrNull(string memberName, int? sourceId) + { + if (sourceId == null) + { + return null; + } + + var mappings = toolConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; + if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) + { + return memberMappings.TryGetValue($"{sourceId}", out int? mappedId) ? mappedId : null; + } + + return null; + } + + private static string CreateKey(Expression> keyNameSelector, int sourceId) => $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; +} diff --git a/Migration.Tool.Core.KX12/Exceptions.cs b/Migration.Tool.Core.KX12/Exceptions.cs new file mode 100644 index 00000000..ed21863e --- /dev/null +++ b/Migration.Tool.Core.KX12/Exceptions.cs @@ -0,0 +1,13 @@ +namespace Migration.Tool.Core.KX12; + +public class MappingFailureException : InvalidOperationException +{ + public MappingFailureException(string keyName, string reason) : base($"Key '{keyName}' mapping failed: {reason}") + { + KeyName = keyName; + Reason = reason; + } + + public string KeyName { get; } + public string Reason { get; } +} diff --git a/Migration.Tool.Core.KX12/GlobalUsings.cs b/Migration.Tool.Core.KX12/GlobalUsings.cs new file mode 100644 index 00000000..0124a4f2 --- /dev/null +++ b/Migration.Tool.Core.KX12/GlobalUsings.cs @@ -0,0 +1,3 @@ +global using System; + +global using KX12M = Migration.Tool.KX12.Models; diff --git a/Migration.Tool.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs b/Migration.Tool.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs new file mode 100644 index 00000000..e156929e --- /dev/null +++ b/Migration.Tool.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs @@ -0,0 +1,392 @@ +using CMS.Activities; +using CMS.ContactManagement; +using CMS.ContentEngine; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Common.Services; +using Migration.Tool.Common.Services.BulkCopy; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.Core.KX12.Helpers; +using Migration.Tool.Core.KX12.Services; +using Migration.Tool.KXP.Api; +using Migration.Tool.KXP.Context; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX12.Handlers; + +public class MigrateContactManagementCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + BulkDataCopyService bulkDataCopyService, + ToolConfiguration toolConfiguration, + PrimaryKeyMappingContext primaryKeyMappingContext, + KeyMappingContext keyMappingContext, + CountryMigrator countryMigrator, + KxpClassFacade kxpClassFacade, + ISpoiledGuidContext spoiledGuidContext, + IProtocol protocol +) + : IRequestHandler, IDisposable +{ + private readonly KxpContext kxpContext = kxpContextFactory.CreateDbContext(); + + public void Dispose() => kxpContext.Dispose(); + + public Task Handle(MigrateContactManagementCommand request, CancellationToken cancellationToken) + { + countryMigrator.MigrateCountriesAndStates(); + + if (MigrateContacts() is { } ccr) + { + return Task.FromResult(ccr); + } + + if (MigrateContactActivities() is { } acr) + { + return Task.FromResult(acr); + } + + return Task.FromResult(new GenericCommandResult()); + } + + #region "Migrate contacts" + + private CommandResult? MigrateContacts() + { + var requiredColumnsForContactMigration = new Dictionary + { + { nameof(KX12M.OmContact.ContactId), nameof(OmContact.ContactId) }, + { nameof(KX12M.OmContact.ContactFirstName), nameof(OmContact.ContactFirstName) }, + { nameof(KX12M.OmContact.ContactMiddleName), nameof(OmContact.ContactMiddleName) }, + { nameof(KX12M.OmContact.ContactLastName), nameof(OmContact.ContactLastName) }, + { nameof(KX12M.OmContact.ContactJobTitle), nameof(OmContact.ContactJobTitle) }, + { nameof(KX12M.OmContact.ContactAddress1), nameof(OmContact.ContactAddress1) }, + { nameof(KX12M.OmContact.ContactCity), nameof(OmContact.ContactCity) }, + { nameof(KX12M.OmContact.ContactZip), nameof(OmContact.ContactZip) }, + { nameof(KX12M.OmContact.ContactStateId), nameof(OmContact.ContactStateId) }, + { nameof(KX12M.OmContact.ContactCountryId), nameof(OmContact.ContactCountryId) }, + { nameof(KX12M.OmContact.ContactMobilePhone), nameof(OmContact.ContactMobilePhone) }, + { nameof(KX12M.OmContact.ContactBusinessPhone), nameof(OmContact.ContactBusinessPhone) }, + { nameof(KX12M.OmContact.ContactEmail), nameof(OmContact.ContactEmail) }, + // No support 2022-07-07 { nameof(OmContact.ContactBirthday), nameof(KXO.Models.OmContact.ContactBirthday) }, + { nameof(KX12M.OmContact.ContactGender), nameof(OmContact.ContactGender) }, + // { nameof(OmContact.ContactStatusId), nameof(KXO.Models.OmContact.ContactStatusId) }, // No support 2022-07-07 but needs to be mapped because of constraint + { nameof(KX12M.OmContact.ContactNotes), nameof(OmContact.ContactNotes) }, + { nameof(KX12M.OmContact.ContactOwnerUserId), nameof(OmContact.ContactOwnerUserId) }, + // No support 2022-07-07 { nameof(OmContact.ContactMonitored), nameof(KXO.Models.OmContact.ContactMonitored) }, + { nameof(KX12M.OmContact.ContactGuid), nameof(OmContact.ContactGuid) }, + { nameof(KX12M.OmContact.ContactLastModified), nameof(OmContact.ContactLastModified) }, + { nameof(KX12M.OmContact.ContactCreated), nameof(OmContact.ContactCreated) }, + // No support 2022-07-07 { nameof(OmContact.ContactBounces), nameof(KXO.Models.OmContact.ContactBounces) }, + { nameof(KX12M.OmContact.ContactCampaign), nameof(OmContact.ContactCampaign) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadId), nameof(KXO.Models.OmContact.ContactSalesForceLeadId) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDisabled), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDisabled) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDateTime) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationSuspensionDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationSuspensionDateTime) }, + { nameof(KX12M.OmContact.ContactCompanyName), nameof(OmContact.ContactCompanyName) } + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationRequired), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationRequired) }, + }; + + foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ContactInfo.TYPEINFO.ObjectClassName)) + { + requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); + } + + if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Contact")) + { + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Contact")); + logger.LogError("Data must not exist in target instance table, remove data before proceeding"); + return new CommandFailureResult(); + } + + if (bulkDataCopyService.CheckForTableColumnsDifferences("OM_Contact", requiredColumnsForContactMigration, out var differences)) + { + protocol.Append(HandbookReferences + .BulkCopyColumnMismatch("OM_Contact") + .NeedsManualAction() + .WithData(differences) + ); + logger.LogError("Table {TableName} columns do not match, fix columns before proceeding", "OM_Contact"); + { + return new CommandFailureResult(); + } + } + + primaryKeyMappingContext.PreloadDependencies(u => u.UserId); + primaryKeyMappingContext.PreloadDependencies(u => u.StateId); + primaryKeyMappingContext.PreloadDependencies(u => u.CountryId); + + var bulkCopyRequest = new BulkCopyRequest("OM_Contact", + s => true, // s => s != "ContactID", + _ => true, + 50000, + requiredColumnsForContactMigration.Keys.ToList(), + ContactValueInterceptor, + current => logger.LogError("Contact skipped due error, contact: {Contact}", PrintHelper.PrintDictionary(current)), + "ContactID" + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + try + { + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to migrate contacts"); + return new CommandFailureResult(); + } + + return null; + } + + private ValueInterceptorResult ContactValueInterceptor(int ordinal, string columnName, object value, Dictionary currentRow) + { + if (columnName.Equals(nameof(OmContact.ContactCompanyName), StringComparison.InvariantCultureIgnoreCase)) + { + // autofix removed in favor of error report and data consistency + // var truncatedValue = SqlDataTypeHelper.TruncateString(value, 100); + // return new ValueInterceptorResult(truncatedValue, true, false); + + if (value is string { Length: > 100 } s) + { + protocol.Append(HandbookReferences.ValueTruncationSkip("OM_Contact") + .WithData(new + { + value, + maxLength = 100, + s.Length, + columnName, + contact = PrintHelper.PrintDictionary(currentRow) + }) + ); + return ValueInterceptorResult.SkipRow; + } + } + + if (columnName.Equals(nameof(OmContact.ContactOwnerUserId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceUserId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.UserId, sourceUserId)) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + // try search member + if (keyMappingContext.MapSourceKey( + s => s.UserId, + s => s.UserGuid, + sourceUserId, + t => t.MemberId, + t => t.MemberGuid + ) is { Success: true, Mapped: { } memberId }) + { + return ValueInterceptorResult.ReplaceValue(memberId); + } + + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + if (columnName.Equals(nameof(OmContact.ContactStateId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceStateId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.StateId, sourceStateId.NullIfZero())) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + if (columnName.Equals(nameof(OmContact.ContactCountryId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceCountryId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.CountryId, sourceCountryId.NullIfZero())) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + + return ValueInterceptorResult.DoNothing; + } + + #endregion + + #region "Migrate contact activities" + + private CommandResult? MigrateContactActivities() + { + var requiredColumnsForContactMigration = new Dictionary + { + { nameof(KX12M.OmActivity.ActivityId), nameof(OmActivity.ActivityId) }, + { nameof(KX12M.OmActivity.ActivityContactId), nameof(OmActivity.ActivityContactId) }, + { nameof(KX12M.OmActivity.ActivityCreated), nameof(OmActivity.ActivityCreated) }, + { nameof(KX12M.OmActivity.ActivityType), nameof(OmActivity.ActivityType) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityItemId), nameof(KXO.Models.OmActivity.ActivityItemId) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityItemDetailId), nameof(KXO.Models.OmActivity.ActivityItemDetailId) }, + { nameof(KX12M.OmActivity.ActivityValue), nameof(OmActivity.ActivityValue) }, + { nameof(KX12M.OmActivity.ActivityUrl), nameof(OmActivity.ActivityUrl) }, + { nameof(KX12M.OmActivity.ActivityTitle), nameof(OmActivity.ActivityTitle) }, + { nameof(KX12M.OmActivity.ActivitySiteId), nameof(OmActivity.ActivityChannelId) }, + { nameof(KX12M.OmActivity.ActivityComment), nameof(OmActivity.ActivityComment) }, + // { nameof(OmActivity.ActivityCampaign), nameof(KXP.Models.OmActivity.ActivityCampaign) }, // deprecated without replacement in v27 + { nameof(KX12M.OmActivity.ActivityUrlreferrer), nameof(OmActivity.ActivityUrlreferrer) }, + { nameof(KX12M.OmActivity.ActivityCulture), nameof(OmActivity.ActivityLanguageId) }, + { nameof(KX12M.OmActivity.ActivityNodeId), nameof(OmActivity.ActivityWebPageItemGuid) }, + { nameof(KX12M.OmActivity.ActivityUtmsource), nameof(OmActivity.ActivityUtmsource) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityAbvariantName), nameof(KXO.Models.OmActivity.ActivityAbvariantName) }, + // OBSOLETE 26.0.0: { nameof(OmActivity.ActivityUrlhash), nameof(KXP.Models.OmActivity.ActivityUrlhash) }, + { nameof(KX12M.OmActivity.ActivityUtmcontent), nameof(OmActivity.ActivityUtmcontent) } + }; + + foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ActivityInfo.TYPEINFO.ObjectClassName)) + { + requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); + } + + if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Activity")) + { + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Activity")); + logger.LogError("Data must not exist in target instance table, remove data before proceeding"); + return new CommandFailureResult(); + } + + // _primaryKeyMappingContext.PreloadDependencies(u => u.NodeId); + // no need to preload contact, ID should stay same + // _primaryKeyMappingContext.PreloadDependencies(u => u.ContactId); + + var bulkCopyRequest = new BulkCopyRequestExtended("OM_Activity", + s => true, + reader => true, + 50000, + requiredColumnsForContactMigration, + ActivityValueInterceptor, + current => logger.LogError("Contact activity skipped due error, activity: {Activity}", PrintHelper.PrintDictionary(current)), + "ActivityID" + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + + try + { + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to migrate activities"); + return new CommandFailureResult(); + } + + return null; + } + + private ValueInterceptorResult ActivityValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow) + { + if (columnName.Equals(nameof(KX12M.OmActivity.ActivitySiteId), StringComparison.InvariantCultureIgnoreCase) && + value is int sourceActivitySiteId) + { + var result = keyMappingContext.MapSourceKey( + s => s.SiteId, + s => s.SiteGuid, + sourceActivitySiteId.NullIfZero(), + t => t.ChannelId, + t => t.ChannelGuid + ); + switch (result) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id ?? 0); + case { Success: false }: + { + switch (toolConfiguration.UseOmActivitySiteRelationAutofix ?? AutofixEnum.Error) + { + case AutofixEnum.DiscardData: + logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => discard data", sourceActivitySiteId); + return ValueInterceptorResult.SkipRow; + case AutofixEnum.AttemptFix: + logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => ActivityNodeId=0", sourceActivitySiteId); + return ValueInterceptorResult.ReplaceValue(0); + case AutofixEnum.Error: + default: //error + protocol.Append(HandbookReferences + .MissingRequiredDependency(columnName, value) + .WithData(currentRow) + ); + return ValueInterceptorResult.SkipRow; + } + } + + default: + break; + } + } + + if (columnName.Equals(nameof(KX12M.OmActivity.ActivityNodeId), StringComparison.InvariantCultureIgnoreCase) && value is int activityNodeId) + { + if (currentRow.TryGetValue(nameof(KX12M.OmActivity.ActivitySiteId), out object? mSiteId) && mSiteId is int siteId) + { + if (spoiledGuidContext.GetNodeGuid(siteId, activityNodeId) is { } nodeGuid) + { + return ValueInterceptorResult.ReplaceValue(nodeGuid); + } + } + + switch (toolConfiguration.UseOmActivityNodeRelationAutofix ?? AutofixEnum.Error) + { + case AutofixEnum.DiscardData: + logger.LogTrace("Autofix (ActivitySiteId={NodeId} not exists) => discard data", activityNodeId); + return ValueInterceptorResult.SkipRow; + case AutofixEnum.AttemptFix: + logger.LogTrace("Autofix (ActivityNodeId={NodeId} not exists) => ActivityNodeId=0", activityNodeId); + return ValueInterceptorResult.ReplaceValue(null); + case AutofixEnum.Error: + default: //error + protocol.Append(HandbookReferences + .MissingRequiredDependency(columnName, value) + .WithData(currentRow) + ); + return ValueInterceptorResult.SkipRow; + } + } + + if (columnName.Equals(nameof(OmActivity.ActivityLanguageId), StringComparison.InvariantCultureIgnoreCase) && value is string cultureCode) + { + return ValueInterceptorResult.ReplaceValue(ContentLanguageInfoProvider.ProviderObject.Get(cultureCode)?.ContentLanguageID); + } + + return ValueInterceptorResult.DoNothing; + } + + #endregion +} diff --git a/Migration.Tool.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs b/Migration.Tool.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs new file mode 100644 index 00000000..2a2a0e38 --- /dev/null +++ b/Migration.Tool.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs @@ -0,0 +1,281 @@ +using CMS.DataProtection; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KX12.Context; +using Migration.Tool.KXP.Context; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX12.Handlers; + +public class MigrateDataProtectionCommandHandler : IRequestHandler, IDisposable +{ + private static readonly int batchSize = 1000; + private readonly IEntityMapper consentAgreementMapper; + private readonly IEntityMapper consentArchiveMapper; + private readonly IEntityMapper consentMapper; + private readonly IDbContextFactory kx12ContextFactory; + private readonly IDbContextFactory kxpContextFactory; + private readonly ILogger logger; + private readonly PrimaryKeyMappingContext primaryKeyMappingContext; + private readonly IProtocol protocol; + + private KxpContext kxpContext; + + public MigrateDataProtectionCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory kx12ContextFactory, + IEntityMapper consentMapper, + IEntityMapper consentArchiveMapper, + IEntityMapper consentAgreementMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) + { + this.logger = logger; + this.kxpContextFactory = kxpContextFactory; + this.kx12ContextFactory = kx12ContextFactory; + this.consentMapper = consentMapper; + this.consentArchiveMapper = consentArchiveMapper; + this.consentAgreementMapper = consentAgreementMapper; + this.primaryKeyMappingContext = primaryKeyMappingContext; + this.protocol = protocol; + kxpContext = this.kxpContextFactory.CreateDbContext(); + } + + public void Dispose() => kxpContext.Dispose(); + + public async Task Handle(MigrateDataProtectionCommand request, CancellationToken cancellationToken) + { + await MigrateConsent(cancellationToken); + await MigrateConsentArchive(cancellationToken); + await MigrateConsentAgreement(cancellationToken, batchSize); + + return new GenericCommandResult(); + } + + private async Task MigrateConsent(CancellationToken cancellationToken) + { + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + + foreach (var k12Consent in kx12Context.CmsConsents) + { + protocol.FetchedSource(k12Consent); + logger.LogTrace("Migrating consent {ConsentName} with ConsentGuid {ConsentGuid}", k12Consent.ConsentName, k12Consent.ConsentGuid); + + var kxoConsent = await kxpContext.CmsConsents.FirstOrDefaultAsync(consent => consent.ConsentGuid == k12Consent.ConsentGuid, cancellationToken); + protocol.FetchedTarget(kxoConsent); + + var mapped = consentMapper.Map(k12Consent, kxoConsent); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsent, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsent, nameof(cmsConsent)); + + if (newInstance) + { + kxpContext.CmsConsents.Add(cmsConsent); + } + else + { + kxpContext.CmsConsents.Update(cmsConsent); + } + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + protocol.Success(k12Consent, cmsConsent, mapped); + logger.LogEntitySetAction(newInstance, cmsConsent); + primaryKeyMappingContext.SetMapping(r => r.ConsentId, k12Consent.ConsentId, cmsConsent.ConsentId); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, k12Consent); + protocol.Append(HandbookReferences + .DbConstraintBroken(sqlException, k12Consent) + .WithMessage("Failed to migrate consent, target database constraint broken.") + ); + + await kxpContext.DisposeAsync(); + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + } + } + + return new GenericCommandResult(); + } + + private async Task MigrateConsentArchive(CancellationToken cancellationToken) + { + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + + foreach (var k12ArchiveConsent in kx12Context.CmsConsentArchives) + { + protocol.FetchedSource(k12ArchiveConsent); + logger.LogTrace("Migrating consent archive with ConsentArchiveGuid {ConsentGuid}", k12ArchiveConsent.ConsentArchiveGuid); + + var kxoConsentArchive = await kxpContext.CmsConsentArchives.FirstOrDefaultAsync(consentArchive => consentArchive.ConsentArchiveGuid == k12ArchiveConsent.ConsentArchiveGuid, cancellationToken); + protocol.FetchedTarget(kxoConsentArchive); + + var mapped = consentArchiveMapper.Map(k12ArchiveConsent, kxoConsentArchive); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsentArchive, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsentArchive, nameof(cmsConsentArchive)); + + if (newInstance) + { + kxpContext.CmsConsentArchives.Add(cmsConsentArchive); + } + else + { + kxpContext.CmsConsentArchives.Update(cmsConsentArchive); + } + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + protocol.Success(k12ArchiveConsent, cmsConsentArchive, mapped); + logger.LogEntitySetAction(newInstance, cmsConsentArchive); + primaryKeyMappingContext.SetMapping(r => r.ConsentArchiveGuid, + k12ArchiveConsent.ConsentArchiveId, cmsConsentArchive.ConsentArchiveId); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, k12ArchiveConsent); + protocol.Append(HandbookReferences + .DbConstraintBroken(sqlException, k12ArchiveConsent) + .WithMessage("Failed to migrate consent archive, target database constraint broken.") + ); + + await kxpContext.DisposeAsync(); + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + } + } + + return new GenericCommandResult(); + } + + private async Task MigrateConsentAgreement(CancellationToken cancellationToken, int batchSize) + { + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + int index = 0; + int indexFull = 0; + var consentAgreementUpdates = new List(); + var consentAgreementNews = new List(); + int itemsCount = kx12Context.CmsConsentAgreements.Count(); + + foreach (var k12ConsentAgreement in kx12Context.CmsConsentAgreements) + { + protocol.FetchedSource(k12ConsentAgreement); + logger.LogTrace("Migrating consent agreement with ConsentAgreementGuid {ConsentAgreementGuid}", k12ConsentAgreement.ConsentAgreementGuid); + + var kxoConsentAgreement = await kxpContext.CmsConsentAgreements.FirstOrDefaultAsync(consentAgreement => consentAgreement.ConsentAgreementGuid == k12ConsentAgreement.ConsentAgreementGuid, cancellationToken); + protocol.FetchedTarget(kxoConsentAgreement); + + var mapped = consentAgreementMapper.Map(k12ConsentAgreement, kxoConsentAgreement); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsentAgreement, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsentAgreement, nameof(cmsConsentAgreement)); + + if (newInstance) + { + consentAgreementNews.Add(cmsConsentAgreement); + } + else + { + consentAgreementUpdates.Add(cmsConsentAgreement); + } + } + + index++; + indexFull++; + + if (index == batchSize || indexFull == itemsCount) + { + kxpContext.CmsConsentAgreements.AddRange(consentAgreementNews); + kxpContext.CmsConsentAgreements.UpdateRange(consentAgreementUpdates); + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + foreach (var newK12ConsentAgreement in consentAgreementNews) + { + protocol.Success(k12ConsentAgreement, newK12ConsentAgreement, mapped); + logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was inserted", + newK12ConsentAgreement.ConsentAgreementGuid); + } + + foreach (var updateK12ConsentAgreement in consentAgreementUpdates) + { + protocol.Success(k12ConsentAgreement, updateK12ConsentAgreement, mapped); + logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was updated", + updateK12ConsentAgreement.ConsentAgreementGuid); + } + } + catch (DbUpdateException dbUpdateException) when ( + dbUpdateException.InnerException is SqlException sqlException && + sqlException.Message.Contains("Cannot insert duplicate key row in object") + ) + { + await kxpContext.DisposeAsync(); + + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrints(consentAgreementNews) + ); + logger.LogEntitiesSetError(dbUpdateException, true, consentAgreementNews); + + + protocol.Append(HandbookReferences + .ErrorUpdatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrints(consentAgreementUpdates) + ); + + var cai = ConsentAgreementInfo.New(); + protocol.Append(HandbookReferences + .ErrorUpdatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrint(cai) + ); + + logger.LogEntitiesSetError(dbUpdateException, false, consentAgreementUpdates); + + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + finally + { + index = 0; + consentAgreementUpdates = []; + consentAgreementNews = []; + } + } + } + + return new GenericCommandResult(); + } +} diff --git a/Migration.Tool.Core.KX12/Handlers/MigrateMembersCommandHandler.cs b/Migration.Tool.Core.KX12/Handlers/MigrateMembersCommandHandler.cs new file mode 100644 index 00000000..11dd6930 --- /dev/null +++ b/Migration.Tool.Core.KX12/Handlers/MigrateMembersCommandHandler.cs @@ -0,0 +1,111 @@ +using System.Diagnostics; + +using CMS.Membership; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.Core.KX12.Mappers; +using Migration.Tool.KX12.Context; +using Migration.Tool.KXP.Api.Enums; + +namespace Migration.Tool.Core.KX12.Handlers; + +public class MigrateMembersCommandHandler( + ILogger logger, + IDbContextFactory kx12ContextFactory, + IEntityMapper memberInfoMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private const string USER_PUBLIC = "public"; + + public void Dispose() + { + } + + public async Task Handle(MigrateMembersCommand request, CancellationToken cancellationToken) + { + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + + var k12CmsUsers = kx12Context.CmsUsers + .Include(u => u.CmsUserSettingUserSettingsUserNavigation) + .Where(u => u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.None) + ; + + foreach (var k12User in k12CmsUsers) + { + protocol.FetchedSource(k12User); + logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid} to member", k12User.UserName, k12User.UserGuid); + + var xbkMemberInfo = MemberInfoProvider.ProviderObject.Get(k12User.UserGuid); + + protocol.FetchedTarget(xbkMemberInfo); + + // no member shall be admin, editor + Debug.Assert(k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin, "k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin"); + Debug.Assert(k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin, "k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin"); + Debug.Assert(k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor, "k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor"); + + if (xbkMemberInfo?.MemberName == USER_PUBLIC || k12User.UserName == USER_PUBLIC) + { + continue; + } + + var mapped = memberInfoMapper.Map(new MemberInfoMapperSource(k12User, k12User.CmsUserSettingUserSettingsUserNavigation), xbkMemberInfo); + protocol.MappedTarget(mapped); + + SaveUserUsingKenticoApi(mapped, k12User); + } + + return new GenericCommandResult(); + } + + private void SaveUserUsingKenticoApi(IModelMappingResult mapped, KX12M.CmsUser k12User) + { + if (mapped is { Success: true } result) + { + (var memberInfo, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(memberInfo); + + try + { + MemberInfoProvider.ProviderObject.Set(memberInfo); + + protocol.Success(k12User, memberInfo, mapped); + logger.LogEntitySetAction(newInstance, memberInfo); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, memberInfo); + protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k12User) + .WithData(new { k12User.UserName, k12User.UserGuid, k12User.UserId }) + .WithMessage("Failed to migrate user, target database broken.") + ); + return; + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, memberInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(memberInfo) + ); + return; + } + + // left for OM_Activity + primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, memberInfo.MemberID); + } + } +} diff --git a/Migration.Tool.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs b/Migration.Tool.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs new file mode 100644 index 00000000..6a7dfd38 --- /dev/null +++ b/Migration.Tool.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs @@ -0,0 +1,84 @@ +using CMS.DataEngine; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KX12.Context; + +namespace Migration.Tool.Core.KX12.Handlers; + +public class MigrateSettingKeysCommandHandler( + ILogger logger, + IEntityMapper mapper, + IDbContextFactory kx12ContextFactory, + ToolConfiguration toolConfiguration, + IProtocol protocol) + : IRequestHandler +{ + public async Task Handle(MigrateSettingKeysCommand request, CancellationToken cancellationToken) + { + var entityConfiguration = toolConfiguration.EntityConfigurations.GetEntityConfiguration(); + + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + + logger.LogInformation("CmsSettingsKey synchronization starting"); + var cmsSettingsKeys = kx12Context.CmsSettingsKeys + .Where(csk => csk.SiteId == null) + .AsNoTrackingWithIdentityResolution() + ; + + foreach (var k12CmsSettingsKey in cmsSettingsKeys) + { + protocol.FetchedSource(k12CmsSettingsKey); + + var kxoGlobalSettingsKey = GetKxoSettingsKey(k12CmsSettingsKey); + + bool canBeMigrated = !kxoGlobalSettingsKey?.KeyIsHidden ?? false; + var kxoCmsSettingsKey = k12CmsSettingsKey.SiteId is null ? kxoGlobalSettingsKey : GetKxoSettingsKey(k12CmsSettingsKey); + + if (!canBeMigrated) + { + logger.LogInformation("Setting with key '{KeyName}' is currently not supported for migration", k12CmsSettingsKey.KeyName); + protocol.Append( + HandbookReferences + .NotCurrentlySupportedSkip() + .WithId(nameof(k12CmsSettingsKey.KeyId), k12CmsSettingsKey.KeyId) + .WithMessage("Settings key is not supported in target instance") + .WithData(new { k12CmsSettingsKey.KeyName, k12CmsSettingsKey.SiteId, k12CmsSettingsKey.KeyGuid }) + ); + continue; + } + + protocol.FetchedTarget(kxoCmsSettingsKey); + + if (entityConfiguration.ExcludeCodeNames.Contains(k12CmsSettingsKey.KeyName)) + { + protocol.Warning(HandbookReferences.CmsSettingsKeyExclusionListSkip, k12CmsSettingsKey); + logger.LogWarning("KeyName {KeyName} is excluded => skipping", k12CmsSettingsKey.KeyName); + continue; + } + + var mapped = mapper.Map(k12CmsSettingsKey, kxoCmsSettingsKey); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + ArgumentNullException.ThrowIfNull(result.Item, nameof(result.Item)); + + SettingsKeyInfoProvider.ProviderObject.Set(result.Item); + + protocol.Success(k12CmsSettingsKey, kxoCmsSettingsKey, mapped); + logger.LogEntitySetAction(result.NewInstance, result.Item); + } + } + + return new GenericCommandResult(); + } + + private SettingsKeyInfo? GetKxoSettingsKey(KX12M.CmsSettingsKey k12CmsSettingsKey) => SettingsKeyInfoProvider.ProviderObject.Get(k12CmsSettingsKey.KeyName); +} diff --git a/Migration.Tool.Core.KX12/Handlers/MigrateSitesCommandHandler.cs b/Migration.Tool.Core.KX12/Handlers/MigrateSitesCommandHandler.cs new file mode 100644 index 00000000..161c70fc --- /dev/null +++ b/Migration.Tool.Core.KX12/Handlers/MigrateSitesCommandHandler.cs @@ -0,0 +1,190 @@ +using CMS.ContentEngine; +using CMS.Websites; + +using Kentico.Xperience.UMT.Model; +using Kentico.Xperience.UMT.Services; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Helpers; +using Migration.Tool.KX12; +using Migration.Tool.KX12.Context; + +namespace Migration.Tool.Core.KX12.Handlers; + +// ReSharper disable once UnusedType.Global +public class MigrateSitesCommandHandler( + ILogger logger, + IDbContextFactory kx12ContextFactory, + IProtocol protocol, + IImporter importer) + : IRequestHandler +{ + public async Task Handle(MigrateSitesCommand request, CancellationToken cancellationToken) + { + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + var migratedCultureCodes = new Dictionary(StringComparer.CurrentCultureIgnoreCase); + foreach (var kx12CmsSite in kx12Context.CmsSites.Include(s => s.Cultures)) + { + protocol.FetchedSource(kx12CmsSite); + logger.LogTrace("Migrating site {SiteName} with SiteGuid {SiteGuid}", kx12CmsSite.SiteName, kx12CmsSite.SiteGuid); + + string defaultCultureCode = GetSiteCulture(kx12CmsSite); + var migratedSiteCultures = kx12CmsSite.Cultures.ToList(); + if (!migratedSiteCultures.Any(x => x.CultureCode.Equals(defaultCultureCode, StringComparison.InvariantCultureIgnoreCase))) + { + await using var ctx = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + if (ctx.CmsCultures.FirstOrDefault(c => c.CultureCode == defaultCultureCode) is { } defaultCulture) + { + migratedSiteCultures.Add(defaultCulture); + } + } + + foreach (var cmsCulture in migratedSiteCultures) + { + var existing = ContentLanguageInfoProvider.ProviderObject.Get() + .WhereEquals(nameof(ContentLanguageInfo.ContentLanguageCultureFormat), cmsCulture.CultureCode) + .FirstOrDefault(); + + if (existing != null && existing.ContentLanguageGUID != cmsCulture.CultureGuid) + { + existing.ContentLanguageGUID = cmsCulture.CultureGuid; + existing.Update(); + } + + if (migratedCultureCodes.ContainsKey(cmsCulture.CultureCode)) + { + continue; + } + + var langResult = await importer.ImportAsync(new ContentLanguageModel + { + ContentLanguageGUID = cmsCulture.CultureGuid, + ContentLanguageDisplayName = cmsCulture.CultureName, + ContentLanguageName = cmsCulture.CultureCode, + ContentLanguageIsDefault = true, + ContentLanguageFallbackContentLanguageGuid = null, + ContentLanguageCultureFormat = cmsCulture.CultureCode + }); + + if (langResult is { Success: true, Imported: ContentLanguageInfo importedLanguage }) + { + migratedCultureCodes.TryAdd(cmsCulture.CultureCode, importedLanguage); + logger.LogTrace("Imported language {Language} from {Culture}", importedLanguage.ContentLanguageName, cmsCulture.CultureCode); + } + } + + // var homePageNodeAliasPath = KenticoHelper.GetSettingsKey(_kx12ContextFactory, kx12CmsSite.SiteId, SettingsKeys.CMSDefaultAliasPath); + int? cookieLevel = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, SettingsKeys.CMSDefaultCookieLevel) switch + { + "all" => CookieLevelConstants.ALL, + "visitor" => CookieLevelConstants.VISITOR, + "editor" => CookieLevelConstants.EDITOR, + "system" => CookieLevelConstants.SYSTEM, + "essential" => CookieLevelConstants.ESSENTIAL, + _ => null + }; + bool? storeFormerUrls = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSStoreFormerUrls") is string storeFormerUrlsStr + ? bool.TryParse(storeFormerUrlsStr, out bool sfu) ? sfu : null + : true; + + var channelResult = await importer.ImportAsync(new ChannelModel { ChannelDisplayName = kx12CmsSite.SiteDisplayName, ChannelName = kx12CmsSite.SiteName, ChannelGUID = kx12CmsSite.SiteGuid, ChannelType = ChannelType.Website }); + + var webSiteChannelResult = await importer.ImportAsync(new WebsiteChannelModel + { + WebsiteChannelGUID = kx12CmsSite.SiteGuid, + WebsiteChannelChannelGuid = kx12CmsSite.SiteGuid, + WebsiteChannelDomain = kx12CmsSite.SiteDomainName, + // WebsiteChannelHomePage = homePageNodeAliasPath, + WebsiteChannelPrimaryContentLanguageGuid = migratedCultureCodes[defaultCultureCode].ContentLanguageGUID, + WebsiteChannelDefaultCookieLevel = cookieLevel, + WebsiteChannelStoreFormerUrls = storeFormerUrls + }); + + if (!webSiteChannelResult.Success) + { + if (webSiteChannelResult.ModelValidationResults != null) + { + foreach (var mvr in webSiteChannelResult.ModelValidationResults) + { + logger.LogError("Invalid channel properties {Members}: {ErrorMessage}", string.Join(", ", mvr.MemberNames), mvr.ErrorMessage); + } + } + else + { + logger.LogError(webSiteChannelResult.Exception, "Failed to migrate site"); + } + + return new CommandFailureResult(); + } + + if (webSiteChannelResult.Imported is WebsiteChannelInfo webSiteChannel) + { + string? cmsReCaptchaPublicKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSReCaptchaPublicKey"); + string? cmsReCaptchaPrivateKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSReCaptchaPrivateKey"); + + WebsiteCaptchaSettingsInfo? reCaptchaSettings = null; + string? cmsReCaptchaV3PrivateKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSReCaptchaV3PrivateKey"); + string? cmsRecaptchaV3PublicKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSRecaptchaV3PublicKey"); + double? cmsRecaptchaV3Threshold = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSRecaptchaV3Threshold"); + + if (!string.IsNullOrWhiteSpace(cmsReCaptchaV3PrivateKey) || !string.IsNullOrWhiteSpace(cmsRecaptchaV3PublicKey)) + { + reCaptchaSettings = new WebsiteCaptchaSettingsInfo + { + WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, + WebsiteCaptchaSettingsReCaptchaSiteKey = cmsRecaptchaV3PublicKey, + WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaV3PrivateKey, + WebsiteCaptchaSettingsReCaptchaThreshold = cmsRecaptchaV3Threshold ?? 0.5d, + WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV3 + }; + } + + if (!string.IsNullOrWhiteSpace(cmsReCaptchaPublicKey) || !string.IsNullOrWhiteSpace(cmsReCaptchaPrivateKey)) + { + if (reCaptchaSettings is not null) + { + logger.LogError(""" + Conflicting settings found, ReCaptchaV2 and ReCaptchaV3 is set simultaneously. + Remove setting keys 'CMSReCaptchaPublicKey', 'CMSReCaptchaPrivateKey' + or remove setting keys 'CMSReCaptchaV3PrivateKey', 'CMSRecaptchaV3PublicKey', 'CMSRecaptchaV3Threshold'. + """); + throw new InvalidOperationException("Invalid ReCaptcha settings"); + } + + reCaptchaSettings = new WebsiteCaptchaSettingsInfo + { + WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, + WebsiteCaptchaSettingsReCaptchaSiteKey = cmsReCaptchaPublicKey, + WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaPrivateKey, + WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV2 + }; + } + + if (reCaptchaSettings != null) + { + WebsiteCaptchaSettingsInfo.Provider.Set(reCaptchaSettings); + } + } + } + + return new GenericCommandResult(); + } + + private string GetSiteCulture(KX12M.CmsSite site) + { + // simplified logic from CMS.DocumentEngine.DefaultPreferredCultureEvaluator.Evaluate() + // domain alias skipped, HttpContext logic skipped + string? siteCulture = site.SiteDefaultVisitorCulture.NullIf(string.Empty) + ?? KenticoHelper.GetSettingsKey(kx12ContextFactory, site.SiteId, SettingsKeys.CMSDefaultCultureCode); + + return siteCulture + ?? throw new InvalidOperationException("Unknown site culture"); + } +} diff --git a/Migration.Tool.Core.KX12/Handlers/MigrateUsersCommandHandler.cs b/Migration.Tool.Core.KX12/Handlers/MigrateUsersCommandHandler.cs new file mode 100644 index 00000000..682a8949 --- /dev/null +++ b/Migration.Tool.Core.KX12/Handlers/MigrateUsersCommandHandler.cs @@ -0,0 +1,234 @@ +using CMS.Membership; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KX12.Context; +using Migration.Tool.KXP.Api.Enums; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX12.Handlers; + +public class MigrateUsersCommandHandler( + ILogger logger, + IDbContextFactory kx12ContextFactory, + IEntityMapper userInfoMapper, + IEntityMapper roleMapper, + IEntityMapper userRoleMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private const string USER_PUBLIC = "public"; + + public void Dispose() + { + } + + public async Task Handle(MigrateUsersCommand request, CancellationToken cancellationToken) + { + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + + var k12CmsUsers = kx12Context.CmsUsers + .Where(u => u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) + ; + + foreach (var k12User in k12CmsUsers) + { + protocol.FetchedSource(k12User); + logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid}", k12User.UserName, k12User.UserGuid); + + var xbkUserInfo = UserInfoProvider.ProviderObject.Get(k12User.UserGuid); + + protocol.FetchedTarget(xbkUserInfo); + + if (k12User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin && xbkUserInfo != null) + { + protocol.Append(HandbookReferences.CmsUserAdminUserSkip.WithIdentityPrint(xbkUserInfo)); + logger.LogInformation("User with guid {UserGuid} is administrator, you need to update administrators manually => skipping", k12User.UserGuid); + primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, xbkUserInfo.UserID); + continue; + } + + if (xbkUserInfo?.UserName == USER_PUBLIC || k12User.UserName == USER_PUBLIC) + { + protocol.Append(HandbookReferences.CmsUserPublicUserSkip.WithIdentityPrint(xbkUserInfo)); + logger.LogInformation("User with guid {UserGuid} is public user, special case that can't be migrated => skipping", xbkUserInfo?.UserGUID ?? k12User.UserGuid); + if (xbkUserInfo != null) + { + primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, xbkUserInfo.UserID); + } + + continue; + } + + var mapped = userInfoMapper.Map(k12User, xbkUserInfo); + protocol.MappedTarget(mapped); + + SaveUserUsingKenticoApi(mapped, k12User); + } + + await MigrateUserCmsRoles(kx12Context, cancellationToken); + + return new GenericCommandResult(); + } + + private void SaveUserUsingKenticoApi(IModelMappingResult mapped, KX12M.CmsUser k12User) + { + if (mapped is { Success: true } result) + { + (var userInfo, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(userInfo); + + try + { + UserInfoProvider.ProviderObject.Set(userInfo); + + protocol.Success(k12User, userInfo, mapped); + logger.LogEntitySetAction(newInstance, userInfo); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, userInfo); + protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k12User) + .WithData(new { k12User.UserName, k12User.UserGuid, k12User.UserId }) + .WithMessage("Failed to migrate user, target database broken.") + ); + return; + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, userInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(userInfo) + ); + return; + } + + primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, userInfo.UserID); + } + } + + private async Task MigrateUserCmsRoles(KX12Context kx12Context, CancellationToken cancellationToken) + { + var k12CmsRoles = kx12Context.CmsRoles + .Where(r => + r.CmsUserRoles.Any(ur => ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) + ) + .AsNoTracking() + .AsAsyncEnumerable(); + + await foreach (var k12CmsRole in k12CmsRoles.WithCancellation(cancellationToken)) + { + protocol.FetchedSource(k12CmsRole); + + var xbkRoleInfo = RoleInfoProvider.ProviderObject.Get(k12CmsRole.RoleGuid); + protocol.FetchedTarget(xbkRoleInfo); + var mapped = roleMapper.Map(k12CmsRole, xbkRoleInfo); + protocol.MappedTarget(mapped); + + if (mapped is not (var roleInfo, var newInstance) { Success: true }) + { + continue; + } + + ArgumentNullException.ThrowIfNull(roleInfo, nameof(roleInfo)); + try + { + RoleInfoProvider.ProviderObject.Set(roleInfo); + + protocol.Success(k12CmsRole, roleInfo, mapped); + logger.LogEntitySetAction(newInstance, roleInfo); + + primaryKeyMappingContext.SetMapping( + r => r.RoleId, + k12CmsRole.RoleId, + roleInfo.RoleID + ); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, roleInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(roleInfo) + ); + continue; + } + + await MigrateUserRole(k12CmsRole.RoleId); + } + } + + private async Task MigrateUserRole(int k12RoleId) + { + var kx12Context = await kx12ContextFactory.CreateDbContextAsync(); + var k12UserRoles = kx12Context.CmsUserRoles + .Where(ur => + ur.RoleId == k12RoleId && ( + ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin + ) + ) + .AsNoTracking() + .AsAsyncEnumerable(); + + await foreach (var k12UserRole in k12UserRoles) + { + protocol.FetchedSource(k12UserRole); + if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.RoleId, k12RoleId, out int xbkRoleId)) + { + var handbookRef = HandbookReferences + .MissingRequiredDependency(nameof(UserRoleInfo.RoleID), k12UserRole.RoleId) + .NeedsManualAction(); + + protocol.Append(handbookRef); + logger.LogWarning("Unable to locate role in target instance with source RoleID '{RoleID}'", k12UserRole.RoleId); + continue; + } + + if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.UserId, k12UserRole.UserId, out int xbkUserId)) + { + continue; + } + + var xbkUserRole = UserRoleInfoProvider.ProviderObject.Get(xbkUserId, xbkRoleId); + protocol.FetchedTarget(xbkUserRole); + + var mapped = userRoleMapper.Map(k12UserRole, xbkUserRole); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true }) + { + (var userRoleInfo, bool newInstance) = mapped; + ArgumentNullException.ThrowIfNull(userRoleInfo); + + try + { + UserRoleInfoProvider.ProviderObject.Set(userRoleInfo); + + protocol.Success(k12UserRole, userRoleInfo, mapped); + logger.LogEntitySetAction(newInstance, userRoleInfo); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, userRoleInfo); + protocol.Append(HandbookReferences.ErrorSavingTargetInstance(ex) + .WithData(new { k12UserRole.UserRoleId, k12UserRole.UserId, k12UserRole.RoleId }) + .WithMessage("Failed to migrate user role") + ); + } + } + } + } +} diff --git a/Migration.Tool.Core.KX12/Helpers/KenticoHelper.cs b/Migration.Tool.Core.KX12/Helpers/KenticoHelper.cs new file mode 100644 index 00000000..41b68161 --- /dev/null +++ b/Migration.Tool.Core.KX12/Helpers/KenticoHelper.cs @@ -0,0 +1,46 @@ +using System.Globalization; + +using CMS.Helpers; + +using Microsoft.EntityFrameworkCore; + +using Migration.Tool.KX12.Context; + +namespace Migration.Tool.Core.KX12.Helpers; + +public static class KenticoHelper +{ + public static void CopyCustomData(ContainerCustomData target, string? sourceXml) + { + var customNodeData = new ContainerCustomData(); + customNodeData.LoadData(sourceXml); + foreach (string? columnName in customNodeData.ColumnNames) + { + target.SetValue(columnName, customNodeData.GetValue(columnName)); + } + } + + public static string? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) + { + using var kx12Context = ctxf.CreateDbContext(); + var keys = kx12Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); + + return (keys.FirstOrDefault(x => x.SiteId == siteId) + ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; + } + + public static T? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) where T : struct, IParsable + { + using var kx12Context = ctxf.CreateDbContext(); + var keys = kx12Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); + string? value = (keys.FirstOrDefault(x => x.SiteId == siteId) + ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; + + + return T.TryParse(value, CultureInfo.InvariantCulture, out var result) + ? result + : null; + } + + public static bool? TryGetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName, out T? result) where T : IParsable => T.TryParse(GetSettingsKey(ctxf, siteId, keyName), CultureInfo.InvariantCulture, out result); +} diff --git a/Migration.Tool.Core.KX12/Helpers/PrintHelper.cs b/Migration.Tool.Core.KX12/Helpers/PrintHelper.cs new file mode 100644 index 00000000..6218744d --- /dev/null +++ b/Migration.Tool.Core.KX12/Helpers/PrintHelper.cs @@ -0,0 +1,7 @@ +namespace Migration.Tool.Core.KX12.Helpers; + +public static class PrintHelper +{ + public static string PrintDictionary(Dictionary dictionary) => + string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); +} diff --git a/Migration.Tool.Core.KX12/Helpers/Printer.cs b/Migration.Tool.Core.KX12/Helpers/Printer.cs new file mode 100644 index 00000000..61a1bce6 --- /dev/null +++ b/Migration.Tool.Core.KX12/Helpers/Printer.cs @@ -0,0 +1,103 @@ +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.Globalization; +using CMS.MediaLibrary; +using CMS.Membership; +using CMS.Modules; + +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.Services; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX12.Helpers; + +public class Printer +{ + public static string PrintKxpModelInfo(T model) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + return model switch + { + MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", + MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", + CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", + CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", + CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", + CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", + CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", + CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", + OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", + + null => $"{currentTypeName}: ", + _ => $"TODO: {typeof(T).FullName}" + }; + } + + public static string GetEntityIdentityPrint(T model, bool printType = true) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + string Fallback(object obj) => printType + ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" + : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}"; + + string FormatModel(string inner) => printType + ? $"{currentTypeName}({inner})" + : $"{inner}"; + + return model switch + { + MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), + MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), + DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), + + CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), + StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), + + ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), + AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), + UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), + RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), + MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), + + CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), + CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), + CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), + + KX12M.CmsPageTemplateConfiguration item => FormatModel($"ID={item.PageTemplateConfigurationId}, GUID={item.PageTemplateConfigurationGuid}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteId}"), + KX12M.CmsRole item => FormatModel($"ID={item.RoleId}, GUID={item.RoleGuid}, Name={item.RoleName}, SiteId={item.SiteId}"), + KX12M.CmsAttachment item => FormatModel($"ID={item.AttachmentId}, GUID={item.AttachmentGuid}, Name={item.AttachmentName}"), + KX12M.CmsClass item => FormatModel($"ID={item.ClassId}, GUID={item.ClassGuid}, Name={item.ClassName}"), + KX12M.CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + KX12M.CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + KX12M.CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + KX12M.CmsCountry item => FormatModel($"ID={item.CountryId}, GUID={item.CountryGuid}, Name={item.CountryName}"), + KX12M.CmsState item => FormatModel($"ID={item.StateId}, GUID={item.StateGuid}, Name={item.StateName}"), + KX12M.CmsTree item => FormatModel($"NodeID={item.NodeId}, NodeGUID={item.NodeGuid}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), + KX12M.CmsDocument item => FormatModel($"NodeID={item.DocumentNodeId}, DocumentID={item.DocumentId}, DocumentGUID={item.DocumentGuid}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), + KX12M.CmsResource item => FormatModel($"ID={item.ResourceId}, GUID={item.ResourceGuid}, Name={item.ResourceName}"), + + null => $" ref of {currentTypeName}", + _ => Fallback(model) + }; + } + + public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); + + public static string PrintEnumValues(string separator) where TEnum : struct, Enum => string.Join(separator, Enum.GetValues()); +} + +public class PrintService : IPrintService +{ + public string PrintKxpModelInfo(T model) => Printer.PrintKxpModelInfo(model); + + public string GetEntityIdentityPrint(T model, bool printType = true) => Printer.GetEntityIdentityPrint(model, printType); + + public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => Printer.GetEntityIdentityPrints(models, separator); + + public string PrintEnumValues(string separator) where TEnum : struct, Enum => Printer.PrintEnumValues(separator); +} diff --git a/Migration.Toolkit.Core.KX12/KX12CoreDiExtensions.cs b/Migration.Tool.Core.KX12/KX12CoreDiExtensions.cs similarity index 83% rename from Migration.Toolkit.Core.KX12/KX12CoreDiExtensions.cs rename to Migration.Tool.Core.KX12/KX12CoreDiExtensions.cs index 8a1c679c..6637a1ef 100644 --- a/Migration.Toolkit.Core.KX12/KX12CoreDiExtensions.cs +++ b/Migration.Tool.Core.KX12/KX12CoreDiExtensions.cs @@ -8,23 +8,23 @@ using MediatR; using Microsoft.Extensions.DependencyInjection; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Core.KX12.Behaviors; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.Core.KX12.Helpers; -using Migration.Toolkit.Core.KX12.Mappers; -using Migration.Toolkit.Core.KX12.Services; -using Migration.Toolkit.KXP.Models; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Common.Services; +using Migration.Tool.Common.Services.BulkCopy; +using Migration.Tool.Core.KX12.Behaviors; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.Core.KX12.Helpers; +using Migration.Tool.Core.KX12.Mappers; +using Migration.Tool.Core.KX12.Services; +using Migration.Tool.KXP.Models; -namespace Migration.Toolkit.Core.KX12; +namespace Migration.Tool.Core.KX12; public static class Kx12CoreDiExtensions { - public static IServiceCollection UseKx12ToolkitCore(this IServiceCollection services) + public static IServiceCollection UseKx12ToolCore(this IServiceCollection services) { var printService = new PrintService(); services.AddSingleton(printService); diff --git a/Migration.Tool.Core.KX12/Mappers/AlternativeFormMapper.cs b/Migration.Tool.Core.KX12/Mappers/AlternativeFormMapper.cs new file mode 100644 index 00000000..781cfb31 --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/AlternativeFormMapper.cs @@ -0,0 +1,90 @@ +using CMS.DataEngine; +using CMS.FormEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KXP.Api.Services.CmsClass; + +namespace Migration.Tool.Core.KX12.Mappers; + +public record AlternativeFormMapperSource(KX12M.CmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); + +public class AlternativeFormMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, FieldMigrationService fieldMigrationService) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) + => AlternativeFormInfo.New(); + + protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (source, xbkFormClass) = sourceObj; + + target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormClassId, out int? classId) + ? classId ?? 0 + : 0; + target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormCoupledClassId, out int? coupledClassId) + ? coupledClassId ?? 0 + : 0; + + bool coupledClassIsDeprecated = + source.FormCoupledClass?.ClassName is { } coupledClassName && + K12SystemClass.NoLongerSupported.Contains(coupledClassName); + + bool classIsSysInternal = K12SystemClass.All.Contains(source.FormClass.ClassName); + + string mergedDefinition = source.FormClass.ClassFormDefinition; + if (source.FormCoupledClass != null) + { + logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", source.FormCoupledClass.ClassName, source.FormClass.ClassName); + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormCoupledClass.ClassFormDefinition); + } + + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); + + var patcher = new FormDefinitionPatcher( + logger, + mergedDefinition, + fieldMigrationService, + source.FormClass.ClassIsForm.GetValueOrDefault(false), + source.FormClass.ClassIsDocumentType, + false, + !classIsSysInternal, + true + ); + + var fieldNames = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); + + patcher.PatchFields(); + + var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); + + if (coupledClassIsDeprecated && source.FormCoupledClass != null) + { + logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", source.FormCoupledClass.ClassName); + patcher.RemoveFields(source.FormCoupledClass.ClassFormDefinition); + + var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); + } + + string result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); + + string formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); + + target.FormDefinition = formDefinitionDifference; + + target.FormDisplayName = source.FormDisplayName; + target.FormGUID = source.FormGuid; + target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); + target.FormLastModified = source.FormLastModified; + target.FormName = source.FormName; + + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/CmsAttachmentMapper.cs b/Migration.Tool.Core.KX12/Mappers/CmsAttachmentMapper.cs new file mode 100644 index 00000000..3419ab5a --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/CmsAttachmentMapper.cs @@ -0,0 +1,62 @@ +using CMS.Base; +using CMS.MediaLibrary; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.Core.KX12.Helpers; + +namespace Migration.Tool.Core.KX12.Mappers; + +public record CmsAttachmentMapperSource( + KX12M.CmsAttachment Attachment, + int TargetLibraryId, + IUploadedFile File, + string LibrarySubFolder, + KX12M.CmsDocument? AttachmentDocument); + +public class CmsAttachmentMapper : EntityMapperBase +{ + private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; + + public CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => + // library name is generated with site name in it + new(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); + + protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + (var cmsAttachment, int targetLibraryId, _, _, var attachmentDocument) = args; + + target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); + target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; + target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; + target.FileExtension = cmsAttachment.AttachmentExtension; + target.FileMimeType = cmsAttachment.AttachmentMimeType; + target.FileSize = cmsAttachment.AttachmentSize; + target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; + target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; + target.FileGUID = cmsAttachment.AttachmentGuid; + target.FileLibraryID = targetLibraryId; + + // target.FileCreatedByUserID = cmsAttachment.?; + // target.FileModifiedByUserID = cmsAttachment.?; + // target.FileCreatedWhen = cmsAttachment.?; + + target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; + + KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); + + if (attachmentDocument != null) + { + target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentDocument.DocumentNode.NodeAliasPath); + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/CmsConsentAgreementMapper.cs b/Migration.Tool.Core.KX12/Mappers/CmsConsentAgreementMapper.cs new file mode 100644 index 00000000..510b1a79 --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/CmsConsentAgreementMapper.cs @@ -0,0 +1,37 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class CmsConsentAgreementMapper : EntityMapperBase +{ + public CmsConsentAgreementMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override CmsConsentAgreement? CreateNewInstance(KX12M.CmsConsentAgreement source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsConsentAgreement MapInternal(KX12M.CmsConsentAgreement source, CmsConsentAgreement target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentAgreementGuid = source.ConsentAgreementGuid; + target.ConsentAgreementRevoked = source.ConsentAgreementRevoked; + target.ConsentAgreementConsentHash = source.ConsentAgreementConsentHash; + target.ConsentAgreementTime = source.ConsentAgreementTime; + + if (mappingHelper.TranslateRequiredId(c => c.ContactId, source.ConsentAgreementContactId, out int contactId)) + { + target.ConsentAgreementContactId = contactId; + } + + if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentAgreementConsentId, out int consentId)) + { + target.ConsentAgreementConsentId = consentId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/CmsConsentArchiveMapper.cs b/Migration.Tool.Core.KX12/Mappers/CmsConsentArchiveMapper.cs new file mode 100644 index 00000000..0b6fb2e0 --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/CmsConsentArchiveMapper.cs @@ -0,0 +1,34 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class CmsConsentArchiveMapper : EntityMapperBase +{ + public CmsConsentArchiveMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override CmsConsentArchive? CreateNewInstance(KX12M.CmsConsentArchive source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsConsentArchive MapInternal(KX12M.CmsConsentArchive source, CmsConsentArchive target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentArchiveContent = source.ConsentArchiveContent; + target.ConsentArchiveGuid = source.ConsentArchiveGuid; + target.ConsentArchiveLastModified = source.ConsentArchiveLastModified; + target.ConsentArchiveHash = source.ConsentArchiveHash; + + if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentArchiveConsentId, out int consentId)) + { + target.ConsentArchiveConsentId = consentId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/CmsConsentMapper.cs b/Migration.Tool.Core.KX12/Mappers/CmsConsentMapper.cs new file mode 100644 index 00000000..f3638416 --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/CmsConsentMapper.cs @@ -0,0 +1,83 @@ +using System.Text; +using System.Xml.Linq; +using System.Xml.XPath; + +using CMS.ContentEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class CmsConsentMapper : EntityMapperBase +{ + public CmsConsentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override CmsConsent? CreateNewInstance(KX12M.CmsConsent source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsConsent MapInternal(KX12M.CmsConsent source, CmsConsent target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentDisplayName = source.ConsentDisplayName; + var defaultContentLanguageInfo = ContentLanguageInfo.Provider.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageIsDefault), true).FirstOrDefault() ?? throw new InvalidCastException("Missing default content language"); + target.ConsentName = source.ConsentName; + target.ConsentContent = ConsentContentPatcher.PatchConsentContent(source.ConsentContent, defaultContentLanguageInfo); + target.ConsentGuid = source.ConsentGuid; + target.ConsentLastModified = source.ConsentLastModified; + target.ConsentHash = source.ConsentHash; + + return target; + } +} + +static file class ConsentContentPatcher +{ + public static string PatchConsentContent(string content, ContentLanguageInfo defaultContentLanguage) + { + if (string.IsNullOrWhiteSpace(content)) + { + return content; + } + + XDocument doc; + try + { + doc = XDocument.Parse(content); + } + catch (Exception) + { + // cannot patch xml that cannot be parsed + return content; + } + + foreach (var cultureCodeElement in doc.XPathSelectElements("//CultureCode")) + { + cultureCodeElement.Name = "LanguageName"; + if (!string.Equals(defaultContentLanguage.ContentLanguageName, cultureCodeElement.Value, StringComparison.InvariantCultureIgnoreCase)) + { + // mLogger.LogWarning($"Consent '{consentInfo.ConsentName}' has unknown content language set '{cultureCodeElement.Value}'"); + } + + // if elements are not swapped, FULLTEXT is not shown in UI + var p = cultureCodeElement.NextNode; + if (p is XElement e && e.Name == "FullText") + { + p.ReplaceWith(cultureCodeElement); + cultureCodeElement.ReplaceWith(p); + } + } + + var builder = new StringBuilder(); + using (var writer = new CMS.IO.StringWriter(builder)) + { + doc.Save(writer); + } + + return builder.ToString(); + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/CmsFormMapper.cs b/Migration.Tool.Core.KX12/Mappers/CmsFormMapper.cs new file mode 100644 index 00000000..b65bd747 --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/CmsFormMapper.cs @@ -0,0 +1,91 @@ +using CMS.FormEngine; +using CMS.OnlineForms; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class CmsFormMapper : EntityMapperBase +{ + public CmsFormMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override BizFormInfo? CreateNewInstance(KX12M.CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) + { + var newBizFormInfo = BizFormInfo.New(); + newBizFormInfo.FormGUID = source.FormGuid; + return newBizFormInfo; + } + + protected override BizFormInfo MapInternal(KX12M.CmsForm source, BizFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.FormDisplayName = source.FormDisplayName; + target.FormName = source.FormName; + target.FormItems = source.FormItems; + target.FormReportFields = source.FormReportFields; + target.FormSubmitButtonText = source.FormSubmitButtonText; + target.FormAccess = source.FormAccess.AsEnum(); + target.FormSubmitButtonImage = source.FormSubmitButtonImage; + target.FormLastModified = source.FormLastModified; + target.FormLogActivity = source.FormLogActivity.UseKenticoDefault(); + target.FormBuilderLayout = source.FormBuilderLayout; + + if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out int formClassId)) + { + target.FormClassID = formClassId; + } + + return target; + } +} + +public class CmsFormMapperEf : EntityMapperBase +{ + public CmsFormMapperEf(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override CmsForm? CreateNewInstance(KX12M.CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsForm MapInternal(KX12M.CmsForm source, CmsForm target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.FormDisplayName = source.FormDisplayName; + target.FormName = source.FormName; + // target.FormSendToEmail = source.FormSendToEmail; + // target.FormSendFromEmail = source.FormSendFromEmail; + // target.FormEmailSubject = source.FormEmailSubject; + // target.FormEmailTemplate = source.FormEmailTemplate; + // target.FormEmailAttachUploadedDocs = source.FormEmailAttachUploadedDocs; + target.FormItems = source.FormItems; + target.FormReportFields = source.FormReportFields; + target.FormSubmitButtonText = source.FormSubmitButtonText; + // target.FormConfirmationEmailField = source.FormConfirmationEmailField; + // target.FormConfirmationTemplate = source.FormConfirmationTemplate; + // target.FormConfirmationSendFromEmail = source.FormConfirmationSendFromEmail; + // target.FormConfirmationEmailSubject = source.FormConfirmationEmailSubject; + target.FormAccess = source.FormAccess; + target.FormSubmitButtonImage = source.FormSubmitButtonImage; + target.FormGuid = source.FormGuid; + target.FormLastModified = source.FormLastModified; + target.FormLogActivity = source.FormLogActivity ?? false; + target.FormBuilderLayout = source.FormBuilderLayout; + + if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out int classId)) + { + target.FormClassId = classId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/CmsSettingsCategoryMapper.cs b/Migration.Tool.Core.KX12/Mappers/CmsSettingsCategoryMapper.cs new file mode 100644 index 00000000..56e28a85 --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/CmsSettingsCategoryMapper.cs @@ -0,0 +1,97 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class CmsSettingsCategoryMapper( + ILogger logger, + PrimaryKeyMappingContext pkContext, + IProtocol protocol, + IEntityMapper cmsResourceMapper) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override CmsSettingsCategory? CreateNewInstance(KX12M.CmsSettingsCategory source, MappingHelper mappingHelper, + AddFailure addFailure) => new(); + + + protected override CmsSettingsCategory MapInternal(KX12M.CmsSettingsCategory source, CmsSettingsCategory target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + // no category guid to match on... + if (newInstance) + { + target.CategoryOrder = source.CategoryOrder; + target.CategoryName = source.CategoryName; + target.CategoryDisplayName = source.CategoryDisplayName; + target.CategoryIdpath = source.CategoryIdpath; + target.CategoryLevel = source.CategoryLevel; + target.CategoryChildCount = source.CategoryChildCount; + target.CategoryIconPath = source.CategoryIconPath; + target.CategoryIsGroup = source.CategoryIsGroup; + target.CategoryIsCustom = source.CategoryIsCustom; + } + + if (source.CategoryResource != null) + { + if (target.CategoryResource != null && source.CategoryResourceId != null && target.CategoryResourceId != null) + { + // skip if target is present + logger.LogTrace("Skipping category resource '{ResourceGuid}', already present in target instance", target.CategoryResource.ResourceGuid); + pkContext.SetMapping(r => r.ResourceId, source.CategoryResourceId.Value, target.CategoryResourceId.Value); + } + else + { + switch (cmsResourceMapper.Map(source.CategoryResource, target.CategoryResource)) + { + case { Success: true } result: + { + target.CategoryResource = result.Item; + break; + } + case { Success: false } result: + { + addFailure(new MapperResultFailure(result.HandbookReference)); + break; + } + + default: + break; + } + } + } + else if (mappingHelper.TranslateIdAllowNulls(r => r.ResourceId, source.CategoryResourceId, out int? categoryResourceId)) + { + target.CategoryResourceId = categoryResourceId; + } + + if (source.CategoryParent != null) + { + switch (Map(source.CategoryParent, target.CategoryParent)) + { + case { Success: true } result: + { + target.CategoryParent = result.Item; + break; + } + case { Success: false } result: + { + addFailure(new MapperResultFailure(result.HandbookReference)); + break; + } + + default: + break; + } + } + else if (mappingHelper.TranslateIdAllowNulls(c => c.CategoryId, source.CategoryParentId, out int? categoryParentId)) + { + target.CategoryParentId = categoryParentId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/CmsSettingsKeyMapper.cs b/Migration.Tool.Core.KX12/Mappers/CmsSettingsKeyMapper.cs new file mode 100644 index 00000000..43fc0e73 --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/CmsSettingsKeyMapper.cs @@ -0,0 +1,70 @@ +using System.Diagnostics; + +using CMS.DataEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class CmsSettingsKeyMapper : EntityMapperBase +{ + private const string SOURCE_KEY_NAME = "CMSDefaultUserID"; + + public CmsSettingsKeyMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override SettingsKeyInfo CreateNewInstance(KX12M.CmsSettingsKey source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override SettingsKeyInfo MapInternal(KX12M.CmsSettingsKey source, SettingsKeyInfo target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + if (newInstance) + { + target.KeyName = source.KeyName; + target.KeyDisplayName = source.KeyDisplayName; + target.KeyDescription = source.KeyDescription; + target.KeyType = source.KeyType; + target.KeyGUID = source.KeyGuid; + target.KeyValidation = source.KeyValidation; + target.KeyEditingControlPath = source.KeyEditingControlPath; + target.KeyFormControlSettings = source.KeyFormControlSettings; + target.KeyExplanationText = source.KeyExplanationText; + } + else + { + target.KeyName = source.KeyName; + target.KeyDescription = source.KeyDescription; + target.KeyType = source.KeyType; + target.KeyValidation = source.KeyValidation; + target.KeyEditingControlPath = source.KeyEditingControlPath; + target.KeyFormControlSettings = source.KeyFormControlSettings; + target.KeyExplanationText = source.KeyExplanationText; + } + + // special migrations for keys + switch (source.KeyName) + { + case SOURCE_KEY_NAME: + { + target.KeyValue = int.TryParse(source.KeyValue, out int cmsDefaultUserId) + ? mappingHelper.TranslateRequiredId(u => u.UserId, cmsDefaultUserId, out int targetCmsDefaultUserId) + ? targetCmsDefaultUserId.ToString() + : source.KeyValue + : source.KeyValue; + break; + } + default: + target.KeyValue = source.KeyValue; + break; + } + + Debug.Assert(!source.SiteId.HasValue, "!source.SiteId.HasValue"); + target.KeyLastModified = source.KeyLastModified; + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/CmsUserMapper.cs b/Migration.Tool.Core.KX12/Mappers/CmsUserMapper.cs new file mode 100644 index 00000000..e98f3df4 --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/CmsUserMapper.cs @@ -0,0 +1,55 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class CmsUserMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override CmsUser CreateNewInstance(KX12M.CmsUser tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsUser MapInternal(KX12M.CmsUser source, CmsUser target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (!newInstance && source.UserGuid != target.UserGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.UserName = source.UserName; + target.FirstName = source.FirstName; + target.LastName = source.LastName; + target.Email = source.Email; + target.UserPassword = source.UserPassword; + target.UserEnabled = source.UserEnabled; + target.UserCreated = source.UserCreated; + target.LastLogon = source.LastLogon; + target.UserGuid = source.UserGuid; + target.UserLastModified = source.UserLastModified; + target.UserSecurityStamp = source.UserSecurityStamp; + target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + target.UserIsPendingRegistration = false; + target.UserPasswordLastChanged = null; + target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + foreach (var sourceCmsUserRole in source.CmsUserRoles) + { + if (mappingHelper.TranslateRequiredId(r => r.RoleId, sourceCmsUserRole.RoleId, out int targetRoleId)) + { + if (target.CmsUserRoles.All(x => x.RoleId != targetRoleId)) + { + target.CmsUserRoles.Add(new CmsUserRole { RoleId = targetRoleId, User = target }); + } + } + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/CountryInfoMapper.cs b/Migration.Tool.Core.KX12/Mappers/CountryInfoMapper.cs new file mode 100644 index 00000000..671d9510 --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/CountryInfoMapper.cs @@ -0,0 +1,30 @@ +using CMS.Globalization; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class CountryInfoMapper : EntityMapperBase +{ + public CountryInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override CountryInfo? CreateNewInstance(KX12M.CmsCountry source, MappingHelper mappingHelper, AddFailure addFailure) + => CountryInfo.New(); + + protected override CountryInfo MapInternal(KX12M.CmsCountry source, CountryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.CountryName = source.CountryName; + target.CountryDisplayName = source.CountryDisplayName; + target.CountryGUID = source.CountryGuid; + target.CountryLastModified = source.CountryLastModified; + target.CountryThreeLetterCode = source.CountryThreeLetterCode; + target.CountryTwoLetterCode = source.CountryTwoLetterCode; + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/MemberInfoMapper.cs b/Migration.Tool.Core.KX12/Mappers/MemberInfoMapper.cs new file mode 100644 index 00000000..611c1ece --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/MemberInfoMapper.cs @@ -0,0 +1,179 @@ +using System.Data; + +using CMS.FormEngine; +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KX12.Context; +using Migration.Tool.KXP.Api; + +namespace Migration.Tool.Core.KX12.Mappers; + +public record MemberInfoMapperSource(KX12M.CmsUser User, KX12M.CmsUserSetting UserSetting); + +public class MemberInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolConfiguration toolConfiguration, + IDbContextFactory k12DbContextFactory) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (user, userSetting) = source; + + if (!newInstance && user.UserGuid != target.MemberGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + // target.UserName = source.UserName; + target.MemberName = user.UserName; + + // target.FirstName = source.FirstName; // TODO tomas.krch: 2023-04-11 configurable autocreate + // target.LastName = source.LastName; // TODO tomas.krch: 2023-04-11 configurable autocreate + + // target.Email = source.Email; + target.MemberEmail = user.Email; + + // target.SetValue("UserPassword", source.UserPassword); + target.MemberPassword = null; // source.UserPassword; // not migrated + + // target.UserEnabled = source.UserEnabled; + target.MemberEnabled = user.UserEnabled; + + target.SetValue("UserCreated", user.UserCreated); + target.MemberCreated = user.UserCreated.GetValueOrDefault(); + + // target.SetValue("LastLogon", source.LastLogon); // TODO tomas.krch: 2023-04-11 configurable autocreate + + // target.UserGUID = source.UserGuid; + target.MemberGuid = user.UserGuid; + + // target.UserLastModified = source.UserLastModified; // TODO tomas.krch: 2023-04-11 configurable autocreate + target.MemberSecurityStamp = user.UserSecurityStamp; // TODO tomas.krch: 2023-04-11 still relevant? + + // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + // OBSOLETE: target.UserIsPendingRegistration = false; + // OBSOLETE: target.UserPasswordLastChanged = null; + // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + // TODO tomas.krch: 2023-04-11 migrate customized fields + var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); + foreach (var customizedFieldInfo in customized) + { + string fieldName = customizedFieldInfo.FieldName; + + if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out object? value) || + ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) + { + target.SetValue(fieldName, value); + } + } + + using var kx12Context = k12DbContextFactory.CreateDbContext(); + var uDci = kx12Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_user); + if (uDci != null) + { + var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(uDci?.ClassFormDefinition)).ToList(); + if (userCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.User.UserId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + } + + var usDci = kx12Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); + if (usDci != null) + { + var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); + if (userSettingsCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; + + using var conn = new SqlConnection(toolConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userSettingsCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserSettingsInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); + } + } + } + + + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/OmContactGroupMapper.cs b/Migration.Tool.Core.KX12/Mappers/OmContactGroupMapper.cs new file mode 100644 index 00000000..c70b6840 --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/OmContactGroupMapper.cs @@ -0,0 +1,36 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class OmContactGroupMapper : EntityMapperBase +{ + public OmContactGroupMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override OmContactGroup? CreateNewInstance(KX12M.OmContactGroup tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override OmContactGroup MapInternal(KX12M.OmContactGroup source, OmContactGroup target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ContactGroupName = source.ContactGroupName; + target.ContactGroupDisplayName = source.ContactGroupDisplayName; + target.ContactGroupDescription = source.ContactGroupDescription; + target.ContactGroupDynamicCondition = source.ContactGroupDynamicCondition; + target.ContactGroupEnabled = source.ContactGroupEnabled; + target.ContactGroupLastModified = source.ContactGroupLastModified; + target.ContactGroupGuid = source.ContactGroupGuid; + target.ContactGroupStatus = source.ContactGroupStatus; + + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/OmContactStatusMapper.cs b/Migration.Tool.Core.KX12/Mappers/OmContactStatusMapper.cs new file mode 100644 index 00000000..b2574d08 --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/OmContactStatusMapper.cs @@ -0,0 +1,32 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class OmContactStatusMapper : EntityMapperBase +{ + public OmContactStatusMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override OmContactStatus? CreateNewInstance(KX12M.OmContactStatus tSourceEntity, MappingHelper mappingHelper, + AddFailure addFailure) => new(); + + protected override OmContactStatus MapInternal(KX12M.OmContactStatus source, OmContactStatus target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ContactStatusName = source.ContactStatusName; + target.ContactStatusDisplayName = source.ContactStatusDisplayName; + target.ContactStatusDescription = source.ContactStatusDescription; + + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/RoleInfoMapper.cs b/Migration.Tool.Core.KX12/Mappers/RoleInfoMapper.cs new file mode 100644 index 00000000..e3cc351e --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/RoleInfoMapper.cs @@ -0,0 +1,32 @@ +using CMS.Membership; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class RoleInfoMapper : EntityMapperBase +{ + public RoleInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override RoleInfo? CreateNewInstance(KX12M.CmsRole source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override RoleInfo MapInternal(KX12M.CmsRole source, RoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.RoleDisplayName = source.RoleDisplayName; + target.RoleName = source.RoleName; + target.RoleDescription = source.RoleDescription; + target.RoleGUID = source.RoleGuid; + target.RoleLastModified = source.RoleLastModified; + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/StateInfoMapper.cs b/Migration.Tool.Core.KX12/Mappers/StateInfoMapper.cs new file mode 100644 index 00000000..f9bab501 --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/StateInfoMapper.cs @@ -0,0 +1,35 @@ +using CMS.Globalization; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class StateInfoMapper : EntityMapperBase +{ + public StateInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override StateInfo? CreateNewInstance(KX12M.CmsState source, MappingHelper mappingHelper, AddFailure addFailure) + => StateInfo.New(); + + protected override StateInfo MapInternal(KX12M.CmsState source, StateInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.StateName = source.StateName; + target.StateDisplayName = source.StateDisplayName; + target.StateLastModified = source.StateLastModified; + target.StateGUID = source.StateGuid; + target.StateCode = source.StateCode; + + if (mappingHelper.TranslateRequiredId(k => k.CountryId, source.CountryId, out int countryId)) + { + target.CountryID = countryId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/UserInfoMapper.cs b/Migration.Tool.Core.KX12/Mappers/UserInfoMapper.cs new file mode 100644 index 00000000..0047794d --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/UserInfoMapper.cs @@ -0,0 +1,101 @@ +using System.Data; + +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KXP.Api; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class UserInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolConfiguration toolConfiguration) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override UserInfo CreateNewInstance(KX12M.CmsUser source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override UserInfo MapInternal(KX12M.CmsUser source, UserInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (!newInstance && source.UserGuid != target.UserGUID) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.UserName = source.UserName; + target.FirstName = source.FirstName; + target.LastName = source.LastName; + target.Email = source.Email; + // target.UserPassword = source.UserPassword; + target.SetValue("UserPassword", source.UserPassword); + target.UserEnabled = source.UserEnabled; + target.SetValue("UserCreated", source.UserCreated); + // target.UserCreated = source.UserCreated; + target.SetValue("LastLogon", source.LastLogon); + // target.LastLogon = source.LastLogon; + target.UserGUID = source.UserGuid; + target.UserLastModified = source.UserLastModified; + target.UserSecurityStamp = source.UserSecurityStamp; + + // TODO tk: 2022-05-18 deduced - check + target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + // TODO tk: 2022-05-18 deduce info + target.UserIsPendingRegistration = false; + // TODO tk: 2022-05-18 deduce info + // target.UserPasswordLastChanged = null; + // TODO tk: 2022-05-18 deduce info + target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + var customizedFields = kxpClassFacade.GetCustomizedFieldInfos(UserInfo.TYPEINFO.ObjectClassName).ToList(); + if (customizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in customizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + + + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Mappers/UserRoleInfoMapper.cs b/Migration.Tool.Core.KX12/Mappers/UserRoleInfoMapper.cs new file mode 100644 index 00000000..cacb1306 --- /dev/null +++ b/Migration.Tool.Core.KX12/Mappers/UserRoleInfoMapper.cs @@ -0,0 +1,34 @@ +using CMS.Membership; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; + +namespace Migration.Tool.Core.KX12.Mappers; + +public class UserRoleInfoMapper : EntityMapperBase +{ + public UserRoleInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override UserRoleInfo? CreateNewInstance(KX12M.CmsUserRole source, MappingHelper mappingHelper, AddFailure addFailure) + => UserRoleInfo.New(); + + protected override UserRoleInfo MapInternal(KX12M.CmsUserRole source, UserRoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (mappingHelper.TranslateRequiredId(r => r.RoleId, source.RoleId, out int xbkRoleId)) + { + target.RoleID = xbkRoleId; + } + + if (mappingHelper.TranslateRequiredId(r => r.UserId, source.UserId, out int xbkUserId)) + { + target.UserID = xbkUserId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX12/Migration.Tool.Core.KX12.csproj b/Migration.Tool.Core.KX12/Migration.Tool.Core.KX12.csproj new file mode 100644 index 00000000..de13157e --- /dev/null +++ b/Migration.Tool.Core.KX12/Migration.Tool.Core.KX12.csproj @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/Migration.Tool.Core.KX12/Providers/ContentItemNameProvider.cs b/Migration.Tool.Core.KX12/Providers/ContentItemNameProvider.cs new file mode 100644 index 00000000..8fbe65fe --- /dev/null +++ b/Migration.Tool.Core.KX12/Providers/ContentItemNameProvider.cs @@ -0,0 +1,42 @@ +using CMS.Base; +using CMS.ContentEngine.Internal; +using CMS.Helpers; + +namespace Migration.Tool.Core.KX12.Providers; + +internal class ContentItemNameProvider +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) => this.codeNameValidator = codeNameValidator; + + public Task Get(string name) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); + } + + async Task Get(string name) + { + string codeName = ValidationHelper.GetCodeName(name, useUnicode: false); + + bool isCodeNameValid = ValidationHelper.IsCodeName(codeName); + + if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) + { + codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); + } + + var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); + + return await uniqueCodeNameProvider.GetUniqueValue(codeName); + } + + return Get(name); + } +} diff --git a/Migration.Tool.Core.KX12/Providers/ContentItemNameValidator.cs b/Migration.Tool.Core.KX12/Providers/ContentItemNameValidator.cs new file mode 100644 index 00000000..3d1228a4 --- /dev/null +++ b/Migration.Tool.Core.KX12/Providers/ContentItemNameValidator.cs @@ -0,0 +1,18 @@ +using CMS.ContentEngine.Internal; + +namespace Migration.Tool.Core.KX12.Providers; + +internal class ContentItemNameValidator : IContentItemNameValidator +{ + /// + public bool IsUnique(string name) => IsUnique(0, name); + + + /// + public bool IsUnique(int id, string name) + { + var contentItemInfo = new ContentItemInfo { ContentItemID = id, ContentItemName = name }; + + return contentItemInfo.CheckUniqueCodeName(); + } +} diff --git a/Migration.Tool.Core.KX12/Providers/UniqueContentItemNameProvider.cs b/Migration.Tool.Core.KX12/Providers/UniqueContentItemNameProvider.cs new file mode 100644 index 00000000..715509ae --- /dev/null +++ b/Migration.Tool.Core.KX12/Providers/UniqueContentItemNameProvider.cs @@ -0,0 +1,38 @@ +using CMS.Base; +using CMS.ContentEngine.Internal; + +namespace Migration.Tool.Core.KX12.Providers; + +internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) + : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) => this.codeNameValidator = codeNameValidator; + + public override Task GetUniqueValue(string inputValue) => base.GetUniqueValue(AddSuffix(inputValue)); + + + private string AddSuffix(string codeName) + { + string randomSuffix = GetRandomSuffix(); + string codeNameWithSuffix = codeName += randomSuffix; + + if (codeNameWithSuffix.Length > MaxLength) + { + int availableLength = MaxLength - randomSuffix.Length; + + codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; + } + + return codeNameWithSuffix; + } + + + /// + protected override Task IsValueUnique(string value) => Task.FromResult(codeNameValidator.IsUnique(value)); +} diff --git a/Migration.Tool.Core.KX12/Services/CmsClass/AttachmentSelectorItem.cs b/Migration.Tool.Core.KX12/Services/CmsClass/AttachmentSelectorItem.cs new file mode 100644 index 00000000..8520d91f --- /dev/null +++ b/Migration.Tool.Core.KX12/Services/CmsClass/AttachmentSelectorItem.cs @@ -0,0 +1,11 @@ +using Newtonsoft.Json; + +namespace Migration.Tool.Core.KX12.Services.CmsClass; + +/// Represents an item for the attachment selector. +public class AttachmentSelectorItem +{ + /// Attachment GUID. + [JsonProperty("fileGuid")] + public Guid FileGuid { get; set; } +} diff --git a/Migration.Tool.Core.KX12/Services/CountryMigrator.cs b/Migration.Tool.Core.KX12/Services/CountryMigrator.cs new file mode 100644 index 00000000..b4b1e019 --- /dev/null +++ b/Migration.Tool.Core.KX12/Services/CountryMigrator.cs @@ -0,0 +1,104 @@ +using CMS.Globalization; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX12.Contexts; +using Migration.Tool.KX12.Context; +using Migration.Tool.KXP.Api; + +namespace Migration.Tool.Core.KX12.Services; + +public class CountryMigrator( + ILogger logger, + IDbContextFactory kx12ContextFactory, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + IEntityMapper countryMapper, + IEntityMapper stateMapper, + KxpApiInitializer kxpApiInitializer) +{ + public void MigrateCountriesAndStates() + { + if (!kxpApiInitializer.EnsureApiIsInitialized()) + { + throw new InvalidOperationException("Falied to initialize kentico API. Please check configuration."); + } + + var kx12Context = kx12ContextFactory.CreateDbContext(); + + var k12Countries = kx12Context.CmsCountries.AsNoTracking(); + foreach (var k12CmsCountry in k12Countries) + { + var kxpCountryInfo = CountryInfoProvider.ProviderObject.Get(k12CmsCountry.CountryName); + + if (kxpCountryInfo != null) // do not update when exists + { + continue; + } + + var mapped = countryMapper.Map(k12CmsCountry, null); + protocol.MappedTarget(mapped); + + if (mapped is (var countryInfo, var newInstance) { Success: true }) + { + try + { + CountryInfoProvider.ProviderObject.Set(countryInfo); + + protocol.Success(k12CmsCountry, countryInfo, mapped); + logger.LogEntitySetAction(newInstance, countryInfo); + + primaryKeyMappingContext.SetMapping(r => r.CountryId, k12CmsCountry.CountryId, countryInfo.CountryID); + } + catch (Exception exception) + { + logger.LogEntitySetError(exception, newInstance, countryInfo); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithIdentityPrint(countryInfo) + ); + } + } + } + + + var k12States = kx12Context.CmsStates.AsNoTracking(); + foreach (var k12CmsState in k12States) + { + var kxpStateInfo = StateInfoProvider.ProviderObject.Get(k12CmsState.StateName); + + if (kxpStateInfo != null) // do not update when exists + { + continue; + } + + var mapped = stateMapper.Map(k12CmsState, null); + protocol.MappedTarget(mapped); + + if (mapped is (var stateInfo, var newInstance) { Success: true }) + { + try + { + StateInfoProvider.ProviderObject.Set(stateInfo); + + protocol.Success(k12CmsState, stateInfo, mapped); + logger.LogEntitySetAction(newInstance, stateInfo); + + primaryKeyMappingContext.SetMapping(r => r.StateId, k12CmsState.StateId, stateInfo.StateID); + } + catch (Exception exception) + { + logger.LogEntitySetError(exception, newInstance, stateInfo); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithIdentityPrint(stateInfo) + ); + } + } + } + } +} diff --git a/Migration.Tool.Core.KX12/Services/IPrimaryKeyLocatorService.cs b/Migration.Tool.Core.KX12/Services/IPrimaryKeyLocatorService.cs new file mode 100644 index 00000000..6ca4f4cf --- /dev/null +++ b/Migration.Tool.Core.KX12/Services/IPrimaryKeyLocatorService.cs @@ -0,0 +1,11 @@ +using System.Linq.Expressions; + +namespace Migration.Tool.Core.KX12.Services; + +public record SourceTargetKeyMapping(int SourceId, int TargetId); + +public interface IPrimaryKeyLocatorService +{ + bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); + IEnumerable SelectAll(Expression> keyNameSelector); +} diff --git a/Migration.Tool.Core.KX12/Services/KeyLocatorService.cs b/Migration.Tool.Core.KX12/Services/KeyLocatorService.cs new file mode 100644 index 00000000..5377b3e6 --- /dev/null +++ b/Migration.Tool.Core.KX12/Services/KeyLocatorService.cs @@ -0,0 +1,108 @@ +using System.Linq.Expressions; +using System.Runtime.CompilerServices; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.KX12.Context; +using Migration.Tool.KXP.Context; + +namespace Migration.Tool.Core.KX12.Services; + +public class KeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory kx12ContextFactory) +{ + public bool TryLocate( + Expression> sourceKeySelector, + Expression> targetKeySelector, + Expression> sourceGuidSelector, + Expression> targetGuidSelector, + object? sourceKey, out TTargetKey targetId + ) where TSource : class where TTarget : class + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var kx12Context = kx12ContextFactory.CreateDbContext(); + + var sourceType = typeof(TSource); + Unsafe.SkipInit(out targetId); + + try + { + if (sourceKey is null) + { + return false; + } + + var sourceEquals = Expression.Equal( + sourceKeySelector.Body, + Expression.Convert(Expression.Constant(sourceKey, sourceKey.GetType()), typeof(object)) + ); + var sourcePredicate = Expression.Lambda>(sourceEquals, sourceKeySelector.Parameters[0]); + var k12Guid = kx12Context.Set().Where(sourcePredicate).Select(sourceGuidSelector).Single(); + + var param = Expression.Parameter(typeof(TTarget), "t"); + var member = targetGuidSelector.Body as MemberExpression ?? throw new InvalidOperationException($"Expression SHALL NOT be other than member expression, expression: {targetGuidSelector}"); + var targetEquals = Expression.Equal( + Expression.MakeMemberAccess(param, member.Member), + Expression.Constant(k12Guid, typeof(Guid)) + ); + var targetPredicate = Expression.Lambda>(targetEquals, param); + + var query = kxpContext.Set().Where(targetPredicate); + var selector = Expression.Lambda>(targetKeySelector.Body, targetKeySelector.Parameters[0]); + targetId = query.Select(selector).Single(); + return true; + } + catch (InvalidOperationException ioex) + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceKey, ioex.Message); + return false; + } + finally + { + if (!targetId?.Equals(default) ?? false) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceKey, targetId); + } + } + } + + public bool TryGetSourceGuid(Expression> keySelector, Expression> guidSelector, object? key, out Guid? guid) + where T : class + { + using var kx12Context = kx12ContextFactory.CreateDbContext(); + + var type = typeof(T); + Unsafe.SkipInit(out guid); + + try + { + if (key is null) + { + return false; + } + + var sourceEquals = Expression.Equal( + keySelector.Body, + Expression.Convert(Expression.Constant(key, key.GetType()), typeof(object)) + ); + var sourcePredicate = Expression.Lambda>(sourceEquals, keySelector.Parameters[0]); + guid = kx12Context.Set().Where(sourcePredicate).Select(guidSelector).Single(); + return true; + } + catch (InvalidOperationException ioex) + { + logger.LogWarning("Guid locator {SourceFullType} primary key: {Key} failed, {Message}", type.FullName, key, ioex.Message); + return false; + } + finally + { + if (!guid?.Equals(default) ?? false) + { + logger.LogTrace("Guid locator {SourceFullType} primary key: {Key} located {Guid}", type.FullName, key, guid); + } + } + } +} diff --git a/Migration.Tool.Core.KX12/Services/PrimaryKeyLocatorService.cs b/Migration.Tool.Core.KX12/Services/PrimaryKeyLocatorService.cs new file mode 100644 index 00000000..54c2e698 --- /dev/null +++ b/Migration.Tool.Core.KX12/Services/PrimaryKeyLocatorService.cs @@ -0,0 +1,219 @@ +using System.Linq.Expressions; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.KX12.Context; +using Migration.Tool.KXP.Context; + +namespace Migration.Tool.Core.KX12.Services; + +public class PrimaryKeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory kx12ContextFactory) + : IPrimaryKeyLocatorService +{ + public IEnumerable SelectAll(Expression> keyNameSelector) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var kx12Context = kx12ContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + string memberName = keyNameSelector.GetMemberName(); + + logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); + + if (sourceType == typeof(KX12M.CmsUser) && memberName == nameof(KX12M.CmsUser.UserId)) + { + var sourceUsers = kx12Context.CmsUsers.Select(x => new { x.UserId, x.UserGuid, x.UserName }).ToList(); + var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); + + var result = sourceUsers.Join(targetUsers, + a => new CmsUserKey(a.UserGuid, a.UserName), + b => new CmsUserKey(b.UserGuid, b.UserName), + (a, b) => new SourceTargetKeyMapping(a.UserId, b.UserId), + new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(KX12M.OmContact) && memberName == nameof(KX12M.OmContact.ContactId)) + { + var source = kx12Context.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + var target = kxpContext.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + + var result = source.Join(target, + a => a.ContactGuid, + b => b.ContactGuid, + (a, b) => new SourceTargetKeyMapping(a.ContactId, b.ContactId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(KX12M.CmsState) && memberName == nameof(KX12M.CmsState.StateId)) + { + var source = kx12Context.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + + var result = source.Join(target, + a => a.StateName, + b => b.StateName, + (a, b) => new SourceTargetKeyMapping(a.StateId, b.StateId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(KX12M.CmsCountry) && memberName == nameof(KX12M.CmsCountry.CountryId)) + { + var source = kx12Context.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + + var result = source.Join(target, + a => a.CountryName, + b => b.CountryName, + (a, b) => new SourceTargetKeyMapping(a.CountryId, b.CountryId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + + throw new NotImplementedException(); + } + + public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var KX12Context = kx12ContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + targetId = -1; + try + { + if (sourceType == typeof(KX12M.CmsResource)) + { + var k12Guid = KX12Context.CmsResources.Where(c => c.ResourceId == sourceId).Select(x => x.ResourceGuid).Single(); + targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == k12Guid).Select(x => x.ResourceId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.CmsClass)) + { + var k12Guid = KX12Context.CmsClasses.Where(c => c.ClassId == sourceId).Select(x => x.ClassGuid).Single(); + targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == k12Guid).Select(x => x.ClassId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.CmsUser)) + { + var k12User = KX12Context.CmsUsers.Where(c => c.UserId == sourceId).Select(x => new { x.UserGuid, x.UserName }).Single(); + targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == k12User.UserGuid || x.UserName == k12User.UserName).Select(x => x.UserId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.CmsRole)) + { + var k12User = KX12Context.CmsRoles.Where(c => c.RoleId == sourceId).Select(x => new { x.RoleGuid }).Single(); + targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == k12User.RoleGuid).Select(x => x.RoleId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.CmsSite)) + { + var k12Guid = KX12Context.CmsSites.Where(c => c.SiteId == sourceId).Select(x => x.SiteGuid).Single(); + targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == k12Guid).Select(x => x.ChannelId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.CmsState)) + { + string k12CodeName = KX12Context.CmsStates.Where(c => c.StateId == sourceId).Select(x => x.StateName).Single(); + targetId = kxpContext.CmsStates.Where(x => x.StateName == k12CodeName).Select(x => x.StateId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.CmsCountry)) + { + string k12CodeName = KX12Context.CmsCountries.Where(c => c.CountryId == sourceId).Select(x => x.CountryName).Single(); + targetId = kxpContext.CmsCountries.Where(x => x.CountryName == k12CodeName).Select(x => x.CountryId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.OmContactStatus)) + { + string k12Guid = KX12Context.OmContactStatuses.Where(c => c.ContactStatusId == sourceId).Select(x => x.ContactStatusName).Single(); + targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == k12Guid).Select(x => x.ContactStatusId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.OmContact)) + { + var k12Guid = KX12Context.OmContacts.Where(c => c.ContactId == sourceId).Select(x => x.ContactGuid).Single(); + targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == k12Guid).Select(x => x.ContactId).Single(); + return true; + } + } + catch (InvalidOperationException ioex) + { + if (ioex.Message.StartsWith("Sequence contains no elements")) + { + logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + else + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + + return false; + } + finally + { + if (targetId != -1) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); + } + } + + logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); + targetId = -1; + return false; + } + + private class KeyEqualityComparerWithLambda(Func equalityComparer) : IEqualityComparer + { + public bool Equals(T? x, T? y) => equalityComparer.Invoke(x, y); + + public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; + } + + private record CmsUserKey(Guid UserGuid, string UserName); +} diff --git a/Migration.Tool.Core.KX13/Behaviors/CommandConstraintBehavior.cs b/Migration.Tool.Core.KX13/Behaviors/CommandConstraintBehavior.cs new file mode 100644 index 00000000..060c1326 --- /dev/null +++ b/Migration.Tool.Core.KX13/Behaviors/CommandConstraintBehavior.cs @@ -0,0 +1,232 @@ +using MediatR; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KX13; +using Migration.Tool.KX13.Context; + +namespace Migration.Tool.Core.KX13.Behaviors; + +public class CommandConstraintBehavior( + ILogger> logger, + IMigrationProtocol protocol, + IDbContextFactory kx13ContextFactory, + ToolConfiguration toolConfiguration) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + try + { + var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + + bool criticalCheckPassed = PerformChecks(request, kx13Context); + if (!criticalCheckPassed) + { + return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); + } + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogCritical(ex, "Error occured while checking command constraints"); + return (TResponse)(CommandResult)new CommandCheckFailedResult(false); + } + + return await next(); + } + + private bool PerformChecks(TRequest request, KX13Context kx13Context) + { + bool criticalCheckPassed = true; + // const string supportedVersion = "13.0.64"; + const string supportedVersion = "13.0.0"; + if (SemanticVersion.TryParse(supportedVersion, out var minimalVersion)) + { + criticalCheckPassed &= CheckVersion(kx13Context, minimalVersion); + } + + var sourceSites = kx13Context.CmsSites + .Include(s => s.Cultures) + .ToList(); + + foreach (var site in sourceSites) + { + criticalCheckPassed &= CheckSite(sourceSites, site.SiteId); + } + + if (request is ICultureReliantCommand cultureReliantCommand) + { + criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites); + } + + // criticalCheckPassed &= CheckDbCollations(); + + return criticalCheckPassed; + } + + private bool CheckVersion(KX13Context kx13Context, SemanticVersion minimalVersion) + { + bool criticalCheckPassed = true; + + #region Check conclusion methods + + void UnableToReadVersionKey(string keyName) + { + logger.LogCritical("Unable to read CMS version (incorrect format) - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { ErrorKind = "Settings key value incorrect format", SettingsKeyName = keyName, SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + void VersionKeyNotFound(string keyName) + { + logger.LogCritical("CMS version not found - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { ErrorKind = "Settings key not found", SettingsKeyName = keyName, SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + void UpgradeNeeded(string keyName, string currentVersion) + { + logger.LogCritical("{Key} '{CurrentVersion}' is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentVersion, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { CurrentVersion = currentVersion, SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + void LowHotfix(string keyName, int currentHotfix) + { + logger.LogCritical("{Key} '{CurrentVersion}' hotfix is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentHotfix, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { CurrentHotfix = currentHotfix.ToString(), SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + #endregion + + if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDataVersion) is { } cmsDataVersion) + { + if (SemanticVersion.TryParse(cmsDataVersion.KeyValue, out var cmsDataVer)) + { + if (cmsDataVer.IsLesserThan(minimalVersion)) + { + UpgradeNeeded(SettingsKeys.CMSDataVersion, cmsDataVer.ToString()); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSDataVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSDataVersion); + } + + if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDBVersion) is { } cmsDbVersion) + { + if (SemanticVersion.TryParse(cmsDbVersion.KeyValue, out var cmsDataVer)) + { + if (cmsDataVer.IsLesserThan(minimalVersion)) + { + UpgradeNeeded(SettingsKeys.CMSDBVersion, cmsDataVer.ToString()); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSDBVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSDBVersion); + } + + if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixDataVersion) is { } cmsHotfixDataVersion) + { + if (int.TryParse(cmsHotfixDataVersion.KeyValue, out int version)) + { + if (version < minimalVersion.Hotfix) + { + LowHotfix(SettingsKeys.CMSHotfixDataVersion, version); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSHotfixDataVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSHotfixDataVersion); + } + + if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixVersion) is { } cmsHotfixVersion) + { + if (int.TryParse(cmsHotfixVersion.KeyValue, out int version)) + { + if (version < minimalVersion.Hotfix) + { + LowHotfix(SettingsKeys.CMSHotfixVersion, version); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSHotfixVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSHotfixVersion); + } + + return criticalCheckPassed; + } + + private bool CheckSite(List sourceSites, int sourceSiteId) + { + bool criticalCheckPassed = true; + if (sourceSites.All(s => s.SiteId != sourceSiteId)) + { + var supportedSites = sourceSites.Select(x => new { x.SiteName, x.SiteId }).ToArray(); + string supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); + logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, + supportedSitesStr); + protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") + .WithMessage("Check program argument '--siteId'") + .WithData(new { sourceSiteId, AvailableSites = supportedSites })); + criticalCheckPassed = false; + } + + return criticalCheckPassed; + } + + private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites) + { + bool criticalCheckPassed = true; + string cultureCode = cultureReliantCommand.CultureCode; + var siteCultureLookup = sourceSites + .ToDictionary(x => x.SiteId, x => x.Cultures.Select(s => s.CultureCode.ToLowerInvariant())); + + foreach (var site in sourceSites) + { + if (siteCultureLookup.TryGetValue(site.SiteId, out var value)) + { + string[] siteCultures = value.ToArray(); + if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) + { + string supportedCultures = string.Join(", ", siteCultures); + logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, site.SiteId, supportedCultures); + protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") + .WithMessage("Check program argument '--culture'") + .WithData(new { cultureCode, site.SiteId, SiteCultures = supportedCultures })); + criticalCheckPassed = false; + } + } + } + + return criticalCheckPassed; + } +} diff --git a/Migration.Tool.Core.KX13/Behaviors/RequestHandlingBehavior.cs b/Migration.Tool.Core.KX13/Behaviors/RequestHandlingBehavior.cs new file mode 100644 index 00000000..6c4f5f90 --- /dev/null +++ b/Migration.Tool.Core.KX13/Behaviors/RequestHandlingBehavior.cs @@ -0,0 +1,40 @@ +using System.Diagnostics; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; + +namespace Migration.Tool.Core.KX13.Behaviors; + +public class RequestHandlingBehavior( + ILogger> logger, + IMigrationProtocol protocol) : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + var sw = Stopwatch.StartNew(); + logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); + try + { + protocol.CommandRequest(request); + var response = await next(); + protocol.CommandFinished(request, response); + return response; + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogError(ex, "Error occured"); + throw; + } + finally + { + logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); + } + } +} diff --git a/Migration.Tool.Core.KX13/Behaviors/XbKApiContextBehavior.cs b/Migration.Tool.Core.KX13/Behaviors/XbKApiContextBehavior.cs new file mode 100644 index 00000000..3991c9da --- /dev/null +++ b/Migration.Tool.Core.KX13/Behaviors/XbKApiContextBehavior.cs @@ -0,0 +1,42 @@ +using CMS.Base; +using CMS.Membership; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KXP.Api; + +namespace Migration.Tool.Core.KX13.Behaviors; + +public class XbKApiContextBehavior( + ILogger> logger, + IMigrationProtocol protocol, + KxpApiInitializer initializer) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + initializer.EnsureApiIsInitialized(); + + var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); + if (defaultAdmin == null) + { + protocol.Append(HandbookReferences + .MissingRequiredDependency() + .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") + ); + throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); + } + + using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) + { + logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); + return await next(); + } + } +} diff --git a/Migration.Tool.Core.KX13/Contexts/KeyMappingContext.cs b/Migration.Tool.Core.KX13/Contexts/KeyMappingContext.cs new file mode 100644 index 00000000..3ab98168 --- /dev/null +++ b/Migration.Tool.Core.KX13/Contexts/KeyMappingContext.cs @@ -0,0 +1,34 @@ +using System.Linq.Expressions; + +using Migration.Tool.Core.KX13.Services; + +namespace Migration.Tool.Core.KX13.Contexts; + +public record MapSourceKeyResult(bool Success, TMapped? Mapped); + +public class KeyMappingContext(PrimaryKeyMappingContext primaryKeyMappingContext, KeyLocatorService keyLocatorService) +{ + public MapSourceKeyResult MapSourceKey(Expression> sourceKeySelector, + Expression> sourceGuidSelector, + object? sourceKey, + Expression> targetKeySelector, + Expression> targetGuidSelector) where TSource : class where TTarget : class + { + if (sourceKey is int id && primaryKeyMappingContext.MapSourceId(sourceKeySelector, id) is { Success: true, MappedId: TTargetKey targetKey }) + { + return new MapSourceKeyResult(true, targetKey); + } + + if (keyLocatorService.TryLocate(sourceKeySelector, targetKeySelector, sourceGuidSelector, targetGuidSelector, sourceKey, out var located)) + { + return new MapSourceKeyResult(true, located); + } + + return new MapSourceKeyResult(false, default); + } + + public MapSourceKeyResult GetGuid(Expression> keySelector, Expression> guidSelector, object? key) where T : class => + keyLocatorService.TryGetSourceGuid(keySelector, guidSelector, key, out var located) + ? new MapSourceKeyResult(true, located) + : new MapSourceKeyResult(false, null); +} diff --git a/Migration.Tool.Core.KX13/Contexts/PrimaryKeyMappingContext.cs b/Migration.Tool.Core.KX13/Contexts/PrimaryKeyMappingContext.cs new file mode 100644 index 00000000..9da19e22 --- /dev/null +++ b/Migration.Tool.Core.KX13/Contexts/PrimaryKeyMappingContext.cs @@ -0,0 +1,287 @@ +using System.Diagnostics; +using System.Linq.Expressions; +using System.Reflection; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Core.KX13.Services; + +namespace Migration.Tool.Core.KX13.Contexts; + +public class PrimaryKeyMappingContext( + ILogger logger, + IPrimaryKeyLocatorService primaryKeyLocatorService, + ToolConfiguration toolConfiguration) + : IPrimaryKeyMappingContext +{ + private readonly Dictionary mappingsCache = new(StringComparer.OrdinalIgnoreCase); + + public void SetMapping(Type type, string keyName, int sourceId, int targetId) + { + Debug.Assert(sourceId > 0, "sourceId > 0"); + Debug.Assert(targetId > 0, "targetId > 0"); + + var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) + .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); + + Debug.Assert(foundProp != null, "foundProp != null"); + + string fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; + + mappingsCache[fullKeyName] = targetId; + logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); + } + + public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) + { + string fullKeyName = CreateKey(keyNameSelector, sourceId); + mappingsCache[fullKeyName] = targetId; + logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); + } + + public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) + { + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sourceId); + if (sourceId == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out int targetId)) + { + SetMapping(keyNameSelector, sourceId, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) + { + targetIdResult = -1; + if (sourceId is not int sid) + { + return false; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + targetIdResult = explicitlyMappedId; + return true; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + targetIdResult = resultId; + return true; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + targetIdResult = targetId; + return true; + } + + return false; + } + + public int? MapFromSource(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + return null; + } + + public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return new MapSourceIdResult(true, null); + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return new MapSourceIdResult(true, null); + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return new MapSourceIdResult(true, explicitlyMappedId); + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return new MapSourceIdResult(true, resultId); + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return new MapSourceIdResult(true, targetId); + } + + return new MapSourceIdResult(false, null); + } + + public void PreloadDependencies(Expression> keyNameSelector) + { + foreach ((int sourceId, int targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) + { + SetMapping(keyNameSelector, sourceId, targetId); + } + } + + public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return true; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + return true; + } + + if (GetExplicitMappingOrNull(memberName, sid) is not null) + { + return true; + } + + if (mappingsCache.TryGetValue(fullKeyName, out _)) + { + return true; + } + + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) + { + return true; + } + + return false; + } + + private int? GetExplicitMappingOrNull(string memberName, int? sourceId) + { + if (sourceId == null) + { + return null; + } + + var mappings = toolConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; + if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) + { + return memberMappings.TryGetValue($"{sourceId}", out int? mappedId) ? mappedId : null; + } + + return null; + } + + private static string CreateKey(Expression> keyNameSelector, int sourceId) => $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; +} diff --git a/Migration.Tool.Core.KX13/DependencyInjectionExtensions.cs b/Migration.Tool.Core.KX13/DependencyInjectionExtensions.cs new file mode 100644 index 00000000..f16a00ae --- /dev/null +++ b/Migration.Tool.Core.KX13/DependencyInjectionExtensions.cs @@ -0,0 +1,69 @@ +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.Globalization; +using CMS.MediaLibrary; +using CMS.Membership; +using Kentico.Xperience.UMT; + +using MediatR; + +using Microsoft.Extensions.DependencyInjection; +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Common.Services; +using Migration.Tool.Common.Services.BulkCopy; +using Migration.Tool.Core.KX13.Behaviors; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.Core.KX13.Helpers; +using Migration.Tool.Core.KX13.Mappers; +using Migration.Tool.Core.KX13.Services; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX13; + +public static class DependencyInjectionExtensions +{ + public static IServiceCollection UseKx13ToolCore(this IServiceCollection services) + { + var printService = new PrintService(); + services.AddSingleton(printService); + HandbookReference.PrintService = printService; + LogExtensions.PrintService = printService; + + services.AddTransient(); + services.AddTransient(); + services.AddScoped(); + + services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(DependencyInjectionExtensions).Assembly)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestHandlingBehavior<,>)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(CommandConstraintBehavior<,>)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(XbKApiContextBehavior<,>)); + + services.AddScoped(); + services.AddSingleton(); + services.AddScoped(); + services.AddSingleton(); + + // mappers + services.AddTransient, CmsAttachmentMapper>(); + services.AddTransient, CmsConsentMapper>(); + services.AddTransient, CmsConsentAgreementMapper>(); + services.AddTransient, CmsConsentArchiveMapper>(); + services.AddTransient, AlternativeFormMapper>(); + services.AddTransient, RoleInfoMapper>(); + services.AddTransient, CmsSettingsCategoryMapper>(); + services.AddTransient, CmsSettingsKeyMapper>(); + services.AddTransient, UserInfoMapper>(); + services.AddTransient, MemberInfoMapper>(); + services.AddTransient, UserRoleInfoMapper>(); + services.AddTransient, OmContactGroupMapper>(); + services.AddTransient, OmContactStatusMapper>(); + services.AddTransient, CountryInfoMapper>(); + services.AddTransient, StateInfoMapper>(); + + services.AddUniversalMigrationToolkit(); + + return services; + } +} diff --git a/Migration.Tool.Core.KX13/Exceptions.cs b/Migration.Tool.Core.KX13/Exceptions.cs new file mode 100644 index 00000000..000ae7a0 --- /dev/null +++ b/Migration.Tool.Core.KX13/Exceptions.cs @@ -0,0 +1,13 @@ +namespace Migration.Tool.Core.KX13; + +public class MappingFailureException : InvalidOperationException +{ + public MappingFailureException(string keyName, string reason) : base($"Key '{keyName}' mapping failed: {reason}") + { + KeyName = keyName; + Reason = reason; + } + + public string KeyName { get; } + public string Reason { get; } +} diff --git a/Migration.Tool.Core.KX13/GlobalUsings.cs b/Migration.Tool.Core.KX13/GlobalUsings.cs new file mode 100644 index 00000000..49e85309 --- /dev/null +++ b/Migration.Tool.Core.KX13/GlobalUsings.cs @@ -0,0 +1,3 @@ +global using System; + +global using KX13M = Migration.Tool.KX13.Models; diff --git a/Migration.Tool.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs b/Migration.Tool.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs new file mode 100644 index 00000000..d35165b3 --- /dev/null +++ b/Migration.Tool.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs @@ -0,0 +1,387 @@ +using CMS.Activities; +using CMS.ContactManagement; +using CMS.ContentEngine; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Common.Services; +using Migration.Tool.Common.Services.BulkCopy; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.Core.KX13.Helpers; +using Migration.Tool.Core.KX13.Services; +using Migration.Tool.KXP.Api; +using Migration.Tool.KXP.Context; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX13.Handlers; + +public class MigrateContactManagementCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + BulkDataCopyService bulkDataCopyService, + ToolConfiguration toolConfiguration, + PrimaryKeyMappingContext primaryKeyMappingContext, + KeyMappingContext keyMappingContext, + CountryMigrator countryMigrator, + KxpClassFacade kxpClassFacade, + ISpoiledGuidContext spoiledGuidContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private readonly KxpContext kxpContext = kxpContextFactory.CreateDbContext(); + + public void Dispose() => kxpContext.Dispose(); + + public Task Handle(MigrateContactManagementCommand request, CancellationToken cancellationToken) + { + countryMigrator.MigrateCountriesAndStates(); + + if (MigrateContacts() is { } ccr) + { + return Task.FromResult(ccr); + } + + if (MigrateContactActivities() is { } acr) + { + return Task.FromResult(acr); + } + + return Task.FromResult(new GenericCommandResult()); + } + + #region "Migrate contacts" + + private CommandResult? MigrateContacts() + { + var requiredColumnsForContactMigration = new Dictionary + { + { nameof(KX13M.OmContact.ContactId), nameof(OmContact.ContactId) }, + { nameof(KX13M.OmContact.ContactFirstName), nameof(OmContact.ContactFirstName) }, + { nameof(KX13M.OmContact.ContactMiddleName), nameof(OmContact.ContactMiddleName) }, + { nameof(KX13M.OmContact.ContactLastName), nameof(OmContact.ContactLastName) }, + { nameof(KX13M.OmContact.ContactJobTitle), nameof(OmContact.ContactJobTitle) }, + { nameof(KX13M.OmContact.ContactAddress1), nameof(OmContact.ContactAddress1) }, + { nameof(KX13M.OmContact.ContactCity), nameof(OmContact.ContactCity) }, + { nameof(KX13M.OmContact.ContactZip), nameof(OmContact.ContactZip) }, + { nameof(KX13M.OmContact.ContactStateId), nameof(OmContact.ContactStateId) }, + { nameof(KX13M.OmContact.ContactCountryId), nameof(OmContact.ContactCountryId) }, + { nameof(KX13M.OmContact.ContactMobilePhone), nameof(OmContact.ContactMobilePhone) }, + { nameof(KX13M.OmContact.ContactBusinessPhone), nameof(OmContact.ContactBusinessPhone) }, + { nameof(KX13M.OmContact.ContactEmail), nameof(OmContact.ContactEmail) }, + // No support 2022-07-07 { nameof(OmContact.ContactBirthday), nameof(KXO.Models.OmContact.ContactBirthday) }, + { nameof(KX13M.OmContact.ContactGender), nameof(OmContact.ContactGender) }, + // { nameof(OmContact.ContactStatusId), nameof(KXO.Models.OmContact.ContactStatusId) }, // No support 2022-07-07 but needs to be mapped because of constraint + { nameof(KX13M.OmContact.ContactNotes), nameof(OmContact.ContactNotes) }, + { nameof(KX13M.OmContact.ContactOwnerUserId), nameof(OmContact.ContactOwnerUserId) }, + // No support 2022-07-07 { nameof(OmContact.ContactMonitored), nameof(KXO.Models.OmContact.ContactMonitored) }, + { nameof(KX13M.OmContact.ContactGuid), nameof(OmContact.ContactGuid) }, + { nameof(KX13M.OmContact.ContactLastModified), nameof(OmContact.ContactLastModified) }, + { nameof(KX13M.OmContact.ContactCreated), nameof(OmContact.ContactCreated) }, + // No support 2022-07-07 { nameof(OmContact.ContactBounces), nameof(KXO.Models.OmContact.ContactBounces) }, + { nameof(KX13M.OmContact.ContactCampaign), nameof(OmContact.ContactCampaign) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadId), nameof(KXO.Models.OmContact.ContactSalesForceLeadId) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDisabled), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDisabled) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDateTime) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationSuspensionDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationSuspensionDateTime) }, + { nameof(KX13M.OmContact.ContactCompanyName), nameof(OmContact.ContactCompanyName) } + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationRequired), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationRequired) }, + }; + + foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ContactInfo.TYPEINFO.ObjectClassName)) + { + requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); + } + + if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Contact")) + { + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Contact")); + logger.LogError("Data must not exist in target instance table, remove data before proceeding"); + return new CommandFailureResult(); + } + + if (bulkDataCopyService.CheckForTableColumnsDifferences("OM_Contact", requiredColumnsForContactMigration, out var differences)) + { + protocol.Append(HandbookReferences + .BulkCopyColumnMismatch("OM_Contact") + .NeedsManualAction() + .WithData(differences) + ); + logger.LogError("Table {TableName} columns do not match, fix columns before proceeding", "OM_Contact"); + { + return new CommandFailureResult(); + } + } + + primaryKeyMappingContext.PreloadDependencies(u => u.UserId); + primaryKeyMappingContext.PreloadDependencies(u => u.StateId); + primaryKeyMappingContext.PreloadDependencies(u => u.CountryId); + + var bulkCopyRequest = new BulkCopyRequest("OM_Contact", + s => true, // s => s != "ContactID", + _ => true, + 50000, + requiredColumnsForContactMigration.Keys.ToList(), + ContactValueInterceptor, + current => logger.LogError("Contact skipped due error, contact: {Contact}", PrintHelper.PrintDictionary(current)), + "ContactID" + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + try + { + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to migrate contacts"); + return new CommandFailureResult(); + } + + return null; + } + + private ValueInterceptorResult ContactValueInterceptor(int ordinal, string columnName, object value, Dictionary currentRow) + { + if (columnName.Equals(nameof(OmContact.ContactCompanyName), StringComparison.InvariantCultureIgnoreCase)) + { + // autofix removed in favor of error report and data consistency + // var truncatedValue = SqlDataTypeHelper.TruncateString(value, 100); + // return new ValueInterceptorResult(truncatedValue, true, false); + + if (value is string { Length: > 100 } s) + { + protocol.Append(HandbookReferences.ValueTruncationSkip("OM_Contact") + .WithData(new + { + value, + maxLength = 100, + s.Length, + columnName, + contact = PrintHelper.PrintDictionary(currentRow) + }) + ); + return ValueInterceptorResult.SkipRow; + } + } + + if (columnName.Equals(nameof(OmContact.ContactOwnerUserId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceUserId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.UserId, sourceUserId)) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + // try search member + if (keyMappingContext.MapSourceKey( + s => s.UserId, + s => s.UserGuid, + sourceUserId, + t => t.MemberId, + t => t.MemberGuid + ) is { Success: true, Mapped: { } memberId }) + { + return ValueInterceptorResult.ReplaceValue(memberId); + } + + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + if (columnName.Equals(nameof(OmContact.ContactStateId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceStateId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.StateId, sourceStateId.NullIfZero())) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + if (columnName.Equals(nameof(OmContact.ContactCountryId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceCountryId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.CountryId, sourceCountryId.NullIfZero())) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + + return ValueInterceptorResult.DoNothing; + } + + #endregion + + #region "Migrate contact activities" + + private CommandResult? MigrateContactActivities() //(List migratedSiteIds) + { + var requiredColumnsForContactMigration = new Dictionary + { + { nameof(KX13M.OmActivity.ActivityId), nameof(OmActivity.ActivityId) }, + { nameof(KX13M.OmActivity.ActivityContactId), nameof(OmActivity.ActivityContactId) }, + { nameof(KX13M.OmActivity.ActivityCreated), nameof(OmActivity.ActivityCreated) }, + { nameof(KX13M.OmActivity.ActivityType), nameof(OmActivity.ActivityType) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityItemId), nameof(KXO.Models.OmActivity.ActivityItemId) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityItemDetailId), nameof(KXO.Models.OmActivity.ActivityItemDetailId) }, + { nameof(KX13M.OmActivity.ActivityValue), nameof(OmActivity.ActivityValue) }, + { nameof(KX13M.OmActivity.ActivityUrl), nameof(OmActivity.ActivityUrl) }, + { nameof(KX13M.OmActivity.ActivityTitle), nameof(OmActivity.ActivityTitle) }, + { nameof(KX13M.OmActivity.ActivitySiteId), nameof(OmActivity.ActivityChannelId) }, + { nameof(KX13M.OmActivity.ActivityComment), nameof(OmActivity.ActivityComment) }, + // { nameof(OmActivity.ActivityCampaign), nameof(KXP.Models.OmActivity.ActivityCampaign) }, // deprecated without replacement in v27 + { nameof(KX13M.OmActivity.ActivityUrlreferrer), nameof(OmActivity.ActivityUrlreferrer) }, + { nameof(KX13M.OmActivity.ActivityCulture), nameof(OmActivity.ActivityLanguageId) }, + { nameof(KX13M.OmActivity.ActivityNodeId), nameof(OmActivity.ActivityWebPageItemGuid) }, + { nameof(KX13M.OmActivity.ActivityUtmsource), nameof(OmActivity.ActivityUtmsource) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityAbvariantName), nameof(KXO.Models.OmActivity.ActivityAbvariantName) }, + // OBSOLETE 26.0.0: { nameof(OmActivity.ActivityUrlhash), nameof(KXP.Models.OmActivity.ActivityUrlhash) }, + { nameof(KX13M.OmActivity.ActivityUtmcontent), nameof(OmActivity.ActivityUtmcontent) } + }; + + foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ActivityInfo.TYPEINFO.ObjectClassName)) + { + requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); + } + + if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Activity")) + { + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Activity")); + logger.LogError("Data must not exist in target instance table, remove data before proceeding"); + return new CommandFailureResult(); + } + + var bulkCopyRequest = new BulkCopyRequestExtended("OM_Activity", + s => true, + reader => true, + 50000, + requiredColumnsForContactMigration, + ActivityValueInterceptor, + current => logger.LogError("Contact activity skipped due error, activity: {Activity}", PrintHelper.PrintDictionary(current)), + "ActivityID" + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + + try + { + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to migrate activities"); + return new CommandFailureResult(); + } + + return null; + } + + private ValueInterceptorResult ActivityValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow) + { + if (columnName.Equals(nameof(KX13M.OmActivity.ActivitySiteId), StringComparison.InvariantCultureIgnoreCase) && + value is int sourceActivitySiteId) + { + var result = keyMappingContext.MapSourceKey( + s => s.SiteId, + s => s.SiteGuid, + sourceActivitySiteId.NullIfZero(), + t => t.ChannelId, + t => t.ChannelGuid + ); + switch (result) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id ?? 0); + case { Success: false }: + { + switch (toolConfiguration.UseOmActivitySiteRelationAutofix ?? AutofixEnum.Error) + { + case AutofixEnum.DiscardData: + logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => discard data", sourceActivitySiteId); + return ValueInterceptorResult.SkipRow; + case AutofixEnum.AttemptFix: + logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => ActivityNodeId=0", sourceActivitySiteId); + return ValueInterceptorResult.ReplaceValue(0); + case AutofixEnum.Error: + default: //error + protocol.Append(HandbookReferences + .MissingRequiredDependency(columnName, value) + .WithData(currentRow) + ); + return ValueInterceptorResult.SkipRow; + } + } + + default: + break; + } + } + + if (columnName.Equals(nameof(KX13M.OmActivity.ActivityNodeId), StringComparison.InvariantCultureIgnoreCase) && value is int activityNodeId) + { + if (currentRow.TryGetValue(nameof(KX13M.OmActivity.ActivitySiteId), out object? mSiteId) && mSiteId is int siteId) + { + if (spoiledGuidContext.GetNodeGuid(siteId, activityNodeId) is { } nodeGuid) + { + return ValueInterceptorResult.ReplaceValue(nodeGuid); + } + } + + switch (toolConfiguration.UseOmActivityNodeRelationAutofix ?? AutofixEnum.Error) + { + case AutofixEnum.DiscardData: + logger.LogTrace("Autofix (ActivitySiteId={NodeId} not exists) => discard data", activityNodeId); + return ValueInterceptorResult.SkipRow; + case AutofixEnum.AttemptFix: + logger.LogTrace("Autofix (ActivityNodeId={NodeId} not exists) => ActivityNodeId=0", activityNodeId); + return ValueInterceptorResult.ReplaceValue(null); + case AutofixEnum.Error: + default: //error + protocol.Append(HandbookReferences + .MissingRequiredDependency(columnName, value) + .WithData(currentRow) + ); + return ValueInterceptorResult.SkipRow; + } + } + + if (columnName.Equals(nameof(KX13M.OmActivity.ActivityCulture), StringComparison.InvariantCultureIgnoreCase) && value is string cultureCode) + { + return ValueInterceptorResult.ReplaceValue(ContentLanguageInfoProvider.ProviderObject.Get(cultureCode)?.ContentLanguageID); + } + + return ValueInterceptorResult.DoNothing; + } + + #endregion +} diff --git a/Migration.Tool.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs b/Migration.Tool.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs new file mode 100644 index 00000000..538b7e0c --- /dev/null +++ b/Migration.Tool.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs @@ -0,0 +1,281 @@ +using CMS.DataProtection; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.KX13.Context; +using Migration.Tool.KXP.Context; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX13.Handlers; + +public class MigrateDataProtectionCommandHandler : IRequestHandler, IDisposable +{ + private static readonly int batchSize = 1000; + private readonly IEntityMapper consentAgreementMapper; + private readonly IEntityMapper consentArchiveMapper; + private readonly IEntityMapper consentMapper; + private readonly IDbContextFactory kx13ContextFactory; + private readonly IDbContextFactory kxpContextFactory; + private readonly ILogger logger; + private readonly PrimaryKeyMappingContext primaryKeyMappingContext; + private readonly IProtocol protocol; + + private KxpContext kxpContext; + + public MigrateDataProtectionCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory kx13ContextFactory, + IEntityMapper consentMapper, + IEntityMapper consentArchiveMapper, + IEntityMapper consentAgreementMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) + { + this.logger = logger; + this.kxpContextFactory = kxpContextFactory; + this.kx13ContextFactory = kx13ContextFactory; + this.consentMapper = consentMapper; + this.consentArchiveMapper = consentArchiveMapper; + this.consentAgreementMapper = consentAgreementMapper; + this.primaryKeyMappingContext = primaryKeyMappingContext; + this.protocol = protocol; + kxpContext = this.kxpContextFactory.CreateDbContext(); + } + + public void Dispose() => kxpContext.Dispose(); + + public async Task Handle(MigrateDataProtectionCommand request, CancellationToken cancellationToken) + { + await MigrateConsent(cancellationToken); + await MigrateConsentArchive(cancellationToken); + await MigrateConsentAgreement(cancellationToken, batchSize); + + return new GenericCommandResult(); + } + + private async Task MigrateConsent(CancellationToken cancellationToken) + { + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + + foreach (var kx13Consent in kx13Context.CmsConsents) + { + protocol.FetchedSource(kx13Consent); + logger.LogTrace("Migrating consent {ConsentName} with ConsentGuid {ConsentGuid}", kx13Consent.ConsentName, kx13Consent.ConsentGuid); + + var kxoConsent = await kxpContext.CmsConsents.FirstOrDefaultAsync(consent => consent.ConsentGuid == kx13Consent.ConsentGuid, cancellationToken); + protocol.FetchedTarget(kxoConsent); + + var mapped = consentMapper.Map(kx13Consent, kxoConsent); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsent, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsent, nameof(cmsConsent)); + + if (newInstance) + { + kxpContext.CmsConsents.Add(cmsConsent); + } + else + { + kxpContext.CmsConsents.Update(cmsConsent); + } + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + protocol.Success(kx13Consent, cmsConsent, mapped); + logger.LogEntitySetAction(newInstance, cmsConsent); + primaryKeyMappingContext.SetMapping(r => r.ConsentId, kx13Consent.ConsentId, cmsConsent.ConsentId); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, kx13Consent); + protocol.Append(HandbookReferences + .DbConstraintBroken(sqlException, kx13Consent) + .WithMessage("Failed to migrate consent, target database constraint broken.") + ); + + await kxpContext.DisposeAsync(); + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + } + } + + return new GenericCommandResult(); + } + + private async Task MigrateConsentArchive(CancellationToken cancellationToken) + { + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + + foreach (var kx13ArchiveConsent in kx13Context.CmsConsentArchives) + { + protocol.FetchedSource(kx13ArchiveConsent); + logger.LogTrace("Migrating consent archive with ConsentArchiveGuid {ConsentGuid}", kx13ArchiveConsent.ConsentArchiveGuid); + + var kxoConsentArchive = await kxpContext.CmsConsentArchives.FirstOrDefaultAsync(consentArchive => consentArchive.ConsentArchiveGuid == kx13ArchiveConsent.ConsentArchiveGuid, cancellationToken); + protocol.FetchedTarget(kxoConsentArchive); + + var mapped = consentArchiveMapper.Map(kx13ArchiveConsent, kxoConsentArchive); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsentArchive, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsentArchive, nameof(cmsConsentArchive)); + + if (newInstance) + { + kxpContext.CmsConsentArchives.Add(cmsConsentArchive); + } + else + { + kxpContext.CmsConsentArchives.Update(cmsConsentArchive); + } + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + protocol.Success(kx13ArchiveConsent, cmsConsentArchive, mapped); + logger.LogEntitySetAction(newInstance, cmsConsentArchive); + primaryKeyMappingContext.SetMapping(r => r.ConsentArchiveGuid, + kx13ArchiveConsent.ConsentArchiveId, cmsConsentArchive.ConsentArchiveId); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, kx13ArchiveConsent); + protocol.Append(HandbookReferences + .DbConstraintBroken(sqlException, kx13ArchiveConsent) + .WithMessage("Failed to migrate consent archive, target database constraint broken.") + ); + + await kxpContext.DisposeAsync(); + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + } + } + + return new GenericCommandResult(); + } + + private async Task MigrateConsentAgreement(CancellationToken cancellationToken, int batchSize) + { + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + int index = 0; + int indexFull = 0; + var consentAgreementUpdates = new List(); + var consentAgreementNews = new List(); + int itemsCount = kx13Context.CmsConsentAgreements.Count(); + + foreach (var kx13ConsentAgreement in kx13Context.CmsConsentAgreements) + { + protocol.FetchedSource(kx13ConsentAgreement); + logger.LogTrace("Migrating consent agreement with ConsentAgreementGuid {ConsentAgreementGuid}", kx13ConsentAgreement.ConsentAgreementGuid); + + var kxoConsentAgreement = await kxpContext.CmsConsentAgreements.FirstOrDefaultAsync(consentAgreement => consentAgreement.ConsentAgreementGuid == kx13ConsentAgreement.ConsentAgreementGuid, cancellationToken); + protocol.FetchedTarget(kxoConsentAgreement); + + var mapped = consentAgreementMapper.Map(kx13ConsentAgreement, kxoConsentAgreement); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsentAgreement, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsentAgreement, nameof(cmsConsentAgreement)); + + if (newInstance) + { + consentAgreementNews.Add(cmsConsentAgreement); + } + else + { + consentAgreementUpdates.Add(cmsConsentAgreement); + } + } + + index++; + indexFull++; + + if (index == batchSize || indexFull == itemsCount) + { + kxpContext.CmsConsentAgreements.AddRange(consentAgreementNews); + kxpContext.CmsConsentAgreements.UpdateRange(consentAgreementUpdates); + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + foreach (var newKx13ConsentAgreement in consentAgreementNews) + { + protocol.Success(kx13ConsentAgreement, newKx13ConsentAgreement, mapped); + logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was inserted", + newKx13ConsentAgreement.ConsentAgreementGuid); + } + + foreach (var updateKx13ConsentAgreement in consentAgreementUpdates) + { + protocol.Success(kx13ConsentAgreement, updateKx13ConsentAgreement, mapped); + logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was updated", + updateKx13ConsentAgreement.ConsentAgreementGuid); + } + } + catch (DbUpdateException dbUpdateException) when ( + dbUpdateException.InnerException is SqlException sqlException && + sqlException.Message.Contains("Cannot insert duplicate key row in object") + ) + { + await kxpContext.DisposeAsync(); + + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrints(consentAgreementNews) + ); + logger.LogEntitiesSetError(dbUpdateException, true, consentAgreementNews); + + + protocol.Append(HandbookReferences + .ErrorUpdatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrints(consentAgreementUpdates) + ); + + var cai = ConsentAgreementInfo.New(); + protocol.Append(HandbookReferences + .ErrorUpdatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrint(cai) + ); + + logger.LogEntitiesSetError(dbUpdateException, false, consentAgreementUpdates); + + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + finally + { + index = 0; + consentAgreementUpdates = []; + consentAgreementNews = []; + } + } + } + + return new GenericCommandResult(); + } +} diff --git a/Migration.Tool.Core.KX13/Handlers/MigrateMembersCommandHandler.cs b/Migration.Tool.Core.KX13/Handlers/MigrateMembersCommandHandler.cs new file mode 100644 index 00000000..837b1b11 --- /dev/null +++ b/Migration.Tool.Core.KX13/Handlers/MigrateMembersCommandHandler.cs @@ -0,0 +1,111 @@ +using System.Diagnostics; + +using CMS.Membership; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.Core.KX13.Mappers; +using Migration.Tool.KX13.Context; +using Migration.Tool.KXP.Api.Enums; + +namespace Migration.Tool.Core.KX13.Handlers; + +public class MigrateMembersCommandHandler( + ILogger logger, + IDbContextFactory kx13ContextFactory, + IEntityMapper memberInfoMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private const string USER_PUBLIC = "public"; + + public void Dispose() + { + } + + public async Task Handle(MigrateMembersCommand request, CancellationToken cancellationToken) + { + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + + var kx13CmsUsers = kx13Context.CmsUsers + .Include(u => u.CmsUserSettingUserSettingsUserNavigation) + .Where(u => u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.None) + ; + + foreach (var kx13User in kx13CmsUsers) + { + protocol.FetchedSource(kx13User); + logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid} to member", kx13User.UserName, kx13User.UserGuid); + + var xbkMemberInfo = MemberInfoProvider.ProviderObject.Get(kx13User.UserGuid); + + protocol.FetchedTarget(xbkMemberInfo); + + // no member shall be admin, editor + Debug.Assert(kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin, "kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin"); + Debug.Assert(kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin, "kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin"); + Debug.Assert(kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor, "kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor"); + + if (xbkMemberInfo?.MemberName == USER_PUBLIC || kx13User.UserName == USER_PUBLIC) + { + continue; + } + + var mapped = memberInfoMapper.Map(new MemberInfoMapperSource(kx13User, kx13User.CmsUserSettingUserSettingsUserNavigation), xbkMemberInfo); + protocol.MappedTarget(mapped); + + SaveUserUsingKenticoApi(mapped, kx13User); + } + + return new GenericCommandResult(); + } + + private void SaveUserUsingKenticoApi(IModelMappingResult mapped, KX13M.CmsUser kx13User) + { + if (mapped is { Success: true } result) + { + (var memberInfo, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(memberInfo); + + try + { + MemberInfoProvider.ProviderObject.Set(memberInfo); + + protocol.Success(kx13User, memberInfo, mapped); + logger.LogEntitySetAction(newInstance, memberInfo); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, memberInfo); + protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, kx13User) + .WithData(new { kx13User.UserName, kx13User.UserGuid, kx13User.UserId }) + .WithMessage("Failed to migrate user, target database broken.") + ); + return; + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, memberInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(memberInfo) + ); + return; + } + + // left for OM_Activity + primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, memberInfo.MemberID); + } + } +} diff --git a/Migration.Tool.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs b/Migration.Tool.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs new file mode 100644 index 00000000..bdd0cccf --- /dev/null +++ b/Migration.Tool.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs @@ -0,0 +1,84 @@ +using CMS.DataEngine; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.KX13.Context; + +namespace Migration.Tool.Core.KX13.Handlers; + +public class MigrateSettingKeysCommandHandler( + ILogger logger, + IEntityMapper mapper, + IDbContextFactory kx13ContextFactory, + ToolConfiguration toolConfiguration, + IProtocol protocol) + : IRequestHandler +{ + public async Task Handle(MigrateSettingKeysCommand request, CancellationToken cancellationToken) + { + var entityConfiguration = toolConfiguration.EntityConfigurations.GetEntityConfiguration(); + + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + + logger.LogInformation("CmsSettingsKey synchronization starting"); + var cmsSettingsKeys = kx13Context.CmsSettingsKeys + .Where(csk => csk.SiteId == null) + .AsNoTrackingWithIdentityResolution() + ; + + foreach (var kx13CmsSettingsKey in cmsSettingsKeys) + { + protocol.FetchedSource(kx13CmsSettingsKey); + + var kxoGlobalSettingsKey = GetKxoSettingsKey(kx13CmsSettingsKey); + + bool canBeMigrated = !kxoGlobalSettingsKey?.KeyIsHidden ?? false; + var kxoCmsSettingsKey = kx13CmsSettingsKey.SiteId is null ? kxoGlobalSettingsKey : GetKxoSettingsKey(kx13CmsSettingsKey); + + if (!canBeMigrated) + { + logger.LogInformation("Setting with key '{KeyName}' is currently not supported for migration", kx13CmsSettingsKey.KeyName); + protocol.Append( + HandbookReferences + .NotCurrentlySupportedSkip() + .WithId(nameof(kx13CmsSettingsKey.KeyId), kx13CmsSettingsKey.KeyId) + .WithMessage("Settings key is not supported in target instance") + .WithData(new { kx13CmsSettingsKey.KeyName, kx13CmsSettingsKey.SiteId, kx13CmsSettingsKey.KeyGuid }) + ); + continue; + } + + protocol.FetchedTarget(kxoCmsSettingsKey); + + if (entityConfiguration.ExcludeCodeNames.Contains(kx13CmsSettingsKey.KeyName)) + { + protocol.Warning(HandbookReferences.CmsSettingsKeyExclusionListSkip, kx13CmsSettingsKey); + logger.LogWarning("KeyName {KeyName} is excluded => skipping", kx13CmsSettingsKey.KeyName); + continue; + } + + var mapped = mapper.Map(kx13CmsSettingsKey, kxoCmsSettingsKey); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + ArgumentNullException.ThrowIfNull(result.Item, nameof(result.Item)); + + SettingsKeyInfoProvider.ProviderObject.Set(result.Item); + + protocol.Success(kx13CmsSettingsKey, kxoCmsSettingsKey, mapped); + logger.LogEntitySetAction(result.NewInstance, result.Item); + } + } + + return new GenericCommandResult(); + } + + private SettingsKeyInfo? GetKxoSettingsKey(KX13M.CmsSettingsKey kx13CmsSettingsKey) => SettingsKeyInfoProvider.ProviderObject.Get(kx13CmsSettingsKey.KeyName); +} diff --git a/Migration.Tool.Core.KX13/Handlers/MigrateSitesCommandHandler.cs b/Migration.Tool.Core.KX13/Handlers/MigrateSitesCommandHandler.cs new file mode 100644 index 00000000..4a99b8ad --- /dev/null +++ b/Migration.Tool.Core.KX13/Handlers/MigrateSitesCommandHandler.cs @@ -0,0 +1,191 @@ +using CMS.ContentEngine; +using CMS.Websites; + +using Kentico.Xperience.UMT.Model; +using Kentico.Xperience.UMT.Services; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Helpers; +using Migration.Tool.KX13; +using Migration.Tool.KX13.Context; + +namespace Migration.Tool.Core.KX13.Handlers; + +// ReSharper disable once UnusedType.Global +public class MigrateSitesCommandHandler( + ILogger logger, + IDbContextFactory kx13ContextFactory, + IProtocol protocol, + IImporter importer) + : IRequestHandler +{ + public async Task Handle(MigrateSitesCommand request, CancellationToken cancellationToken) + { + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + var migratedCultureCodes = new Dictionary(StringComparer.CurrentCultureIgnoreCase); + foreach (var kx13CmsSite in kx13Context.CmsSites.Include(s => s.Cultures)) + { + protocol.FetchedSource(kx13CmsSite); + logger.LogTrace("Migrating site {SiteName} with SiteGuid {SiteGuid}", kx13CmsSite.SiteName, kx13CmsSite.SiteGuid); + + string defaultCultureCode = GetSiteCulture(kx13CmsSite); + var migratedSiteCultures = kx13CmsSite.Cultures.ToList(); + if (!migratedSiteCultures.Any(x => x.CultureCode.Equals(defaultCultureCode, StringComparison.InvariantCultureIgnoreCase))) + { + await using var ctx = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + if (ctx.CmsCultures.FirstOrDefault(c => c.CultureCode == defaultCultureCode) is { } defaultCulture) + { + migratedSiteCultures.Add(defaultCulture); + } + } + + foreach (var cmsCulture in migratedSiteCultures) + { + var existing = ContentLanguageInfoProvider.ProviderObject.Get() + .WhereEquals(nameof(ContentLanguageInfo.ContentLanguageCultureFormat), cmsCulture.CultureCode) + .FirstOrDefault(); + + if (existing != null && existing.ContentLanguageGUID != cmsCulture.CultureGuid) + { + existing.ContentLanguageGUID = cmsCulture.CultureGuid; + existing.Update(); + } + + if (migratedCultureCodes.ContainsKey(cmsCulture.CultureCode)) + { + continue; + } + + var langResult = await importer.ImportAsync(new ContentLanguageModel + { + ContentLanguageGUID = cmsCulture.CultureGuid, + ContentLanguageDisplayName = cmsCulture.CultureName, + ContentLanguageName = cmsCulture.CultureCode, + ContentLanguageIsDefault = true, + ContentLanguageFallbackContentLanguageGuid = null, + ContentLanguageCultureFormat = cmsCulture.CultureCode + }); + + if (langResult is { Success: true, Imported: ContentLanguageInfo importedLanguage }) + { + migratedCultureCodes.TryAdd(cmsCulture.CultureCode, importedLanguage); + logger.LogTrace("Imported language {Language} from {Culture}", importedLanguage.ContentLanguageName, cmsCulture.CultureCode); + } + } + + + string? homePagePath = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, SettingsKeys.CMSHomePagePath); + int? cookieLevel = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, SettingsKeys.CMSDefaultCookieLevel) switch + { + "all" => CookieLevelConstants.ALL, + "visitor" => CookieLevelConstants.VISITOR, + "editor" => CookieLevelConstants.EDITOR, + "system" => CookieLevelConstants.SYSTEM, + "essential" => CookieLevelConstants.ESSENTIAL, + _ => null + }; + bool? storeFormerUrls = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSStoreFormerUrls") is string storeFormerUrlsStr + ? bool.TryParse(storeFormerUrlsStr, out bool sfu) ? sfu : null + : null; + + var channelResult = await importer.ImportAsync(new ChannelModel { ChannelDisplayName = kx13CmsSite.SiteDisplayName, ChannelName = kx13CmsSite.SiteName, ChannelGUID = kx13CmsSite.SiteGuid, ChannelType = ChannelType.Website }); + + var webSiteChannelResult = await importer.ImportAsync(new WebsiteChannelModel + { + WebsiteChannelGUID = kx13CmsSite.SiteGuid, + WebsiteChannelChannelGuid = kx13CmsSite.SiteGuid, + WebsiteChannelDomain = kx13CmsSite.SiteDomainName, + WebsiteChannelHomePage = homePagePath, + WebsiteChannelPrimaryContentLanguageGuid = migratedCultureCodes[defaultCultureCode].ContentLanguageGUID, + WebsiteChannelDefaultCookieLevel = cookieLevel, + WebsiteChannelStoreFormerUrls = storeFormerUrls + }); + + if (!webSiteChannelResult.Success) + { + if (webSiteChannelResult.ModelValidationResults != null) + { + foreach (var mvr in webSiteChannelResult.ModelValidationResults) + { + logger.LogError("Invalid channel properties {Members}: {ErrorMessage}", string.Join(", ", mvr.MemberNames), mvr.ErrorMessage); + } + } + else + { + logger.LogError(webSiteChannelResult.Exception, "Failed to migrate site"); + } + + return new CommandFailureResult(); + } + + if (webSiteChannelResult.Imported is WebsiteChannelInfo webSiteChannel) + { + string? cmsReCaptchaPublicKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSReCaptchaPublicKey"); + string? cmsReCaptchaPrivateKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSReCaptchaPrivateKey"); + + WebsiteCaptchaSettingsInfo? reCaptchaSettings = null; + string? cmsReCaptchaV3PrivateKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSReCaptchaV3PrivateKey"); + string? cmsRecaptchaV3PublicKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSRecaptchaV3PublicKey"); + double? cmsRecaptchaV3Threshold = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSRecaptchaV3Threshold"); + + if (!string.IsNullOrWhiteSpace(cmsReCaptchaV3PrivateKey) || !string.IsNullOrWhiteSpace(cmsRecaptchaV3PublicKey)) + { + reCaptchaSettings = new WebsiteCaptchaSettingsInfo + { + WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, + WebsiteCaptchaSettingsReCaptchaSiteKey = cmsRecaptchaV3PublicKey, + WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaV3PrivateKey, + WebsiteCaptchaSettingsReCaptchaThreshold = cmsRecaptchaV3Threshold ?? 0.5d, + WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV3 + }; + } + + if (!string.IsNullOrWhiteSpace(cmsReCaptchaPublicKey) || !string.IsNullOrWhiteSpace(cmsReCaptchaPrivateKey)) + { + if (reCaptchaSettings is not null) + { + logger.LogError(""" + Conflicting settings found, ReCaptchaV2 and ReCaptchaV3 is set simultaneously. + Remove setting keys 'CMSReCaptchaPublicKey', 'CMSReCaptchaPrivateKey' + or remove setting keys 'CMSReCaptchaV3PrivateKey', 'CMSRecaptchaV3PublicKey', 'CMSRecaptchaV3Threshold'. + """); + throw new InvalidOperationException("Invalid ReCaptcha settings"); + } + + reCaptchaSettings = new WebsiteCaptchaSettingsInfo + { + WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, + WebsiteCaptchaSettingsReCaptchaSiteKey = cmsReCaptchaPublicKey, + WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaPrivateKey, + WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV2 + }; + } + + if (reCaptchaSettings != null) + { + WebsiteCaptchaSettingsInfo.Provider.Set(reCaptchaSettings); + } + } + } + + return new GenericCommandResult(); + } + + private string GetSiteCulture(KX13M.CmsSite site) + { + // simplified logic from CMS.DocumentEngine.DefaultPreferredCultureEvaluator.Evaluate() + // domain alias skipped, HttpContext logic skipped + string? siteCulture = site.SiteDefaultVisitorCulture + ?? KenticoHelper.GetSettingsKey(kx13ContextFactory, site.SiteId, SettingsKeys.CMSDefaultCultureCode); + + return siteCulture + ?? throw new InvalidOperationException("Unknown site culture"); + } +} diff --git a/Migration.Tool.Core.KX13/Handlers/MigrateUsersCommandHandler.cs b/Migration.Tool.Core.KX13/Handlers/MigrateUsersCommandHandler.cs new file mode 100644 index 00000000..e5d59193 --- /dev/null +++ b/Migration.Tool.Core.KX13/Handlers/MigrateUsersCommandHandler.cs @@ -0,0 +1,236 @@ +using CMS.Membership; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.KX13.Context; +using Migration.Tool.KXP.Api.Enums; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX13.Handlers; + +public class MigrateUsersCommandHandler( + ILogger logger, + IDbContextFactory kx13ContextFactory, + IEntityMapper userInfoMapper, + IEntityMapper roleMapper, + IEntityMapper userRoleMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private const string USER_PUBLIC = "public"; + + public void Dispose() + { + } + + public async Task Handle(MigrateUsersCommand request, CancellationToken cancellationToken) + { + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + + var kx13CmsUsers = kx13Context.CmsUsers + .Where(u => u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) + ; + + foreach (var kx13User in kx13CmsUsers) + { + protocol.FetchedSource(kx13User); + logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid}", kx13User.UserName, kx13User.UserGuid); + + var xbkUserInfo = UserInfoProvider.ProviderObject.Get(kx13User.UserGuid); + + protocol.FetchedTarget(xbkUserInfo); + + if (kx13User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin && xbkUserInfo != null) + { + protocol.Append(HandbookReferences.CmsUserAdminUserSkip.WithIdentityPrint(xbkUserInfo)); + logger.LogInformation("User with guid {UserGuid} is administrator, you need to update administrators manually => skipping", kx13User.UserGuid); + primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, xbkUserInfo.UserID); + continue; + } + + if (xbkUserInfo?.UserName == USER_PUBLIC || kx13User.UserName == USER_PUBLIC) + { + protocol.Append(HandbookReferences.CmsUserPublicUserSkip.WithIdentityPrint(xbkUserInfo)); + logger.LogInformation("User with guid {UserGuid} is public user, special case that can't be migrated => skipping", xbkUserInfo?.UserGUID ?? kx13User.UserGuid); + if (xbkUserInfo != null) + { + primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, xbkUserInfo.UserID); + } + + continue; + } + + var mapped = userInfoMapper.Map(kx13User, xbkUserInfo); + protocol.MappedTarget(mapped); + + await SaveUserUsingKenticoApi(mapped, kx13User); + } + + await MigrateUserCmsRoles(kx13Context, cancellationToken); + + return new GenericCommandResult(); + } + + private Task SaveUserUsingKenticoApi(IModelMappingResult mapped, KX13M.CmsUser kx13User) + { + if (mapped is { Success: true } result) + { + (var userInfo, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(userInfo); + + try + { + UserInfoProvider.ProviderObject.Set(userInfo); + + protocol.Success(kx13User, userInfo, mapped); + logger.LogEntitySetAction(newInstance, userInfo); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, userInfo); + protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, kx13User) + .WithData(new { kx13User.UserName, kx13User.UserGuid, kx13User.UserId }) + .WithMessage("Failed to migrate user, target database broken.") + ); + return Task.CompletedTask; + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, userInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(userInfo) + ); + return Task.CompletedTask; + } + + primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, userInfo.UserID); + return Task.CompletedTask; + } + + return Task.CompletedTask; + } + + private async Task MigrateUserCmsRoles(KX13Context kx13Context, CancellationToken cancellationToken) + { + var kx13CmsRoles = kx13Context.CmsRoles + .Where(r => + r.CmsUserRoles.Any(ur => ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) + ) + .AsNoTracking() + .AsAsyncEnumerable(); + + await foreach (var kx13CmsRole in kx13CmsRoles.WithCancellation(cancellationToken)) + { + protocol.FetchedSource(kx13CmsRole); + + var xbkRoleInfo = RoleInfoProvider.ProviderObject.Get(kx13CmsRole.RoleGuid); + protocol.FetchedTarget(xbkRoleInfo); + var mapped = roleMapper.Map(kx13CmsRole, xbkRoleInfo); + protocol.MappedTarget(mapped); + + if (mapped is not (var roleInfo, var newInstance) { Success: true }) + { + continue; + } + + ArgumentNullException.ThrowIfNull(roleInfo, nameof(roleInfo)); + try + { + RoleInfoProvider.ProviderObject.Set(roleInfo); + + protocol.Success(kx13CmsRole, roleInfo, mapped); + logger.LogEntitySetAction(newInstance, roleInfo); + + primaryKeyMappingContext.SetMapping( + r => r.RoleId, + kx13CmsRole.RoleId, + roleInfo.RoleID + ); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, roleInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(roleInfo) + ); + continue; + } + + await MigrateUserRole(kx13CmsRole.RoleId); + } + } + + private async Task MigrateUserRole(int kx13RoleId) + { + var kx13Context = await kx13ContextFactory.CreateDbContextAsync(); + var kx13UserRoles = kx13Context.CmsUserRoles + .Where(ur => + ur.RoleId == kx13RoleId && + (ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) + ) + .AsNoTracking() + .AsAsyncEnumerable(); + + await foreach (var kx13UserRole in kx13UserRoles) + { + protocol.FetchedSource(kx13UserRole); + if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.RoleId, kx13RoleId, out int xbkRoleId)) + { + var handbookRef = HandbookReferences + .MissingRequiredDependency(nameof(UserRoleInfo.RoleID), kx13UserRole.RoleId) + .NeedsManualAction(); + + protocol.Append(handbookRef); + logger.LogWarning("Unable to locate role in target instance with source RoleID '{RoleID}'", kx13UserRole.RoleId); + continue; + } + + if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.UserId, kx13UserRole.UserId, out int xbkUserId)) + { + continue; + } + + var xbkUserRole = UserRoleInfoProvider.ProviderObject.Get(xbkUserId, xbkRoleId); + protocol.FetchedTarget(xbkUserRole); + + var mapped = userRoleMapper.Map(kx13UserRole, xbkUserRole); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true }) + { + (var userRoleInfo, bool newInstance) = mapped; + ArgumentNullException.ThrowIfNull(userRoleInfo); + + try + { + UserRoleInfoProvider.ProviderObject.Set(userRoleInfo); + + protocol.Success(kx13UserRole, userRoleInfo, mapped); + logger.LogEntitySetAction(newInstance, userRoleInfo); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, userRoleInfo); + protocol.Append(HandbookReferences.ErrorSavingTargetInstance(ex) + .WithData(new { kx13UserRole.UserRoleId, kx13UserRole.UserId, kx13UserRole.RoleId }) + .WithMessage("Failed to migrate user role") + ); + } + } + } + } +} diff --git a/Migration.Tool.Core.KX13/Helpers/KenticoHelper.cs b/Migration.Tool.Core.KX13/Helpers/KenticoHelper.cs new file mode 100644 index 00000000..07034796 --- /dev/null +++ b/Migration.Tool.Core.KX13/Helpers/KenticoHelper.cs @@ -0,0 +1,46 @@ +using System.Globalization; + +using CMS.Helpers; + +using Microsoft.EntityFrameworkCore; + +using Migration.Tool.KX13.Context; + +namespace Migration.Tool.Core.KX13.Helpers; + +public static class KenticoHelper +{ + public static void CopyCustomData(ContainerCustomData target, string? sourceXml) + { + var customNodeData = new ContainerCustomData(); + customNodeData.LoadData(sourceXml); + foreach (string? columnName in customNodeData.ColumnNames) + { + target.SetValue(columnName, customNodeData.GetValue(columnName)); + } + } + + public static string? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) + { + using var kx13Context = ctxf.CreateDbContext(); + var keys = kx13Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); + + return (keys.FirstOrDefault(x => x.SiteId == siteId) + ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; + } + + public static T? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) where T : struct, IParsable + { + using var kx13Context = ctxf.CreateDbContext(); + var keys = kx13Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); + string? value = (keys.FirstOrDefault(x => x.SiteId == siteId) + ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; + + + return T.TryParse(value, CultureInfo.InvariantCulture, out var result) + ? result + : null; + } + + public static bool? TryGetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName, out T? result) where T : IParsable => T.TryParse(GetSettingsKey(ctxf, siteId, keyName), CultureInfo.InvariantCulture, out result); +} diff --git a/Migration.Tool.Core.KX13/Helpers/PrintHelper.cs b/Migration.Tool.Core.KX13/Helpers/PrintHelper.cs new file mode 100644 index 00000000..1ba89a13 --- /dev/null +++ b/Migration.Tool.Core.KX13/Helpers/PrintHelper.cs @@ -0,0 +1,7 @@ +namespace Migration.Tool.Core.KX13.Helpers; + +public static class PrintHelper +{ + public static string PrintDictionary(Dictionary dictionary) => + string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); +} diff --git a/Migration.Tool.Core.KX13/Helpers/Printer.cs b/Migration.Tool.Core.KX13/Helpers/Printer.cs new file mode 100644 index 00000000..b0130c98 --- /dev/null +++ b/Migration.Tool.Core.KX13/Helpers/Printer.cs @@ -0,0 +1,103 @@ +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.Globalization; +using CMS.MediaLibrary; +using CMS.Membership; +using CMS.Modules; + +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.Services; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX13.Helpers; + +public class Printer +{ + public static string PrintKxpModelInfo(T model) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + return model switch + { + MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", + MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", + CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", + CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", + CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", + CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", + CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", + CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", + OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", + + null => $"{currentTypeName}: ", + _ => $"TODO: {typeof(T).FullName}" + }; + } + + public static string GetEntityIdentityPrint(T model, bool printType = true) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + string Fallback(object obj) => printType + ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" + : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}"; + + string FormatModel(string inner) => printType + ? $"{currentTypeName}({inner})" + : $"{inner}"; + + return model switch + { + MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), + MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), + DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), + + CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), + StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), + + ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), + AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), + UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), + RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), + MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), + + CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), + CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), + CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), + + KX13M.CmsPageTemplateConfiguration item => FormatModel($"ID={item.PageTemplateConfigurationId}, GUID={item.PageTemplateConfigurationGuid}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteId}"), + KX13M.CmsRole item => FormatModel($"ID={item.RoleId}, GUID={item.RoleGuid}, Name={item.RoleName}, SiteId={item.SiteId}"), + KX13M.CmsAttachment item => FormatModel($"ID={item.AttachmentId}, GUID={item.AttachmentGuid}, Name={item.AttachmentName}"), + KX13M.CmsClass item => FormatModel($"ID={item.ClassId}, GUID={item.ClassGuid}, Name={item.ClassName}"), + KX13M.CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + KX13M.CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + KX13M.CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + KX13M.CmsCountry item => FormatModel($"ID={item.CountryId}, GUID={item.CountryGuid}, Name={item.CountryName}"), + KX13M.CmsState item => FormatModel($"ID={item.StateId}, GUID={item.StateGuid}, Name={item.StateName}"), + KX13M.CmsTree item => FormatModel($"NodeID={item.NodeId}, NodeGUID={item.NodeGuid}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), + KX13M.CmsDocument item => FormatModel($"NodeID={item.DocumentNodeId}, DocumentID={item.DocumentId}, DocumentGUID={item.DocumentGuid}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), + KX13M.CmsResource item => FormatModel($"ID={item.ResourceId}, GUID={item.ResourceGuid}, Name={item.ResourceName}"), + + null => $" ref of {currentTypeName}", + _ => Fallback(model) + }; + } + + public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); + + public static string PrintEnumValues(string separator) where TEnum : struct, Enum => string.Join(separator, Enum.GetValues()); +} + +public class PrintService : IPrintService +{ + public string PrintKxpModelInfo(T model) => Printer.PrintKxpModelInfo(model); + + public string GetEntityIdentityPrint(T model, bool printType = true) => Printer.GetEntityIdentityPrint(model, printType); + + public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => Printer.GetEntityIdentityPrints(models, separator); + + public string PrintEnumValues(string separator) where TEnum : struct, Enum => Printer.PrintEnumValues(separator); +} diff --git a/Migration.Tool.Core.KX13/Mappers/AlternativeFormMapper.cs b/Migration.Tool.Core.KX13/Mappers/AlternativeFormMapper.cs new file mode 100644 index 00000000..daab52c3 --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/AlternativeFormMapper.cs @@ -0,0 +1,90 @@ +using CMS.DataEngine; +using CMS.FormEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.KXP.Api.Services.CmsClass; + +namespace Migration.Tool.Core.KX13.Mappers; + +public record AlternativeFormMapperSource(KX13M.CmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); + +public class AlternativeFormMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, FieldMigrationService fieldMigrationService) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) + => AlternativeFormInfo.New(); + + protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (source, xbkFormClass) = sourceObj; + + target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormClassId, out int? classId) + ? classId ?? 0 + : 0; + target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormCoupledClassId, out int? coupledClassId) + ? coupledClassId ?? 0 + : 0; + + bool coupledClassIsDeprecated = + source.FormCoupledClass?.ClassName is { } coupledClassName && + Kx13SystemClass.NoLongerSupported.Contains(coupledClassName); + + bool classIsSysInternal = Kx13SystemClass.All.Contains(source.FormClass.ClassName); + + string mergedDefinition = source.FormClass.ClassFormDefinition; + if (source.FormCoupledClass != null) + { + logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", source.FormCoupledClass.ClassName, source.FormClass.ClassName); + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormCoupledClass.ClassFormDefinition); + } + + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); + + var patcher = new FormDefinitionPatcher( + logger, + mergedDefinition, + fieldMigrationService, + source.FormClass.ClassIsForm.GetValueOrDefault(false), + source.FormClass.ClassIsDocumentType, + false, + !classIsSysInternal, + true + ); + + var fieldNames = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); + + patcher.PatchFields(); + + var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); + + if (coupledClassIsDeprecated && source.FormCoupledClass != null) + { + logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", source.FormCoupledClass.ClassName); + patcher.RemoveFields(source.FormCoupledClass.ClassFormDefinition); + + var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); + } + + string result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); + + string formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); + + target.FormDefinition = formDefinitionDifference; + + target.FormDisplayName = source.FormDisplayName; + target.FormGUID = source.FormGuid; + target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); + target.FormLastModified = source.FormLastModified; + target.FormName = source.FormName; + + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/CmsAttachmentMapper.cs b/Migration.Tool.Core.KX13/Mappers/CmsAttachmentMapper.cs new file mode 100644 index 00000000..875f38b6 --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/CmsAttachmentMapper.cs @@ -0,0 +1,62 @@ +using CMS.Base; +using CMS.MediaLibrary; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.Core.KX13.Helpers; + +namespace Migration.Tool.Core.KX13.Mappers; + +public record CmsAttachmentMapperSource( + KX13M.CmsAttachment Attachment, + int TargetLibraryId, + IUploadedFile File, + string LibrarySubFolder, + KX13M.CmsDocument? AttachmentDocument); + +public class CmsAttachmentMapper : EntityMapperBase +{ + private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; + + public CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => + // library name is generated with site name in it + new(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); + + protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + (var cmsAttachment, int targetLibraryId, _, _, var attachmentDocument) = args; + + target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); + target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; + target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; + target.FileExtension = cmsAttachment.AttachmentExtension; + target.FileMimeType = cmsAttachment.AttachmentMimeType; + target.FileSize = cmsAttachment.AttachmentSize; + target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; + target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; + target.FileGUID = cmsAttachment.AttachmentGuid; + target.FileLibraryID = targetLibraryId; + + // target.FileCreatedByUserID = cmsAttachment.?; + // target.FileModifiedByUserID = cmsAttachment.?; + // target.FileCreatedWhen = cmsAttachment.?; + + target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; + + KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); + + if (attachmentDocument != null) + { + target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentDocument.DocumentNode.NodeAliasPath); + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/CmsConsentAgreementMapper.cs b/Migration.Tool.Core.KX13/Mappers/CmsConsentAgreementMapper.cs new file mode 100644 index 00000000..8d4b1533 --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/CmsConsentAgreementMapper.cs @@ -0,0 +1,37 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX13.Mappers; + +public class CmsConsentAgreementMapper : EntityMapperBase +{ + public CmsConsentAgreementMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override CmsConsentAgreement? CreateNewInstance(KX13M.CmsConsentAgreement source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsConsentAgreement MapInternal(KX13M.CmsConsentAgreement source, CmsConsentAgreement target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentAgreementGuid = source.ConsentAgreementGuid; + target.ConsentAgreementRevoked = source.ConsentAgreementRevoked; + target.ConsentAgreementConsentHash = source.ConsentAgreementConsentHash; + target.ConsentAgreementTime = source.ConsentAgreementTime; + + if (mappingHelper.TranslateRequiredId(c => c.ContactId, source.ConsentAgreementContactId, out int contactId)) + { + target.ConsentAgreementContactId = contactId; + } + + if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentAgreementConsentId, out int consentId)) + { + target.ConsentAgreementConsentId = consentId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/CmsConsentArchiveMapper.cs b/Migration.Tool.Core.KX13/Mappers/CmsConsentArchiveMapper.cs new file mode 100644 index 00000000..e3eb2cc8 --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/CmsConsentArchiveMapper.cs @@ -0,0 +1,34 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX13.Mappers; + +public class CmsConsentArchiveMapper : EntityMapperBase +{ + public CmsConsentArchiveMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override CmsConsentArchive? CreateNewInstance(KX13M.CmsConsentArchive source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsConsentArchive MapInternal(KX13M.CmsConsentArchive source, CmsConsentArchive target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentArchiveContent = source.ConsentArchiveContent; + target.ConsentArchiveGuid = source.ConsentArchiveGuid; + target.ConsentArchiveLastModified = source.ConsentArchiveLastModified; + target.ConsentArchiveHash = source.ConsentArchiveHash; + + if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentArchiveConsentId, out int consentId)) + { + target.ConsentArchiveConsentId = consentId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/CmsConsentMapper.cs b/Migration.Tool.Core.KX13/Mappers/CmsConsentMapper.cs new file mode 100644 index 00000000..53d0ae19 --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/CmsConsentMapper.cs @@ -0,0 +1,83 @@ +using System.Text; +using System.Xml.Linq; +using System.Xml.XPath; + +using CMS.ContentEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX13.Mappers; + +public class CmsConsentMapper : EntityMapperBase +{ + public CmsConsentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override CmsConsent? CreateNewInstance(KX13M.CmsConsent source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsConsent MapInternal(KX13M.CmsConsent source, CmsConsent target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentDisplayName = source.ConsentDisplayName; + var defaultContentLanguageInfo = ContentLanguageInfo.Provider.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageIsDefault), true).FirstOrDefault() ?? throw new InvalidCastException("Missing default content language"); + target.ConsentName = source.ConsentName; + target.ConsentContent = ConsentContentPatcher.PatchConsentContent(source.ConsentContent, defaultContentLanguageInfo); + target.ConsentGuid = source.ConsentGuid; + target.ConsentLastModified = source.ConsentLastModified; + target.ConsentHash = source.ConsentHash; + + return target; + } +} + +static file class ConsentContentPatcher +{ + public static string PatchConsentContent(string content, ContentLanguageInfo defaultContentLanguage) + { + if (string.IsNullOrWhiteSpace(content)) + { + return content; + } + + XDocument doc; + try + { + doc = XDocument.Parse(content); + } + catch (Exception) + { + // cannot patch xml that cannot be parsed + return content; + } + + foreach (var cultureCodeElement in doc.XPathSelectElements("//CultureCode")) + { + cultureCodeElement.Name = "LanguageName"; + if (!string.Equals(defaultContentLanguage.ContentLanguageName, cultureCodeElement.Value, StringComparison.InvariantCultureIgnoreCase)) + { + // mLogger.LogWarning($"Consent '{consentInfo.ConsentName}' has unknown content language set '{cultureCodeElement.Value}'"); + } + + // if elements are not swapped, FULLTEXT is not shown in UI + var p = cultureCodeElement.NextNode; + if (p is XElement e && e.Name == "FullText") + { + p.ReplaceWith(cultureCodeElement); + cultureCodeElement.ReplaceWith(p); + } + } + + var builder = new StringBuilder(); + using (var writer = new CMS.IO.StringWriter(builder)) + { + doc.Save(writer); + } + + return builder.ToString(); + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/CmsSettingsCategoryMapper.cs b/Migration.Tool.Core.KX13/Mappers/CmsSettingsCategoryMapper.cs new file mode 100644 index 00000000..fd5aff2f --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/CmsSettingsCategoryMapper.cs @@ -0,0 +1,97 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX13.Mappers; + +public class CmsSettingsCategoryMapper( + ILogger logger, + PrimaryKeyMappingContext pkContext, + IProtocol protocol, + IEntityMapper cmsResourceMapper) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override CmsSettingsCategory? CreateNewInstance(KX13M.CmsSettingsCategory source, MappingHelper mappingHelper, + AddFailure addFailure) => new(); + + + protected override CmsSettingsCategory MapInternal(KX13M.CmsSettingsCategory source, CmsSettingsCategory target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + // no category guid to match on... + if (newInstance) + { + target.CategoryOrder = source.CategoryOrder; + target.CategoryName = source.CategoryName; + target.CategoryDisplayName = source.CategoryDisplayName; + target.CategoryIdpath = source.CategoryIdpath; + target.CategoryLevel = source.CategoryLevel; + target.CategoryChildCount = source.CategoryChildCount; + target.CategoryIconPath = source.CategoryIconPath; + target.CategoryIsGroup = source.CategoryIsGroup; + target.CategoryIsCustom = source.CategoryIsCustom; + } + + if (source.CategoryResource != null) + { + if (target.CategoryResource != null && source.CategoryResourceId != null && target.CategoryResourceId != null) + { + // skip if target is present + logger.LogTrace("Skipping category resource '{ResourceGuid}', already present in target instance", target.CategoryResource.ResourceGuid); + pkContext.SetMapping(r => r.ResourceId, source.CategoryResourceId.Value, target.CategoryResourceId.Value); + } + else + { + switch (cmsResourceMapper.Map(source.CategoryResource, target.CategoryResource)) + { + case { Success: true } result: + { + target.CategoryResource = result.Item; + break; + } + case { Success: false } result: + { + addFailure(new MapperResultFailure(result.HandbookReference)); + break; + } + + default: + break; + } + } + } + else if (mappingHelper.TranslateIdAllowNulls(r => r.ResourceId, source.CategoryResourceId, out int? categoryResourceId)) + { + target.CategoryResourceId = categoryResourceId; + } + + if (source.CategoryParent != null) + { + switch (Map(source.CategoryParent, target.CategoryParent)) + { + case { Success: true } result: + { + target.CategoryParent = result.Item; + break; + } + case { Success: false } result: + { + addFailure(new MapperResultFailure(result.HandbookReference)); + break; + } + + default: + break; + } + } + else if (mappingHelper.TranslateIdAllowNulls(c => c.CategoryId, source.CategoryParentId, out int? categoryParentId)) + { + target.CategoryParentId = categoryParentId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/CmsSettingsKeyMapper.cs b/Migration.Tool.Core.KX13/Mappers/CmsSettingsKeyMapper.cs new file mode 100644 index 00000000..b7a9a674 --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/CmsSettingsKeyMapper.cs @@ -0,0 +1,70 @@ +using System.Diagnostics; + +using CMS.DataEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; + +namespace Migration.Tool.Core.KX13.Mappers; + +public class CmsSettingsKeyMapper : EntityMapperBase +{ + private const string SOURCE_KEY_NAME = "CMSDefaultUserID"; + + public CmsSettingsKeyMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override SettingsKeyInfo CreateNewInstance(KX13M.CmsSettingsKey source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override SettingsKeyInfo MapInternal(KX13M.CmsSettingsKey source, SettingsKeyInfo target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + if (newInstance) + { + target.KeyName = source.KeyName; + target.KeyDisplayName = source.KeyDisplayName; + target.KeyDescription = source.KeyDescription; + target.KeyType = source.KeyType; + target.KeyGUID = source.KeyGuid; + target.KeyValidation = source.KeyValidation; + target.KeyEditingControlPath = source.KeyEditingControlPath; + target.KeyFormControlSettings = source.KeyFormControlSettings; + target.KeyExplanationText = source.KeyExplanationText; + } + else + { + target.KeyName = source.KeyName; + target.KeyDescription = source.KeyDescription; + target.KeyType = source.KeyType; + target.KeyValidation = source.KeyValidation; + target.KeyEditingControlPath = source.KeyEditingControlPath; + target.KeyFormControlSettings = source.KeyFormControlSettings; + target.KeyExplanationText = source.KeyExplanationText; + } + + // special migrations for keys + switch (source.KeyName) + { + case SOURCE_KEY_NAME: + { + target.KeyValue = int.TryParse(source.KeyValue, out int cmsDefaultUserId) + ? mappingHelper.TranslateRequiredId(u => u.UserId, cmsDefaultUserId, out int targetCmsDefaultUserId) + ? targetCmsDefaultUserId.ToString() + : source.KeyValue + : source.KeyValue; + break; + } + default: + target.KeyValue = source.KeyValue; + break; + } + + Debug.Assert(!source.SiteId.HasValue, "!source.SiteId.HasValue"); + target.KeyLastModified = source.KeyLastModified; + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/CmsUserMapper.cs b/Migration.Tool.Core.KX13/Mappers/CmsUserMapper.cs new file mode 100644 index 00000000..f6c980f7 --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/CmsUserMapper.cs @@ -0,0 +1,55 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX13.Mappers; + +public class CmsUserMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override CmsUser CreateNewInstance(KX13M.CmsUser tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsUser MapInternal(KX13M.CmsUser source, CmsUser target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (!newInstance && source.UserGuid != target.UserGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.UserName = source.UserName; + target.FirstName = source.FirstName; + target.LastName = source.LastName; + target.Email = source.Email; + target.UserPassword = source.UserPassword; + target.UserEnabled = source.UserEnabled; + target.UserCreated = source.UserCreated; + target.LastLogon = source.LastLogon; + target.UserGuid = source.UserGuid; + target.UserLastModified = source.UserLastModified; + target.UserSecurityStamp = source.UserSecurityStamp; + target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + target.UserIsPendingRegistration = false; + target.UserPasswordLastChanged = null; + target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + foreach (var sourceCmsUserRole in source.CmsUserRoles) + { + if (mappingHelper.TranslateRequiredId(r => r.RoleId, sourceCmsUserRole.RoleId, out int targetRoleId)) + { + if (target.CmsUserRoles.All(x => x.RoleId != targetRoleId)) + { + target.CmsUserRoles.Add(new CmsUserRole { RoleId = targetRoleId, User = target }); + } + } + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/CountryInfoMapper.cs b/Migration.Tool.Core.KX13/Mappers/CountryInfoMapper.cs new file mode 100644 index 00000000..fc20baeb --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/CountryInfoMapper.cs @@ -0,0 +1,30 @@ +using CMS.Globalization; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; + +namespace Migration.Tool.Core.KX13.Mappers; + +public class CountryInfoMapper : EntityMapperBase +{ + public CountryInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override CountryInfo? CreateNewInstance(KX13M.CmsCountry source, MappingHelper mappingHelper, AddFailure addFailure) + => CountryInfo.New(); + + protected override CountryInfo MapInternal(KX13M.CmsCountry source, CountryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.CountryName = source.CountryName; + target.CountryDisplayName = source.CountryDisplayName; + target.CountryGUID = source.CountryGuid; + target.CountryLastModified = source.CountryLastModified; + target.CountryThreeLetterCode = source.CountryThreeLetterCode; + target.CountryTwoLetterCode = source.CountryTwoLetterCode; + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/MemberInfoMapper.cs b/Migration.Tool.Core.KX13/Mappers/MemberInfoMapper.cs new file mode 100644 index 00000000..e96e5cf5 --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/MemberInfoMapper.cs @@ -0,0 +1,183 @@ +using System.Data; + +using CMS.FormEngine; +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.Helpers; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.KX13.Context; +using Migration.Tool.KXP.Api; + +namespace Migration.Tool.Core.KX13.Mappers; + +public record MemberInfoMapperSource(KX13M.CmsUser User, KX13M.CmsUserSetting UserSetting); + +public class MemberInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolConfiguration toolConfiguration, + IDbContextFactory kx13DbContextFactory) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + public static IReadOnlyList MigratedUserFields = new List + { + nameof(KX13M.CmsUser.UserGuid), + nameof(KX13M.CmsUser.UserName), + nameof(KX13M.CmsUser.Email), + // nameof(KX13M.CmsUser.UserPassword), + nameof(KX13M.CmsUser.UserEnabled), + nameof(KX13M.CmsUser.UserCreated), + nameof(KX13M.CmsUser.UserSecurityStamp) + }; + + protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (user, userSetting) = source; + + if (!newInstance && user.UserGuid != target.MemberGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + // target.UserName = source.UserName; + target.MemberName = user.UserName; + + // target.Email = source.Email; + target.MemberEmail = user.Email; + + // target.SetValue("UserPassword", source.UserPassword); + target.MemberPassword = null; // source.UserPassword; // not migrated + + // target.UserEnabled = source.UserEnabled; + target.MemberEnabled = user.UserEnabled; + + target.SetValue("UserCreated", user.UserCreated); + target.MemberCreated = user.UserCreated.GetValueOrDefault(); + + // target.UserGUID = source.UserGuid; + target.MemberGuid = user.UserGuid; + + target.MemberSecurityStamp = user.UserSecurityStamp; + + // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + // OBSOLETE: target.UserIsPendingRegistration = false; + // OBSOLETE: target.UserPasswordLastChanged = null; + // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); + foreach (var customizedFieldInfo in customized) + { + string fieldName = customizedFieldInfo.FieldName; + + if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out object? value) || + ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) + { + target.SetValue(fieldName, value); + } + } + + using var kx13Context = kx13DbContextFactory.CreateDbContext(); + var uDci = kx13Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_user); + if (uDci != null) + { + var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(uDci?.ClassFormDefinition)).ToList(); + if (userCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.User.UserId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + } + + var usDci = kx13Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_usersettings); + if (usDci != null) + { + var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); + if (userSettingsCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; + + using var conn = new SqlConnection(toolConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userSettingsCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserSettingsInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); + } + } + } + + + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/OmContactGroupMapper.cs b/Migration.Tool.Core.KX13/Mappers/OmContactGroupMapper.cs new file mode 100644 index 00000000..d4127b9b --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/OmContactGroupMapper.cs @@ -0,0 +1,36 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX13.Mappers; + +public class OmContactGroupMapper : EntityMapperBase +{ + public OmContactGroupMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override OmContactGroup? CreateNewInstance(KX13M.OmContactGroup tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override OmContactGroup MapInternal(KX13M.OmContactGroup source, OmContactGroup target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ContactGroupName = source.ContactGroupName; + target.ContactGroupDisplayName = source.ContactGroupDisplayName; + target.ContactGroupDescription = source.ContactGroupDescription; + target.ContactGroupDynamicCondition = source.ContactGroupDynamicCondition; + target.ContactGroupEnabled = source.ContactGroupEnabled; + target.ContactGroupLastModified = source.ContactGroupLastModified; + target.ContactGroupGuid = source.ContactGroupGuid; + target.ContactGroupStatus = source.ContactGroupStatus; + + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/OmContactStatusMapper.cs b/Migration.Tool.Core.KX13/Mappers/OmContactStatusMapper.cs new file mode 100644 index 00000000..11118552 --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/OmContactStatusMapper.cs @@ -0,0 +1,32 @@ +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.KXP.Models; + +namespace Migration.Tool.Core.KX13.Mappers; + +public class OmContactStatusMapper : EntityMapperBase +{ + public OmContactStatusMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override OmContactStatus? CreateNewInstance(KX13M.OmContactStatus tSourceEntity, MappingHelper mappingHelper, + AddFailure addFailure) => new(); + + protected override OmContactStatus MapInternal(KX13M.OmContactStatus source, OmContactStatus target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ContactStatusName = source.ContactStatusName; + target.ContactStatusDisplayName = source.ContactStatusDisplayName; + target.ContactStatusDescription = source.ContactStatusDescription; + + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/RoleInfoMapper.cs b/Migration.Tool.Core.KX13/Mappers/RoleInfoMapper.cs new file mode 100644 index 00000000..74a416fe --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/RoleInfoMapper.cs @@ -0,0 +1,32 @@ +using CMS.Membership; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; + +namespace Migration.Tool.Core.KX13.Mappers; + +public class RoleInfoMapper : EntityMapperBase +{ + public RoleInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override RoleInfo? CreateNewInstance(KX13M.CmsRole source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override RoleInfo MapInternal(KX13M.CmsRole source, RoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.RoleDisplayName = source.RoleDisplayName; + target.RoleName = source.RoleName; + target.RoleDescription = source.RoleDescription; + target.RoleGUID = source.RoleGuid; + target.RoleLastModified = source.RoleLastModified; + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/StateInfoMapper.cs b/Migration.Tool.Core.KX13/Mappers/StateInfoMapper.cs new file mode 100644 index 00000000..f82e1819 --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/StateInfoMapper.cs @@ -0,0 +1,35 @@ +using CMS.Globalization; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; + +namespace Migration.Tool.Core.KX13.Mappers; + +public class StateInfoMapper : EntityMapperBase +{ + public StateInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override StateInfo? CreateNewInstance(KX13M.CmsState source, MappingHelper mappingHelper, AddFailure addFailure) + => StateInfo.New(); + + protected override StateInfo MapInternal(KX13M.CmsState source, StateInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.StateName = source.StateName; + target.StateDisplayName = source.StateDisplayName; + target.StateLastModified = source.StateLastModified; + target.StateGUID = source.StateGuid; + target.StateCode = source.StateCode; + + if (mappingHelper.TranslateRequiredId(k => k.CountryId, source.CountryId, out int countryId)) + { + target.CountryID = countryId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/UserInfoMapper.cs b/Migration.Tool.Core.KX13/Mappers/UserInfoMapper.cs new file mode 100644 index 00000000..fcf96aae --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/UserInfoMapper.cs @@ -0,0 +1,96 @@ +using System.Data; + +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.KXP.Api; + +namespace Migration.Tool.Core.KX13.Mappers; + +public class UserInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolConfiguration toolConfiguration) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override UserInfo CreateNewInstance(KX13M.CmsUser source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override UserInfo MapInternal(KX13M.CmsUser source, UserInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (!newInstance && source.UserGuid != target.UserGUID) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.UserName = source.UserName; + target.FirstName = source.FirstName; + target.LastName = source.LastName; + target.Email = source.Email; + // target.UserPassword = source.UserPassword; + target.SetValue("UserPassword", source.UserPassword); + target.UserEnabled = source.UserEnabled; + target.SetValue("UserCreated", source.UserCreated); + // target.UserCreated = source.UserCreated; + target.SetValue("LastLogon", source.LastLogon); + // target.LastLogon = source.LastLogon; + target.UserGUID = source.UserGuid; + target.UserLastModified = source.UserLastModified; + target.UserSecurityStamp = source.UserSecurityStamp; + + target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + target.UserIsPendingRegistration = false; + target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + var customizedFields = kxpClassFacade.GetCustomizedFieldInfos(UserInfo.TYPEINFO.ObjectClassName).ToList(); + if (customizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in customizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + + + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Mappers/UserRoleInfoMapper.cs b/Migration.Tool.Core.KX13/Mappers/UserRoleInfoMapper.cs new file mode 100644 index 00000000..ad9ee0b0 --- /dev/null +++ b/Migration.Tool.Core.KX13/Mappers/UserRoleInfoMapper.cs @@ -0,0 +1,34 @@ +using CMS.Membership; + +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; + +namespace Migration.Tool.Core.KX13.Mappers; + +public class UserRoleInfoMapper : EntityMapperBase +{ + public UserRoleInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override UserRoleInfo? CreateNewInstance(KX13M.CmsUserRole source, MappingHelper mappingHelper, AddFailure addFailure) + => UserRoleInfo.New(); + + protected override UserRoleInfo MapInternal(KX13M.CmsUserRole source, UserRoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (mappingHelper.TranslateRequiredId(r => r.RoleId, source.RoleId, out int xbkRoleId)) + { + target.RoleID = xbkRoleId; + } + + if (mappingHelper.TranslateRequiredId(r => r.UserId, source.UserId, out int xbkUserId)) + { + target.UserID = xbkUserId; + } + + return target; + } +} diff --git a/Migration.Tool.Core.KX13/Migration.Tool.Core.KX13.csproj b/Migration.Tool.Core.KX13/Migration.Tool.Core.KX13.csproj new file mode 100644 index 00000000..75085dcd --- /dev/null +++ b/Migration.Tool.Core.KX13/Migration.Tool.Core.KX13.csproj @@ -0,0 +1,20 @@ + + + + Migration.Tool.Core.KX13 + + + + + + + + + + + + + + + + diff --git a/Migration.Toolkit.Core.KX13/Migration.Toolkit.Core.csproj.DotSettings.user b/Migration.Tool.Core.KX13/Migration.Tool.Core.csproj.DotSettings.user similarity index 100% rename from Migration.Toolkit.Core.KX13/Migration.Toolkit.Core.csproj.DotSettings.user rename to Migration.Tool.Core.KX13/Migration.Tool.Core.csproj.DotSettings.user diff --git a/Migration.Tool.Core.KX13/Providers/ContentItemNameProvider.cs b/Migration.Tool.Core.KX13/Providers/ContentItemNameProvider.cs new file mode 100644 index 00000000..525c0b08 --- /dev/null +++ b/Migration.Tool.Core.KX13/Providers/ContentItemNameProvider.cs @@ -0,0 +1,42 @@ +using CMS.Base; +using CMS.ContentEngine.Internal; +using CMS.Helpers; + +namespace Migration.Tool.Core.KX13.Providers; + +internal class ContentItemNameProvider +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) => this.codeNameValidator = codeNameValidator; + + public Task Get(string name) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); + } + + async Task Get(string name) + { + string codeName = ValidationHelper.GetCodeName(name, useUnicode: false); + + bool isCodeNameValid = ValidationHelper.IsCodeName(codeName); + + if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) + { + codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); + } + + var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); + + return await uniqueCodeNameProvider.GetUniqueValue(codeName); + } + + return Get(name); + } +} diff --git a/Migration.Tool.Core.KX13/Providers/ContentItemNameValidator.cs b/Migration.Tool.Core.KX13/Providers/ContentItemNameValidator.cs new file mode 100644 index 00000000..1ec7c2fc --- /dev/null +++ b/Migration.Tool.Core.KX13/Providers/ContentItemNameValidator.cs @@ -0,0 +1,18 @@ +using CMS.ContentEngine.Internal; + +namespace Migration.Tool.Core.KX13.Providers; + +internal class ContentItemNameValidator : IContentItemNameValidator +{ + /// + public bool IsUnique(string name) => IsUnique(0, name); + + + /// + public bool IsUnique(int id, string name) + { + var contentItemInfo = new ContentItemInfo { ContentItemID = id, ContentItemName = name }; + + return contentItemInfo.CheckUniqueCodeName(); + } +} diff --git a/Migration.Tool.Core.KX13/Providers/UniqueContentItemNameProvider.cs b/Migration.Tool.Core.KX13/Providers/UniqueContentItemNameProvider.cs new file mode 100644 index 00000000..3c35ad98 --- /dev/null +++ b/Migration.Tool.Core.KX13/Providers/UniqueContentItemNameProvider.cs @@ -0,0 +1,38 @@ +using CMS.Base; +using CMS.ContentEngine.Internal; + +namespace Migration.Tool.Core.KX13.Providers; + +internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) + : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) => this.codeNameValidator = codeNameValidator; + + public override Task GetUniqueValue(string inputValue) => base.GetUniqueValue(AddSuffix(inputValue)); + + + private string AddSuffix(string codeName) + { + string randomSuffix = GetRandomSuffix(); + string codeNameWithSuffix = codeName += randomSuffix; + + if (codeNameWithSuffix.Length > MaxLength) + { + int availableLength = MaxLength - randomSuffix.Length; + + codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; + } + + return codeNameWithSuffix; + } + + + /// + protected override Task IsValueUnique(string value) => Task.FromResult(codeNameValidator.IsUnique(value)); +} diff --git a/Migration.Tool.Core.KX13/Services/CmsClass/AttachmentSelectorItem.cs b/Migration.Tool.Core.KX13/Services/CmsClass/AttachmentSelectorItem.cs new file mode 100644 index 00000000..85015c94 --- /dev/null +++ b/Migration.Tool.Core.KX13/Services/CmsClass/AttachmentSelectorItem.cs @@ -0,0 +1,11 @@ +using Newtonsoft.Json; + +namespace Migration.Tool.Core.KX13.Services.CmsClass; + +/// Represents an item for the attachment selector. +public class AttachmentSelectorItem +{ + /// Attachment GUID. + [JsonProperty("fileGuid")] + public Guid FileGuid { get; set; } +} diff --git a/Migration.Tool.Core.KX13/Services/CountryMigrator.cs b/Migration.Tool.Core.KX13/Services/CountryMigrator.cs new file mode 100644 index 00000000..418520e3 --- /dev/null +++ b/Migration.Tool.Core.KX13/Services/CountryMigrator.cs @@ -0,0 +1,104 @@ +using CMS.Globalization; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.Common.Abstractions; +using Migration.Tool.Common.MigrationProtocol; +using Migration.Tool.Core.KX13.Contexts; +using Migration.Tool.KX13.Context; +using Migration.Tool.KXP.Api; + +namespace Migration.Tool.Core.KX13.Services; + +public class CountryMigrator( + ILogger logger, + IDbContextFactory kx13ContextFactory, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + IEntityMapper countryMapper, + IEntityMapper stateMapper, + KxpApiInitializer kxpApiInitializer) +{ + public void MigrateCountriesAndStates() + { + if (!kxpApiInitializer.EnsureApiIsInitialized()) + { + throw new InvalidOperationException("Falied to initialize kentico API. Please check configuration."); + } + + var kx13Context = kx13ContextFactory.CreateDbContext(); + + var kx13Countries = kx13Context.CmsCountries.AsNoTracking(); + foreach (var kx13CmsCountry in kx13Countries) + { + var kxpCountryInfo = CountryInfoProvider.ProviderObject.Get(kx13CmsCountry.CountryName); + + if (kxpCountryInfo != null) // do not update when exists + { + continue; + } + + var mapped = countryMapper.Map(kx13CmsCountry, null); + protocol.MappedTarget(mapped); + + if (mapped is (var countryInfo, var newInstance) { Success: true }) + { + try + { + CountryInfoProvider.ProviderObject.Set(countryInfo); + + protocol.Success(kx13CmsCountry, countryInfo, mapped); + logger.LogEntitySetAction(newInstance, countryInfo); + + primaryKeyMappingContext.SetMapping(r => r.CountryId, kx13CmsCountry.CountryId, countryInfo.CountryID); + } + catch (Exception exception) + { + logger.LogEntitySetError(exception, newInstance, countryInfo); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithIdentityPrint(countryInfo) + ); + } + } + } + + + var kx13States = kx13Context.CmsStates.AsNoTracking(); + foreach (var kx13CmsState in kx13States) + { + var kxpStateInfo = StateInfoProvider.ProviderObject.Get(kx13CmsState.StateName); + + if (kxpStateInfo != null) // do not update when exists + { + continue; + } + + var mapped = stateMapper.Map(kx13CmsState, null); + protocol.MappedTarget(mapped); + + if (mapped is (var stateInfo, var newInstance) { Success: true }) + { + try + { + StateInfoProvider.ProviderObject.Set(stateInfo); + + protocol.Success(kx13CmsState, stateInfo, mapped); + logger.LogEntitySetAction(newInstance, stateInfo); + + primaryKeyMappingContext.SetMapping(r => r.StateId, kx13CmsState.StateId, stateInfo.StateID); + } + catch (Exception exception) + { + logger.LogEntitySetError(exception, newInstance, stateInfo); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithIdentityPrint(stateInfo) + ); + } + } + } + } +} diff --git a/Migration.Tool.Core.KX13/Services/IPrimaryKeyLocatorService.cs b/Migration.Tool.Core.KX13/Services/IPrimaryKeyLocatorService.cs new file mode 100644 index 00000000..ee94d07f --- /dev/null +++ b/Migration.Tool.Core.KX13/Services/IPrimaryKeyLocatorService.cs @@ -0,0 +1,11 @@ +using System.Linq.Expressions; + +namespace Migration.Tool.Core.KX13.Services; + +public record SourceTargetKeyMapping(int SourceId, int TargetId); + +public interface IPrimaryKeyLocatorService +{ + bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); + IEnumerable SelectAll(Expression> keyNameSelector); +} diff --git a/Migration.Tool.Core.KX13/Services/KeyLocatorService.cs b/Migration.Tool.Core.KX13/Services/KeyLocatorService.cs new file mode 100644 index 00000000..bec13d98 --- /dev/null +++ b/Migration.Tool.Core.KX13/Services/KeyLocatorService.cs @@ -0,0 +1,108 @@ +using System.Linq.Expressions; +using System.Runtime.CompilerServices; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.KX13.Context; +using Migration.Tool.KXP.Context; + +namespace Migration.Tool.Core.KX13.Services; + +public class KeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory kx13ContextFactory) +{ + public bool TryLocate( + Expression> sourceKeySelector, + Expression> targetKeySelector, + Expression> sourceGuidSelector, + Expression> targetGuidSelector, + object? sourceKey, out TTargetKey targetId + ) where TSource : class where TTarget : class + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var kx13Context = kx13ContextFactory.CreateDbContext(); + + var sourceType = typeof(TSource); + Unsafe.SkipInit(out targetId); + + try + { + if (sourceKey is null) + { + return false; + } + + var sourceEquals = Expression.Equal( + sourceKeySelector.Body, + Expression.Convert(Expression.Constant(sourceKey, sourceKey.GetType()), typeof(object)) + ); + var sourcePredicate = Expression.Lambda>(sourceEquals, sourceKeySelector.Parameters[0]); + var kx13Guid = kx13Context.Set().Where(sourcePredicate).Select(sourceGuidSelector).Single(); + + var param = Expression.Parameter(typeof(TTarget), "t"); + var member = targetGuidSelector.Body as MemberExpression ?? throw new InvalidOperationException($"Expression SHALL NOT be other than member expression, expression: {targetGuidSelector}"); + var targetEquals = Expression.Equal( + Expression.MakeMemberAccess(param, member.Member), + Expression.Constant(kx13Guid, typeof(Guid)) + ); + var targetPredicate = Expression.Lambda>(targetEquals, param); + + var query = kxpContext.Set().Where(targetPredicate); + var selector = Expression.Lambda>(targetKeySelector.Body, targetKeySelector.Parameters[0]); + targetId = query.Select(selector).Single(); + return true; + } + catch (InvalidOperationException ioex) + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceKey, ioex.Message); + return false; + } + finally + { + if (!targetId?.Equals(default) ?? false) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceKey, targetId); + } + } + } + + public bool TryGetSourceGuid(Expression> keySelector, Expression> guidSelector, object? key, out Guid? guid) + where T : class + { + using var kx13Context = kx13ContextFactory.CreateDbContext(); + + var type = typeof(T); + Unsafe.SkipInit(out guid); + + try + { + if (key is null) + { + return false; + } + + var sourceEquals = Expression.Equal( + keySelector.Body, + Expression.Convert(Expression.Constant(key, key.GetType()), typeof(object)) + ); + var sourcePredicate = Expression.Lambda>(sourceEquals, keySelector.Parameters[0]); + guid = kx13Context.Set().Where(sourcePredicate).Select(guidSelector).Single(); + return true; + } + catch (InvalidOperationException ioex) + { + logger.LogWarning("Guid locator {SourceFullType} primary key: {Key} failed, {Message}", type.FullName, key, ioex.Message); + return false; + } + finally + { + if (!guid?.Equals(default) ?? false) + { + logger.LogTrace("Guid locator {SourceFullType} primary key: {Key} located {Guid}", type.FullName, key, guid); + } + } + } +} diff --git a/Migration.Tool.Core.KX13/Services/PrimaryKeyLocatorService.cs b/Migration.Tool.Core.KX13/Services/PrimaryKeyLocatorService.cs new file mode 100644 index 00000000..a7934901 --- /dev/null +++ b/Migration.Tool.Core.KX13/Services/PrimaryKeyLocatorService.cs @@ -0,0 +1,218 @@ +using System.Linq.Expressions; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Tool.Common; +using Migration.Tool.KX13.Context; +using Migration.Tool.KXP.Context; + +namespace Migration.Tool.Core.KX13.Services; + +public class PrimaryKeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory kx13ContextFactory) + : IPrimaryKeyLocatorService +{ + public IEnumerable SelectAll(Expression> keyNameSelector) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var kx13Context = kx13ContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + string memberName = keyNameSelector.GetMemberName(); + + logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); + + if (sourceType == typeof(KX13M.CmsUser) && memberName == nameof(KX13M.CmsUser.UserId)) + { + var sourceUsers = kx13Context.CmsUsers.Select(x => new { x.UserId, x.UserGuid, x.UserName }).ToList(); + var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); + + var result = sourceUsers.Join(targetUsers, + a => new CmsUserKey(a.UserGuid, a.UserName), + b => new CmsUserKey(b.UserGuid, b.UserName), + (a, b) => new SourceTargetKeyMapping(a.UserId, b.UserId), + new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(KX13M.OmContact) && memberName == nameof(KX13M.OmContact.ContactId)) + { + var source = kx13Context.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + var target = kxpContext.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + + var result = source.Join(target, + a => a.ContactGuid, + b => b.ContactGuid, + (a, b) => new SourceTargetKeyMapping(a.ContactId, b.ContactId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(KX13M.CmsState) && memberName == nameof(KX13M.CmsState.StateId)) + { + var source = kx13Context.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + + var result = source.Join(target, + a => a.StateName, + b => b.StateName, + (a, b) => new SourceTargetKeyMapping(a.StateId, b.StateId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(KX13M.CmsCountry) && memberName == nameof(KX13M.CmsCountry.CountryId)) + { + var source = kx13Context.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + + var result = source.Join(target, + a => a.CountryName, + b => b.CountryName, + (a, b) => new SourceTargetKeyMapping(a.CountryId, b.CountryId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + throw new NotImplementedException(); + } + + public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var kx13Context = kx13ContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + targetId = -1; + try + { + if (sourceType == typeof(KX13M.CmsResource)) + { + var kx13Guid = kx13Context.CmsResources.Where(c => c.ResourceId == sourceId).Select(x => x.ResourceGuid).Single(); + targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == kx13Guid).Select(x => x.ResourceId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.CmsClass)) + { + var kx13Guid = kx13Context.CmsClasses.Where(c => c.ClassId == sourceId).Select(x => x.ClassGuid).Single(); + targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == kx13Guid).Select(x => x.ClassId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.CmsUser)) + { + var kx13User = kx13Context.CmsUsers.Where(c => c.UserId == sourceId).Select(x => new { x.UserGuid, x.UserName }).Single(); + targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == kx13User.UserGuid || x.UserName == kx13User.UserName).Select(x => x.UserId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.CmsRole)) + { + var kx13User = kx13Context.CmsRoles.Where(c => c.RoleId == sourceId).Select(x => new { x.RoleGuid }).Single(); + targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == kx13User.RoleGuid).Select(x => x.RoleId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.CmsSite)) + { + var kx13Guid = kx13Context.CmsSites.Where(c => c.SiteId == sourceId).Select(x => x.SiteGuid).Single(); + targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == kx13Guid).Select(x => x.ChannelId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.CmsState)) + { + string kx13CodeName = kx13Context.CmsStates.Where(c => c.StateId == sourceId).Select(x => x.StateName).Single(); + targetId = kxpContext.CmsStates.Where(x => x.StateName == kx13CodeName).Select(x => x.StateId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.CmsCountry)) + { + string kx13CodeName = kx13Context.CmsCountries.Where(c => c.CountryId == sourceId).Select(x => x.CountryName).Single(); + targetId = kxpContext.CmsCountries.Where(x => x.CountryName == kx13CodeName).Select(x => x.CountryId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.OmContactStatus)) + { + string kx13Guid = kx13Context.OmContactStatuses.Where(c => c.ContactStatusId == sourceId).Select(x => x.ContactStatusName).Single(); + targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == kx13Guid).Select(x => x.ContactStatusId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.OmContact)) + { + var kx13Guid = kx13Context.OmContacts.Where(c => c.ContactId == sourceId).Select(x => x.ContactGuid).Single(); + targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == kx13Guid).Select(x => x.ContactId).Single(); + return true; + } + } + catch (InvalidOperationException ioex) + { + if (ioex.Message.StartsWith("Sequence contains no elements")) + { + logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + else + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + + return false; + } + finally + { + if (targetId != -1) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); + } + } + + logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); + targetId = -1; + return false; + } + + private class KeyEqualityComparerWithLambda(Func equalityComparer) : IEqualityComparer + { + public bool Equals(T? x, T? y) => equalityComparer.Invoke(x, y); + + public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; + } + + private record CmsUserKey(Guid UserGuid, string UserName); +} diff --git a/Migration.Tool.Extensions/ClassMappings/ClassMappingSample.cs b/Migration.Tool.Extensions/ClassMappings/ClassMappingSample.cs new file mode 100644 index 00000000..b25439e2 --- /dev/null +++ b/Migration.Tool.Extensions/ClassMappings/ClassMappingSample.cs @@ -0,0 +1,225 @@ +using CMS.DataEngine; +using CMS.FormEngine; +using Microsoft.Extensions.DependencyInjection; +using Migration.Tool.Common.Builders; +using Migration.Tool.KXP.Api.Auxiliary; + +// ReSharper disable ArrangeMethodOrOperatorBody + +namespace Migration.Tool.Extensions.ClassMappings; + +public static class ClassMappingSample +{ + public static IServiceCollection AddSimpleRemodelingSample(this IServiceCollection serviceCollection) + { + const string targetClassName = "DancingGoatCore.CoffeeRemodeled"; + // declare target class + var m = new MultiClassMapping(targetClassName, target => + { + target.ClassName = targetClassName; + target.ClassTableName = "DancingGoatCore_CoffeeRemodeled"; + target.ClassDisplayName = "Coffee remodeled"; + target.ClassType = ClassType.CONTENT_TYPE; + target.ClassContentTypeType = ClassContentTypeType.WEBSITE; + }); + + // set new primary key + m.BuildField("CoffeeRemodeledID").AsPrimaryKey(); + + // change fields according to new requirements + const string sourceClassName = "DancingGoatCore.Coffee"; + m + .BuildField("FarmRM") + .SetFrom(sourceClassName, "CoffeeFarm", true) + .WithFieldPatch(f => f.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "Farm RM")); + + m + .BuildField("CoffeeCountryRM") + .WithFieldPatch(f => f.Caption = "Country RM") + .SetFrom(sourceClassName, "CoffeeCountry", true); + + m + .BuildField("CoffeeVarietyRM") + .SetFrom(sourceClassName, "CoffeeVariety", true) + .WithFieldPatch(f => f.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "Variety RM")); + + m + .BuildField("CoffeeProcessingRM") + .SetFrom(sourceClassName, "CoffeeProcessing", true) + .WithFieldPatch(f => f.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "Processing RM")); + + m + .BuildField("CoffeeAltitudeRM") + .SetFrom(sourceClassName, "CoffeeAltitude", true) + .WithFieldPatch(f => f.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "Altitude RM")); + + m + .BuildField("CoffeeIsDecafRM") + .SetFrom(sourceClassName, "CoffeeIsDecaf", true) + .WithFieldPatch(f => f.SetPropertyValue(FormFieldPropertyEnum.FieldCaption, "IsDecaf RM")); + + // register class mapping + serviceCollection.AddSingleton(m); + + return serviceCollection; + } + + public static IServiceCollection AddClassMergeExample(this IServiceCollection serviceCollection) + { + const string targetClassName = "ET.Event"; + const string sourceClassName1 = "_ET.Event1"; + const string sourceClassName2 = "_ET.Event2"; + + var m = new MultiClassMapping(targetClassName, target => + { + target.ClassName = targetClassName; + target.ClassTableName = "ET_Event"; + target.ClassDisplayName = "ET - MY new transformed event"; + target.ClassType = ClassType.CONTENT_TYPE; + target.ClassContentTypeType = ClassContentTypeType.WEBSITE; + }); + + m.BuildField("EventID").AsPrimaryKey(); + + // build new field + var title = m.BuildField("Title"); + // map "EventTitle" field form source data class "_ET.Event1" also use it as template for target field + title.SetFrom(sourceClassName1, "EventTitle", true); + // map "EventTitle" field form source data class "_ET.Event2" + title.SetFrom(sourceClassName2, "EventTitle"); + // patch field definition, in this case lets change field caption + title.WithFieldPatch(f => f.Caption = "Event title"); + + var description = m.BuildField("Description"); + description.SetFrom(sourceClassName2, "EventSmallDesc", true); + description.WithFieldPatch(f => f.Caption = "Event description"); + + var teaser = m.BuildField("Teaser"); + teaser.SetFrom(sourceClassName1, "EventTeaser", true); + teaser.WithFieldPatch(f => f.Caption = "Event teaser"); + + var text = m.BuildField("Text"); + text.SetFrom(sourceClassName1, "EventText", true); + text.SetFrom(sourceClassName2, "EventHtml"); + text.WithFieldPatch(f => f.Caption = "Event text"); + + var startDate = m.BuildField("StartDate"); + startDate.SetFrom(sourceClassName1, "EventDateStart", true); + // if needed use value conversion to adapt value + startDate.ConvertFrom(sourceClassName2, "EventStartDateAsText", false, + v => v?.ToString() is { } av && !string.IsNullOrWhiteSpace(av) ? DateTime.Parse(av) : null + ); + startDate.WithFieldPatch(f => f.Caption = "Event start date"); + + serviceCollection.AddSingleton(m); + + return serviceCollection; + } + + public static IServiceCollection AddReusableSchemaIntegrationSample(this IServiceCollection serviceCollection) + { + const string schemaNameDgcCommon = "DGC.Address"; + const string schemaNameDgcName = "DGC.Name"; + const string sourceClassName = "DancingGoatCore.Cafe"; + + // create instance of reusable schema builder - class will help us with definition of new reusable schema + var sb = new ReusableSchemaBuilder(schemaNameDgcCommon, "Common address", "Reusable schema that defines common address"); + + sb + .BuildField("City") + .WithFactory(() => new FormFieldInfo + { + Name = "City", + Caption = "City", + Guid = new Guid("F9DC7EBE-29CA-4591-BF43-E782D50624AF"), + DataType = FieldDataType.Text, + Size = 400, + Settings = + { + ["controlname"] = FormComponents.AdminTextInputComponent + } + }); + + sb + .BuildField("Street") + .WithFactory(() => new FormFieldInfo + { + Name = "Street", + Caption = "Street", + Guid = new Guid("712C0B07-45AC-4CD0-A355-2BA4C46941B6"), + DataType = FieldDataType.Text, + Size = 400, + Settings = + { + ["controlname"] = FormComponents.AdminTextInputComponent + } + }); + + sb + .BuildField("ZipCode") + .CreateFrom(sourceClassName, "CafeZipCode"); + + sb + .BuildField("Phone") + .CreateFrom(sourceClassName, "CafePhone"); + + + var sb2 = new ReusableSchemaBuilder(schemaNameDgcName, "Common name", "Reusable schema that defines name field"); + + sb2 + .BuildField("Name") + .WithFactory(() => new FormFieldInfo + { + Name = "Name", + Caption = "Name", + Guid = new Guid("3213B67F-23F1-4F6F-9E5F-C74DE5F84BC5"), + DataType = FieldDataType.Text, + Size = 400, + Settings = + { + ["controlname"] = FormComponents.AdminTextInputComponent + } + }); + + var m = new MultiClassMapping("DancingGoatCore.CafeRS", target => + { + target.ClassName = "DancingGoatCore.CafeRS"; + target.ClassTableName = "DancingGoatCore_CafeRS"; + target.ClassDisplayName = "Coffee with reusable schema"; + target.ClassType = ClassType.CONTENT_TYPE; + target.ClassContentTypeType = ClassContentTypeType.WEBSITE; + }); + + // set primary key + m.BuildField("CafeID").AsPrimaryKey(); + + // declare that we intend to use reusable schema and set mappings to new fields from old ones + m.UseResusableSchema(schemaNameDgcCommon); + m.BuildField("City").SetFrom(sourceClassName, "CafeCity"); + m.BuildField("Street").SetFrom(sourceClassName, "CafeStreet"); + m.BuildField("ZipCode").SetFrom(sourceClassName, "CafeZipCode"); + m.BuildField("Phone").SetFrom(sourceClassName, "CafePhone"); + + m.UseResusableSchema(schemaNameDgcName); + m.BuildField("Name").SetFrom(sourceClassName, "CafeName"); + + // old fields we leave in data class + m.BuildField("CafePhoto").SetFrom(sourceClassName, "CafePhoto", isTemplate: true); + m.BuildField("CafeAdditionalNotes").SetFrom(sourceClassName, "CafeAdditionalNotes", isTemplate: true); + + // in similar manner we can define other classes where we want to use reusable schema + // var m2 = new MultiClassMapping("DancingGoatCore.MyOtherClass", target => + // ... + // m2.UseResusableSchema(schemaNameDgcCommon); + // m2.BuildField ... + // serviceCollection.AddSingleton(m2); + + // register mapping + serviceCollection.AddSingleton(m); + // register reusable schema builder + serviceCollection.AddSingleton(sb); + serviceCollection.AddSingleton(sb2); + + return serviceCollection; + } +} diff --git a/Migration.Tool.Extensions/CommunityMigrations/SampleTextMigration.cs b/Migration.Tool.Extensions/CommunityMigrations/SampleTextMigration.cs new file mode 100644 index 00000000..605ed755 --- /dev/null +++ b/Migration.Tool.Extensions/CommunityMigrations/SampleTextMigration.cs @@ -0,0 +1,65 @@ +using System.Xml.Linq; +using CMS.DataEngine; +using Microsoft.Extensions.Logging; +using Migration.Tool.Common; +using Migration.Tool.KXP.Api.Auxiliary; +using Migration.Tool.KXP.Api.Services.CmsClass; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Services; + +namespace Migration.Tool.Extensions.CommunityMigrations; + +public class SampleTextMigration(ILogger logger, SpoiledGuidContext spoiledGuidContext) : IFieldMigration +{ + // Migrations will be sorted by this number before checking with "ShallMigrate" method. Set rank to number bellow 100 000 (default migration will have 100 000 or higher) + public int Rank => 5000; + + // this method will check, if this implementation handles migration (for both, definition and value) + public bool ShallMigrate(FieldMigrationContext context) => context.SourceDataType is "text" or "longtext" && context.SourceFormControl is "MY_COMMUNITY_TEXT_EDITOR"; + + public void MigrateFieldDefinition(FormDefinitionPatcher formDefinitionPatcher, XElement field, XAttribute? columnTypeAttr, string fieldDescriptor) + { + // now we migrate field definition + + // field is element from class form definition, for example + /* + + + Media selection + + + MediaSelectionControl + True + + + */ + + // we usually want to change field type and column type, lets assume our custom control content is HTML, then target type would be: + columnTypeAttr?.SetValue(FieldDataType.RichTextHTML); + + var settings = field.EnsureElement(FormDefinitionPatcher.FieldElemSettings); + // RichText editor control + settings.EnsureElement(FormDefinitionPatcher.SettingsElemControlname, e => e.Value = FormComponents.AdminRichTextEditorComponent); + // and rich text configuration + settings.EnsureElement("ConfigurationName", e => e.Value = "Kentico.Administration.StructuredContent"); + } + + public async Task MigrateValue(object? sourceValue, FieldMigrationContext context) + { + // if required, migrate value (for example cut out any unsupported features or migrated them to kentico supported variants if available) + + // check context + if (context.SourceObjectContext is DocumentSourceObjectContext(_, _, _, _, _, _)) + { + // do migration logic + + // return result + return new FieldMigrationResult(true, sourceValue); + } + else + { + return new FieldMigrationResult(false, null); + } + } +} diff --git a/Migration.Tool.Extensions/DefaultMigrations/AssetMigration.cs b/Migration.Tool.Extensions/DefaultMigrations/AssetMigration.cs new file mode 100644 index 00000000..c6b4d2ea --- /dev/null +++ b/Migration.Tool.Extensions/DefaultMigrations/AssetMigration.cs @@ -0,0 +1,336 @@ +using System.Xml.Linq; +using CMS.ContentEngine; +using CMS.DataEngine; +using CMS.MediaLibrary; +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; +using Migration.Tool.Common; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.Common.Helpers; +using Migration.Tool.KXP.Api; +using Migration.Tool.KXP.Api.Auxiliary; +using Migration.Tool.KXP.Api.Services.CmsClass; +using Migration.Tool.Source; +using Migration.Tool.Source.Auxiliary; +using Migration.Tool.Source.Contexts; +using Migration.Tool.Source.Helpers; +using Migration.Tool.Source.Model; +using Migration.Tool.Source.Services; + +namespace Migration.Tool.Extensions.DefaultMigrations; + +public class AssetMigration( + ILogger logger, + ClassService classService, + IAttachmentMigrator attachmentMigrator, + ModelFacade modelFacade, + KxpMediaFileFacade mediaFileFacade, + ToolConfiguration configuration, + EntityIdentityFacade entityIdentityFacade, + IAssetFacade assetFacade, + MediaLinkServiceFactory mediaLinkServiceFactory +) : IFieldMigration +{ + public int Rank => 100_000; + + public bool ShallMigrate(FieldMigrationContext context) => + ( + context.SourceDataType is KsFieldDataType.DocAttachments or KsFieldDataType.File || + Kx13FormControls.UserControlForText.MediaSelectionControl.Equals(context.SourceFormControl, StringComparison.InvariantCultureIgnoreCase) + ) && + context.SourceObjectContext + // this migration can handle only migration of documents to content items + is DocumentSourceObjectContext + // this migration also handles empty object context - for example when migrating data class, empty context is supplied + or EmptySourceObjectContext; + + public async Task MigrateValue(object? sourceValue, FieldMigrationContext context) + { + (string? _, string? sourceFormControl, string? fieldName, var sourceObjectContext) = context; + if (sourceObjectContext is not DocumentSourceObjectContext(_, _, var cmsSite, var oldFormInfo, _, var documentId)) + { + throw new ArgumentNullException(nameof(sourceObjectContext)); + } + + var field = oldFormInfo.GetFormField(fieldName); + + List mfis = []; + bool hasMigratedAsset = false; + if (sourceValue is string link && + mediaLinkServiceFactory.Create().MatchMediaLink(link, cmsSite.SiteID) is (true, var mediaLinkKind, var mediaKind, var path, var mediaGuid, _, _) result) + { + if (mediaLinkKind == MediaLinkKind.Path) + { + // path needs to be converted to GUID + if (mediaKind == MediaKind.Attachment && path != null) + { + switch (await attachmentMigrator.TryMigrateAttachmentByPath(path, $"__{fieldName}")) + { + case MigrateAttachmentResultMediaFile(true, _, var x, _): + { + mfis = [new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }]; + hasMigratedAsset = true; + logger.LogTrace("'{FieldName}' migrated Match={Value}", fieldName, result); + break; + } + case MigrateAttachmentResultContentItem { Success: true, ContentItemGuid: { } contentItemGuid }: + { + mfis = + [ + new ContentItemReference { Identifier = contentItemGuid } + ]; + hasMigratedAsset = true; + logger.LogTrace("'{FieldName}' migrated Match={Value}", fieldName, result); + break; + } + default: + { + logger.LogTrace("Unsuccessful attachment migration '{Field}': '{Value}' - {Match}", fieldName, path, result); + break; + } + } + } + + if (mediaKind == MediaKind.MediaFile) + { + logger.LogTrace("'{FieldName}' Skipped Match={Value}", fieldName, result); + } + } + + if (mediaLinkKind == MediaLinkKind.DirectMediaPath) + { + if (mediaKind == MediaKind.MediaFile) + { + var sourceMediaFile = MediaHelper.GetMediaFile(result, modelFacade); + if (sourceMediaFile != null) + { + if (configuration.MigrateMediaToMediaLibrary) + { + if (entityIdentityFacade.Translate(sourceMediaFile) is { } mf && mediaFileFacade.GetMediaFile(mf.Identity) is { } x) + { + mfis = [new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }]; + hasMigratedAsset = true; + } + } + else + { + var (ownerContentItemGuid, _) = assetFacade.GetRef(sourceMediaFile); + mfis = + [ + new ContentItemReference { Identifier = ownerContentItemGuid } + ]; + hasMigratedAsset = true; + logger.LogTrace("MediaFile migrated from media file '{Field}': '{Value}'", fieldName, result); + } + } + } + } + + if (mediaGuid is { } mg) + { + if (mediaKind == MediaKind.Attachment) + { + switch (await attachmentMigrator.MigrateAttachment(mg, $"__{fieldName}", cmsSite.SiteID)) + { + case MigrateAttachmentResultMediaFile(true, _, var x, _): + { + mfis = [new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }]; + hasMigratedAsset = true; + logger.LogTrace("MediaFile migrated from attachment '{Field}': '{Value}'", fieldName, mg); + break; + } + case MigrateAttachmentResultContentItem { Success: true, ContentItemGuid: { } contentItemGuid }: + { + mfis = + [ + new ContentItemReference { Identifier = contentItemGuid } + ]; + hasMigratedAsset = true; + logger.LogTrace("Content item migrated from attachment '{Field}': '{Value}' to {ContentItemGUID}", fieldName, mg, contentItemGuid); + break; + } + default: + { + break; + } + } + } + + if (mediaKind == MediaKind.MediaFile) + { + var sourceMediaFile = modelFacade.SelectWhere("FileGUID = @mediaFileGuid AND FileSiteID = @fileSiteID", new SqlParameter("mediaFileGuid", mg), new SqlParameter("fileSiteID", cmsSite.SiteID)) + .FirstOrDefault(); + if (sourceMediaFile != null) + { + if (configuration.MigrateMediaToMediaLibrary) + { + if (entityIdentityFacade.Translate(sourceMediaFile) is { } mf && mediaFileFacade.GetMediaFile(mf.Identity) is { } x) + { + mfis = [new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }]; + hasMigratedAsset = true; + } + } + else + { + var (ownerContentItemGuid, _) = assetFacade.GetRef(sourceMediaFile); + mfis = + [ + new ContentItemReference { Identifier = ownerContentItemGuid } + ]; + hasMigratedAsset = true; + logger.LogTrace("MediaFile migrated from media file '{Field}': '{Value}'", fieldName, mg); + } + } + } + } + } + else if (classService.GetFormControlDefinition(sourceFormControl) is { } formControl) + { + switch (formControl) + { + case { UserControlForFile: true }: + { + if (sourceValue is Guid attachmentGuid) + { + switch (await attachmentMigrator.MigrateAttachment(attachmentGuid, $"__{fieldName}", cmsSite.SiteID)) + { + case MigrateAttachmentResultMediaFile(true, _, var mfi, _): + { + mfis = [new AssetRelatedItem { Identifier = mfi.FileGUID, Dimensions = new AssetDimensions { Height = mfi.FileImageHeight, Width = mfi.FileImageWidth }, Name = mfi.FileName, Size = mfi.FileSize }]; + hasMigratedAsset = true; + logger.LogTrace("MediaFile migrated from attachment '{Field}': '{Value}'", fieldName, attachmentGuid); + break; + } + case MigrateAttachmentResultContentItem { Success: true, ContentItemGuid: { } contentItemGuid }: + { + mfis = + [ + new ContentItemReference { Identifier = contentItemGuid } + ]; + hasMigratedAsset = true; + logger.LogTrace("Content item migrated from attachment '{Field}': '{Value}' to {ContentItemGUID}", fieldName, attachmentGuid, contentItemGuid); + break; + } + default: + { + logger.LogTrace("'{FieldName}' UserControlForFile Success={Success} AttachmentGUID={attachmentGuid}", fieldName, false, attachmentGuid); + break; + } + } + } + else if (sourceValue is string attachmentGuidStr && Guid.TryParse(attachmentGuidStr, out attachmentGuid)) + { + switch (await attachmentMigrator.MigrateAttachment(attachmentGuid, $"__{fieldName}", cmsSite.SiteID)) + { + case MigrateAttachmentResultMediaFile { Success: true, MediaFileInfo: { } x }: + { + mfis = [new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }]; + hasMigratedAsset = true; + logger.LogTrace("MediaFile migrated from attachment '{Field}': '{Value}' (parsed)", fieldName, attachmentGuid); + break; + } + case MigrateAttachmentResultContentItem { Success: true, ContentItemGuid: { } contentItemGuid }: + { + mfis = + [ + new ContentItemReference { Identifier = contentItemGuid } + ]; + hasMigratedAsset = true; + logger.LogTrace("Content item migrated from attachment '{Field}': '{Value}' to {ContentItemGUID}", fieldName, attachmentGuid, contentItemGuid); + break; + } + default: + { + logger.LogTrace("'{FieldName}' UserControlForFile Success={Success} AttachmentGUID={attachmentGuid}", fieldName, false, attachmentGuid); + break; + } + } + } + else + { + logger.LogTrace("'{FieldName}' UserControlForFile AttachmentGUID={Value}", fieldName, sourceValue); + } + + break; + } + case { UserControlForDocAttachments: true }: + { + // new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize } + if (documentId is { } docId) + { + var mfisl = new List(); + await foreach (var migResult in attachmentMigrator.MigrateGroupedAttachments(docId, field.Guid, field.Name)) + { + switch (migResult) + { + case MigrateAttachmentResultMediaFile { Success: true, MediaFileInfo: { } x }: + { + mfisl.Add(new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }); + hasMigratedAsset = true; + break; + } + case MigrateAttachmentResultContentItem { Success: true, ContentItemGuid: { } contentItemGuid }: + { + mfis = + [ + new ContentItemReference { Identifier = contentItemGuid } + ]; + hasMigratedAsset = true; + logger.LogTrace("Content item migrated from document '{DocumentID}' attachment '{FiledName}' to {ContentItemGUID}", docId, field.Name, contentItemGuid); + break; + } + default: + { + hasMigratedAsset = false; + break; + } + } + } + + mfis = mfisl; + } + else + { + logger.LogTrace("'{FieldName}' UserControlForDocAttachments DocumentID={Value}", fieldName, documentId); + } + + break; + } + + default: + break; + } + } + else + { + logger.LogWarning("Unable to map value based on selected migration, value: '{Value}'", sourceValue); + return new FieldMigrationResult(false, null); + } + + if (hasMigratedAsset && mfis is { Count: > 0 }) + { + return new FieldMigrationResult(true, SerializationHelper.Serialize(mfis)); + } + else if (DBNull.Value.Equals(sourceValue)) + { + return new FieldMigrationResult(true, null); + } + else + { + logger.LogTrace("No assets migrated for '{FieldName}', value: '{Value}'", fieldName, sourceValue); + return new FieldMigrationResult(false, null); + } + } + + public void MigrateFieldDefinition(FormDefinitionPatcher formDefinitionPatcher, XElement field, XAttribute? columnTypeAttr, string fieldDescriptor) + { + columnTypeAttr?.SetValue(configuration.MigrateMediaToMediaLibrary ? FieldDataType.Assets : FieldDataType.ContentItemReference); + + var settings = field.EnsureElement(FormDefinitionPatcher.FieldElemSettings); + settings.EnsureElement(FormDefinitionPatcher.SettingsElemControlname, e => e.Value = configuration.MigrateMediaToMediaLibrary ? FormComponents.AdminAssetSelectorComponent : FormComponents.AdminContentItemSelectorComponent); + if (configuration.MigrateMediaToMediaLibrary) + { + settings.EnsureElement(FormDefinitionPatcher.SettingsMaximumassets, maxAssets => maxAssets.Value = FormDefinitionPatcher.SettingsMaximumassetsFallback); + } + } +} diff --git a/Migration.Tool.Extensions/Migration.Tool.Extensions.csproj b/Migration.Tool.Extensions/Migration.Tool.Extensions.csproj new file mode 100644 index 00000000..d1507c3b --- /dev/null +++ b/Migration.Tool.Extensions/Migration.Tool.Extensions.csproj @@ -0,0 +1,18 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + + diff --git a/Migration.Tool.Extensions/README.md b/Migration.Tool.Extensions/README.md new file mode 100644 index 00000000..f30baed3 --- /dev/null +++ b/Migration.Tool.Extensions/README.md @@ -0,0 +1,81 @@ +## Custom migrations + +Samples: +- `Migration.Tool.Extensions/CommunityMigrations/SampleTextMigration.cs` contains simplest implementation for migration of text fields +- `Migration.Tool.Extensions/DefaultMigrations/AssetMigration.cs` contains real world migration of assets (complex example) + +To create custom migration: +- create new file in `Migration.Tool.Extensions/CommunityMigrations` (directory if you need more files for single migration) +- implement interface `Migration.Tool.KXP.Api.Services.CmsClass.IFieldMigration` + - implement property rank, set number bellow 100 000 - for example 5000 + - implement method shall migrate (if method returns true, migration will be used) + - implement `MigrateFieldDefinition`, where objective is to mutate argument `XElement field` that represents one particular field + - implement `MigrateValue` where goal is to return new migrated value derived from `object? sourceValue` +- finally register in `Migration.Tool.Extensions/ServiceCollectionExtensions.cs` as `Transient` dependency into service collection. For example `services.AddTransient()` + +## Custom class mappings for page types + +examples are `Migration.Tool.Extensions/ClassMappings/ClassMappingSample.cs` + +### Class remodeling sample + +demonstrated in method `AddSimpleRemodelingSample`, goal is to take single data class and change it to more suitable shape. + +### Class merge sample + +demonstrated in method `AddClassMergeExample`, goal is to take multiple data classes from source instance and define their relation to new class + +lets define new class: +```csharp +var m = new MultiClassMapping(targetClassName, target => +{ + target.ClassName = targetClassName; + target.ClassTableName = "ET_Event"; + target.ClassDisplayName = "ET - MY new transformed event"; + target.ClassType = ClassType.CONTENT_TYPE; + target.ClassContentTypeType = ClassContentTypeType.WEBSITE; +}); +``` + +define new primary key: +```csharp +m.BuildField("EventID").AsPrimaryKey(); +``` + +and finally lets define relations to fields: + +1) build field title +```csharp +// build new field +var title = m.BuildField("Title"); + +// map "EventTitle" field form source data class "_ET.Event1" also use it as template for target field +title.SetFrom("_ET.Event1", "EventTitle", true); +// map "EventTitle" field form source data class "_ET.Event2" +title.SetFrom("_ET.Event2", "EventTitle"); + +// patch field definition, in this case lets change field caption +title.WithFieldPatch(f => f.Caption = "Event title"); +``` + +2) in similar fashion map other fields + +3) if needed custom value conversion can be used +```csharp +var startDate = m.BuildField("StartDate"); +startDate.SetFrom("_ET.Event1", "EventDateStart", true); +// if needed use value conversion to adapt value +startDate.ConvertFrom("_ET.Event2", "EventStartDateAsText", false, + v => v?.ToString() is { } av && !string.IsNullOrWhiteSpace(av) ? DateTime.Parse(av) : null +); +startDate.WithFieldPatch(f => f.Caption = "Event start date"); +``` + +4) register class mapping to dependency injection ocntainer +```csharp +serviceCollection.AddSingleton(m); +``` + +### Inject and use reusable schema + +demonstrated in method `AddReusableSchemaIntegrationSample`, goal is to take single data class and assign reusable schema. \ No newline at end of file diff --git a/Migration.Tool.Extensions/ServiceCollectionExtensions.cs b/Migration.Tool.Extensions/ServiceCollectionExtensions.cs new file mode 100644 index 00000000..be060670 --- /dev/null +++ b/Migration.Tool.Extensions/ServiceCollectionExtensions.cs @@ -0,0 +1,20 @@ +using Microsoft.Extensions.DependencyInjection; +using Migration.Tool.Extensions.CommunityMigrations; +using Migration.Tool.Extensions.DefaultMigrations; +using Migration.Tool.KXP.Api.Services.CmsClass; + +namespace Migration.Tool.Extensions; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection UseCustomizations(this IServiceCollection services) + { + services.AddTransient(); + services.AddTransient(); + + // services.AddClassMergeExample(); + // services.AddSimpleRemodelingSample(); + // services.AddReusableSchemaIntegrationSample(); + return services; + } +} diff --git a/Migration.Tool.K11/Auxiliary/Kx13FormControls.cs b/Migration.Tool.K11/Auxiliary/Kx13FormControls.cs new file mode 100644 index 00000000..0f56e4e5 --- /dev/null +++ b/Migration.Tool.K11/Auxiliary/Kx13FormControls.cs @@ -0,0 +1,234 @@ +// ReSharper disable InconsistentNaming + +namespace Migration.Tool.K11.Auxiliary; + +public class Kx12FormControls +{ + public class UserControlForText + { + public const string AbTestConversionTypeSelector = "ABTestConversionTypeSelector"; + public const string ActivityTypeSelector = "ActivityTypeSelector"; + public const string AllowedExtensionsSelector = "AllowedExtensionsSelector"; + public const string Selectalternativeform = "selectalternativeform"; + public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; + public const string AssemblyClassSelector = "AssemblyClassSelector"; + public const string Fieldselector = "fieldselector"; + public const string BizFormSelector = "BizFormSelector"; + public const string BundleInventoryTypeSelector = "BundleInventoryTypeSelector"; + public const string CampaignSelector = "CampaignSelector"; + public const string CategorySelector = "CategorySelector"; + public const string ClassFieldSelector = "ClassFieldSelector"; + public const string ClassFields = "Class_fields"; + public const string CodeName = "CodeName"; + public const string CodeNameWithPrefix = "CodeNameWithPrefix"; + public const string Selectcolor = "selectcolor"; + public const string Columns = "Columns"; + public const string ConnectionStringSelector = "Connection_string_selector"; + public const string ContactClassFields = "Contact_class_fields"; + public const string CountrySelector = "countrySelector"; + public const string CssStylesEditor = "CSS_Styles_Editor"; + public const string Selectculture = "selectculture"; + public const string CultureSelectorForSettings = "CultureSelectorForSettings"; + public const string CurrencySelector = "currencySelector"; + public const string CustomTableItemSelector = "CustomTableItemSelector"; + public const string CustomTableSelector = "CustomTableSelector"; + public const string Selectcolumns = "selectcolumns"; + public const string DepartmentSelector = "DepartmentSelector"; + public const string DropDownListControl = "DropDownListControl"; + public const string DueDateSelector = "Due_date_selector"; + public const string Emailinput = "emailinput"; + public const string EmailTemplateSelector = "Email_template_selector"; + public const string EmailTemplateTypeSelector = "Email_template_type_selector"; + public const string EncodingTextBox = "EncodingTextBox"; + public const string EncryptedPassword = "EncryptedPassword"; + public const string EnumSelector = "EnumSelector"; + public const string EventLogTypeSelector = "EventLogTypeSelector"; + public const string FacebookAutoPost = "Facebook_auto_post"; + public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; + public const string FileSystemSelector = "FileSystemSelector"; + public const string FontIconSelector = "FontIconSelector"; + public const string FormFieldSelector = "FormFieldSelector"; + public const string FormPassword = "FormPassword"; + public const string FullMediaLibrarySelector = "FullMediaLibrarySelector"; + public const string GetGoogleTranslatorApiKey = "Get_Google_Translator_API_key"; + public const string GetMsTranslatorTextApiKey = "GetMSTranslatorTextAPIKey"; + public const string GoToExternalUrl = "Go_to_external_URL"; + public const string GoogleAnalyticsParameterSelector = "Google_Analytics_parameter_selector"; + public const string Html5Input = "HTML5Input"; + public const string IconSelector = "IconSelector"; + public const string InternalStatusSelector = "InternalStatusSelector"; + public const string Internationalphone = "internationalphone"; + public const string LabelControl = "LabelControl"; + public const string LargeTextArea = "LargeTextArea"; + public const string LicenseSelector = "LicenseSelector"; + public const string LinkedInAutoPost = "LinkedInAutoPost"; + public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; + public const string ListBoxControl = "ListBoxControl"; + public const string LocalizableTextArea = "LocalizableTextArea"; + public const string LocalizableTextBox = "LocalizableTextBox"; + public const string MacroAnyAllBoolSelector = "Macro_any-all_bool_selector"; + public const string MacroAnyAllSelector = "MacroAnyAllSelector"; + public const string MacroDateOperator = "Macro_date_operator"; + public const string MacroEditor = "MacroEditor"; + public const string MacroEqualityOperator = "MacroEqualityOperator"; + public const string MacroNegationOperator = "MacroNegationOperator"; + public const string MacroNumericOperator = "Macro_numeric_operator"; + public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; + public const string MacroTextOperator = "Macro_text_operator"; + public const string MacroType = "MacroType"; + public const string ManufacturerSelector = "ManufacturerSelector"; + public const string MediaLibrarySelector = "MediaLibrarySelector"; + public const string MediaSelectionControl = "MediaSelectionControl"; + public const string MembershipSelector = "MembershipSelector"; + public const string MetafileUploaderControl = "MetafileUploaderControl"; + public const string ModuleSelector = "ModuleSelector"; + public const string MultipleCategoriesSelector = "MultipleCategoriesSelector"; + public const string MultipleChoiceControl = "MultipleChoiceControl"; + public const string RoleCheckboxSelector = "RoleCheckboxSelector"; + public const string SimpleCheckboxRoleSelector = "SimpleCheckboxRoleSelector"; + public const string SimpleCheckboxSiteSelector = "SimpleCheckboxSiteSelector"; + public const string MultipleUserSelector = "MultipleUserSelector"; + public const string NewsletterSelector = "NewsletterSelector"; + public const string NewsletterSelectorSimple = "NewsletterSelectorSimple"; + public const string NumericUpDown = "NumericUpDown"; + public const string ObjectColumnSelector = "ObjectColumnSelector"; + public const string ObjectSelector = "ObjectSelector"; + public const string ObjectTransformation = "ObjectTransformation"; + public const string ObjectTypeBinSelector = "ObjectTypeBinSelector"; + public const string ObjectTypeSelector = "ObjectTypeSelector"; + public const string OptionCategoryProductOptionSelector = "OptionCategoryProductOptionSelector"; + public const string OptionCategorySelectionTypeSelector = "OptionCategorySelectionTypeSelector"; + public const string OrderBy = "OrderBy"; + public const string OrderStatusSelector = "OrderStatusSelector"; + public const string DocumentCultureFilter = "DocumentCultureFilter"; + public const string PageLayoutCode = "Page_layout_code"; + public const string Selectdocument = "selectdocument"; + public const string PageTemplateLevels = "PageTemplateLevels"; + public const string Selectpagetemplate = "selectpagetemplate"; + public const string DocumentTypeIconSelector = "DocumentTypeIconSelector"; + public const string Selectclassnames = "selectclassnames"; + public const string Password = "Password"; + public const string PasswordStrength = "PasswordStrength"; + public const string PasswordConfirmator = "PasswordConfirmator"; + public const string Selectpath = "selectpath"; + public const string PaymentSelector = "paymentSelector"; + public const string ProductImageSelector = "ProductImageSelector"; + public const string ProductRelationshipNameSelector = "ProductRelationshipNameSelector"; + public const string ProductSectionsSelector = "ProductSectionsSelector"; + public const string ProductTypeSelector = "ProductTypeSelector"; + public const string PublicStatusSelector = "PublicStatusSelector"; + public const string Selectquery = "selectquery"; + public const string RadioButtonsControl = "RadioButtonsControl"; + public const string AgeRangeSelector = "AgeRangeSelector"; + public const string RelatedDocuments = "RelatedDocuments"; + public const string Relationshipconfiguration = "relationshipconfiguration"; + public const string SelectRelationshipName = "SelectRelationshipName"; + public const string ReportSelectorDropDown = "ReportSelectorDropDown"; + public const string RoleSelector = "RoleSelector"; + public const string SearchClassNameSelector = "SearchClassNameSelector"; + public const string SearchIndexSelector = "SearchIndexSelector"; + public const string SearchIndexTypeSelector = "SearchIndexTypeSelector"; + public const string SelectCmsVersion = "SelectCMSVersion"; + public const string SettingsKeyControlSelector = "SettingsKeyControlSelector"; + public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; + public const string SharePointListSelector = "SharePointListSelector"; + public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; + public const string ShippingSelector = "shippingSelector"; + public const string ShippingServiceSelector = "ShippingServiceSelector"; + public const string Selectsinglepath = "selectsinglepath"; + public const string SinglePathSelectorWithPermissions = "SinglePathSelectorWithPermissions"; + public const string SiteContentCulture = "SiteContentCulture"; + public const string SiteCultureSelector = "SiteCultureSelector"; + public const string SiteCultureSelectorAll = "SiteCultureSelectorAll"; + public const string Selectsite = "selectsite"; + public const string SiteSelectorWithAllFieldForGlobalAdmin = "SiteSelectorWithAllFieldForGlobalAdmin"; + public const string SkuSelector = "SKUSelector"; + public const string StopWordsSelector = "StopWordsSelector"; + public const string SupplierSelector = "SupplierSelector"; + public const string SupportedCultureSelector = "SupportedCultureSelector"; + public const string TableConversionSettings = "TableConversionSettings"; + public const string TagGroupSelector = "TagGroupSelector"; + public const string TagSelector = "TagSelector"; + public const string TaxAddressTypeSelector = "TaxAddressTypeSelector"; + public const string TextAreaControl = "TextAreaControl"; + public const string TextBoxControl = "TextBoxControl"; + public const string TextFilter = "TextFilter"; + public const string TextboxDefaultValueFromSetting = "Textbox_default_value_from_setting"; + public const string TextboxDoubleValidator = "Textbox_double_validator"; + public const string TimeZoneSelector = "TimeZoneSelector"; + public const string TimeZoneTypeSelector = "TimeZoneTypeSelector"; + public const string ToggleButton = "ToggleButton"; + public const string Selecttransformation = "selecttransformation"; + public const string TranslationServiceSelector = "Translation_service_selector"; + public const string TwitterAutoPost = "Twitter_auto_post"; + public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; + public const string Usphone = "usphone"; + public const string Uszipcode = "uszipcode"; + public const string UiCultureSelector = "UICultureSelector"; + public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; + public const string UniSelector = "Uni_selector"; + public const string UrlChecker = "UrlChecker"; + public const string UrlSelector = "URLSelector"; + public const string SmurlShortenerSelector = "SMURLShortenerSelector"; + public const string UserName = "UserName"; + public const string UserNameSelector = "UserNameSelector"; + public const string UserSelector = "UserSelector"; + public const string ValiditySelector = "ValiditySelector"; + public const string ViewSecureText = "ViewSecureText"; + public const string WhereCondition = "WhereCondition"; + public const string WorkflowScopeDefinition = "WorkflowScopeDefinition"; + } + + public class UserControlForLongText + { + public const string AbTestConversionSelector = "ABTestConversionSelector"; + public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; + public const string BbEditorControl = "BBEditorControl"; + public const string CacheDependencies = "CacheDependencies"; + public const string ClassFields = "Class_fields"; + public const string Columns = "Columns"; + public const string ConditionBuilder = "ConditionBuilder"; + public const string ContactClassFields = "Contact_class_fields"; + public const string CssStylesEditor = "CSS_Styles_Editor"; + public const string Selectcolumns = "selectcolumns"; + public const string DropDownListControl = "DropDownListControl"; + public const string FacebookAutoPost = "Facebook_auto_post"; + public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; + public const string FileSystemSelector = "FileSystemSelector"; + public const string Html5Input = "HTML5Input"; + public const string AutoResizeConfiguration = "AutoResizeConfiguration"; + public const string LabelControl = "LabelControl"; + public const string LargeTextArea = "LargeTextArea"; + public const string LinkedInAutoPost = "LinkedInAutoPost"; + public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; + public const string LocalizableTextArea = "LocalizableTextArea"; + public const string LocalizableTextBox = "LocalizableTextBox"; + public const string MacroEditor = "MacroEditor"; + public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; + public const string MultipleObjectBindingControl = "MultipleObjectBindingControl"; + public const string ObjectTypeSelector = "ObjectTypeSelector"; + public const string OptionsSelector = "OptionsSelector"; + public const string OrderBy = "OrderBy"; + public const string PageLayoutCode = "Page_layout_code"; + public const string ProductSectionsSelector = "ProductSectionsSelector"; + public const string RelatedDocuments = "RelatedDocuments"; + public const string ReportGraphSelector = "ReportGraphSelector"; + public const string ReportTableSelector = "ReportTableSelector"; + public const string ReportValueSelector = "ReportValueSelector"; + public const string HtmlAreaControl = "HtmlAreaControl"; + public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; + public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; + public const string TagSelector = "TagSelector"; + public const string TextAreaControl = "TextAreaControl"; + public const string TextBoxControl = "TextBoxControl"; + public const string TextFilter = "TextFilter"; + public const string TranslationServiceSelector = "Translation_service_selector"; + public const string TwitterAutoPost = "Twitter_auto_post"; + public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; + public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; + public const string UniSelector = "Uni_selector"; + public const string SmurlShortenerSelector = "SMURLShortenerSelector"; + public const string ViewSecureText = "ViewSecureText"; + public const string WhereCondition = "WhereCondition"; + } +} diff --git a/Migration.Toolkit.K11/Context/K11Context.cs b/Migration.Tool.K11/Context/K11Context.cs similarity index 99% rename from Migration.Toolkit.K11/Context/K11Context.cs rename to Migration.Tool.K11/Context/K11Context.cs index d1a1e893..7b6aadd5 100644 --- a/Migration.Toolkit.K11/Context/K11Context.cs +++ b/Migration.Tool.K11/Context/K11Context.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; -using Migration.Toolkit.K11.Models; +using Migration.Tool.K11.Models; -namespace Migration.Toolkit.K11; +namespace Migration.Tool.K11; public partial class K11Context : DbContext { diff --git a/Migration.Tool.K11/ContextCustomizations.cs b/Migration.Tool.K11/ContextCustomizations.cs new file mode 100644 index 00000000..8424c011 --- /dev/null +++ b/Migration.Tool.K11/ContextCustomizations.cs @@ -0,0 +1,14 @@ +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11; + +public partial class K11Context +{ + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder + .EnableDetailedErrors() + .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); + base.OnConfiguring(optionsBuilder); + } +} diff --git a/Migration.Tool.K11/DependencyInjectionExtensions.cs b/Migration.Tool.K11/DependencyInjectionExtensions.cs new file mode 100644 index 00000000..30e1e143 --- /dev/null +++ b/Migration.Tool.K11/DependencyInjectionExtensions.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; + +using Migration.Tool.Common; + +namespace Migration.Tool.K11; + +public static class DependencyInjectionExtensions +{ + public static IServiceCollection UseK11DbContext(this IServiceCollection services, ToolConfiguration toolConfiguration) + { + services.AddDbContextFactory(options => options.UseSqlServer(toolConfiguration.KxConnectionString)); + return services; + } +} diff --git a/Migration.Tool.K11/Migration.Tool.K11.csproj b/Migration.Tool.K11/Migration.Tool.K11.csproj new file mode 100644 index 00000000..6279fd8c --- /dev/null +++ b/Migration.Tool.K11/Migration.Tool.K11.csproj @@ -0,0 +1,42 @@ + + + + + TextTemplatingFileGenerator + SettingsKeys.cs + + + + + + True + True + SettingsKeys.tt + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + diff --git a/Migration.Toolkit.K11/Migration.Toolkit.K11.csproj.DotSettings b/Migration.Tool.K11/Migration.Tool.K11.csproj.DotSettings similarity index 100% rename from Migration.Toolkit.K11/Migration.Toolkit.K11.csproj.DotSettings rename to Migration.Tool.K11/Migration.Tool.K11.csproj.DotSettings diff --git a/Migration.Tool.K11/Models/AnalyticsCampaign.cs b/Migration.Tool.K11/Models/AnalyticsCampaign.cs new file mode 100644 index 00000000..7473ec28 --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsCampaign.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_Campaign")] +[Index("CampaignScheduledTaskId", Name = "IX_Analytics_Campaign_CampaignScheduledTaskID")] +[Index("CampaignSiteId", Name = "IX_Analytics_Campaign_CampaignSiteID")] +public class AnalyticsCampaign +{ + [Key] + [Column("CampaignID")] + public int CampaignId { get; set; } + + [StringLength(200)] + public string CampaignName { get; set; } = null!; + + [StringLength(100)] + public string CampaignDisplayName { get; set; } = null!; + + public string? CampaignDescription { get; set; } + + [Column("CampaignSiteID")] + public int CampaignSiteId { get; set; } + + public DateTime? CampaignOpenFrom { get; set; } + + public DateTime? CampaignOpenTo { get; set; } + + [Column("CampaignGUID")] + public Guid CampaignGuid { get; set; } + + public DateTime CampaignLastModified { get; set; } + + [Column("CampaignUTMCode")] + [StringLength(200)] + public string? CampaignUtmcode { get; set; } + + public DateTime? CampaignCalculatedTo { get; set; } + + [Column("CampaignScheduledTaskID")] + public int? CampaignScheduledTaskId { get; set; } + + public int? CampaignVisitors { get; set; } + + [InverseProperty("CampaignAssetCampaign")] + public virtual ICollection AnalyticsCampaignAssets { get; set; } = new List(); + + [InverseProperty("CampaignConversionCampaign")] + public virtual ICollection AnalyticsCampaignConversions { get; set; } = new List(); + + [InverseProperty("CampaignObjectiveCampaign")] + public virtual AnalyticsCampaignObjective? AnalyticsCampaignObjective { get; set; } + + [ForeignKey("CampaignScheduledTaskId")] + [InverseProperty("AnalyticsCampaigns")] + public virtual CmsScheduledTask? CampaignScheduledTask { get; set; } + + [ForeignKey("CampaignSiteId")] + [InverseProperty("AnalyticsCampaigns")] + public virtual CmsSite CampaignSite { get; set; } = null!; + + [InverseProperty("FacebookPostCampaign")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); + + [InverseProperty("LinkedInPostCampaign")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); + + [InverseProperty("TwitterPostCampaign")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/AnalyticsCampaignAsset.cs b/Migration.Tool.K11/Models/AnalyticsCampaignAsset.cs new file mode 100644 index 00000000..f202391f --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsCampaignAsset.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_CampaignAsset")] +[Index("CampaignAssetCampaignId", Name = "IX_Analytics_CampaignAsset_CampaignAssetCampaignID")] +public class AnalyticsCampaignAsset +{ + [Key] + [Column("CampaignAssetID")] + public int CampaignAssetId { get; set; } + + public Guid CampaignAssetGuid { get; set; } + + public DateTime CampaignAssetLastModified { get; set; } + + public Guid CampaignAssetAssetGuid { get; set; } + + [Column("CampaignAssetCampaignID")] + public int CampaignAssetCampaignId { get; set; } + + [StringLength(200)] + public string CampaignAssetType { get; set; } = null!; + + [InverseProperty("CampaignAssetUrlCampaignAsset")] + public virtual ICollection AnalyticsCampaignAssetUrls { get; set; } = new List(); + + [ForeignKey("CampaignAssetCampaignId")] + [InverseProperty("AnalyticsCampaignAssets")] + public virtual AnalyticsCampaign CampaignAssetCampaign { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/AnalyticsCampaignAssetUrl.cs b/Migration.Tool.K11/Models/AnalyticsCampaignAssetUrl.cs new file mode 100644 index 00000000..08fdb5aa --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsCampaignAssetUrl.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_CampaignAssetUrl")] +[Index("CampaignAssetUrlCampaignAssetId", Name = "IX_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID")] +public class AnalyticsCampaignAssetUrl +{ + [Key] + [Column("CampaignAssetUrlID")] + public int CampaignAssetUrlId { get; set; } + + public Guid CampaignAssetUrlGuid { get; set; } + + public string CampaignAssetUrlTarget { get; set; } = null!; + + [StringLength(200)] + public string CampaignAssetUrlPageTitle { get; set; } = null!; + + [Column("CampaignAssetUrlCampaignAssetID")] + public int CampaignAssetUrlCampaignAssetId { get; set; } + + [ForeignKey("CampaignAssetUrlCampaignAssetId")] + [InverseProperty("AnalyticsCampaignAssetUrls")] + public virtual AnalyticsCampaignAsset CampaignAssetUrlCampaignAsset { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/AnalyticsCampaignConversion.cs b/Migration.Tool.K11/Models/AnalyticsCampaignConversion.cs new file mode 100644 index 00000000..eb7cb7f1 --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsCampaignConversion.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_CampaignConversion")] +[Index("CampaignConversionCampaignId", Name = "IX_Analytics_CampaignConversion_CampaignConversionCampaignID")] +public class AnalyticsCampaignConversion +{ + [Key] + [Column("CampaignConversionID")] + public int CampaignConversionId { get; set; } + + public Guid CampaignConversionGuid { get; set; } + + public DateTime CampaignConversionLastModified { get; set; } + + [StringLength(100)] + public string CampaignConversionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string CampaignConversionName { get; set; } = null!; + + [Column("CampaignConversionCampaignID")] + public int CampaignConversionCampaignId { get; set; } + + public int CampaignConversionOrder { get; set; } + + [StringLength(250)] + public string CampaignConversionActivityType { get; set; } = null!; + + public int CampaignConversionHits { get; set; } + + [Column("CampaignConversionItemID")] + public int? CampaignConversionItemId { get; set; } + + public double CampaignConversionValue { get; set; } + + public bool CampaignConversionIsFunnelStep { get; set; } + + [Column("CampaignConversionURL")] + public string? CampaignConversionUrl { get; set; } + + [InverseProperty("CampaignConversionHitsConversion")] + public virtual ICollection AnalyticsCampaignConversionHits { get; set; } = new List(); + + [InverseProperty("CampaignObjectiveCampaignConversion")] + public virtual ICollection AnalyticsCampaignObjectives { get; set; } = new List(); + + [ForeignKey("CampaignConversionCampaignId")] + [InverseProperty("AnalyticsCampaignConversions")] + public virtual AnalyticsCampaign CampaignConversionCampaign { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/AnalyticsCampaignConversionHit.cs b/Migration.Tool.K11/Models/AnalyticsCampaignConversionHit.cs new file mode 100644 index 00000000..42277972 --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsCampaignConversionHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_CampaignConversionHits")] +[Index("CampaignConversionHitsConversionId", Name = "IX_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID")] +public class AnalyticsCampaignConversionHit +{ + [Key] + [Column("CampaignConversionHitsID")] + public int CampaignConversionHitsId { get; set; } + + [Column("CampaignConversionHitsConversionID")] + public int CampaignConversionHitsConversionId { get; set; } + + public int CampaignConversionHitsCount { get; set; } + + [StringLength(200)] + public string CampaignConversionHitsSourceName { get; set; } = null!; + + [StringLength(200)] + public string? CampaignConversionHitsContentName { get; set; } + + [ForeignKey("CampaignConversionHitsConversionId")] + [InverseProperty("AnalyticsCampaignConversionHits")] + public virtual AnalyticsCampaignConversion CampaignConversionHitsConversion { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/AnalyticsCampaignObjective.cs b/Migration.Tool.K11/Models/AnalyticsCampaignObjective.cs new file mode 100644 index 00000000..3ab197a1 --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsCampaignObjective.cs @@ -0,0 +1,36 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_CampaignObjective")] +[Index("CampaignObjectiveCampaignId", Name = "CK_Analytics_CampaignObjective_CampaignObjectiveCampaignID", IsUnique = true)] +[Index("CampaignObjectiveCampaignConversionId", Name = "IX_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID")] +public class AnalyticsCampaignObjective +{ + [Key] + [Column("CampaignObjectiveID")] + public int CampaignObjectiveId { get; set; } + + public Guid CampaignObjectiveGuid { get; set; } + + public DateTime CampaignObjectiveLastModified { get; set; } + + [Column("CampaignObjectiveCampaignID")] + public int CampaignObjectiveCampaignId { get; set; } + + public int? CampaignObjectiveValue { get; set; } + + [Column("CampaignObjectiveCampaignConversionID")] + public int CampaignObjectiveCampaignConversionId { get; set; } + + [ForeignKey("CampaignObjectiveCampaignId")] + [InverseProperty("AnalyticsCampaignObjective")] + public virtual AnalyticsCampaign CampaignObjectiveCampaign { get; set; } = null!; + + [ForeignKey("CampaignObjectiveCampaignConversionId")] + [InverseProperty("AnalyticsCampaignObjectives")] + public virtual AnalyticsCampaignConversion CampaignObjectiveCampaignConversion { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/AnalyticsConversion.cs b/Migration.Tool.K11/Models/AnalyticsConversion.cs new file mode 100644 index 00000000..87edc1d8 --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsConversion.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_Conversion")] +[Index("ConversionSiteId", Name = "IX_Analytics_Conversion_ConversionSiteID")] +public class AnalyticsConversion +{ + [Key] + [Column("ConversionID")] + public int ConversionId { get; set; } + + [StringLength(200)] + public string ConversionName { get; set; } = null!; + + [StringLength(200)] + public string ConversionDisplayName { get; set; } = null!; + + public string? ConversionDescription { get; set; } + + [Column("ConversionGUID")] + public Guid ConversionGuid { get; set; } + + public DateTime ConversionLastModified { get; set; } + + [Column("ConversionSiteID")] + public int ConversionSiteId { get; set; } + + [ForeignKey("ConversionSiteId")] + [InverseProperty("AnalyticsConversions")] + public virtual CmsSite ConversionSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/AnalyticsDayHit.cs b/Migration.Tool.K11/Models/AnalyticsDayHit.cs new file mode 100644 index 00000000..cc913c69 --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsDayHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_DayHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_DayHits_HitsStatisticsID")] +public class AnalyticsDayHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsDayHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/AnalyticsExitPage.cs b/Migration.Tool.K11/Models/AnalyticsExitPage.cs new file mode 100644 index 00000000..a3e2f981 --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsExitPage.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_ExitPages")] +[Index("ExitPageLastModified", Name = "IX_Analytics_ExitPages_ExitPageLastModified")] +public class AnalyticsExitPage +{ + [Key] + [StringLength(200)] + public string SessionIdentificator { get; set; } = null!; + + [Column("ExitPageNodeID")] + public int ExitPageNodeId { get; set; } + + public DateTime ExitPageLastModified { get; set; } + + [Column("ExitPageSiteID")] + public int ExitPageSiteId { get; set; } + + [StringLength(10)] + public string? ExitPageCulture { get; set; } +} diff --git a/Migration.Tool.K11/Models/AnalyticsHourHit.cs b/Migration.Tool.K11/Models/AnalyticsHourHit.cs new file mode 100644 index 00000000..ad0f7644 --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsHourHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_HourHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_HourHits_HitsStatisticsID")] +public class AnalyticsHourHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsHourHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/AnalyticsMonthHit.cs b/Migration.Tool.K11/Models/AnalyticsMonthHit.cs new file mode 100644 index 00000000..1e24766b --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsMonthHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_MonthHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_MonthHits_HitsStatisticsID")] +public class AnalyticsMonthHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsMonthHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/AnalyticsStatistic.cs b/Migration.Tool.K11/Models/AnalyticsStatistic.cs new file mode 100644 index 00000000..08e85248 --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsStatistic.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_Statistics")] +[Index("StatisticsSiteId", Name = "IX_Analytics_Statistics_StatisticsSiteID")] +public class AnalyticsStatistic +{ + [Key] + [Column("StatisticsID")] + public int StatisticsId { get; set; } + + [Column("StatisticsSiteID")] + public int? StatisticsSiteId { get; set; } + + [StringLength(400)] + public string StatisticsCode { get; set; } = null!; + + [StringLength(450)] + public string? StatisticsObjectName { get; set; } + + [Column("StatisticsObjectID")] + public int? StatisticsObjectId { get; set; } + + [StringLength(10)] + public string? StatisticsObjectCulture { get; set; } + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsDayHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsHourHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsMonthHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsWeekHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsYearHits { get; set; } = new List(); + + [ForeignKey("StatisticsSiteId")] + [InverseProperty("AnalyticsStatistics")] + public virtual CmsSite? StatisticsSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/AnalyticsWeekHit.cs b/Migration.Tool.K11/Models/AnalyticsWeekHit.cs new file mode 100644 index 00000000..09fa05c5 --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsWeekHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_WeekHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_WeekHits_HitsStatisticsID")] +public class AnalyticsWeekHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsWeekHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/AnalyticsYearHit.cs b/Migration.Tool.K11/Models/AnalyticsYearHit.cs new file mode 100644 index 00000000..e49685f5 --- /dev/null +++ b/Migration.Tool.K11/Models/AnalyticsYearHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Analytics_YearHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_WeekYearHits_HitsStatisticsID")] +public class AnalyticsYearHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsYearHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/BadWordsWord.cs b/Migration.Tool.K11/Models/BadWordsWord.cs new file mode 100644 index 00000000..438b8aa2 --- /dev/null +++ b/Migration.Tool.K11/Models/BadWordsWord.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("BadWords_Word")] +[Index("WordIsGlobal", Name = "IX_BadWords_Word_WordIsGlobal")] +public class BadWordsWord +{ + [Key] + [Column("WordID")] + public int WordId { get; set; } + + [Column("WordGUID")] + public Guid WordGuid { get; set; } + + public DateTime WordLastModified { get; set; } + + [StringLength(200)] + public string WordExpression { get; set; } = null!; + + [StringLength(200)] + public string? WordReplacement { get; set; } + + public int? WordAction { get; set; } + + public bool WordIsGlobal { get; set; } + + public bool WordIsRegularExpression { get; set; } + + public bool? WordMatchWholeWord { get; set; } + + [ForeignKey("WordId")] + [InverseProperty("Words")] + public virtual ICollection Cultures { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/BlogComment.cs b/Migration.Tool.K11/Models/BlogComment.cs new file mode 100644 index 00000000..970bf53d --- /dev/null +++ b/Migration.Tool.K11/Models/BlogComment.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Blog_Comment")] +[Index("CommentApprovedByUserId", Name = "IX_Blog_Comment_CommentApprovedByUserID")] +[Index("CommentPostDocumentId", Name = "IX_Blog_Comment_CommentPostDocumentID")] +[Index("CommentUserId", Name = "IX_Blog_Comment_CommentUserID")] +public class BlogComment +{ + [Key] + [Column("CommentID")] + public int CommentId { get; set; } + + [StringLength(200)] + public string CommentUserName { get; set; } = null!; + + [Column("CommentUserID")] + public int? CommentUserId { get; set; } + + [StringLength(450)] + public string? CommentUrl { get; set; } + + public string CommentText { get; set; } = null!; + + [Column("CommentApprovedByUserID")] + public int? CommentApprovedByUserId { get; set; } + + [Column("CommentPostDocumentID")] + public int CommentPostDocumentId { get; set; } + + public DateTime CommentDate { get; set; } + + public bool? CommentIsSpam { get; set; } + + public bool? CommentApproved { get; set; } + + [StringLength(254)] + public string? CommentEmail { get; set; } + + public string? CommentInfo { get; set; } + + [Column("CommentGUID")] + public Guid CommentGuid { get; set; } + + [ForeignKey("CommentApprovedByUserId")] + [InverseProperty("BlogCommentCommentApprovedByUsers")] + public virtual CmsUser? CommentApprovedByUser { get; set; } + + [ForeignKey("CommentPostDocumentId")] + [InverseProperty("BlogComments")] + public virtual CmsDocument CommentPostDocument { get; set; } = null!; + + [ForeignKey("CommentUserId")] + [InverseProperty("BlogCommentCommentUsers")] + public virtual CmsUser? CommentUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/BlogPostSubscription.cs b/Migration.Tool.K11/Models/BlogPostSubscription.cs new file mode 100644 index 00000000..949efdf6 --- /dev/null +++ b/Migration.Tool.K11/Models/BlogPostSubscription.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Blog_PostSubscription")] +[Index("SubscriptionPostDocumentId", Name = "IX_Blog_PostSubscription_SubscriptionPostDocumentID")] +[Index("SubscriptionUserId", Name = "IX_Blog_PostSubscription_SubscriptionUserID")] +public class BlogPostSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionPostDocumentID")] + public int SubscriptionPostDocumentId { get; set; } + + [Column("SubscriptionUserID")] + public int? SubscriptionUserId { get; set; } + + [StringLength(254)] + public string? SubscriptionEmail { get; set; } + + public DateTime SubscriptionLastModified { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [ForeignKey("SubscriptionPostDocumentId")] + [InverseProperty("BlogPostSubscriptions")] + public virtual CmsDocument SubscriptionPostDocument { get; set; } = null!; + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("BlogPostSubscriptions")] + public virtual CmsUser? SubscriptionUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/BoardBoard.cs b/Migration.Tool.K11/Models/BoardBoard.cs new file mode 100644 index 00000000..511841c7 --- /dev/null +++ b/Migration.Tool.K11/Models/BoardBoard.cs @@ -0,0 +1,116 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Board_Board")] +[Index("BoardDocumentId", "BoardName", Name = "IX_Board_Board_BoardDocumentID_BoardName", IsUnique = true)] +[Index("BoardGroupId", "BoardName", Name = "IX_Board_Board_BoardGroupID_BoardName")] +[Index("BoardSiteId", Name = "IX_Board_Board_BoardSiteID")] +[Index("BoardUserId", "BoardName", Name = "IX_Board_Board_BoardUserID_BoardName")] +public class BoardBoard +{ + [Key] + [Column("BoardID")] + public int BoardId { get; set; } + + [StringLength(250)] + public string BoardName { get; set; } = null!; + + [StringLength(250)] + public string BoardDisplayName { get; set; } = null!; + + public string BoardDescription { get; set; } = null!; + + public bool BoardOpened { get; set; } + + public DateTime? BoardOpenedFrom { get; set; } + + public DateTime? BoardOpenedTo { get; set; } + + public bool BoardEnabled { get; set; } + + public int BoardAccess { get; set; } + + public bool BoardModerated { get; set; } + + public bool BoardUseCaptcha { get; set; } + + public int BoardMessages { get; set; } + + public DateTime BoardLastModified { get; set; } + + [Column("BoardGUID")] + public Guid BoardGuid { get; set; } + + [Column("BoardDocumentID")] + public int BoardDocumentId { get; set; } + + [Column("BoardUserID")] + public int? BoardUserId { get; set; } + + [Column("BoardGroupID")] + public int? BoardGroupId { get; set; } + + public DateTime? BoardLastMessageTime { get; set; } + + [StringLength(250)] + public string? BoardLastMessageUserName { get; set; } + + [Column("BoardUnsubscriptionURL")] + [StringLength(450)] + public string? BoardUnsubscriptionUrl { get; set; } + + public bool? BoardRequireEmails { get; set; } + + [Column("BoardSiteID")] + public int BoardSiteId { get; set; } + + public bool BoardEnableSubscriptions { get; set; } + + [Column("BoardBaseURL")] + [StringLength(450)] + public string? BoardBaseUrl { get; set; } + + public bool? BoardLogActivity { get; set; } + + public bool? BoardEnableOptIn { get; set; } + + public bool? BoardSendOptInConfirmation { get; set; } + + [Column("BoardOptInApprovalURL")] + [StringLength(450)] + public string? BoardOptInApprovalUrl { get; set; } + + [ForeignKey("BoardDocumentId")] + [InverseProperty("BoardBoards")] + public virtual CmsDocument BoardDocument { get; set; } = null!; + + [ForeignKey("BoardGroupId")] + [InverseProperty("BoardBoards")] + public virtual CommunityGroup? BoardGroup { get; set; } + + [InverseProperty("MessageBoard")] + public virtual ICollection BoardMessagesNavigation { get; set; } = new List(); + + [ForeignKey("BoardSiteId")] + [InverseProperty("BoardBoards")] + public virtual CmsSite BoardSite { get; set; } = null!; + + [InverseProperty("SubscriptionBoard")] + public virtual ICollection BoardSubscriptions { get; set; } = new List(); + + [ForeignKey("BoardUserId")] + [InverseProperty("BoardBoards")] + public virtual CmsUser? BoardUser { get; set; } + + [ForeignKey("BoardId")] + [InverseProperty("Boards")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("BoardId")] + [InverseProperty("Boards")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/BoardMessage.cs b/Migration.Tool.K11/Models/BoardMessage.cs new file mode 100644 index 00000000..0e6c20bd --- /dev/null +++ b/Migration.Tool.K11/Models/BoardMessage.cs @@ -0,0 +1,69 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Board_Message")] +[Index("MessageApprovedByUserId", Name = "IX_Board_Message_MessageApprovedByUserID")] +[Index("MessageApproved", "MessageIsSpam", Name = "IX_Board_Message_MessageApproved_MessageIsSpam")] +[Index("MessageBoardId", "MessageGuid", Name = "IX_Board_Message_MessageBoardID_MessageGUID", IsUnique = true)] +[Index("MessageUserId", Name = "IX_Board_Message_MessageUserID")] +public class BoardMessage +{ + [Key] + [Column("MessageID")] + public int MessageId { get; set; } + + [StringLength(250)] + public string MessageUserName { get; set; } = null!; + + public string MessageText { get; set; } = null!; + + [StringLength(254)] + public string MessageEmail { get; set; } = null!; + + [Column("MessageURL")] + [StringLength(450)] + public string MessageUrl { get; set; } = null!; + + public bool MessageIsSpam { get; set; } + + [Column("MessageBoardID")] + public int MessageBoardId { get; set; } + + public bool MessageApproved { get; set; } + + [Column("MessageApprovedByUserID")] + public int? MessageApprovedByUserId { get; set; } + + [Column("MessageUserID")] + public int? MessageUserId { get; set; } + + public string MessageUserInfo { get; set; } = null!; + + [Column("MessageAvatarGUID")] + public Guid? MessageAvatarGuid { get; set; } + + public DateTime MessageInserted { get; set; } + + public DateTime MessageLastModified { get; set; } + + [Column("MessageGUID")] + public Guid MessageGuid { get; set; } + + public double? MessageRatingValue { get; set; } + + [ForeignKey("MessageApprovedByUserId")] + [InverseProperty("BoardMessageMessageApprovedByUsers")] + public virtual CmsUser? MessageApprovedByUser { get; set; } + + [ForeignKey("MessageBoardId")] + [InverseProperty("BoardMessagesNavigation")] + public virtual BoardBoard MessageBoard { get; set; } = null!; + + [ForeignKey("MessageUserId")] + [InverseProperty("BoardMessageMessageUsers")] + public virtual CmsUser? MessageUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/BoardSubscription.cs b/Migration.Tool.K11/Models/BoardSubscription.cs new file mode 100644 index 00000000..ab3ed9bc --- /dev/null +++ b/Migration.Tool.K11/Models/BoardSubscription.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Board_Subscription")] +[Index("SubscriptionBoardId", Name = "IX_Board_Subscription_SubscriptionBoardID")] +[Index("SubscriptionUserId", Name = "IX_Board_Subscription_SubscriptionUserID")] +public class BoardSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionBoardID")] + public int SubscriptionBoardId { get; set; } + + [Column("SubscriptionUserID")] + public int? SubscriptionUserId { get; set; } + + [StringLength(254)] + public string SubscriptionEmail { get; set; } = null!; + + public DateTime SubscriptionLastModified { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [ForeignKey("SubscriptionBoardId")] + [InverseProperty("BoardSubscriptions")] + public virtual BoardBoard SubscriptionBoard { get; set; } = null!; + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("BoardSubscriptions")] + public virtual CmsUser? SubscriptionUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/ChatInitiatedChatRequest.cs b/Migration.Tool.K11/Models/ChatInitiatedChatRequest.cs new file mode 100644 index 00000000..299be22b --- /dev/null +++ b/Migration.Tool.K11/Models/ChatInitiatedChatRequest.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Chat_InitiatedChatRequest")] +[Index("InitiatedChatRequestInitiatorChatUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestInitiatorChatUserID")] +[Index("InitiatedChatRequestUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestUserID")] +[Index("InitiatedChatRequestRoomId", Name = "UQ_Chat_InitiatedChatRequest_RoomID", IsUnique = true)] +[Index("InitiatedChatRequestUserId", "InitiatedChatRequestContactId", Name = "UQ_Chat_InitiatedChatRequest_UserIDContactID", IsUnique = true)] +public class ChatInitiatedChatRequest +{ + [Key] + [Column("InitiatedChatRequestID")] + public int InitiatedChatRequestId { get; set; } + + [Column("InitiatedChatRequestUserID")] + public int? InitiatedChatRequestUserId { get; set; } + + [Column("InitiatedChatRequestContactID")] + public int? InitiatedChatRequestContactId { get; set; } + + [Column("InitiatedChatRequestRoomID")] + public int InitiatedChatRequestRoomId { get; set; } + + public int InitiatedChatRequestState { get; set; } + + [StringLength(100)] + public string InitiatedChatRequestInitiatorName { get; set; } = null!; + + [Column("InitiatedChatRequestInitiatorChatUserID")] + public int InitiatedChatRequestInitiatorChatUserId { get; set; } + + public DateTime InitiatedChatRequestLastModification { get; set; } + + [ForeignKey("InitiatedChatRequestInitiatorChatUserId")] + [InverseProperty("ChatInitiatedChatRequests")] + public virtual ChatUser InitiatedChatRequestInitiatorChatUser { get; set; } = null!; + + [ForeignKey("InitiatedChatRequestRoomId")] + [InverseProperty("ChatInitiatedChatRequest")] + public virtual ChatRoom InitiatedChatRequestRoom { get; set; } = null!; + + [ForeignKey("InitiatedChatRequestUserId")] + [InverseProperty("ChatInitiatedChatRequests")] + public virtual CmsUser? InitiatedChatRequestUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/ChatMessage.cs b/Migration.Tool.K11/Models/ChatMessage.cs new file mode 100644 index 00000000..a6f2d98f --- /dev/null +++ b/Migration.Tool.K11/Models/ChatMessage.cs @@ -0,0 +1,53 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Chat_Message")] +[Index("ChatMessageLastModified", Name = "IX_Chat_Message_ChatMessageLastModified")] +[Index("ChatMessageRecipientId", Name = "IX_Chat_Message_ChatMessageRecipientID")] +[Index("ChatMessageRoomId", Name = "IX_Chat_Message_ChatMessageRoomID")] +[Index("ChatMessageSystemMessageType", Name = "IX_Chat_Message_ChatMessageSystemMessageType")] +[Index("ChatMessageUserId", Name = "IX_Chat_Message_ChatMessageUserID")] +public class ChatMessage +{ + [Key] + [Column("ChatMessageID")] + public int ChatMessageId { get; set; } + + public DateTime ChatMessageCreatedWhen { get; set; } + + [Column("ChatMessageIPAddress")] + public string ChatMessageIpaddress { get; set; } = null!; + + [Column("ChatMessageUserID")] + public int? ChatMessageUserId { get; set; } + + [Column("ChatMessageRoomID")] + public int ChatMessageRoomId { get; set; } + + public bool ChatMessageRejected { get; set; } + + public DateTime ChatMessageLastModified { get; set; } + + public string ChatMessageText { get; set; } = null!; + + public int ChatMessageSystemMessageType { get; set; } + + [Column("ChatMessageRecipientID")] + public int? ChatMessageRecipientId { get; set; } + + [ForeignKey("ChatMessageRecipientId")] + [InverseProperty("ChatMessageChatMessageRecipients")] + public virtual ChatUser? ChatMessageRecipient { get; set; } + + [ForeignKey("ChatMessageRoomId")] + [InverseProperty("ChatMessages")] + public virtual ChatRoom ChatMessageRoom { get; set; } = null!; + + [ForeignKey("ChatMessageUserId")] + [InverseProperty("ChatMessageChatMessageUsers")] + public virtual ChatUser? ChatMessageUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/ChatNotification.cs b/Migration.Tool.K11/Models/ChatNotification.cs new file mode 100644 index 00000000..2cab1e1a --- /dev/null +++ b/Migration.Tool.K11/Models/ChatNotification.cs @@ -0,0 +1,54 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Chat_Notification")] +[Index("ChatNotificationReceiverId", Name = "IX_Chat_Notification_ChatNotificationReceiverID")] +[Index("ChatNotificationRoomId", Name = "IX_Chat_Notification_ChatNotificationRoomID")] +[Index("ChatNotificationSenderId", Name = "IX_Chat_Notification_ChatNotificationSenderID")] +[Index("ChatNotificationSiteId", Name = "IX_Chat_Notification_ChatNotificationSiteID")] +public class ChatNotification +{ + [Key] + [Column("ChatNotificationID")] + public int ChatNotificationId { get; set; } + + [Column("ChatNotificationSenderID")] + public int ChatNotificationSenderId { get; set; } + + [Column("ChatNotificationReceiverID")] + public int ChatNotificationReceiverId { get; set; } + + public bool ChatNotificationIsRead { get; set; } + + public int ChatNotificationType { get; set; } + + [Column("ChatNotificationRoomID")] + public int? ChatNotificationRoomId { get; set; } + + public DateTime ChatNotificationSendDateTime { get; set; } + + public DateTime? ChatNotificationReadDateTime { get; set; } + + [Column("ChatNotificationSiteID")] + public int? ChatNotificationSiteId { get; set; } + + [ForeignKey("ChatNotificationReceiverId")] + [InverseProperty("ChatNotificationChatNotificationReceivers")] + public virtual ChatUser ChatNotificationReceiver { get; set; } = null!; + + [ForeignKey("ChatNotificationRoomId")] + [InverseProperty("ChatNotifications")] + public virtual ChatRoom? ChatNotificationRoom { get; set; } + + [ForeignKey("ChatNotificationSenderId")] + [InverseProperty("ChatNotificationChatNotificationSenders")] + public virtual ChatUser ChatNotificationSender { get; set; } = null!; + + [ForeignKey("ChatNotificationSiteId")] + [InverseProperty("ChatNotifications")] + public virtual CmsSite? ChatNotificationSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/ChatOnlineSupport.cs b/Migration.Tool.K11/Models/ChatOnlineSupport.cs new file mode 100644 index 00000000..ffda3461 --- /dev/null +++ b/Migration.Tool.K11/Models/ChatOnlineSupport.cs @@ -0,0 +1,36 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Chat_OnlineSupport")] +[Index("ChatOnlineSupportChatUserId", Name = "IX_Chat_OnlineSupport_ChatOnlineSupportChatUserID")] +[Index("ChatOnlineSupportSiteId", Name = "IX_Chat_OnlineSupport_SiteID")] +[Index("ChatOnlineSupportChatUserId", "ChatOnlineSupportSiteId", Name = "UQ_Chat_OnlineSupport_ChatUserID-SiteID", IsUnique = true)] +public class ChatOnlineSupport +{ + [Key] + [Column("ChatOnlineSupportID")] + public int ChatOnlineSupportId { get; set; } + + [Column("ChatOnlineSupportChatUserID")] + public int ChatOnlineSupportChatUserId { get; set; } + + public DateTime ChatOnlineSupportLastChecking { get; set; } + + [Column("ChatOnlineSupportSiteID")] + public int ChatOnlineSupportSiteId { get; set; } + + [StringLength(50)] + public string? ChatOnlineSupportToken { get; set; } + + [ForeignKey("ChatOnlineSupportChatUserId")] + [InverseProperty("ChatOnlineSupports")] + public virtual ChatUser ChatOnlineSupportChatUser { get; set; } = null!; + + [ForeignKey("ChatOnlineSupportSiteId")] + [InverseProperty("ChatOnlineSupports")] + public virtual CmsSite ChatOnlineSupportSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ChatOnlineUser.cs b/Migration.Tool.K11/Models/ChatOnlineUser.cs new file mode 100644 index 00000000..d92dc032 --- /dev/null +++ b/Migration.Tool.K11/Models/ChatOnlineUser.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Chat_OnlineUser")] +[Index("ChatOnlineUserChatUserId", Name = "IX_Chat_OnlineUser_ChatOnlineUserChatUserID")] +[Index("ChatOnlineUserSiteId", Name = "IX_Chat_OnlineUser_SiteID")] +[Index("ChatOnlineUserChatUserId", "ChatOnlineUserSiteId", Name = "UQ_Chat_OnlineUser_SiteID-ChatUserID", IsUnique = true)] +public class ChatOnlineUser +{ + [Key] + [Column("ChatOnlineUserID")] + public int ChatOnlineUserId { get; set; } + + [Column("ChatOnlineUserSiteID")] + public int ChatOnlineUserSiteId { get; set; } + + public DateTime? ChatOnlineUserLastChecking { get; set; } + + [Column("ChatOnlineUserChatUserID")] + public int ChatOnlineUserChatUserId { get; set; } + + public DateTime? ChatOnlineUserJoinTime { get; set; } + + public DateTime? ChatOnlineUserLeaveTime { get; set; } + + [StringLength(50)] + public string? ChatOnlineUserToken { get; set; } + + public bool ChatOnlineUserIsHidden { get; set; } + + [ForeignKey("ChatOnlineUserChatUserId")] + [InverseProperty("ChatOnlineUsers")] + public virtual ChatUser ChatOnlineUserChatUser { get; set; } = null!; + + [ForeignKey("ChatOnlineUserSiteId")] + [InverseProperty("ChatOnlineUsers")] + public virtual CmsSite ChatOnlineUserSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ChatPopupWindowSetting.cs b/Migration.Tool.K11/Models/ChatPopupWindowSetting.cs new file mode 100644 index 00000000..0e6ac53c --- /dev/null +++ b/Migration.Tool.K11/Models/ChatPopupWindowSetting.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("Chat_PopupWindowSettings")] +public class ChatPopupWindowSetting +{ + [Key] + [Column("ChatPopupWindowSettingsID")] + public int ChatPopupWindowSettingsId { get; set; } + + [StringLength(255)] + public string MessageTransformationName { get; set; } = null!; + + [StringLength(255)] + public string ErrorTransformationName { get; set; } = null!; + + [StringLength(255)] + public string ErrorClearTransformationName { get; set; } = null!; + + [StringLength(255)] + public string UserTransformationName { get; set; } = null!; + + public int ChatPopupWindowSettingsHashCode { get; set; } +} diff --git a/Migration.Tool.K11/Models/ChatRoom.cs b/Migration.Tool.K11/Models/ChatRoom.cs new file mode 100644 index 00000000..2bd28771 --- /dev/null +++ b/Migration.Tool.K11/Models/ChatRoom.cs @@ -0,0 +1,80 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Chat_Room")] +[Index("ChatRoomCreatedByChatUserId", Name = "IX_Chat_Room_ChatRoomCreatedByChatUserID")] +[Index("ChatRoomEnabled", Name = "IX_Chat_Room_Enabled")] +[Index("ChatRoomIsSupport", Name = "IX_Chat_Room_IsSupport")] +[Index("ChatRoomSiteId", Name = "IX_Chat_Room_SiteID")] +public class ChatRoom +{ + [Key] + [Column("ChatRoomID")] + public int ChatRoomId { get; set; } + + [StringLength(100)] + public string ChatRoomName { get; set; } = null!; + + [StringLength(100)] + public string ChatRoomDisplayName { get; set; } = null!; + + [Column("ChatRoomSiteID")] + public int? ChatRoomSiteId { get; set; } + + public bool ChatRoomEnabled { get; set; } + + public bool ChatRoomPrivate { get; set; } + + public bool ChatRoomAllowAnonym { get; set; } + + public DateTime ChatRoomCreatedWhen { get; set; } + + [StringLength(100)] + public string? ChatRoomPassword { get; set; } + + [Column("ChatRoomCreatedByChatUserID")] + public int? ChatRoomCreatedByChatUserId { get; set; } + + public bool ChatRoomIsSupport { get; set; } + + public bool ChatRoomIsOneToOne { get; set; } + + [StringLength(500)] + public string? ChatRoomDescription { get; set; } + + public DateTime ChatRoomLastModification { get; set; } + + public DateTime? ChatRoomScheduledToDelete { get; set; } + + public DateTime ChatRoomPrivateStateLastModification { get; set; } + + [Column("ChatRoomGUID")] + public Guid ChatRoomGuid { get; set; } + + [InverseProperty("InitiatedChatRequestRoom")] + public virtual ChatInitiatedChatRequest? ChatInitiatedChatRequest { get; set; } + + [InverseProperty("ChatMessageRoom")] + public virtual ICollection ChatMessages { get; set; } = new List(); + + [InverseProperty("ChatNotificationRoom")] + public virtual ICollection ChatNotifications { get; set; } = new List(); + + [ForeignKey("ChatRoomCreatedByChatUserId")] + [InverseProperty("ChatRooms")] + public virtual ChatUser? ChatRoomCreatedByChatUser { get; set; } + + [ForeignKey("ChatRoomSiteId")] + [InverseProperty("ChatRooms")] + public virtual CmsSite? ChatRoomSite { get; set; } + + [InverseProperty("ChatRoomUserRoom")] + public virtual ICollection ChatRoomUsers { get; set; } = new List(); + + [InverseProperty("ChatSupportTakenRoomRoom")] + public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ChatRoomUser.cs b/Migration.Tool.K11/Models/ChatRoomUser.cs new file mode 100644 index 00000000..ce7c6830 --- /dev/null +++ b/Migration.Tool.K11/Models/ChatRoomUser.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Chat_RoomUser")] +[Index("ChatRoomUserChatUserId", Name = "IX_Chat_RoomUser_ChatRoomUserChatUserID")] +[Index("ChatRoomUserRoomId", Name = "IX_Chat_RoomUser_ChatRoomUserRoomID")] +[Index("ChatRoomUserRoomId", "ChatRoomUserChatUserId", Name = "UQ_Chat_RoomUser_RoomID-ChatUserID", IsUnique = true)] +public class ChatRoomUser +{ + [Key] + [Column("ChatRoomUserID")] + public int ChatRoomUserId { get; set; } + + [Column("ChatRoomUserRoomID")] + public int ChatRoomUserRoomId { get; set; } + + [Column("ChatRoomUserChatUserID")] + public int ChatRoomUserChatUserId { get; set; } + + public DateTime? ChatRoomUserLastChecking { get; set; } + + public DateTime? ChatRoomUserKickExpiration { get; set; } + + public DateTime? ChatRoomUserJoinTime { get; set; } + + public DateTime? ChatRoomUserLeaveTime { get; set; } + + public int ChatRoomUserAdminLevel { get; set; } + + public DateTime ChatRoomUserLastModification { get; set; } + + [ForeignKey("ChatRoomUserChatUserId")] + [InverseProperty("ChatRoomUsers")] + public virtual ChatUser ChatRoomUserChatUser { get; set; } = null!; + + [ForeignKey("ChatRoomUserRoomId")] + [InverseProperty("ChatRoomUsers")] + public virtual ChatRoom ChatRoomUserRoom { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ChatSupportCannedResponse.cs b/Migration.Tool.K11/Models/ChatSupportCannedResponse.cs new file mode 100644 index 00000000..138229bb --- /dev/null +++ b/Migration.Tool.K11/Models/ChatSupportCannedResponse.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Chat_SupportCannedResponse")] +[Index("ChatSupportCannedResponseChatUserId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseChatUserID")] +[Index("ChatSupportCannedResponseSiteId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseSiteID")] +public class ChatSupportCannedResponse +{ + [Key] + [Column("ChatSupportCannedResponseID")] + public int ChatSupportCannedResponseId { get; set; } + + [Column("ChatSupportCannedResponseChatUserID")] + public int? ChatSupportCannedResponseChatUserId { get; set; } + + [StringLength(500)] + public string ChatSupportCannedResponseText { get; set; } = null!; + + [StringLength(50)] + public string ChatSupportCannedResponseTagName { get; set; } = null!; + + [Column("ChatSupportCannedResponseSiteID")] + public int? ChatSupportCannedResponseSiteId { get; set; } + + [StringLength(100)] + public string ChatSupportCannedResponseName { get; set; } = null!; + + [ForeignKey("ChatSupportCannedResponseChatUserId")] + [InverseProperty("ChatSupportCannedResponses")] + public virtual ChatUser? ChatSupportCannedResponseChatUser { get; set; } + + [ForeignKey("ChatSupportCannedResponseSiteId")] + [InverseProperty("ChatSupportCannedResponses")] + public virtual CmsSite? ChatSupportCannedResponseSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/ChatSupportTakenRoom.cs b/Migration.Tool.K11/Models/ChatSupportTakenRoom.cs new file mode 100644 index 00000000..b0c2276d --- /dev/null +++ b/Migration.Tool.K11/Models/ChatSupportTakenRoom.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Chat_SupportTakenRoom")] +[Index("ChatSupportTakenRoomChatUserId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomChatUserID")] +[Index("ChatSupportTakenRoomRoomId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomRoomID")] +public class ChatSupportTakenRoom +{ + [Key] + [Column("ChatSupportTakenRoomID")] + public int ChatSupportTakenRoomId { get; set; } + + [Column("ChatSupportTakenRoomChatUserID")] + public int? ChatSupportTakenRoomChatUserId { get; set; } + + [Column("ChatSupportTakenRoomRoomID")] + public int ChatSupportTakenRoomRoomId { get; set; } + + public DateTime? ChatSupportTakenRoomResolvedDateTime { get; set; } + + public DateTime ChatSupportTakenRoomLastModification { get; set; } + + [ForeignKey("ChatSupportTakenRoomChatUserId")] + [InverseProperty("ChatSupportTakenRooms")] + public virtual ChatUser? ChatSupportTakenRoomChatUser { get; set; } + + [ForeignKey("ChatSupportTakenRoomRoomId")] + [InverseProperty("ChatSupportTakenRooms")] + public virtual ChatRoom ChatSupportTakenRoomRoom { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ChatUser.cs b/Migration.Tool.K11/Models/ChatUser.cs new file mode 100644 index 00000000..d207fd8e --- /dev/null +++ b/Migration.Tool.K11/Models/ChatUser.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Chat_User")] +[Index("ChatUserUserId", Name = "IX_Chat_User_UserID")] +public class ChatUser +{ + [Key] + [Column("ChatUserID")] + public int ChatUserId { get; set; } + + [Column("ChatUserUserID")] + public int? ChatUserUserId { get; set; } + + [StringLength(50)] + public string ChatUserNickname { get; set; } = null!; + + public DateTime ChatUserLastModification { get; set; } + + [InverseProperty("InitiatedChatRequestInitiatorChatUser")] + public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); + + [InverseProperty("ChatMessageRecipient")] + public virtual ICollection ChatMessageChatMessageRecipients { get; set; } = new List(); + + [InverseProperty("ChatMessageUser")] + public virtual ICollection ChatMessageChatMessageUsers { get; set; } = new List(); + + [InverseProperty("ChatNotificationReceiver")] + public virtual ICollection ChatNotificationChatNotificationReceivers { get; set; } = new List(); + + [InverseProperty("ChatNotificationSender")] + public virtual ICollection ChatNotificationChatNotificationSenders { get; set; } = new List(); + + [InverseProperty("ChatOnlineSupportChatUser")] + public virtual ICollection ChatOnlineSupports { get; set; } = new List(); + + [InverseProperty("ChatOnlineUserChatUser")] + public virtual ICollection ChatOnlineUsers { get; set; } = new List(); + + [InverseProperty("ChatRoomUserChatUser")] + public virtual ICollection ChatRoomUsers { get; set; } = new List(); + + [InverseProperty("ChatRoomCreatedByChatUser")] + public virtual ICollection ChatRooms { get; set; } = new List(); + + [InverseProperty("ChatSupportCannedResponseChatUser")] + public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); + + [InverseProperty("ChatSupportTakenRoomChatUser")] + public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); + + [ForeignKey("ChatUserUserId")] + [InverseProperty("ChatUsers")] + public virtual CmsUser? ChatUserUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/CiFileMetadatum.cs b/Migration.Tool.K11/Models/CiFileMetadatum.cs new file mode 100644 index 00000000..6dda70fe --- /dev/null +++ b/Migration.Tool.K11/Models/CiFileMetadatum.cs @@ -0,0 +1,21 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CI_FileMetadata")] +[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] +public class CiFileMetadatum +{ + [Key] + [Column("FileMetadataID")] + public int FileMetadataId { get; set; } + + [StringLength(260)] + public string FileLocation { get; set; } = null!; + + [StringLength(32)] + public string FileHash { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CiMigration.cs b/Migration.Tool.K11/Models/CiMigration.cs new file mode 100644 index 00000000..64d705a3 --- /dev/null +++ b/Migration.Tool.K11/Models/CiMigration.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CI_Migration")] +[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] +public class CiMigration +{ + [Key] + [Column("MigrationID")] + public int MigrationId { get; set; } + + [StringLength(255)] + public string MigrationName { get; set; } = null!; + + [Precision(3)] + public DateTime DateApplied { get; set; } + + public int? RowsAffected { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsAbuseReport.cs b/Migration.Tool.K11/Models/CmsAbuseReport.cs new file mode 100644 index 00000000..cda61626 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsAbuseReport.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_AbuseReport")] +[Index("ReportSiteId", Name = "IX_CMS_AbuseReport_ReportSiteID")] +[Index("ReportStatus", Name = "IX_CMS_AbuseReport_ReportStatus")] +[Index("ReportUserId", Name = "IX_CMS_AbuseReport_ReportUserID")] +public class CmsAbuseReport +{ + [Key] + [Column("ReportID")] + public int ReportId { get; set; } + + [Column("ReportGUID")] + public Guid ReportGuid { get; set; } + + [StringLength(100)] + public string? ReportTitle { get; set; } + + [Column("ReportURL")] + [StringLength(1000)] + public string ReportUrl { get; set; } = null!; + + [StringLength(50)] + public string ReportCulture { get; set; } = null!; + + [Column("ReportObjectID")] + public int? ReportObjectId { get; set; } + + [StringLength(100)] + public string? ReportObjectType { get; set; } + + public string ReportComment { get; set; } = null!; + + [Column("ReportUserID")] + public int? ReportUserId { get; set; } + + public DateTime ReportWhen { get; set; } + + public int ReportStatus { get; set; } + + [Column("ReportSiteID")] + public int ReportSiteId { get; set; } + + [ForeignKey("ReportSiteId")] + [InverseProperty("CmsAbuseReports")] + public virtual CmsSite ReportSite { get; set; } = null!; + + [ForeignKey("ReportUserId")] + [InverseProperty("CmsAbuseReports")] + public virtual CmsUser? ReportUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsAcl.cs b/Migration.Tool.K11/Models/CmsAcl.cs new file mode 100644 index 00000000..46205c1d --- /dev/null +++ b/Migration.Tool.K11/Models/CmsAcl.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_ACL")] +[Index("AclinheritedAcls", Name = "IX_CMS_ACL_ACLInheritedACLs")] +[Index("AclsiteId", Name = "IX_CMS_ACL_ACLSiteID")] +public class CmsAcl +{ + [Key] + [Column("ACLID")] + public int Aclid { get; set; } + + [Column("ACLInheritedACLs")] + public string AclinheritedAcls { get; set; } = null!; + + [Column("ACLGUID")] + public Guid Aclguid { get; set; } + + [Column("ACLLastModified")] + public DateTime AcllastModified { get; set; } + + [Column("ACLSiteID")] + public int? AclsiteId { get; set; } + + [ForeignKey("AclsiteId")] + [InverseProperty("CmsAcls")] + public virtual CmsSite? Aclsite { get; set; } + + [InverseProperty("Acl")] + public virtual ICollection CmsAclitems { get; set; } = new List(); + + [InverseProperty("NodeAcl")] + public virtual ICollection CmsTrees { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsAclitem.cs b/Migration.Tool.K11/Models/CmsAclitem.cs new file mode 100644 index 00000000..5cbe2e47 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsAclitem.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_ACLItem")] +[Index("Aclid", Name = "IX_CMS_ACLItem_ACLID")] +[Index("LastModifiedByUserId", Name = "IX_CMS_ACLItem_LastModifiedByUserID")] +[Index("RoleId", Name = "IX_CMS_ACLItem_RoleID")] +[Index("UserId", Name = "IX_CMS_ACLItem_UserID")] +public class CmsAclitem +{ + [Key] + [Column("ACLItemID")] + public int AclitemId { get; set; } + + [Column("ACLID")] + public int Aclid { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [Column("RoleID")] + public int? RoleId { get; set; } + + public int Allowed { get; set; } + + public int Denied { get; set; } + + public DateTime LastModified { get; set; } + + [Column("LastModifiedByUserID")] + public int? LastModifiedByUserId { get; set; } + + [Column("ACLItemGUID")] + public Guid AclitemGuid { get; set; } + + [ForeignKey("Aclid")] + [InverseProperty("CmsAclitems")] + public virtual CmsAcl Acl { get; set; } = null!; + + [ForeignKey("LastModifiedByUserId")] + [InverseProperty("CmsAclitemLastModifiedByUsers")] + public virtual CmsUser? LastModifiedByUser { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsAclitems")] + public virtual CmsRole? Role { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsAclitemUsers")] + public virtual CmsUser? User { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsAlternativeForm.cs b/Migration.Tool.K11/Models/CmsAlternativeForm.cs new file mode 100644 index 00000000..f28c503e --- /dev/null +++ b/Migration.Tool.K11/Models/CmsAlternativeForm.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_AlternativeForm")] +[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] +[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] +public class CmsAlternativeForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(50)] + public string FormName { get; set; } = null!; + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public string? FormDefinition { get; set; } + + public string? FormLayout { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + [Column("FormCoupledClassID")] + public int? FormCoupledClassId { get; set; } + + public bool? FormHideNewParentFields { get; set; } + + [StringLength(50)] + public string? FormLayoutType { get; set; } + + [Column("FormVersionGUID")] + [StringLength(50)] + public string? FormVersionGuid { get; set; } + + [StringLength(400)] + public string? FormCustomizedColumns { get; set; } + + public bool? FormIsCustom { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsAlternativeFormFormClasses")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormCoupledClassId")] + [InverseProperty("CmsAlternativeFormFormCoupledClasses")] + public virtual CmsClass? FormCoupledClass { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsAttachment.cs b/Migration.Tool.K11/Models/CmsAttachment.cs new file mode 100644 index 00000000..b9331d9a --- /dev/null +++ b/Migration.Tool.K11/Models/CmsAttachment.cs @@ -0,0 +1,90 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Attachment")] +[Index("AttachmentDocumentId", Name = "IX_CMS_Attachment_AttachmentDocumentID")] +[Index("AttachmentGuid", "AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentGUID_AttachmentSiteID")] +[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentFormGuid", "AttachmentOrder", Name = "IX_CMS_Attachment_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentFormGUID_AttachmentOrder")] +[Index("AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentSiteID")] +[Index("AttachmentVariantParentId", Name = "IX_CMS_Attachment_AttachmentVariantParentID")] +public class CmsAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + public int? AttachmentImageWidth { get; set; } + + public int? AttachmentImageHeight { get; set; } + + [Column("AttachmentDocumentID")] + public int? AttachmentDocumentId { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + public bool? AttachmentIsUnsorted { get; set; } + + public int? AttachmentOrder { get; set; } + + [Column("AttachmentGroupGUID")] + public Guid? AttachmentGroupGuid { get; set; } + + [Column("AttachmentFormGUID")] + public Guid? AttachmentFormGuid { get; set; } + + [StringLength(32)] + public string? AttachmentHash { get; set; } + + [StringLength(250)] + public string? AttachmentTitle { get; set; } + + public string? AttachmentDescription { get; set; } + + public string? AttachmentCustomData { get; set; } + + public string? AttachmentSearchContent { get; set; } + + [StringLength(50)] + public string? AttachmentVariantDefinitionIdentifier { get; set; } + + [Column("AttachmentVariantParentID")] + public int? AttachmentVariantParentId { get; set; } + + [ForeignKey("AttachmentDocumentId")] + [InverseProperty("CmsAttachments")] + public virtual CmsDocument? AttachmentDocument { get; set; } + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("CmsAttachments")] + public virtual CmsSite AttachmentSite { get; set; } = null!; + + [ForeignKey("AttachmentVariantParentId")] + [InverseProperty("InverseAttachmentVariantParent")] + public virtual CmsAttachment? AttachmentVariantParent { get; set; } + + [InverseProperty("AttachmentVariantParent")] + public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsAttachmentHistory.cs b/Migration.Tool.K11/Models/CmsAttachmentHistory.cs new file mode 100644 index 00000000..9fcef6fb --- /dev/null +++ b/Migration.Tool.K11/Models/CmsAttachmentHistory.cs @@ -0,0 +1,89 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_AttachmentHistory")] +[Index("AttachmentGuid", Name = "IX_CMS_AttachmentHistory_AttachmentGUID")] +[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentOrder", Name = "IX_CMS_AttachmentHistory_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentOrder")] +[Index("AttachmentSiteId", Name = "IX_CMS_AttachmentHistory_AttachmentSiteID")] +[Index("AttachmentVariantParentId", Name = "IX_CMS_AttachmentHistory_AttachmentVariantParentID")] +public class CmsAttachmentHistory +{ + [Key] + [Column("AttachmentHistoryID")] + public int AttachmentHistoryId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + public int? AttachmentImageWidth { get; set; } + + public int? AttachmentImageHeight { get; set; } + + [Column("AttachmentDocumentID")] + public int AttachmentDocumentId { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public bool? AttachmentIsUnsorted { get; set; } + + public int? AttachmentOrder { get; set; } + + [Column("AttachmentGroupGUID")] + public Guid? AttachmentGroupGuid { get; set; } + + [StringLength(32)] + public string? AttachmentHash { get; set; } + + [StringLength(250)] + public string? AttachmentTitle { get; set; } + + public string? AttachmentDescription { get; set; } + + public string? AttachmentCustomData { get; set; } + + public DateTime? AttachmentLastModified { get; set; } + + [Column("AttachmentHistoryGUID")] + public Guid AttachmentHistoryGuid { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + public string? AttachmentSearchContent { get; set; } + + [StringLength(50)] + public string? AttachmentVariantDefinitionIdentifier { get; set; } + + [Column("AttachmentVariantParentID")] + public int? AttachmentVariantParentId { get; set; } + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("CmsAttachmentHistories")] + public virtual CmsSite AttachmentSite { get; set; } = null!; + + [ForeignKey("AttachmentVariantParentId")] + [InverseProperty("InverseAttachmentVariantParent")] + public virtual CmsAttachmentHistory? AttachmentVariantParent { get; set; } + + [InverseProperty("AttachmentVariantParent")] + public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); + + [ForeignKey("AttachmentHistoryId")] + [InverseProperty("AttachmentHistories")] + public virtual ICollection VersionHistories { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsAutomationHistory.cs b/Migration.Tool.K11/Models/CmsAutomationHistory.cs new file mode 100644 index 00000000..68ed6aa1 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsAutomationHistory.cs @@ -0,0 +1,81 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_AutomationHistory")] +[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] +[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] +[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] +[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] +[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] +[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] +public class CmsAutomationHistory +{ + [Key] + [Column("HistoryID")] + public int HistoryId { get; set; } + + [Column("HistoryStepID")] + public int? HistoryStepId { get; set; } + + [StringLength(440)] + public string? HistoryStepName { get; set; } + + [StringLength(450)] + public string HistoryStepDisplayName { get; set; } = null!; + + public int? HistoryStepType { get; set; } + + [Column("HistoryTargetStepID")] + public int? HistoryTargetStepId { get; set; } + + [StringLength(440)] + public string? HistoryTargetStepName { get; set; } + + [StringLength(450)] + public string? HistoryTargetStepDisplayName { get; set; } + + public int? HistoryTargetStepType { get; set; } + + [Column("HistoryApprovedByUserID")] + public int? HistoryApprovedByUserId { get; set; } + + public DateTime? HistoryApprovedWhen { get; set; } + + public string? HistoryComment { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + public bool HistoryWasRejected { get; set; } + + [Column("HistoryStateID")] + public int HistoryStateId { get; set; } + + [ForeignKey("HistoryApprovedByUserId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsUser? HistoryApprovedByUser { get; set; } + + [ForeignKey("HistoryStateId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsAutomationState HistoryState { get; set; } = null!; + + [ForeignKey("HistoryStepId")] + [InverseProperty("CmsAutomationHistoryHistorySteps")] + public virtual CmsWorkflowStep? HistoryStep { get; set; } + + [ForeignKey("HistoryTargetStepId")] + [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] + public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsAutomationState.cs b/Migration.Tool.K11/Models/CmsAutomationState.cs new file mode 100644 index 00000000..e17aa3a2 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsAutomationState.cs @@ -0,0 +1,70 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_AutomationState")] +[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] +[Index("StateSiteId", Name = "IX_CMS_AutomationState_StateSiteID")] +[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] +[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] +[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] +public class CmsAutomationState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [Column("StateStepID")] + public int StateStepId { get; set; } + + [Column("StateObjectID")] + public int StateObjectId { get; set; } + + [StringLength(100)] + public string StateObjectType { get; set; } = null!; + + [StringLength(450)] + public string? StateActionStatus { get; set; } + + public DateTime? StateCreated { get; set; } + + public DateTime? StateLastModified { get; set; } + + [Column("StateWorkflowID")] + public int StateWorkflowId { get; set; } + + public int? StateStatus { get; set; } + + [Column("StateSiteID")] + public int? StateSiteId { get; set; } + + [Column("StateUserID")] + public int? StateUserId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public string? StateCustomData { get; set; } + + [InverseProperty("HistoryState")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [ForeignKey("StateSiteId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsSite? StateSite { get; set; } + + [ForeignKey("StateStepId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflowStep StateStep { get; set; } = null!; + + [ForeignKey("StateUserId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsUser? StateUser { get; set; } + + [ForeignKey("StateWorkflowId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflow StateWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsAvatar.cs b/Migration.Tool.K11/Models/CmsAvatar.cs new file mode 100644 index 00000000..3ebb382d --- /dev/null +++ b/Migration.Tool.K11/Models/CmsAvatar.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Avatar")] +[Index("AvatarGuid", Name = "IX_CMS_Avatar_AvatarGUID")] +[Index("AvatarType", "AvatarIsCustom", Name = "IX_CMS_Avatar_AvatarType_AvatarIsCustom")] +public class CmsAvatar +{ + [Key] + [Column("AvatarID")] + public int AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarName { get; set; } + + [StringLength(200)] + public string AvatarFileName { get; set; } = null!; + + [StringLength(10)] + public string AvatarFileExtension { get; set; } = null!; + + public byte[]? AvatarBinary { get; set; } + + [StringLength(50)] + public string AvatarType { get; set; } = null!; + + public bool AvatarIsCustom { get; set; } + + [Column("AvatarGUID")] + public Guid AvatarGuid { get; set; } + + public DateTime AvatarLastModified { get; set; } + + [StringLength(100)] + public string AvatarMimeType { get; set; } = null!; + + public int AvatarFileSize { get; set; } + + public int? AvatarImageHeight { get; set; } + + public int? AvatarImageWidth { get; set; } + + public bool? DefaultMaleUserAvatar { get; set; } + + public bool? DefaultFemaleUserAvatar { get; set; } + + public bool? DefaultGroupAvatar { get; set; } + + public bool? DefaultUserAvatar { get; set; } + + [InverseProperty("UserAvatar")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); + + [InverseProperty("GroupAvatar")] + public virtual ICollection CommunityGroups { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsBadge.cs b/Migration.Tool.K11/Models/CmsBadge.cs new file mode 100644 index 00000000..ff488705 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsBadge.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Badge")] +public class CmsBadge +{ + [Key] + [Column("BadgeID")] + public int BadgeId { get; set; } + + [StringLength(100)] + public string BadgeName { get; set; } = null!; + + [StringLength(200)] + public string BadgeDisplayName { get; set; } = null!; + + [Column("BadgeImageURL")] + [StringLength(200)] + public string? BadgeImageUrl { get; set; } + + public bool BadgeIsAutomatic { get; set; } + + public int? BadgeTopLimit { get; set; } + + [Column("BadgeGUID")] + public Guid BadgeGuid { get; set; } + + public DateTime BadgeLastModified { get; set; } + + [InverseProperty("UserBadge")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsBannedIp.cs b/Migration.Tool.K11/Models/CmsBannedIp.cs new file mode 100644 index 00000000..ed8aca44 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsBannedIp.cs @@ -0,0 +1,53 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_BannedIP")] +[Index("IpaddressSiteId", Name = "IX_CMS_BannedIP_IPAddressSiteID")] +public class CmsBannedIp +{ + [Key] + [Column("IPAddressID")] + public int IpaddressId { get; set; } + + [Column("IPAddress")] + [StringLength(100)] + public string Ipaddress { get; set; } = null!; + + [Column("IPAddressRegular")] + [StringLength(200)] + public string IpaddressRegular { get; set; } = null!; + + [Column("IPAddressAllowed")] + public bool IpaddressAllowed { get; set; } + + [Column("IPAddressAllowOverride")] + public bool IpaddressAllowOverride { get; set; } + + [Column("IPAddressBanReason")] + [StringLength(450)] + public string? IpaddressBanReason { get; set; } + + [Column("IPAddressBanType")] + [StringLength(100)] + public string IpaddressBanType { get; set; } = null!; + + [Column("IPAddressBanEnabled")] + public bool? IpaddressBanEnabled { get; set; } + + [Column("IPAddressSiteID")] + public int? IpaddressSiteId { get; set; } + + [Column("IPAddressGUID")] + public Guid IpaddressGuid { get; set; } + + [Column("IPAddressLastModified")] + public DateTime IpaddressLastModified { get; set; } + + [ForeignKey("IpaddressSiteId")] + [InverseProperty("CmsBannedIps")] + public virtual CmsSite? IpaddressSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsBanner.cs b/Migration.Tool.K11/Models/CmsBanner.cs new file mode 100644 index 00000000..7c9b6cb9 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsBanner.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Banner")] +[Index("BannerCategoryId", Name = "IX_CMS_Banner_BannerCategoryID")] +[Index("BannerSiteId", Name = "IX_CMS_Banner_BannerSiteID")] +public class CmsBanner +{ + [Key] + [Column("BannerID")] + public int BannerId { get; set; } + + [StringLength(256)] + public string BannerName { get; set; } = null!; + + [StringLength(256)] + public string BannerDisplayName { get; set; } = null!; + + [Column("BannerCategoryID")] + public int BannerCategoryId { get; set; } + + [Required] + public bool? BannerEnabled { get; set; } + + public DateTime? BannerFrom { get; set; } + + public DateTime? BannerTo { get; set; } + + public Guid BannerGuid { get; set; } + + public DateTime BannerLastModified { get; set; } + + public int BannerType { get; set; } + + [Column("BannerURL")] + [StringLength(2083)] + public string BannerUrl { get; set; } = null!; + + public bool BannerBlank { get; set; } + + public double BannerWeight { get; set; } + + public int? BannerHitsLeft { get; set; } + + public int? BannerClicksLeft { get; set; } + + [Column("BannerSiteID")] + public int? BannerSiteId { get; set; } + + public string BannerContent { get; set; } = null!; + + [ForeignKey("BannerCategoryId")] + [InverseProperty("CmsBanners")] + public virtual CmsBannerCategory BannerCategory { get; set; } = null!; + + [ForeignKey("BannerSiteId")] + [InverseProperty("CmsBanners")] + public virtual CmsSite? BannerSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsBannerCategory.cs b/Migration.Tool.K11/Models/CmsBannerCategory.cs new file mode 100644 index 00000000..7d58a173 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsBannerCategory.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_BannerCategory")] +[Index("BannerCategoryName", "BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategoryName_BannerCategorySiteID", IsUnique = true)] +[Index("BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategorySiteID")] +public class CmsBannerCategory +{ + [Key] + [Column("BannerCategoryID")] + public int BannerCategoryId { get; set; } + + [StringLength(100)] + public string BannerCategoryName { get; set; } = null!; + + [StringLength(200)] + public string BannerCategoryDisplayName { get; set; } = null!; + + [Column("BannerCategorySiteID")] + public int? BannerCategorySiteId { get; set; } + + public Guid BannerCategoryGuid { get; set; } + + public DateTime BannerCategoryLastModified { get; set; } + + [Required] + public bool? BannerCategoryEnabled { get; set; } + + [ForeignKey("BannerCategorySiteId")] + [InverseProperty("CmsBannerCategories")] + public virtual CmsSite? BannerCategorySite { get; set; } + + [InverseProperty("BannerCategory")] + public virtual ICollection CmsBanners { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsCategory.cs b/Migration.Tool.K11/Models/CmsCategory.cs new file mode 100644 index 00000000..752631ec --- /dev/null +++ b/Migration.Tool.K11/Models/CmsCategory.cs @@ -0,0 +1,66 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Category")] +[Index("CategorySiteId", Name = "IX_CMS_Category_CategorySiteID")] +[Index("CategoryUserId", Name = "IX_CMS_Category_CategoryUserID")] +public class CmsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(250)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(250)] + public string? CategoryName { get; set; } + + public string? CategoryDescription { get; set; } + + public int? CategoryCount { get; set; } + + [Required] + public bool? CategoryEnabled { get; set; } + + [Column("CategoryUserID")] + public int? CategoryUserId { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + [StringLength(1500)] + public string? CategoryNamePath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryOrder { get; set; } + + [ForeignKey("CategorySiteId")] + [InverseProperty("CmsCategories")] + public virtual CmsSite? CategorySite { get; set; } + + [ForeignKey("CategoryUserId")] + [InverseProperty("CmsCategories")] + public virtual CmsUser? CategoryUser { get; set; } + + [ForeignKey("CategoryId")] + [InverseProperty("Categories")] + public virtual ICollection Documents { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsClass.cs b/Migration.Tool.K11/Models/CmsClass.cs new file mode 100644 index 00000000..aee519d6 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsClass.cs @@ -0,0 +1,220 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Class")] +[Index("ClassDefaultPageTemplateId", Name = "IX_CMS_Class_ClassDefaultPageTemplateID")] +[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] +[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] +[Index("ClassPageTemplateCategoryId", Name = "IX_CMS_Class_ClassPageTemplateCategoryID")] +[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] +[Index("ClassShowAsSystemTable", "ClassIsCustomTable", "ClassIsCoupledClass", "ClassIsDocumentType", Name = "IX_CMS_Class_ClassShowAsSystemTable_ClassIsCustomTable_ClassIsCoupledClass_ClassIsDocumentType")] +public class CmsClass +{ + [Key] + [Column("ClassID")] + public int ClassId { get; set; } + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + public bool ClassUsesVersioning { get; set; } + + public bool ClassIsDocumentType { get; set; } + + public bool ClassIsCoupledClass { get; set; } + + public string ClassXmlSchema { get; set; } = null!; + + public string ClassFormDefinition { get; set; } = null!; + + [StringLength(450)] + public string? ClassEditingPageUrl { get; set; } + + [StringLength(450)] + public string? ClassListPageUrl { get; set; } + + [StringLength(100)] + public string ClassNodeNameSource { get; set; } = null!; + + [StringLength(100)] + public string? ClassTableName { get; set; } + + [StringLength(450)] + public string? ClassViewPageUrl { get; set; } + + [StringLength(450)] + public string? ClassPreviewPageUrl { get; set; } + + public string? ClassFormLayout { get; set; } + + [StringLength(450)] + public string? ClassNewPageUrl { get; set; } + + public bool? ClassShowAsSystemTable { get; set; } + + public bool? ClassUsePublishFromTo { get; set; } + + public bool? ClassShowTemplateSelection { get; set; } + + [Column("ClassSKUMappings")] + public string? ClassSkumappings { get; set; } + + public bool? ClassIsMenuItemType { get; set; } + + [StringLength(100)] + public string? ClassNodeAliasSource { get; set; } + + [Column("ClassDefaultPageTemplateID")] + public int? ClassDefaultPageTemplateId { get; set; } + + public DateTime ClassLastModified { get; set; } + + [Column("ClassGUID")] + public Guid ClassGuid { get; set; } + + [Column("ClassCreateSKU")] + public bool? ClassCreateSku { get; set; } + + public bool? ClassIsProduct { get; set; } + + public bool ClassIsCustomTable { get; set; } + + [StringLength(1000)] + public string? ClassShowColumns { get; set; } + + [StringLength(200)] + public string? ClassSearchTitleColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchContentColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchImageColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchCreationDateColumn { get; set; } + + public string? ClassSearchSettings { get; set; } + + [Column("ClassInheritsFromClassID")] + public int? ClassInheritsFromClassId { get; set; } + + public bool? ClassSearchEnabled { get; set; } + + [Column("ClassSKUDefaultDepartmentName")] + [StringLength(200)] + public string? ClassSkudefaultDepartmentName { get; set; } + + [Column("ClassSKUDefaultDepartmentID")] + public int? ClassSkudefaultDepartmentId { get; set; } + + public string? ClassContactMapping { get; set; } + + public bool? ClassContactOverwriteEnabled { get; set; } + + [Column("ClassSKUDefaultProductType")] + [StringLength(50)] + public string? ClassSkudefaultProductType { get; set; } + + [StringLength(100)] + public string? ClassConnectionString { get; set; } + + public bool? ClassIsProductSection { get; set; } + + [Column("ClassPageTemplateCategoryID")] + public int? ClassPageTemplateCategoryId { get; set; } + + [StringLength(50)] + public string? ClassFormLayoutType { get; set; } + + [Column("ClassVersionGUID")] + [StringLength(50)] + public string? ClassVersionGuid { get; set; } + + [StringLength(100)] + public string? ClassDefaultObjectType { get; set; } + + public bool? ClassIsForm { get; set; } + + [Column("ClassResourceID")] + public int? ClassResourceId { get; set; } + + [StringLength(400)] + public string? ClassCustomizedColumns { get; set; } + + public string? ClassCodeGenerationSettings { get; set; } + + [StringLength(200)] + public string? ClassIconClass { get; set; } + + public bool? ClassIsContentOnly { get; set; } + + [Column("ClassURLPattern")] + [StringLength(200)] + public string? ClassUrlpattern { get; set; } + + [ForeignKey("ClassDefaultPageTemplateId")] + [InverseProperty("CmsClasses")] + public virtual CmsPageTemplate? ClassDefaultPageTemplate { get; set; } + + [ForeignKey("ClassPageTemplateCategoryId")] + [InverseProperty("CmsClasses")] + public virtual CmsPageTemplateCategory? ClassPageTemplateCategory { get; set; } + + [ForeignKey("ClassResourceId")] + [InverseProperty("CmsClasses")] + public virtual CmsResource? ClassResource { get; set; } + + [InverseProperty("FormClass")] + public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); + + [InverseProperty("FormCoupledClass")] + public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); + + [InverseProperty("FormClass")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("PageTemplateScopeClass")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsPermissions { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsQueries { get; set; } = new List(); + + [InverseProperty("TransformationClass")] + public virtual ICollection CmsTransformations { get; set; } = new List(); + + [InverseProperty("NodeClass")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("VersionClass")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("ScopeClass")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [ForeignKey("ParentClassId")] + [InverseProperty("ParentClasses")] + public virtual ICollection ChildClasses { get; set; } = new List(); + + [ForeignKey("ChildClassId")] + [InverseProperty("ChildClasses")] + public virtual ICollection ParentClasses { get; set; } = new List(); + + [ForeignKey("ClassId")] + [InverseProperty("Classes")] + public virtual ICollection Scopes { get; set; } = new List(); + + [ForeignKey("ClassId")] + [InverseProperty("Classes")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsConsent.cs b/Migration.Tool.K11/Models/CmsConsent.cs new file mode 100644 index 00000000..90d8208b --- /dev/null +++ b/Migration.Tool.K11/Models/CmsConsent.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Consent")] +public class CmsConsent +{ + [Key] + [Column("ConsentID")] + public int ConsentId { get; set; } + + [StringLength(200)] + public string ConsentDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ConsentName { get; set; } = null!; + + public string ConsentContent { get; set; } = null!; + + public Guid ConsentGuid { get; set; } + + public DateTime ConsentLastModified { get; set; } + + [StringLength(100)] + public string ConsentHash { get; set; } = null!; + + [InverseProperty("ConsentAgreementConsent")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [InverseProperty("ConsentArchiveConsent")] + public virtual ICollection CmsConsentArchives { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsConsentAgreement.cs b/Migration.Tool.K11/Models/CmsConsentAgreement.cs new file mode 100644 index 00000000..5c476442 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsConsentAgreement.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_ConsentAgreement")] +[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] +public class CmsConsentAgreement +{ + [Key] + [Column("ConsentAgreementID")] + public int ConsentAgreementId { get; set; } + + public Guid ConsentAgreementGuid { get; set; } + + public bool ConsentAgreementRevoked { get; set; } + + [Column("ConsentAgreementContactID")] + public int ConsentAgreementContactId { get; set; } + + [Column("ConsentAgreementConsentID")] + public int ConsentAgreementConsentId { get; set; } + + [StringLength(100)] + public string? ConsentAgreementConsentHash { get; set; } + + public DateTime ConsentAgreementTime { get; set; } + + [ForeignKey("ConsentAgreementConsentId")] + [InverseProperty("CmsConsentAgreements")] + public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; + + [ForeignKey("ConsentAgreementContactId")] + [InverseProperty("CmsConsentAgreements")] + public virtual OmContact ConsentAgreementContact { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsConsentArchive.cs b/Migration.Tool.K11/Models/CmsConsentArchive.cs new file mode 100644 index 00000000..02f88aee --- /dev/null +++ b/Migration.Tool.K11/Models/CmsConsentArchive.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_ConsentArchive")] +[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] +public class CmsConsentArchive +{ + [Key] + [Column("ConsentArchiveID")] + public int ConsentArchiveId { get; set; } + + public Guid ConsentArchiveGuid { get; set; } + + public DateTime ConsentArchiveLastModified { get; set; } + + [Column("ConsentArchiveConsentID")] + public int ConsentArchiveConsentId { get; set; } + + [StringLength(100)] + public string ConsentArchiveHash { get; set; } = null!; + + public string ConsentArchiveContent { get; set; } = null!; + + [ForeignKey("ConsentArchiveConsentId")] + [InverseProperty("CmsConsentArchives")] + public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsCountry.cs b/Migration.Tool.K11/Models/CmsCountry.cs new file mode 100644 index 00000000..270e79bd --- /dev/null +++ b/Migration.Tool.K11/Models/CmsCountry.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Country")] +public class CmsCountry +{ + [Key] + [Column("CountryID")] + public int CountryId { get; set; } + + [StringLength(200)] + public string CountryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CountryName { get; set; } = null!; + + [Column("CountryGUID")] + public Guid CountryGuid { get; set; } + + public DateTime CountryLastModified { get; set; } + + [StringLength(2)] + public string? CountryTwoLetterCode { get; set; } + + [StringLength(3)] + public string? CountryThreeLetterCode { get; set; } + + [InverseProperty("Country")] + public virtual ICollection CmsStates { get; set; } = new List(); + + [InverseProperty("AddressCountry")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("AddressCountry")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("Country")] + public virtual ICollection ComTaxClassCountries { get; set; } = new List(); + + [InverseProperty("AccountCountry")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactCountry")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsCssStylesheet.cs b/Migration.Tool.K11/Models/CmsCssStylesheet.cs new file mode 100644 index 00000000..708296da --- /dev/null +++ b/Migration.Tool.K11/Models/CmsCssStylesheet.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_CssStylesheet")] +[Index("StylesheetName", Name = "IX_CMS_CssStylesheet_StylesheetName")] +public class CmsCssStylesheet +{ + [Key] + [Column("StylesheetID")] + public int StylesheetId { get; set; } + + [StringLength(200)] + public string StylesheetDisplayName { get; set; } = null!; + + [StringLength(200)] + public string StylesheetName { get; set; } = null!; + + public string? StylesheetText { get; set; } + + [Column("StylesheetVersionGUID")] + public Guid? StylesheetVersionGuid { get; set; } + + [Column("StylesheetGUID")] + public Guid? StylesheetGuid { get; set; } + + public DateTime StylesheetLastModified { get; set; } + + public string? StylesheetDynamicCode { get; set; } + + [StringLength(200)] + public string? StylesheetDynamicLanguage { get; set; } + + [InverseProperty("DocumentStylesheet")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("SiteDefaultEditorStylesheetNavigation")] + public virtual ICollection CmsSiteSiteDefaultEditorStylesheetNavigations { get; set; } = new List(); + + [InverseProperty("SiteDefaultStylesheet")] + public virtual ICollection CmsSiteSiteDefaultStylesheets { get; set; } = new List(); + + [ForeignKey("StylesheetId")] + [InverseProperty("Stylesheets")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsCulture.cs b/Migration.Tool.K11/Models/CmsCulture.cs new file mode 100644 index 00000000..2c828448 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsCulture.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Culture")] +[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] +[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] +public class CmsCulture +{ + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; + + [StringLength(200)] + public string CultureShortName { get; set; } = null!; + + [Column("CultureGUID")] + public Guid CultureGuid { get; set; } + + public DateTime CultureLastModified { get; set; } + + [StringLength(100)] + public string? CultureAlias { get; set; } + + [Column("CultureIsUICulture")] + public bool? CultureIsUiculture { get; set; } + + [InverseProperty("PageTemplateScopeCulture")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("TranslationCulture")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); + + [InverseProperty("Culture")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("ScopeCulture")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [ForeignKey("IndexCultureId")] + [InverseProperty("IndexCultures")] + public virtual ICollection Indices { get; set; } = new List(); + + [ForeignKey("CultureId")] + [InverseProperty("Cultures")] + public virtual ICollection Sites { get; set; } = new List(); + + [ForeignKey("CultureId")] + [InverseProperty("Cultures")] + public virtual ICollection Words { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsDeviceProfile.cs b/Migration.Tool.K11/Models/CmsDeviceProfile.cs new file mode 100644 index 00000000..cbbd6643 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsDeviceProfile.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_DeviceProfile")] +public class CmsDeviceProfile +{ + [Key] + [Column("ProfileID")] + public int ProfileId { get; set; } + + [StringLength(100)] + public string ProfileName { get; set; } = null!; + + [StringLength(200)] + public string ProfileDisplayName { get; set; } = null!; + + public int? ProfileOrder { get; set; } + + public string? ProfileMacro { get; set; } + + public string? ProfileUserAgents { get; set; } + + [Required] + public bool? ProfileEnabled { get; set; } + + public int? ProfilePreviewWidth { get; set; } + + public int? ProfilePreviewHeight { get; set; } + + [Column("ProfileGUID")] + public Guid? ProfileGuid { get; set; } + + public DateTime? ProfileLastModified { get; set; } + + [InverseProperty("DeviceProfile")] + public virtual ICollection CmsDeviceProfileLayouts { get; set; } = new List(); + + [InverseProperty("Profile")] + public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsDeviceProfileLayout.cs b/Migration.Tool.K11/Models/CmsDeviceProfileLayout.cs new file mode 100644 index 00000000..d027c229 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsDeviceProfileLayout.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_DeviceProfileLayout")] +[Index("DeviceProfileId", Name = "IX_CMS_DeviceProfileLayout_DeviceProfileID")] +[Index("SourceLayoutId", Name = "IX_CMS_DeviceProfileLayout_SourceLayoutID")] +[Index("TargetLayoutId", Name = "IX_CMS_DeviceProfileLayout_TargetLayoutID")] +public class CmsDeviceProfileLayout +{ + [Key] + [Column("DeviceProfileLayoutID")] + public int DeviceProfileLayoutId { get; set; } + + [Column("DeviceProfileID")] + public int DeviceProfileId { get; set; } + + [Column("SourceLayoutID")] + public int SourceLayoutId { get; set; } + + [Column("TargetLayoutID")] + public int TargetLayoutId { get; set; } + + [Column("DeviceProfileLayoutGUID")] + public Guid DeviceProfileLayoutGuid { get; set; } + + public DateTime DeviceProfileLayoutLastModified { get; set; } + + [ForeignKey("DeviceProfileId")] + [InverseProperty("CmsDeviceProfileLayouts")] + public virtual CmsDeviceProfile DeviceProfile { get; set; } = null!; + + [ForeignKey("SourceLayoutId")] + [InverseProperty("CmsDeviceProfileLayoutSourceLayouts")] + public virtual CmsLayout SourceLayout { get; set; } = null!; + + [ForeignKey("TargetLayoutId")] + [InverseProperty("CmsDeviceProfileLayoutTargetLayouts")] + public virtual CmsLayout TargetLayout { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsDocument.cs b/Migration.Tool.K11/Models/CmsDocument.cs new file mode 100644 index 00000000..42da3570 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsDocument.cs @@ -0,0 +1,283 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Document")] +[Index("DocumentCheckedOutByUserId", Name = "IX_CMS_Document_DocumentCheckedOutByUserID")] +[Index("DocumentCheckedOutVersionHistoryId", Name = "IX_CMS_Document_DocumentCheckedOutVersionHistoryID")] +[Index("DocumentCreatedByUserId", Name = "IX_CMS_Document_DocumentCreatedByUserID")] +[Index("DocumentCulture", Name = "IX_CMS_Document_DocumentCulture")] +[Index("DocumentForeignKeyValue", "DocumentId", "DocumentNodeId", Name = "IX_CMS_Document_DocumentForeignKeyValue_DocumentID_DocumentNodeID")] +[Index("DocumentModifiedByUserId", Name = "IX_CMS_Document_DocumentModifiedByUserID")] +[Index("DocumentNodeId", "DocumentId", "DocumentCulture", Name = "IX_CMS_Document_DocumentNodeID_DocumentID_DocumentCulture", IsUnique = true)] +[Index("DocumentPageTemplateId", Name = "IX_CMS_Document_DocumentPageTemplateID")] +[Index("DocumentPublishedVersionHistoryId", Name = "IX_CMS_Document_DocumentPublishedVersionHistoryID")] +[Index("DocumentTagGroupId", Name = "IX_CMS_Document_DocumentTagGroupID")] +[Index("DocumentUrlPath", Name = "IX_CMS_Document_DocumentUrlPath_DocumentID_DocumentNodeID")] +[Index("DocumentWildcardRule", "DocumentPriority", Name = "IX_CMS_Document_DocumentWildcardRule_DocumentPriority")] +[Index("DocumentWorkflowStepId", Name = "IX_CMS_Document_DocumentWorkflowStepID")] +public class CmsDocument +{ + [Key] + [Column("DocumentID")] + public int DocumentId { get; set; } + + [StringLength(100)] + public string DocumentName { get; set; } = null!; + + [StringLength(1500)] + public string? DocumentNamePath { get; set; } + + public DateTime? DocumentModifiedWhen { get; set; } + + [Column("DocumentModifiedByUserID")] + public int? DocumentModifiedByUserId { get; set; } + + public int? DocumentForeignKeyValue { get; set; } + + [Column("DocumentCreatedByUserID")] + public int? DocumentCreatedByUserId { get; set; } + + public DateTime? DocumentCreatedWhen { get; set; } + + [Column("DocumentCheckedOutByUserID")] + public int? DocumentCheckedOutByUserId { get; set; } + + public DateTime? DocumentCheckedOutWhen { get; set; } + + [Column("DocumentCheckedOutVersionHistoryID")] + public int? DocumentCheckedOutVersionHistoryId { get; set; } + + [Column("DocumentPublishedVersionHistoryID")] + public int? DocumentPublishedVersionHistoryId { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + public DateTime? DocumentPublishFrom { get; set; } + + public DateTime? DocumentPublishTo { get; set; } + + public string? DocumentUrlPath { get; set; } + + [StringLength(10)] + public string DocumentCulture { get; set; } = null!; + + [Column("DocumentNodeID")] + public int DocumentNodeId { get; set; } + + public string? DocumentPageTitle { get; set; } + + public string? DocumentPageKeyWords { get; set; } + + public string? DocumentPageDescription { get; set; } + + public bool DocumentShowInSiteMap { get; set; } + + public bool DocumentMenuItemHideInNavigation { get; set; } + + [StringLength(200)] + public string? DocumentMenuCaption { get; set; } + + [StringLength(100)] + public string? DocumentMenuStyle { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImage { get; set; } + + [Column("DocumentPageTemplateID")] + public int? DocumentPageTemplateId { get; set; } + + [StringLength(450)] + public string? DocumentMenuJavascript { get; set; } + + [StringLength(450)] + public string? DocumentMenuRedirectUrl { get; set; } + + public bool? DocumentUseNamePathForUrlPath { get; set; } + + [Column("DocumentStylesheetID")] + public int? DocumentStylesheetId { get; set; } + + public string? DocumentContent { get; set; } + + [StringLength(100)] + public string? DocumentMenuClass { get; set; } + + [StringLength(200)] + public string? DocumentMenuStyleHighlighted { get; set; } + + [StringLength(100)] + public string? DocumentMenuClassHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImageHighlighted { get; set; } + + public bool? DocumentMenuItemInactive { get; set; } + + public string? DocumentCustomData { get; set; } + + [StringLength(100)] + public string? DocumentExtensions { get; set; } + + public string? DocumentTags { get; set; } + + [Column("DocumentTagGroupID")] + public int? DocumentTagGroupId { get; set; } + + [StringLength(440)] + public string? DocumentWildcardRule { get; set; } + + public string? DocumentWebParts { get; set; } + + public double? DocumentRatingValue { get; set; } + + public int? DocumentRatings { get; set; } + + public int? DocumentPriority { get; set; } + + [StringLength(50)] + public string? DocumentType { get; set; } + + public DateTime? DocumentLastPublished { get; set; } + + public bool? DocumentUseCustomExtensions { get; set; } + + public string? DocumentGroupWebParts { get; set; } + + public bool? DocumentCheckedOutAutomatically { get; set; } + + [StringLength(200)] + public string? DocumentTrackConversionName { get; set; } + + [StringLength(100)] + public string? DocumentConversionValue { get; set; } + + public bool? DocumentSearchExcluded { get; set; } + + [StringLength(50)] + public string? DocumentLastVersionNumber { get; set; } + + public bool? DocumentIsArchived { get; set; } + + [StringLength(32)] + public string? DocumentHash { get; set; } + + public bool? DocumentLogVisitActivity { get; set; } + + [Column("DocumentGUID")] + public Guid? DocumentGuid { get; set; } + + [Column("DocumentWorkflowCycleGUID")] + public Guid? DocumentWorkflowCycleGuid { get; set; } + + [StringLength(100)] + public string? DocumentSitemapSettings { get; set; } + + public bool? DocumentIsWaitingForTranslation { get; set; } + + [Column("DocumentSKUName")] + [StringLength(440)] + public string? DocumentSkuname { get; set; } + + [Column("DocumentSKUDescription")] + public string? DocumentSkudescription { get; set; } + + [Column("DocumentSKUShortDescription")] + public string? DocumentSkushortDescription { get; set; } + + [StringLength(450)] + public string? DocumentWorkflowActionStatus { get; set; } + + public bool? DocumentMenuRedirectToFirstChild { get; set; } + + [Required] + public bool? DocumentCanBePublished { get; set; } + + [Required] + public bool? DocumentInheritsStylesheet { get; set; } + + [InverseProperty("CommentPostDocument")] + public virtual ICollection BlogComments { get; set; } = new List(); + + [InverseProperty("SubscriptionPostDocument")] + public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); + + [InverseProperty("BoardDocument")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("AttachmentDocument")] + public virtual ICollection CmsAttachments { get; set; } = new List(); + + [InverseProperty("PersonalizationDocument")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [ForeignKey("DocumentCheckedOutByUserId")] + [InverseProperty("CmsDocumentDocumentCheckedOutByUsers")] + public virtual CmsUser? DocumentCheckedOutByUser { get; set; } + + [ForeignKey("DocumentCheckedOutVersionHistoryId")] + [InverseProperty("CmsDocumentDocumentCheckedOutVersionHistories")] + public virtual CmsVersionHistory? DocumentCheckedOutVersionHistory { get; set; } + + [ForeignKey("DocumentCreatedByUserId")] + [InverseProperty("CmsDocumentDocumentCreatedByUsers")] + public virtual CmsUser? DocumentCreatedByUser { get; set; } + + [ForeignKey("DocumentModifiedByUserId")] + [InverseProperty("CmsDocumentDocumentModifiedByUsers")] + public virtual CmsUser? DocumentModifiedByUser { get; set; } + + [ForeignKey("DocumentNodeId")] + [InverseProperty("CmsDocuments")] + public virtual CmsTree DocumentNode { get; set; } = null!; + + [ForeignKey("DocumentPageTemplateId")] + [InverseProperty("CmsDocuments")] + public virtual CmsPageTemplate? DocumentPageTemplate { get; set; } + + [ForeignKey("DocumentPublishedVersionHistoryId")] + [InverseProperty("CmsDocumentDocumentPublishedVersionHistories")] + public virtual CmsVersionHistory? DocumentPublishedVersionHistory { get; set; } + + [ForeignKey("DocumentStylesheetId")] + [InverseProperty("CmsDocuments")] + public virtual CmsCssStylesheet? DocumentStylesheet { get; set; } + + [ForeignKey("DocumentTagGroupId")] + [InverseProperty("CmsDocuments")] + public virtual CmsTagGroup? DocumentTagGroup { get; set; } + + [ForeignKey("DocumentWorkflowStepId")] + [InverseProperty("CmsDocuments")] + public virtual CmsWorkflowStep? DocumentWorkflowStep { get; set; } + + [InverseProperty("ForumDocument")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [InverseProperty("VariantDocument")] + public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); + + [ForeignKey("DocumentId")] + [InverseProperty("Documents")] + public virtual ICollection Categories { get; set; } = new List(); + + [ForeignKey("DocumentId")] + [InverseProperty("Documents")] + public virtual ICollection Tags { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsDocumentAlias.cs b/Migration.Tool.K11/Models/CmsDocumentAlias.cs new file mode 100644 index 00000000..622c583d --- /dev/null +++ b/Migration.Tool.K11/Models/CmsDocumentAlias.cs @@ -0,0 +1,54 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_DocumentAlias")] +[Index("AliasNodeId", Name = "IX_CMS_DocumentAlias_AliasNodeID")] +[Index("AliasSiteId", Name = "IX_CMS_DocumentAlias_AliasSiteID")] +[Index("AliasWildcardRule", "AliasPriority", Name = "IX_CMS_DocumentAlias_AliasWildcardRule_AliasPriority")] +[Index("AliasCulture", Name = "IX_CMS_Document_AliasCulture")] +public class CmsDocumentAlias +{ + [Key] + [Column("AliasID")] + public int AliasId { get; set; } + + [Column("AliasNodeID")] + public int AliasNodeId { get; set; } + + [StringLength(20)] + public string? AliasCulture { get; set; } + + [Column("AliasURLPath")] + public string? AliasUrlpath { get; set; } + + [StringLength(100)] + public string? AliasExtensions { get; set; } + + [StringLength(440)] + public string? AliasWildcardRule { get; set; } + + public int? AliasPriority { get; set; } + + [Column("AliasGUID")] + public Guid? AliasGuid { get; set; } + + public DateTime AliasLastModified { get; set; } + + [Column("AliasSiteID")] + public int AliasSiteId { get; set; } + + [StringLength(50)] + public string? AliasActionMode { get; set; } + + [ForeignKey("AliasNodeId")] + [InverseProperty("CmsDocumentAliases")] + public virtual CmsTree AliasNode { get; set; } = null!; + + [ForeignKey("AliasSiteId")] + [InverseProperty("CmsDocumentAliases")] + public virtual CmsSite AliasSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsDocumentTypeScope.cs b/Migration.Tool.K11/Models/CmsDocumentTypeScope.cs new file mode 100644 index 00000000..eac4bcef --- /dev/null +++ b/Migration.Tool.K11/Models/CmsDocumentTypeScope.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_DocumentTypeScope")] +[Index("ScopeSiteId", Name = "IX_CMS_DocumentTypeScope_ScopeSiteID")] +public class CmsDocumentTypeScope +{ + [Key] + [Column("ScopeID")] + public int ScopeId { get; set; } + + public string ScopePath { get; set; } = null!; + + [Column("ScopeSiteID")] + public int? ScopeSiteId { get; set; } + + public DateTime ScopeLastModified { get; set; } + + [Column("ScopeGUID")] + public Guid? ScopeGuid { get; set; } + + public bool? ScopeIncludeChildren { get; set; } + + public bool? ScopeAllowAllTypes { get; set; } + + public bool? ScopeAllowLinks { get; set; } + + [Column("ScopeAllowABVariant")] + public bool? ScopeAllowAbvariant { get; set; } + + public string? ScopeMacroCondition { get; set; } + + [ForeignKey("ScopeSiteId")] + [InverseProperty("CmsDocumentTypeScopes")] + public virtual CmsSite? ScopeSite { get; set; } + + [ForeignKey("ScopeId")] + [InverseProperty("Scopes")] + public virtual ICollection Classes { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsEmail.cs b/Migration.Tool.K11/Models/CmsEmail.cs new file mode 100644 index 00000000..bc7a0b1a --- /dev/null +++ b/Migration.Tool.K11/Models/CmsEmail.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Email")] +[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] +public class CmsEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [StringLength(254)] + public string EmailFrom { get; set; } = null!; + + [StringLength(998)] + public string? EmailTo { get; set; } + + [StringLength(998)] + public string? EmailCc { get; set; } + + [StringLength(998)] + public string? EmailBcc { get; set; } + + [StringLength(450)] + public string EmailSubject { get; set; } = null!; + + public string? EmailBody { get; set; } + + public string? EmailPlainTextBody { get; set; } + + public int EmailFormat { get; set; } + + public int EmailPriority { get; set; } + + [Column("EmailSiteID")] + public int? EmailSiteId { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + public DateTime EmailLastModified { get; set; } + + public int? EmailStatus { get; set; } + + public bool? EmailIsMass { get; set; } + + [StringLength(254)] + public string? EmailReplyTo { get; set; } + + public string? EmailHeaders { get; set; } + + public DateTime? EmailCreated { get; set; } + + [InverseProperty("Email")] + public virtual ICollection CmsEmailUsers { get; set; } = new List(); + + [ForeignKey("EmailId")] + [InverseProperty("Emails")] + public virtual ICollection Attachments { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsEmailAttachment.cs b/Migration.Tool.K11/Models/CmsEmailAttachment.cs new file mode 100644 index 00000000..ccc6d8b0 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsEmailAttachment.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_EmailAttachment")] +public class CmsEmailAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[] AttachmentBinary { get; set; } = null!; + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + [Column("AttachmentContentID")] + [StringLength(255)] + public string? AttachmentContentId { get; set; } + + [Column("AttachmentSiteID")] + public int? AttachmentSiteId { get; set; } + + [ForeignKey("AttachmentId")] + [InverseProperty("Attachments")] + public virtual ICollection Emails { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsEmailTemplate.cs b/Migration.Tool.K11/Models/CmsEmailTemplate.cs new file mode 100644 index 00000000..428ba5e4 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsEmailTemplate.cs @@ -0,0 +1,58 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_EmailTemplate")] +[Index("EmailTemplateName", "EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateName_EmailTemplateSiteID")] +[Index("EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateSiteID")] +public class CmsEmailTemplate +{ + [Key] + [Column("EmailTemplateID")] + public int EmailTemplateId { get; set; } + + [StringLength(200)] + public string EmailTemplateName { get; set; } = null!; + + [StringLength(200)] + public string EmailTemplateDisplayName { get; set; } = null!; + + public string? EmailTemplateText { get; set; } + + [Column("EmailTemplateSiteID")] + public int? EmailTemplateSiteId { get; set; } + + [Column("EmailTemplateGUID")] + public Guid EmailTemplateGuid { get; set; } + + public DateTime EmailTemplateLastModified { get; set; } + + public string? EmailTemplatePlainText { get; set; } + + [StringLength(250)] + public string? EmailTemplateSubject { get; set; } + + [StringLength(254)] + public string? EmailTemplateFrom { get; set; } + + [StringLength(998)] + public string? EmailTemplateCc { get; set; } + + [StringLength(998)] + public string? EmailTemplateBcc { get; set; } + + [StringLength(100)] + public string? EmailTemplateType { get; set; } + + public string? EmailTemplateDescription { get; set; } + + [StringLength(254)] + public string? EmailTemplateReplyTo { get; set; } + + [ForeignKey("EmailTemplateSiteId")] + [InverseProperty("CmsEmailTemplates")] + public virtual CmsSite? EmailTemplateSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsEmailUser.cs b/Migration.Tool.K11/Models/CmsEmailUser.cs new file mode 100644 index 00000000..2c6f5daa --- /dev/null +++ b/Migration.Tool.K11/Models/CmsEmailUser.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[PrimaryKey("EmailId", "UserId")] +[Table("CMS_EmailUser")] +[Index("Status", Name = "IX_CMS_EmailUser_Status")] +[Index("UserId", Name = "IX_CMS_EmailUser_UserID")] +public class CmsEmailUser +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [Key] + [Column("UserID")] + public int UserId { get; set; } + + public string? LastSendResult { get; set; } + + public DateTime? LastSendAttempt { get; set; } + + public int? Status { get; set; } + + [ForeignKey("EmailId")] + [InverseProperty("CmsEmailUsers")] + public virtual CmsEmail Email { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsEmailUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsEventLog.cs b/Migration.Tool.K11/Models/CmsEventLog.cs new file mode 100644 index 00000000..14e99bbb --- /dev/null +++ b/Migration.Tool.K11/Models/CmsEventLog.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_EventLog")] +[Index("SiteId", Name = "IX_CMS_EventLog_SiteID")] +public class CmsEventLog +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(5)] + public string EventType { get; set; } = null!; + + public DateTime EventTime { get; set; } + + [StringLength(100)] + public string Source { get; set; } = null!; + + [StringLength(100)] + public string EventCode { get; set; } = null!; + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(250)] + public string? UserName { get; set; } + + [Column("IPAddress")] + [StringLength(100)] + public string? Ipaddress { get; set; } + + [Column("NodeID")] + public int? NodeId { get; set; } + + [StringLength(100)] + public string? DocumentName { get; set; } + + public string? EventDescription { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + public string? EventUrl { get; set; } + + [StringLength(100)] + public string? EventMachineName { get; set; } + + public string? EventUserAgent { get; set; } + + public string? EventUrlReferrer { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsExternalLogin.cs b/Migration.Tool.K11/Models/CmsExternalLogin.cs new file mode 100644 index 00000000..37da47ed --- /dev/null +++ b/Migration.Tool.K11/Models/CmsExternalLogin.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_ExternalLogin")] +[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] +public class CmsExternalLogin +{ + [Key] + [Column("ExternalLoginID")] + public int ExternalLoginId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(200)] + public string? LoginProvider { get; set; } + + [StringLength(200)] + public string? IdentityKey { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsExternalLogins")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsForm.cs b/Migration.Tool.K11/Models/CmsForm.cs new file mode 100644 index 00000000..f6a50df1 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsForm.cs @@ -0,0 +1,90 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Form")] +[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] +[Index("FormSiteId", Name = "IX_CMS_Form_FormSiteID")] +public class CmsForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(100)] + public string FormName { get; set; } = null!; + + [StringLength(998)] + public string? FormSendToEmail { get; set; } + + [StringLength(254)] + public string? FormSendFromEmail { get; set; } + + [StringLength(250)] + public string? FormEmailSubject { get; set; } + + public string? FormEmailTemplate { get; set; } + + public bool? FormEmailAttachUploadedDocs { get; set; } + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public int FormItems { get; set; } + + public string? FormReportFields { get; set; } + + [StringLength(400)] + public string? FormRedirectToUrl { get; set; } + + public string? FormDisplayText { get; set; } + + public bool FormClearAfterSave { get; set; } + + [StringLength(400)] + public string? FormSubmitButtonText { get; set; } + + [Column("FormSiteID")] + public int FormSiteId { get; set; } + + [StringLength(254)] + public string? FormConfirmationEmailField { get; set; } + + public string? FormConfirmationTemplate { get; set; } + + [StringLength(254)] + public string? FormConfirmationSendFromEmail { get; set; } + + [StringLength(250)] + public string? FormConfirmationEmailSubject { get; set; } + + public int? FormAccess { get; set; } + + [StringLength(255)] + public string? FormSubmitButtonImage { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + public bool? FormLogActivity { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsForms")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormSiteId")] + [InverseProperty("CmsForms")] + public virtual CmsSite FormSite { get; set; } = null!; + + [ForeignKey("FormId")] + [InverseProperty("Forms")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsFormUserControl.cs b/Migration.Tool.K11/Models/CmsFormUserControl.cs new file mode 100644 index 00000000..19a8b347 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsFormUserControl.cs @@ -0,0 +1,108 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_FormUserControl")] +[Index("UserControlCodeName", Name = "IX_CMS_FormUserControl_UserControlCodeName", IsUnique = true)] +[Index("UserControlParentId", Name = "IX_CMS_FormUserControl_UserControlParentID")] +[Index("UserControlResourceId", Name = "IX_CMS_FormUserControl_UserControlResourceID")] +public class CmsFormUserControl +{ + [Key] + [Column("UserControlID")] + public int UserControlId { get; set; } + + [StringLength(200)] + public string UserControlDisplayName { get; set; } = null!; + + [StringLength(200)] + public string UserControlCodeName { get; set; } = null!; + + [StringLength(400)] + public string UserControlFileName { get; set; } = null!; + + public bool UserControlForText { get; set; } + + public bool UserControlForLongText { get; set; } + + public bool UserControlForInteger { get; set; } + + public bool UserControlForDecimal { get; set; } + + public bool UserControlForDateTime { get; set; } + + public bool UserControlForBoolean { get; set; } + + public bool UserControlForFile { get; set; } + + public bool UserControlShowInBizForms { get; set; } + + [StringLength(50)] + public string UserControlDefaultDataType { get; set; } = null!; + + public int? UserControlDefaultDataTypeSize { get; set; } + + public bool? UserControlShowInDocumentTypes { get; set; } + + public bool? UserControlShowInSystemTables { get; set; } + + public bool? UserControlShowInWebParts { get; set; } + + public bool? UserControlShowInReports { get; set; } + + [Column("UserControlGUID")] + public Guid UserControlGuid { get; set; } + + public DateTime UserControlLastModified { get; set; } + + public bool UserControlForGuid { get; set; } + + public bool? UserControlShowInCustomTables { get; set; } + + public bool UserControlForVisibility { get; set; } + + public string? UserControlParameters { get; set; } + + public bool UserControlForDocAttachments { get; set; } + + [Column("UserControlResourceID")] + public int? UserControlResourceId { get; set; } + + public int? UserControlType { get; set; } + + [Column("UserControlParentID")] + public int? UserControlParentId { get; set; } + + public string? UserControlDescription { get; set; } + + [Column("UserControlThumbnailGUID")] + public Guid? UserControlThumbnailGuid { get; set; } + + public int? UserControlPriority { get; set; } + + public bool? UserControlIsSystem { get; set; } + + public bool UserControlForBinary { get; set; } + + public bool UserControlForDocRelationships { get; set; } + + [StringLength(200)] + public string? UserControlAssemblyName { get; set; } + + [StringLength(200)] + public string? UserControlClassName { get; set; } + + [InverseProperty("UserControlParent")] + public virtual ICollection InverseUserControlParent { get; set; } = new List(); + + [ForeignKey("UserControlParentId")] + [InverseProperty("InverseUserControlParent")] + public virtual CmsFormUserControl? UserControlParent { get; set; } + + [ForeignKey("UserControlResourceId")] + [InverseProperty("CmsFormUserControls")] + public virtual CmsResource? UserControlResource { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsHelpTopic.cs b/Migration.Tool.K11/Models/CmsHelpTopic.cs new file mode 100644 index 00000000..8887557e --- /dev/null +++ b/Migration.Tool.K11/Models/CmsHelpTopic.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_HelpTopic")] +[Index("HelpTopicUielementId", Name = "IX_CMS_HelpTopic_HelpTopicUIElementID")] +public class CmsHelpTopic +{ + [Key] + [Column("HelpTopicID")] + public int HelpTopicId { get; set; } + + [Column("HelpTopicUIElementID")] + public int HelpTopicUielementId { get; set; } + + [StringLength(200)] + public string HelpTopicName { get; set; } = null!; + + [StringLength(1023)] + public string HelpTopicLink { get; set; } = null!; + + public DateTime HelpTopicLastModified { get; set; } + + [Column("HelpTopicGUID")] + public Guid HelpTopicGuid { get; set; } + + public int? HelpTopicOrder { get; set; } + + [ForeignKey("HelpTopicUielementId")] + [InverseProperty("CmsHelpTopics")] + public virtual CmsUielement HelpTopicUielement { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsLayout.cs b/Migration.Tool.K11/Models/CmsLayout.cs new file mode 100644 index 00000000..0c73d615 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsLayout.cs @@ -0,0 +1,62 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Layout")] +[Index("LayoutDisplayName", Name = "IX_CMS_Layout_LayoutDisplayName")] +public class CmsLayout +{ + [Key] + [Column("LayoutID")] + public int LayoutId { get; set; } + + [StringLength(100)] + public string LayoutCodeName { get; set; } = null!; + + [StringLength(200)] + public string LayoutDisplayName { get; set; } = null!; + + public string? LayoutDescription { get; set; } + + public string LayoutCode { get; set; } = null!; + + [Column("LayoutVersionGUID")] + [StringLength(50)] + public string? LayoutVersionGuid { get; set; } + + [Column("LayoutGUID")] + public Guid LayoutGuid { get; set; } + + public DateTime LayoutLastModified { get; set; } + + [StringLength(50)] + public string? LayoutType { get; set; } + + [Column("LayoutCSS")] + public string? LayoutCss { get; set; } + + [Column("LayoutThumbnailGUID")] + public Guid? LayoutThumbnailGuid { get; set; } + + public int? LayoutZoneCount { get; set; } + + public bool? LayoutIsConvertible { get; set; } + + [StringLength(200)] + public string? LayoutIconClass { get; set; } + + [InverseProperty("SourceLayout")] + public virtual ICollection CmsDeviceProfileLayoutSourceLayouts { get; set; } = new List(); + + [InverseProperty("TargetLayout")] + public virtual ICollection CmsDeviceProfileLayoutTargetLayouts { get; set; } = new List(); + + [InverseProperty("PageTemplateLayoutNavigation")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("Layout")] + public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsLicenseKey.cs b/Migration.Tool.K11/Models/CmsLicenseKey.cs new file mode 100644 index 00000000..aac8991e --- /dev/null +++ b/Migration.Tool.K11/Models/CmsLicenseKey.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_LicenseKey")] +public class CmsLicenseKey +{ + [Key] + [Column("LicenseKeyID")] + public int LicenseKeyId { get; set; } + + [StringLength(255)] + public string? LicenseDomain { get; set; } + + public string? LicenseKey { get; set; } + + [StringLength(200)] + public string? LicenseEdition { get; set; } + + [StringLength(200)] + public string? LicenseExpiration { get; set; } + + public int? LicenseServers { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsMacroIdentity.cs b/Migration.Tool.K11/Models/CmsMacroIdentity.cs new file mode 100644 index 00000000..8d05df14 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsMacroIdentity.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_MacroIdentity")] +[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] +public class CmsMacroIdentity +{ + [Key] + [Column("MacroIdentityID")] + public int MacroIdentityId { get; set; } + + public Guid MacroIdentityGuid { get; set; } + + public DateTime MacroIdentityLastModified { get; set; } + + [StringLength(200)] + public string MacroIdentityName { get; set; } = null!; + + [Column("MacroIdentityEffectiveUserID")] + public int? MacroIdentityEffectiveUserId { get; set; } + + [InverseProperty("UserMacroIdentityMacroIdentity")] + public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); + + [ForeignKey("MacroIdentityEffectiveUserId")] + [InverseProperty("CmsMacroIdentities")] + public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsMacroRule.cs b/Migration.Tool.K11/Models/CmsMacroRule.cs new file mode 100644 index 00000000..a93bca43 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsMacroRule.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_MacroRule")] +public class CmsMacroRule +{ + [Key] + [Column("MacroRuleID")] + public int MacroRuleId { get; set; } + + [StringLength(200)] + public string MacroRuleName { get; set; } = null!; + + [StringLength(1000)] + public string MacroRuleText { get; set; } = null!; + + public string? MacroRuleParameters { get; set; } + + [StringLength(100)] + public string? MacroRuleResourceName { get; set; } + + public DateTime MacroRuleLastModified { get; set; } + + [Column("MacroRuleGUID")] + public Guid MacroRuleGuid { get; set; } + + public string MacroRuleCondition { get; set; } = null!; + + [StringLength(500)] + public string MacroRuleDisplayName { get; set; } = null!; + + public bool? MacroRuleIsCustom { get; set; } + + public bool MacroRuleRequiresContext { get; set; } + + [StringLength(450)] + public string? MacroRuleDescription { get; set; } + + [StringLength(2500)] + public string? MacroRuleRequiredData { get; set; } + + public bool? MacroRuleEnabled { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsMembership.cs b/Migration.Tool.K11/Models/CmsMembership.cs new file mode 100644 index 00000000..34698d57 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsMembership.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Membership")] +[Index("MembershipSiteId", Name = "IX_CMS_Membership_MembershipSiteID")] +public class CmsMembership +{ + [Key] + [Column("MembershipID")] + public int MembershipId { get; set; } + + [StringLength(200)] + public string MembershipName { get; set; } = null!; + + [StringLength(200)] + public string MembershipDisplayName { get; set; } = null!; + + public string? MembershipDescription { get; set; } + + public DateTime MembershipLastModified { get; set; } + + [Column("MembershipGUID")] + public Guid MembershipGuid { get; set; } + + [Column("MembershipSiteID")] + public int? MembershipSiteId { get; set; } + + [InverseProperty("Membership")] + public virtual ICollection CmsMembershipUsers { get; set; } = new List(); + + [ForeignKey("MembershipSiteId")] + [InverseProperty("CmsMemberships")] + public virtual CmsSite? MembershipSite { get; set; } + + [ForeignKey("MembershipId")] + [InverseProperty("Memberships")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsMembershipUser.cs b/Migration.Tool.K11/Models/CmsMembershipUser.cs new file mode 100644 index 00000000..7a4ddb73 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsMembershipUser.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_MembershipUser")] +[Index("MembershipId", "UserId", Name = "IX_CMS_MembershipUser_MembershipID_UserID", IsUnique = true)] +[Index("UserId", Name = "IX_CMS_MembershipUser_UserID")] +public class CmsMembershipUser +{ + [Key] + [Column("MembershipUserID")] + public int MembershipUserId { get; set; } + + [Column("MembershipID")] + public int MembershipId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + public DateTime? ValidTo { get; set; } + + public bool? SendNotification { get; set; } + + [ForeignKey("MembershipId")] + [InverseProperty("CmsMembershipUsers")] + public virtual CmsMembership Membership { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsMembershipUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsMetaFile.cs b/Migration.Tool.K11/Models/CmsMetaFile.cs new file mode 100644 index 00000000..1bfed617 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsMetaFile.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_MetaFile")] +[Index("MetaFileGuid", "MetaFileSiteId", "MetaFileObjectType", "MetaFileObjectId", "MetaFileGroupName", Name = "IX_CMS_MetaFile_MetaFileGUID_MetaFileSiteID_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName")] +[Index("MetaFileSiteId", Name = "IX_CMS_MetaFile_MetaFileSiteID")] +public class CmsMetaFile +{ + [Key] + [Column("MetaFileID")] + public int MetaFileId { get; set; } + + [Column("MetaFileObjectID")] + public int MetaFileObjectId { get; set; } + + [StringLength(100)] + public string MetaFileObjectType { get; set; } = null!; + + [StringLength(100)] + public string? MetaFileGroupName { get; set; } + + [StringLength(250)] + public string MetaFileName { get; set; } = null!; + + [StringLength(50)] + public string MetaFileExtension { get; set; } = null!; + + public int MetaFileSize { get; set; } + + [StringLength(100)] + public string MetaFileMimeType { get; set; } = null!; + + public byte[]? MetaFileBinary { get; set; } + + public int? MetaFileImageWidth { get; set; } + + public int? MetaFileImageHeight { get; set; } + + [Column("MetaFileGUID")] + public Guid MetaFileGuid { get; set; } + + public DateTime MetaFileLastModified { get; set; } + + [Column("MetaFileSiteID")] + public int? MetaFileSiteId { get; set; } + + [StringLength(250)] + public string? MetaFileTitle { get; set; } + + public string? MetaFileDescription { get; set; } + + public string? MetaFileCustomData { get; set; } + + [ForeignKey("MetaFileSiteId")] + [InverseProperty("CmsMetaFiles")] + public virtual CmsSite? MetaFileSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsModuleLicenseKey.cs b/Migration.Tool.K11/Models/CmsModuleLicenseKey.cs new file mode 100644 index 00000000..116c9a3b --- /dev/null +++ b/Migration.Tool.K11/Models/CmsModuleLicenseKey.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_ModuleLicenseKey")] +[Index("ModuleLicenseKeyResourceId", Name = "IX_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID")] +public class CmsModuleLicenseKey +{ + [Key] + [Column("ModuleLicenseKeyID")] + public int ModuleLicenseKeyId { get; set; } + + public Guid ModuleLicenseKeyGuid { get; set; } + + public DateTime ModuleLicenseKeyLastModified { get; set; } + + public string ModuleLicenseKeyLicense { get; set; } = null!; + + [Column("ModuleLicenseKeyResourceID")] + public int ModuleLicenseKeyResourceId { get; set; } + + [ForeignKey("ModuleLicenseKeyResourceId")] + [InverseProperty("CmsModuleLicenseKeys")] + public virtual CmsResource ModuleLicenseKeyResource { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsModuleUsageCounter.cs b/Migration.Tool.K11/Models/CmsModuleUsageCounter.cs new file mode 100644 index 00000000..c49ac8f5 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsModuleUsageCounter.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +[Table("CMS_ModuleUsageCounter")] +public class CmsModuleUsageCounter +{ + [Column("ModuleUsageCounterID")] + public int ModuleUsageCounterId { get; set; } + + [StringLength(200)] + public string ModuleUsageCounterName { get; set; } = null!; + + public long ModuleUsageCounterValue { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsObjectSetting.cs b/Migration.Tool.K11/Models/CmsObjectSetting.cs new file mode 100644 index 00000000..01198822 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsObjectSetting.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_ObjectSettings")] +[Index("ObjectCheckedOutByUserId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutByUserID")] +[Index("ObjectCheckedOutVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID")] +[Index("ObjectPublishedVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectPublishedVersionHistoryID")] +[Index("ObjectSettingsObjectId", "ObjectSettingsObjectType", Name = "IX_CMS_ObjectSettings_ObjectSettingsObjectType_ObjectSettingsObjectID", IsUnique = true)] +[Index("ObjectWorkflowStepId", Name = "IX_CMS_ObjectSettings_ObjectWorkflowStepID")] +public class CmsObjectSetting +{ + [Key] + [Column("ObjectSettingsID")] + public int ObjectSettingsId { get; set; } + + public string? ObjectTags { get; set; } + + [Column("ObjectCheckedOutByUserID")] + public int? ObjectCheckedOutByUserId { get; set; } + + public DateTime? ObjectCheckedOutWhen { get; set; } + + [Column("ObjectCheckedOutVersionHistoryID")] + public int? ObjectCheckedOutVersionHistoryId { get; set; } + + [Column("ObjectWorkflowStepID")] + public int? ObjectWorkflowStepId { get; set; } + + [Column("ObjectPublishedVersionHistoryID")] + public int? ObjectPublishedVersionHistoryId { get; set; } + + [Column("ObjectSettingsObjectID")] + public int ObjectSettingsObjectId { get; set; } + + [StringLength(100)] + public string ObjectSettingsObjectType { get; set; } = null!; + + public string? ObjectComments { get; set; } + + public bool? ObjectWorkflowSendEmails { get; set; } + + [ForeignKey("ObjectCheckedOutByUserId")] + [InverseProperty("CmsObjectSettings")] + public virtual CmsUser? ObjectCheckedOutByUser { get; set; } + + [ForeignKey("ObjectCheckedOutVersionHistoryId")] + [InverseProperty("CmsObjectSettingObjectCheckedOutVersionHistories")] + public virtual CmsObjectVersionHistory? ObjectCheckedOutVersionHistory { get; set; } + + [ForeignKey("ObjectPublishedVersionHistoryId")] + [InverseProperty("CmsObjectSettingObjectPublishedVersionHistories")] + public virtual CmsObjectVersionHistory? ObjectPublishedVersionHistory { get; set; } + + [ForeignKey("ObjectWorkflowStepId")] + [InverseProperty("CmsObjectSettings")] + public virtual CmsWorkflowStep? ObjectWorkflowStep { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsObjectVersionHistory.cs b/Migration.Tool.K11/Models/CmsObjectVersionHistory.cs new file mode 100644 index 00000000..5a074d9c --- /dev/null +++ b/Migration.Tool.K11/Models/CmsObjectVersionHistory.cs @@ -0,0 +1,72 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_ObjectVersionHistory")] +[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionModifiedByUserId", Name = "IX_CMS_ObjectVersionHistory_VersionModifiedByUserID")] +[Index("VersionObjectSiteId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectSiteID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionObjectType", "VersionObjectId", "VersionModifiedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectType_VersionObjectID_VersionModifiedWhen", IsDescending = new[] { false, false, true })] +public class CmsObjectVersionHistory +{ + [Key] + [Column("VersionID")] + public int VersionId { get; set; } + + [Column("VersionObjectID")] + public int? VersionObjectId { get; set; } + + [StringLength(100)] + public string VersionObjectType { get; set; } = null!; + + [Column("VersionObjectSiteID")] + public int? VersionObjectSiteId { get; set; } + + [StringLength(450)] + public string VersionObjectDisplayName { get; set; } = null!; + + [Column("VersionXML")] + public string VersionXml { get; set; } = null!; + + [Column("VersionBinaryDataXML")] + public string? VersionBinaryDataXml { get; set; } + + [Column("VersionModifiedByUserID")] + public int? VersionModifiedByUserId { get; set; } + + public DateTime VersionModifiedWhen { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [StringLength(50)] + public string VersionNumber { get; set; } = null!; + + [Column("VersionSiteBindingIDs")] + public string? VersionSiteBindingIds { get; set; } + + public string? VersionComment { get; set; } + + [InverseProperty("ObjectCheckedOutVersionHistory")] + public virtual ICollection CmsObjectSettingObjectCheckedOutVersionHistories { get; set; } = new List(); + + [InverseProperty("ObjectPublishedVersionHistory")] + public virtual ICollection CmsObjectSettingObjectPublishedVersionHistories { get; set; } = new List(); + + [ForeignKey("VersionDeletedByUserId")] + [InverseProperty("CmsObjectVersionHistoryVersionDeletedByUsers")] + public virtual CmsUser? VersionDeletedByUser { get; set; } + + [ForeignKey("VersionModifiedByUserId")] + [InverseProperty("CmsObjectVersionHistoryVersionModifiedByUsers")] + public virtual CmsUser? VersionModifiedByUser { get; set; } + + [ForeignKey("VersionObjectSiteId")] + [InverseProperty("CmsObjectVersionHistories")] + public virtual CmsSite? VersionObjectSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsObjectWorkflowTrigger.cs b/Migration.Tool.K11/Models/CmsObjectWorkflowTrigger.cs new file mode 100644 index 00000000..0d451651 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsObjectWorkflowTrigger.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_ObjectWorkflowTrigger")] +[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] +public class CmsObjectWorkflowTrigger +{ + [Key] + [Column("TriggerID")] + public int TriggerId { get; set; } + + [Column("TriggerGUID")] + public Guid TriggerGuid { get; set; } + + public DateTime TriggerLastModified { get; set; } + + public int TriggerType { get; set; } + + public string? TriggerMacroCondition { get; set; } + + [Column("TriggerWorkflowID")] + public int TriggerWorkflowId { get; set; } + + [StringLength(450)] + public string TriggerDisplayName { get; set; } = null!; + + [StringLength(100)] + public string TriggerObjectType { get; set; } = null!; + + public string? TriggerParameters { get; set; } + + [StringLength(100)] + public string? TriggerTargetObjectType { get; set; } + + [Column("TriggerTargetObjectID")] + public int? TriggerTargetObjectId { get; set; } + + [ForeignKey("TriggerWorkflowId")] + [InverseProperty("CmsObjectWorkflowTriggers")] + public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsOpenIduser.cs b/Migration.Tool.K11/Models/CmsOpenIduser.cs new file mode 100644 index 00000000..e2561d97 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsOpenIduser.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_OpenIDUser")] +[Index("OpenId", Name = "IX_CMS_OpenIDUser_OpenID")] +[Index("UserId", Name = "IX_CMS_OpenIDUser_UserID")] +public class CmsOpenIduser +{ + [Key] + [Column("OpenIDUserID")] + public int OpenIduserId { get; set; } + + [Column("OpenID")] + public string OpenId { get; set; } = null!; + + [Column("OpenIDProviderURL")] + [StringLength(450)] + public string? OpenIdproviderUrl { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsOpenIdusers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsPageTemplate.cs b/Migration.Tool.K11/Models/CmsPageTemplate.cs new file mode 100644 index 00000000..9eab85c8 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsPageTemplate.cs @@ -0,0 +1,141 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_PageTemplate")] +[Index("PageTemplateCodeName", "PageTemplateDisplayName", Name = "IX_CMS_PageTemplate_PageTemplateCodeName_PageTemplateDisplayName")] +[Index("PageTemplateIsReusable", "PageTemplateForAllPages", "PageTemplateShowAsMasterTemplate", Name = "IX_CMS_PageTemplate_PageTemplateIsReusable_PageTemplateForAllPages_PageTemplateShowAsMasterTemplate")] +[Index("PageTemplateLayoutId", Name = "IX_CMS_PageTemplate_PageTemplateLayoutID")] +[Index("PageTemplateSiteId", "PageTemplateCodeName", "PageTemplateGuid", Name = "IX_CMS_PageTemplate_PageTemplateSiteID_PageTemplateCodeName_PageTemplateGUID")] +public class CmsPageTemplate +{ + [Key] + [Column("PageTemplateID")] + public int PageTemplateId { get; set; } + + [StringLength(200)] + public string PageTemplateDisplayName { get; set; } = null!; + + [StringLength(100)] + public string PageTemplateCodeName { get; set; } = null!; + + public string? PageTemplateDescription { get; set; } + + [StringLength(400)] + public string? PageTemplateFile { get; set; } + + [Column("PageTemplateCategoryID")] + public int? PageTemplateCategoryId { get; set; } + + [Column("PageTemplateLayoutID")] + public int? PageTemplateLayoutId { get; set; } + + public string? PageTemplateWebParts { get; set; } + + public bool? PageTemplateIsReusable { get; set; } + + public bool? PageTemplateShowAsMasterTemplate { get; set; } + + [StringLength(200)] + public string? PageTemplateInheritPageLevels { get; set; } + + public string? PageTemplateLayout { get; set; } + + [Column("PageTemplateVersionGUID")] + [StringLength(200)] + public string? PageTemplateVersionGuid { get; set; } + + public string? PageTemplateHeader { get; set; } + + [Column("PageTemplateGUID")] + public Guid PageTemplateGuid { get; set; } + + public DateTime PageTemplateLastModified { get; set; } + + [Column("PageTemplateSiteID")] + public int? PageTemplateSiteId { get; set; } + + public bool? PageTemplateForAllPages { get; set; } + + [StringLength(10)] + public string PageTemplateType { get; set; } = null!; + + [StringLength(50)] + public string? PageTemplateLayoutType { get; set; } + + [Column("PageTemplateCSS")] + public string? PageTemplateCss { get; set; } + + public bool? PageTemplateIsAllowedForProductSection { get; set; } + + public bool? PageTemplateInheritParentHeader { get; set; } + + public bool? PageTemplateAllowInheritHeader { get; set; } + + [Column("PageTemplateThumbnailGUID")] + public Guid? PageTemplateThumbnailGuid { get; set; } + + public bool? PageTemplateCloneAsAdHoc { get; set; } + + [StringLength(200)] + public string? PageTemplateDefaultController { get; set; } + + [StringLength(200)] + public string? PageTemplateDefaultAction { get; set; } + + [Column("PageTemplateNodeGUID")] + public Guid? PageTemplateNodeGuid { get; set; } + + [Column("PageTemplateMasterPageTemplateID")] + public int? PageTemplateMasterPageTemplateId { get; set; } + + public string? PageTemplateProperties { get; set; } + + public bool? PageTemplateIsLayout { get; set; } + + [StringLength(200)] + public string? PageTemplateIconClass { get; set; } + + [InverseProperty("ClassDefaultPageTemplate")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("DocumentPageTemplate")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("PageTemplateScopeTemplate")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("PageTemplate")] + public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); + + [InverseProperty("NodeTemplate")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("ElementPageTemplate")] + public virtual ICollection CmsUielements { get; set; } = new List(); + + [InverseProperty("MvtvariantPageTemplate")] + public virtual ICollection OmMvtvariants { get; set; } = new List(); + + [InverseProperty("VariantPageTemplate")] + public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); + + [ForeignKey("PageTemplateCategoryId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsPageTemplateCategory? PageTemplateCategory { get; set; } + + [ForeignKey("PageTemplateLayoutId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsLayout? PageTemplateLayoutNavigation { get; set; } + + [ForeignKey("PageTemplateSiteId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsSite? PageTemplateSite { get; set; } + + [ForeignKey("PageTemplateId")] + [InverseProperty("PageTemplates")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsPageTemplateCategory.cs b/Migration.Tool.K11/Models/CmsPageTemplateCategory.cs new file mode 100644 index 00000000..607c21bc --- /dev/null +++ b/Migration.Tool.K11/Models/CmsPageTemplateCategory.cs @@ -0,0 +1,54 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_PageTemplateCategory")] +[Index("CategoryLevel", Name = "IX_CMS_PageTemplateCategory_CategoryLevel")] +[Index("CategoryParentId", Name = "IX_CMS_PageTemplateCategory_CategoryParentID")] +public class CmsPageTemplateCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(200)] + public string? CategoryName { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryTemplateChildCount { get; set; } + + public string? CategoryPath { get; set; } + + public int? CategoryLevel { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsPageTemplateCategory? CategoryParent { get; set; } + + [InverseProperty("ClassPageTemplateCategory")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("PageTemplateCategory")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsPageTemplateScope.cs b/Migration.Tool.K11/Models/CmsPageTemplateScope.cs new file mode 100644 index 00000000..df5be546 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsPageTemplateScope.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_PageTemplateScope")] +[Index("PageTemplateScopeClassId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeClassID")] +[Index("PageTemplateScopeCultureId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeCultureID")] +[Index("PageTemplateScopeLevels", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeLevels")] +[Index("PageTemplateScopeSiteId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeSiteID")] +[Index("PageTemplateScopeTemplateId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeTemplateID")] +public class CmsPageTemplateScope +{ + [Key] + [Column("PageTemplateScopeID")] + public int PageTemplateScopeId { get; set; } + + public string PageTemplateScopePath { get; set; } = null!; + + public string? PageTemplateScopeLevels { get; set; } + + [Column("PageTemplateScopeCultureID")] + public int? PageTemplateScopeCultureId { get; set; } + + [Column("PageTemplateScopeClassID")] + public int? PageTemplateScopeClassId { get; set; } + + [Column("PageTemplateScopeTemplateID")] + public int PageTemplateScopeTemplateId { get; set; } + + [Column("PageTemplateScopeSiteID")] + public int? PageTemplateScopeSiteId { get; set; } + + public DateTime PageTemplateScopeLastModified { get; set; } + + [Column("PageTemplateScopeGUID")] + public Guid PageTemplateScopeGuid { get; set; } + + [ForeignKey("PageTemplateScopeClassId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsClass? PageTemplateScopeClass { get; set; } + + [ForeignKey("PageTemplateScopeCultureId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsCulture? PageTemplateScopeCulture { get; set; } + + [ForeignKey("PageTemplateScopeSiteId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsSite? PageTemplateScopeSite { get; set; } + + [ForeignKey("PageTemplateScopeTemplateId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsPageTemplate PageTemplateScopeTemplate { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsPermission.cs b/Migration.Tool.K11/Models/CmsPermission.cs new file mode 100644 index 00000000..73b29397 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsPermission.cs @@ -0,0 +1,65 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Permission")] +[Index("ClassId", "PermissionName", Name = "IX_CMS_Permission_ClassID_PermissionName")] +[Index("ResourceId", "PermissionName", Name = "IX_CMS_Permission_ResourceID_PermissionName")] +public class CmsPermission +{ + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [StringLength(100)] + public string PermissionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string PermissionName { get; set; } = null!; + + [Column("ClassID")] + public int? ClassId { get; set; } + + [Column("ResourceID")] + public int? ResourceId { get; set; } + + [Column("PermissionGUID")] + public Guid PermissionGuid { get; set; } + + public DateTime PermissionLastModified { get; set; } + + public string? PermissionDescription { get; set; } + + public bool? PermissionDisplayInMatrix { get; set; } + + public int? PermissionOrder { get; set; } + + public bool? PermissionEditableByGlobalAdmin { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsPermissions")] + public virtual CmsClass? Class { get; set; } + + [InverseProperty("Permission")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection ForumsForumRoles { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); + + [ForeignKey("ResourceId")] + [InverseProperty("CmsPermissions")] + public virtual CmsResource? Resource { get; set; } + + [ForeignKey("PermissionId")] + [InverseProperty("Permissions")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsPersonalization.cs b/Migration.Tool.K11/Models/CmsPersonalization.cs new file mode 100644 index 00000000..df5fc800 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsPersonalization.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Personalization")] +[Index("PersonalizationId", "PersonalizationUserId", "PersonalizationDocumentId", "PersonalizationDashboardName", Name = "IX_CMS_Personalization_PersonalizationID_PersonalizationUserID_PersonalizationDocumentID_PersonalizationDashboardName", + IsUnique = true)] +[Index("PersonalizationSiteId", Name = "IX_CMS_Personalization_PersonalizationSiteID_SiteID")] +[Index("PersonalizationUserId", Name = "IX_CMS_Personalization_PersonalizationUserID")] +public class CmsPersonalization +{ + [Key] + [Column("PersonalizationID")] + public int PersonalizationId { get; set; } + + [Column("PersonalizationGUID")] + public Guid PersonalizationGuid { get; set; } + + public DateTime PersonalizationLastModified { get; set; } + + [Column("PersonalizationUserID")] + public int? PersonalizationUserId { get; set; } + + [Column("PersonalizationDocumentID")] + public int? PersonalizationDocumentId { get; set; } + + public string? PersonalizationWebParts { get; set; } + + [StringLength(200)] + public string? PersonalizationDashboardName { get; set; } + + [Column("PersonalizationSiteID")] + public int? PersonalizationSiteId { get; set; } + + [ForeignKey("PersonalizationDocumentId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsDocument? PersonalizationDocument { get; set; } + + [ForeignKey("PersonalizationSiteId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsSite? PersonalizationSite { get; set; } + + [ForeignKey("PersonalizationUserId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsUser? PersonalizationUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsQuery.cs b/Migration.Tool.K11/Models/CmsQuery.cs new file mode 100644 index 00000000..6436696c --- /dev/null +++ b/Migration.Tool.K11/Models/CmsQuery.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Query")] +[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] +public class CmsQuery +{ + [Key] + [Column("QueryID")] + public int QueryId { get; set; } + + [StringLength(100)] + public string QueryName { get; set; } = null!; + + [Column("QueryTypeID")] + public int QueryTypeId { get; set; } + + public string QueryText { get; set; } = null!; + + public bool QueryRequiresTransaction { get; set; } + + [Column("ClassID")] + public int? ClassId { get; set; } + + public bool QueryIsLocked { get; set; } + + public DateTime QueryLastModified { get; set; } + + [Column("QueryGUID")] + public Guid QueryGuid { get; set; } + + public bool? QueryIsCustom { get; set; } + + [StringLength(100)] + public string? QueryConnectionString { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsQueries")] + public virtual CmsClass? Class { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsRelationship.cs b/Migration.Tool.K11/Models/CmsRelationship.cs new file mode 100644 index 00000000..d42a0379 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsRelationship.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Relationship")] +[Index("LeftNodeId", Name = "IX_CMS_Relationship_LeftNodeID")] +[Index("RelationshipNameId", Name = "IX_CMS_Relationship_RelationshipNameID")] +[Index("RightNodeId", Name = "IX_CMS_Relationship_RightNodeID")] +public class CmsRelationship +{ + [Key] + [Column("RelationshipID")] + public int RelationshipId { get; set; } + + [Column("LeftNodeID")] + public int LeftNodeId { get; set; } + + [Column("RightNodeID")] + public int RightNodeId { get; set; } + + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + public string? RelationshipCustomData { get; set; } + + public int? RelationshipOrder { get; set; } + + public bool? RelationshipIsAdHoc { get; set; } + + [ForeignKey("LeftNodeId")] + [InverseProperty("CmsRelationshipLeftNodes")] + public virtual CmsTree LeftNode { get; set; } = null!; + + [ForeignKey("RelationshipNameId")] + [InverseProperty("CmsRelationships")] + public virtual CmsRelationshipName RelationshipName { get; set; } = null!; + + [ForeignKey("RightNodeId")] + [InverseProperty("CmsRelationshipRightNodes")] + public virtual CmsTree RightNode { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsRelationshipName.cs b/Migration.Tool.K11/Models/CmsRelationshipName.cs new file mode 100644 index 00000000..491efe31 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsRelationshipName.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_RelationshipName")] +[Index("RelationshipAllowedObjects", Name = "IX_CMS_RelationshipName_RelationshipAllowedObjects")] +[Index("RelationshipName", "RelationshipDisplayName", Name = "IX_CMS_RelationshipName_RelationshipName_RelationshipDisplayName")] +public class CmsRelationshipName +{ + [Key] + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + [StringLength(200)] + public string RelationshipDisplayName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipName { get; set; } = null!; + + public string? RelationshipAllowedObjects { get; set; } + + [Column("RelationshipGUID")] + public Guid RelationshipGuid { get; set; } + + public DateTime RelationshipLastModified { get; set; } + + public bool? RelationshipNameIsAdHoc { get; set; } + + [InverseProperty("RelationshipName")] + public virtual ICollection CmsRelationships { get; set; } = new List(); + + [ForeignKey("RelationshipNameId")] + [InverseProperty("RelationshipNames")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsResource.cs b/Migration.Tool.K11/Models/CmsResource.cs new file mode 100644 index 00000000..7f7d31e1 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsResource.cs @@ -0,0 +1,84 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Resource")] +[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] +public class CmsResource +{ + [Key] + [Column("ResourceID")] + public int ResourceId { get; set; } + + [StringLength(100)] + public string ResourceDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + public string? ResourceDescription { get; set; } + + public bool? ShowInDevelopment { get; set; } + + [Column("ResourceURL")] + [StringLength(1000)] + public string? ResourceUrl { get; set; } + + [Column("ResourceGUID")] + public Guid ResourceGuid { get; set; } + + public DateTime ResourceLastModified { get; set; } + + public bool? ResourceIsInDevelopment { get; set; } + + public bool? ResourceHasFiles { get; set; } + + [StringLength(200)] + public string? ResourceVersion { get; set; } + + [StringLength(200)] + public string? ResourceAuthor { get; set; } + + [StringLength(50)] + public string? ResourceInstallationState { get; set; } + + [StringLength(50)] + public string? ResourceInstalledVersion { get; set; } + + [InverseProperty("ClassResource")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("UserControlResource")] + public virtual ICollection CmsFormUserControls { get; set; } = new List(); + + [InverseProperty("ModuleLicenseKeyResource")] + public virtual ICollection CmsModuleLicenseKeys { get; set; } = new List(); + + [InverseProperty("Resource")] + public virtual ICollection CmsPermissions { get; set; } = new List(); + + [InverseProperty("ResourceLibraryResource")] + public virtual ICollection CmsResourceLibraries { get; set; } = new List(); + + [InverseProperty("TaskResource")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("CategoryResource")] + public virtual ICollection CmsSettingsCategories { get; set; } = new List(); + + [InverseProperty("ElementResource")] + public virtual ICollection CmsUielements { get; set; } = new List(); + + [InverseProperty("WebPartResource")] + public virtual ICollection CmsWebParts { get; set; } = new List(); + + [InverseProperty("ActionResource")] + public virtual ICollection CmsWorkflowActions { get; set; } = new List(); + + [ForeignKey("ResourceId")] + [InverseProperty("Resources")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsResourceLibrary.cs b/Migration.Tool.K11/Models/CmsResourceLibrary.cs new file mode 100644 index 00000000..93950d7f --- /dev/null +++ b/Migration.Tool.K11/Models/CmsResourceLibrary.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_ResourceLibrary")] +[Index("ResourceLibraryResourceId", Name = "IX_CMS_ResourceLibrary")] +public class CmsResourceLibrary +{ + [Key] + [Column("ResourceLibraryID")] + public int ResourceLibraryId { get; set; } + + [Column("ResourceLibraryResourceID")] + public int ResourceLibraryResourceId { get; set; } + + [StringLength(200)] + public string ResourceLibraryPath { get; set; } = null!; + + [ForeignKey("ResourceLibraryResourceId")] + [InverseProperty("CmsResourceLibraries")] + public virtual CmsResource ResourceLibraryResource { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsResourceString.cs b/Migration.Tool.K11/Models/CmsResourceString.cs new file mode 100644 index 00000000..cf3ecd5d --- /dev/null +++ b/Migration.Tool.K11/Models/CmsResourceString.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_ResourceString")] +[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] +public class CmsResourceString +{ + [Key] + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("StringGUID")] + public Guid StringGuid { get; set; } + + [InverseProperty("TranslationString")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsResourceTranslation.cs b/Migration.Tool.K11/Models/CmsResourceTranslation.cs new file mode 100644 index 00000000..f89caadb --- /dev/null +++ b/Migration.Tool.K11/Models/CmsResourceTranslation.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_ResourceTranslation")] +[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] +[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] +public class CmsResourceTranslation +{ + [Key] + [Column("TranslationID")] + public int TranslationId { get; set; } + + [Column("TranslationStringID")] + public int TranslationStringId { get; set; } + + public string? TranslationText { get; set; } + + [Column("TranslationCultureID")] + public int TranslationCultureId { get; set; } + + [ForeignKey("TranslationCultureId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsCulture TranslationCulture { get; set; } = null!; + + [ForeignKey("TranslationStringId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsResourceString TranslationString { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsRole.cs b/Migration.Tool.K11/Models/CmsRole.cs new file mode 100644 index 00000000..956fc1ad --- /dev/null +++ b/Migration.Tool.K11/Models/CmsRole.cs @@ -0,0 +1,97 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Role")] +[Index("RoleGroupId", Name = "IX_CMS_Role_RoleGroupID")] +[Index("SiteId", "RoleId", Name = "IX_CMS_Role_SiteID_RoleID")] +[Index("SiteId", "RoleName", "RoleGroupId", Name = "IX_CMS_Role_SiteID_RoleName_RoleGroupID", IsUnique = true)] +public class CmsRole +{ + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + public DateTime RoleLastModified { get; set; } + + [Column("RoleGroupID")] + public int? RoleGroupId { get; set; } + + public bool? RoleIsGroupAdministrator { get; set; } + + public bool? RoleIsDomain { get; set; } + + [InverseProperty("Role")] + public virtual ICollection CmsAclitems { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection ForumsForumRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); + + [ForeignKey("RoleGroupId")] + [InverseProperty("CmsRoles")] + public virtual CommunityGroup? RoleGroup { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsRoles")] + public virtual CmsSite? Site { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Boards { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Elements { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("RolesNavigation")] + public virtual ICollection ElementsNavigation { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Forms { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Memberships { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Permissions { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Polls { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsScheduledTask.cs b/Migration.Tool.K11/Models/CmsScheduledTask.cs new file mode 100644 index 00000000..94c407fd --- /dev/null +++ b/Migration.Tool.K11/Models/CmsScheduledTask.cs @@ -0,0 +1,111 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_ScheduledTask")] +[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] +[Index("TaskResourceId", Name = "IX_CMS_ScheduledTask_TaskResourceID")] +[Index("TaskSiteId", "TaskDisplayName", Name = "IX_CMS_ScheduledTask_TaskSiteID_TaskDisplayName")] +[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] +public class CmsScheduledTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(200)] + public string TaskName { get; set; } = null!; + + [StringLength(200)] + public string TaskDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TaskAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string? TaskClass { get; set; } + + [StringLength(1000)] + public string TaskInterval { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime? TaskLastRunTime { get; set; } + + public DateTime? TaskNextRunTime { get; set; } + + public string? TaskLastResult { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + public bool? TaskDeleteAfterLastRun { get; set; } + + [StringLength(100)] + public string? TaskServerName { get; set; } + + [Column("TaskGUID")] + public Guid TaskGuid { get; set; } + + public DateTime TaskLastModified { get; set; } + + public int? TaskExecutions { get; set; } + + [Column("TaskResourceID")] + public int? TaskResourceId { get; set; } + + public bool? TaskRunInSeparateThread { get; set; } + + public bool? TaskUseExternalService { get; set; } + + public bool? TaskAllowExternalService { get; set; } + + public DateTime? TaskLastExecutionReset { get; set; } + + [StringLength(400)] + public string? TaskCondition { get; set; } + + public bool? TaskRunIndividually { get; set; } + + [Column("TaskUserID")] + public int? TaskUserId { get; set; } + + public int? TaskType { get; set; } + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [StringLength(200)] + public string? TaskExecutingServerName { get; set; } + + public bool TaskEnabled { get; set; } + + public bool TaskIsRunning { get; set; } + + [InverseProperty("CampaignScheduledTask")] + public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); + + [InverseProperty("TestWinnerScheduledTask")] + public virtual ICollection NewsletterAbtests { get; set; } = new List(); + + [InverseProperty("NewsletterDynamicScheduledTask")] + public virtual ICollection NewsletterNewsletters { get; set; } = new List(); + + [ForeignKey("TaskResourceId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsResource? TaskResource { get; set; } + + [ForeignKey("TaskSiteId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsSite? TaskSite { get; set; } + + [ForeignKey("TaskUserId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsUser? TaskUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsSearchEngine.cs b/Migration.Tool.K11/Models/CmsSearchEngine.cs new file mode 100644 index 00000000..ff8dc260 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsSearchEngine.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_SearchEngine")] +public class CmsSearchEngine +{ + [Key] + [Column("SearchEngineID")] + public int SearchEngineId { get; set; } + + [StringLength(200)] + public string SearchEngineDisplayName { get; set; } = null!; + + [StringLength(200)] + public string SearchEngineName { get; set; } = null!; + + [StringLength(450)] + public string SearchEngineDomainRule { get; set; } = null!; + + [StringLength(200)] + public string? SearchEngineKeywordParameter { get; set; } + + [Column("SearchEngineGUID")] + public Guid SearchEngineGuid { get; set; } + + public DateTime SearchEngineLastModified { get; set; } + + [StringLength(200)] + public string? SearchEngineCrawler { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsSearchIndex.cs b/Migration.Tool.K11/Models/CmsSearchIndex.cs new file mode 100644 index 00000000..2770a169 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsSearchIndex.cs @@ -0,0 +1,85 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_SearchIndex")] +public class CmsSearchIndex +{ + [Key] + [Column("IndexID")] + public int IndexId { get; set; } + + [StringLength(200)] + public string IndexName { get; set; } = null!; + + [StringLength(200)] + public string IndexDisplayName { get; set; } = null!; + + [StringLength(200)] + public string? IndexAnalyzerType { get; set; } + + public bool IndexIsCommunityGroup { get; set; } + + public string? IndexSettings { get; set; } + + [Column("IndexGUID")] + public Guid IndexGuid { get; set; } + + public DateTime IndexLastModified { get; set; } + + public DateTime? IndexLastRebuildTime { get; set; } + + [StringLength(200)] + public string IndexType { get; set; } = null!; + + [StringLength(200)] + public string? IndexStopWordsFile { get; set; } + + [StringLength(200)] + public string? IndexCustomAnalyzerAssemblyName { get; set; } + + [StringLength(200)] + public string? IndexCustomAnalyzerClassName { get; set; } + + public int? IndexBatchSize { get; set; } + + [StringLength(10)] + public string? IndexStatus { get; set; } + + public DateTime? IndexLastUpdate { get; set; } + + [StringLength(200)] + public string? IndexCrawlerUserName { get; set; } + + [StringLength(200)] + public string? IndexCrawlerFormsUserName { get; set; } + + [StringLength(200)] + public string? IndexCrawlerUserPassword { get; set; } + + [StringLength(200)] + public string? IndexCrawlerDomain { get; set; } + + public bool? IndexIsOutdated { get; set; } + + [StringLength(200)] + public string IndexProvider { get; set; } = null!; + + [StringLength(200)] + public string? IndexSearchServiceName { get; set; } + + [StringLength(200)] + public string? IndexAdminKey { get; set; } + + [StringLength(200)] + public string? IndexQueryKey { get; set; } + + [ForeignKey("IndexId")] + [InverseProperty("Indices")] + public virtual ICollection IndexCultures { get; set; } = new List(); + + [ForeignKey("IndexId")] + [InverseProperty("Indices")] + public virtual ICollection IndexSites { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsSearchTask.cs b/Migration.Tool.K11/Models/CmsSearchTask.cs new file mode 100644 index 00000000..86c2906d --- /dev/null +++ b/Migration.Tool.K11/Models/CmsSearchTask.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_SearchTask")] +public class CmsSearchTask +{ + [Key] + [Column("SearchTaskID")] + public int SearchTaskId { get; set; } + + [StringLength(100)] + public string SearchTaskType { get; set; } = null!; + + [StringLength(100)] + public string? SearchTaskObjectType { get; set; } + + [StringLength(200)] + public string? SearchTaskField { get; set; } + + [StringLength(600)] + public string SearchTaskValue { get; set; } = null!; + + [StringLength(200)] + public string? SearchTaskServerName { get; set; } + + [StringLength(100)] + public string SearchTaskStatus { get; set; } = null!; + + public int SearchTaskPriority { get; set; } + + public DateTime SearchTaskCreated { get; set; } + + public string? SearchTaskErrorMessage { get; set; } + + [Column("SearchTaskRelatedObjectID")] + public int? SearchTaskRelatedObjectId { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsSearchTaskAzure.cs b/Migration.Tool.K11/Models/CmsSearchTaskAzure.cs new file mode 100644 index 00000000..ea8510df --- /dev/null +++ b/Migration.Tool.K11/Models/CmsSearchTaskAzure.cs @@ -0,0 +1,36 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_SearchTaskAzure")] +[Index("SearchTaskAzurePriority", Name = "IX_CMS_SearchTaskAzure_SearchTaskAzurePriority", AllDescending = true)] +public class CmsSearchTaskAzure +{ + [Key] + [Column("SearchTaskAzureID")] + public int SearchTaskAzureId { get; set; } + + [StringLength(100)] + public string SearchTaskAzureType { get; set; } = null!; + + [StringLength(100)] + public string? SearchTaskAzureObjectType { get; set; } + + [StringLength(200)] + public string? SearchTaskAzureMetadata { get; set; } + + [StringLength(600)] + public string SearchTaskAzureAdditionalData { get; set; } = null!; + + [Column("SearchTaskAzureInitiatorObjectID")] + public int? SearchTaskAzureInitiatorObjectId { get; set; } + + public int SearchTaskAzurePriority { get; set; } + + public string? SearchTaskAzureErrorMessage { get; set; } + + public DateTime SearchTaskAzureCreated { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsSession.cs b/Migration.Tool.K11/Models/CmsSession.cs new file mode 100644 index 00000000..6e5a549d --- /dev/null +++ b/Migration.Tool.K11/Models/CmsSession.cs @@ -0,0 +1,65 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Session")] +[Index("SessionIdentificator", Name = "IX_CMS_Session_SessionIdentificator", IsUnique = true)] +[Index("SessionSiteId", Name = "IX_CMS_Session_SessionSiteID")] +[Index("SessionUserId", Name = "IX_CMS_Session_SessionUserID")] +[Index("SessionUserIsHidden", Name = "IX_CMS_Session_SessionUserIsHidden")] +public class CmsSession +{ + [StringLength(50)] + public string SessionIdentificator { get; set; } = null!; + + [Column("SessionUserID")] + public int? SessionUserId { get; set; } + + [StringLength(450)] + public string? SessionLocation { get; set; } + + public DateTime SessionLastActive { get; set; } + + public DateTime? SessionLastLogon { get; set; } + + public DateTime SessionExpires { get; set; } + + public bool SessionExpired { get; set; } + + [Column("SessionSiteID")] + public int? SessionSiteId { get; set; } + + public bool SessionUserIsHidden { get; set; } + + [StringLength(450)] + public string? SessionFullName { get; set; } + + [StringLength(254)] + public string? SessionEmail { get; set; } + + [StringLength(254)] + public string? SessionUserName { get; set; } + + [StringLength(254)] + public string? SessionNickName { get; set; } + + public DateTime? SessionUserCreated { get; set; } + + [Column("SessionContactID")] + public int? SessionContactId { get; set; } + + [Key] + [Column("SessionID")] + public int SessionId { get; set; } + + [ForeignKey("SessionSiteId")] + [InverseProperty("CmsSessions")] + public virtual CmsSite? SessionSite { get; set; } + + [ForeignKey("SessionUserId")] + [InverseProperty("CmsSessions")] + public virtual CmsUser? SessionUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsSettingsCategory.cs b/Migration.Tool.K11/Models/CmsSettingsCategory.cs new file mode 100644 index 00000000..ce60de50 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsSettingsCategory.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_SettingsCategory")] +[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] +[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] +public class CmsSettingsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + public int? CategoryOrder { get; set; } + + [StringLength(100)] + public string? CategoryName { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + [StringLength(200)] + public string? CategoryIconPath { get; set; } + + public bool? CategoryIsGroup { get; set; } + + public bool? CategoryIsCustom { get; set; } + + [Column("CategoryResourceID")] + public int? CategoryResourceId { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsSettingsCategory? CategoryParent { get; set; } + + [ForeignKey("CategoryResourceId")] + [InverseProperty("CmsSettingsCategories")] + public virtual CmsResource? CategoryResource { get; set; } + + [InverseProperty("KeyCategory")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsSettingsKey.cs b/Migration.Tool.K11/Models/CmsSettingsKey.cs new file mode 100644 index 00000000..03222621 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsSettingsKey.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_SettingsKey")] +[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] +[Index("SiteId", "KeyName", Name = "IX_CMS_SettingsKey_SiteID_KeyName")] +public class CmsSettingsKey +{ + [Key] + [Column("KeyID")] + public int KeyId { get; set; } + + [StringLength(100)] + public string KeyName { get; set; } = null!; + + [StringLength(200)] + public string KeyDisplayName { get; set; } = null!; + + public string? KeyDescription { get; set; } + + public string? KeyValue { get; set; } + + [StringLength(50)] + public string KeyType { get; set; } = null!; + + [Column("KeyCategoryID")] + public int? KeyCategoryId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("KeyGUID")] + public Guid KeyGuid { get; set; } + + public DateTime KeyLastModified { get; set; } + + public int? KeyOrder { get; set; } + + public string? KeyDefaultValue { get; set; } + + [StringLength(255)] + public string? KeyValidation { get; set; } + + [StringLength(200)] + public string? KeyEditingControlPath { get; set; } + + public bool? KeyIsGlobal { get; set; } + + public bool? KeyIsCustom { get; set; } + + public bool? KeyIsHidden { get; set; } + + public string? KeyFormControlSettings { get; set; } + + public string? KeyExplanationText { get; set; } + + [ForeignKey("KeyCategoryId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSettingsCategory? KeyCategory { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSite? Site { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsSite.cs b/Migration.Tool.K11/Models/CmsSite.cs new file mode 100644 index 00000000..d4bf6323 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsSite.cs @@ -0,0 +1,407 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Site")] +[Index("SiteDefaultEditorStylesheet", Name = "IX_CMS_Site_SiteDefaultEditorStylesheet")] +[Index("SiteDefaultStylesheetId", Name = "IX_CMS_Site_SiteDefaultStylesheetID")] +[Index("SiteDomainName", "SiteStatus", Name = "IX_CMS_Site_SiteDomainName_SiteStatus")] +[Index("SiteName", Name = "IX_CMS_Site_SiteName")] +public class CmsSite +{ + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + [StringLength(200)] + public string SiteDisplayName { get; set; } = null!; + + public string? SiteDescription { get; set; } + + [StringLength(20)] + public string SiteStatus { get; set; } = null!; + + [StringLength(400)] + public string SiteDomainName { get; set; } = null!; + + [Column("SiteDefaultStylesheetID")] + public int? SiteDefaultStylesheetId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + public int? SiteDefaultEditorStylesheet { get; set; } + + [Column("SiteGUID")] + public Guid SiteGuid { get; set; } + + public DateTime SiteLastModified { get; set; } + + public bool? SiteIsOffline { get; set; } + + [Column("SiteOfflineRedirectURL")] + [StringLength(400)] + public string? SiteOfflineRedirectUrl { get; set; } + + public string? SiteOfflineMessage { get; set; } + + [Column("SitePresentationURL")] + [StringLength(400)] + public string? SitePresentationUrl { get; set; } + + public bool? SiteIsContentOnly { get; set; } + + [InverseProperty("CampaignSite")] + public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); + + [InverseProperty("ConversionSite")] + public virtual ICollection AnalyticsConversions { get; set; } = new List(); + + [InverseProperty("StatisticsSite")] + public virtual ICollection AnalyticsStatistics { get; set; } = new List(); + + [InverseProperty("BoardSite")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("ChatNotificationSite")] + public virtual ICollection ChatNotifications { get; set; } = new List(); + + [InverseProperty("ChatOnlineSupportSite")] + public virtual ICollection ChatOnlineSupports { get; set; } = new List(); + + [InverseProperty("ChatOnlineUserSite")] + public virtual ICollection ChatOnlineUsers { get; set; } = new List(); + + [InverseProperty("ChatRoomSite")] + public virtual ICollection ChatRooms { get; set; } = new List(); + + [InverseProperty("ChatSupportCannedResponseSite")] + public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); + + [InverseProperty("ReportSite")] + public virtual ICollection CmsAbuseReports { get; set; } = new List(); + + [InverseProperty("Aclsite")] + public virtual ICollection CmsAcls { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection CmsAttachmentHistories { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection CmsAttachments { get; set; } = new List(); + + [InverseProperty("StateSite")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("IpaddressSite")] + public virtual ICollection CmsBannedIps { get; set; } = new List(); + + [InverseProperty("BannerCategorySite")] + public virtual ICollection CmsBannerCategories { get; set; } = new List(); + + [InverseProperty("BannerSite")] + public virtual ICollection CmsBanners { get; set; } = new List(); + + [InverseProperty("CategorySite")] + public virtual ICollection CmsCategories { get; set; } = new List(); + + [InverseProperty("AliasSite")] + public virtual ICollection CmsDocumentAliases { get; set; } = new List(); + + [InverseProperty("ScopeSite")] + public virtual ICollection CmsDocumentTypeScopes { get; set; } = new List(); + + [InverseProperty("EmailTemplateSite")] + public virtual ICollection CmsEmailTemplates { get; set; } = new List(); + + [InverseProperty("FormSite")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("MembershipSite")] + public virtual ICollection CmsMemberships { get; set; } = new List(); + + [InverseProperty("MetaFileSite")] + public virtual ICollection CmsMetaFiles { get; set; } = new List(); + + [InverseProperty("VersionObjectSite")] + public virtual ICollection CmsObjectVersionHistories { get; set; } = new List(); + + [InverseProperty("PageTemplateScopeSite")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("PageTemplateSite")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("PersonalizationSite")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsRoles { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("SessionSite")] + public virtual ICollection CmsSessions { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsSiteDomainAliases { get; set; } = new List(); + + [InverseProperty("TagGroupSite")] + public virtual ICollection CmsTagGroups { get; set; } = new List(); + + [InverseProperty("NodeLinkedNodeSite")] + public virtual ICollection CmsTreeNodeLinkedNodeSites { get; set; } = new List(); + + [InverseProperty("NodeSite")] + public virtual ICollection CmsTreeNodeSites { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsUserSites { get; set; } = new List(); + + [InverseProperty("NodeSite")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("ScopeSite")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [InverseProperty("BrandSite")] + public virtual ICollection ComBrands { get; set; } = new List(); + + [InverseProperty("CarrierSite")] + public virtual ICollection ComCarriers { get; set; } = new List(); + + [InverseProperty("CollectionSite")] + public virtual ICollection ComCollections { get; set; } = new List(); + + [InverseProperty("CurrencySite")] + public virtual ICollection ComCurrencies { get; set; } = new List(); + + [InverseProperty("EventSite")] + public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); + + [InverseProperty("CustomerSite")] + public virtual ICollection ComCustomers { get; set; } = new List(); + + [InverseProperty("DepartmentSite")] + public virtual ICollection ComDepartments { get; set; } = new List(); + + [InverseProperty("DiscountSite")] + public virtual ICollection ComDiscounts { get; set; } = new List(); + + [InverseProperty("ExchangeTableSite")] + public virtual ICollection ComExchangeTables { get; set; } = new List(); + + [InverseProperty("GiftCardSite")] + public virtual ICollection ComGiftCards { get; set; } = new List(); + + [InverseProperty("InternalStatusSite")] + public virtual ICollection ComInternalStatuses { get; set; } = new List(); + + [InverseProperty("ManufacturerSite")] + public virtual ICollection ComManufacturers { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscountSite")] + public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); + + [InverseProperty("CategorySite")] + public virtual ICollection ComOptionCategories { get; set; } = new List(); + + [InverseProperty("StatusSite")] + public virtual ICollection ComOrderStatuses { get; set; } = new List(); + + [InverseProperty("OrderSite")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("PaymentOptionSite")] + public virtual ICollection ComPaymentOptions { get; set; } = new List(); + + [InverseProperty("PublicStatusSite")] + public virtual ICollection ComPublicStatuses { get; set; } = new List(); + + [InverseProperty("ShippingOptionSite")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); + + [InverseProperty("ShoppingCartSite")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [InverseProperty("Skusite")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [InverseProperty("SupplierSite")] + public virtual ICollection ComSuppliers { get; set; } = new List(); + + [InverseProperty("TaxClassSite")] + public virtual ICollection ComTaxClasses { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("GroupSite")] + public virtual ICollection CommunityGroups { get; set; } = new List(); + + [InverseProperty("ExportSite")] + public virtual ICollection ExportHistories { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection ExportTasks { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection ForumsAttachments { get; set; } = new List(); + + [InverseProperty("GroupSite")] + public virtual ICollection ForumsForumGroups { get; set; } = new List(); + + [InverseProperty("ForumSite")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection IntegrationTasks { get; set; } = new List(); + + [InverseProperty("FileSite")] + public virtual ICollection MediaFiles { get; set; } = new List(); + + [InverseProperty("LibrarySite")] + public virtual ICollection MediaLibraries { get; set; } = new List(); + + [InverseProperty("TemplateSite")] + public virtual ICollection NewsletterEmailTemplates { get; set; } = new List(); + + [InverseProperty("EmailWidgetSite")] + public virtual ICollection NewsletterEmailWidgets { get; set; } = new List(); + + [InverseProperty("EmailSite")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("IssueSite")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [InverseProperty("NewsletterSite")] + public virtual ICollection NewsletterNewsletters { get; set; } = new List(); + + [InverseProperty("SubscriberSite")] + public virtual ICollection NewsletterSubscribers { get; set; } = new List(); + + [InverseProperty("SubscriptionSite")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("TemplateSite")] + public virtual ICollection NotificationTemplates { get; set; } = new List(); + + [InverseProperty("AbtestSite")] + public virtual ICollection OmAbtests { get; set; } = new List(); + + [InverseProperty("AbvariantSite")] + public virtual ICollection OmAbvariants { get; set; } = new List(); + + [InverseProperty("MvtestSite")] + public virtual ICollection OmMvtests { get; set; } = new List(); + + [InverseProperty("PollSite")] + public virtual ICollection PollsPolls { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionSite")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("SharePointConnectionSite")] + public virtual ICollection SharePointSharePointConnections { get; set; } = new List(); + + [InverseProperty("SharePointFileSite")] + public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); + + [InverseProperty("SharePointLibrarySite")] + public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); + + [ForeignKey("SiteDefaultEditorStylesheet")] + [InverseProperty("CmsSiteSiteDefaultEditorStylesheetNavigations")] + public virtual CmsCssStylesheet? SiteDefaultEditorStylesheetNavigation { get; set; } + + [ForeignKey("SiteDefaultStylesheetId")] + [InverseProperty("CmsSiteSiteDefaultStylesheets")] + public virtual CmsCssStylesheet? SiteDefaultStylesheet { get; set; } + + [InverseProperty("FacebookAccountSite")] + public virtual ICollection SmFacebookAccounts { get; set; } = new List(); + + [InverseProperty("FacebookApplicationSite")] + public virtual ICollection SmFacebookApplications { get; set; } = new List(); + + [InverseProperty("FacebookPostSite")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); + + [InverseProperty("LinkedInApplicationSite")] + public virtual ICollection SmLinkedInApplications { get; set; } = new List(); + + [InverseProperty("LinkedInPostSite")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); + + [InverseProperty("TwitterAccountSite")] + public virtual ICollection SmTwitterAccounts { get; set; } = new List(); + + [InverseProperty("TwitterApplicationSite")] + public virtual ICollection SmTwitterApplications { get; set; } = new List(); + + [InverseProperty("TwitterPostSite")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); + + [InverseProperty("ServerSite")] + public virtual ICollection StagingServers { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection StagingTasks { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Classes { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Containers { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Cultures { get; set; } = new List(); + + [ForeignKey("IndexSiteId")] + [InverseProperty("IndexSites")] + public virtual ICollection Indices { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection PageTemplates { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Polls { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection RelationshipNames { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Resources { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Servers { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Stylesheets { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsSiteDomainAlias.cs b/Migration.Tool.K11/Models/CmsSiteDomainAlias.cs new file mode 100644 index 00000000..0d2e305e --- /dev/null +++ b/Migration.Tool.K11/Models/CmsSiteDomainAlias.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_SiteDomainAlias")] +[Index("SiteDomainAliasName", Name = "IX_CMS_SiteDomainAlias_SiteDomainAliasName")] +[Index("SiteId", Name = "IX_CMS_SiteDomainAlias_SiteID")] +public class CmsSiteDomainAlias +{ + [Key] + [Column("SiteDomainAliasID")] + public int SiteDomainAliasId { get; set; } + + [StringLength(400)] + public string SiteDomainAliasName { get; set; } = null!; + + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + [Column("SiteDomainGUID")] + public Guid? SiteDomainGuid { get; set; } + + public DateTime SiteDomainLastModified { get; set; } + + [StringLength(450)] + public string? SiteDomainDefaultAliasPath { get; set; } + + [StringLength(450)] + public string? SiteDomainRedirectUrl { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsSiteDomainAliases")] + public virtual CmsSite Site { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsSmtpserver.cs b/Migration.Tool.K11/Models/CmsSmtpserver.cs new file mode 100644 index 00000000..565fb537 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsSmtpserver.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_SMTPServer")] +public class CmsSmtpserver +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(200)] + public string ServerName { get; set; } = null!; + + [StringLength(50)] + public string? ServerUserName { get; set; } + + [StringLength(200)] + public string? ServerPassword { get; set; } + + [Column("ServerUseSSL")] + public bool ServerUseSsl { get; set; } + + public bool ServerEnabled { get; set; } + + public bool ServerIsGlobal { get; set; } + + [Column("ServerGUID")] + public Guid ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public int? ServerPriority { get; set; } + + public int? ServerDeliveryMethod { get; set; } + + [StringLength(450)] + public string? ServerPickupDirectory { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("Servers")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsState.cs b/Migration.Tool.K11/Models/CmsState.cs new file mode 100644 index 00000000..bf8bc050 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsState.cs @@ -0,0 +1,52 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_State")] +[Index("CountryId", Name = "IX_CMS_State_CountryID")] +[Index("StateCode", Name = "IX_CMS_State_StateCode")] +public class CmsState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [StringLength(200)] + public string StateDisplayName { get; set; } = null!; + + [StringLength(200)] + public string StateName { get; set; } = null!; + + [StringLength(100)] + public string? StateCode { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public DateTime StateLastModified { get; set; } + + [InverseProperty("AddressState")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("AddressState")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("State")] + public virtual ICollection ComTaxClassStates { get; set; } = new List(); + + [ForeignKey("CountryId")] + [InverseProperty("CmsStates")] + public virtual CmsCountry Country { get; set; } = null!; + + [InverseProperty("AccountState")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactState")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsTag.cs b/Migration.Tool.K11/Models/CmsTag.cs new file mode 100644 index 00000000..5793e99f --- /dev/null +++ b/Migration.Tool.K11/Models/CmsTag.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Tag")] +[Index("TagGroupId", Name = "IX_CMS_Tag_TagGroupID")] +public class CmsTag +{ + [Key] + [Column("TagID")] + public int TagId { get; set; } + + [StringLength(250)] + public string TagName { get; set; } = null!; + + public int TagCount { get; set; } + + [Column("TagGroupID")] + public int TagGroupId { get; set; } + + [Column("TagGUID")] + public Guid TagGuid { get; set; } + + [ForeignKey("TagGroupId")] + [InverseProperty("CmsTags")] + public virtual CmsTagGroup TagGroup { get; set; } = null!; + + [ForeignKey("TagId")] + [InverseProperty("Tags")] + public virtual ICollection Documents { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsTagGroup.cs b/Migration.Tool.K11/Models/CmsTagGroup.cs new file mode 100644 index 00000000..811c9806 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsTagGroup.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_TagGroup")] +[Index("TagGroupSiteId", Name = "IX_CMS_TagGroup_TagGroupSiteID")] +public class CmsTagGroup +{ + [Key] + [Column("TagGroupID")] + public int TagGroupId { get; set; } + + [StringLength(250)] + public string TagGroupDisplayName { get; set; } = null!; + + [StringLength(250)] + public string TagGroupName { get; set; } = null!; + + public string? TagGroupDescription { get; set; } + + [Column("TagGroupSiteID")] + public int TagGroupSiteId { get; set; } + + public bool TagGroupIsAdHoc { get; set; } + + public DateTime TagGroupLastModified { get; set; } + + [Column("TagGroupGUID")] + public Guid TagGroupGuid { get; set; } + + [InverseProperty("DocumentTagGroup")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("TagGroup")] + public virtual ICollection CmsTags { get; set; } = new List(); + + [ForeignKey("TagGroupSiteId")] + [InverseProperty("CmsTagGroups")] + public virtual CmsSite TagGroupSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsTemplateDeviceLayout.cs b/Migration.Tool.K11/Models/CmsTemplateDeviceLayout.cs new file mode 100644 index 00000000..32cc8bd4 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsTemplateDeviceLayout.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_TemplateDeviceLayout")] +[Index("LayoutId", Name = "IX_CMS_TemplateDeviceLayout_LayoutID")] +[Index("PageTemplateId", "ProfileId", Name = "IX_CMS_TemplateDeviceLayout_PageTemplateID_ProfileID", IsUnique = true)] +[Index("ProfileId", Name = "IX_CMS_TemplateDeviceLayout_ProfileID")] +public class CmsTemplateDeviceLayout +{ + [Key] + [Column("TemplateDeviceLayoutID")] + public int TemplateDeviceLayoutId { get; set; } + + [Column("PageTemplateID")] + public int PageTemplateId { get; set; } + + [Column("ProfileID")] + public int ProfileId { get; set; } + + [Column("LayoutID")] + public int? LayoutId { get; set; } + + public string? LayoutCode { get; set; } + + [StringLength(50)] + public string? LayoutType { get; set; } + + [Column("LayoutCSS")] + public string? LayoutCss { get; set; } + + public DateTime LayoutLastModified { get; set; } + + [Column("LayoutGUID")] + public Guid LayoutGuid { get; set; } + + [Column("LayoutVersionGUID")] + [StringLength(50)] + public string? LayoutVersionGuid { get; set; } + + [ForeignKey("LayoutId")] + [InverseProperty("CmsTemplateDeviceLayouts")] + public virtual CmsLayout? Layout { get; set; } + + [ForeignKey("PageTemplateId")] + [InverseProperty("CmsTemplateDeviceLayouts")] + public virtual CmsPageTemplate PageTemplate { get; set; } = null!; + + [ForeignKey("ProfileId")] + [InverseProperty("CmsTemplateDeviceLayouts")] + public virtual CmsDeviceProfile Profile { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsTimeZone.cs b/Migration.Tool.K11/Models/CmsTimeZone.cs new file mode 100644 index 00000000..7d3128e0 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsTimeZone.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_TimeZone")] +public class CmsTimeZone +{ + [Key] + [Column("TimeZoneID")] + public int TimeZoneId { get; set; } + + [StringLength(200)] + public string TimeZoneName { get; set; } = null!; + + [StringLength(200)] + public string TimeZoneDisplayName { get; set; } = null!; + + [Column("TimeZoneGMT")] + public double TimeZoneGmt { get; set; } + + public bool? TimeZoneDaylight { get; set; } + + public DateTime TimeZoneRuleStartIn { get; set; } + + [StringLength(200)] + public string TimeZoneRuleStartRule { get; set; } = null!; + + public DateTime TimeZoneRuleEndIn { get; set; } + + [StringLength(200)] + public string TimeZoneRuleEndRule { get; set; } = null!; + + [Column("TimeZoneGUID")] + public Guid TimeZoneGuid { get; set; } + + public DateTime TimeZoneLastModified { get; set; } + + [InverseProperty("UserTimeZone")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsTransformation.cs b/Migration.Tool.K11/Models/CmsTransformation.cs new file mode 100644 index 00000000..d77d4137 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsTransformation.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Transformation")] +[Index("TransformationClassId", Name = "IX_CMS_Transformation_TransformationClassID")] +public class CmsTransformation +{ + [Key] + [Column("TransformationID")] + public int TransformationId { get; set; } + + [StringLength(100)] + public string TransformationName { get; set; } = null!; + + public string TransformationCode { get; set; } = null!; + + [StringLength(50)] + public string TransformationType { get; set; } = null!; + + [Column("TransformationClassID")] + public int TransformationClassId { get; set; } + + [Column("TransformationVersionGUID")] + [StringLength(50)] + public string? TransformationVersionGuid { get; set; } + + [Column("TransformationGUID")] + public Guid TransformationGuid { get; set; } + + public DateTime TransformationLastModified { get; set; } + + public bool? TransformationIsHierarchical { get; set; } + + [Column("TransformationHierarchicalXML")] + public string? TransformationHierarchicalXml { get; set; } + + [Column("TransformationCSS")] + public string? TransformationCss { get; set; } + + [StringLength(700)] + public string? TransformationPreferredDocument { get; set; } + + [ForeignKey("TransformationClassId")] + [InverseProperty("CmsTransformations")] + public virtual CmsClass TransformationClass { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsTranslationService.cs b/Migration.Tool.K11/Models/CmsTranslationService.cs new file mode 100644 index 00000000..35ff1679 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsTranslationService.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_TranslationService")] +public class CmsTranslationService +{ + [Key] + [Column("TranslationServiceID")] + public int TranslationServiceId { get; set; } + + [StringLength(200)] + public string TranslationServiceAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceClassName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceDisplayName { get; set; } = null!; + + public bool TranslationServiceIsMachine { get; set; } + + public DateTime TranslationServiceLastModified { get; set; } + + [Column("TranslationServiceGUID")] + public Guid TranslationServiceGuid { get; set; } + + public bool TranslationServiceEnabled { get; set; } + + public bool? TranslationServiceSupportsInstructions { get; set; } + + public bool? TranslationServiceSupportsPriority { get; set; } + + public bool? TranslationServiceSupportsDeadline { get; set; } + + public bool? TranslationServiceGenerateTargetTag { get; set; } + + [StringLength(1000)] + public string? TranslationServiceParameter { get; set; } + + public bool? TranslationServiceSupportsStatusUpdate { get; set; } + + public bool? TranslationServiceSupportsCancel { get; set; } + + [InverseProperty("SubmissionService")] + public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsTranslationSubmission.cs b/Migration.Tool.K11/Models/CmsTranslationSubmission.cs new file mode 100644 index 00000000..3c868a7c --- /dev/null +++ b/Migration.Tool.K11/Models/CmsTranslationSubmission.cs @@ -0,0 +1,75 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_TranslationSubmission")] +[Index("SubmissionServiceId", Name = "IX_CMS_TranslationSubmission_SubmissionServiceID")] +[Index("SubmissionSubmittedByUserId", Name = "IX_CMS_TranslationSubmission_SubmissionSubmittedByUserID")] +public class CmsTranslationSubmission +{ + [Key] + [Column("SubmissionID")] + public int SubmissionId { get; set; } + + [StringLength(200)] + public string SubmissionName { get; set; } = null!; + + [StringLength(200)] + public string? SubmissionTicket { get; set; } + + public int SubmissionStatus { get; set; } + + [Column("SubmissionServiceID")] + public int SubmissionServiceId { get; set; } + + [StringLength(10)] + public string SubmissionSourceCulture { get; set; } = null!; + + public string SubmissionTargetCulture { get; set; } = null!; + + public int SubmissionPriority { get; set; } + + public DateTime? SubmissionDeadline { get; set; } + + [StringLength(500)] + public string? SubmissionInstructions { get; set; } + + public DateTime SubmissionLastModified { get; set; } + + [Column("SubmissionGUID")] + public Guid SubmissionGuid { get; set; } + + [Column("SubmissionSiteID")] + public int? SubmissionSiteId { get; set; } + + public double? SubmissionPrice { get; set; } + + public string? SubmissionStatusMessage { get; set; } + + public bool? SubmissionTranslateAttachments { get; set; } + + public int SubmissionItemCount { get; set; } + + public DateTime SubmissionDate { get; set; } + + public int? SubmissionWordCount { get; set; } + + public int? SubmissionCharCount { get; set; } + + [Column("SubmissionSubmittedByUserID")] + public int? SubmissionSubmittedByUserId { get; set; } + + [InverseProperty("SubmissionItemSubmission")] + public virtual ICollection CmsTranslationSubmissionItems { get; set; } = new List(); + + [ForeignKey("SubmissionServiceId")] + [InverseProperty("CmsTranslationSubmissions")] + public virtual CmsTranslationService SubmissionService { get; set; } = null!; + + [ForeignKey("SubmissionSubmittedByUserId")] + [InverseProperty("CmsTranslationSubmissions")] + public virtual CmsUser? SubmissionSubmittedByUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsTranslationSubmissionItem.cs b/Migration.Tool.K11/Models/CmsTranslationSubmissionItem.cs new file mode 100644 index 00000000..b2efb16f --- /dev/null +++ b/Migration.Tool.K11/Models/CmsTranslationSubmissionItem.cs @@ -0,0 +1,57 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_TranslationSubmissionItem")] +[Index("SubmissionItemSubmissionId", Name = "IX_CMS_TranslationSubmissionItem_SubmissionItemSubmissionID")] +public class CmsTranslationSubmissionItem +{ + [Key] + [Column("SubmissionItemID")] + public int SubmissionItemId { get; set; } + + [Column("SubmissionItemSubmissionID")] + public int SubmissionItemSubmissionId { get; set; } + + [Column("SubmissionItemSourceXLIFF")] + public string? SubmissionItemSourceXliff { get; set; } + + [Column("SubmissionItemTargetXLIFF")] + public string? SubmissionItemTargetXliff { get; set; } + + [StringLength(100)] + public string SubmissionItemObjectType { get; set; } = null!; + + [Column("SubmissionItemObjectID")] + public int SubmissionItemObjectId { get; set; } + + [Column("SubmissionItemGUID")] + public Guid SubmissionItemGuid { get; set; } + + public DateTime SubmissionItemLastModified { get; set; } + + [StringLength(200)] + public string SubmissionItemName { get; set; } = null!; + + public int? SubmissionItemWordCount { get; set; } + + public int? SubmissionItemCharCount { get; set; } + + public string? SubmissionItemCustomData { get; set; } + + [Column("SubmissionItemTargetObjectID")] + public int SubmissionItemTargetObjectId { get; set; } + + [StringLength(50)] + public string? SubmissionItemType { get; set; } + + [StringLength(10)] + public string? SubmissionItemTargetCulture { get; set; } + + [ForeignKey("SubmissionItemSubmissionId")] + [InverseProperty("CmsTranslationSubmissionItems")] + public virtual CmsTranslationSubmission SubmissionItemSubmission { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsTree.cs b/Migration.Tool.K11/Models/CmsTree.cs new file mode 100644 index 00000000..5fed2f7c --- /dev/null +++ b/Migration.Tool.K11/Models/CmsTree.cs @@ -0,0 +1,183 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Tree")] +[Index("NodeAclid", Name = "IX_CMS_Tree_NodeACLID")] +[Index("NodeAliasPath", Name = "IX_CMS_Tree_NodeAliasPath")] +[Index("NodeClassId", Name = "IX_CMS_Tree_NodeClassID")] +[Index("NodeGroupId", Name = "IX_CMS_Tree_NodeGroupID")] +[Index("NodeLevel", Name = "IX_CMS_Tree_NodeLevel")] +[Index("NodeLinkedNodeId", Name = "IX_CMS_Tree_NodeLinkedNodeID")] +[Index("NodeLinkedNodeSiteId", Name = "IX_CMS_Tree_NodeLinkedNodeSiteID")] +[Index("NodeOriginalNodeId", Name = "IX_CMS_Tree_NodeOriginalNodeID")] +[Index("NodeOwner", Name = "IX_CMS_Tree_NodeOwner")] +[Index("NodeParentId", "NodeAlias", "NodeName", Name = "IX_CMS_Tree_NodeParentID_NodeAlias_NodeName")] +[Index("NodeSkuid", Name = "IX_CMS_Tree_NodeSKUID")] +[Index("NodeSiteId", "NodeGuid", Name = "IX_CMS_Tree_NodeSiteID_NodeGUID", IsUnique = true)] +[Index("NodeTemplateId", Name = "IX_CMS_Tree_NodeTemplateID")] +public class CmsTree +{ + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + public string NodeAliasPath { get; set; } = null!; + + [StringLength(100)] + public string NodeName { get; set; } = null!; + + [StringLength(50)] + public string NodeAlias { get; set; } = null!; + + [Column("NodeClassID")] + public int NodeClassId { get; set; } + + [Column("NodeParentID")] + public int? NodeParentId { get; set; } + + public int NodeLevel { get; set; } + + [Column("NodeACLID")] + public int? NodeAclid { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeGUID")] + public Guid NodeGuid { get; set; } + + public int? NodeOrder { get; set; } + + public bool? IsSecuredNode { get; set; } + + public int? NodeCacheMinutes { get; set; } + + [Column("NodeSKUID")] + public int? NodeSkuid { get; set; } + + public string? NodeDocType { get; set; } + + public string? NodeHeadTags { get; set; } + + public string? NodeBodyElementAttributes { get; set; } + + [StringLength(200)] + public string? NodeInheritPageLevels { get; set; } + + [Column("RequiresSSL")] + public int? RequiresSsl { get; set; } + + [Column("NodeLinkedNodeID")] + public int? NodeLinkedNodeId { get; set; } + + public int? NodeOwner { get; set; } + + public string? NodeCustomData { get; set; } + + [Column("NodeGroupID")] + public int? NodeGroupId { get; set; } + + [Column("NodeLinkedNodeSiteID")] + public int? NodeLinkedNodeSiteId { get; set; } + + [Column("NodeTemplateID")] + public int? NodeTemplateId { get; set; } + + public bool? NodeTemplateForAllCultures { get; set; } + + public bool? NodeInheritPageTemplate { get; set; } + + public bool? NodeAllowCacheInFileSystem { get; set; } + + public bool? NodeHasChildren { get; set; } + + public bool? NodeHasLinks { get; set; } + + [Column("NodeOriginalNodeID")] + public int? NodeOriginalNodeId { get; set; } + + public bool NodeIsContentOnly { get; set; } + + [Column("NodeIsACLOwner")] + public bool NodeIsAclowner { get; set; } + + public string? NodeBodyScripts { get; set; } + + [InverseProperty("AliasNode")] + public virtual ICollection CmsDocumentAliases { get; set; } = new List(); + + [InverseProperty("DocumentNode")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("LeftNode")] + public virtual ICollection CmsRelationshipLeftNodes { get; set; } = new List(); + + [InverseProperty("RightNode")] + public virtual ICollection CmsRelationshipRightNodes { get; set; } = new List(); + + [InverseProperty("Node")] + public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); + + [InverseProperty("AttendeeEventNode")] + public virtual ICollection EventsAttendees { get; set; } = new List(); + + [InverseProperty("NodeLinkedNode")] + public virtual ICollection InverseNodeLinkedNode { get; set; } = new List(); + + [InverseProperty("NodeOriginalNode")] + public virtual ICollection InverseNodeOriginalNode { get; set; } = new List(); + + [InverseProperty("NodeParent")] + public virtual ICollection InverseNodeParent { get; set; } = new List(); + + [ForeignKey("NodeAclid")] + [InverseProperty("CmsTrees")] + public virtual CmsAcl? NodeAcl { get; set; } + + [ForeignKey("NodeClassId")] + [InverseProperty("CmsTrees")] + public virtual CmsClass NodeClass { get; set; } = null!; + + [ForeignKey("NodeGroupId")] + [InverseProperty("CmsTrees")] + public virtual CommunityGroup? NodeGroup { get; set; } + + [ForeignKey("NodeLinkedNodeId")] + [InverseProperty("InverseNodeLinkedNode")] + public virtual CmsTree? NodeLinkedNode { get; set; } + + [ForeignKey("NodeLinkedNodeSiteId")] + [InverseProperty("CmsTreeNodeLinkedNodeSites")] + public virtual CmsSite? NodeLinkedNodeSite { get; set; } + + [ForeignKey("NodeOriginalNodeId")] + [InverseProperty("InverseNodeOriginalNode")] + public virtual CmsTree? NodeOriginalNode { get; set; } + + [ForeignKey("NodeOwner")] + [InverseProperty("CmsTrees")] + public virtual CmsUser? NodeOwnerNavigation { get; set; } + + [ForeignKey("NodeParentId")] + [InverseProperty("InverseNodeParent")] + public virtual CmsTree? NodeParent { get; set; } + + [ForeignKey("NodeSiteId")] + [InverseProperty("CmsTreeNodeSites")] + public virtual CmsSite NodeSite { get; set; } = null!; + + [ForeignKey("NodeSkuid")] + [InverseProperty("CmsTrees")] + public virtual ComSku? NodeSku { get; set; } + + [ForeignKey("NodeTemplateId")] + [InverseProperty("CmsTrees")] + public virtual CmsPageTemplate? NodeTemplate { get; set; } + + [InverseProperty("Node")] + public virtual ICollection PersonasPersonaNodes { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsUielement.cs b/Migration.Tool.K11/Models/CmsUielement.cs new file mode 100644 index 00000000..478d4f51 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsUielement.cs @@ -0,0 +1,115 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_UIElement")] +[Index("ElementGuid", Name = "IX_CMS_UIElement_ElementGUID", IsUnique = true)] +[Index("ElementPageTemplateId", Name = "IX_CMS_UIElement_ElementPageTemplateID")] +[Index("ElementParentId", Name = "IX_CMS_UIElement_ElementParentID")] +public class CmsUielement +{ + [Key] + [Column("ElementID")] + public int ElementId { get; set; } + + [StringLength(200)] + public string ElementDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ElementName { get; set; } = null!; + + [StringLength(200)] + public string? ElementCaption { get; set; } + + [Column("ElementTargetURL")] + [StringLength(650)] + public string? ElementTargetUrl { get; set; } + + [Column("ElementResourceID")] + public int ElementResourceId { get; set; } + + [Column("ElementParentID")] + public int? ElementParentId { get; set; } + + public int ElementChildCount { get; set; } + + public int? ElementOrder { get; set; } + + public int ElementLevel { get; set; } + + [Column("ElementIDPath")] + [StringLength(450)] + public string ElementIdpath { get; set; } = null!; + + [StringLength(200)] + public string? ElementIconPath { get; set; } + + public bool? ElementIsCustom { get; set; } + + public DateTime ElementLastModified { get; set; } + + [Column("ElementGUID")] + public Guid ElementGuid { get; set; } + + public int? ElementSize { get; set; } + + public string? ElementDescription { get; set; } + + [StringLength(20)] + public string? ElementFromVersion { get; set; } + + [Column("ElementPageTemplateID")] + public int? ElementPageTemplateId { get; set; } + + [StringLength(50)] + public string? ElementType { get; set; } + + public string? ElementProperties { get; set; } + + public bool? ElementIsMenu { get; set; } + + [StringLength(200)] + public string? ElementFeature { get; set; } + + [StringLength(100)] + public string? ElementIconClass { get; set; } + + public bool? ElementIsGlobalApplication { get; set; } + + public bool? ElementCheckModuleReadPermission { get; set; } + + public string? ElementAccessCondition { get; set; } + + public string? ElementVisibilityCondition { get; set; } + + public bool ElementRequiresGlobalAdminPriviligeLevel { get; set; } + + [InverseProperty("HelpTopicUielement")] + public virtual ICollection CmsHelpTopics { get; set; } = new List(); + + [ForeignKey("ElementPageTemplateId")] + [InverseProperty("CmsUielements")] + public virtual CmsPageTemplate? ElementPageTemplate { get; set; } + + [ForeignKey("ElementParentId")] + [InverseProperty("InverseElementParent")] + public virtual CmsUielement? ElementParent { get; set; } + + [ForeignKey("ElementResourceId")] + [InverseProperty("CmsUielements")] + public virtual CmsResource ElementResource { get; set; } = null!; + + [InverseProperty("ElementParent")] + public virtual ICollection InverseElementParent { get; set; } = new List(); + + [ForeignKey("ElementId")] + [InverseProperty("Elements")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("ElementId")] + [InverseProperty("ElementsNavigation")] + public virtual ICollection RolesNavigation { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsUser.cs b/Migration.Tool.K11/Models/CmsUser.cs new file mode 100644 index 00000000..00353004 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsUser.cs @@ -0,0 +1,339 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_User")] +[Index("Email", Name = "IX_CMS_User_Email")] +[Index("FullName", Name = "IX_CMS_User_FullName")] +[Index("UserEnabled", "UserIsHidden", Name = "IX_CMS_User_UserEnabled_UserIsHidden")] +[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] +[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] +[Index("UserPrivilegeLevel", Name = "IX_CMS_User_UserPrivilegeLevel")] +public class CmsUser +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [InverseProperty("CommentApprovedByUser")] + public virtual ICollection BlogCommentCommentApprovedByUsers { get; set; } = new List(); + + [InverseProperty("CommentUser")] + public virtual ICollection BlogCommentCommentUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); + + [InverseProperty("BoardUser")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("MessageApprovedByUser")] + public virtual ICollection BoardMessageMessageApprovedByUsers { get; set; } = new List(); + + [InverseProperty("MessageUser")] + public virtual ICollection BoardMessageMessageUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection BoardSubscriptions { get; set; } = new List(); + + [InverseProperty("InitiatedChatRequestUser")] + public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); + + [InverseProperty("ChatUserUser")] + public virtual ICollection ChatUsers { get; set; } = new List(); + + [InverseProperty("ReportUser")] + public virtual ICollection CmsAbuseReports { get; set; } = new List(); + + [InverseProperty("LastModifiedByUser")] + public virtual ICollection CmsAclitemLastModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsAclitemUsers { get; set; } = new List(); + + [InverseProperty("HistoryApprovedByUser")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateUser")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("CategoryUser")] + public virtual ICollection CmsCategories { get; set; } = new List(); + + [InverseProperty("DocumentCheckedOutByUser")] + public virtual ICollection CmsDocumentDocumentCheckedOutByUsers { get; set; } = new List(); + + [InverseProperty("DocumentCreatedByUser")] + public virtual ICollection CmsDocumentDocumentCreatedByUsers { get; set; } = new List(); + + [InverseProperty("DocumentModifiedByUser")] + public virtual ICollection CmsDocumentDocumentModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsEmailUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsExternalLogins { get; set; } = new List(); + + [InverseProperty("MacroIdentityEffectiveUser")] + public virtual ICollection CmsMacroIdentities { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsMembershipUsers { get; set; } = new List(); + + [InverseProperty("ObjectCheckedOutByUser")] + public virtual ICollection CmsObjectSettings { get; set; } = new List(); + + [InverseProperty("VersionDeletedByUser")] + public virtual ICollection CmsObjectVersionHistoryVersionDeletedByUsers { get; set; } = new List(); + + [InverseProperty("VersionModifiedByUser")] + public virtual ICollection CmsObjectVersionHistoryVersionModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsOpenIdusers { get; set; } = new List(); + + [InverseProperty("PersonalizationUser")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [InverseProperty("TaskUser")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("SessionUser")] + public virtual ICollection CmsSessions { get; set; } = new List(); + + [InverseProperty("SubmissionSubmittedByUser")] + public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); + + [InverseProperty("NodeOwnerNavigation")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("UserMacroIdentityUser")] + public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } + + [InverseProperty("User")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("UserActivatedByUser")] + public virtual ICollection CmsUserSettingUserActivatedByUsers { get; set; } = new List(); + + [InverseProperty("UserSettingsUserNavigation")] + public virtual CmsUserSetting? CmsUserSettingUserSettingsUserNavigation { get; set; } + + public virtual ICollection CmsUserSettingUserSettingsUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsUserSites { get; set; } = new List(); + + [InverseProperty("ModifiedByUser")] + public virtual ICollection CmsVersionHistoryModifiedByUsers { get; set; } = new List(); + + [InverseProperty("VersionDeletedByUser")] + public virtual ICollection CmsVersionHistoryVersionDeletedByUsers { get; set; } = new List(); + + [InverseProperty("ApprovedByUser")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); + + [InverseProperty("CustomerUser")] + public virtual ICollection ComCustomers { get; set; } = new List(); + + [InverseProperty("ChangedByUser")] + public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); + + [InverseProperty("OrderCreatedByUser")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartUser")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("FriendApprovedByNavigation")] + public virtual ICollection CommunityFriendFriendApprovedByNavigations { get; set; } = new List(); + + [InverseProperty("FriendRejectedByNavigation")] + public virtual ICollection CommunityFriendFriendRejectedByNavigations { get; set; } = new List(); + + [InverseProperty("FriendRequestedUser")] + public virtual ICollection CommunityFriendFriendRequestedUsers { get; set; } = new List(); + + [InverseProperty("FriendUser")] + public virtual ICollection CommunityFriendFriendUsers { get; set; } = new List(); + + [InverseProperty("GroupApprovedByUser")] + public virtual ICollection CommunityGroupGroupApprovedByUsers { get; set; } = new List(); + + [InverseProperty("GroupCreatedByUser")] + public virtual ICollection CommunityGroupGroupCreatedByUsers { get; set; } = new List(); + + [InverseProperty("MemberApprovedByUser")] + public virtual ICollection CommunityGroupMemberMemberApprovedByUsers { get; set; } = new List(); + + [InverseProperty("MemberInvitedByUser")] + public virtual ICollection CommunityGroupMemberMemberInvitedByUsers { get; set; } = new List(); + + [InverseProperty("MemberUser")] + public virtual ICollection CommunityGroupMemberMemberUsers { get; set; } = new List(); + + [InverseProperty("InvitedByUser")] + public virtual ICollection CommunityInvitationInvitedByUsers { get; set; } = new List(); + + [InverseProperty("InvitedUser")] + public virtual ICollection CommunityInvitationInvitedUsers { get; set; } = new List(); + + [InverseProperty("ExportUser")] + public virtual ICollection ExportHistories { get; set; } = new List(); + + [InverseProperty("PostApprovedByUser")] + public virtual ICollection ForumsForumPostPostApprovedByUsers { get; set; } = new List(); + + [InverseProperty("PostUser")] + public virtual ICollection ForumsForumPostPostUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [InverseProperty("FileCreatedByUser")] + public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); + + [InverseProperty("FileModifiedByUser")] + public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); + + [InverseProperty("MessageRecipientUser")] + public virtual ICollection MessagingMessageMessageRecipientUsers { get; set; } = new List(); + + [InverseProperty("MessageSenderUser")] + public virtual ICollection MessagingMessageMessageSenderUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("AccountOwnerUser")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactOwnerUser")] + public virtual ICollection OmContacts { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionUser")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("SavedReportCreatedByUser")] + public virtual ICollection ReportingSavedReports { get; set; } = new List(); + + [InverseProperty("User")] + public virtual StagingTaskGroupUser? StagingTaskGroupUser { get; set; } + + [InverseProperty("User")] + public virtual ICollection StagingTaskUsers { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Boards { get; set; } = new List(); + + [ForeignKey("ContactListUserId")] + [InverseProperty("ContactListUsers")] + public virtual ICollection ContactListContactUsers { get; set; } = new List(); + + [ForeignKey("ContactListContactUserId")] + [InverseProperty("ContactListContactUsers")] + public virtual ICollection ContactListUsers { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Forums { get; set; } = new List(); + + [ForeignKey("IgnoreListUserId")] + [InverseProperty("IgnoreListUsers")] + public virtual ICollection IgnoreListIgnoredUsers { get; set; } = new List(); + + [ForeignKey("IgnoreListIgnoredUserId")] + [InverseProperty("IgnoreListIgnoredUsers")] + public virtual ICollection IgnoreListUsers { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Workflows { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsUserCulture.cs b/Migration.Tool.K11/Models/CmsUserCulture.cs new file mode 100644 index 00000000..fbff0bfa --- /dev/null +++ b/Migration.Tool.K11/Models/CmsUserCulture.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[PrimaryKey("UserId", "CultureId", "SiteId")] +[Table("CMS_UserCulture")] +[Index("CultureId", Name = "IX_CMS_UserCulture_CultureID")] +[Index("SiteId", Name = "IX_CMS_UserCulture_SiteID")] +public class CmsUserCulture +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("CultureId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsCulture Culture { get; set; } = null!; + + [ForeignKey("SiteId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsUserMacroIdentity.cs b/Migration.Tool.K11/Models/CmsUserMacroIdentity.cs new file mode 100644 index 00000000..b47d4a2c --- /dev/null +++ b/Migration.Tool.K11/Models/CmsUserMacroIdentity.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_UserMacroIdentity")] +[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] +[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] +public class CmsUserMacroIdentity +{ + [Key] + [Column("UserMacroIdentityID")] + public int UserMacroIdentityId { get; set; } + + public DateTime UserMacroIdentityLastModified { get; set; } + + [Column("UserMacroIdentityUserID")] + public int UserMacroIdentityUserId { get; set; } + + [Column("UserMacroIdentityMacroIdentityID")] + public int? UserMacroIdentityMacroIdentityId { get; set; } + + public Guid UserMacroIdentityUserGuid { get; set; } + + [ForeignKey("UserMacroIdentityMacroIdentityId")] + [InverseProperty("CmsUserMacroIdentities")] + public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } + + [ForeignKey("UserMacroIdentityUserId")] + [InverseProperty("CmsUserMacroIdentity")] + public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsUserRole.cs b/Migration.Tool.K11/Models/CmsUserRole.cs new file mode 100644 index 00000000..1eff1126 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsUserRole.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_UserRole")] +[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] +[Index("RoleId", "ValidTo", "UserId", Name = "IX_CMS_UserRole_UserID")] +[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] +public class CmsUserRole +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } + + [Key] + [Column("UserRoleID")] + public int UserRoleId { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsUserSetting.cs b/Migration.Tool.K11/Models/CmsUserSetting.cs new file mode 100644 index 00000000..6a3c7487 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsUserSetting.cs @@ -0,0 +1,170 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_UserSettings")] +[Index("UserActivatedByUserId", Name = "IX_CMS_UserSettings_UserActivatedByUserID")] +[Index("UserAuthenticationGuid", Name = "IX_CMS_UserSettings_UserAuthenticationGUID")] +[Index("UserAvatarId", Name = "IX_CMS_UserSettings_UserAvatarID")] +[Index("UserBadgeId", Name = "IX_CMS_UserSettings_UserBadgeID")] +[Index("UserFacebookId", Name = "IX_CMS_UserSettings_UserFacebookID")] +[Index("UserGender", Name = "IX_CMS_UserSettings_UserGender")] +[Index("UserNickName", Name = "IX_CMS_UserSettings_UserNickName")] +[Index("UserPasswordRequestHash", Name = "IX_CMS_UserSettings_UserPasswordRequestHash")] +[Index("UserSettingsUserGuid", Name = "IX_CMS_UserSettings_UserSettingsUserGUID")] +[Index("UserSettingsUserId", Name = "IX_CMS_UserSettings_UserSettingsUserID", IsUnique = true)] +[Index("UserTimeZoneId", Name = "IX_CMS_UserSettings_UserTimeZoneID")] +[Index("UserWaitingForApproval", Name = "IX_CMS_UserSettings_UserWaitingForApproval")] +[Index("WindowsLiveId", Name = "IX_CMS_UserSettings_WindowsLiveID")] +public class CmsUserSetting +{ + [Key] + [Column("UserSettingsID")] + public int UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + [StringLength(200)] + public string? UserMessagingNotificationEmail { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [ForeignKey("UserActivatedByUserId")] + [InverseProperty("CmsUserSettingUserActivatedByUsers")] + public virtual CmsUser? UserActivatedByUser { get; set; } + + [ForeignKey("UserAvatarId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsAvatar? UserAvatar { get; set; } + + [ForeignKey("UserBadgeId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsBadge? UserBadge { get; set; } + + public virtual CmsUser UserSettingsUser { get; set; } = null!; + + [ForeignKey("UserSettingsUserId")] + [InverseProperty("CmsUserSettingUserSettingsUserNavigation")] + public virtual CmsUser UserSettingsUserNavigation { get; set; } = null!; + + [ForeignKey("UserTimeZoneId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsTimeZone? UserTimeZone { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsUserSite.cs b/Migration.Tool.K11/Models/CmsUserSite.cs new file mode 100644 index 00000000..26718a76 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsUserSite.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_UserSite")] +[Index("SiteId", Name = "IX_CMS_UserSite_SiteID")] +[Index("UserId", "SiteId", Name = "IX_CMS_UserSite_UserID_SiteID", IsUnique = true)] +public class CmsUserSite +{ + [Key] + [Column("UserSiteID")] + public int UserSiteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsUserSites")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserSites")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsVersionHistory.cs b/Migration.Tool.K11/Models/CmsVersionHistory.cs new file mode 100644 index 00000000..feaaf6bb --- /dev/null +++ b/Migration.Tool.K11/Models/CmsVersionHistory.cs @@ -0,0 +1,116 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_VersionHistory")] +[Index("ModifiedByUserId", Name = "IX_CMS_VersionHistory_ModifiedByUserID")] +[Index("NodeSiteId", Name = "IX_CMS_VersionHistory_NodeSiteID")] +[Index("ToBePublished", "PublishFrom", "PublishTo", Name = "IX_CMS_VersionHistory_ToBePublished_PublishFrom_PublishTo")] +[Index("VersionClassId", Name = "IX_CMS_VersionHistory_VersionClassID")] +[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_VersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionWorkflowId", Name = "IX_CMS_VersionHistory_VersionWorkflowID")] +[Index("VersionWorkflowStepId", Name = "IX_CMS_VersionHistory_VersionWorkflowStepID")] +public class CmsVersionHistory +{ + [Key] + [Column("VersionHistoryID")] + public int VersionHistoryId { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("DocumentID")] + public int? DocumentId { get; set; } + + [StringLength(450)] + public string DocumentNamePath { get; set; } = null!; + + [Column("NodeXML")] + public string NodeXml { get; set; } = null!; + + [Column("ModifiedByUserID")] + public int? ModifiedByUserId { get; set; } + + public DateTime ModifiedWhen { get; set; } + + [StringLength(50)] + public string? VersionNumber { get; set; } + + public string? VersionComment { get; set; } + + public bool ToBePublished { get; set; } + + public DateTime? PublishFrom { get; set; } + + public DateTime? PublishTo { get; set; } + + public DateTime? WasPublishedFrom { get; set; } + + public DateTime? WasPublishedTo { get; set; } + + [StringLength(100)] + public string? VersionDocumentName { get; set; } + + [StringLength(50)] + public string? VersionDocumentType { get; set; } + + [Column("VersionClassID")] + public int? VersionClassId { get; set; } + + [StringLength(450)] + public string? VersionMenuRedirectUrl { get; set; } + + [Column("VersionWorkflowID")] + public int? VersionWorkflowId { get; set; } + + [Column("VersionWorkflowStepID")] + public int? VersionWorkflowStepId { get; set; } + + [StringLength(450)] + public string? VersionNodeAliasPath { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [InverseProperty("DocumentCheckedOutVersionHistory")] + public virtual ICollection CmsDocumentDocumentCheckedOutVersionHistories { get; set; } = new List(); + + [InverseProperty("DocumentPublishedVersionHistory")] + public virtual ICollection CmsDocumentDocumentPublishedVersionHistories { get; set; } = new List(); + + [InverseProperty("VersionHistory")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [ForeignKey("ModifiedByUserId")] + [InverseProperty("CmsVersionHistoryModifiedByUsers")] + public virtual CmsUser? ModifiedByUser { get; set; } + + [ForeignKey("NodeSiteId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsSite NodeSite { get; set; } = null!; + + [ForeignKey("VersionClassId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsClass? VersionClass { get; set; } + + [ForeignKey("VersionDeletedByUserId")] + [InverseProperty("CmsVersionHistoryVersionDeletedByUsers")] + public virtual CmsUser? VersionDeletedByUser { get; set; } + + [ForeignKey("VersionWorkflowId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsWorkflow? VersionWorkflow { get; set; } + + [ForeignKey("VersionWorkflowStepId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsWorkflowStep? VersionWorkflowStep { get; set; } + + [ForeignKey("VersionHistoryId")] + [InverseProperty("VersionHistories")] + public virtual ICollection AttachmentHistories { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsWebFarmServer.cs b/Migration.Tool.K11/Models/CmsWebFarmServer.cs new file mode 100644 index 00000000..f66c4c0a --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWebFarmServer.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WebFarmServer")] +[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] +public class CmsWebFarmServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(300)] + public string ServerDisplayName { get; set; } = null!; + + [StringLength(300)] + public string ServerName { get; set; } = null!; + + [Column("ServerGUID")] + public Guid? ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public bool ServerEnabled { get; set; } + + public bool IsExternalWebAppServer { get; set; } + + [InverseProperty("Server")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsWebFarmServerLog.cs b/Migration.Tool.K11/Models/CmsWebFarmServerLog.cs new file mode 100644 index 00000000..c1ff3575 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWebFarmServerLog.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WebFarmServerLog")] +public class CmsWebFarmServerLog +{ + [Key] + [Column("WebFarmServerLogID")] + public int WebFarmServerLogId { get; set; } + + public DateTime LogTime { get; set; } + + [StringLength(200)] + public string LogCode { get; set; } = null!; + + [Column("ServerID")] + public int ServerId { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsWebFarmServerMonitoring.cs b/Migration.Tool.K11/Models/CmsWebFarmServerMonitoring.cs new file mode 100644 index 00000000..ce46835a --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWebFarmServerMonitoring.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WebFarmServerMonitoring")] +public class CmsWebFarmServerMonitoring +{ + [Key] + [Column("WebFarmServerMonitoringID")] + public int WebFarmServerMonitoringId { get; set; } + + [Column("ServerID")] + public int ServerId { get; set; } + + public DateTime? ServerPing { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsWebFarmServerTask.cs b/Migration.Tool.K11/Models/CmsWebFarmServerTask.cs new file mode 100644 index 00000000..8120b0c7 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWebFarmServerTask.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[PrimaryKey("ServerId", "TaskId")] +[Table("CMS_WebFarmServerTask")] +[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] +public class CmsWebFarmServerTask +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + public string? ErrorMessage { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmServer Server { get; set; } = null!; + + [ForeignKey("TaskId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmTask Task { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsWebFarmTask.cs b/Migration.Tool.K11/Models/CmsWebFarmTask.cs new file mode 100644 index 00000000..2b80aba3 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWebFarmTask.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WebFarmTask")] +[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] +public class CmsWebFarmTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + public string? TaskTextData { get; set; } + + public byte[]? TaskBinaryData { get; set; } + + public DateTime? TaskCreated { get; set; } + + public string? TaskTarget { get; set; } + + [StringLength(450)] + public string? TaskMachineName { get; set; } + + [Column("TaskGUID")] + public Guid? TaskGuid { get; set; } + + public bool? TaskIsAnonymous { get; set; } + + public string? TaskErrorMessage { get; set; } + + public bool? TaskIsMemory { get; set; } + + [InverseProperty("Task")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsWebPart.cs b/Migration.Tool.K11/Models/CmsWebPart.cs new file mode 100644 index 00000000..a9ef0ddc --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWebPart.cs @@ -0,0 +1,85 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WebPart")] +[Index("WebPartCategoryId", Name = "IX_CMS_WebPart_WebPartCategoryID")] +[Index("WebPartName", Name = "IX_CMS_WebPart_WebPartName")] +[Index("WebPartParentId", Name = "IX_CMS_WebPart_WebPartParentID")] +[Index("WebPartResourceId", Name = "IX_CMS_WebPart_WebPartResourceID")] +public class CmsWebPart +{ + [Key] + [Column("WebPartID")] + public int WebPartId { get; set; } + + [StringLength(100)] + public string WebPartName { get; set; } = null!; + + [StringLength(100)] + public string WebPartDisplayName { get; set; } = null!; + + public string? WebPartDescription { get; set; } + + [StringLength(100)] + public string WebPartFileName { get; set; } = null!; + + public string WebPartProperties { get; set; } = null!; + + [Column("WebPartCategoryID")] + public int WebPartCategoryId { get; set; } + + [Column("WebPartParentID")] + public int? WebPartParentId { get; set; } + + public string? WebPartDocumentation { get; set; } + + [Column("WebPartGUID")] + public Guid WebPartGuid { get; set; } + + public DateTime WebPartLastModified { get; set; } + + public int? WebPartType { get; set; } + + public string? WebPartDefaultValues { get; set; } + + [Column("WebPartResourceID")] + public int? WebPartResourceId { get; set; } + + [Column("WebPartCSS")] + public string? WebPartCss { get; set; } + + public bool? WebPartSkipInsertProperties { get; set; } + + [Column("WebPartThumbnailGUID")] + public Guid? WebPartThumbnailGuid { get; set; } + + public string? WebPartDefaultConfiguration { get; set; } + + [StringLength(200)] + public string? WebPartIconClass { get; set; } + + [InverseProperty("WebPartLayoutWebPart")] + public virtual ICollection CmsWebPartLayouts { get; set; } = new List(); + + [InverseProperty("WidgetWebPart")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [InverseProperty("WebPartParent")] + public virtual ICollection InverseWebPartParent { get; set; } = new List(); + + [ForeignKey("WebPartCategoryId")] + [InverseProperty("CmsWebParts")] + public virtual CmsWebPartCategory WebPartCategory { get; set; } = null!; + + [ForeignKey("WebPartParentId")] + [InverseProperty("InverseWebPartParent")] + public virtual CmsWebPart? WebPartParent { get; set; } + + [ForeignKey("WebPartResourceId")] + [InverseProperty("CmsWebParts")] + public virtual CmsResource? WebPartResource { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsWebPartCategory.cs b/Migration.Tool.K11/Models/CmsWebPartCategory.cs new file mode 100644 index 00000000..198410fa --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWebPartCategory.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WebPartCategory")] +[Index("CategoryParentId", Name = "IX_CMS_WebPartCategory_CategoryParentID")] +public class CmsWebPartCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(100)] + public string CategoryDisplayName { get; set; } = null!; + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(100)] + public string CategoryName { get; set; } = null!; + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public string CategoryPath { get; set; } = null!; + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryWebPartChildCount { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsWebPartCategory? CategoryParent { get; set; } + + [InverseProperty("WebPartCategory")] + public virtual ICollection CmsWebParts { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsWebPartContainer.cs b/Migration.Tool.K11/Models/CmsWebPartContainer.cs new file mode 100644 index 00000000..518fedd5 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWebPartContainer.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WebPartContainer")] +[Index("ContainerName", Name = "IX_CMS_WebPartContainer_ContainerName")] +public class CmsWebPartContainer +{ + [Key] + [Column("ContainerID")] + public int ContainerId { get; set; } + + [StringLength(200)] + public string ContainerDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ContainerName { get; set; } = null!; + + public string? ContainerTextBefore { get; set; } + + public string? ContainerTextAfter { get; set; } + + [Column("ContainerGUID")] + public Guid ContainerGuid { get; set; } + + public DateTime ContainerLastModified { get; set; } + + [Column("ContainerCSS")] + public string? ContainerCss { get; set; } + + [ForeignKey("ContainerId")] + [InverseProperty("Containers")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsWebPartLayout.cs b/Migration.Tool.K11/Models/CmsWebPartLayout.cs new file mode 100644 index 00000000..a28df70a --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWebPartLayout.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WebPartLayout")] +[Index("WebPartLayoutWebPartId", Name = "IX_CMS_WebPartLayout_WebPartLayoutWebPartID")] +public class CmsWebPartLayout +{ + [Key] + [Column("WebPartLayoutID")] + public int WebPartLayoutId { get; set; } + + [StringLength(200)] + public string WebPartLayoutCodeName { get; set; } = null!; + + [StringLength(200)] + public string WebPartLayoutDisplayName { get; set; } = null!; + + public string? WebPartLayoutDescription { get; set; } + + public string? WebPartLayoutCode { get; set; } + + [Column("WebPartLayoutVersionGUID")] + [StringLength(100)] + public string? WebPartLayoutVersionGuid { get; set; } + + [Column("WebPartLayoutWebPartID")] + public int WebPartLayoutWebPartId { get; set; } + + [Column("WebPartLayoutGUID")] + public Guid WebPartLayoutGuid { get; set; } + + public DateTime WebPartLayoutLastModified { get; set; } + + [Column("WebPartLayoutCSS")] + public string? WebPartLayoutCss { get; set; } + + public bool? WebPartLayoutIsDefault { get; set; } + + [InverseProperty("WidgetLayout")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [ForeignKey("WebPartLayoutWebPartId")] + [InverseProperty("CmsWebPartLayouts")] + public virtual CmsWebPart WebPartLayoutWebPart { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsWebTemplate.cs b/Migration.Tool.K11/Models/CmsWebTemplate.cs new file mode 100644 index 00000000..0e4daadc --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWebTemplate.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WebTemplate")] +public class CmsWebTemplate +{ + [Key] + [Column("WebTemplateID")] + public int WebTemplateId { get; set; } + + [StringLength(200)] + public string WebTemplateDisplayName { get; set; } = null!; + + [StringLength(100)] + public string WebTemplateFileName { get; set; } = null!; + + public string WebTemplateDescription { get; set; } = null!; + + [Column("WebTemplateGUID")] + public Guid WebTemplateGuid { get; set; } + + public DateTime WebTemplateLastModified { get; set; } + + [StringLength(100)] + public string WebTemplateName { get; set; } = null!; + + public int WebTemplateOrder { get; set; } + + [StringLength(200)] + public string WebTemplateLicenses { get; set; } = null!; + + [Column("WebTemplateThumbnailGUID")] + public Guid? WebTemplateThumbnailGuid { get; set; } + + public string? WebTemplateShortDescription { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsWidget.cs b/Migration.Tool.K11/Models/CmsWidget.cs new file mode 100644 index 00000000..93b073a0 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWidget.cs @@ -0,0 +1,83 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Widget")] +[Index("WidgetCategoryId", Name = "IX_CMS_Widget_WidgetCategoryID")] +[Index("WidgetIsEnabled", "WidgetForGroup", "WidgetForEditor", "WidgetForUser", Name = "IX_CMS_Widget_WidgetIsEnabled_WidgetForGroup_WidgetForEditor_WidgetForUser")] +[Index("WidgetLayoutId", Name = "IX_CMS_Widget_WidgetLayoutID")] +[Index("WidgetWebPartId", Name = "IX_CMS_Widget_WidgetWebPartID")] +public class CmsWidget +{ + [Key] + [Column("WidgetID")] + public int WidgetId { get; set; } + + [Column("WidgetWebPartID")] + public int WidgetWebPartId { get; set; } + + [StringLength(100)] + public string WidgetDisplayName { get; set; } = null!; + + [StringLength(100)] + public string WidgetName { get; set; } = null!; + + public string? WidgetDescription { get; set; } + + [Column("WidgetCategoryID")] + public int WidgetCategoryId { get; set; } + + public string? WidgetProperties { get; set; } + + public int WidgetSecurity { get; set; } + + [Column("WidgetGUID")] + public Guid WidgetGuid { get; set; } + + public DateTime WidgetLastModified { get; set; } + + public bool WidgetIsEnabled { get; set; } + + public bool WidgetForGroup { get; set; } + + public bool WidgetForEditor { get; set; } + + public bool WidgetForUser { get; set; } + + public bool WidgetForDashboard { get; set; } + + public bool WidgetForInline { get; set; } + + public string? WidgetDocumentation { get; set; } + + public string? WidgetDefaultValues { get; set; } + + [Column("WidgetLayoutID")] + public int? WidgetLayoutId { get; set; } + + public bool? WidgetSkipInsertProperties { get; set; } + + [Column("WidgetThumbnailGUID")] + public Guid? WidgetThumbnailGuid { get; set; } + + [StringLength(200)] + public string? WidgetIconClass { get; set; } + + [InverseProperty("Widget")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [ForeignKey("WidgetCategoryId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWidgetCategory WidgetCategory { get; set; } = null!; + + [ForeignKey("WidgetLayoutId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWebPartLayout? WidgetLayout { get; set; } + + [ForeignKey("WidgetWebPartId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWebPart WidgetWebPart { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsWidgetCategory.cs b/Migration.Tool.K11/Models/CmsWidgetCategory.cs new file mode 100644 index 00000000..ccf1e615 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWidgetCategory.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WidgetCategory")] +[Index("WidgetCategoryParentId", Name = "IX_CMS_WidgetCategory_WidgetCategoryParentID")] +public class CmsWidgetCategory +{ + [Key] + [Column("WidgetCategoryID")] + public int WidgetCategoryId { get; set; } + + [StringLength(100)] + public string WidgetCategoryName { get; set; } = null!; + + [StringLength(100)] + public string WidgetCategoryDisplayName { get; set; } = null!; + + [Column("WidgetCategoryParentID")] + public int? WidgetCategoryParentId { get; set; } + + public string WidgetCategoryPath { get; set; } = null!; + + public int WidgetCategoryLevel { get; set; } + + public int? WidgetCategoryChildCount { get; set; } + + public int? WidgetCategoryWidgetChildCount { get; set; } + + [StringLength(450)] + public string? WidgetCategoryImagePath { get; set; } + + [Column("WidgetCategoryGUID")] + public Guid WidgetCategoryGuid { get; set; } + + public DateTime WidgetCategoryLastModified { get; set; } + + [InverseProperty("WidgetCategory")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [InverseProperty("WidgetCategoryParent")] + public virtual ICollection InverseWidgetCategoryParent { get; set; } = new List(); + + [ForeignKey("WidgetCategoryParentId")] + [InverseProperty("InverseWidgetCategoryParent")] + public virtual CmsWidgetCategory? WidgetCategoryParent { get; set; } +} diff --git a/Migration.Tool.K11/Models/CmsWidgetRole.cs b/Migration.Tool.K11/Models/CmsWidgetRole.cs new file mode 100644 index 00000000..9e4e03c6 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWidgetRole.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[PrimaryKey("WidgetId", "RoleId", "PermissionId")] +[Table("CMS_WidgetRole")] +[Index("PermissionId", Name = "IX_CMS_WidgetRole_PermissionID")] +[Index("RoleId", Name = "IX_CMS_WidgetRole_RoleID")] +public class CmsWidgetRole +{ + [Key] + [Column("WidgetID")] + public int WidgetId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("PermissionId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("WidgetId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsWidget Widget { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsWorkflow.cs b/Migration.Tool.K11/Models/CmsWorkflow.cs new file mode 100644 index 00000000..db428055 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWorkflow.cs @@ -0,0 +1,93 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_Workflow")] +public class CmsWorkflow +{ + [Key] + [Column("WorkflowID")] + public int WorkflowId { get; set; } + + public string WorkflowDisplayName { get; set; } = null!; + + [StringLength(450)] + public string WorkflowName { get; set; } = null!; + + [Column("WorkflowGUID")] + public Guid WorkflowGuid { get; set; } + + public DateTime WorkflowLastModified { get; set; } + + public bool? WorkflowAutoPublishChanges { get; set; } + + public bool? WorkflowUseCheckinCheckout { get; set; } + + public int? WorkflowType { get; set; } + + public bool? WorkflowSendEmails { get; set; } + + public bool? WorkflowSendApproveEmails { get; set; } + + public bool? WorkflowSendRejectEmails { get; set; } + + public bool? WorkflowSendPublishEmails { get; set; } + + public bool? WorkflowSendArchiveEmails { get; set; } + + [StringLength(200)] + public string? WorkflowApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowPublishedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowArchivedTemplateName { get; set; } + + public bool? WorkflowSendReadyForApprovalEmails { get; set; } + + [StringLength(200)] + public string? WorkflowReadyForApprovalTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowNotificationTemplateName { get; set; } + + public string? WorkflowAllowedObjects { get; set; } + + public int? WorkflowRecurrenceType { get; set; } + + [Required] + public bool? WorkflowEnabled { get; set; } + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateWorkflow")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("TriggerWorkflow")] + public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); + + [InverseProperty("VersionWorkflow")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [InverseProperty("ScopeWorkflow")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [InverseProperty("StepWorkflow")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); + + [InverseProperty("TransitionWorkflow")] + public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); + + [ForeignKey("WorkflowId")] + [InverseProperty("Workflows")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsWorkflowAction.cs b/Migration.Tool.K11/Models/CmsWorkflowAction.cs new file mode 100644 index 00000000..42cee425 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWorkflowAction.cs @@ -0,0 +1,65 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WorkflowAction")] +[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] +public class CmsWorkflowAction +{ + [Key] + [Column("ActionID")] + public int ActionId { get; set; } + + [StringLength(200)] + public string ActionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ActionName { get; set; } = null!; + + public string? ActionParameters { get; set; } + + public string? ActionDescription { get; set; } + + [StringLength(200)] + public string ActionAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string ActionClass { get; set; } = null!; + + [Column("ActionResourceID")] + public int? ActionResourceId { get; set; } + + [Column("ActionThumbnailGUID")] + public Guid? ActionThumbnailGuid { get; set; } + + [Column("ActionGUID")] + public Guid ActionGuid { get; set; } + + public DateTime ActionLastModified { get; set; } + + [Required] + public bool? ActionEnabled { get; set; } + + public string? ActionAllowedObjects { get; set; } + + [Column("ActionIconGUID")] + public Guid? ActionIconGuid { get; set; } + + public int? ActionWorkflowType { get; set; } + + [StringLength(200)] + public string? ActionIconClass { get; set; } + + [StringLength(200)] + public string? ActionThumbnailClass { get; set; } + + [ForeignKey("ActionResourceId")] + [InverseProperty("CmsWorkflowActions")] + public virtual CmsResource? ActionResource { get; set; } + + [InverseProperty("StepAction")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CmsWorkflowHistory.cs b/Migration.Tool.K11/Models/CmsWorkflowHistory.cs new file mode 100644 index 00000000..342b7047 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWorkflowHistory.cs @@ -0,0 +1,87 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WorkflowHistory")] +[Index("ApprovedByUserId", Name = "IX_CMS_WorkflowHistory_ApprovedByUserID")] +[Index("ApprovedWhen", Name = "IX_CMS_WorkflowHistory_ApprovedWhen")] +[Index("HistoryWorkflowId", Name = "IX_CMS_WorkflowHistory_HistoryWorkflowID")] +[Index("StepId", Name = "IX_CMS_WorkflowHistory_StepID")] +[Index("TargetStepId", Name = "IX_CMS_WorkflowHistory_TargetStepID")] +[Index("VersionHistoryId", Name = "IX_CMS_WorkflowHistory_VersionHistoryID")] +public class CmsWorkflowHistory +{ + [Key] + [Column("WorkflowHistoryID")] + public int WorkflowHistoryId { get; set; } + + [Column("VersionHistoryID")] + public int VersionHistoryId { get; set; } + + [Column("StepID")] + public int? StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [Column("ApprovedByUserID")] + public int? ApprovedByUserId { get; set; } + + public DateTime? ApprovedWhen { get; set; } + + public string? Comment { get; set; } + + public bool WasRejected { get; set; } + + [StringLength(440)] + public string? StepName { get; set; } + + [Column("TargetStepID")] + public int? TargetStepId { get; set; } + + [StringLength(440)] + public string? TargetStepName { get; set; } + + [StringLength(450)] + public string? TargetStepDisplayName { get; set; } + + public int? StepType { get; set; } + + public int? TargetStepType { get; set; } + + [StringLength(100)] + public string? HistoryObjectType { get; set; } + + [Column("HistoryObjectID")] + public int? HistoryObjectId { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int? HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + [ForeignKey("ApprovedByUserId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsUser? ApprovedByUser { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsWorkflow? HistoryWorkflow { get; set; } + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowHistorySteps")] + public virtual CmsWorkflowStep? Step { get; set; } + + [ForeignKey("TargetStepId")] + [InverseProperty("CmsWorkflowHistoryTargetSteps")] + public virtual CmsWorkflowStep? TargetStep { get; set; } + + [ForeignKey("VersionHistoryId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsVersionHistory VersionHistory { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsWorkflowScope.cs b/Migration.Tool.K11/Models/CmsWorkflowScope.cs new file mode 100644 index 00000000..30002189 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWorkflowScope.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WorkflowScope")] +[Index("ScopeClassId", Name = "IX_CMS_WorkflowScope_ScopeClassID")] +[Index("ScopeCultureId", Name = "IX_CMS_WorkflowScope_ScopeCultureID")] +[Index("ScopeSiteId", Name = "IX_CMS_WorkflowScope_ScopeSiteID")] +[Index("ScopeWorkflowId", Name = "IX_CMS_WorkflowScope_ScopeWorkflowID")] +public class CmsWorkflowScope +{ + [Key] + [Column("ScopeID")] + public int ScopeId { get; set; } + + public string ScopeStartingPath { get; set; } = null!; + + [Column("ScopeWorkflowID")] + public int ScopeWorkflowId { get; set; } + + [Column("ScopeClassID")] + public int? ScopeClassId { get; set; } + + [Column("ScopeSiteID")] + public int ScopeSiteId { get; set; } + + [Column("ScopeGUID")] + public Guid ScopeGuid { get; set; } + + public DateTime ScopeLastModified { get; set; } + + [Column("ScopeCultureID")] + public int? ScopeCultureId { get; set; } + + public bool? ScopeExcludeChildren { get; set; } + + public bool ScopeExcluded { get; set; } + + public string? ScopeMacroCondition { get; set; } + + [ForeignKey("ScopeClassId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsClass? ScopeClass { get; set; } + + [ForeignKey("ScopeCultureId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsCulture? ScopeCulture { get; set; } + + [ForeignKey("ScopeSiteId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsSite ScopeSite { get; set; } = null!; + + [ForeignKey("ScopeWorkflowId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsWorkflow ScopeWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsWorkflowStep.cs b/Migration.Tool.K11/Models/CmsWorkflowStep.cs new file mode 100644 index 00000000..5d02a031 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWorkflowStep.cs @@ -0,0 +1,114 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WorkflowStep")] +[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] +[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] +[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] +[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] +public class CmsWorkflowStep +{ + [Key] + [Column("StepID")] + public int StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [StringLength(440)] + public string? StepName { get; set; } + + public int? StepOrder { get; set; } + + [Column("StepWorkflowID")] + public int StepWorkflowId { get; set; } + + [Column("StepGUID")] + public Guid StepGuid { get; set; } + + public DateTime StepLastModified { get; set; } + + public int? StepType { get; set; } + + public bool? StepAllowReject { get; set; } + + public string? StepDefinition { get; set; } + + public int? StepRolesSecurity { get; set; } + + public int? StepUsersSecurity { get; set; } + + [StringLength(200)] + public string? StepApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? StepRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? StepReadyforApprovalTemplateName { get; set; } + + public bool? StepSendApproveEmails { get; set; } + + public bool? StepSendRejectEmails { get; set; } + + public bool? StepSendReadyForApprovalEmails { get; set; } + + public bool? StepSendEmails { get; set; } + + public bool? StepAllowPublish { get; set; } + + [Column("StepActionID")] + public int? StepActionId { get; set; } + + public string? StepActionParameters { get; set; } + + public int? StepWorkflowType { get; set; } + + [InverseProperty("HistoryStep")] + public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); + + [InverseProperty("HistoryTargetStep")] + public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("StateStep")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("DocumentWorkflowStep")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("ObjectWorkflowStep")] + public virtual ICollection CmsObjectSettings { get; set; } = new List(); + + [InverseProperty("VersionWorkflowStep")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowHistorySteps { get; set; } = new List(); + + [InverseProperty("TargetStep")] + public virtual ICollection CmsWorkflowHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); + + [InverseProperty("TransitionEndStep")] + public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); + + [InverseProperty("TransitionStartStep")] + public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); + + [ForeignKey("StepActionId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflowAction? StepAction { get; set; } + + [ForeignKey("StepWorkflowId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflow StepWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsWorkflowStepRole.cs b/Migration.Tool.K11/Models/CmsWorkflowStepRole.cs new file mode 100644 index 00000000..adcabafc --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWorkflowStepRole.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WorkflowStepRoles")] +[Index("RoleId", Name = "IX_CMS_WorkflowStepRoles_RoleID")] +public class CmsWorkflowStepRole +{ + [Key] + [Column("WorkflowStepRoleID")] + public int WorkflowStepRoleId { get; set; } + + [Column("StepID")] + public int StepId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [Column("StepSourcePointGUID")] + public Guid? StepSourcePointGuid { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsWorkflowStepRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowStepRoles")] + public virtual CmsWorkflowStep Step { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsWorkflowStepUser.cs b/Migration.Tool.K11/Models/CmsWorkflowStepUser.cs new file mode 100644 index 00000000..6d44448c --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWorkflowStepUser.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WorkflowStepUser")] +[Index("UserId", Name = "IX_CMS_WorkflowStepUser_UserID")] +public class CmsWorkflowStepUser +{ + [Key] + [Column("WorkflowStepUserID")] + public int WorkflowStepUserId { get; set; } + + [Column("StepID")] + public int StepId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("StepSourcePointGUID")] + public Guid? StepSourcePointGuid { get; set; } + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowStepUsers")] + public virtual CmsWorkflowStep Step { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsWorkflowStepUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CmsWorkflowTransition.cs b/Migration.Tool.K11/Models/CmsWorkflowTransition.cs new file mode 100644 index 00000000..75749a97 --- /dev/null +++ b/Migration.Tool.K11/Models/CmsWorkflowTransition.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("CMS_WorkflowTransition")] +[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] +[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] +[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] +public class CmsWorkflowTransition +{ + [Key] + [Column("TransitionID")] + public int TransitionId { get; set; } + + [Column("TransitionStartStepID")] + public int TransitionStartStepId { get; set; } + + [Column("TransitionEndStepID")] + public int TransitionEndStepId { get; set; } + + public int TransitionType { get; set; } + + public DateTime TransitionLastModified { get; set; } + + [Column("TransitionSourcePointGUID")] + public Guid? TransitionSourcePointGuid { get; set; } + + [Column("TransitionWorkflowID")] + public int TransitionWorkflowId { get; set; } + + [ForeignKey("TransitionEndStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] + public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; + + [ForeignKey("TransitionStartStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] + public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; + + [ForeignKey("TransitionWorkflowId")] + [InverseProperty("CmsWorkflowTransitions")] + public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComAddress.cs b/Migration.Tool.K11/Models/ComAddress.cs new file mode 100644 index 00000000..6c202344 --- /dev/null +++ b/Migration.Tool.K11/Models/ComAddress.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_Address")] +[Index("AddressCountryId", Name = "IX_COM_Address_AddressCountryID")] +[Index("AddressCustomerId", Name = "IX_COM_Address_AddressCustomerID")] +[Index("AddressStateId", Name = "IX_COM_Address_AddressStateID")] +public class ComAddress +{ + [Key] + [Column("AddressID")] + public int AddressId { get; set; } + + [StringLength(200)] + public string AddressName { get; set; } = null!; + + [StringLength(100)] + public string AddressLine1 { get; set; } = null!; + + [StringLength(100)] + public string? AddressLine2 { get; set; } + + [StringLength(100)] + public string AddressCity { get; set; } = null!; + + [StringLength(20)] + public string AddressZip { get; set; } = null!; + + [StringLength(26)] + public string? AddressPhone { get; set; } + + [Column("AddressCustomerID")] + public int AddressCustomerId { get; set; } + + [Column("AddressCountryID")] + public int AddressCountryId { get; set; } + + [Column("AddressStateID")] + public int? AddressStateId { get; set; } + + [StringLength(200)] + public string AddressPersonalName { get; set; } = null!; + + [Column("AddressGUID")] + public Guid? AddressGuid { get; set; } + + public DateTime AddressLastModified { get; set; } + + [ForeignKey("AddressCountryId")] + [InverseProperty("ComAddresses")] + public virtual CmsCountry AddressCountry { get; set; } = null!; + + [ForeignKey("AddressCustomerId")] + [InverseProperty("ComAddresses")] + public virtual ComCustomer AddressCustomer { get; set; } = null!; + + [ForeignKey("AddressStateId")] + [InverseProperty("ComAddresses")] + public virtual CmsState? AddressState { get; set; } + + [InverseProperty("ShoppingCartBillingAddress")] + public virtual ICollection ComShoppingCartShoppingCartBillingAddresses { get; set; } = new List(); + + [InverseProperty("ShoppingCartCompanyAddress")] + public virtual ICollection ComShoppingCartShoppingCartCompanyAddresses { get; set; } = new List(); + + [InverseProperty("ShoppingCartShippingAddress")] + public virtual ICollection ComShoppingCartShoppingCartShippingAddresses { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ComBrand.cs b/Migration.Tool.K11/Models/ComBrand.cs new file mode 100644 index 00000000..bd0594c5 --- /dev/null +++ b/Migration.Tool.K11/Models/ComBrand.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_Brand")] +[Index("BrandDisplayName", Name = "IX_COM_Brand_BrandDisplayName")] +[Index("BrandSiteId", "BrandEnabled", Name = "IX_COM_Brand_BrandSiteID_BrandEnabled")] +public class ComBrand +{ + [Key] + [Column("BrandID")] + public int BrandId { get; set; } + + [StringLength(200)] + public string BrandDisplayName { get; set; } = null!; + + [StringLength(200)] + public string BrandName { get; set; } = null!; + + public string? BrandDescription { get; set; } + + [StringLength(400)] + public string? BrandHomepage { get; set; } + + [Column("BrandThumbnailGUID")] + public Guid? BrandThumbnailGuid { get; set; } + + [Column("BrandSiteID")] + public int BrandSiteId { get; set; } + + [Required] + public bool? BrandEnabled { get; set; } + + public Guid BrandGuid { get; set; } + + public DateTime BrandLastModified { get; set; } + + [ForeignKey("BrandSiteId")] + [InverseProperty("ComBrands")] + public virtual CmsSite BrandSite { get; set; } = null!; + + [InverseProperty("Brand")] + public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); + + [InverseProperty("Skubrand")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ComCarrier.cs b/Migration.Tool.K11/Models/ComCarrier.cs new file mode 100644 index 00000000..a4060190 --- /dev/null +++ b/Migration.Tool.K11/Models/ComCarrier.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_Carrier")] +[Index("CarrierSiteId", Name = "IX_COM_Carrier_CarrierSiteID")] +public class ComCarrier +{ + [Key] + [Column("CarrierID")] + public int CarrierId { get; set; } + + [StringLength(200)] + public string CarrierDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CarrierName { get; set; } = null!; + + [Column("CarrierSiteID")] + public int CarrierSiteId { get; set; } + + [Column("CarrierGUID")] + public Guid CarrierGuid { get; set; } + + [StringLength(200)] + public string CarrierAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string CarrierClassName { get; set; } = null!; + + public DateTime CarrierLastModified { get; set; } + + [ForeignKey("CarrierSiteId")] + [InverseProperty("ComCarriers")] + public virtual CmsSite CarrierSite { get; set; } = null!; + + [InverseProperty("ShippingOptionCarrier")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ComCollection.cs b/Migration.Tool.K11/Models/ComCollection.cs new file mode 100644 index 00000000..5ee3dde9 --- /dev/null +++ b/Migration.Tool.K11/Models/ComCollection.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_Collection")] +[Index("CollectionDisplayName", Name = "IX_COM_Collection_CollectionDisplayName")] +[Index("CollectionSiteId", "CollectionEnabled", Name = "IX_COM_Collection_CollectionSiteID_CollectionEnabled")] +public class ComCollection +{ + [Key] + [Column("CollectionID")] + public int CollectionId { get; set; } + + [StringLength(200)] + public string CollectionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CollectionName { get; set; } = null!; + + public string? CollectionDescription { get; set; } + + [Column("CollectionSiteID")] + public int CollectionSiteId { get; set; } + + [Required] + public bool? CollectionEnabled { get; set; } + + public Guid CollectionGuid { get; set; } + + public DateTime CollectionLastModified { get; set; } + + [ForeignKey("CollectionSiteId")] + [InverseProperty("ComCollections")] + public virtual CmsSite CollectionSite { get; set; } = null!; + + [InverseProperty("Collection")] + public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); + + [InverseProperty("Skucollection")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ComCouponCode.cs b/Migration.Tool.K11/Models/ComCouponCode.cs new file mode 100644 index 00000000..b0ec75b7 --- /dev/null +++ b/Migration.Tool.K11/Models/ComCouponCode.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_CouponCode")] +[Index("CouponCodeDiscountId", Name = "IX_COM_CouponCode_CouponCodeDiscountID")] +public class ComCouponCode +{ + [Key] + [Column("CouponCodeID")] + public int CouponCodeId { get; set; } + + [StringLength(200)] + public string CouponCodeCode { get; set; } = null!; + + public int? CouponCodeUseCount { get; set; } + + public int? CouponCodeUseLimit { get; set; } + + [Column("CouponCodeDiscountID")] + public int CouponCodeDiscountId { get; set; } + + public DateTime CouponCodeLastModified { get; set; } + + [Column("CouponCodeGUID")] + public Guid CouponCodeGuid { get; set; } + + [ForeignKey("CouponCodeDiscountId")] + [InverseProperty("ComCouponCodes")] + public virtual ComDiscount CouponCodeDiscount { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComCurrency.cs b/Migration.Tool.K11/Models/ComCurrency.cs new file mode 100644 index 00000000..2ec850f5 --- /dev/null +++ b/Migration.Tool.K11/Models/ComCurrency.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_Currency")] +[Index("CurrencyDisplayName", Name = "IX_COM_Currency_CurrencyDisplayName")] +[Index("CurrencySiteId", Name = "IX_COM_Currency_CurrencySiteID")] +public class ComCurrency +{ + [Key] + [Column("CurrencyID")] + public int CurrencyId { get; set; } + + [StringLength(200)] + public string CurrencyName { get; set; } = null!; + + [StringLength(200)] + public string CurrencyDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CurrencyCode { get; set; } = null!; + + public int? CurrencyRoundTo { get; set; } + + public bool CurrencyEnabled { get; set; } + + [StringLength(200)] + public string CurrencyFormatString { get; set; } = null!; + + public bool CurrencyIsMain { get; set; } + + [Column("CurrencyGUID")] + public Guid? CurrencyGuid { get; set; } + + public DateTime CurrencyLastModified { get; set; } + + [Column("CurrencySiteID")] + public int? CurrencySiteId { get; set; } + + [InverseProperty("ExchangeRateToCurrency")] + public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); + + [InverseProperty("OrderCurrency")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartCurrency")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("CurrencySiteId")] + [InverseProperty("ComCurrencies")] + public virtual CmsSite? CurrencySite { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComCurrencyExchangeRate.cs b/Migration.Tool.K11/Models/ComCurrencyExchangeRate.cs new file mode 100644 index 00000000..fcfd3578 --- /dev/null +++ b/Migration.Tool.K11/Models/ComCurrencyExchangeRate.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_CurrencyExchangeRate")] +[Index("ExchangeRateToCurrencyId", Name = "IX_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID")] +[Index("ExchangeTableId", Name = "IX_COM_CurrencyExchangeRate_ExchangeTableID")] +public class ComCurrencyExchangeRate +{ + [Key] + [Column("ExchagneRateID")] + public int ExchagneRateId { get; set; } + + [Column("ExchangeRateToCurrencyID")] + public int ExchangeRateToCurrencyId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal ExchangeRateValue { get; set; } + + [Column("ExchangeTableID")] + public int ExchangeTableId { get; set; } + + [Column("ExchangeRateGUID")] + public Guid ExchangeRateGuid { get; set; } + + public DateTime ExchangeRateLastModified { get; set; } + + [ForeignKey("ExchangeRateToCurrencyId")] + [InverseProperty("ComCurrencyExchangeRates")] + public virtual ComCurrency ExchangeRateToCurrency { get; set; } = null!; + + [ForeignKey("ExchangeTableId")] + [InverseProperty("ComCurrencyExchangeRates")] + public virtual ComExchangeTable ExchangeTable { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComCustomer.cs b/Migration.Tool.K11/Models/ComCustomer.cs new file mode 100644 index 00000000..19c86272 --- /dev/null +++ b/Migration.Tool.K11/Models/ComCustomer.cs @@ -0,0 +1,78 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_Customer")] +[Index("CustomerEmail", Name = "IX_COM_Customer_CustomerEmail")] +[Index("CustomerFirstName", Name = "IX_COM_Customer_CustomerFirstName")] +[Index("CustomerLastName", Name = "IX_COM_Customer_CustomerLastName")] +[Index("CustomerSiteId", Name = "IX_COM_Customer_CustomerSiteID")] +[Index("CustomerUserId", Name = "IX_COM_Customer_CustomerUserID")] +public class ComCustomer +{ + [Key] + [Column("CustomerID")] + public int CustomerId { get; set; } + + [StringLength(200)] + public string CustomerFirstName { get; set; } = null!; + + [StringLength(200)] + public string CustomerLastName { get; set; } = null!; + + [StringLength(254)] + public string? CustomerEmail { get; set; } + + [StringLength(26)] + public string? CustomerPhone { get; set; } + + [StringLength(50)] + public string? CustomerFax { get; set; } + + [StringLength(200)] + public string? CustomerCompany { get; set; } + + [Column("CustomerUserID")] + public int? CustomerUserId { get; set; } + + [Column("CustomerGUID")] + public Guid CustomerGuid { get; set; } + + [Column("CustomerTaxRegistrationID")] + [StringLength(50)] + public string? CustomerTaxRegistrationId { get; set; } + + [Column("CustomerOrganizationID")] + [StringLength(50)] + public string? CustomerOrganizationId { get; set; } + + public DateTime CustomerLastModified { get; set; } + + [Column("CustomerSiteID")] + public int? CustomerSiteId { get; set; } + + public DateTime? CustomerCreated { get; set; } + + [InverseProperty("AddressCustomer")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("EventCustomer")] + public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); + + [InverseProperty("OrderCustomer")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartCustomer")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("CustomerSiteId")] + [InverseProperty("ComCustomers")] + public virtual CmsSite? CustomerSite { get; set; } + + [ForeignKey("CustomerUserId")] + [InverseProperty("ComCustomers")] + public virtual CmsUser? CustomerUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComCustomerCreditHistory.cs b/Migration.Tool.K11/Models/ComCustomerCreditHistory.cs new file mode 100644 index 00000000..4e9d61c1 --- /dev/null +++ b/Migration.Tool.K11/Models/ComCustomerCreditHistory.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_CustomerCreditHistory")] +[Index("EventCustomerId", "EventDate", Name = "IX_COM_CustomerCreditHistory_EventCustomerID_EventDate", IsDescending = new[] { false, true })] +[Index("EventSiteId", Name = "IX_COM_CustomerCreditHistory_EventSiteID")] +public class ComCustomerCreditHistory +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(200)] + public string EventName { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal EventCreditChange { get; set; } + + public DateTime EventDate { get; set; } + + public string? EventDescription { get; set; } + + [Column("EventCustomerID")] + public int EventCustomerId { get; set; } + + [Column("EventCreditGUID")] + public Guid? EventCreditGuid { get; set; } + + public DateTime EventCreditLastModified { get; set; } + + [Column("EventSiteID")] + public int? EventSiteId { get; set; } + + [ForeignKey("EventCustomerId")] + [InverseProperty("ComCustomerCreditHistories")] + public virtual ComCustomer EventCustomer { get; set; } = null!; + + [ForeignKey("EventSiteId")] + [InverseProperty("ComCustomerCreditHistories")] + public virtual CmsSite? EventSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComDepartment.cs b/Migration.Tool.K11/Models/ComDepartment.cs new file mode 100644 index 00000000..2c34f4b3 --- /dev/null +++ b/Migration.Tool.K11/Models/ComDepartment.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_Department")] +[Index("DepartmentDefaultTaxClassId", Name = "IX_COM_Department_DepartmentDefaultTaxClassID")] +[Index("DepartmentSiteId", Name = "IX_COM_Department_DepartmentSiteID")] +public class ComDepartment +{ + [Key] + [Column("DepartmentID")] + public int DepartmentId { get; set; } + + [StringLength(200)] + public string DepartmentName { get; set; } = null!; + + [StringLength(200)] + public string DepartmentDisplayName { get; set; } = null!; + + [Column("DepartmentDefaultTaxClassID")] + public int? DepartmentDefaultTaxClassId { get; set; } + + [Column("DepartmentGUID")] + public Guid DepartmentGuid { get; set; } + + public DateTime DepartmentLastModified { get; set; } + + [Column("DepartmentSiteID")] + public int? DepartmentSiteId { get; set; } + + [InverseProperty("Skudepartment")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("DepartmentDefaultTaxClassId")] + [InverseProperty("ComDepartments")] + public virtual ComTaxClass? DepartmentDefaultTaxClass { get; set; } + + [ForeignKey("DepartmentSiteId")] + [InverseProperty("ComDepartments")] + public virtual CmsSite? DepartmentSite { get; set; } + + [ForeignKey("DepartmentId")] + [InverseProperty("Departments")] + public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ComDiscount.cs b/Migration.Tool.K11/Models/ComDiscount.cs new file mode 100644 index 00000000..7548d638 --- /dev/null +++ b/Migration.Tool.K11/Models/ComDiscount.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_Discount")] +[Index("DiscountSiteId", Name = "IX_COM_Discount_DiscountSiteID")] +public class ComDiscount +{ + [Key] + [Column("DiscountID")] + public int DiscountId { get; set; } + + [StringLength(200)] + public string DiscountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string DiscountName { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal DiscountValue { get; set; } + + [Required] + public bool? DiscountEnabled { get; set; } + + [Column("DiscountGUID")] + public Guid DiscountGuid { get; set; } + + public DateTime DiscountLastModified { get; set; } + + [Column("DiscountSiteID")] + public int DiscountSiteId { get; set; } + + public string? DiscountDescription { get; set; } + + public DateTime? DiscountValidFrom { get; set; } + + public DateTime? DiscountValidTo { get; set; } + + public double DiscountOrder { get; set; } + + public string? DiscountProductCondition { get; set; } + + [StringLength(400)] + public string? DiscountRoles { get; set; } + + [StringLength(200)] + public string? DiscountCustomerRestriction { get; set; } + + public bool DiscountIsFlat { get; set; } + + public string? DiscountCartCondition { get; set; } + + [StringLength(100)] + public string DiscountApplyTo { get; set; } = null!; + + [Required] + public bool? DiscountApplyFurtherDiscounts { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? DiscountOrderAmount { get; set; } + + public bool DiscountUsesCoupons { get; set; } + + [InverseProperty("CouponCodeDiscount")] + public virtual ICollection ComCouponCodes { get; set; } = new List(); + + [ForeignKey("DiscountSiteId")] + [InverseProperty("ComDiscounts")] + public virtual CmsSite DiscountSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComExchangeTable.cs b/Migration.Tool.K11/Models/ComExchangeTable.cs new file mode 100644 index 00000000..eff106e6 --- /dev/null +++ b/Migration.Tool.K11/Models/ComExchangeTable.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_ExchangeTable")] +[Index("ExchangeTableSiteId", Name = "IX_COM_ExchangeTable_ExchangeTableSiteID")] +public class ComExchangeTable +{ + [Key] + [Column("ExchangeTableID")] + public int ExchangeTableId { get; set; } + + [StringLength(200)] + public string ExchangeTableDisplayName { get; set; } = null!; + + public DateTime? ExchangeTableValidFrom { get; set; } + + public DateTime? ExchangeTableValidTo { get; set; } + + [Column("ExchangeTableGUID")] + public Guid ExchangeTableGuid { get; set; } + + public DateTime ExchangeTableLastModified { get; set; } + + [Column("ExchangeTableSiteID")] + public int? ExchangeTableSiteId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? ExchangeTableRateFromGlobalCurrency { get; set; } + + [InverseProperty("ExchangeTable")] + public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); + + [ForeignKey("ExchangeTableSiteId")] + [InverseProperty("ComExchangeTables")] + public virtual CmsSite? ExchangeTableSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComGiftCard.cs b/Migration.Tool.K11/Models/ComGiftCard.cs new file mode 100644 index 00000000..c4dea31c --- /dev/null +++ b/Migration.Tool.K11/Models/ComGiftCard.cs @@ -0,0 +1,58 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_GiftCard")] +[Index("GiftCardSiteId", Name = "IX_COM_GiftCard_GiftCardSiteID")] +public class ComGiftCard +{ + [Key] + [Column("GiftCardID")] + public int GiftCardId { get; set; } + + public Guid GiftCardGuid { get; set; } + + [StringLength(200)] + public string GiftCardDisplayName { get; set; } = null!; + + [StringLength(200)] + public string GiftCardName { get; set; } = null!; + + public string? GiftCardDescription { get; set; } + + [Required] + public bool? GiftCardEnabled { get; set; } + + public DateTime GiftCardLastModified { get; set; } + + [Column("GiftCardSiteID")] + public int GiftCardSiteId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal GiftCardValue { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? GiftCardMinimumOrderPrice { get; set; } + + public string? GiftCardCartCondition { get; set; } + + public DateTime? GiftCardValidFrom { get; set; } + + public DateTime? GiftCardValidTo { get; set; } + + [StringLength(200)] + public string? GiftCardCustomerRestriction { get; set; } + + [StringLength(400)] + public string? GiftCardRoles { get; set; } + + [InverseProperty("GiftCardCouponCodeGiftCard")] + public virtual ICollection ComGiftCardCouponCodes { get; set; } = new List(); + + [ForeignKey("GiftCardSiteId")] + [InverseProperty("ComGiftCards")] + public virtual CmsSite GiftCardSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComGiftCardCouponCode.cs b/Migration.Tool.K11/Models/ComGiftCardCouponCode.cs new file mode 100644 index 00000000..ae384381 --- /dev/null +++ b/Migration.Tool.K11/Models/ComGiftCardCouponCode.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_GiftCardCouponCode")] +[Index("GiftCardCouponCodeGiftCardId", Name = "IX_COM_GiftCardCouponCodeGiftCardID")] +public class ComGiftCardCouponCode +{ + [Key] + [Column("GiftCardCouponCodeID")] + public int GiftCardCouponCodeId { get; set; } + + [StringLength(200)] + public string GiftCardCouponCodeCode { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal GiftCardCouponCodeRemainingValue { get; set; } + + [Column("GiftCardCouponCodeGiftCardID")] + public int GiftCardCouponCodeGiftCardId { get; set; } + + public Guid GiftCardCouponCodeGuid { get; set; } + + public DateTime GiftCardCouponCodeLastModified { get; set; } + + [ForeignKey("GiftCardCouponCodeGiftCardId")] + [InverseProperty("ComGiftCardCouponCodes")] + public virtual ComGiftCard GiftCardCouponCodeGiftCard { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComInternalStatus.cs b/Migration.Tool.K11/Models/ComInternalStatus.cs new file mode 100644 index 00000000..ec811407 --- /dev/null +++ b/Migration.Tool.K11/Models/ComInternalStatus.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_InternalStatus")] +[Index("InternalStatusSiteId", Name = "IX_COM_InternalStatus_InternalStatusSiteID")] +public class ComInternalStatus +{ + [Key] + [Column("InternalStatusID")] + public int InternalStatusId { get; set; } + + [StringLength(200)] + public string InternalStatusName { get; set; } = null!; + + [StringLength(200)] + public string InternalStatusDisplayName { get; set; } = null!; + + [Required] + public bool? InternalStatusEnabled { get; set; } + + [Column("InternalStatusGUID")] + public Guid InternalStatusGuid { get; set; } + + public DateTime InternalStatusLastModified { get; set; } + + [Column("InternalStatusSiteID")] + public int? InternalStatusSiteId { get; set; } + + [InverseProperty("SkuinternalStatus")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("InternalStatusSiteId")] + [InverseProperty("ComInternalStatuses")] + public virtual CmsSite? InternalStatusSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComManufacturer.cs b/Migration.Tool.K11/Models/ComManufacturer.cs new file mode 100644 index 00000000..afae8f8f --- /dev/null +++ b/Migration.Tool.K11/Models/ComManufacturer.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_Manufacturer")] +[Index("ManufacturerSiteId", Name = "IX_COM_Manufacturer_ManufacturerSiteID")] +public class ComManufacturer +{ + [Key] + [Column("ManufacturerID")] + public int ManufacturerId { get; set; } + + [StringLength(200)] + public string ManufacturerDisplayName { get; set; } = null!; + + [StringLength(400)] + public string? ManufactureHomepage { get; set; } + + [Required] + public bool? ManufacturerEnabled { get; set; } + + [Column("ManufacturerGUID")] + public Guid ManufacturerGuid { get; set; } + + public DateTime ManufacturerLastModified { get; set; } + + [Column("ManufacturerSiteID")] + public int? ManufacturerSiteId { get; set; } + + [Column("ManufacturerThumbnailGUID")] + public Guid? ManufacturerThumbnailGuid { get; set; } + + public string? ManufacturerDescription { get; set; } + + [StringLength(200)] + public string? ManufacturerName { get; set; } + + [InverseProperty("Skumanufacturer")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("ManufacturerSiteId")] + [InverseProperty("ComManufacturers")] + public virtual CmsSite? ManufacturerSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComMultiBuyCouponCode.cs b/Migration.Tool.K11/Models/ComMultiBuyCouponCode.cs new file mode 100644 index 00000000..afd99444 --- /dev/null +++ b/Migration.Tool.K11/Models/ComMultiBuyCouponCode.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_MultiBuyCouponCode")] +[Index("MultiBuyCouponCodeMultiBuyDiscountId", Name = "IX_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID")] +public class ComMultiBuyCouponCode +{ + [Key] + [Column("MultiBuyCouponCodeID")] + public int MultiBuyCouponCodeId { get; set; } + + [StringLength(200)] + public string MultiBuyCouponCodeCode { get; set; } = null!; + + public int? MultiBuyCouponCodeUseLimit { get; set; } + + public int? MultiBuyCouponCodeUseCount { get; set; } + + [Column("MultiBuyCouponCodeMultiBuyDiscountID")] + public int MultiBuyCouponCodeMultiBuyDiscountId { get; set; } + + public DateTime MultiBuyCouponCodeLastModified { get; set; } + + [Column("MultiBuyCouponCodeGUID")] + public Guid MultiBuyCouponCodeGuid { get; set; } + + [ForeignKey("MultiBuyCouponCodeMultiBuyDiscountId")] + [InverseProperty("ComMultiBuyCouponCodes")] + public virtual ComMultiBuyDiscount MultiBuyCouponCodeMultiBuyDiscount { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComMultiBuyDiscount.cs b/Migration.Tool.K11/Models/ComMultiBuyDiscount.cs new file mode 100644 index 00000000..a3f686a3 --- /dev/null +++ b/Migration.Tool.K11/Models/ComMultiBuyDiscount.cs @@ -0,0 +1,97 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_MultiBuyDiscount")] +[Index("MultiBuyDiscountApplyToSkuid", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID")] +[Index("MultiBuyDiscountSiteId", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountSiteID")] +public class ComMultiBuyDiscount +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [StringLength(200)] + public string MultiBuyDiscountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string MultiBuyDiscountName { get; set; } = null!; + + public string? MultiBuyDiscountDescription { get; set; } + + [Required] + public bool? MultiBuyDiscountEnabled { get; set; } + + [Column("MultiBuyDiscountGUID")] + public Guid MultiBuyDiscountGuid { get; set; } + + public DateTime MultiBuyDiscountLastModified { get; set; } + + [Column("MultiBuyDiscountSiteID")] + public int MultiBuyDiscountSiteId { get; set; } + + [Required] + public bool? MultiBuyDiscountApplyFurtherDiscounts { get; set; } + + public int MultiBuyDiscountMinimumBuyCount { get; set; } + + public DateTime? MultiBuyDiscountValidFrom { get; set; } + + public DateTime? MultiBuyDiscountValidTo { get; set; } + + [StringLength(200)] + public string MultiBuyDiscountCustomerRestriction { get; set; } = null!; + + [StringLength(400)] + public string? MultiBuyDiscountRoles { get; set; } + + [Column("MultiBuyDiscountApplyToSKUID")] + public int? MultiBuyDiscountApplyToSkuid { get; set; } + + public int? MultiBuyDiscountLimitPerOrder { get; set; } + + public bool? MultiBuyDiscountUsesCoupons { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? MultiBuyDiscountValue { get; set; } + + public bool? MultiBuyDiscountIsFlat { get; set; } + + [Required] + public bool? MultiBuyDiscountAutoAddEnabled { get; set; } + + public int? MultiBuyDiscountPriority { get; set; } + + public bool MultiBuyDiscountIsProductCoupon { get; set; } + + [InverseProperty("MultiBuyCouponCodeMultiBuyDiscount")] + public virtual ICollection ComMultiBuyCouponCodes { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscount")] + public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); + + [InverseProperty("MultibuyDiscount")] + public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscount")] + public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); + + [ForeignKey("MultiBuyDiscountApplyToSkuid")] + [InverseProperty("ComMultiBuyDiscounts")] + public virtual ComSku? MultiBuyDiscountApplyToSku { get; set; } + + [ForeignKey("MultiBuyDiscountSiteId")] + [InverseProperty("ComMultiBuyDiscounts")] + public virtual CmsSite MultiBuyDiscountSite { get; set; } = null!; + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("MultiBuyDiscounts")] + public virtual ICollection Departments { get; set; } = new List(); + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("MultiBuyDiscounts")] + public virtual ICollection Skus { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ComMultiBuyDiscountBrand.cs b/Migration.Tool.K11/Models/ComMultiBuyDiscountBrand.cs new file mode 100644 index 00000000..15637810 --- /dev/null +++ b/Migration.Tool.K11/Models/ComMultiBuyDiscountBrand.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[PrimaryKey("MultiBuyDiscountId", "BrandId")] +[Table("COM_MultiBuyDiscountBrand")] +[Index("BrandId", Name = "IX_COM_MultiBuyDiscountBrand_BrandID")] +public class ComMultiBuyDiscountBrand +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [Key] + [Column("BrandID")] + public int BrandId { get; set; } + + [Required] + public bool? BrandIncluded { get; set; } + + [ForeignKey("BrandId")] + [InverseProperty("ComMultiBuyDiscountBrands")] + public virtual ComBrand Brand { get; set; } = null!; + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountBrands")] + public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComMultiBuyDiscountCollection.cs b/Migration.Tool.K11/Models/ComMultiBuyDiscountCollection.cs new file mode 100644 index 00000000..127ca956 --- /dev/null +++ b/Migration.Tool.K11/Models/ComMultiBuyDiscountCollection.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[PrimaryKey("MultibuyDiscountId", "CollectionId")] +[Table("COM_MultiBuyDiscountCollection")] +[Index("CollectionId", Name = "IX_COM_MultiBuyDiscountCollection_CollectionID")] +public class ComMultiBuyDiscountCollection +{ + [Key] + [Column("MultibuyDiscountID")] + public int MultibuyDiscountId { get; set; } + + [Key] + [Column("CollectionID")] + public int CollectionId { get; set; } + + [Required] + public bool? CollectionIncluded { get; set; } + + [ForeignKey("CollectionId")] + [InverseProperty("ComMultiBuyDiscountCollections")] + public virtual ComCollection Collection { get; set; } = null!; + + [ForeignKey("MultibuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountCollections")] + public virtual ComMultiBuyDiscount MultibuyDiscount { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComMultiBuyDiscountTree.cs b/Migration.Tool.K11/Models/ComMultiBuyDiscountTree.cs new file mode 100644 index 00000000..9c1ccc60 --- /dev/null +++ b/Migration.Tool.K11/Models/ComMultiBuyDiscountTree.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[PrimaryKey("MultiBuyDiscountId", "NodeId")] +[Table("COM_MultiBuyDiscountTree")] +[Index("NodeId", Name = "IX_COM_MultiBuyDiscountTree_NodeID")] +public class ComMultiBuyDiscountTree +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + [Required] + public bool? NodeIncluded { get; set; } + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountTrees")] + public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; + + [ForeignKey("NodeId")] + [InverseProperty("ComMultiBuyDiscountTrees")] + public virtual CmsTree Node { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComOptionCategory.cs b/Migration.Tool.K11/Models/ComOptionCategory.cs new file mode 100644 index 00000000..80228677 --- /dev/null +++ b/Migration.Tool.K11/Models/ComOptionCategory.cs @@ -0,0 +1,65 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_OptionCategory")] +[Index("CategorySiteId", Name = "IX_COM_OptionCategory_CategorySiteID")] +public class ComOptionCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryName { get; set; } = null!; + + [StringLength(200)] + public string CategorySelectionType { get; set; } = null!; + + [StringLength(200)] + public string? CategoryDefaultOptions { get; set; } + + public string? CategoryDescription { get; set; } + + [StringLength(200)] + public string? CategoryDefaultRecord { get; set; } + + [Required] + public bool? CategoryEnabled { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + public bool? CategoryDisplayPrice { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + public int? CategoryTextMaxLength { get; set; } + + [StringLength(20)] + public string? CategoryType { get; set; } + + public int? CategoryTextMinLength { get; set; } + + [StringLength(200)] + public string? CategoryLiveSiteDisplayName { get; set; } + + [ForeignKey("CategorySiteId")] + [InverseProperty("ComOptionCategories")] + public virtual CmsSite? CategorySite { get; set; } + + [InverseProperty("Category")] + public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); + + [InverseProperty("SkuoptionCategory")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ComOrder.cs b/Migration.Tool.K11/Models/ComOrder.cs new file mode 100644 index 00000000..29d4a8f9 --- /dev/null +++ b/Migration.Tool.K11/Models/ComOrder.cs @@ -0,0 +1,152 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_Order")] +[Index("OrderBillingAddressId", Name = "IX_COM_Order_OrderBillingAddressID")] +[Index("OrderCompanyAddressId", Name = "IX_COM_Order_OrderCompanyAddressID")] +[Index("OrderCreatedByUserId", Name = "IX_COM_Order_OrderCreatedByUserID")] +[Index("OrderCurrencyId", Name = "IX_COM_Order_OrderCurrencyID")] +[Index("OrderCustomerId", Name = "IX_COM_Order_OrderCustomerID")] +[Index("OrderPaymentOptionId", Name = "IX_COM_Order_OrderPaymentOptionID")] +[Index("OrderShippingAddressId", Name = "IX_COM_Order_OrderShippingAddressID")] +[Index("OrderShippingOptionId", Name = "IX_COM_Order_OrderShippingOptionID")] +[Index("OrderSiteId", "OrderDate", Name = "IX_COM_Order_OrderSiteID_OrderDate", IsDescending = new[] { false, true })] +[Index("OrderStatusId", Name = "IX_COM_Order_OrderStatusID")] +public class ComOrder +{ + [Key] + [Column("OrderID")] + public int OrderId { get; set; } + + [Column("OrderBillingAddressID")] + public int OrderBillingAddressId { get; set; } + + [Column("OrderShippingAddressID")] + public int? OrderShippingAddressId { get; set; } + + [Column("OrderShippingOptionID")] + public int? OrderShippingOptionId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderTotalShipping { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderTotalPrice { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderTotalTax { get; set; } + + public DateTime OrderDate { get; set; } + + [Column("OrderStatusID")] + public int? OrderStatusId { get; set; } + + [Column("OrderCurrencyID")] + public int? OrderCurrencyId { get; set; } + + [Column("OrderCustomerID")] + public int OrderCustomerId { get; set; } + + [Column("OrderCreatedByUserID")] + public int? OrderCreatedByUserId { get; set; } + + public string? OrderNote { get; set; } + + [Column("OrderSiteID")] + public int OrderSiteId { get; set; } + + [Column("OrderPaymentOptionID")] + public int? OrderPaymentOptionId { get; set; } + + public string? OrderInvoice { get; set; } + + [StringLength(200)] + public string? OrderInvoiceNumber { get; set; } + + [Column("OrderCompanyAddressID")] + public int? OrderCompanyAddressId { get; set; } + + [StringLength(100)] + public string? OrderTrackingNumber { get; set; } + + public string? OrderCustomData { get; set; } + + public string? OrderPaymentResult { get; set; } + + [Column("OrderGUID")] + public Guid OrderGuid { get; set; } + + public DateTime OrderLastModified { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderTotalPriceInMainCurrency { get; set; } + + public bool? OrderIsPaid { get; set; } + + [StringLength(10)] + public string? OrderCulture { get; set; } + + public string? OrderDiscounts { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderGrandTotal { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderGrandTotalInMainCurrency { get; set; } + + public string? OrderOtherPayments { get; set; } + + public string? OrderTaxSummary { get; set; } + + public string? OrderCouponCodes { get; set; } + + [InverseProperty("OrderItemOrder")] + public virtual ICollection ComOrderItems { get; set; } = new List(); + + [InverseProperty("Order")] + public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); + + [ForeignKey("OrderBillingAddressId")] + [InverseProperty("ComOrderOrderBillingAddresses")] + public virtual ComOrderAddress OrderBillingAddress { get; set; } = null!; + + [ForeignKey("OrderCompanyAddressId")] + [InverseProperty("ComOrderOrderCompanyAddresses")] + public virtual ComOrderAddress? OrderCompanyAddress { get; set; } + + [ForeignKey("OrderCreatedByUserId")] + [InverseProperty("ComOrders")] + public virtual CmsUser? OrderCreatedByUser { get; set; } + + [ForeignKey("OrderCurrencyId")] + [InverseProperty("ComOrders")] + public virtual ComCurrency? OrderCurrency { get; set; } + + [ForeignKey("OrderCustomerId")] + [InverseProperty("ComOrders")] + public virtual ComCustomer OrderCustomer { get; set; } = null!; + + [ForeignKey("OrderPaymentOptionId")] + [InverseProperty("ComOrders")] + public virtual ComPaymentOption? OrderPaymentOption { get; set; } + + [ForeignKey("OrderShippingAddressId")] + [InverseProperty("ComOrderOrderShippingAddresses")] + public virtual ComOrderAddress? OrderShippingAddress { get; set; } + + [ForeignKey("OrderShippingOptionId")] + [InverseProperty("ComOrders")] + public virtual ComShippingOption? OrderShippingOption { get; set; } + + [ForeignKey("OrderSiteId")] + [InverseProperty("ComOrders")] + public virtual CmsSite OrderSite { get; set; } = null!; + + [ForeignKey("OrderStatusId")] + [InverseProperty("ComOrders")] + public virtual ComOrderStatus? OrderStatus { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComOrderAddress.cs b/Migration.Tool.K11/Models/ComOrderAddress.cs new file mode 100644 index 00000000..7f024522 --- /dev/null +++ b/Migration.Tool.K11/Models/ComOrderAddress.cs @@ -0,0 +1,62 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_OrderAddress")] +[Index("AddressCountryId", Name = "IX_COM_OrderAddress_AddressCountryID")] +[Index("AddressStateId", Name = "IX_COM_OrderAddress_AddressStateID")] +public class ComOrderAddress +{ + [Key] + [Column("AddressID")] + public int AddressId { get; set; } + + [StringLength(100)] + public string AddressLine1 { get; set; } = null!; + + [StringLength(100)] + public string? AddressLine2 { get; set; } + + [StringLength(100)] + public string AddressCity { get; set; } = null!; + + [StringLength(20)] + public string AddressZip { get; set; } = null!; + + [StringLength(26)] + public string? AddressPhone { get; set; } + + [Column("AddressCountryID")] + public int AddressCountryId { get; set; } + + [Column("AddressStateID")] + public int? AddressStateId { get; set; } + + [StringLength(200)] + public string AddressPersonalName { get; set; } = null!; + + [Column("AddressGUID")] + public Guid? AddressGuid { get; set; } + + public DateTime AddressLastModified { get; set; } + + [ForeignKey("AddressCountryId")] + [InverseProperty("ComOrderAddresses")] + public virtual CmsCountry AddressCountry { get; set; } = null!; + + [ForeignKey("AddressStateId")] + [InverseProperty("ComOrderAddresses")] + public virtual CmsState? AddressState { get; set; } + + [InverseProperty("OrderBillingAddress")] + public virtual ICollection ComOrderOrderBillingAddresses { get; set; } = new List(); + + [InverseProperty("OrderCompanyAddress")] + public virtual ICollection ComOrderOrderCompanyAddresses { get; set; } = new List(); + + [InverseProperty("OrderShippingAddress")] + public virtual ICollection ComOrderOrderShippingAddresses { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ComOrderItem.cs b/Migration.Tool.K11/Models/ComOrderItem.cs new file mode 100644 index 00000000..5713b513 --- /dev/null +++ b/Migration.Tool.K11/Models/ComOrderItem.cs @@ -0,0 +1,69 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_OrderItem")] +[Index("OrderItemOrderId", Name = "IX_COM_OrderItem_OrderItemOrderID")] +[Index("OrderItemSkuid", Name = "IX_COM_OrderItem_OrderItemSKUID")] +public class ComOrderItem +{ + [Key] + [Column("OrderItemID")] + public int OrderItemId { get; set; } + + [Column("OrderItemOrderID")] + public int OrderItemOrderId { get; set; } + + [Column("OrderItemSKUID")] + public int OrderItemSkuid { get; set; } + + [Column("OrderItemSKUName")] + [StringLength(450)] + public string OrderItemSkuname { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderItemUnitPrice { get; set; } + + public int OrderItemUnitCount { get; set; } + + public string? OrderItemCustomData { get; set; } + + public Guid OrderItemGuid { get; set; } + + public Guid? OrderItemParentGuid { get; set; } + + public DateTime OrderItemLastModified { get; set; } + + public DateTime? OrderItemValidTo { get; set; } + + [Column("OrderItemBundleGUID")] + public Guid? OrderItemBundleGuid { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderItemTotalPriceInMainCurrency { get; set; } + + public bool? OrderItemSendNotification { get; set; } + + public string? OrderItemText { get; set; } + + public string? OrderItemProductDiscounts { get; set; } + + public string? OrderItemDiscountSummary { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderItemTotalPrice { get; set; } + + [InverseProperty("OrderItem")] + public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); + + [ForeignKey("OrderItemOrderId")] + [InverseProperty("ComOrderItems")] + public virtual ComOrder OrderItemOrder { get; set; } = null!; + + [ForeignKey("OrderItemSkuid")] + [InverseProperty("ComOrderItems")] + public virtual ComSku OrderItemSku { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComOrderItemSkufile.cs b/Migration.Tool.K11/Models/ComOrderItemSkufile.cs new file mode 100644 index 00000000..e2941d80 --- /dev/null +++ b/Migration.Tool.K11/Models/ComOrderItemSkufile.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_OrderItemSKUFile")] +[Index("FileId", Name = "IX_COM_OrderItemSKUFile_FileID")] +[Index("OrderItemId", Name = "IX_COM_OrderItemSKUFile_OrderItemID")] +public class ComOrderItemSkufile +{ + [Key] + [Column("OrderItemSKUFileID")] + public int OrderItemSkufileId { get; set; } + + public Guid Token { get; set; } + + [Column("OrderItemID")] + public int OrderItemId { get; set; } + + [Column("FileID")] + public int FileId { get; set; } + + [ForeignKey("FileId")] + [InverseProperty("ComOrderItemSkufiles")] + public virtual ComSkufile File { get; set; } = null!; + + [ForeignKey("OrderItemId")] + [InverseProperty("ComOrderItemSkufiles")] + public virtual ComOrderItem OrderItem { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComOrderStatus.cs b/Migration.Tool.K11/Models/ComOrderStatus.cs new file mode 100644 index 00000000..ddd2cbb2 --- /dev/null +++ b/Migration.Tool.K11/Models/ComOrderStatus.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_OrderStatus")] +[Index("StatusSiteId", "StatusOrder", Name = "IX_COM_OrderStatus_StatusSiteID_StatusOrder")] +public class ComOrderStatus +{ + [Key] + [Column("StatusID")] + public int StatusId { get; set; } + + [StringLength(200)] + public string StatusName { get; set; } = null!; + + [StringLength(200)] + public string StatusDisplayName { get; set; } = null!; + + public int? StatusOrder { get; set; } + + [Required] + public bool? StatusEnabled { get; set; } + + [StringLength(7)] + public string? StatusColor { get; set; } + + [Column("StatusGUID")] + public Guid StatusGuid { get; set; } + + public DateTime StatusLastModified { get; set; } + + public bool? StatusSendNotification { get; set; } + + [Column("StatusSiteID")] + public int? StatusSiteId { get; set; } + + public bool? StatusOrderIsPaid { get; set; } + + [InverseProperty("FromStatus")] + public virtual ICollection ComOrderStatusUserFromStatuses { get; set; } = new List(); + + [InverseProperty("ToStatus")] + public virtual ICollection ComOrderStatusUserToStatuses { get; set; } = new List(); + + [InverseProperty("OrderStatus")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("PaymentOptionAuthorizedOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionAuthorizedOrderStatuses { get; set; } = new List(); + + [InverseProperty("PaymentOptionFailedOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionFailedOrderStatuses { get; set; } = new List(); + + [InverseProperty("PaymentOptionSucceededOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionSucceededOrderStatuses { get; set; } = new List(); + + [ForeignKey("StatusSiteId")] + [InverseProperty("ComOrderStatuses")] + public virtual CmsSite? StatusSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComOrderStatusUser.cs b/Migration.Tool.K11/Models/ComOrderStatusUser.cs new file mode 100644 index 00000000..61543a00 --- /dev/null +++ b/Migration.Tool.K11/Models/ComOrderStatusUser.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_OrderStatusUser")] +[Index("ChangedByUserId", Name = "IX_COM_OrderStatusUser_ChangedByUserID")] +[Index("FromStatusId", Name = "IX_COM_OrderStatusUser_FromStatusID")] +[Index("OrderId", "Date", Name = "IX_COM_OrderStatusUser_OrderID_Date")] +[Index("ToStatusId", Name = "IX_COM_OrderStatusUser_ToStatusID")] +public class ComOrderStatusUser +{ + [Key] + [Column("OrderStatusUserID")] + public int OrderStatusUserId { get; set; } + + [Column("OrderID")] + public int OrderId { get; set; } + + [Column("FromStatusID")] + public int? FromStatusId { get; set; } + + [Column("ToStatusID")] + public int ToStatusId { get; set; } + + [Column("ChangedByUserID")] + public int? ChangedByUserId { get; set; } + + public DateTime Date { get; set; } + + public string? Note { get; set; } + + [ForeignKey("ChangedByUserId")] + [InverseProperty("ComOrderStatusUsers")] + public virtual CmsUser? ChangedByUser { get; set; } + + [ForeignKey("FromStatusId")] + [InverseProperty("ComOrderStatusUserFromStatuses")] + public virtual ComOrderStatus? FromStatus { get; set; } + + [ForeignKey("OrderId")] + [InverseProperty("ComOrderStatusUsers")] + public virtual ComOrder Order { get; set; } = null!; + + [ForeignKey("ToStatusId")] + [InverseProperty("ComOrderStatusUserToStatuses")] + public virtual ComOrderStatus ToStatus { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComPaymentOption.cs b/Migration.Tool.K11/Models/ComPaymentOption.cs new file mode 100644 index 00000000..52abbcea --- /dev/null +++ b/Migration.Tool.K11/Models/ComPaymentOption.cs @@ -0,0 +1,82 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_PaymentOption")] +[Index("PaymentOptionAuthorizedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID")] +[Index("PaymentOptionFailedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionFailedOrderStatusID")] +[Index("PaymentOptionSiteId", Name = "IX_COM_PaymentOption_PaymentOptionSiteID")] +[Index("PaymentOptionSucceededOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionSucceededOrderStatusID")] +public class ComPaymentOption +{ + [Key] + [Column("PaymentOptionID")] + public int PaymentOptionId { get; set; } + + [StringLength(200)] + public string PaymentOptionName { get; set; } = null!; + + [StringLength(200)] + public string PaymentOptionDisplayName { get; set; } = null!; + + [Required] + public bool? PaymentOptionEnabled { get; set; } + + [Column("PaymentOptionSiteID")] + public int? PaymentOptionSiteId { get; set; } + + [StringLength(500)] + public string? PaymentOptionPaymentGateUrl { get; set; } + + [StringLength(200)] + public string? PaymentOptionAssemblyName { get; set; } + + [StringLength(200)] + public string? PaymentOptionClassName { get; set; } + + [Column("PaymentOptionSucceededOrderStatusID")] + public int? PaymentOptionSucceededOrderStatusId { get; set; } + + [Column("PaymentOptionFailedOrderStatusID")] + public int? PaymentOptionFailedOrderStatusId { get; set; } + + [Column("PaymentOptionGUID")] + public Guid PaymentOptionGuid { get; set; } + + public DateTime PaymentOptionLastModified { get; set; } + + public bool? PaymentOptionAllowIfNoShipping { get; set; } + + [Column("PaymentOptionThumbnailGUID")] + public Guid? PaymentOptionThumbnailGuid { get; set; } + + public string? PaymentOptionDescription { get; set; } + + [Column("PaymentOptionAuthorizedOrderStatusID")] + public int? PaymentOptionAuthorizedOrderStatusId { get; set; } + + [InverseProperty("OrderPaymentOption")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartPaymentOption")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("PaymentOptionAuthorizedOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionAuthorizedOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionAuthorizedOrderStatus { get; set; } + + [ForeignKey("PaymentOptionFailedOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionFailedOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionFailedOrderStatus { get; set; } + + [ForeignKey("PaymentOptionSiteId")] + [InverseProperty("ComPaymentOptions")] + public virtual CmsSite? PaymentOptionSite { get; set; } + + [ForeignKey("PaymentOptionSucceededOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionSucceededOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionSucceededOrderStatus { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComPublicStatus.cs b/Migration.Tool.K11/Models/ComPublicStatus.cs new file mode 100644 index 00000000..098b8061 --- /dev/null +++ b/Migration.Tool.K11/Models/ComPublicStatus.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_PublicStatus")] +[Index("PublicStatusSiteId", Name = "IX_COM_PublicStatus_PublicStatusSiteID")] +public class ComPublicStatus +{ + [Key] + [Column("PublicStatusID")] + public int PublicStatusId { get; set; } + + [StringLength(200)] + public string PublicStatusName { get; set; } = null!; + + [StringLength(200)] + public string PublicStatusDisplayName { get; set; } = null!; + + [Required] + public bool? PublicStatusEnabled { get; set; } + + [Column("PublicStatusGUID")] + public Guid? PublicStatusGuid { get; set; } + + public DateTime PublicStatusLastModified { get; set; } + + [Column("PublicStatusSiteID")] + public int? PublicStatusSiteId { get; set; } + + [InverseProperty("SkupublicStatus")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("PublicStatusSiteId")] + [InverseProperty("ComPublicStatuses")] + public virtual CmsSite? PublicStatusSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComShippingCost.cs b/Migration.Tool.K11/Models/ComShippingCost.cs new file mode 100644 index 00000000..3b400dd0 --- /dev/null +++ b/Migration.Tool.K11/Models/ComShippingCost.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_ShippingCost")] +[Index("ShippingCostShippingOptionId", Name = "IX_COM_ShippingCost_ShippingCostShippingOptionID")] +public class ComShippingCost +{ + [Key] + [Column("ShippingCostID")] + public int ShippingCostId { get; set; } + + [Column("ShippingCostShippingOptionID")] + public int ShippingCostShippingOptionId { get; set; } + + public double ShippingCostMinWeight { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal ShippingCostValue { get; set; } + + [Column("ShippingCostGUID")] + public Guid ShippingCostGuid { get; set; } + + public DateTime ShippingCostLastModified { get; set; } + + [ForeignKey("ShippingCostShippingOptionId")] + [InverseProperty("ComShippingCosts")] + public virtual ComShippingOption ShippingCostShippingOption { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComShippingOption.cs b/Migration.Tool.K11/Models/ComShippingOption.cs new file mode 100644 index 00000000..f35ece13 --- /dev/null +++ b/Migration.Tool.K11/Models/ComShippingOption.cs @@ -0,0 +1,69 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_ShippingOption")] +[Index("ShippingOptionCarrierId", Name = "IX_COM_ShippingOption_ShippingOptionCarrierID")] +[Index("ShippingOptionSiteId", Name = "IX_COM_ShippingOption_ShippingOptionSiteID_ShippingOptionDisplayName_ShippingOptionEnabled")] +[Index("ShippingOptionTaxClassId", Name = "IX_COM_ShippingOption_ShippingOptionTaxClassID")] +public class ComShippingOption +{ + [Key] + [Column("ShippingOptionID")] + public int ShippingOptionId { get; set; } + + [StringLength(200)] + public string ShippingOptionName { get; set; } = null!; + + [StringLength(200)] + public string ShippingOptionDisplayName { get; set; } = null!; + + [Required] + public bool? ShippingOptionEnabled { get; set; } + + [Column("ShippingOptionSiteID")] + public int? ShippingOptionSiteId { get; set; } + + [Column("ShippingOptionGUID")] + public Guid ShippingOptionGuid { get; set; } + + public DateTime ShippingOptionLastModified { get; set; } + + [Column("ShippingOptionThumbnailGUID")] + public Guid? ShippingOptionThumbnailGuid { get; set; } + + public string? ShippingOptionDescription { get; set; } + + [Column("ShippingOptionCarrierID")] + public int? ShippingOptionCarrierId { get; set; } + + [StringLength(200)] + public string? ShippingOptionCarrierServiceName { get; set; } + + [Column("ShippingOptionTaxClassID")] + public int? ShippingOptionTaxClassId { get; set; } + + [InverseProperty("OrderShippingOption")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShippingCostShippingOption")] + public virtual ICollection ComShippingCosts { get; set; } = new List(); + + [InverseProperty("ShoppingCartShippingOption")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("ShippingOptionCarrierId")] + [InverseProperty("ComShippingOptions")] + public virtual ComCarrier? ShippingOptionCarrier { get; set; } + + [ForeignKey("ShippingOptionSiteId")] + [InverseProperty("ComShippingOptions")] + public virtual CmsSite? ShippingOptionSite { get; set; } + + [ForeignKey("ShippingOptionTaxClassId")] + [InverseProperty("ComShippingOptions")] + public virtual ComTaxClass? ShippingOptionTaxClass { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComShoppingCart.cs b/Migration.Tool.K11/Models/ComShoppingCart.cs new file mode 100644 index 00000000..dfbbf7d5 --- /dev/null +++ b/Migration.Tool.K11/Models/ComShoppingCart.cs @@ -0,0 +1,106 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_ShoppingCart")] +[Index("ShoppingCartBillingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartBillingAddressID")] +[Index("ShoppingCartCompanyAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartCompanyAddressID")] +[Index("ShoppingCartCurrencyId", Name = "IX_COM_ShoppingCart_ShoppingCartCurrencyID")] +[Index("ShoppingCartCustomerId", Name = "IX_COM_ShoppingCart_ShoppingCartCustomerID")] +[Index("ShoppingCartLastUpdate", Name = "IX_COM_ShoppingCart_ShoppingCartLastUpdate")] +[Index("ShoppingCartPaymentOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartPaymentOptionID")] +[Index("ShoppingCartShippingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingAddressID")] +[Index("ShoppingCartShippingOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingOptionID")] +[Index("ShoppingCartSiteId", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID")] +[Index("ShoppingCartGuid", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID_ShoppingCartGUID")] +[Index("ShoppingCartUserId", Name = "IX_COM_ShoppingCart_ShoppingCartUserID")] +public class ComShoppingCart +{ + [Key] + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [Column("ShoppingCartGUID")] + public Guid ShoppingCartGuid { get; set; } + + [Column("ShoppingCartUserID")] + public int? ShoppingCartUserId { get; set; } + + [Column("ShoppingCartSiteID")] + public int ShoppingCartSiteId { get; set; } + + public DateTime ShoppingCartLastUpdate { get; set; } + + [Column("ShoppingCartCurrencyID")] + public int? ShoppingCartCurrencyId { get; set; } + + [Column("ShoppingCartPaymentOptionID")] + public int? ShoppingCartPaymentOptionId { get; set; } + + [Column("ShoppingCartShippingOptionID")] + public int? ShoppingCartShippingOptionId { get; set; } + + [Column("ShoppingCartBillingAddressID")] + public int? ShoppingCartBillingAddressId { get; set; } + + [Column("ShoppingCartShippingAddressID")] + public int? ShoppingCartShippingAddressId { get; set; } + + [Column("ShoppingCartCustomerID")] + public int? ShoppingCartCustomerId { get; set; } + + public string? ShoppingCartNote { get; set; } + + [Column("ShoppingCartCompanyAddressID")] + public int? ShoppingCartCompanyAddressId { get; set; } + + public string? ShoppingCartCustomData { get; set; } + + [Column("ShoppingCartContactID")] + public int? ShoppingCartContactId { get; set; } + + [InverseProperty("ShoppingCart")] + public virtual ICollection ComShoppingCartCouponCodes { get; set; } = new List(); + + [InverseProperty("ShoppingCart")] + public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); + + [ForeignKey("ShoppingCartBillingAddressId")] + [InverseProperty("ComShoppingCartShoppingCartBillingAddresses")] + public virtual ComAddress? ShoppingCartBillingAddress { get; set; } + + [ForeignKey("ShoppingCartCompanyAddressId")] + [InverseProperty("ComShoppingCartShoppingCartCompanyAddresses")] + public virtual ComAddress? ShoppingCartCompanyAddress { get; set; } + + [ForeignKey("ShoppingCartCurrencyId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComCurrency? ShoppingCartCurrency { get; set; } + + [ForeignKey("ShoppingCartCustomerId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComCustomer? ShoppingCartCustomer { get; set; } + + [ForeignKey("ShoppingCartPaymentOptionId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComPaymentOption? ShoppingCartPaymentOption { get; set; } + + [ForeignKey("ShoppingCartShippingAddressId")] + [InverseProperty("ComShoppingCartShoppingCartShippingAddresses")] + public virtual ComAddress? ShoppingCartShippingAddress { get; set; } + + [ForeignKey("ShoppingCartShippingOptionId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComShippingOption? ShoppingCartShippingOption { get; set; } + + [ForeignKey("ShoppingCartSiteId")] + [InverseProperty("ComShoppingCarts")] + public virtual CmsSite ShoppingCartSite { get; set; } = null!; + + [ForeignKey("ShoppingCartUserId")] + [InverseProperty("ComShoppingCarts")] + public virtual CmsUser? ShoppingCartUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComShoppingCartCouponCode.cs b/Migration.Tool.K11/Models/ComShoppingCartCouponCode.cs new file mode 100644 index 00000000..fcb06e4e --- /dev/null +++ b/Migration.Tool.K11/Models/ComShoppingCartCouponCode.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_ShoppingCartCouponCode")] +[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartCouponCode_ShoppingCartID")] +public class ComShoppingCartCouponCode +{ + [Key] + [Column("ShoppingCartCouponCodeID")] + public int ShoppingCartCouponCodeId { get; set; } + + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [StringLength(200)] + public string CouponCode { get; set; } = null!; + + [ForeignKey("ShoppingCartId")] + [InverseProperty("ComShoppingCartCouponCodes")] + public virtual ComShoppingCart ShoppingCart { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComShoppingCartSku.cs b/Migration.Tool.K11/Models/ComShoppingCartSku.cs new file mode 100644 index 00000000..57256f3c --- /dev/null +++ b/Migration.Tool.K11/Models/ComShoppingCartSku.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_ShoppingCartSKU")] +[Index("Skuid", Name = "IX_COM_ShoppingCartSKU_SKUID")] +[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartSKU_ShoppingCartID")] +public class ComShoppingCartSku +{ + [Key] + [Column("CartItemID")] + public int CartItemId { get; set; } + + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("SKUUnits")] + public int Skuunits { get; set; } + + public string? CartItemCustomData { get; set; } + + public Guid? CartItemGuid { get; set; } + + public Guid? CartItemParentGuid { get; set; } + + public DateTime? CartItemValidTo { get; set; } + + [Column("CartItemBundleGUID")] + public Guid? CartItemBundleGuid { get; set; } + + public string? CartItemText { get; set; } + + public int? CartItemAutoAddedUnits { get; set; } + + [ForeignKey("ShoppingCartId")] + [InverseProperty("ComShoppingCartSkus")] + public virtual ComShoppingCart ShoppingCart { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComShoppingCartSkus")] + public virtual ComSku Sku { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComSku.cs b/Migration.Tool.K11/Models/ComSku.cs new file mode 100644 index 00000000..037f1054 --- /dev/null +++ b/Migration.Tool.K11/Models/ComSku.cs @@ -0,0 +1,277 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_SKU")] +[Index("SkubrandId", Name = "IX_COM_SKU_SKUBrandID")] +[Index("SkucollectionId", Name = "IX_COM_SKU_SKUCollectionID")] +[Index("SkudepartmentId", Name = "IX_COM_SKU_SKUDepartmentID")] +[Index("SkuinternalStatusId", Name = "IX_COM_SKU_SKUInternalStatusID")] +[Index("SkumanufacturerId", Name = "IX_COM_SKU_SKUManufacturerID")] +[Index("Skuname", Name = "IX_COM_SKU_SKUName")] +[Index("SkuoptionCategoryId", Name = "IX_COM_SKU_SKUOptionCategoryID")] +[Index("SkuparentSkuid", Name = "IX_COM_SKU_SKUParentSKUID")] +[Index("Skuprice", Name = "IX_COM_SKU_SKUPrice")] +[Index("SkupublicStatusId", Name = "IX_COM_SKU_SKUPublicStatusID")] +[Index("SkusiteId", Name = "IX_COM_SKU_SKUSiteID")] +[Index("SkusupplierId", Name = "IX_COM_SKU_SKUSupplierID")] +[Index("SkutaxClassId", Name = "IX_COM_SKU_SKUTaxClassID")] +public class ComSku +{ + [Key] + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("SKUNumber")] + [StringLength(200)] + public string? Skunumber { get; set; } + + [Column("SKUName")] + [StringLength(440)] + public string Skuname { get; set; } = null!; + + [Column("SKUDescription")] + public string? Skudescription { get; set; } + + [Column("SKUPrice", TypeName = "decimal(18, 9)")] + public decimal Skuprice { get; set; } + + [Required] + [Column("SKUEnabled")] + public bool? Skuenabled { get; set; } + + [Column("SKUDepartmentID")] + public int? SkudepartmentId { get; set; } + + [Column("SKUManufacturerID")] + public int? SkumanufacturerId { get; set; } + + [Column("SKUInternalStatusID")] + public int? SkuinternalStatusId { get; set; } + + [Column("SKUPublicStatusID")] + public int? SkupublicStatusId { get; set; } + + [Column("SKUSupplierID")] + public int? SkusupplierId { get; set; } + + [Column("SKUAvailableInDays")] + public int? SkuavailableInDays { get; set; } + + [Column("SKUGUID")] + public Guid Skuguid { get; set; } + + [Column("SKUImagePath")] + [StringLength(450)] + public string? SkuimagePath { get; set; } + + [Column("SKUWeight")] + public double? Skuweight { get; set; } + + [Column("SKUWidth")] + public double? Skuwidth { get; set; } + + [Column("SKUDepth")] + public double? Skudepth { get; set; } + + [Column("SKUHeight")] + public double? Skuheight { get; set; } + + [Column("SKUAvailableItems")] + public int? SkuavailableItems { get; set; } + + [Column("SKUSellOnlyAvailable")] + public bool? SkusellOnlyAvailable { get; set; } + + [Column("SKUCustomData")] + public string? SkucustomData { get; set; } + + [Column("SKUOptionCategoryID")] + public int? SkuoptionCategoryId { get; set; } + + [Column("SKUOrder")] + public int? Skuorder { get; set; } + + [Column("SKULastModified")] + public DateTime SkulastModified { get; set; } + + [Column("SKUCreated")] + public DateTime? Skucreated { get; set; } + + [Column("SKUSiteID")] + public int? SkusiteId { get; set; } + + [Column("SKUNeedsShipping")] + public bool? SkuneedsShipping { get; set; } + + [Column("SKUValidUntil")] + public DateTime? SkuvalidUntil { get; set; } + + [Column("SKUProductType")] + [StringLength(50)] + public string? SkuproductType { get; set; } + + [Column("SKUMaxItemsInOrder")] + public int? SkumaxItemsInOrder { get; set; } + + [Column("SKUValidity")] + [StringLength(50)] + public string? Skuvalidity { get; set; } + + [Column("SKUValidFor")] + public int? SkuvalidFor { get; set; } + + [Column("SKUMembershipGUID")] + public Guid? SkumembershipGuid { get; set; } + + [Column("SKUConversionName")] + [StringLength(100)] + public string? SkuconversionName { get; set; } + + [Column("SKUConversionValue")] + [StringLength(200)] + public string? SkuconversionValue { get; set; } + + [Column("SKUBundleInventoryType")] + [StringLength(50)] + public string? SkubundleInventoryType { get; set; } + + [Column("SKUMinItemsInOrder")] + public int? SkuminItemsInOrder { get; set; } + + [Column("SKURetailPrice", TypeName = "decimal(18, 9)")] + public decimal? SkuretailPrice { get; set; } + + [Column("SKUParentSKUID")] + public int? SkuparentSkuid { get; set; } + + [Column("SKUShortDescription")] + public string? SkushortDescription { get; set; } + + [Column("SKUEproductFilesCount")] + public int? SkueproductFilesCount { get; set; } + + [Column("SKUBundleItemsCount")] + public int? SkubundleItemsCount { get; set; } + + [Column("SKUInStoreFrom")] + public DateTime? SkuinStoreFrom { get; set; } + + [Column("SKUReorderAt")] + public int? SkureorderAt { get; set; } + + [Column("SKUTrackInventory")] + [StringLength(50)] + public string? SkutrackInventory { get; set; } + + [Column("SKUTaxClassID")] + public int? SkutaxClassId { get; set; } + + [Column("SKUBrandID")] + public int? SkubrandId { get; set; } + + [Column("SKUCollectionID")] + public int? SkucollectionId { get; set; } + + [InverseProperty("NodeSku")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscountApplyToSku")] + public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); + + [InverseProperty("OrderItemSku")] + public virtual ICollection ComOrderItems { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); + + [InverseProperty("FileSku")] + public virtual ICollection ComSkufiles { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); + + [InverseProperty("VolumeDiscountSku")] + public virtual ICollection ComVolumeDiscounts { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("SkuparentSku")] + public virtual ICollection InverseSkuparentSku { get; set; } = new List(); + + [ForeignKey("SkubrandId")] + [InverseProperty("ComSkus")] + public virtual ComBrand? Skubrand { get; set; } + + [ForeignKey("SkucollectionId")] + [InverseProperty("ComSkus")] + public virtual ComCollection? Skucollection { get; set; } + + [ForeignKey("SkudepartmentId")] + [InverseProperty("ComSkus")] + public virtual ComDepartment? Skudepartment { get; set; } + + [ForeignKey("SkuinternalStatusId")] + [InverseProperty("ComSkus")] + public virtual ComInternalStatus? SkuinternalStatus { get; set; } + + [ForeignKey("SkumanufacturerId")] + [InverseProperty("ComSkus")] + public virtual ComManufacturer? Skumanufacturer { get; set; } + + [ForeignKey("SkuoptionCategoryId")] + [InverseProperty("ComSkus")] + public virtual ComOptionCategory? SkuoptionCategory { get; set; } + + [ForeignKey("SkuparentSkuid")] + [InverseProperty("InverseSkuparentSku")] + public virtual ComSku? SkuparentSku { get; set; } + + [ForeignKey("SkupublicStatusId")] + [InverseProperty("ComSkus")] + public virtual ComPublicStatus? SkupublicStatus { get; set; } + + [ForeignKey("SkusiteId")] + [InverseProperty("ComSkus")] + public virtual CmsSite? Skusite { get; set; } + + [ForeignKey("SkusupplierId")] + [InverseProperty("ComSkus")] + public virtual ComSupplier? Skusupplier { get; set; } + + [ForeignKey("SkutaxClassId")] + [InverseProperty("ComSkus")] + public virtual ComTaxClass? SkutaxClass { get; set; } + + [ForeignKey("Skuid")] + [InverseProperty("Skus")] + public virtual ICollection Bundles { get; set; } = new List(); + + [ForeignKey("Skuid")] + [InverseProperty("Skus")] + public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); + + [ForeignKey("Skuid")] + [InverseProperty("SkusNavigation")] + public virtual ICollection OptionSkus { get; set; } = new List(); + + [ForeignKey("VariantSkuid")] + [InverseProperty("VariantSkus")] + public virtual ICollection OptionSkusNavigation { get; set; } = new List(); + + [ForeignKey("BundleId")] + [InverseProperty("Bundles")] + public virtual ICollection Skus { get; set; } = new List(); + + [ForeignKey("OptionSkuid")] + [InverseProperty("OptionSkus")] + public virtual ICollection SkusNavigation { get; set; } = new List(); + + [ForeignKey("OptionSkuid")] + [InverseProperty("OptionSkusNavigation")] + public virtual ICollection VariantSkus { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ComSkufile.cs b/Migration.Tool.K11/Models/ComSkufile.cs new file mode 100644 index 00000000..0e343a18 --- /dev/null +++ b/Migration.Tool.K11/Models/ComSkufile.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_SKUFile")] +[Index("FileSkuid", Name = "IX_COM_SKUFile_FileSKUID")] +public class ComSkufile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileSKUID")] + public int FileSkuid { get; set; } + + [StringLength(450)] + public string FilePath { get; set; } = null!; + + [StringLength(50)] + public string FileType { get; set; } = null!; + + public DateTime FileLastModified { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [Column("FileMetaFileGUID")] + public Guid? FileMetaFileGuid { get; set; } + + [InverseProperty("File")] + public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); + + [ForeignKey("FileSkuid")] + [InverseProperty("ComSkufiles")] + public virtual ComSku FileSku { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComSkuoptionCategory.cs b/Migration.Tool.K11/Models/ComSkuoptionCategory.cs new file mode 100644 index 00000000..cba3abdd --- /dev/null +++ b/Migration.Tool.K11/Models/ComSkuoptionCategory.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_SKUOptionCategory")] +[Index("CategoryId", Name = "IX_COM_SKUOptionCategory_CategoryID")] +[Index("Skuid", Name = "IX_COM_SKUOptionCategory_SKUID")] +public class ComSkuoptionCategory +{ + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("CategoryID")] + public int CategoryId { get; set; } + + public bool? AllowAllOptions { get; set; } + + [Key] + [Column("SKUCategoryID")] + public int SkucategoryId { get; set; } + + [Column("SKUCategoryOrder")] + public int? SkucategoryOrder { get; set; } + + [ForeignKey("CategoryId")] + [InverseProperty("ComSkuoptionCategories")] + public virtual ComOptionCategory Category { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComSkuoptionCategories")] + public virtual ComSku Sku { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComSupplier.cs b/Migration.Tool.K11/Models/ComSupplier.cs new file mode 100644 index 00000000..dd1bdda5 --- /dev/null +++ b/Migration.Tool.K11/Models/ComSupplier.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_Supplier")] +[Index("SupplierSiteId", Name = "IX_COM_Supplier_SupplierSiteID")] +public class ComSupplier +{ + [Key] + [Column("SupplierID")] + public int SupplierId { get; set; } + + [StringLength(200)] + public string SupplierDisplayName { get; set; } = null!; + + [StringLength(50)] + public string? SupplierPhone { get; set; } + + [StringLength(254)] + public string? SupplierEmail { get; set; } + + [StringLength(50)] + public string? SupplierFax { get; set; } + + [Required] + public bool? SupplierEnabled { get; set; } + + [Column("SupplierGUID")] + public Guid SupplierGuid { get; set; } + + public DateTime SupplierLastModified { get; set; } + + [Column("SupplierSiteID")] + public int? SupplierSiteId { get; set; } + + [StringLength(200)] + public string? SupplierName { get; set; } + + [InverseProperty("Skusupplier")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("SupplierSiteId")] + [InverseProperty("ComSuppliers")] + public virtual CmsSite? SupplierSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComTaxClass.cs b/Migration.Tool.K11/Models/ComTaxClass.cs new file mode 100644 index 00000000..3e023874 --- /dev/null +++ b/Migration.Tool.K11/Models/ComTaxClass.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_TaxClass")] +[Index("TaxClassSiteId", Name = "IX_COM_TaxClass_TaxClassSiteID")] +public class ComTaxClass +{ + [Key] + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [StringLength(200)] + public string TaxClassName { get; set; } = null!; + + [StringLength(200)] + public string TaxClassDisplayName { get; set; } = null!; + + [Column("TaxClassZeroIfIDSupplied")] + public bool? TaxClassZeroIfIdsupplied { get; set; } + + [Column("TaxClassGUID")] + public Guid TaxClassGuid { get; set; } + + public DateTime TaxClassLastModified { get; set; } + + [Column("TaxClassSiteID")] + public int? TaxClassSiteId { get; set; } + + [InverseProperty("DepartmentDefaultTaxClass")] + public virtual ICollection ComDepartments { get; set; } = new List(); + + [InverseProperty("ShippingOptionTaxClass")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); + + [InverseProperty("SkutaxClass")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [InverseProperty("TaxClass")] + public virtual ICollection ComTaxClassCountries { get; set; } = new List(); + + [InverseProperty("TaxClass")] + public virtual ICollection ComTaxClassStates { get; set; } = new List(); + + [ForeignKey("TaxClassSiteId")] + [InverseProperty("ComTaxClasses")] + public virtual CmsSite? TaxClassSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/ComTaxClassCountry.cs b/Migration.Tool.K11/Models/ComTaxClassCountry.cs new file mode 100644 index 00000000..2b7250e4 --- /dev/null +++ b/Migration.Tool.K11/Models/ComTaxClassCountry.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_TaxClassCountry")] +[Index("CountryId", Name = "IX_COM_TaxClassCountry_CountryID")] +[Index("TaxClassId", "CountryId", Name = "IX_COM_TaxClassCountry_TaxClassID_CountryID", IsUnique = true)] +public class ComTaxClassCountry +{ + [Key] + [Column("TaxClassCountryID")] + public int TaxClassCountryId { get; set; } + + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal TaxValue { get; set; } + + [ForeignKey("CountryId")] + [InverseProperty("ComTaxClassCountries")] + public virtual CmsCountry Country { get; set; } = null!; + + [ForeignKey("TaxClassId")] + [InverseProperty("ComTaxClassCountries")] + public virtual ComTaxClass TaxClass { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComTaxClassState.cs b/Migration.Tool.K11/Models/ComTaxClassState.cs new file mode 100644 index 00000000..c68e6df9 --- /dev/null +++ b/Migration.Tool.K11/Models/ComTaxClassState.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_TaxClassState")] +[Index("StateId", Name = "IX_COM_TaxClassState_StateID")] +[Index("TaxClassId", "StateId", Name = "IX_COM_TaxClassState_TaxClassID_StateID", IsUnique = true)] +public class ComTaxClassState +{ + [Key] + [Column("TaxClassStateID")] + public int TaxClassStateId { get; set; } + + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [Column("StateID")] + public int StateId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal TaxValue { get; set; } + + [ForeignKey("StateId")] + [InverseProperty("ComTaxClassStates")] + public virtual CmsState State { get; set; } = null!; + + [ForeignKey("TaxClassId")] + [InverseProperty("ComTaxClassStates")] + public virtual ComTaxClass TaxClass { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComVolumeDiscount.cs b/Migration.Tool.K11/Models/ComVolumeDiscount.cs new file mode 100644 index 00000000..9d392a84 --- /dev/null +++ b/Migration.Tool.K11/Models/ComVolumeDiscount.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("COM_VolumeDiscount")] +[Index("VolumeDiscountSkuid", Name = "IX_COM_VolumeDiscount_VolumeDiscountSKUID")] +public class ComVolumeDiscount +{ + [Key] + [Column("VolumeDiscountID")] + public int VolumeDiscountId { get; set; } + + [Column("VolumeDiscountSKUID")] + public int VolumeDiscountSkuid { get; set; } + + public int VolumeDiscountMinCount { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal VolumeDiscountValue { get; set; } + + public bool VolumeDiscountIsFlatValue { get; set; } + + [Column("VolumeDiscountGUID")] + public Guid VolumeDiscountGuid { get; set; } + + public DateTime VolumeDiscountLastModified { get; set; } + + [ForeignKey("VolumeDiscountSkuid")] + [InverseProperty("ComVolumeDiscounts")] + public virtual ComSku VolumeDiscountSku { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ComWishlist.cs b/Migration.Tool.K11/Models/ComWishlist.cs new file mode 100644 index 00000000..a6234840 --- /dev/null +++ b/Migration.Tool.K11/Models/ComWishlist.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[PrimaryKey("UserId", "Skuid", "SiteId")] +[Table("COM_Wishlist")] +[Index("Skuid", Name = "IX_COM_Wishlist_SKUID")] +[Index("SiteId", "UserId", Name = "IX_COM_Wishlist_SiteID_UserID")] +public class ComWishlist +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [Key] + [Column("SKUID")] + public int Skuid { get; set; } + + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("ComWishlists")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComWishlists")] + public virtual ComSku Sku { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("ComWishlists")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CommunityFriend.cs b/Migration.Tool.K11/Models/CommunityFriend.cs similarity index 98% rename from Migration.Toolkit.K11/Models/CommunityFriend.cs rename to Migration.Tool.K11/Models/CommunityFriend.cs index 5e7d903b..4cfb14aa 100644 --- a/Migration.Toolkit.K11/Models/CommunityFriend.cs +++ b/Migration.Tool.K11/Models/CommunityFriend.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("Community_Friend")] [Index("FriendApprovedBy", Name = "IX_Community_Friend_FriendApprovedBy")] diff --git a/Migration.Tool.K11/Models/CommunityGroup.cs b/Migration.Tool.K11/Models/CommunityGroup.cs new file mode 100644 index 00000000..296e83b7 --- /dev/null +++ b/Migration.Tool.K11/Models/CommunityGroup.cs @@ -0,0 +1,109 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Community_Group")] +[Index("GroupApproved", Name = "IX_Community_Group_GroupApproved")] +[Index("GroupApprovedByUserId", Name = "IX_Community_Group_GroupApprovedByUserID")] +[Index("GroupAvatarId", Name = "IX_Community_Group_GroupAvatarID")] +[Index("GroupCreatedByUserId", Name = "IX_Community_Group_GroupCreatedByUserID")] +[Index("GroupSiteId", "GroupName", Name = "IX_Community_Group_GroupSiteID_GroupName")] +public class CommunityGroup +{ + [Key] + [Column("GroupID")] + public int GroupId { get; set; } + + [Column("GroupGUID")] + public Guid GroupGuid { get; set; } + + public DateTime GroupLastModified { get; set; } + + [Column("GroupSiteID")] + public int GroupSiteId { get; set; } + + [StringLength(200)] + public string GroupDisplayName { get; set; } = null!; + + [StringLength(100)] + public string GroupName { get; set; } = null!; + + public string GroupDescription { get; set; } = null!; + + [Column("GroupNodeGUID")] + public Guid? GroupNodeGuid { get; set; } + + public int GroupApproveMembers { get; set; } + + public int GroupAccess { get; set; } + + [Column("GroupCreatedByUserID")] + public int? GroupCreatedByUserId { get; set; } + + [Column("GroupApprovedByUserID")] + public int? GroupApprovedByUserId { get; set; } + + [Column("GroupAvatarID")] + public int? GroupAvatarId { get; set; } + + public bool? GroupApproved { get; set; } + + public DateTime GroupCreatedWhen { get; set; } + + public bool? GroupSendJoinLeaveNotification { get; set; } + + public bool? GroupSendWaitingForApprovalNotification { get; set; } + + public int? GroupSecurity { get; set; } + + public bool? GroupLogActivity { get; set; } + + [InverseProperty("BoardGroup")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("RoleGroup")] + public virtual ICollection CmsRoles { get; set; } = new List(); + + [InverseProperty("NodeGroup")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("MemberGroup")] + public virtual ICollection CommunityGroupMembers { get; set; } = new List(); + + [InverseProperty("Group")] + public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); + + [InverseProperty("InvitationGroup")] + public virtual ICollection CommunityInvitations { get; set; } = new List(); + + [InverseProperty("GroupGroup")] + public virtual ICollection ForumsForumGroups { get; set; } = new List(); + + [InverseProperty("ForumCommunityGroup")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [ForeignKey("GroupApprovedByUserId")] + [InverseProperty("CommunityGroupGroupApprovedByUsers")] + public virtual CmsUser? GroupApprovedByUser { get; set; } + + [ForeignKey("GroupAvatarId")] + [InverseProperty("CommunityGroups")] + public virtual CmsAvatar? GroupAvatar { get; set; } + + [ForeignKey("GroupCreatedByUserId")] + [InverseProperty("CommunityGroupGroupCreatedByUsers")] + public virtual CmsUser? GroupCreatedByUser { get; set; } + + [ForeignKey("GroupSiteId")] + [InverseProperty("CommunityGroups")] + public virtual CmsSite GroupSite { get; set; } = null!; + + [InverseProperty("LibraryGroup")] + public virtual ICollection MediaLibraries { get; set; } = new List(); + + [InverseProperty("PollGroup")] + public virtual ICollection PollsPolls { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/CommunityGroupMember.cs b/Migration.Tool.K11/Models/CommunityGroupMember.cs new file mode 100644 index 00000000..8f9ba043 --- /dev/null +++ b/Migration.Tool.K11/Models/CommunityGroupMember.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Community_GroupMember")] +[Index("MemberApprovedByUserId", Name = "IX_Community_GroupMember_MemberApprovedByUserID")] +[Index("MemberGroupId", Name = "IX_Community_GroupMember_MemberGroupID")] +[Index("MemberInvitedByUserId", Name = "IX_Community_GroupMember_MemberInvitedByUserID")] +[Index("MemberStatus", Name = "IX_Community_GroupMember_MemberStatus")] +[Index("MemberUserId", Name = "IX_Community_GroupMember_MemberUserID")] +public class CommunityGroupMember +{ + [Key] + [Column("MemberID")] + public int MemberId { get; set; } + + [Column("MemberGUID")] + public Guid MemberGuid { get; set; } + + [Column("MemberUserID")] + public int MemberUserId { get; set; } + + [Column("MemberGroupID")] + public int MemberGroupId { get; set; } + + public DateTime MemberJoined { get; set; } + + public DateTime? MemberApprovedWhen { get; set; } + + public DateTime? MemberRejectedWhen { get; set; } + + [Column("MemberApprovedByUserID")] + public int? MemberApprovedByUserId { get; set; } + + public string? MemberComment { get; set; } + + [Column("MemberInvitedByUserID")] + public int? MemberInvitedByUserId { get; set; } + + public int? MemberStatus { get; set; } + + [ForeignKey("MemberApprovedByUserId")] + [InverseProperty("CommunityGroupMemberMemberApprovedByUsers")] + public virtual CmsUser? MemberApprovedByUser { get; set; } + + [ForeignKey("MemberGroupId")] + [InverseProperty("CommunityGroupMembers")] + public virtual CommunityGroup MemberGroup { get; set; } = null!; + + [ForeignKey("MemberInvitedByUserId")] + [InverseProperty("CommunityGroupMemberMemberInvitedByUsers")] + public virtual CmsUser? MemberInvitedByUser { get; set; } + + [ForeignKey("MemberUserId")] + [InverseProperty("CommunityGroupMemberMemberUsers")] + public virtual CmsUser MemberUser { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CommunityGroupRolePermission.cs b/Migration.Tool.K11/Models/CommunityGroupRolePermission.cs new file mode 100644 index 00000000..b7df1533 --- /dev/null +++ b/Migration.Tool.K11/Models/CommunityGroupRolePermission.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[PrimaryKey("GroupId", "RoleId", "PermissionId")] +[Table("Community_GroupRolePermission")] +[Index("PermissionId", Name = "IX_Community_GroupRolePermission_PermissionID")] +[Index("RoleId", Name = "IX_Community_GroupRolePermission_RoleID")] +public class CommunityGroupRolePermission +{ + [Key] + [Column("GroupID")] + public int GroupId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("GroupId")] + [InverseProperty("CommunityGroupRolePermissions")] + public virtual CommunityGroup Group { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("CommunityGroupRolePermissions")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("CommunityGroupRolePermissions")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/CommunityInvitation.cs b/Migration.Tool.K11/Models/CommunityInvitation.cs new file mode 100644 index 00000000..cea81871 --- /dev/null +++ b/Migration.Tool.K11/Models/CommunityInvitation.cs @@ -0,0 +1,52 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Community_Invitation")] +[Index("InvitationGroupId", Name = "IX_Community_Invitation_InvitationGroupID")] +[Index("InvitedByUserId", Name = "IX_Community_Invitation_InvitedByUserID")] +[Index("InvitedUserId", Name = "IX_Community_Invitation_InvitedUserID")] +public class CommunityInvitation +{ + [Key] + [Column("InvitationID")] + public int InvitationId { get; set; } + + [Column("InvitedUserID")] + public int? InvitedUserId { get; set; } + + [Column("InvitedByUserID")] + public int InvitedByUserId { get; set; } + + [Column("InvitationGroupID")] + public int? InvitationGroupId { get; set; } + + public DateTime? InvitationCreated { get; set; } + + public DateTime? InvitationValidTo { get; set; } + + public string? InvitationComment { get; set; } + + [Column("InvitationGUID")] + public Guid InvitationGuid { get; set; } + + public DateTime InvitationLastModified { get; set; } + + [StringLength(254)] + public string? InvitationUserEmail { get; set; } + + [ForeignKey("InvitationGroupId")] + [InverseProperty("CommunityInvitations")] + public virtual CommunityGroup? InvitationGroup { get; set; } + + [ForeignKey("InvitedByUserId")] + [InverseProperty("CommunityInvitationInvitedByUsers")] + public virtual CmsUser InvitedByUser { get; set; } = null!; + + [ForeignKey("InvitedUserId")] + [InverseProperty("CommunityInvitationInvitedUsers")] + public virtual CmsUser? InvitedUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentArticle.cs b/Migration.Tool.K11/Models/ContentArticle.cs similarity index 92% rename from Migration.Toolkit.K11/Models/ContentArticle.cs rename to Migration.Tool.K11/Models/ContentArticle.cs index 47382657..ad3c4715 100644 --- a/Migration.Toolkit.K11/Models/ContentArticle.cs +++ b/Migration.Tool.K11/Models/ContentArticle.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_Article")] public class ContentArticle diff --git a/Migration.Toolkit.K11/Models/ContentBlog.cs b/Migration.Tool.K11/Models/ContentBlog.cs similarity index 97% rename from Migration.Toolkit.K11/Models/ContentBlog.cs rename to Migration.Tool.K11/Models/ContentBlog.cs index 53261b84..cb0364f5 100644 --- a/Migration.Toolkit.K11/Models/ContentBlog.cs +++ b/Migration.Tool.K11/Models/ContentBlog.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_Blog")] public class ContentBlog diff --git a/Migration.Toolkit.K11/Models/ContentBlogMonth.cs b/Migration.Tool.K11/Models/ContentBlogMonth.cs similarity index 90% rename from Migration.Toolkit.K11/Models/ContentBlogMonth.cs rename to Migration.Tool.K11/Models/ContentBlogMonth.cs index efdff172..d582607d 100644 --- a/Migration.Toolkit.K11/Models/ContentBlogMonth.cs +++ b/Migration.Tool.K11/Models/ContentBlogMonth.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_BlogMonth")] public class ContentBlogMonth diff --git a/Migration.Toolkit.K11/Models/ContentBlogPost.cs b/Migration.Tool.K11/Models/ContentBlogPost.cs similarity index 95% rename from Migration.Toolkit.K11/Models/ContentBlogPost.cs rename to Migration.Tool.K11/Models/ContentBlogPost.cs index c4b7b8a4..0a8a19ab 100644 --- a/Migration.Toolkit.K11/Models/ContentBlogPost.cs +++ b/Migration.Tool.K11/Models/ContentBlogPost.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_BlogPost")] public class ContentBlogPost diff --git a/Migration.Toolkit.K11/Models/ContentBookingEvent.cs b/Migration.Tool.K11/Models/ContentBookingEvent.cs similarity index 95% rename from Migration.Toolkit.K11/Models/ContentBookingEvent.cs rename to Migration.Tool.K11/Models/ContentBookingEvent.cs index f0a1b6b7..b031403c 100644 --- a/Migration.Toolkit.K11/Models/ContentBookingEvent.cs +++ b/Migration.Tool.K11/Models/ContentBookingEvent.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_BookingEvent")] public class ContentBookingEvent diff --git a/Migration.Toolkit.K11/Models/ContentCellphone.cs b/Migration.Tool.K11/Models/ContentCellphone.cs similarity index 96% rename from Migration.Toolkit.K11/Models/ContentCellphone.cs rename to Migration.Tool.K11/Models/ContentCellphone.cs index 5fe2f546..5b52326b 100644 --- a/Migration.Toolkit.K11/Models/ContentCellphone.cs +++ b/Migration.Tool.K11/Models/ContentCellphone.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_Cellphone")] public class ContentCellphone diff --git a/Migration.Toolkit.K11/Models/ContentEbook.cs b/Migration.Tool.K11/Models/ContentEbook.cs similarity index 91% rename from Migration.Toolkit.K11/Models/ContentEbook.cs rename to Migration.Tool.K11/Models/ContentEbook.cs index af2cc408..cc9d66b3 100644 --- a/Migration.Toolkit.K11/Models/ContentEbook.cs +++ b/Migration.Tool.K11/Models/ContentEbook.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_Ebook")] public class ContentEbook diff --git a/Migration.Toolkit.K11/Models/ContentEvent.cs b/Migration.Tool.K11/Models/ContentEvent.cs similarity index 92% rename from Migration.Toolkit.K11/Models/ContentEvent.cs rename to Migration.Tool.K11/Models/ContentEvent.cs index a30606fe..0da6e280 100644 --- a/Migration.Toolkit.K11/Models/ContentEvent.cs +++ b/Migration.Tool.K11/Models/ContentEvent.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_Event")] public class ContentEvent diff --git a/Migration.Toolkit.K11/Models/ContentFaq.cs b/Migration.Tool.K11/Models/ContentFaq.cs similarity index 90% rename from Migration.Toolkit.K11/Models/ContentFaq.cs rename to Migration.Tool.K11/Models/ContentFaq.cs index 79f5440a..ed36780f 100644 --- a/Migration.Toolkit.K11/Models/ContentFaq.cs +++ b/Migration.Tool.K11/Models/ContentFaq.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_FAQ")] public class ContentFaq diff --git a/Migration.Tool.K11/Models/ContentFile.cs b/Migration.Tool.K11/Models/ContentFile.cs new file mode 100644 index 00000000..ec7e1b67 --- /dev/null +++ b/Migration.Tool.K11/Models/ContentFile.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("CONTENT_File")] +public class ContentFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [StringLength(500)] + public string? FileDescription { get; set; } + + [StringLength(100)] + public string FileName { get; set; } = null!; + + public Guid? FileAttachment { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentHeadlineBanner.cs b/Migration.Tool.K11/Models/ContentHeadlineBanner.cs similarity index 92% rename from Migration.Toolkit.K11/Models/ContentHeadlineBanner.cs rename to Migration.Tool.K11/Models/ContentHeadlineBanner.cs index dffdc26f..78089050 100644 --- a/Migration.Toolkit.K11/Models/ContentHeadlineBanner.cs +++ b/Migration.Tool.K11/Models/ContentHeadlineBanner.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_HeadlineBanner")] public class ContentHeadlineBanner diff --git a/Migration.Toolkit.K11/Models/ContentImageGallery.cs b/Migration.Tool.K11/Models/ContentImageGallery.cs similarity index 91% rename from Migration.Toolkit.K11/Models/ContentImageGallery.cs rename to Migration.Tool.K11/Models/ContentImageGallery.cs index 8bf5efa3..6acc8a37 100644 --- a/Migration.Toolkit.K11/Models/ContentImageGallery.cs +++ b/Migration.Tool.K11/Models/ContentImageGallery.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_ImageGallery")] public class ContentImageGallery diff --git a/Migration.Toolkit.K11/Models/ContentJob.cs b/Migration.Tool.K11/Models/ContentJob.cs similarity index 93% rename from Migration.Toolkit.K11/Models/ContentJob.cs rename to Migration.Tool.K11/Models/ContentJob.cs index f44699f7..edae0911 100644 --- a/Migration.Toolkit.K11/Models/ContentJob.cs +++ b/Migration.Tool.K11/Models/ContentJob.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_Job")] public class ContentJob diff --git a/Migration.Toolkit.K11/Models/ContentKbarticle.cs b/Migration.Tool.K11/Models/ContentKbarticle.cs similarity index 93% rename from Migration.Toolkit.K11/Models/ContentKbarticle.cs rename to Migration.Tool.K11/Models/ContentKbarticle.cs index e88e4d7e..63df68ca 100644 --- a/Migration.Toolkit.K11/Models/ContentKbarticle.cs +++ b/Migration.Tool.K11/Models/ContentKbarticle.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_KBArticle")] public class ContentKbarticle diff --git a/Migration.Toolkit.K11/Models/ContentLaptop.cs b/Migration.Tool.K11/Models/ContentLaptop.cs similarity index 96% rename from Migration.Toolkit.K11/Models/ContentLaptop.cs rename to Migration.Tool.K11/Models/ContentLaptop.cs index c39726df..f9eafecf 100644 --- a/Migration.Toolkit.K11/Models/ContentLaptop.cs +++ b/Migration.Tool.K11/Models/ContentLaptop.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_Laptop")] public class ContentLaptop diff --git a/Migration.Toolkit.K11/Models/ContentMenuItem.cs b/Migration.Tool.K11/Models/ContentMenuItem.cs similarity index 91% rename from Migration.Toolkit.K11/Models/ContentMenuItem.cs rename to Migration.Tool.K11/Models/ContentMenuItem.cs index dd1b88d2..acf91558 100644 --- a/Migration.Toolkit.K11/Models/ContentMenuItem.cs +++ b/Migration.Tool.K11/Models/ContentMenuItem.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_MenuItem")] public class ContentMenuItem diff --git a/Migration.Toolkit.K11/Models/ContentNews.cs b/Migration.Tool.K11/Models/ContentNews.cs similarity index 92% rename from Migration.Toolkit.K11/Models/ContentNews.cs rename to Migration.Tool.K11/Models/ContentNews.cs index 71cf206e..d9cfad35 100644 --- a/Migration.Toolkit.K11/Models/ContentNews.cs +++ b/Migration.Tool.K11/Models/ContentNews.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_News")] public class ContentNews diff --git a/Migration.Toolkit.K11/Models/ContentOffice.cs b/Migration.Tool.K11/Models/ContentOffice.cs similarity index 97% rename from Migration.Toolkit.K11/Models/ContentOffice.cs rename to Migration.Tool.K11/Models/ContentOffice.cs index 206c2f48..82f4de5b 100644 --- a/Migration.Toolkit.K11/Models/ContentOffice.cs +++ b/Migration.Tool.K11/Models/ContentOffice.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_Office")] public class ContentOffice diff --git a/Migration.Toolkit.K11/Models/ContentPressRelease.cs b/Migration.Tool.K11/Models/ContentPressRelease.cs similarity index 93% rename from Migration.Toolkit.K11/Models/ContentPressRelease.cs rename to Migration.Tool.K11/Models/ContentPressRelease.cs index 475547ff..2caa0ac5 100644 --- a/Migration.Toolkit.K11/Models/ContentPressRelease.cs +++ b/Migration.Tool.K11/Models/ContentPressRelease.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_PressRelease")] public class ContentPressRelease diff --git a/Migration.Toolkit.K11/Models/ContentProduct.cs b/Migration.Tool.K11/Models/ContentProduct.cs similarity index 88% rename from Migration.Toolkit.K11/Models/ContentProduct.cs rename to Migration.Tool.K11/Models/ContentProduct.cs index 2debabaa..b09646bf 100644 --- a/Migration.Toolkit.K11/Models/ContentProduct.cs +++ b/Migration.Tool.K11/Models/ContentProduct.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_Product")] public class ContentProduct diff --git a/Migration.Toolkit.K11/Models/ContentSimpleArticle.cs b/Migration.Tool.K11/Models/ContentSimpleArticle.cs similarity index 90% rename from Migration.Toolkit.K11/Models/ContentSimpleArticle.cs rename to Migration.Tool.K11/Models/ContentSimpleArticle.cs index 078b3b6b..141a707f 100644 --- a/Migration.Toolkit.K11/Models/ContentSimpleArticle.cs +++ b/Migration.Tool.K11/Models/ContentSimpleArticle.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_SimpleArticle")] public class ContentSimpleArticle diff --git a/Migration.Toolkit.K11/Models/ContentSmartphone.cs b/Migration.Tool.K11/Models/ContentSmartphone.cs similarity index 97% rename from Migration.Toolkit.K11/Models/ContentSmartphone.cs rename to Migration.Tool.K11/Models/ContentSmartphone.cs index 2dda1f36..9c4da1e9 100644 --- a/Migration.Toolkit.K11/Models/ContentSmartphone.cs +++ b/Migration.Tool.K11/Models/ContentSmartphone.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_Smartphone")] public class ContentSmartphone diff --git a/Migration.Toolkit.K11/Models/ContentSoftware.cs b/Migration.Tool.K11/Models/ContentSoftware.cs similarity index 93% rename from Migration.Toolkit.K11/Models/ContentSoftware.cs rename to Migration.Tool.K11/Models/ContentSoftware.cs index 04479600..a1a7ea68 100644 --- a/Migration.Toolkit.K11/Models/ContentSoftware.cs +++ b/Migration.Tool.K11/Models/ContentSoftware.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("CONTENT_Software")] public class ContentSoftware diff --git a/Migration.Toolkit.K11/Models/CustomtableSampleTable.cs b/Migration.Tool.K11/Models/CustomtableSampleTable.cs similarity index 93% rename from Migration.Toolkit.K11/Models/CustomtableSampleTable.cs rename to Migration.Tool.K11/Models/CustomtableSampleTable.cs index db6dc98e..5cc25eca 100644 --- a/Migration.Toolkit.K11/Models/CustomtableSampleTable.cs +++ b/Migration.Tool.K11/Models/CustomtableSampleTable.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("customtable_SampleTable")] public class CustomtableSampleTable diff --git a/Migration.Toolkit.K11/Models/DancingGoatArticle.cs b/Migration.Tool.K11/Models/DancingGoatArticle.cs similarity index 92% rename from Migration.Toolkit.K11/Models/DancingGoatArticle.cs rename to Migration.Tool.K11/Models/DancingGoatArticle.cs index 6b9ec71e..f947c1fe 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatArticle.cs +++ b/Migration.Tool.K11/Models/DancingGoatArticle.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("DancingGoat_Article")] public class DancingGoatArticle diff --git a/Migration.Toolkit.K11/Models/DancingGoatBrewer.cs b/Migration.Tool.K11/Models/DancingGoatBrewer.cs similarity index 92% rename from Migration.Toolkit.K11/Models/DancingGoatBrewer.cs rename to Migration.Tool.K11/Models/DancingGoatBrewer.cs index 6c4b696b..5b00bd0a 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatBrewer.cs +++ b/Migration.Tool.K11/Models/DancingGoatBrewer.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("DancingGoat_Brewer")] public class DancingGoatBrewer diff --git a/Migration.Toolkit.K11/Models/DancingGoatCafe.cs b/Migration.Tool.K11/Models/DancingGoatCafe.cs similarity index 95% rename from Migration.Toolkit.K11/Models/DancingGoatCafe.cs rename to Migration.Tool.K11/Models/DancingGoatCafe.cs index c8efe994..06e2be22 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatCafe.cs +++ b/Migration.Tool.K11/Models/DancingGoatCafe.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("DancingGoat_Cafe")] public class DancingGoatCafe diff --git a/Migration.Toolkit.K11/Models/DancingGoatCity.cs b/Migration.Tool.K11/Models/DancingGoatCity.cs similarity index 90% rename from Migration.Toolkit.K11/Models/DancingGoatCity.cs rename to Migration.Tool.K11/Models/DancingGoatCity.cs index 27e78e2b..b2c9c27a 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatCity.cs +++ b/Migration.Tool.K11/Models/DancingGoatCity.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("DancingGoat_City")] public class DancingGoatCity diff --git a/Migration.Toolkit.K11/Models/DancingGoatCoffee.cs b/Migration.Tool.K11/Models/DancingGoatCoffee.cs similarity index 95% rename from Migration.Toolkit.K11/Models/DancingGoatCoffee.cs rename to Migration.Tool.K11/Models/DancingGoatCoffee.cs index 92d4dc95..ffa7adea 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatCoffee.cs +++ b/Migration.Tool.K11/Models/DancingGoatCoffee.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("DancingGoat_Coffee")] public class DancingGoatCoffee diff --git a/Migration.Toolkit.K11/Models/DancingGoatEbook.cs b/Migration.Tool.K11/Models/DancingGoatEbook.cs similarity index 90% rename from Migration.Toolkit.K11/Models/DancingGoatEbook.cs rename to Migration.Tool.K11/Models/DancingGoatEbook.cs index b5a5d86a..90d49d6e 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatEbook.cs +++ b/Migration.Tool.K11/Models/DancingGoatEbook.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("DancingGoat_Ebook")] public class DancingGoatEbook diff --git a/Migration.Toolkit.K11/Models/DancingGoatElectricGrinder.cs b/Migration.Tool.K11/Models/DancingGoatElectricGrinder.cs similarity index 93% rename from Migration.Toolkit.K11/Models/DancingGoatElectricGrinder.cs rename to Migration.Tool.K11/Models/DancingGoatElectricGrinder.cs index 9a499ba0..35b38ffa 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatElectricGrinder.cs +++ b/Migration.Tool.K11/Models/DancingGoatElectricGrinder.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("DancingGoat_ElectricGrinder")] public class DancingGoatElectricGrinder diff --git a/Migration.Toolkit.K11/Models/DancingGoatFilterPack.cs b/Migration.Tool.K11/Models/DancingGoatFilterPack.cs similarity index 93% rename from Migration.Toolkit.K11/Models/DancingGoatFilterPack.cs rename to Migration.Tool.K11/Models/DancingGoatFilterPack.cs index 872457f2..429b578b 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatFilterPack.cs +++ b/Migration.Tool.K11/Models/DancingGoatFilterPack.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("DancingGoat_FilterPack")] public class DancingGoatFilterPack diff --git a/Migration.Toolkit.K11/Models/DancingGoatGrinder.cs b/Migration.Tool.K11/Models/DancingGoatGrinder.cs similarity index 92% rename from Migration.Toolkit.K11/Models/DancingGoatGrinder.cs rename to Migration.Tool.K11/Models/DancingGoatGrinder.cs index c667d5c5..0ccab738 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatGrinder.cs +++ b/Migration.Tool.K11/Models/DancingGoatGrinder.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("DancingGoat_Grinder")] public class DancingGoatGrinder diff --git a/Migration.Toolkit.K11/Models/DancingGoatMembership.cs b/Migration.Tool.K11/Models/DancingGoatMembership.cs similarity index 92% rename from Migration.Toolkit.K11/Models/DancingGoatMembership.cs rename to Migration.Tool.K11/Models/DancingGoatMembership.cs index a1437509..4c2c4d0e 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatMembership.cs +++ b/Migration.Tool.K11/Models/DancingGoatMembership.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("DancingGoat_Membership")] public class DancingGoatMembership diff --git a/Migration.Toolkit.K11/Models/DancingGoatOffice.cs b/Migration.Tool.K11/Models/DancingGoatOffice.cs similarity index 95% rename from Migration.Toolkit.K11/Models/DancingGoatOffice.cs rename to Migration.Tool.K11/Models/DancingGoatOffice.cs index da8a3607..32954b75 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatOffice.cs +++ b/Migration.Tool.K11/Models/DancingGoatOffice.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("DancingGoat_Office")] public class DancingGoatOffice diff --git a/Migration.Toolkit.K11/Models/DancingGoatPartnerCafe.cs b/Migration.Tool.K11/Models/DancingGoatPartnerCafe.cs similarity index 93% rename from Migration.Toolkit.K11/Models/DancingGoatPartnerCafe.cs rename to Migration.Tool.K11/Models/DancingGoatPartnerCafe.cs index 3bbbaec5..bcae88f4 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatPartnerCafe.cs +++ b/Migration.Tool.K11/Models/DancingGoatPartnerCafe.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("DancingGoat_PartnerCafe")] public class DancingGoatPartnerCafe diff --git a/Migration.Toolkit.K11/Models/DancingGoatTableware.cs b/Migration.Tool.K11/Models/DancingGoatTableware.cs similarity index 92% rename from Migration.Toolkit.K11/Models/DancingGoatTableware.cs rename to Migration.Tool.K11/Models/DancingGoatTableware.cs index 61da58ae..268c6f92 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatTableware.cs +++ b/Migration.Tool.K11/Models/DancingGoatTableware.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("DancingGoat_Tableware")] public class DancingGoatTableware diff --git a/Migration.Toolkit.K11/Models/EcommerceCheckoutStep.cs b/Migration.Tool.K11/Models/EcommerceCheckoutStep.cs similarity index 89% rename from Migration.Toolkit.K11/Models/EcommerceCheckoutStep.cs rename to Migration.Tool.K11/Models/EcommerceCheckoutStep.cs index 025e4344..c350d2d6 100644 --- a/Migration.Toolkit.K11/Models/EcommerceCheckoutStep.cs +++ b/Migration.Tool.K11/Models/EcommerceCheckoutStep.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("Ecommerce_CheckoutStep")] public class EcommerceCheckoutStep diff --git a/Migration.Toolkit.K11/Models/EcommerceCheckoutWizard.cs b/Migration.Tool.K11/Models/EcommerceCheckoutWizard.cs similarity index 89% rename from Migration.Toolkit.K11/Models/EcommerceCheckoutWizard.cs rename to Migration.Tool.K11/Models/EcommerceCheckoutWizard.cs index d0e3943b..ad03cd3b 100644 --- a/Migration.Toolkit.K11/Models/EcommerceCheckoutWizard.cs +++ b/Migration.Tool.K11/Models/EcommerceCheckoutWizard.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("Ecommerce_CheckoutWizard")] public class EcommerceCheckoutWizard diff --git a/Migration.Tool.K11/Models/EventsAttendee.cs b/Migration.Tool.K11/Models/EventsAttendee.cs new file mode 100644 index 00000000..7268a6d7 --- /dev/null +++ b/Migration.Tool.K11/Models/EventsAttendee.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Events_Attendee")] +[Index("AttendeeEventNodeId", Name = "IX_Events_Attendee_AttendeeEventNodeID")] +public class EventsAttendee +{ + [Key] + [Column("AttendeeID")] + public int AttendeeId { get; set; } + + [StringLength(254)] + public string AttendeeEmail { get; set; } = null!; + + [StringLength(100)] + public string? AttendeeFirstName { get; set; } + + [StringLength(100)] + public string? AttendeeLastName { get; set; } + + [StringLength(50)] + public string? AttendeePhone { get; set; } + + [Column("AttendeeEventNodeID")] + public int AttendeeEventNodeId { get; set; } + + [Column("AttendeeGUID")] + public Guid AttendeeGuid { get; set; } + + public DateTime AttendeeLastModified { get; set; } + + [ForeignKey("AttendeeEventNodeId")] + [InverseProperty("EventsAttendees")] + public virtual CmsTree AttendeeEventNode { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ExportHistory.cs b/Migration.Tool.K11/Models/ExportHistory.cs new file mode 100644 index 00000000..7d1b00c8 --- /dev/null +++ b/Migration.Tool.K11/Models/ExportHistory.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Export_History")] +[Index("ExportSiteId", Name = "IX_Export_History_ExportSiteID")] +[Index("ExportUserId", Name = "IX_Export_History_ExportUserID")] +public class ExportHistory +{ + [Key] + [Column("ExportID")] + public int ExportId { get; set; } + + public DateTime ExportDateTime { get; set; } + + [StringLength(450)] + public string ExportFileName { get; set; } = null!; + + [Column("ExportSiteID")] + public int? ExportSiteId { get; set; } + + [Column("ExportUserID")] + public int? ExportUserId { get; set; } + + public string? ExportSettings { get; set; } + + [ForeignKey("ExportSiteId")] + [InverseProperty("ExportHistories")] + public virtual CmsSite? ExportSite { get; set; } + + [ForeignKey("ExportUserId")] + [InverseProperty("ExportHistories")] + public virtual CmsUser? ExportUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/ExportTask.cs b/Migration.Tool.K11/Models/ExportTask.cs new file mode 100644 index 00000000..071d4f5c --- /dev/null +++ b/Migration.Tool.K11/Models/ExportTask.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Export_Task")] +[Index("TaskSiteId", "TaskObjectType", Name = "IX_Export_Task_TaskSiteID_TaskObjectType")] +public class ExportTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [ForeignKey("TaskSiteId")] + [InverseProperty("ExportTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/FormContactU.cs b/Migration.Tool.K11/Models/FormContactU.cs similarity index 94% rename from Migration.Toolkit.K11/Models/FormContactU.cs rename to Migration.Tool.K11/Models/FormContactU.cs index df83855b..a364e5da 100644 --- a/Migration.Toolkit.K11/Models/FormContactU.cs +++ b/Migration.Tool.K11/Models/FormContactU.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("Form_ContactUs")] public class FormContactU diff --git a/Migration.Toolkit.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs b/Migration.Tool.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs similarity index 95% rename from Migration.Toolkit.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs rename to Migration.Tool.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs index 156f4aec..599fb968 100644 --- a/Migration.Toolkit.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs +++ b/Migration.Tool.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("Form_DancingGoat_BusinessCustomerRegistration")] public class FormDancingGoatBusinessCustomerRegistration diff --git a/Migration.Toolkit.K11/Models/FormDancingGoatContactU.cs b/Migration.Tool.K11/Models/FormDancingGoatContactU.cs similarity index 94% rename from Migration.Toolkit.K11/Models/FormDancingGoatContactU.cs rename to Migration.Tool.K11/Models/FormDancingGoatContactU.cs index 412be22e..e9dff1f1 100644 --- a/Migration.Toolkit.K11/Models/FormDancingGoatContactU.cs +++ b/Migration.Tool.K11/Models/FormDancingGoatContactU.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("Form_DancingGoat_ContactUs")] public class FormDancingGoatContactU diff --git a/Migration.Toolkit.K11/Models/FormDancingGoatMachineRental.cs b/Migration.Tool.K11/Models/FormDancingGoatMachineRental.cs similarity index 94% rename from Migration.Toolkit.K11/Models/FormDancingGoatMachineRental.cs rename to Migration.Tool.K11/Models/FormDancingGoatMachineRental.cs index dec11a64..c2f76329 100644 --- a/Migration.Toolkit.K11/Models/FormDancingGoatMachineRental.cs +++ b/Migration.Tool.K11/Models/FormDancingGoatMachineRental.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("Form_DancingGoat_MachineRental")] public class FormDancingGoatMachineRental diff --git a/Migration.Toolkit.K11/Models/FormDancingGoatTryFreeSample.cs b/Migration.Tool.K11/Models/FormDancingGoatTryFreeSample.cs similarity index 96% rename from Migration.Toolkit.K11/Models/FormDancingGoatTryFreeSample.cs rename to Migration.Tool.K11/Models/FormDancingGoatTryFreeSample.cs index 7a77760d..00690c48 100644 --- a/Migration.Toolkit.K11/Models/FormDancingGoatTryFreeSample.cs +++ b/Migration.Tool.K11/Models/FormDancingGoatTryFreeSample.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("Form_DancingGoat_TryFreeSample")] public class FormDancingGoatTryFreeSample diff --git a/Migration.Toolkit.K11/Models/FormEcommerceSiteGeneralQuestion.cs b/Migration.Tool.K11/Models/FormEcommerceSiteGeneralQuestion.cs similarity index 92% rename from Migration.Toolkit.K11/Models/FormEcommerceSiteGeneralQuestion.cs rename to Migration.Tool.K11/Models/FormEcommerceSiteGeneralQuestion.cs index 8aa6e8e4..36377990 100644 --- a/Migration.Toolkit.K11/Models/FormEcommerceSiteGeneralQuestion.cs +++ b/Migration.Tool.K11/Models/FormEcommerceSiteGeneralQuestion.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("Form_EcommerceSite_GeneralQuestion")] public class FormEcommerceSiteGeneralQuestion diff --git a/Migration.Toolkit.K11/Models/FormEcommerceSiteProductQuestion.cs b/Migration.Tool.K11/Models/FormEcommerceSiteProductQuestion.cs similarity index 93% rename from Migration.Toolkit.K11/Models/FormEcommerceSiteProductQuestion.cs rename to Migration.Tool.K11/Models/FormEcommerceSiteProductQuestion.cs index 84363ddf..dff46be5 100644 --- a/Migration.Toolkit.K11/Models/FormEcommerceSiteProductQuestion.cs +++ b/Migration.Tool.K11/Models/FormEcommerceSiteProductQuestion.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("Form_EcommerceSite_ProductQuestion")] public class FormEcommerceSiteProductQuestion diff --git a/Migration.Tool.K11/Models/ForumsAttachment.cs b/Migration.Tool.K11/Models/ForumsAttachment.cs new file mode 100644 index 00000000..39806d6f --- /dev/null +++ b/Migration.Tool.K11/Models/ForumsAttachment.cs @@ -0,0 +1,52 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Forums_Attachment")] +[Index("AttachmentSiteId", "AttachmentGuid", Name = "IX_Forums_Attachment_AttachmentGUID", IsUnique = true)] +[Index("AttachmentPostId", Name = "IX_Forums_Attachment_AttachmentPostID")] +public class ForumsAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(200)] + public string AttachmentFileName { get; set; } = null!; + + [StringLength(10)] + public string AttachmentFileExtension { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public int AttachmentFileSize { get; set; } + + public int? AttachmentImageHeight { get; set; } + + public int? AttachmentImageWidth { get; set; } + + [Column("AttachmentPostID")] + public int AttachmentPostId { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + [ForeignKey("AttachmentPostId")] + [InverseProperty("ForumsAttachments")] + public virtual ForumsForumPost AttachmentPost { get; set; } = null!; + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("ForumsAttachments")] + public virtual CmsSite AttachmentSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ForumsForum.cs b/Migration.Tool.K11/Models/ForumsForum.cs new file mode 100644 index 00000000..fe0f7de3 --- /dev/null +++ b/Migration.Tool.K11/Models/ForumsForum.cs @@ -0,0 +1,146 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Forums_Forum")] +[Index("ForumCommunityGroupId", Name = "IX_Forums_Forum_ForumCommunityGroupID")] +[Index("ForumDocumentId", Name = "IX_Forums_Forum_ForumDocumentID")] +[Index("ForumSiteId", "ForumName", Name = "IX_Forums_Forum_ForumSiteID_ForumName")] +public class ForumsForum +{ + [Key] + [Column("ForumID")] + public int ForumId { get; set; } + + [Column("ForumGroupID")] + public int ForumGroupId { get; set; } + + [StringLength(200)] + public string ForumName { get; set; } = null!; + + [StringLength(200)] + public string ForumDisplayName { get; set; } = null!; + + public string? ForumDescription { get; set; } + + public int? ForumOrder { get; set; } + + [Column("ForumDocumentID")] + public int? ForumDocumentId { get; set; } + + public bool ForumOpen { get; set; } + + public bool ForumModerated { get; set; } + + public bool? ForumDisplayEmails { get; set; } + + public bool? ForumRequireEmail { get; set; } + + public int ForumAccess { get; set; } + + public int ForumThreads { get; set; } + + public int ForumPosts { get; set; } + + public DateTime? ForumLastPostTime { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserName { get; set; } + + [StringLength(200)] + public string? ForumBaseUrl { get; set; } + + public bool? ForumAllowChangeName { get; set; } + + [Column("ForumHTMLEditor")] + public bool? ForumHtmleditor { get; set; } + + [Column("ForumUseCAPTCHA")] + public bool? ForumUseCaptcha { get; set; } + + [Column("ForumGUID")] + public Guid ForumGuid { get; set; } + + public DateTime ForumLastModified { get; set; } + + [StringLength(200)] + public string? ForumUnsubscriptionUrl { get; set; } + + public bool? ForumIsLocked { get; set; } + + public string? ForumSettings { get; set; } + + public bool? ForumAuthorEdit { get; set; } + + public bool? ForumAuthorDelete { get; set; } + + public int? ForumType { get; set; } + + public int? ForumIsAnswerLimit { get; set; } + + public int? ForumImageMaxSideSize { get; set; } + + public DateTime? ForumLastPostTimeAbsolute { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserNameAbsolute { get; set; } + + public int? ForumPostsAbsolute { get; set; } + + public int? ForumThreadsAbsolute { get; set; } + + public int? ForumAttachmentMaxFileSize { get; set; } + + public int? ForumDiscussionActions { get; set; } + + [Column("ForumSiteID")] + public int ForumSiteId { get; set; } + + public bool? ForumLogActivity { get; set; } + + [Column("ForumCommunityGroupID")] + public int? ForumCommunityGroupId { get; set; } + + public bool? ForumEnableOptIn { get; set; } + + public bool? ForumSendOptInConfirmation { get; set; } + + [Column("ForumOptInApprovalURL")] + [StringLength(450)] + public string? ForumOptInApprovalUrl { get; set; } + + [ForeignKey("ForumCommunityGroupId")] + [InverseProperty("ForumsForums")] + public virtual CommunityGroup? ForumCommunityGroup { get; set; } + + [ForeignKey("ForumDocumentId")] + [InverseProperty("ForumsForums")] + public virtual CmsDocument? ForumDocument { get; set; } + + [ForeignKey("ForumGroupId")] + [InverseProperty("ForumsForums")] + public virtual ForumsForumGroup ForumGroup { get; set; } = null!; + + [ForeignKey("ForumSiteId")] + [InverseProperty("ForumsForums")] + public virtual CmsSite ForumSite { get; set; } = null!; + + [InverseProperty("PostForum")] + public virtual ICollection ForumsForumPosts { get; set; } = new List(); + + [InverseProperty("Forum")] + public virtual ICollection ForumsForumRoles { get; set; } = new List(); + + [InverseProperty("SubscriptionForum")] + public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); + + [InverseProperty("Forum")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [ForeignKey("ForumId")] + [InverseProperty("Forums")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ForumsForumGroup.cs b/Migration.Tool.K11/Models/ForumsForumGroup.cs new file mode 100644 index 00000000..7661fbb8 --- /dev/null +++ b/Migration.Tool.K11/Models/ForumsForumGroup.cs @@ -0,0 +1,88 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Forums_ForumGroup")] +[Index("GroupGroupId", Name = "IX_Forums_ForumGroup_GroupGroupID")] +[Index("GroupSiteId", "GroupName", Name = "IX_Forums_ForumGroup_GroupSiteID_GroupName")] +public class ForumsForumGroup +{ + [Key] + [Column("GroupID")] + public int GroupId { get; set; } + + [Column("GroupSiteID")] + public int GroupSiteId { get; set; } + + [StringLength(200)] + public string GroupName { get; set; } = null!; + + [StringLength(200)] + public string GroupDisplayName { get; set; } = null!; + + public int? GroupOrder { get; set; } + + public string? GroupDescription { get; set; } + + [Column("GroupGUID")] + public Guid GroupGuid { get; set; } + + public DateTime GroupLastModified { get; set; } + + [StringLength(200)] + public string? GroupBaseUrl { get; set; } + + [StringLength(200)] + public string? GroupUnsubscriptionUrl { get; set; } + + [Column("GroupGroupID")] + public int? GroupGroupId { get; set; } + + public bool? GroupAuthorEdit { get; set; } + + public bool? GroupAuthorDelete { get; set; } + + public int? GroupType { get; set; } + + public int? GroupIsAnswerLimit { get; set; } + + public int? GroupImageMaxSideSize { get; set; } + + public bool? GroupDisplayEmails { get; set; } + + public bool? GroupRequireEmail { get; set; } + + [Column("GroupHTMLEditor")] + public bool? GroupHtmleditor { get; set; } + + [Column("GroupUseCAPTCHA")] + public bool? GroupUseCaptcha { get; set; } + + public int? GroupAttachmentMaxFileSize { get; set; } + + public int? GroupDiscussionActions { get; set; } + + public bool? GroupLogActivity { get; set; } + + public bool? GroupEnableOptIn { get; set; } + + public bool? GroupSendOptInConfirmation { get; set; } + + [Column("GroupOptInApprovalURL")] + [StringLength(450)] + public string? GroupOptInApprovalUrl { get; set; } + + [InverseProperty("ForumGroup")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [ForeignKey("GroupGroupId")] + [InverseProperty("ForumsForumGroups")] + public virtual CommunityGroup? GroupGroup { get; set; } + + [ForeignKey("GroupSiteId")] + [InverseProperty("ForumsForumGroups")] + public virtual CmsSite GroupSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ForumsForumPost.cs b/Migration.Tool.K11/Models/ForumsForumPost.cs new file mode 100644 index 00000000..54faf4d0 --- /dev/null +++ b/Migration.Tool.K11/Models/ForumsForumPost.cs @@ -0,0 +1,123 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Forums_ForumPost")] +[Index("PostApproved", Name = "IX_Forums_ForumPost_PostApproved")] +[Index("PostApprovedByUserId", Name = "IX_Forums_ForumPost_PostApprovedByUserID")] +[Index("PostForumId", Name = "IX_Forums_ForumPost_PostForumID")] +[Index("PostLevel", Name = "IX_Forums_ForumPost_PostLevel")] +[Index("PostParentId", Name = "IX_Forums_ForumPost_PostParentID")] +[Index("PostUserId", Name = "IX_Forums_ForumPost_PostUserID")] +public class ForumsForumPost +{ + [Key] + public int PostId { get; set; } + + [Column("PostForumID")] + public int PostForumId { get; set; } + + [Column("PostParentID")] + public int? PostParentId { get; set; } + + [Column("PostIDPath")] + public string PostIdpath { get; set; } = null!; + + public int PostLevel { get; set; } + + [StringLength(450)] + public string PostSubject { get; set; } = null!; + + [Column("PostUserID")] + public int? PostUserId { get; set; } + + [StringLength(200)] + public string PostUserName { get; set; } = null!; + + [StringLength(254)] + public string? PostUserMail { get; set; } + + public string? PostText { get; set; } + + public DateTime PostTime { get; set; } + + [Column("PostApprovedByUserID")] + public int? PostApprovedByUserId { get; set; } + + public int? PostThreadPosts { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserName { get; set; } + + public DateTime? PostThreadLastPostTime { get; set; } + + public string? PostUserSignature { get; set; } + + [Column("PostGUID")] + public Guid PostGuid { get; set; } + + public DateTime PostLastModified { get; set; } + + public bool? PostApproved { get; set; } + + public bool? PostIsLocked { get; set; } + + public int? PostIsAnswer { get; set; } + + public int PostStickOrder { get; set; } + + public int? PostViews { get; set; } + + public DateTime? PostLastEdit { get; set; } + + public string? PostInfo { get; set; } + + public int? PostAttachmentCount { get; set; } + + public int? PostType { get; set; } + + public int? PostThreadPostsAbsolute { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserNameAbsolute { get; set; } + + public DateTime? PostThreadLastPostTimeAbsolute { get; set; } + + public bool? PostQuestionSolved { get; set; } + + public int? PostIsNotAnswer { get; set; } + + [Column("PostSiteID")] + public int? PostSiteId { get; set; } + + [InverseProperty("AttachmentPost")] + public virtual ICollection ForumsAttachments { get; set; } = new List(); + + [InverseProperty("SubscriptionPost")] + public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); + + [InverseProperty("Post")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [InverseProperty("PostParent")] + public virtual ICollection InversePostParent { get; set; } = new List(); + + [ForeignKey("PostApprovedByUserId")] + [InverseProperty("ForumsForumPostPostApprovedByUsers")] + public virtual CmsUser? PostApprovedByUser { get; set; } + + [ForeignKey("PostForumId")] + [InverseProperty("ForumsForumPosts")] + public virtual ForumsForum PostForum { get; set; } = null!; + + [ForeignKey("PostParentId")] + [InverseProperty("InversePostParent")] + public virtual ForumsForumPost? PostParent { get; set; } + + [ForeignKey("PostUserId")] + [InverseProperty("ForumsForumPostPostUsers")] + public virtual CmsUser? PostUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/ForumsForumRole.cs b/Migration.Tool.K11/Models/ForumsForumRole.cs new file mode 100644 index 00000000..3d3ebb2b --- /dev/null +++ b/Migration.Tool.K11/Models/ForumsForumRole.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[PrimaryKey("ForumId", "RoleId", "PermissionId")] +[Table("Forums_ForumRoles")] +[Index("PermissionId", Name = "IX_Forums_ForumRoles_PermissionID")] +[Index("RoleId", Name = "IX_Forums_ForumRoles_RoleID")] +public class ForumsForumRole +{ + [Key] + [Column("ForumID")] + public int ForumId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("ForumId")] + [InverseProperty("ForumsForumRoles")] + public virtual ForumsForum Forum { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("ForumsForumRoles")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("ForumsForumRoles")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ForumsForumSubscription.cs b/Migration.Tool.K11/Models/ForumsForumSubscription.cs new file mode 100644 index 00000000..b3d7e04d --- /dev/null +++ b/Migration.Tool.K11/Models/ForumsForumSubscription.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Forums_ForumSubscription")] +[Index("SubscriptionForumId", Name = "IX_Forums_ForumSubscription_SubscriptionForumID")] +[Index("SubscriptionPostId", Name = "IX_Forums_ForumSubscription_SubscriptionPostID")] +[Index("SubscriptionUserId", Name = "IX_Forums_ForumSubscription_SubscriptionUserID")] +public class ForumsForumSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionUserID")] + public int? SubscriptionUserId { get; set; } + + [StringLength(254)] + public string? SubscriptionEmail { get; set; } + + [Column("SubscriptionForumID")] + public int SubscriptionForumId { get; set; } + + [Column("SubscriptionPostID")] + public int? SubscriptionPostId { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public DateTime SubscriptionLastModified { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [ForeignKey("SubscriptionForumId")] + [InverseProperty("ForumsForumSubscriptions")] + public virtual ForumsForum SubscriptionForum { get; set; } = null!; + + [ForeignKey("SubscriptionPostId")] + [InverseProperty("ForumsForumSubscriptions")] + public virtual ForumsForumPost? SubscriptionPost { get; set; } + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("ForumsForumSubscriptions")] + public virtual CmsUser? SubscriptionUser { get; set; } +} diff --git a/Migration.Tool.K11/Models/ForumsUserFavorite.cs b/Migration.Tool.K11/Models/ForumsUserFavorite.cs new file mode 100644 index 00000000..eda27230 --- /dev/null +++ b/Migration.Tool.K11/Models/ForumsUserFavorite.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Forums_UserFavorites")] +[Index("ForumId", Name = "IX_Forums_UserFavorites_ForumID")] +[Index("PostId", Name = "IX_Forums_UserFavorites_PostID")] +[Index("SiteId", Name = "IX_Forums_UserFavorites_SiteID")] +[Index("UserId", Name = "IX_Forums_UserFavorites_UserID")] +[Index("UserId", "PostId", "ForumId", Name = "IX_Forums_UserFavorites_UserID_PostID_ForumID", IsUnique = true)] +public class ForumsUserFavorite +{ + [Key] + [Column("FavoriteID")] + public int FavoriteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("PostID")] + public int? PostId { get; set; } + + [Column("ForumID")] + public int? ForumId { get; set; } + + [StringLength(100)] + public string? FavoriteName { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [Column("FavoriteGUID")] + public Guid FavoriteGuid { get; set; } + + public DateTime FavoriteLastModified { get; set; } + + [ForeignKey("ForumId")] + [InverseProperty("ForumsUserFavorites")] + public virtual ForumsForum? Forum { get; set; } + + [ForeignKey("PostId")] + [InverseProperty("ForumsUserFavorites")] + public virtual ForumsForumPost? Post { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("ForumsUserFavorites")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("ForumsUserFavorites")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/IntegrationConnector.cs b/Migration.Tool.K11/Models/IntegrationConnector.cs new file mode 100644 index 00000000..ff00c725 --- /dev/null +++ b/Migration.Tool.K11/Models/IntegrationConnector.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Integration_Connector")] +[Index("ConnectorEnabled", Name = "IX_Integration_Connector_ConnectorEnabled")] +public class IntegrationConnector +{ + [Key] + [Column("ConnectorID")] + public int ConnectorId { get; set; } + + [StringLength(100)] + public string ConnectorName { get; set; } = null!; + + [StringLength(440)] + public string ConnectorDisplayName { get; set; } = null!; + + [StringLength(400)] + public string ConnectorAssemblyName { get; set; } = null!; + + [StringLength(400)] + public string ConnectorClassName { get; set; } = null!; + + [Required] + public bool? ConnectorEnabled { get; set; } + + public DateTime ConnectorLastModified { get; set; } + + [InverseProperty("SynchronizationConnector")] + public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/IntegrationSyncLog.cs b/Migration.Tool.K11/Models/IntegrationSyncLog.cs new file mode 100644 index 00000000..ee449705 --- /dev/null +++ b/Migration.Tool.K11/Models/IntegrationSyncLog.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Integration_SyncLog")] +[Index("SyncLogSynchronizationId", Name = "IX_Integration_SyncLog_SyncLogTaskID")] +public class IntegrationSyncLog +{ + [Key] + [Column("SyncLogID")] + public int SyncLogId { get; set; } + + [Column("SyncLogSynchronizationID")] + public int SyncLogSynchronizationId { get; set; } + + public DateTime SyncLogTime { get; set; } + + public string? SyncLogErrorMessage { get; set; } + + [ForeignKey("SyncLogSynchronizationId")] + [InverseProperty("IntegrationSyncLogs")] + public virtual IntegrationSynchronization SyncLogSynchronization { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/IntegrationSynchronization.cs b/Migration.Tool.K11/Models/IntegrationSynchronization.cs new file mode 100644 index 00000000..8b8d56e6 --- /dev/null +++ b/Migration.Tool.K11/Models/IntegrationSynchronization.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Integration_Synchronization")] +[Index("SynchronizationConnectorId", Name = "IX_Integration_Synchronization_SynchronizationConnectorID")] +[Index("SynchronizationTaskId", Name = "IX_Integration_Synchronization_SynchronizationTaskID")] +public class IntegrationSynchronization +{ + [Key] + [Column("SynchronizationID")] + public int SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int SynchronizationTaskId { get; set; } + + [Column("SynchronizationConnectorID")] + public int SynchronizationConnectorId { get; set; } + + public DateTime SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + public bool? SynchronizationIsRunning { get; set; } + + [InverseProperty("SyncLogSynchronization")] + public virtual ICollection IntegrationSyncLogs { get; set; } = new List(); + + [ForeignKey("SynchronizationConnectorId")] + [InverseProperty("IntegrationSynchronizations")] + public virtual IntegrationConnector SynchronizationConnector { get; set; } = null!; + + [ForeignKey("SynchronizationTaskId")] + [InverseProperty("IntegrationSynchronizations")] + public virtual IntegrationTask SynchronizationTask { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/IntegrationTask.cs b/Migration.Tool.K11/Models/IntegrationTask.cs new file mode 100644 index 00000000..27526823 --- /dev/null +++ b/Migration.Tool.K11/Models/IntegrationTask.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Integration_Task")] +[Index("TaskIsInbound", Name = "IX_Integration_Task_TaskIsInbound")] +[Index("TaskSiteId", Name = "IX_Integration_Task_TaskSiteID")] +[Index("TaskType", Name = "IX_Integration_Task_TaskType")] +public class IntegrationTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool TaskIsInbound { get; set; } + + [StringLength(50)] + public string? TaskProcessType { get; set; } + + public string TaskData { get; set; } = null!; + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(50)] + public string? TaskDataType { get; set; } + + [InverseProperty("SynchronizationTask")] + public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); + + [ForeignKey("TaskSiteId")] + [InverseProperty("IntegrationTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/IntranetPortalDepartment.cs b/Migration.Tool.K11/Models/IntranetPortalDepartment.cs similarity index 93% rename from Migration.Toolkit.K11/Models/IntranetPortalDepartment.cs rename to Migration.Tool.K11/Models/IntranetPortalDepartment.cs index 059d86a0..8efb15dd 100644 --- a/Migration.Toolkit.K11/Models/IntranetPortalDepartment.cs +++ b/Migration.Tool.K11/Models/IntranetPortalDepartment.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("IntranetPortal_Department")] public class IntranetPortalDepartment diff --git a/Migration.Toolkit.K11/Models/IntranetPortalWorkingEnvironment.cs b/Migration.Tool.K11/Models/IntranetPortalWorkingEnvironment.cs similarity index 93% rename from Migration.Toolkit.K11/Models/IntranetPortalWorkingEnvironment.cs rename to Migration.Tool.K11/Models/IntranetPortalWorkingEnvironment.cs index 37aa3554..b4a46b20 100644 --- a/Migration.Toolkit.K11/Models/IntranetPortalWorkingEnvironment.cs +++ b/Migration.Tool.K11/Models/IntranetPortalWorkingEnvironment.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("IntranetPortal_WorkingEnvironment")] public class IntranetPortalWorkingEnvironment diff --git a/Migration.Tool.K11/Models/MediaFile.cs b/Migration.Tool.K11/Models/MediaFile.cs new file mode 100644 index 00000000..642274b8 --- /dev/null +++ b/Migration.Tool.K11/Models/MediaFile.cs @@ -0,0 +1,77 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Media_File")] +[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] +[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] +[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] +[Index("FileSiteId", "FileGuid", Name = "IX_Media_File_FileSiteID_FileGUID")] +public class MediaFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string FileTitle { get; set; } = null!; + + public string FileDescription { get; set; } = null!; + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public string FilePath { get; set; } = null!; + + public long FileSize { get; set; } + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileLibraryID")] + public int FileLibraryId { get; set; } + + [Column("FileSiteID")] + public int FileSiteId { get; set; } + + [Column("FileCreatedByUserID")] + public int? FileCreatedByUserId { get; set; } + + public DateTime FileCreatedWhen { get; set; } + + [Column("FileModifiedByUserID")] + public int? FileModifiedByUserId { get; set; } + + public DateTime FileModifiedWhen { get; set; } + + public string? FileCustomData { get; set; } + + [ForeignKey("FileCreatedByUserId")] + [InverseProperty("MediaFileFileCreatedByUsers")] + public virtual CmsUser? FileCreatedByUser { get; set; } + + [ForeignKey("FileLibraryId")] + [InverseProperty("MediaFiles")] + public virtual MediaLibrary FileLibrary { get; set; } = null!; + + [ForeignKey("FileModifiedByUserId")] + [InverseProperty("MediaFileFileModifiedByUsers")] + public virtual CmsUser? FileModifiedByUser { get; set; } + + [ForeignKey("FileSiteId")] + [InverseProperty("MediaFiles")] + public virtual CmsSite FileSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/MediaLibrary.cs b/Migration.Tool.K11/Models/MediaLibrary.cs new file mode 100644 index 00000000..e318717d --- /dev/null +++ b/Migration.Tool.K11/Models/MediaLibrary.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Media_Library")] +[Index("LibraryGroupId", Name = "IX_Media_Library_LibraryGroupID")] +[Index("LibrarySiteId", "LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] +public class MediaLibrary +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [StringLength(250)] + public string LibraryName { get; set; } = null!; + + [StringLength(250)] + public string LibraryDisplayName { get; set; } = null!; + + public string? LibraryDescription { get; set; } + + [StringLength(250)] + public string LibraryFolder { get; set; } = null!; + + public int? LibraryAccess { get; set; } + + [Column("LibraryGroupID")] + public int? LibraryGroupId { get; set; } + + [Column("LibrarySiteID")] + public int LibrarySiteId { get; set; } + + [Column("LibraryGUID")] + public Guid? LibraryGuid { get; set; } + + public DateTime? LibraryLastModified { get; set; } + + [StringLength(450)] + public string? LibraryTeaserPath { get; set; } + + [Column("LibraryTeaserGUID")] + public Guid? LibraryTeaserGuid { get; set; } + + [ForeignKey("LibraryGroupId")] + [InverseProperty("MediaLibraries")] + public virtual CommunityGroup? LibraryGroup { get; set; } + + [ForeignKey("LibrarySiteId")] + [InverseProperty("MediaLibraries")] + public virtual CmsSite LibrarySite { get; set; } = null!; + + [InverseProperty("FileLibrary")] + public virtual ICollection MediaFiles { get; set; } = new List(); + + [InverseProperty("Library")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/MediaLibraryRolePermission.cs b/Migration.Tool.K11/Models/MediaLibraryRolePermission.cs new file mode 100644 index 00000000..ccd5c672 --- /dev/null +++ b/Migration.Tool.K11/Models/MediaLibraryRolePermission.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[PrimaryKey("LibraryId", "RoleId", "PermissionId")] +[Table("Media_LibraryRolePermission")] +[Index("PermissionId", Name = "IX_Media_LibraryRolePermission_PermissionID")] +[Index("RoleId", Name = "IX_Media_LibraryRolePermission_RoleID")] +public class MediaLibraryRolePermission +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("LibraryId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual MediaLibrary Library { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/MessagingMessage.cs b/Migration.Tool.K11/Models/MessagingMessage.cs similarity index 97% rename from Migration.Toolkit.K11/Models/MessagingMessage.cs rename to Migration.Tool.K11/Models/MessagingMessage.cs index dbe23202..b963e03b 100644 --- a/Migration.Toolkit.K11/Models/MessagingMessage.cs +++ b/Migration.Tool.K11/Models/MessagingMessage.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("Messaging_Message")] [Index("MessageSenderUserId", "MessageSent", "MessageSenderDeleted", Name = "IX_Messaging_Message_MessageSenderUserID_MessageSent_MessageSenderDeleted")] diff --git a/Migration.Tool.K11/Models/NewsletterAbtest.cs b/Migration.Tool.K11/Models/NewsletterAbtest.cs new file mode 100644 index 00000000..ad3e640a --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterAbtest.cs @@ -0,0 +1,53 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_ABTest")] +[Index("TestIssueId", Name = "IX_Newsletter_ABTest_TestIssueID", IsUnique = true)] +[Index("TestWinnerIssueId", Name = "IX_Newsletter_ABTest_TestWinnerIssueID")] +[Index("TestWinnerScheduledTaskId", Name = "IX_Newsletter_ABTest_TestWinnerScheduledTaskID")] +public class NewsletterAbtest +{ + [Key] + [Column("TestID")] + public int TestId { get; set; } + + [Column("TestIssueID")] + public int TestIssueId { get; set; } + + public int TestWinnerOption { get; set; } + + public int? TestSelectWinnerAfter { get; set; } + + [Column("TestWinnerIssueID")] + public int? TestWinnerIssueId { get; set; } + + public DateTime? TestWinnerSelected { get; set; } + + public DateTime TestLastModified { get; set; } + + [Column("TestGUID")] + public Guid TestGuid { get; set; } + + [Column("TestWinnerScheduledTaskID")] + public int? TestWinnerScheduledTaskId { get; set; } + + public int TestSizePercentage { get; set; } + + public int? TestNumberPerVariantEmails { get; set; } + + [ForeignKey("TestIssueId")] + [InverseProperty("NewsletterAbtestTestIssue")] + public virtual NewsletterNewsletterIssue TestIssue { get; set; } = null!; + + [ForeignKey("TestWinnerIssueId")] + [InverseProperty("NewsletterAbtestTestWinnerIssues")] + public virtual NewsletterNewsletterIssue? TestWinnerIssue { get; set; } + + [ForeignKey("TestWinnerScheduledTaskId")] + [InverseProperty("NewsletterAbtests")] + public virtual CmsScheduledTask? TestWinnerScheduledTask { get; set; } +} diff --git a/Migration.Tool.K11/Models/NewsletterClickedLink.cs b/Migration.Tool.K11/Models/NewsletterClickedLink.cs new file mode 100644 index 00000000..55b9e64f --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterClickedLink.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_ClickedLink")] +[Index("ClickedLinkNewsletterLinkId", Name = "IX_Newsletter_ClickedLink_ClickedLinkNewsletterLinkID")] +public class NewsletterClickedLink +{ + [Key] + [Column("ClickedLinkID")] + public int ClickedLinkId { get; set; } + + public Guid ClickedLinkGuid { get; set; } + + [StringLength(254)] + public string ClickedLinkEmail { get; set; } = null!; + + [Column("ClickedLinkNewsletterLinkID")] + public int ClickedLinkNewsletterLinkId { get; set; } + + public DateTime? ClickedLinkTime { get; set; } + + [ForeignKey("ClickedLinkNewsletterLinkId")] + [InverseProperty("NewsletterClickedLinks")] + public virtual NewsletterLink ClickedLinkNewsletterLink { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/NewsletterEmail.cs b/Migration.Tool.K11/Models/NewsletterEmail.cs new file mode 100644 index 00000000..cc76ed06 --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterEmail.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_Emails")] +[Index("EmailGuid", Name = "IX_Newsletter_Emails_EmailGUID", IsUnique = true)] +[Index("EmailNewsletterIssueId", Name = "IX_Newsletter_Emails_EmailNewsletterIssueID")] +[Index("EmailSending", Name = "IX_Newsletter_Emails_EmailSending")] +[Index("EmailSiteId", Name = "IX_Newsletter_Emails_EmailSiteID")] +[Index("EmailSubscriberId", Name = "IX_Newsletter_Emails_EmailSubscriberID")] +public class NewsletterEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [Column("EmailNewsletterIssueID")] + public int EmailNewsletterIssueId { get; set; } + + [Column("EmailSubscriberID")] + public int? EmailSubscriberId { get; set; } + + [Column("EmailSiteID")] + public int EmailSiteId { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + public bool? EmailSending { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + [Column("EmailContactID")] + public int? EmailContactId { get; set; } + + [StringLength(254)] + public string? EmailAddress { get; set; } + + [ForeignKey("EmailNewsletterIssueId")] + [InverseProperty("NewsletterEmails")] + public virtual NewsletterNewsletterIssue EmailNewsletterIssue { get; set; } = null!; + + [ForeignKey("EmailSiteId")] + [InverseProperty("NewsletterEmails")] + public virtual CmsSite EmailSite { get; set; } = null!; + + [ForeignKey("EmailSubscriberId")] + [InverseProperty("NewsletterEmails")] + public virtual NewsletterSubscriber? EmailSubscriber { get; set; } +} diff --git a/Migration.Tool.K11/Models/NewsletterEmailTemplate.cs b/Migration.Tool.K11/Models/NewsletterEmailTemplate.cs new file mode 100644 index 00000000..40647851 --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterEmailTemplate.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_EmailTemplate")] +[Index("TemplateSiteId", "TemplateName", Name = "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateName", IsUnique = true)] +public class NewsletterEmailTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(250)] + public string TemplateDisplayName { get; set; } = null!; + + [StringLength(250)] + public string TemplateName { get; set; } = null!; + + [Column("TemplateSiteID")] + public int TemplateSiteId { get; set; } + + [StringLength(50)] + public string TemplateType { get; set; } = null!; + + [Column("TemplateGUID")] + public Guid TemplateGuid { get; set; } + + public DateTime TemplateLastModified { get; set; } + + [StringLength(450)] + public string? TemplateSubject { get; set; } + + [Column("TemplateThumbnailGUID")] + public Guid? TemplateThumbnailGuid { get; set; } + + public string? TemplateDescription { get; set; } + + [StringLength(200)] + public string? TemplateIconClass { get; set; } + + public string? TemplateCode { get; set; } + + [Column("TemplateInlineCSS")] + public bool TemplateInlineCss { get; set; } + + [InverseProperty("Template")] + public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); + + [InverseProperty("IssueTemplate")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [InverseProperty("NewsletterOptInTemplate")] + public virtual ICollection NewsletterNewsletterNewsletterOptInTemplates { get; set; } = new List(); + + [InverseProperty("NewsletterUnsubscriptionTemplate")] + public virtual ICollection NewsletterNewsletterNewsletterUnsubscriptionTemplates { get; set; } = new List(); + + [ForeignKey("TemplateSiteId")] + [InverseProperty("NewsletterEmailTemplates")] + public virtual CmsSite TemplateSite { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("Templates")] + public virtual ICollection Newsletters { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/NewsletterEmailWidget.cs b/Migration.Tool.K11/Models/NewsletterEmailWidget.cs new file mode 100644 index 00000000..4381e609 --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterEmailWidget.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_EmailWidget")] +[Index("EmailWidgetSiteId", Name = "IX_Newsletter_EmailWidget_EmailWidgetSiteID")] +public class NewsletterEmailWidget +{ + [Key] + [Column("EmailWidgetID")] + public int EmailWidgetId { get; set; } + + public Guid EmailWidgetGuid { get; set; } + + public DateTime EmailWidgetLastModified { get; set; } + + [StringLength(250)] + public string EmailWidgetDisplayName { get; set; } = null!; + + [StringLength(250)] + public string EmailWidgetName { get; set; } = null!; + + public string? EmailWidgetDescription { get; set; } + + public string? EmailWidgetCode { get; set; } + + [Column("EmailWidgetSiteID")] + public int EmailWidgetSiteId { get; set; } + + [Column("EmailWidgetThumbnailGUID")] + public Guid? EmailWidgetThumbnailGuid { get; set; } + + [StringLength(200)] + public string? EmailWidgetIconCssClass { get; set; } + + public string? EmailWidgetProperties { get; set; } + + [ForeignKey("EmailWidgetSiteId")] + [InverseProperty("NewsletterEmailWidgets")] + public virtual CmsSite EmailWidgetSite { get; set; } = null!; + + [InverseProperty("EmailWidget")] + public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/NewsletterEmailWidgetTemplate.cs b/Migration.Tool.K11/Models/NewsletterEmailWidgetTemplate.cs new file mode 100644 index 00000000..eee8ed4d --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterEmailWidgetTemplate.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_EmailWidgetTemplate")] +[Index("EmailWidgetId", Name = "IX_Newsletter_EmailWidgetTemplate_EmailWidgetID")] +[Index("TemplateId", Name = "IX_Newsletter_EmailWidgetTemplate_TemplateID")] +public class NewsletterEmailWidgetTemplate +{ + [Key] + [Column("EmailWidgetTemplateID")] + public int EmailWidgetTemplateId { get; set; } + + [Column("EmailWidgetID")] + public int EmailWidgetId { get; set; } + + [Column("TemplateID")] + public int TemplateId { get; set; } + + [ForeignKey("EmailWidgetId")] + [InverseProperty("NewsletterEmailWidgetTemplates")] + public virtual NewsletterEmailWidget EmailWidget { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("NewsletterEmailWidgetTemplates")] + public virtual NewsletterEmailTemplate Template { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/NewsletterIssueContactGroup.cs b/Migration.Tool.K11/Models/NewsletterIssueContactGroup.cs new file mode 100644 index 00000000..70dba6f9 --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterIssueContactGroup.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_IssueContactGroup")] +[Index("ContactGroupId", Name = "IX_Newsletter_IssueContactGroup_ContactGroupID")] +public class NewsletterIssueContactGroup +{ + [Key] + [Column("IssueContactGroupID")] + public int IssueContactGroupId { get; set; } + + [Column("IssueID")] + public int IssueId { get; set; } + + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [ForeignKey("ContactGroupId")] + [InverseProperty("NewsletterIssueContactGroups")] + public virtual OmContactGroup ContactGroup { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/NewsletterLink.cs b/Migration.Tool.K11/Models/NewsletterLink.cs new file mode 100644 index 00000000..2acf07cf --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterLink.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_Link")] +[Index("LinkIssueId", Name = "IX_Newsletter_Link_LinkIssueID")] +public class NewsletterLink +{ + [Key] + [Column("LinkID")] + public int LinkId { get; set; } + + [Column("LinkIssueID")] + public int LinkIssueId { get; set; } + + public string LinkTarget { get; set; } = null!; + + [StringLength(450)] + public string LinkDescription { get; set; } = null!; + + [Column("LinkGUID")] + public Guid LinkGuid { get; set; } + + [ForeignKey("LinkIssueId")] + [InverseProperty("NewsletterLinks")] + public virtual NewsletterNewsletterIssue LinkIssue { get; set; } = null!; + + [InverseProperty("ClickedLinkNewsletterLink")] + public virtual ICollection NewsletterClickedLinks { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/NewsletterNewsletter.cs b/Migration.Tool.K11/Models/NewsletterNewsletter.cs new file mode 100644 index 00000000..14f02dd7 --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterNewsletter.cs @@ -0,0 +1,115 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_Newsletter")] +[Index("NewsletterDynamicScheduledTaskId", Name = "IX_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID")] +[Index("NewsletterOptInTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterOptInTemplateID")] +[Index("NewsletterSiteId", "NewsletterName", Name = "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterName", IsUnique = true)] +[Index("NewsletterSubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterSubscriptionTemplateID")] +[Index("NewsletterUnsubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID")] +public class NewsletterNewsletter +{ + [Key] + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + [StringLength(250)] + public string NewsletterDisplayName { get; set; } = null!; + + [StringLength(250)] + public string NewsletterName { get; set; } = null!; + + [Column("NewsletterSubscriptionTemplateID")] + public int? NewsletterSubscriptionTemplateId { get; set; } + + [Column("NewsletterUnsubscriptionTemplateID")] + public int NewsletterUnsubscriptionTemplateId { get; set; } + + [StringLength(200)] + public string NewsletterSenderName { get; set; } = null!; + + [StringLength(254)] + public string NewsletterSenderEmail { get; set; } = null!; + + [StringLength(100)] + public string? NewsletterDynamicSubject { get; set; } + + [Column("NewsletterDynamicURL")] + [StringLength(500)] + public string? NewsletterDynamicUrl { get; set; } + + [Column("NewsletterDynamicScheduledTaskID")] + public int? NewsletterDynamicScheduledTaskId { get; set; } + + [Column("NewsletterSiteID")] + public int NewsletterSiteId { get; set; } + + [Column("NewsletterGUID")] + public Guid NewsletterGuid { get; set; } + + [StringLength(1000)] + public string? NewsletterUnsubscribeUrl { get; set; } + + [StringLength(500)] + public string? NewsletterBaseUrl { get; set; } + + public DateTime NewsletterLastModified { get; set; } + + public bool? NewsletterEnableOptIn { get; set; } + + [Column("NewsletterOptInTemplateID")] + public int? NewsletterOptInTemplateId { get; set; } + + public bool? NewsletterSendOptInConfirmation { get; set; } + + [Column("NewsletterOptInApprovalURL")] + [StringLength(450)] + public string? NewsletterOptInApprovalUrl { get; set; } + + public bool? NewsletterTrackOpenEmails { get; set; } + + public bool? NewsletterTrackClickedLinks { get; set; } + + [StringLength(998)] + public string? NewsletterDraftEmails { get; set; } + + public bool? NewsletterLogActivity { get; set; } + + [StringLength(5)] + public string NewsletterSource { get; set; } = null!; + + public int NewsletterType { get; set; } + + [ForeignKey("NewsletterDynamicScheduledTaskId")] + [InverseProperty("NewsletterNewsletters")] + public virtual CmsScheduledTask? NewsletterDynamicScheduledTask { get; set; } + + [InverseProperty("IssueNewsletter")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [ForeignKey("NewsletterOptInTemplateId")] + [InverseProperty("NewsletterNewsletterNewsletterOptInTemplates")] + public virtual NewsletterEmailTemplate? NewsletterOptInTemplate { get; set; } + + [ForeignKey("NewsletterSiteId")] + [InverseProperty("NewsletterNewsletters")] + public virtual CmsSite NewsletterSite { get; set; } = null!; + + [InverseProperty("Newsletter")] + public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); + + [ForeignKey("NewsletterUnsubscriptionTemplateId")] + [InverseProperty("NewsletterNewsletterNewsletterUnsubscriptionTemplates")] + public virtual NewsletterEmailTemplate NewsletterUnsubscriptionTemplate { get; set; } = null!; + + [InverseProperty("UnsubscriptionNewsletter")] + public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); + + [ForeignKey("NewsletterId")] + [InverseProperty("Newsletters")] + public virtual ICollection Templates { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/NewsletterNewsletterIssue.cs b/Migration.Tool.K11/Models/NewsletterNewsletterIssue.cs new file mode 100644 index 00000000..f369de44 --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterNewsletterIssue.cs @@ -0,0 +1,125 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_NewsletterIssue")] +[Index("IssueNewsletterId", Name = "IX_Newsletter_NewsletterIssue_IssueNewsletterID")] +[Index("IssueScheduledTaskId", Name = "IX_Newsletter_NewsletterIssue_IssueScheduledTaskID")] +[Index("IssueSiteId", Name = "IX_Newsletter_NewsletterIssue_IssueSiteID")] +[Index("IssueTemplateId", Name = "IX_Newsletter_NewsletterIssue_IssueTemplateID")] +[Index("IssueVariantOfIssueId", Name = "IX_Newsletter_NewsletterIssue_IssueVariantOfIssueID")] +public class NewsletterNewsletterIssue +{ + [Key] + [Column("IssueID")] + public int IssueId { get; set; } + + [StringLength(450)] + public string IssueSubject { get; set; } = null!; + + public string IssueText { get; set; } = null!; + + public int IssueUnsubscribed { get; set; } + + [Column("IssueNewsletterID")] + public int IssueNewsletterId { get; set; } + + [Column("IssueTemplateID")] + public int? IssueTemplateId { get; set; } + + public int IssueSentEmails { get; set; } + + public DateTime? IssueMailoutTime { get; set; } + + [Column("IssueGUID")] + public Guid IssueGuid { get; set; } + + public DateTime IssueLastModified { get; set; } + + [Column("IssueSiteID")] + public int IssueSiteId { get; set; } + + public int? IssueOpenedEmails { get; set; } + + public int? IssueBounces { get; set; } + + public int? IssueStatus { get; set; } + + [Column("IssueIsABTest")] + public bool? IssueIsAbtest { get; set; } + + [Column("IssueVariantOfIssueID")] + public int? IssueVariantOfIssueId { get; set; } + + [StringLength(200)] + public string? IssueVariantName { get; set; } + + [StringLength(200)] + public string? IssueSenderName { get; set; } + + [StringLength(254)] + public string? IssueSenderEmail { get; set; } + + [Column("IssueScheduledTaskID")] + public int? IssueScheduledTaskId { get; set; } + + [Column("IssueUTMSource")] + [StringLength(200)] + public string? IssueUtmsource { get; set; } + + [Column("IssueUseUTM")] + public bool IssueUseUtm { get; set; } + + [Column("IssueUTMCampaign")] + [StringLength(200)] + public string? IssueUtmcampaign { get; set; } + + [StringLength(200)] + public string IssueDisplayName { get; set; } = null!; + + public string? IssueWidgets { get; set; } + + public string? IssuePreheader { get; set; } + + public string? IssuePlainText { get; set; } + + [InverseProperty("IssueVariantOfIssue")] + public virtual ICollection InverseIssueVariantOfIssue { get; set; } = new List(); + + [ForeignKey("IssueNewsletterId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual NewsletterNewsletter IssueNewsletter { get; set; } = null!; + + [ForeignKey("IssueSiteId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual CmsSite IssueSite { get; set; } = null!; + + [ForeignKey("IssueTemplateId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual NewsletterEmailTemplate? IssueTemplate { get; set; } + + [ForeignKey("IssueVariantOfIssueId")] + [InverseProperty("InverseIssueVariantOfIssue")] + public virtual NewsletterNewsletterIssue? IssueVariantOfIssue { get; set; } + + [InverseProperty("TestIssue")] + public virtual NewsletterAbtest? NewsletterAbtestTestIssue { get; set; } + + [InverseProperty("TestWinnerIssue")] + public virtual ICollection NewsletterAbtestTestWinnerIssues { get; set; } = new List(); + + [InverseProperty("EmailNewsletterIssue")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("LinkIssue")] + public virtual ICollection NewsletterLinks { get; set; } = new List(); + + [InverseProperty("OpenedEmailIssue")] + public virtual ICollection NewsletterOpenedEmails { get; set; } = new List(); + + [InverseProperty("UnsubscriptionFromIssue")] + public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/NewsletterOpenedEmail.cs b/Migration.Tool.K11/Models/NewsletterOpenedEmail.cs new file mode 100644 index 00000000..b850d129 --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterOpenedEmail.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_OpenedEmail")] +[Index("OpenedEmailIssueId", Name = "IX_Newsletter_OpenedEmail_OpenedEmailIssueID")] +public class NewsletterOpenedEmail +{ + [Key] + [Column("OpenedEmailID")] + public int OpenedEmailId { get; set; } + + [StringLength(254)] + public string OpenedEmailEmail { get; set; } = null!; + + public Guid OpenedEmailGuid { get; set; } + + public DateTime? OpenedEmailTime { get; set; } + + [Column("OpenedEmailIssueID")] + public int OpenedEmailIssueId { get; set; } + + [ForeignKey("OpenedEmailIssueId")] + [InverseProperty("NewsletterOpenedEmails")] + public virtual NewsletterNewsletterIssue OpenedEmailIssue { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/NewsletterSubscriber.cs b/Migration.Tool.K11/Models/NewsletterSubscriber.cs new file mode 100644 index 00000000..48e77bd9 --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterSubscriber.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_Subscriber")] +[Index("SubscriberEmail", Name = "IX_Newsletter_Subscriber_SubscriberEmail")] +[Index("SubscriberType", "SubscriberRelatedId", Name = "IX_Newsletter_Subscriber_SubscriberType_SubscriberRelatedID")] +public class NewsletterSubscriber +{ + [Key] + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [StringLength(254)] + public string? SubscriberEmail { get; set; } + + [StringLength(200)] + public string? SubscriberFirstName { get; set; } + + [StringLength(200)] + public string? SubscriberLastName { get; set; } + + [Column("SubscriberSiteID")] + public int SubscriberSiteId { get; set; } + + [Column("SubscriberGUID")] + public Guid SubscriberGuid { get; set; } + + public string? SubscriberCustomData { get; set; } + + [StringLength(100)] + public string? SubscriberType { get; set; } + + [Column("SubscriberRelatedID")] + public int SubscriberRelatedId { get; set; } + + public DateTime SubscriberLastModified { get; set; } + + [StringLength(440)] + public string? SubscriberFullName { get; set; } + + public int? SubscriberBounces { get; set; } + + [InverseProperty("EmailSubscriber")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("Subscriber")] + public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); + + [ForeignKey("SubscriberSiteId")] + [InverseProperty("NewsletterSubscribers")] + public virtual CmsSite SubscriberSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/NewsletterSubscriberNewsletter.cs b/Migration.Tool.K11/Models/NewsletterSubscriberNewsletter.cs new file mode 100644 index 00000000..81e845c0 --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterSubscriberNewsletter.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_SubscriberNewsletter")] +[Index("NewsletterId", "SubscriptionApproved", Name = "IX_Newsletter_SubscriberNewsletter_NewsletterID_SubscriptionApproved")] +[Index("SubscriberId", "NewsletterId", Name = "UQ_Newsletter_SubscriberNewsletter", IsUnique = true)] +public class NewsletterSubscriberNewsletter +{ + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + public DateTime SubscribedWhen { get; set; } + + public bool? SubscriptionApproved { get; set; } + + public DateTime? SubscriptionApprovedWhen { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [Key] + [Column("SubscriberNewsletterID")] + public int SubscriberNewsletterId { get; set; } + + [ForeignKey("NewsletterId")] + [InverseProperty("NewsletterSubscriberNewsletters")] + public virtual NewsletterNewsletter Newsletter { get; set; } = null!; + + [ForeignKey("SubscriberId")] + [InverseProperty("NewsletterSubscriberNewsletters")] + public virtual NewsletterSubscriber Subscriber { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/NewsletterUnsubscription.cs b/Migration.Tool.K11/Models/NewsletterUnsubscription.cs new file mode 100644 index 00000000..70a403ce --- /dev/null +++ b/Migration.Tool.K11/Models/NewsletterUnsubscription.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Newsletter_Unsubscription")] +[Index("UnsubscriptionEmail", "UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_Email_NewsletterID")] +[Index("UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_NewsletterID")] +[Index("UnsubscriptionFromIssueId", Name = "IX_Newsletter_Unsubscription_UnsubscriptionFromIssueID")] +public class NewsletterUnsubscription +{ + [Key] + [Column("UnsubscriptionID")] + public int UnsubscriptionId { get; set; } + + [StringLength(254)] + public string UnsubscriptionEmail { get; set; } = null!; + + public DateTime UnsubscriptionCreated { get; set; } + + [Column("UnsubscriptionNewsletterID")] + public int? UnsubscriptionNewsletterId { get; set; } + + [Column("UnsubscriptionFromIssueID")] + public int? UnsubscriptionFromIssueId { get; set; } + + [Column("UnsubscriptionGUID")] + public Guid UnsubscriptionGuid { get; set; } + + [ForeignKey("UnsubscriptionFromIssueId")] + [InverseProperty("NewsletterUnsubscriptions")] + public virtual NewsletterNewsletterIssue? UnsubscriptionFromIssue { get; set; } + + [ForeignKey("UnsubscriptionNewsletterId")] + [InverseProperty("NewsletterUnsubscriptions")] + public virtual NewsletterNewsletter? UnsubscriptionNewsletter { get; set; } +} diff --git a/Migration.Tool.K11/Models/NotificationGateway.cs b/Migration.Tool.K11/Models/NotificationGateway.cs new file mode 100644 index 00000000..6b983dcf --- /dev/null +++ b/Migration.Tool.K11/Models/NotificationGateway.cs @@ -0,0 +1,46 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("Notification_Gateway")] +public class NotificationGateway +{ + [Key] + [Column("GatewayID")] + public int GatewayId { get; set; } + + [StringLength(200)] + public string GatewayName { get; set; } = null!; + + [StringLength(200)] + public string GatewayDisplayName { get; set; } = null!; + + [StringLength(200)] + public string GatewayAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string GatewayClassName { get; set; } = null!; + + public string? GatewayDescription { get; set; } + + public bool? GatewaySupportsEmail { get; set; } + + public bool? GatewaySupportsPlainText { get; set; } + + [Column("GatewaySupportsHTMLText")] + public bool? GatewaySupportsHtmltext { get; set; } + + public DateTime GatewayLastModified { get; set; } + + [Column("GatewayGUID")] + public Guid GatewayGuid { get; set; } + + public bool? GatewayEnabled { get; set; } + + [InverseProperty("SubscriptionGateway")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("Gateway")] + public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/NotificationSubscription.cs b/Migration.Tool.K11/Models/NotificationSubscription.cs new file mode 100644 index 00000000..52c5c474 --- /dev/null +++ b/Migration.Tool.K11/Models/NotificationSubscription.cs @@ -0,0 +1,76 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Notification_Subscription")] +[Index("SubscriptionEventSource", "SubscriptionEventCode", "SubscriptionEventObjectId", Name = "IX_Notification_Subscription_SubscriptionEventSource_SubscriptionEventCode_SubscriptionEventObjectID")] +[Index("SubscriptionGatewayId", Name = "IX_Notification_Subscription_SubscriptionGatewayID")] +[Index("SubscriptionSiteId", Name = "IX_Notification_Subscription_SubscriptionSiteID")] +[Index("SubscriptionTemplateId", Name = "IX_Notification_Subscription_SubscriptionTemplateID")] +[Index("SubscriptionUserId", Name = "IX_Notification_Subscription_SubscriptionUserID")] +public class NotificationSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionGatewayID")] + public int SubscriptionGatewayId { get; set; } + + [Column("SubscriptionTemplateID")] + public int SubscriptionTemplateId { get; set; } + + [StringLength(100)] + public string? SubscriptionEventSource { get; set; } + + [StringLength(100)] + public string? SubscriptionEventCode { get; set; } + + [StringLength(250)] + public string SubscriptionEventDisplayName { get; set; } = null!; + + [Column("SubscriptionEventObjectID")] + public int? SubscriptionEventObjectId { get; set; } + + public DateTime SubscriptionTime { get; set; } + + [Column("SubscriptionUserID")] + public int SubscriptionUserId { get; set; } + + [StringLength(250)] + public string SubscriptionTarget { get; set; } = null!; + + public DateTime SubscriptionLastModified { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public string? SubscriptionEventData1 { get; set; } + + public string? SubscriptionEventData2 { get; set; } + + [Column("SubscriptionUseHTML")] + public bool? SubscriptionUseHtml { get; set; } + + [Column("SubscriptionSiteID")] + public int? SubscriptionSiteId { get; set; } + + [ForeignKey("SubscriptionGatewayId")] + [InverseProperty("NotificationSubscriptions")] + public virtual NotificationGateway SubscriptionGateway { get; set; } = null!; + + [ForeignKey("SubscriptionSiteId")] + [InverseProperty("NotificationSubscriptions")] + public virtual CmsSite? SubscriptionSite { get; set; } + + [ForeignKey("SubscriptionTemplateId")] + [InverseProperty("NotificationSubscriptions")] + public virtual NotificationTemplate SubscriptionTemplate { get; set; } = null!; + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("NotificationSubscriptions")] + public virtual CmsUser SubscriptionUser { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/NotificationTemplate.cs b/Migration.Tool.K11/Models/NotificationTemplate.cs new file mode 100644 index 00000000..2a3f20c4 --- /dev/null +++ b/Migration.Tool.K11/Models/NotificationTemplate.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Notification_Template")] +[Index("TemplateSiteId", Name = "IX_Notification_Template_TemplateSiteID")] +public class NotificationTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(200)] + public string TemplateName { get; set; } = null!; + + [StringLength(200)] + public string TemplateDisplayName { get; set; } = null!; + + [Column("TemplateSiteID")] + public int? TemplateSiteId { get; set; } + + public DateTime TemplateLastModified { get; set; } + + [Column("TemplateGUID")] + public Guid TemplateGuid { get; set; } + + [InverseProperty("SubscriptionTemplate")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("Template")] + public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); + + [ForeignKey("TemplateSiteId")] + [InverseProperty("NotificationTemplates")] + public virtual CmsSite? TemplateSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/NotificationTemplateText.cs b/Migration.Tool.K11/Models/NotificationTemplateText.cs new file mode 100644 index 00000000..f37f6077 --- /dev/null +++ b/Migration.Tool.K11/Models/NotificationTemplateText.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Notification_TemplateText")] +[Index("GatewayId", Name = "IX_Notification_TemplateText_GatewayID")] +[Index("TemplateId", Name = "IX_Notification_TemplateText_TemplateID")] +public class NotificationTemplateText +{ + [Key] + [Column("TemplateTextID")] + public int TemplateTextId { get; set; } + + [Column("TemplateID")] + public int TemplateId { get; set; } + + [Column("GatewayID")] + public int GatewayId { get; set; } + + [StringLength(250)] + public string TemplateSubject { get; set; } = null!; + + [Column("TemplateHTMLText")] + public string TemplateHtmltext { get; set; } = null!; + + public string TemplatePlainText { get; set; } = null!; + + [Column("TemplateTextGUID")] + public Guid TemplateTextGuid { get; set; } + + public DateTime TemplateTextLastModified { get; set; } + + [ForeignKey("GatewayId")] + [InverseProperty("NotificationTemplateTexts")] + public virtual NotificationGateway Gateway { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("NotificationTemplateTexts")] + public virtual NotificationTemplate Template { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/OmAbtest.cs b/Migration.Tool.K11/Models/OmAbtest.cs new file mode 100644 index 00000000..2ffe23ed --- /dev/null +++ b/Migration.Tool.K11/Models/OmAbtest.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_ABTest")] +[Index("AbtestSiteId", Name = "IX_OM_ABTest_SiteID")] +public class OmAbtest +{ + [Key] + [Column("ABTestID")] + public int AbtestId { get; set; } + + [Column("ABTestName")] + [StringLength(50)] + public string AbtestName { get; set; } = null!; + + [Column("ABTestDescription")] + public string? AbtestDescription { get; set; } + + [Column("ABTestCulture")] + [StringLength(50)] + public string? AbtestCulture { get; set; } + + [Column("ABTestOriginalPage")] + [StringLength(450)] + public string AbtestOriginalPage { get; set; } = null!; + + [Column("ABTestOpenFrom")] + public DateTime? AbtestOpenFrom { get; set; } + + [Column("ABTestOpenTo")] + public DateTime? AbtestOpenTo { get; set; } + + [Column("ABTestSiteID")] + public int AbtestSiteId { get; set; } + + [Column("ABTestGUID")] + public Guid AbtestGuid { get; set; } + + [Column("ABTestLastModified")] + public DateTime AbtestLastModified { get; set; } + + [Column("ABTestDisplayName")] + [StringLength(100)] + public string AbtestDisplayName { get; set; } = null!; + + [Column("ABTestIncludedTraffic")] + public int AbtestIncludedTraffic { get; set; } + + [Column("ABTestVisitorTargeting")] + public string? AbtestVisitorTargeting { get; set; } + + [Column("ABTestConversions")] + public string? AbtestConversions { get; set; } + + [Column("ABTestWinnerGUID")] + public Guid? AbtestWinnerGuid { get; set; } + + [ForeignKey("AbtestSiteId")] + [InverseProperty("OmAbtests")] + public virtual CmsSite AbtestSite { get; set; } = null!; + + [InverseProperty("AbvariantTest")] + public virtual ICollection OmAbvariants { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/OmAbvariant.cs b/Migration.Tool.K11/Models/OmAbvariant.cs new file mode 100644 index 00000000..31b05dd4 --- /dev/null +++ b/Migration.Tool.K11/Models/OmAbvariant.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_ABVariant")] +[Index("AbvariantSiteId", Name = "IX_OM_ABVariant_ABVariantSiteID")] +[Index("AbvariantTestId", Name = "IX_OM_ABVariant_ABVariantTestID")] +public class OmAbvariant +{ + [Key] + [Column("ABVariantID")] + public int AbvariantId { get; set; } + + [Column("ABVariantDisplayName")] + [StringLength(110)] + public string AbvariantDisplayName { get; set; } = null!; + + [Column("ABVariantName")] + [StringLength(50)] + public string AbvariantName { get; set; } = null!; + + [Column("ABVariantTestID")] + public int AbvariantTestId { get; set; } + + [Column("ABVariantPath")] + [StringLength(450)] + public string AbvariantPath { get; set; } = null!; + + [Column("ABVariantGUID")] + public Guid AbvariantGuid { get; set; } + + [Column("ABVariantLastModified")] + public DateTime AbvariantLastModified { get; set; } + + [Column("ABVariantSiteID")] + public int AbvariantSiteId { get; set; } + + [ForeignKey("AbvariantSiteId")] + [InverseProperty("OmAbvariants")] + public virtual CmsSite AbvariantSite { get; set; } = null!; + + [ForeignKey("AbvariantTestId")] + [InverseProperty("OmAbvariants")] + public virtual OmAbtest AbvariantTest { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/OmAccount.cs b/Migration.Tool.K11/Models/OmAccount.cs new file mode 100644 index 00000000..515153e5 --- /dev/null +++ b/Migration.Tool.K11/Models/OmAccount.cs @@ -0,0 +1,113 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_Account")] +[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] +[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] +[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] +[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] +[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] +[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] +[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] +public class OmAccount +{ + [Key] + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [ForeignKey("AccountCountryId")] + [InverseProperty("OmAccounts")] + public virtual CmsCountry? AccountCountry { get; set; } + + [ForeignKey("AccountOwnerUserId")] + [InverseProperty("OmAccounts")] + public virtual CmsUser? AccountOwnerUser { get; set; } + + [ForeignKey("AccountPrimaryContactId")] + [InverseProperty("OmAccountAccountPrimaryContacts")] + public virtual OmContact? AccountPrimaryContact { get; set; } + + [ForeignKey("AccountSecondaryContactId")] + [InverseProperty("OmAccountAccountSecondaryContacts")] + public virtual OmContact? AccountSecondaryContact { get; set; } + + [ForeignKey("AccountStateId")] + [InverseProperty("OmAccounts")] + public virtual CmsState? AccountState { get; set; } + + [ForeignKey("AccountStatusId")] + [InverseProperty("OmAccounts")] + public virtual OmAccountStatus? AccountStatus { get; set; } + + [ForeignKey("AccountSubsidiaryOfId")] + [InverseProperty("InverseAccountSubsidiaryOf")] + public virtual OmAccount? AccountSubsidiaryOf { get; set; } + + [InverseProperty("AccountSubsidiaryOf")] + public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); + + [InverseProperty("Account")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/OmAccountContact.cs b/Migration.Tool.K11/Models/OmAccountContact.cs new file mode 100644 index 00000000..97a78cd3 --- /dev/null +++ b/Migration.Tool.K11/Models/OmAccountContact.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_AccountContact")] +[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] +[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] +[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] +public class OmAccountContact +{ + [Key] + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("AccountId")] + [InverseProperty("OmAccountContacts")] + public virtual OmAccount Account { get; set; } = null!; + + [ForeignKey("ContactId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("ContactRoleId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContactRole? ContactRole { get; set; } +} diff --git a/Migration.Tool.K11/Models/OmAccountStatus.cs b/Migration.Tool.K11/Models/OmAccountStatus.cs new file mode 100644 index 00000000..b2f54f0e --- /dev/null +++ b/Migration.Tool.K11/Models/OmAccountStatus.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("OM_AccountStatus")] +public class OmAccountStatus +{ + [Key] + [Column("AccountStatusID")] + public int AccountStatusId { get; set; } + + [StringLength(200)] + public string AccountStatusName { get; set; } = null!; + + [StringLength(200)] + public string AccountStatusDisplayName { get; set; } = null!; + + public string? AccountStatusDescription { get; set; } + + [InverseProperty("AccountStatus")] + public virtual ICollection OmAccounts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/OmActivity.cs b/Migration.Tool.K11/Models/OmActivity.cs new file mode 100644 index 00000000..41f44708 --- /dev/null +++ b/Migration.Tool.K11/Models/OmActivity.cs @@ -0,0 +1,78 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_Activity")] +[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] +[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] +[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] +[Index("ActivitySiteId", Name = "IX_OM_Activity_ActivitySiteID")] +[Index("ActivityType", "ActivityItemId", "ActivityNodeId", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityNodeID_ActivityUTMSource_ActivityUTMContent_ActivityCampaign")] +public class OmActivity +{ + [Key] + [Column("ActivityID")] + public int ActivityId { get; set; } + + [Column("ActivityContactID")] + public int ActivityContactId { get; set; } + + public DateTime? ActivityCreated { get; set; } + + [StringLength(250)] + public string ActivityType { get; set; } = null!; + + [Column("ActivityItemID")] + public int? ActivityItemId { get; set; } + + [Column("ActivityItemDetailID")] + public int? ActivityItemDetailId { get; set; } + + [StringLength(250)] + public string? ActivityValue { get; set; } + + [Column("ActivityURL")] + public string? ActivityUrl { get; set; } + + [StringLength(250)] + public string? ActivityTitle { get; set; } + + [Column("ActivitySiteID")] + public int ActivitySiteId { get; set; } + + public string? ActivityComment { get; set; } + + [StringLength(200)] + public string? ActivityCampaign { get; set; } + + [Column("ActivityURLReferrer")] + public string? ActivityUrlreferrer { get; set; } + + [StringLength(10)] + public string? ActivityCulture { get; set; } + + [Column("ActivityNodeID")] + public int? ActivityNodeId { get; set; } + + [Column("ActivityUTMSource")] + [StringLength(200)] + public string? ActivityUtmsource { get; set; } + + [Column("ActivityABVariantName")] + [StringLength(200)] + public string? ActivityAbvariantName { get; set; } + + [Column("ActivityMVTCombinationName")] + [StringLength(200)] + public string? ActivityMvtcombinationName { get; set; } + + [Column("ActivityURLHash")] + public long ActivityUrlhash { get; set; } + + [Column("ActivityUTMContent")] + [StringLength(200)] + public string? ActivityUtmcontent { get; set; } +} diff --git a/Migration.Tool.K11/Models/OmActivityRecalculationQueue.cs b/Migration.Tool.K11/Models/OmActivityRecalculationQueue.cs new file mode 100644 index 00000000..5aebf4ac --- /dev/null +++ b/Migration.Tool.K11/Models/OmActivityRecalculationQueue.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("OM_ActivityRecalculationQueue")] +public class OmActivityRecalculationQueue +{ + [Key] + [Column("ActivityRecalculationQueueID")] + public int ActivityRecalculationQueueId { get; set; } + + [Column("ActivityRecalculationQueueActivityID")] + public int ActivityRecalculationQueueActivityId { get; set; } +} diff --git a/Migration.Tool.K11/Models/OmActivityType.cs b/Migration.Tool.K11/Models/OmActivityType.cs new file mode 100644 index 00000000..583adff1 --- /dev/null +++ b/Migration.Tool.K11/Models/OmActivityType.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("OM_ActivityType")] +public class OmActivityType +{ + [Key] + [Column("ActivityTypeID")] + public int ActivityTypeId { get; set; } + + [StringLength(250)] + public string ActivityTypeDisplayName { get; set; } = null!; + + [StringLength(250)] + public string ActivityTypeName { get; set; } = null!; + + public bool? ActivityTypeEnabled { get; set; } + + public bool? ActivityTypeIsCustom { get; set; } + + public string? ActivityTypeDescription { get; set; } + + public bool? ActivityTypeManualCreationAllowed { get; set; } + + [StringLength(200)] + public string? ActivityTypeMainFormControl { get; set; } + + [StringLength(200)] + public string? ActivityTypeDetailFormControl { get; set; } + + public bool ActivityTypeIsHiddenInContentOnly { get; set; } + + [StringLength(7)] + public string? ActivityTypeColor { get; set; } +} diff --git a/Migration.Tool.K11/Models/OmContact.cs b/Migration.Tool.K11/Models/OmContact.cs new file mode 100644 index 00000000..5c2cf14c --- /dev/null +++ b/Migration.Tool.K11/Models/OmContact.cs @@ -0,0 +1,140 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_Contact")] +[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] +[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] +[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] +[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] +[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] +[Index("ContactPersonaId", "ContactLastName", Name = "IX_OM_Contact_ContactPersonaID_ContactLastName")] +[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] +[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] +public class OmContact +{ + [Key] + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(50)] + public string? ContactJobTitle { get; set; } + + [StringLength(100)] + public string? ContactAddress1 { get; set; } + + [StringLength(100)] + public string? ContactCity { get; set; } + + [Column("ContactZIP")] + [StringLength(100)] + public string? ContactZip { get; set; } + + [Column("ContactStateID")] + public int? ContactStateId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [StringLength(26)] + public string? ContactMobilePhone { get; set; } + + [StringLength(26)] + public string? ContactBusinessPhone { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + public DateTime? ContactBirthday { get; set; } + + public int? ContactGender { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + public string? ContactNotes { get; set; } + + [Column("ContactOwnerUserID")] + public int? ContactOwnerUserId { get; set; } + + public bool? ContactMonitored { get; set; } + + [Column("ContactGUID")] + public Guid ContactGuid { get; set; } + + public DateTime ContactLastModified { get; set; } + + public DateTime ContactCreated { get; set; } + + public int? ContactBounces { get; set; } + + [StringLength(200)] + public string? ContactCampaign { get; set; } + + [Column("ContactSalesForceLeadID")] + [StringLength(18)] + public string? ContactSalesForceLeadId { get; set; } + + public bool? ContactSalesForceLeadReplicationDisabled { get; set; } + + public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } + + public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } + + [StringLength(100)] + public string? ContactCompanyName { get; set; } + + public bool? ContactSalesForceLeadReplicationRequired { get; set; } + + [Column("ContactPersonaID")] + public int? ContactPersonaId { get; set; } + + [InverseProperty("ConsentAgreementContact")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [ForeignKey("ContactCountryId")] + [InverseProperty("OmContacts")] + public virtual CmsCountry? ContactCountry { get; set; } + + [ForeignKey("ContactOwnerUserId")] + [InverseProperty("OmContacts")] + public virtual CmsUser? ContactOwnerUser { get; set; } + + [ForeignKey("ContactStateId")] + [InverseProperty("OmContacts")] + public virtual CmsState? ContactState { get; set; } + + [ForeignKey("ContactStatusId")] + [InverseProperty("OmContacts")] + public virtual OmContactStatus? ContactStatus { get; set; } + + [InverseProperty("AccountPrimaryContact")] + public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); + + [InverseProperty("AccountSecondaryContact")] + public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmMemberships { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [InverseProperty("VisitorToContactContact")] + public virtual ICollection OmVisitorToContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/OmContactChangeRecalculationQueue.cs b/Migration.Tool.K11/Models/OmContactChangeRecalculationQueue.cs new file mode 100644 index 00000000..8666cd16 --- /dev/null +++ b/Migration.Tool.K11/Models/OmContactChangeRecalculationQueue.cs @@ -0,0 +1,21 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("OM_ContactChangeRecalculationQueue")] +public class OmContactChangeRecalculationQueue +{ + [Key] + [Column("ContactChangeRecalculationQueueID")] + public int ContactChangeRecalculationQueueId { get; set; } + + [Column("ContactChangeRecalculationQueueContactID")] + public int ContactChangeRecalculationQueueContactId { get; set; } + + public string? ContactChangeRecalculationQueueChangedColumns { get; set; } + + public bool ContactChangeRecalculationQueueContactIsNew { get; set; } + + public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } +} diff --git a/Migration.Tool.K11/Models/OmContactGroup.cs b/Migration.Tool.K11/Models/OmContactGroup.cs new file mode 100644 index 00000000..786dcb30 --- /dev/null +++ b/Migration.Tool.K11/Models/OmContactGroup.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("OM_ContactGroup")] +public class OmContactGroup +{ + [Key] + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [StringLength(200)] + public string ContactGroupName { get; set; } = null!; + + [StringLength(200)] + public string ContactGroupDisplayName { get; set; } = null!; + + public string? ContactGroupDescription { get; set; } + + public string? ContactGroupDynamicCondition { get; set; } + + public bool? ContactGroupEnabled { get; set; } + + public DateTime? ContactGroupLastModified { get; set; } + + [Column("ContactGroupGUID")] + public Guid? ContactGroupGuid { get; set; } + + public int? ContactGroupStatus { get; set; } + + [InverseProperty("ContactGroup")] + public virtual ICollection NewsletterIssueContactGroups { get; set; } = new List(); + + [InverseProperty("ContactGroupMemberContactGroup")] + public virtual ICollection OmContactGroupMembers { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/OmContactGroupMember.cs b/Migration.Tool.K11/Models/OmContactGroupMember.cs new file mode 100644 index 00000000..9b080fbf --- /dev/null +++ b/Migration.Tool.K11/Models/OmContactGroupMember.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_ContactGroupMember")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] +[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] +public class OmContactGroupMember +{ + [Key] + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + public int ContactGroupMemberType { get; set; } + + [Column("ContactGroupMemberRelatedID")] + public int ContactGroupMemberRelatedId { get; set; } + + public bool? ContactGroupMemberFromCondition { get; set; } + + public bool? ContactGroupMemberFromAccount { get; set; } + + public bool? ContactGroupMemberFromManual { get; set; } + + [ForeignKey("ContactGroupMemberContactGroupId")] + [InverseProperty("OmContactGroupMembers")] + public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/OmContactRole.cs b/Migration.Tool.K11/Models/OmContactRole.cs new file mode 100644 index 00000000..ded76b64 --- /dev/null +++ b/Migration.Tool.K11/Models/OmContactRole.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("OM_ContactRole")] +public class OmContactRole +{ + [Key] + [Column("ContactRoleID")] + public int ContactRoleId { get; set; } + + [StringLength(200)] + public string ContactRoleName { get; set; } = null!; + + [StringLength(200)] + public string ContactRoleDisplayName { get; set; } = null!; + + public string? ContactRoleDescription { get; set; } + + [InverseProperty("ContactRole")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/OmContactStatus.cs b/Migration.Tool.K11/Models/OmContactStatus.cs new file mode 100644 index 00000000..30d67934 --- /dev/null +++ b/Migration.Tool.K11/Models/OmContactStatus.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("OM_ContactStatus")] +public class OmContactStatus +{ + [Key] + [Column("ContactStatusID")] + public int ContactStatusId { get; set; } + + [StringLength(200)] + public string ContactStatusName { get; set; } = null!; + + [StringLength(200)] + public string ContactStatusDisplayName { get; set; } = null!; + + public string? ContactStatusDescription { get; set; } + + [InverseProperty("ContactStatus")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/OmMembership.cs b/Migration.Tool.K11/Models/OmMembership.cs new file mode 100644 index 00000000..f2777559 --- /dev/null +++ b/Migration.Tool.K11/Models/OmMembership.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_Membership")] +[Index("ContactId", Name = "IX_OM_Membership_ContactID")] +[Index("RelatedId", Name = "IX_OM_Membership_RelatedID")] +public class OmMembership +{ + [Key] + [Column("MembershipID")] + public int MembershipId { get; set; } + + [Column("RelatedID")] + public int RelatedId { get; set; } + + public int MemberType { get; set; } + + [Column("MembershipGUID")] + public Guid MembershipGuid { get; set; } + + public DateTime MembershipCreated { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("ContactId")] + [InverseProperty("OmMemberships")] + public virtual OmContact Contact { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/OmMvtcombination.cs b/Migration.Tool.K11/Models/OmMvtcombination.cs new file mode 100644 index 00000000..27d379ae --- /dev/null +++ b/Migration.Tool.K11/Models/OmMvtcombination.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_MVTCombination")] +[Index("MvtcombinationPageTemplateId", Name = "IX_OM_MVTCombination_MVTCombinationPageTemplateID")] +public class OmMvtcombination +{ + [Key] + [Column("MVTCombinationID")] + public int MvtcombinationId { get; set; } + + [Column("MVTCombinationName")] + [StringLength(200)] + public string MvtcombinationName { get; set; } = null!; + + [Column("MVTCombinationCustomName")] + [StringLength(200)] + public string? MvtcombinationCustomName { get; set; } + + [Column("MVTCombinationPageTemplateID")] + public int MvtcombinationPageTemplateId { get; set; } + + [Column("MVTCombinationEnabled")] + public bool MvtcombinationEnabled { get; set; } + + [Column("MVTCombinationGUID")] + public Guid MvtcombinationGuid { get; set; } + + [Column("MVTCombinationLastModified")] + public DateTime MvtcombinationLastModified { get; set; } + + [Column("MVTCombinationIsDefault")] + public bool? MvtcombinationIsDefault { get; set; } + + [Column("MVTCombinationConversions")] + public int? MvtcombinationConversions { get; set; } + + [Column("MVTCombinationDocumentID")] + public int? MvtcombinationDocumentId { get; set; } + + [ForeignKey("MvtcombinationId")] + [InverseProperty("Mvtcombinations")] + public virtual ICollection Mvtvariants { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/OmMvtest.cs b/Migration.Tool.K11/Models/OmMvtest.cs new file mode 100644 index 00000000..d576657b --- /dev/null +++ b/Migration.Tool.K11/Models/OmMvtest.cs @@ -0,0 +1,66 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_MVTest")] +[Index("MvtestSiteId", Name = "IX_OM_MVTest_MVTestSiteID")] +public class OmMvtest +{ + [Key] + [Column("MVTestID")] + public int MvtestId { get; set; } + + [Column("MVTestName")] + [StringLength(50)] + public string MvtestName { get; set; } = null!; + + [Column("MVTestDescription")] + public string? MvtestDescription { get; set; } + + [Column("MVTestPage")] + [StringLength(450)] + public string MvtestPage { get; set; } = null!; + + [Column("MVTestSiteID")] + public int MvtestSiteId { get; set; } + + [Column("MVTestCulture")] + [StringLength(50)] + public string? MvtestCulture { get; set; } + + [Column("MVTestOpenFrom")] + public DateTime? MvtestOpenFrom { get; set; } + + [Column("MVTestOpenTo")] + public DateTime? MvtestOpenTo { get; set; } + + [Column("MVTestMaxConversions")] + public int? MvtestMaxConversions { get; set; } + + [Column("MVTestConversions")] + public int? MvtestConversions { get; set; } + + [Column("MVTestTargetConversionType")] + [StringLength(100)] + public string? MvtestTargetConversionType { get; set; } + + [Column("MVTestGUID")] + public Guid MvtestGuid { get; set; } + + [Column("MVTestLastModified")] + public DateTime MvtestLastModified { get; set; } + + [Column("MVTestEnabled")] + public bool MvtestEnabled { get; set; } + + [Column("MVTestDisplayName")] + [StringLength(100)] + public string MvtestDisplayName { get; set; } = null!; + + [ForeignKey("MvtestSiteId")] + [InverseProperty("OmMvtests")] + public virtual CmsSite MvtestSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/OmMvtvariant.cs b/Migration.Tool.K11/Models/OmMvtvariant.cs new file mode 100644 index 00000000..ac82376b --- /dev/null +++ b/Migration.Tool.K11/Models/OmMvtvariant.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_MVTVariant")] +[Index("MvtvariantPageTemplateId", Name = "IX_OM_MVTVariant_MVTVariantPageTemplateID")] +public class OmMvtvariant +{ + [Key] + [Column("MVTVariantID")] + public int MvtvariantId { get; set; } + + [Column("MVTVariantName")] + [StringLength(100)] + public string MvtvariantName { get; set; } = null!; + + [Column("MVTVariantDisplayName")] + [StringLength(200)] + public string MvtvariantDisplayName { get; set; } = null!; + + [Column("MVTVariantInstanceGUID")] + public Guid? MvtvariantInstanceGuid { get; set; } + + [Column("MVTVariantZoneID")] + [StringLength(200)] + public string? MvtvariantZoneId { get; set; } + + [Column("MVTVariantPageTemplateID")] + public int MvtvariantPageTemplateId { get; set; } + + [Required] + [Column("MVTVariantEnabled")] + public bool? MvtvariantEnabled { get; set; } + + [Column("MVTVariantWebParts")] + public string? MvtvariantWebParts { get; set; } + + [Column("MVTVariantGUID")] + public Guid MvtvariantGuid { get; set; } + + [Column("MVTVariantLastModified")] + public DateTime MvtvariantLastModified { get; set; } + + [Column("MVTVariantDescription")] + public string? MvtvariantDescription { get; set; } + + [Column("MVTVariantDocumentID")] + public int? MvtvariantDocumentId { get; set; } + + [ForeignKey("MvtvariantPageTemplateId")] + [InverseProperty("OmMvtvariants")] + public virtual CmsPageTemplate MvtvariantPageTemplate { get; set; } = null!; + + [ForeignKey("MvtvariantId")] + [InverseProperty("Mvtvariants")] + public virtual ICollection Mvtcombinations { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/OmPersonalizationVariant.cs b/Migration.Tool.K11/Models/OmPersonalizationVariant.cs new file mode 100644 index 00000000..8f8aa87d --- /dev/null +++ b/Migration.Tool.K11/Models/OmPersonalizationVariant.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_PersonalizationVariant")] +[Index("VariantPageTemplateId", Name = "IX_OM_PersonalizationVariant_VariantDocumentID")] +[Index("VariantDocumentId", Name = "IX_OM_PersonalizationVariant_VariantPageTemplateID")] +public class OmPersonalizationVariant +{ + [Key] + [Column("VariantID")] + public int VariantId { get; set; } + + [Required] + public bool? VariantEnabled { get; set; } + + [StringLength(200)] + public string VariantName { get; set; } = null!; + + [StringLength(200)] + public string VariantDisplayName { get; set; } = null!; + + [Column("VariantInstanceGUID")] + public Guid? VariantInstanceGuid { get; set; } + + [Column("VariantZoneID")] + [StringLength(200)] + public string? VariantZoneId { get; set; } + + [Column("VariantPageTemplateID")] + public int VariantPageTemplateId { get; set; } + + public string VariantWebParts { get; set; } = null!; + + public int? VariantPosition { get; set; } + + [Column("VariantGUID")] + public Guid VariantGuid { get; set; } + + public DateTime VariantLastModified { get; set; } + + public string? VariantDescription { get; set; } + + [Column("VariantDocumentID")] + public int? VariantDocumentId { get; set; } + + public string VariantDisplayCondition { get; set; } = null!; + + [ForeignKey("VariantDocumentId")] + [InverseProperty("OmPersonalizationVariants")] + public virtual CmsDocument? VariantDocument { get; set; } + + [ForeignKey("VariantPageTemplateId")] + [InverseProperty("OmPersonalizationVariants")] + public virtual CmsPageTemplate VariantPageTemplate { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/OmRule.cs b/Migration.Tool.K11/Models/OmRule.cs new file mode 100644 index 00000000..27ebde6c --- /dev/null +++ b/Migration.Tool.K11/Models/OmRule.cs @@ -0,0 +1,58 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_Rule")] +[Index("RuleScoreId", Name = "IX_OM_Rule_RuleScoreID")] +public class OmRule +{ + [Key] + [Column("RuleID")] + public int RuleId { get; set; } + + [Column("RuleScoreID")] + public int RuleScoreId { get; set; } + + [StringLength(200)] + public string RuleDisplayName { get; set; } = null!; + + [StringLength(200)] + public string RuleName { get; set; } = null!; + + public int RuleValue { get; set; } + + public bool? RuleIsRecurring { get; set; } + + public int? RuleMaxPoints { get; set; } + + public DateTime? RuleValidUntil { get; set; } + + [StringLength(50)] + public string? RuleValidity { get; set; } + + public int? RuleValidFor { get; set; } + + public int RuleType { get; set; } + + [StringLength(250)] + public string? RuleParameter { get; set; } + + public string RuleCondition { get; set; } = null!; + + public DateTime RuleLastModified { get; set; } + + [Column("RuleGUID")] + public Guid RuleGuid { get; set; } + + public bool RuleBelongsToPersona { get; set; } + + [InverseProperty("Rule")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [ForeignKey("RuleScoreId")] + [InverseProperty("OmRules")] + public virtual OmScore RuleScore { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/OmScore.cs b/Migration.Tool.K11/Models/OmScore.cs new file mode 100644 index 00000000..679c4f7e --- /dev/null +++ b/Migration.Tool.K11/Models/OmScore.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("OM_Score")] +public class OmScore +{ + [Key] + [Column("ScoreID")] + public int ScoreId { get; set; } + + [StringLength(200)] + public string ScoreName { get; set; } = null!; + + [StringLength(200)] + public string ScoreDisplayName { get; set; } = null!; + + public string? ScoreDescription { get; set; } + + public bool ScoreEnabled { get; set; } + + public int? ScoreEmailAtScore { get; set; } + + [StringLength(998)] + public string? ScoreNotificationEmail { get; set; } + + public DateTime ScoreLastModified { get; set; } + + [Column("ScoreGUID")] + public Guid ScoreGuid { get; set; } + + public int? ScoreStatus { get; set; } + + [Column("ScoreScheduledTaskID")] + public int? ScoreScheduledTaskId { get; set; } + + public bool ScoreBelongsToPersona { get; set; } + + [InverseProperty("RuleScore")] + public virtual ICollection OmRules { get; set; } = new List(); + + [InverseProperty("Score")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/OmScoreContactRule.cs b/Migration.Tool.K11/Models/OmScoreContactRule.cs new file mode 100644 index 00000000..ff3433ca --- /dev/null +++ b/Migration.Tool.K11/Models/OmScoreContactRule.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_ScoreContactRule")] +[Index("ContactId", Name = "IX_OM_ScoreContactRule_ContactID")] +[Index("RuleId", Name = "IX_OM_ScoreContactRule_RuleID")] +[Index("ScoreId", Name = "IX_OM_ScoreContactRule_ScoreID_ContactID_Value_Expiration")] +[Index("ScoreId", "ContactId", "RuleId", Name = "UQ_OM_ScoreContactRule", IsUnique = true)] +public class OmScoreContactRule +{ + [Column("ScoreID")] + public int ScoreId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("RuleID")] + public int RuleId { get; set; } + + public int Value { get; set; } + + public DateTime? Expiration { get; set; } + + [Key] + [Column("ScoreContactRuleID")] + public int ScoreContactRuleId { get; set; } + + [ForeignKey("ContactId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("RuleId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmRule Rule { get; set; } = null!; + + [ForeignKey("ScoreId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmScore Score { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/OmVisitorToContact.cs b/Migration.Tool.K11/Models/OmVisitorToContact.cs new file mode 100644 index 00000000..e5773c50 --- /dev/null +++ b/Migration.Tool.K11/Models/OmVisitorToContact.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("OM_VisitorToContact")] +[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] +[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] +public class OmVisitorToContact +{ + [Key] + [Column("VisitorToContactID")] + public int VisitorToContactId { get; set; } + + [Column("VisitorToContactVisitorGUID")] + public Guid VisitorToContactVisitorGuid { get; set; } + + [Column("VisitorToContactContactID")] + public int VisitorToContactContactId { get; set; } + + [ForeignKey("VisitorToContactContactId")] + [InverseProperty("OmVisitorToContacts")] + public virtual OmContact VisitorToContactContact { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/PersonasPersona.cs b/Migration.Tool.K11/Models/PersonasPersona.cs new file mode 100644 index 00000000..1d55b6c8 --- /dev/null +++ b/Migration.Tool.K11/Models/PersonasPersona.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Personas_Persona")] +[Index("PersonaScoreId", Name = "IX_Personas_Persona_PersonaScoreID")] +public class PersonasPersona +{ + [Key] + [Column("PersonaID")] + public int PersonaId { get; set; } + + [StringLength(200)] + public string PersonaDisplayName { get; set; } = null!; + + [StringLength(200)] + public string PersonaName { get; set; } = null!; + + public string? PersonaDescription { get; set; } + + [Required] + public bool? PersonaEnabled { get; set; } + + [Column("PersonaGUID")] + public Guid PersonaGuid { get; set; } + + [Column("PersonaScoreID")] + public int PersonaScoreId { get; set; } + + [Column("PersonaPictureMetafileGUID")] + public Guid? PersonaPictureMetafileGuid { get; set; } + + public int PersonaPointsThreshold { get; set; } + + [InverseProperty("PersonaContactHistoryPersona")] + public virtual ICollection PersonasPersonaContactHistories { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/PersonasPersonaContactHistory.cs b/Migration.Tool.K11/Models/PersonasPersonaContactHistory.cs new file mode 100644 index 00000000..1df78764 --- /dev/null +++ b/Migration.Tool.K11/Models/PersonasPersonaContactHistory.cs @@ -0,0 +1,27 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Personas_PersonaContactHistory")] +[Index("PersonaContactHistoryPersonaId", Name = "IX_Personas_PersonaContactHistoryPersonaID")] +public class PersonasPersonaContactHistory +{ + [Key] + [Column("PersonaContactHistoryID")] + public int PersonaContactHistoryId { get; set; } + + [Column("PersonaContactHistoryPersonaID")] + public int? PersonaContactHistoryPersonaId { get; set; } + + [Column(TypeName = "date")] + public DateTime PersonaContactHistoryDate { get; set; } + + public int PersonaContactHistoryContacts { get; set; } + + [ForeignKey("PersonaContactHistoryPersonaId")] + [InverseProperty("PersonasPersonaContactHistories")] + public virtual PersonasPersona? PersonaContactHistoryPersona { get; set; } +} diff --git a/Migration.Tool.K11/Models/PersonasPersonaNode.cs b/Migration.Tool.K11/Models/PersonasPersonaNode.cs new file mode 100644 index 00000000..e44a44d5 --- /dev/null +++ b/Migration.Tool.K11/Models/PersonasPersonaNode.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[PrimaryKey("PersonaId", "NodeId")] +[Table("Personas_PersonaNode")] +[Index("NodeId", Name = "IX_Personas_PersonaNode_NodeID")] +[Index("PersonaId", Name = "IX_Personas_PersonaNode_PersonaID")] +public class PersonasPersonaNode +{ + [Key] + [Column("PersonaID")] + public int PersonaId { get; set; } + + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + [ForeignKey("NodeId")] + [InverseProperty("PersonasPersonaNodes")] + public virtual CmsTree Node { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/PollsPoll.cs b/Migration.Tool.K11/Models/PollsPoll.cs new file mode 100644 index 00000000..63b92d8a --- /dev/null +++ b/Migration.Tool.K11/Models/PollsPoll.cs @@ -0,0 +1,71 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Polls_Poll")] +[Index("PollGroupId", Name = "IX_Polls_Poll_PollGroupID")] +[Index("PollSiteId", "PollCodeName", Name = "IX_Polls_Poll_PollSiteID_PollCodeName")] +public class PollsPoll +{ + [Key] + [Column("PollID")] + public int PollId { get; set; } + + [StringLength(200)] + public string PollCodeName { get; set; } = null!; + + [StringLength(200)] + public string PollDisplayName { get; set; } = null!; + + [StringLength(100)] + public string? PollTitle { get; set; } + + public DateTime? PollOpenFrom { get; set; } + + public DateTime? PollOpenTo { get; set; } + + public bool PollAllowMultipleAnswers { get; set; } + + [StringLength(450)] + public string PollQuestion { get; set; } = null!; + + public int PollAccess { get; set; } + + [StringLength(450)] + public string? PollResponseMessage { get; set; } + + [Column("PollGUID")] + public Guid PollGuid { get; set; } + + public DateTime PollLastModified { get; set; } + + [Column("PollGroupID")] + public int? PollGroupId { get; set; } + + [Column("PollSiteID")] + public int? PollSiteId { get; set; } + + public bool? PollLogActivity { get; set; } + + [ForeignKey("PollGroupId")] + [InverseProperty("PollsPolls")] + public virtual CommunityGroup? PollGroup { get; set; } + + [ForeignKey("PollSiteId")] + [InverseProperty("PollsPolls")] + public virtual CmsSite? PollSite { get; set; } + + [InverseProperty("AnswerPoll")] + public virtual ICollection PollsPollAnswers { get; set; } = new List(); + + [ForeignKey("PollId")] + [InverseProperty("Polls")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("PollId")] + [InverseProperty("Polls")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/PollsPollAnswer.cs b/Migration.Tool.K11/Models/PollsPollAnswer.cs new file mode 100644 index 00000000..77069cbf --- /dev/null +++ b/Migration.Tool.K11/Models/PollsPollAnswer.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Polls_PollAnswer")] +[Index("AnswerPollId", Name = "IX_Polls_PollAnswer_AnswerPollID")] +public class PollsPollAnswer +{ + [Key] + [Column("AnswerID")] + public int AnswerId { get; set; } + + [StringLength(200)] + public string AnswerText { get; set; } = null!; + + public int? AnswerOrder { get; set; } + + public int? AnswerCount { get; set; } + + public bool? AnswerEnabled { get; set; } + + [Column("AnswerPollID")] + public int AnswerPollId { get; set; } + + [Column("AnswerGUID")] + public Guid AnswerGuid { get; set; } + + public DateTime AnswerLastModified { get; set; } + + [StringLength(100)] + public string? AnswerForm { get; set; } + + [StringLength(100)] + public string? AnswerAlternativeForm { get; set; } + + public bool? AnswerHideForm { get; set; } + + [ForeignKey("AnswerPollId")] + [InverseProperty("PollsPollAnswers")] + public virtual PollsPoll AnswerPoll { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ReportingReport.cs b/Migration.Tool.K11/Models/ReportingReport.cs new file mode 100644 index 00000000..be0453a2 --- /dev/null +++ b/Migration.Tool.K11/Models/ReportingReport.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Reporting_Report")] +[Index("ReportCategoryId", Name = "IX_Reporting_Report_ReportCategoryID")] +[Index("ReportGuid", "ReportName", Name = "IX_Reporting_Report_ReportGUID_ReportName")] +[Index("ReportName", Name = "IX_Reporting_Report_ReportName", IsUnique = true)] +public class ReportingReport +{ + [Key] + [Column("ReportID")] + public int ReportId { get; set; } + + [StringLength(200)] + public string ReportName { get; set; } = null!; + + [StringLength(440)] + public string ReportDisplayName { get; set; } = null!; + + public string? ReportLayout { get; set; } + + public string? ReportParameters { get; set; } + + [Column("ReportCategoryID")] + public int ReportCategoryId { get; set; } + + public int ReportAccess { get; set; } + + [Column("ReportGUID")] + public Guid ReportGuid { get; set; } + + public DateTime ReportLastModified { get; set; } + + public bool? ReportEnableSubscription { get; set; } + + [StringLength(100)] + public string? ReportConnectionString { get; set; } + + [ForeignKey("ReportCategoryId")] + [InverseProperty("ReportingReports")] + public virtual ReportingReportCategory ReportCategory { get; set; } = null!; + + [InverseProperty("GraphReport")] + public virtual ICollection ReportingReportGraphs { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionReport")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("TableReport")] + public virtual ICollection ReportingReportTables { get; set; } = new List(); + + [InverseProperty("ValueReport")] + public virtual ICollection ReportingReportValues { get; set; } = new List(); + + [InverseProperty("SavedReportReport")] + public virtual ICollection ReportingSavedReports { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ReportingReportCategory.cs b/Migration.Tool.K11/Models/ReportingReportCategory.cs new file mode 100644 index 00000000..f4293df0 --- /dev/null +++ b/Migration.Tool.K11/Models/ReportingReportCategory.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Reporting_ReportCategory")] +[Index("CategoryParentId", Name = "IX_Reporting_ReportCategory_CategoryParentID")] +public class ReportingReportCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryCodeName { get; set; } = null!; + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public string CategoryPath { get; set; } = null!; + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryReportChildCount { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual ReportingReportCategory? CategoryParent { get; set; } + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); + + [InverseProperty("ReportCategory")] + public virtual ICollection ReportingReports { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ReportingReportGraph.cs b/Migration.Tool.K11/Models/ReportingReportGraph.cs new file mode 100644 index 00000000..80bbe540 --- /dev/null +++ b/Migration.Tool.K11/Models/ReportingReportGraph.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Reporting_ReportGraph")] +[Index("GraphGuid", Name = "IX_Reporting_ReportGraph_GraphGUID", IsUnique = true)] +[Index("GraphReportId", "GraphName", Name = "IX_Reporting_ReportGraph_GraphReportID_GraphName", IsUnique = true)] +public class ReportingReportGraph +{ + [Key] + [Column("GraphID")] + public int GraphId { get; set; } + + [StringLength(100)] + public string GraphName { get; set; } = null!; + + [StringLength(450)] + public string GraphDisplayName { get; set; } = null!; + + public string GraphQuery { get; set; } = null!; + + public bool GraphQueryIsStoredProcedure { get; set; } + + [StringLength(50)] + public string GraphType { get; set; } = null!; + + [Column("GraphReportID")] + public int GraphReportId { get; set; } + + [StringLength(200)] + public string? GraphTitle { get; set; } + + [Column("GraphXAxisTitle")] + [StringLength(200)] + public string? GraphXaxisTitle { get; set; } + + [Column("GraphYAxisTitle")] + [StringLength(200)] + public string? GraphYaxisTitle { get; set; } + + public int? GraphWidth { get; set; } + + public int? GraphHeight { get; set; } + + public int? GraphLegendPosition { get; set; } + + public string? GraphSettings { get; set; } + + [Column("GraphGUID")] + public Guid GraphGuid { get; set; } + + public DateTime GraphLastModified { get; set; } + + public bool? GraphIsHtml { get; set; } + + [StringLength(100)] + public string? GraphConnectionString { get; set; } + + [ForeignKey("GraphReportId")] + [InverseProperty("ReportingReportGraphs")] + public virtual ReportingReport GraphReport { get; set; } = null!; + + [InverseProperty("ReportSubscriptionGraph")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/ReportingReportSubscription.cs b/Migration.Tool.K11/Models/ReportingReportSubscription.cs new file mode 100644 index 00000000..65a6139d --- /dev/null +++ b/Migration.Tool.K11/Models/ReportingReportSubscription.cs @@ -0,0 +1,92 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Reporting_ReportSubscription")] +[Index("ReportSubscriptionGraphId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionGraphID")] +[Index("ReportSubscriptionReportId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionReportID")] +[Index("ReportSubscriptionSiteId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionSiteID")] +[Index("ReportSubscriptionTableId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionTableID")] +[Index("ReportSubscriptionUserId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionUserID")] +[Index("ReportSubscriptionValueId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionValueID")] +public class ReportingReportSubscription +{ + [Key] + [Column("ReportSubscriptionID")] + public int ReportSubscriptionId { get; set; } + + [Column("ReportSubscriptionReportID")] + public int ReportSubscriptionReportId { get; set; } + + [StringLength(1000)] + public string ReportSubscriptionInterval { get; set; } = null!; + + public string? ReportSubscriptionCondition { get; set; } + + [Required] + public bool? ReportSubscriptionEnabled { get; set; } + + public string? ReportSubscriptionParameters { get; set; } + + [Column("ReportSubscriptionGUID")] + public Guid ReportSubscriptionGuid { get; set; } + + public DateTime ReportSubscriptionLastModified { get; set; } + + [StringLength(200)] + public string? ReportSubscriptionSubject { get; set; } + + [Column("ReportSubscriptionGraphID")] + public int? ReportSubscriptionGraphId { get; set; } + + [Column("ReportSubscriptionTableID")] + public int? ReportSubscriptionTableId { get; set; } + + [Column("ReportSubscriptionValueID")] + public int? ReportSubscriptionValueId { get; set; } + + [Column("ReportSubscriptionUserID")] + public int ReportSubscriptionUserId { get; set; } + + [StringLength(400)] + public string ReportSubscriptionEmail { get; set; } = null!; + + [Required] + public bool? ReportSubscriptionOnlyNonEmpty { get; set; } + + public DateTime? ReportSubscriptionLastPostDate { get; set; } + + public DateTime? ReportSubscriptionNextPostDate { get; set; } + + [Column("ReportSubscriptionSiteID")] + public int ReportSubscriptionSiteId { get; set; } + + public string? ReportSubscriptionSettings { get; set; } + + [ForeignKey("ReportSubscriptionGraphId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportGraph? ReportSubscriptionGraph { get; set; } + + [ForeignKey("ReportSubscriptionReportId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReport ReportSubscriptionReport { get; set; } = null!; + + [ForeignKey("ReportSubscriptionSiteId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual CmsSite ReportSubscriptionSite { get; set; } = null!; + + [ForeignKey("ReportSubscriptionTableId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportTable? ReportSubscriptionTable { get; set; } + + [ForeignKey("ReportSubscriptionUserId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual CmsUser ReportSubscriptionUser { get; set; } = null!; + + [ForeignKey("ReportSubscriptionValueId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportValue? ReportSubscriptionValue { get; set; } +} diff --git a/Migration.Tool.K11/Models/ReportingReportTable.cs b/Migration.Tool.K11/Models/ReportingReportTable.cs new file mode 100644 index 00000000..bbe15195 --- /dev/null +++ b/Migration.Tool.K11/Models/ReportingReportTable.cs @@ -0,0 +1,46 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Reporting_ReportTable")] +[Index("TableReportId", Name = "IX_Reporting_ReportTable_TableReportID")] +[Index("TableName", "TableReportId", Name = "IX_Reporting_ReportTable_TableReportID_TableName", IsUnique = true)] +public class ReportingReportTable +{ + [Key] + [Column("TableID")] + public int TableId { get; set; } + + [StringLength(100)] + public string TableName { get; set; } = null!; + + [StringLength(450)] + public string TableDisplayName { get; set; } = null!; + + public string TableQuery { get; set; } = null!; + + public bool TableQueryIsStoredProcedure { get; set; } + + [Column("TableReportID")] + public int TableReportId { get; set; } + + public string? TableSettings { get; set; } + + [Column("TableGUID")] + public Guid TableGuid { get; set; } + + public DateTime TableLastModified { get; set; } + + [StringLength(100)] + public string? TableConnectionString { get; set; } + + [InverseProperty("ReportSubscriptionTable")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [ForeignKey("TableReportId")] + [InverseProperty("ReportingReportTables")] + public virtual ReportingReport TableReport { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ReportingReportValue.cs b/Migration.Tool.K11/Models/ReportingReportValue.cs new file mode 100644 index 00000000..1da6164f --- /dev/null +++ b/Migration.Tool.K11/Models/ReportingReportValue.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Reporting_ReportValue")] +[Index("ValueName", "ValueReportId", Name = "IX_Reporting_ReportValue_ValueName_ValueReportID")] +[Index("ValueReportId", Name = "IX_Reporting_ReportValue_ValueReportID")] +public class ReportingReportValue +{ + [Key] + [Column("ValueID")] + public int ValueId { get; set; } + + [StringLength(100)] + public string ValueName { get; set; } = null!; + + [StringLength(450)] + public string ValueDisplayName { get; set; } = null!; + + public string ValueQuery { get; set; } = null!; + + public bool ValueQueryIsStoredProcedure { get; set; } + + [StringLength(200)] + public string? ValueFormatString { get; set; } + + [Column("ValueReportID")] + public int ValueReportId { get; set; } + + [Column("ValueGUID")] + public Guid ValueGuid { get; set; } + + public DateTime ValueLastModified { get; set; } + + public string? ValueSettings { get; set; } + + [StringLength(100)] + public string? ValueConnectionString { get; set; } + + [InverseProperty("ReportSubscriptionValue")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [ForeignKey("ValueReportId")] + [InverseProperty("ReportingReportValues")] + public virtual ReportingReport ValueReport { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ReportingSavedGraph.cs b/Migration.Tool.K11/Models/ReportingSavedGraph.cs new file mode 100644 index 00000000..d48e807c --- /dev/null +++ b/Migration.Tool.K11/Models/ReportingSavedGraph.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Reporting_SavedGraph")] +[Index("SavedGraphGuid", Name = "IX_Reporting_SavedGraph_SavedGraphGUID")] +[Index("SavedGraphSavedReportId", Name = "IX_Reporting_SavedGraph_SavedGraphSavedReportID")] +public class ReportingSavedGraph +{ + [Key] + [Column("SavedGraphID")] + public int SavedGraphId { get; set; } + + [Column("SavedGraphSavedReportID")] + public int SavedGraphSavedReportId { get; set; } + + [Column("SavedGraphGUID")] + public Guid SavedGraphGuid { get; set; } + + public byte[] SavedGraphBinary { get; set; } = null!; + + [StringLength(100)] + public string SavedGraphMimeType { get; set; } = null!; + + public DateTime SavedGraphLastModified { get; set; } + + [ForeignKey("SavedGraphSavedReportId")] + [InverseProperty("ReportingSavedGraphs")] + public virtual ReportingSavedReport SavedGraphSavedReport { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ReportingSavedReport.cs b/Migration.Tool.K11/Models/ReportingSavedReport.cs new file mode 100644 index 00000000..fbae731f --- /dev/null +++ b/Migration.Tool.K11/Models/ReportingSavedReport.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Reporting_SavedReport")] +[Index("SavedReportCreatedByUserId", Name = "IX_Reporting_SavedReport_SavedReportCreatedByUserID")] +public class ReportingSavedReport +{ + [Key] + [Column("SavedReportID")] + public int SavedReportId { get; set; } + + [Column("SavedReportReportID")] + public int SavedReportReportId { get; set; } + + [Column("SavedReportGUID")] + public Guid SavedReportGuid { get; set; } + + [StringLength(200)] + public string? SavedReportTitle { get; set; } + + public DateTime SavedReportDate { get; set; } + + [Column("SavedReportHTML")] + public string SavedReportHtml { get; set; } = null!; + + public string SavedReportParameters { get; set; } = null!; + + [Column("SavedReportCreatedByUserID")] + public int? SavedReportCreatedByUserId { get; set; } + + public DateTime SavedReportLastModified { get; set; } + + [InverseProperty("SavedGraphSavedReport")] + public virtual ICollection ReportingSavedGraphs { get; set; } = new List(); + + [ForeignKey("SavedReportCreatedByUserId")] + [InverseProperty("ReportingSavedReports")] + public virtual CmsUser? SavedReportCreatedByUser { get; set; } + + [ForeignKey("SavedReportReportId")] + [InverseProperty("ReportingSavedReports")] + public virtual ReportingReport SavedReportReport { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/SharePointSharePointConnection.cs b/Migration.Tool.K11/Models/SharePointSharePointConnection.cs new file mode 100644 index 00000000..11deb2b4 --- /dev/null +++ b/Migration.Tool.K11/Models/SharePointSharePointConnection.cs @@ -0,0 +1,54 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SharePoint_SharePointConnection")] +[Index("SharePointConnectionSiteId", Name = "IX_SharePoint_SharePointConnection_SharePointConnectionSiteID")] +public class SharePointSharePointConnection +{ + [Key] + [Column("SharePointConnectionID")] + public int SharePointConnectionId { get; set; } + + [Column("SharePointConnectionGUID")] + public Guid SharePointConnectionGuid { get; set; } + + [Column("SharePointConnectionSiteID")] + public int SharePointConnectionSiteId { get; set; } + + [StringLength(512)] + public string SharePointConnectionSiteUrl { get; set; } = null!; + + [StringLength(30)] + public string SharePointConnectionAuthMode { get; set; } = null!; + + [StringLength(100)] + public string SharePointConnectionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string SharePointConnectionName { get; set; } = null!; + + [StringLength(30)] + public string SharePointConnectionSharePointVersion { get; set; } = null!; + + [StringLength(100)] + public string? SharePointConnectionUserName { get; set; } + + [StringLength(100)] + public string? SharePointConnectionPassword { get; set; } + + [StringLength(100)] + public string? SharePointConnectionDomain { get; set; } + + public DateTime SharePointConnectionLastModified { get; set; } + + [ForeignKey("SharePointConnectionSiteId")] + [InverseProperty("SharePointSharePointConnections")] + public virtual CmsSite SharePointConnectionSite { get; set; } = null!; + + [InverseProperty("SharePointLibrarySharePointConnection")] + public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/SharePointSharePointFile.cs b/Migration.Tool.K11/Models/SharePointSharePointFile.cs new file mode 100644 index 00000000..b88f2d26 --- /dev/null +++ b/Migration.Tool.K11/Models/SharePointSharePointFile.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SharePoint_SharePointFile")] +[Index("SharePointFileSiteId", Name = "IX_SharePoint_SharePointFile_SharePointFileSiteID")] +[Index("SharePointFileSharePointLibraryId", "SharePointFileServerRelativeUrl", Name = "UQ_SharePoint_SharePointFile_LibraryID_ServerRelativeURL", IsUnique = true)] +public class SharePointSharePointFile +{ + [Key] + [Column("SharePointFileID")] + public int SharePointFileId { get; set; } + + [Column("SharePointFileGUID")] + public Guid SharePointFileGuid { get; set; } + + [Column("SharePointFileSiteID")] + public int SharePointFileSiteId { get; set; } + + [StringLength(150)] + public string SharePointFileName { get; set; } = null!; + + [StringLength(150)] + public string? SharePointFileExtension { get; set; } + + [StringLength(255)] + public string? SharePointFileMimeType { get; set; } + + [Column("SharePointFileETag")] + [StringLength(255)] + public string? SharePointFileEtag { get; set; } + + public long SharePointFileSize { get; set; } + + public DateTime SharePointFileServerLastModified { get; set; } + + [Column("SharePointFileServerRelativeURL")] + [StringLength(300)] + public string SharePointFileServerRelativeUrl { get; set; } = null!; + + [Column("SharePointFileSharePointLibraryID")] + public int SharePointFileSharePointLibraryId { get; set; } + + public byte[]? SharePointFileBinary { get; set; } + + [ForeignKey("SharePointFileSharePointLibraryId")] + [InverseProperty("SharePointSharePointFiles")] + public virtual SharePointSharePointLibrary SharePointFileSharePointLibrary { get; set; } = null!; + + [ForeignKey("SharePointFileSiteId")] + [InverseProperty("SharePointSharePointFiles")] + public virtual CmsSite SharePointFileSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/SharePointSharePointLibrary.cs b/Migration.Tool.K11/Models/SharePointSharePointLibrary.cs new file mode 100644 index 00000000..6f0bdbc5 --- /dev/null +++ b/Migration.Tool.K11/Models/SharePointSharePointLibrary.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SharePoint_SharePointLibrary")] +[Index("SharePointLibrarySharePointConnectionId", Name = "IX_SharePoint_SharePointLibrary_SharePointLibrarySharepointConnectionID")] +[Index("SharePointLibrarySiteId", Name = "IX_SharePoint_SharePointLibrary_SharePointlibrarySiteID")] +public class SharePointSharePointLibrary +{ + [Key] + [Column("SharePointLibraryID")] + public int SharePointLibraryId { get; set; } + + [StringLength(100)] + public string SharePointLibraryName { get; set; } = null!; + + [Column("SharePointLibrarySharePointConnectionID")] + public int? SharePointLibrarySharePointConnectionId { get; set; } + + [StringLength(100)] + public string SharePointLibraryListTitle { get; set; } = null!; + + public int SharePointLibrarySynchronizationPeriod { get; set; } + + [Column("SharePointLibraryGUID")] + public Guid SharePointLibraryGuid { get; set; } + + [Column("SharePointLibrarySiteID")] + public int SharePointLibrarySiteId { get; set; } + + [StringLength(100)] + public string SharePointLibraryDisplayName { get; set; } = null!; + + public DateTime SharePointLibraryLastModified { get; set; } + + public int SharePointLibraryListType { get; set; } + + [ForeignKey("SharePointLibrarySharePointConnectionId")] + [InverseProperty("SharePointSharePointLibraries")] + public virtual SharePointSharePointConnection? SharePointLibrarySharePointConnection { get; set; } + + [ForeignKey("SharePointLibrarySiteId")] + [InverseProperty("SharePointSharePointLibraries")] + public virtual CmsSite SharePointLibrarySite { get; set; } = null!; + + [InverseProperty("SharePointFileSharePointLibrary")] + public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/SmFacebookAccount.cs b/Migration.Tool.K11/Models/SmFacebookAccount.cs new file mode 100644 index 00000000..646ae887 --- /dev/null +++ b/Migration.Tool.K11/Models/SmFacebookAccount.cs @@ -0,0 +1,57 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SM_FacebookAccount")] +[Index("FacebookAccountFacebookApplicationId", Name = "IX_SM_FacebookAccount_FacebookAccountFacebookApplicationID")] +[Index("FacebookAccountSiteId", Name = "IX_SM_FacebookAccount_FacebookAccountSiteID")] +public class SmFacebookAccount +{ + [Key] + [Column("FacebookAccountID")] + public int FacebookAccountId { get; set; } + + [Column("FacebookAccountGUID")] + public Guid FacebookAccountGuid { get; set; } + + public DateTime FacebookAccountLastModified { get; set; } + + [Column("FacebookAccountSiteID")] + public int FacebookAccountSiteId { get; set; } + + [StringLength(200)] + public string FacebookAccountName { get; set; } = null!; + + [StringLength(200)] + public string FacebookAccountDisplayName { get; set; } = null!; + + [Column("FacebookAccountPageID")] + [StringLength(500)] + public string FacebookAccountPageId { get; set; } = null!; + + public string FacebookAccountPageAccessToken { get; set; } = null!; + + [Column("FacebookAccountFacebookApplicationID")] + public int FacebookAccountFacebookApplicationId { get; set; } + + public DateTime? FacebookAccountPageAccessTokenExpiration { get; set; } + + [StringLength(1000)] + public string? FacebookAccountPageUrl { get; set; } + + public bool? FacebookAccountIsDefault { get; set; } + + [ForeignKey("FacebookAccountFacebookApplicationId")] + [InverseProperty("SmFacebookAccounts")] + public virtual SmFacebookApplication FacebookAccountFacebookApplication { get; set; } = null!; + + [ForeignKey("FacebookAccountSiteId")] + [InverseProperty("SmFacebookAccounts")] + public virtual CmsSite FacebookAccountSite { get; set; } = null!; + + [InverseProperty("FacebookPostFacebookAccount")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/SmFacebookApplication.cs b/Migration.Tool.K11/Models/SmFacebookApplication.cs new file mode 100644 index 00000000..92a0f372 --- /dev/null +++ b/Migration.Tool.K11/Models/SmFacebookApplication.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SM_FacebookApplication")] +[Index("FacebookApplicationSiteId", Name = "IX_SM_FacebookApplication_FacebookApplicationSiteID")] +public class SmFacebookApplication +{ + [Key] + [Column("FacebookApplicationID")] + public int FacebookApplicationId { get; set; } + + [StringLength(500)] + public string FacebookApplicationConsumerKey { get; set; } = null!; + + [StringLength(500)] + public string FacebookApplicationConsumerSecret { get; set; } = null!; + + [StringLength(200)] + public string FacebookApplicationName { get; set; } = null!; + + [StringLength(200)] + public string FacebookApplicationDisplayName { get; set; } = null!; + + [Column("FacebookApplicationGUID")] + public Guid FacebookApplicationGuid { get; set; } + + public DateTime FacebookApplicationLastModified { get; set; } + + [Column("FacebookApplicationSiteID")] + public int FacebookApplicationSiteId { get; set; } + + [ForeignKey("FacebookApplicationSiteId")] + [InverseProperty("SmFacebookApplications")] + public virtual CmsSite FacebookApplicationSite { get; set; } = null!; + + [InverseProperty("FacebookAccountFacebookApplication")] + public virtual ICollection SmFacebookAccounts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/SmFacebookPost.cs b/Migration.Tool.K11/Models/SmFacebookPost.cs new file mode 100644 index 00000000..ff172326 --- /dev/null +++ b/Migration.Tool.K11/Models/SmFacebookPost.cs @@ -0,0 +1,88 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SM_FacebookPost")] +[Index("FacebookPostCampaignId", Name = "IX_SM_FacebookPost_FacebookPostCampaignID")] +[Index("FacebookPostFacebookAccountId", Name = "IX_SM_FacebookPost_FacebookPostFacebookAccountID")] +[Index("FacebookPostSiteId", Name = "IX_SM_FacebookPost_FacebookPostSiteID")] +public class SmFacebookPost +{ + [Key] + [Column("FacebookPostID")] + public int FacebookPostId { get; set; } + + [Column("FacebookPostGUID")] + public Guid FacebookPostGuid { get; set; } + + public DateTime FacebookPostLastModified { get; set; } + + [Column("FacebookPostSiteID")] + public int FacebookPostSiteId { get; set; } + + [Column("FacebookPostFacebookAccountID")] + public int FacebookPostFacebookAccountId { get; set; } + + public string FacebookPostText { get; set; } = null!; + + [Column("FacebookPostURLShortenerType")] + public int? FacebookPostUrlshortenerType { get; set; } + + public int? FacebookPostErrorCode { get; set; } + + public int? FacebookPostErrorSubcode { get; set; } + + [Column("FacebookPostExternalID")] + public string? FacebookPostExternalId { get; set; } + + public DateTime? FacebookPostPublishedDateTime { get; set; } + + public DateTime? FacebookPostScheduledPublishDateTime { get; set; } + + [Column("FacebookPostCampaignID")] + public int? FacebookPostCampaignId { get; set; } + + public bool? FacebookPostPostAfterDocumentPublish { get; set; } + + public int? FacebookPostInsightPeopleReached { get; set; } + + public int? FacebookPostInsightLikesFromPage { get; set; } + + public int? FacebookPostInsightCommentsFromPage { get; set; } + + public int? FacebookPostInsightSharesFromPage { get; set; } + + public int? FacebookPostInsightLikesTotal { get; set; } + + public int? FacebookPostInsightCommentsTotal { get; set; } + + public int? FacebookPostInsightNegativeHidePost { get; set; } + + public int? FacebookPostInsightNegativeHideAllPosts { get; set; } + + public int? FacebookPostInsightNegativeReportSpam { get; set; } + + public int? FacebookPostInsightNegativeUnlikePage { get; set; } + + public DateTime? FacebookPostInsightsLastUpdated { get; set; } + + [Column("FacebookPostDocumentGUID")] + public Guid? FacebookPostDocumentGuid { get; set; } + + public bool? FacebookPostIsCreatedByUser { get; set; } + + [ForeignKey("FacebookPostCampaignId")] + [InverseProperty("SmFacebookPosts")] + public virtual AnalyticsCampaign? FacebookPostCampaign { get; set; } + + [ForeignKey("FacebookPostFacebookAccountId")] + [InverseProperty("SmFacebookPosts")] + public virtual SmFacebookAccount FacebookPostFacebookAccount { get; set; } = null!; + + [ForeignKey("FacebookPostSiteId")] + [InverseProperty("SmFacebookPosts")] + public virtual CmsSite FacebookPostSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/SmInsight.cs b/Migration.Tool.K11/Models/SmInsight.cs new file mode 100644 index 00000000..bbf50ea3 --- /dev/null +++ b/Migration.Tool.K11/Models/SmInsight.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SM_Insight")] +[Index("InsightCodeName", "InsightPeriodType", Name = "IX_SM_Insight_InsightCodeName_InsightPeriodType")] +public class SmInsight +{ + [Key] + [Column("InsightID")] + public int InsightId { get; set; } + + [StringLength(200)] + public string InsightCodeName { get; set; } = null!; + + [Column("InsightExternalID")] + public string InsightExternalId { get; set; } = null!; + + [StringLength(20)] + public string InsightPeriodType { get; set; } = null!; + + public string? InsightValueName { get; set; } + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitDays { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitMonths { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitWeeks { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitYears { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/SmInsightHitDay.cs b/Migration.Tool.K11/Models/SmInsightHitDay.cs new file mode 100644 index 00000000..408899c6 --- /dev/null +++ b/Migration.Tool.K11/Models/SmInsightHitDay.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SM_InsightHit_Day")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Day_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitDay +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitDays")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/SmInsightHitMonth.cs b/Migration.Tool.K11/Models/SmInsightHitMonth.cs new file mode 100644 index 00000000..4e28c2c5 --- /dev/null +++ b/Migration.Tool.K11/Models/SmInsightHitMonth.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SM_InsightHit_Month")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Month_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitMonth +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitMonths")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/SmInsightHitWeek.cs b/Migration.Tool.K11/Models/SmInsightHitWeek.cs new file mode 100644 index 00000000..3be07b24 --- /dev/null +++ b/Migration.Tool.K11/Models/SmInsightHitWeek.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SM_InsightHit_Week")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Week_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitWeek +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitWeeks")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/SmInsightHitYear.cs b/Migration.Tool.K11/Models/SmInsightHitYear.cs new file mode 100644 index 00000000..3f06865f --- /dev/null +++ b/Migration.Tool.K11/Models/SmInsightHitYear.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SM_InsightHit_Year")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Year_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitYear +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitYears")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/SmLinkedInAccount.cs b/Migration.Tool.K11/Models/SmLinkedInAccount.cs new file mode 100644 index 00000000..64f4ff9b --- /dev/null +++ b/Migration.Tool.K11/Models/SmLinkedInAccount.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("SM_LinkedInAccount")] +public class SmLinkedInAccount +{ + [Key] + [Column("LinkedInAccountID")] + public int LinkedInAccountId { get; set; } + + [StringLength(200)] + public string LinkedInAccountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string LinkedInAccountName { get; set; } = null!; + + public bool? LinkedInAccountIsDefault { get; set; } + + [StringLength(500)] + public string LinkedInAccountAccessToken { get; set; } = null!; + + [StringLength(500)] + public string LinkedInAccountAccessTokenSecret { get; set; } = null!; + + public DateTime LinkedInAccountLastModified { get; set; } + + [Column("LinkedInAccountGUID")] + public Guid LinkedInAccountGuid { get; set; } + + [Column("LinkedInAccountSiteID")] + public int LinkedInAccountSiteId { get; set; } + + [Column("LinkedInAccountProfileID")] + [StringLength(50)] + public string LinkedInAccountProfileId { get; set; } = null!; + + [Column("LinkedInAccountLinkedInApplicationID")] + public int LinkedInAccountLinkedInApplicationId { get; set; } + + [StringLength(200)] + public string? LinkedInAccountProfileName { get; set; } + + public DateTime? LinkedInAccountAccessTokenExpiration { get; set; } + + [InverseProperty("LinkedInPostLinkedInAccount")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/SmLinkedInApplication.cs b/Migration.Tool.K11/Models/SmLinkedInApplication.cs new file mode 100644 index 00000000..8f84f0c1 --- /dev/null +++ b/Migration.Tool.K11/Models/SmLinkedInApplication.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SM_LinkedInApplication")] +[Index("LinkedInApplicationSiteId", Name = "IX_SM_LinkedInApplication_LinkedInApplicationSiteID")] +public class SmLinkedInApplication +{ + [Key] + [Column("LinkedInApplicationID")] + public int LinkedInApplicationId { get; set; } + + [StringLength(200)] + public string LinkedInApplicationDisplayName { get; set; } = null!; + + [StringLength(200)] + public string LinkedInApplicationName { get; set; } = null!; + + [StringLength(500)] + public string LinkedInApplicationConsumerSecret { get; set; } = null!; + + [StringLength(500)] + public string LinkedInApplicationConsumerKey { get; set; } = null!; + + public DateTime LinkedInApplicationLastModified { get; set; } + + [Column("LinkedInApplicationGUID")] + public Guid LinkedInApplicationGuid { get; set; } + + [Column("LinkedInApplicationSiteID")] + public int LinkedInApplicationSiteId { get; set; } + + [ForeignKey("LinkedInApplicationSiteId")] + [InverseProperty("SmLinkedInApplications")] + public virtual CmsSite LinkedInApplicationSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/SmLinkedInPost.cs b/Migration.Tool.K11/Models/SmLinkedInPost.cs new file mode 100644 index 00000000..c0c908ae --- /dev/null +++ b/Migration.Tool.K11/Models/SmLinkedInPost.cs @@ -0,0 +1,84 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SM_LinkedInPost")] +[Index("LinkedInPostCampaignId", Name = "IX_SM_LinkedInPost_LinkedInPostCampaignID")] +[Index("LinkedInPostLinkedInAccountId", Name = "IX_SM_LinkedInPost_LinkedInPostLinkedInAccountID")] +[Index("LinkedInPostSiteId", Name = "IX_SM_LinkedInPost_LinkedInPostSiteID")] +public class SmLinkedInPost +{ + [Key] + [Column("LinkedInPostID")] + public int LinkedInPostId { get; set; } + + [Column("LinkedInPostLinkedInAccountID")] + public int LinkedInPostLinkedInAccountId { get; set; } + + [StringLength(700)] + public string LinkedInPostComment { get; set; } = null!; + + [Column("LinkedInPostSiteID")] + public int LinkedInPostSiteId { get; set; } + + [Column("LinkedInPostGUID")] + public Guid LinkedInPostGuid { get; set; } + + public DateTime? LinkedInPostLastModified { get; set; } + + [StringLength(200)] + public string? LinkedInPostUpdateKey { get; set; } + + [Column("LinkedInPostURLShortenerType")] + public int? LinkedInPostUrlshortenerType { get; set; } + + public DateTime? LinkedInPostScheduledPublishDateTime { get; set; } + + [Column("LinkedInPostCampaignID")] + public int? LinkedInPostCampaignId { get; set; } + + public DateTime? LinkedInPostPublishedDateTime { get; set; } + + [Column("LinkedInPostHTTPStatusCode")] + public int? LinkedInPostHttpstatusCode { get; set; } + + public int? LinkedInPostErrorCode { get; set; } + + public string? LinkedInPostErrorMessage { get; set; } + + [Column("LinkedInPostDocumentGUID")] + public Guid? LinkedInPostDocumentGuid { get; set; } + + public bool? LinkedInPostIsCreatedByUser { get; set; } + + public bool? LinkedInPostPostAfterDocumentPublish { get; set; } + + public DateTime? LinkedInPostInsightsLastUpdated { get; set; } + + public int? LinkedInPostCommentCount { get; set; } + + public int? LinkedInPostImpressionCount { get; set; } + + public int? LinkedInPostLikeCount { get; set; } + + public int? LinkedInPostShareCount { get; set; } + + public int? LinkedInPostClickCount { get; set; } + + public double? LinkedInPostEngagement { get; set; } + + [ForeignKey("LinkedInPostCampaignId")] + [InverseProperty("SmLinkedInPosts")] + public virtual AnalyticsCampaign? LinkedInPostCampaign { get; set; } + + [ForeignKey("LinkedInPostLinkedInAccountId")] + [InverseProperty("SmLinkedInPosts")] + public virtual SmLinkedInAccount LinkedInPostLinkedInAccount { get; set; } = null!; + + [ForeignKey("LinkedInPostSiteId")] + [InverseProperty("SmLinkedInPosts")] + public virtual CmsSite LinkedInPostSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/SmTwitterAccount.cs b/Migration.Tool.K11/Models/SmTwitterAccount.cs new file mode 100644 index 00000000..8d7f88ae --- /dev/null +++ b/Migration.Tool.K11/Models/SmTwitterAccount.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SM_TwitterAccount")] +[Index("TwitterAccountSiteId", Name = "IX_SM_TwitterAccount_TwitterAccountSiteID")] +[Index("TwitterAccountTwitterApplicationId", Name = "IX_SM_TwitterAccount_TwitterAccountTwitterApplicationID")] +public class SmTwitterAccount +{ + [Key] + [Column("TwitterAccountID")] + public int TwitterAccountId { get; set; } + + [StringLength(200)] + public string TwitterAccountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TwitterAccountName { get; set; } = null!; + + public DateTime TwitterAccountLastModified { get; set; } + + [Column("TwitterAccountGUID")] + public Guid TwitterAccountGuid { get; set; } + + [Column("TwitterAccountSiteID")] + public int TwitterAccountSiteId { get; set; } + + [StringLength(500)] + public string TwitterAccountAccessToken { get; set; } = null!; + + [StringLength(500)] + public string TwitterAccountAccessTokenSecret { get; set; } = null!; + + [Column("TwitterAccountTwitterApplicationID")] + public int TwitterAccountTwitterApplicationId { get; set; } + + public int? TwitterAccountFollowers { get; set; } + + public int? TwitterAccountMentions { get; set; } + + [StringLength(40)] + public string? TwitterAccountMentionsRange { get; set; } + + [Column("TwitterAccountUserID")] + [StringLength(20)] + public string? TwitterAccountUserId { get; set; } + + public bool? TwitterAccountIsDefault { get; set; } + + [InverseProperty("TwitterPostTwitterAccount")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); + + [ForeignKey("TwitterAccountSiteId")] + [InverseProperty("SmTwitterAccounts")] + public virtual CmsSite TwitterAccountSite { get; set; } = null!; + + [ForeignKey("TwitterAccountTwitterApplicationId")] + [InverseProperty("SmTwitterAccounts")] + public virtual SmTwitterApplication TwitterAccountTwitterApplication { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/SmTwitterApplication.cs b/Migration.Tool.K11/Models/SmTwitterApplication.cs new file mode 100644 index 00000000..f0cc74e3 --- /dev/null +++ b/Migration.Tool.K11/Models/SmTwitterApplication.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SM_TwitterApplication")] +[Index("TwitterApplicationSiteId", Name = "IX_SM_TwitterApplication_TwitterApplicationSiteID")] +public class SmTwitterApplication +{ + [Key] + [Column("TwitterApplicationID")] + public int TwitterApplicationId { get; set; } + + [StringLength(200)] + public string TwitterApplicationDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TwitterApplicationName { get; set; } = null!; + + public DateTime TwitterApplicationLastModified { get; set; } + + [Column("TwitterApplicationGUID")] + public Guid TwitterApplicationGuid { get; set; } + + [Column("TwitterApplicationSiteID")] + public int TwitterApplicationSiteId { get; set; } + + [StringLength(500)] + public string TwitterApplicationConsumerKey { get; set; } = null!; + + [StringLength(500)] + public string TwitterApplicationConsumerSecret { get; set; } = null!; + + [InverseProperty("TwitterAccountTwitterApplication")] + public virtual ICollection SmTwitterAccounts { get; set; } = new List(); + + [ForeignKey("TwitterApplicationSiteId")] + [InverseProperty("SmTwitterApplications")] + public virtual CmsSite TwitterApplicationSite { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/SmTwitterPost.cs b/Migration.Tool.K11/Models/SmTwitterPost.cs new file mode 100644 index 00000000..3c09914a --- /dev/null +++ b/Migration.Tool.K11/Models/SmTwitterPost.cs @@ -0,0 +1,70 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("SM_TwitterPost")] +[Index("TwitterPostCampaignId", Name = "IX_SM_TwitterPost_TwitterPostCampaignID")] +[Index("TwitterPostSiteId", Name = "IX_SM_TwitterPost_TwitterPostSiteID")] +[Index("TwitterPostTwitterAccountId", Name = "IX_SM_TwitterPost_TwitterPostTwitterAccountID")] +public class SmTwitterPost +{ + [Key] + [Column("TwitterPostID")] + public int TwitterPostId { get; set; } + + [Column("TwitterPostGUID")] + public Guid TwitterPostGuid { get; set; } + + public DateTime TwitterPostLastModified { get; set; } + + [Column("TwitterPostSiteID")] + public int TwitterPostSiteId { get; set; } + + [Column("TwitterPostTwitterAccountID")] + public int TwitterPostTwitterAccountId { get; set; } + + public string TwitterPostText { get; set; } = null!; + + [Column("TwitterPostURLShortenerType")] + public int? TwitterPostUrlshortenerType { get; set; } + + [Column("TwitterPostExternalID")] + public string? TwitterPostExternalId { get; set; } + + public int? TwitterPostErrorCode { get; set; } + + public DateTime? TwitterPostPublishedDateTime { get; set; } + + public DateTime? TwitterPostScheduledPublishDateTime { get; set; } + + [Column("TwitterPostCampaignID")] + public int? TwitterPostCampaignId { get; set; } + + public int? TwitterPostFavorites { get; set; } + + public int? TwitterPostRetweets { get; set; } + + public bool? TwitterPostPostAfterDocumentPublish { get; set; } + + public DateTime? TwitterPostInsightsUpdateDateTime { get; set; } + + [Column("TwitterPostDocumentGUID")] + public Guid? TwitterPostDocumentGuid { get; set; } + + public bool? TwitterPostIsCreatedByUser { get; set; } + + [ForeignKey("TwitterPostCampaignId")] + [InverseProperty("SmTwitterPosts")] + public virtual AnalyticsCampaign? TwitterPostCampaign { get; set; } + + [ForeignKey("TwitterPostSiteId")] + [InverseProperty("SmTwitterPosts")] + public virtual CmsSite TwitterPostSite { get; set; } = null!; + + [ForeignKey("TwitterPostTwitterAccountId")] + [InverseProperty("SmTwitterPosts")] + public virtual SmTwitterAccount TwitterPostTwitterAccount { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/StagingServer.cs b/Migration.Tool.K11/Models/StagingServer.cs new file mode 100644 index 00000000..cfb4d04d --- /dev/null +++ b/Migration.Tool.K11/Models/StagingServer.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Staging_Server")] +[Index("ServerEnabled", Name = "IX_Staging_Server_ServerEnabled")] +[Index("ServerSiteId", Name = "IX_Staging_Server_ServerSiteID")] +public class StagingServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(100)] + public string ServerName { get; set; } = null!; + + [StringLength(440)] + public string ServerDisplayName { get; set; } = null!; + + [Column("ServerSiteID")] + public int ServerSiteId { get; set; } + + [Column("ServerURL")] + [StringLength(450)] + public string ServerUrl { get; set; } = null!; + + [Required] + public bool? ServerEnabled { get; set; } + + [StringLength(20)] + public string ServerAuthentication { get; set; } = null!; + + [StringLength(100)] + public string? ServerUsername { get; set; } + + [StringLength(100)] + public string? ServerPassword { get; set; } + + [Column("ServerX509ClientKeyID")] + [StringLength(200)] + public string? ServerX509clientKeyId { get; set; } + + [Column("ServerX509ServerKeyID")] + [StringLength(200)] + public string? ServerX509serverKeyId { get; set; } + + [Column("ServerGUID")] + public Guid ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + [ForeignKey("ServerSiteId")] + [InverseProperty("StagingServers")] + public virtual CmsSite ServerSite { get; set; } = null!; + + [InverseProperty("SynchronizationServer")] + public virtual ICollection StagingSynchronizations { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/StagingSynchronization.cs b/Migration.Tool.K11/Models/StagingSynchronization.cs new file mode 100644 index 00000000..6a2dbf1b --- /dev/null +++ b/Migration.Tool.K11/Models/StagingSynchronization.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Staging_Synchronization")] +[Index("SynchronizationServerId", Name = "IX_Staging_Synchronization_SynchronizationServerID")] +[Index("SynchronizationTaskId", Name = "IX_Staging_Synchronization_SynchronizationTaskID")] +public class StagingSynchronization +{ + [Key] + [Column("SynchronizationID")] + public int SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int SynchronizationTaskId { get; set; } + + [Column("SynchronizationServerID")] + public int SynchronizationServerId { get; set; } + + public DateTime? SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + [ForeignKey("SynchronizationServerId")] + [InverseProperty("StagingSynchronizations")] + public virtual StagingServer SynchronizationServer { get; set; } = null!; + + [ForeignKey("SynchronizationTaskId")] + [InverseProperty("StagingSynchronizations")] + public virtual StagingTask SynchronizationTask { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/StagingTask.cs b/Migration.Tool.K11/Models/StagingTask.cs new file mode 100644 index 00000000..6f14d859 --- /dev/null +++ b/Migration.Tool.K11/Models/StagingTask.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Staging_Task")] +[Index("TaskDocumentId", "TaskNodeId", "TaskRunning", Name = "IX_Staging_Task_TaskDocumentID_TaskNodeID_TaskRunning")] +[Index("TaskObjectType", "TaskObjectId", "TaskRunning", Name = "IX_Staging_Task_TaskObjectType_TaskObjectID_TaskRunning")] +[Index("TaskSiteId", Name = "IX_Staging_Task_TaskSiteID")] +[Index("TaskType", Name = "IX_Staging_Task_TaskType")] +public class StagingTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + [StringLength(450)] + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool? TaskRunning { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + public string? TaskServers { get; set; } + + [InverseProperty("SynchronizationTask")] + public virtual ICollection StagingSynchronizations { get; set; } = new List(); + + [InverseProperty("Task")] + public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); + + [InverseProperty("Task")] + public virtual ICollection StagingTaskUsers { get; set; } = new List(); + + [ForeignKey("TaskSiteId")] + [InverseProperty("StagingTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Tool.K11/Models/StagingTaskGroup.cs b/Migration.Tool.K11/Models/StagingTaskGroup.cs new file mode 100644 index 00000000..6e884c5a --- /dev/null +++ b/Migration.Tool.K11/Models/StagingTaskGroup.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("staging_TaskGroup")] +public class StagingTaskGroup +{ + [Key] + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [StringLength(50)] + public string TaskGroupCodeName { get; set; } = null!; + + public Guid TaskGroupGuid { get; set; } + + public string? TaskGroupDescription { get; set; } + + [InverseProperty("TaskGroup")] + public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); + + [InverseProperty("TaskGroup")] + public virtual ICollection StagingTaskGroupUsers { get; set; } = new List(); +} diff --git a/Migration.Tool.K11/Models/StagingTaskGroupTask.cs b/Migration.Tool.K11/Models/StagingTaskGroupTask.cs new file mode 100644 index 00000000..f638286c --- /dev/null +++ b/Migration.Tool.K11/Models/StagingTaskGroupTask.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("staging_TaskGroupTask")] +[Index("TaskGroupId", Name = "IX_Staging_TaskGroupTask_TaskGroupID")] +[Index("TaskId", Name = "IX_Staging_TaskGroupTask_TaskID")] +public class StagingTaskGroupTask +{ + [Key] + [Column("TaskGroupTaskID")] + public int TaskGroupTaskId { get; set; } + + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [ForeignKey("TaskId")] + [InverseProperty("StagingTaskGroupTasks")] + public virtual StagingTask Task { get; set; } = null!; + + [ForeignKey("TaskGroupId")] + [InverseProperty("StagingTaskGroupTasks")] + public virtual StagingTaskGroup TaskGroup { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/StagingTaskGroupUser.cs b/Migration.Tool.K11/Models/StagingTaskGroupUser.cs new file mode 100644 index 00000000..75ed792e --- /dev/null +++ b/Migration.Tool.K11/Models/StagingTaskGroupUser.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("staging_TaskGroupUser")] +[Index("TaskGroupId", Name = "IX_Staging_TaskGroupUser_TaskGroup_ID")] +[Index("UserId", Name = "IX_Staging_TaskGroupUser_UserID", IsUnique = true)] +public class StagingTaskGroupUser +{ + [Key] + [Column("TaskGroupUserID")] + public int TaskGroupUserId { get; set; } + + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("TaskGroupId")] + [InverseProperty("StagingTaskGroupUsers")] + public virtual StagingTaskGroup TaskGroup { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("StagingTaskGroupUser")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/StagingTaskUser.cs b/Migration.Tool.K11/Models/StagingTaskUser.cs new file mode 100644 index 00000000..753957ef --- /dev/null +++ b/Migration.Tool.K11/Models/StagingTaskUser.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Table("Staging_TaskUser")] +[Index("TaskId", Name = "IX_Staging_TaskUser_TaskID")] +[Index("UserId", Name = "IX_Staging_TaskUser_UserID")] +public class StagingTaskUser +{ + [Key] + [Column("TaskUserID")] + public int TaskUserId { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("TaskId")] + [InverseProperty("StagingTaskUsers")] + public virtual StagingTask Task { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("StagingTaskUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/StorecontentBook.cs b/Migration.Tool.K11/Models/StorecontentBook.cs similarity index 92% rename from Migration.Toolkit.K11/Models/StorecontentBook.cs rename to Migration.Tool.K11/Models/StorecontentBook.cs index bea10edf..693ce18c 100644 --- a/Migration.Toolkit.K11/Models/StorecontentBook.cs +++ b/Migration.Tool.K11/Models/StorecontentBook.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("STORECONTENT_Book")] public class StorecontentBook diff --git a/Migration.Toolkit.K11/Models/StorecontentCellPhone.cs b/Migration.Tool.K11/Models/StorecontentCellPhone.cs similarity index 97% rename from Migration.Toolkit.K11/Models/StorecontentCellPhone.cs rename to Migration.Tool.K11/Models/StorecontentCellPhone.cs index f73f6302..582e6bda 100644 --- a/Migration.Toolkit.K11/Models/StorecontentCellPhone.cs +++ b/Migration.Tool.K11/Models/StorecontentCellPhone.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("STORECONTENT_CellPhone")] public class StorecontentCellPhone diff --git a/Migration.Toolkit.K11/Models/StorecontentComputer.cs b/Migration.Tool.K11/Models/StorecontentComputer.cs similarity index 95% rename from Migration.Toolkit.K11/Models/StorecontentComputer.cs rename to Migration.Tool.K11/Models/StorecontentComputer.cs index e59516fa..2be09b8a 100644 --- a/Migration.Toolkit.K11/Models/StorecontentComputer.cs +++ b/Migration.Tool.K11/Models/StorecontentComputer.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("STORECONTENT_Computer")] public class StorecontentComputer diff --git a/Migration.Toolkit.K11/Models/StorecontentCup.cs b/Migration.Tool.K11/Models/StorecontentCup.cs similarity index 91% rename from Migration.Toolkit.K11/Models/StorecontentCup.cs rename to Migration.Tool.K11/Models/StorecontentCup.cs index 56e87f1c..6d30ee03 100644 --- a/Migration.Toolkit.K11/Models/StorecontentCup.cs +++ b/Migration.Tool.K11/Models/StorecontentCup.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("STORECONTENT_Cup")] public class StorecontentCup diff --git a/Migration.Toolkit.K11/Models/StorecontentLaptop.cs b/Migration.Tool.K11/Models/StorecontentLaptop.cs similarity index 97% rename from Migration.Toolkit.K11/Models/StorecontentLaptop.cs rename to Migration.Tool.K11/Models/StorecontentLaptop.cs index 689821db..1b32ec57 100644 --- a/Migration.Toolkit.K11/Models/StorecontentLaptop.cs +++ b/Migration.Tool.K11/Models/StorecontentLaptop.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("STORECONTENT_Laptop")] public class StorecontentLaptop diff --git a/Migration.Toolkit.K11/Models/StorecontentMediaPlayer.cs b/Migration.Tool.K11/Models/StorecontentMediaPlayer.cs similarity index 95% rename from Migration.Toolkit.K11/Models/StorecontentMediaPlayer.cs rename to Migration.Tool.K11/Models/StorecontentMediaPlayer.cs index 19c31303..d4acce7c 100644 --- a/Migration.Toolkit.K11/Models/StorecontentMediaPlayer.cs +++ b/Migration.Tool.K11/Models/StorecontentMediaPlayer.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("STORECONTENT_MediaPlayer")] public class StorecontentMediaPlayer diff --git a/Migration.Toolkit.K11/Models/StorecontentPant.cs b/Migration.Tool.K11/Models/StorecontentPant.cs similarity index 90% rename from Migration.Toolkit.K11/Models/StorecontentPant.cs rename to Migration.Tool.K11/Models/StorecontentPant.cs index 3c5ce839..9f7bb104 100644 --- a/Migration.Toolkit.K11/Models/StorecontentPant.cs +++ b/Migration.Tool.K11/Models/StorecontentPant.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("STORECONTENT_Pants")] public class StorecontentPant diff --git a/Migration.Toolkit.K11/Models/StorecontentPerfume.cs b/Migration.Tool.K11/Models/StorecontentPerfume.cs similarity index 90% rename from Migration.Toolkit.K11/Models/StorecontentPerfume.cs rename to Migration.Tool.K11/Models/StorecontentPerfume.cs index bffd4519..5ad82ffa 100644 --- a/Migration.Toolkit.K11/Models/StorecontentPerfume.cs +++ b/Migration.Tool.K11/Models/StorecontentPerfume.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("STORECONTENT_Perfume")] public class StorecontentPerfume diff --git a/Migration.Toolkit.K11/Models/StorecontentShoe.cs b/Migration.Tool.K11/Models/StorecontentShoe.cs similarity index 90% rename from Migration.Toolkit.K11/Models/StorecontentShoe.cs rename to Migration.Tool.K11/Models/StorecontentShoe.cs index 3b2a6804..5ea5e4ec 100644 --- a/Migration.Toolkit.K11/Models/StorecontentShoe.cs +++ b/Migration.Tool.K11/Models/StorecontentShoe.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("STORECONTENT_Shoes")] public class StorecontentShoe diff --git a/Migration.Toolkit.K11/Models/StorecontentTablet.cs b/Migration.Tool.K11/Models/StorecontentTablet.cs similarity index 96% rename from Migration.Toolkit.K11/Models/StorecontentTablet.cs rename to Migration.Tool.K11/Models/StorecontentTablet.cs index 1dba31e6..fa9c7305 100644 --- a/Migration.Toolkit.K11/Models/StorecontentTablet.cs +++ b/Migration.Tool.K11/Models/StorecontentTablet.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("STORECONTENT_tablet")] public class StorecontentTablet diff --git a/Migration.Toolkit.K11/Models/StorecontentTshirt.cs b/Migration.Tool.K11/Models/StorecontentTshirt.cs similarity index 90% rename from Migration.Toolkit.K11/Models/StorecontentTshirt.cs rename to Migration.Tool.K11/Models/StorecontentTshirt.cs index 913b2fad..ce1f8bda 100644 --- a/Migration.Toolkit.K11/Models/StorecontentTshirt.cs +++ b/Migration.Tool.K11/Models/StorecontentTshirt.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("STORECONTENT_Tshirt")] public class StorecontentTshirt diff --git a/Migration.Toolkit.K11/Models/StorecontentTv.cs b/Migration.Tool.K11/Models/StorecontentTv.cs similarity index 96% rename from Migration.Toolkit.K11/Models/StorecontentTv.cs rename to Migration.Tool.K11/Models/StorecontentTv.cs index 1b8d6db5..9f78ad45 100644 --- a/Migration.Toolkit.K11/Models/StorecontentTv.cs +++ b/Migration.Tool.K11/Models/StorecontentTv.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("STORECONTENT_TV")] public class StorecontentTv diff --git a/Migration.Toolkit.K11/Models/StorecontentWatch.cs b/Migration.Tool.K11/Models/StorecontentWatch.cs similarity index 93% rename from Migration.Toolkit.K11/Models/StorecontentWatch.cs rename to Migration.Tool.K11/Models/StorecontentWatch.cs index 721fa533..922c7949 100644 --- a/Migration.Toolkit.K11/Models/StorecontentWatch.cs +++ b/Migration.Tool.K11/Models/StorecontentWatch.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Table("STORECONTENT_Watch")] public class StorecontentWatch diff --git a/Migration.Tool.K11/Models/TempFile.cs b/Migration.Tool.K11/Models/TempFile.cs new file mode 100644 index 00000000..0001938f --- /dev/null +++ b/Migration.Tool.K11/Models/TempFile.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.K11.Models; + +[Table("Temp_File")] +public class TempFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileParentGUID")] + public Guid FileParentGuid { get; set; } + + public int FileNumber { get; set; } + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + public long FileSize { get; set; } + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + public byte[]? FileBinary { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + public DateTime FileLastModified { get; set; } + + [StringLength(200)] + public string FileDirectory { get; set; } = null!; + + [StringLength(200)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string? FileTitle { get; set; } + + public string? FileDescription { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewBoardsBoardMessageJoined.cs b/Migration.Tool.K11/Models/ViewBoardsBoardMessageJoined.cs new file mode 100644 index 00000000..e198a5e5 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewBoardsBoardMessageJoined.cs @@ -0,0 +1,158 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewBoardsBoardMessageJoined +{ + [Column("BoardID")] + public int BoardId { get; set; } + + [StringLength(250)] + public string BoardName { get; set; } = null!; + + [StringLength(250)] + public string BoardDisplayName { get; set; } = null!; + + public string BoardDescription { get; set; } = null!; + + public DateTime? BoardOpenedFrom { get; set; } + + public bool BoardOpened { get; set; } + + public DateTime? BoardOpenedTo { get; set; } + + public bool BoardEnabled { get; set; } + + public bool BoardModerated { get; set; } + + public int BoardAccess { get; set; } + + public bool BoardUseCaptcha { get; set; } + + public DateTime BoardLastModified { get; set; } + + public int BoardMessages { get; set; } + + [Column("BoardDocumentID")] + public int BoardDocumentId { get; set; } + + [Column("BoardGUID")] + public Guid BoardGuid { get; set; } + + [Column("BoardUserID")] + public int? BoardUserId { get; set; } + + [Column("BoardGroupID")] + public int? BoardGroupId { get; set; } + + public DateTime? BoardLastMessageTime { get; set; } + + [StringLength(250)] + public string? BoardLastMessageUserName { get; set; } + + [Column("BoardUnsubscriptionURL")] + [StringLength(450)] + public string? BoardUnsubscriptionUrl { get; set; } + + public bool? BoardRequireEmails { get; set; } + + [Column("BoardSiteID")] + public int BoardSiteId { get; set; } + + public bool BoardEnableSubscriptions { get; set; } + + [Column("BoardBaseURL")] + [StringLength(450)] + public string? BoardBaseUrl { get; set; } + + [Column("MessageID")] + public int MessageId { get; set; } + + [StringLength(250)] + public string MessageUserName { get; set; } = null!; + + public string MessageText { get; set; } = null!; + + [StringLength(254)] + public string MessageEmail { get; set; } = null!; + + [Column("MessageURL")] + [StringLength(450)] + public string MessageUrl { get; set; } = null!; + + public bool MessageIsSpam { get; set; } + + [Column("MessageBoardID")] + public int MessageBoardId { get; set; } + + public bool MessageApproved { get; set; } + + [Column("MessageUserID")] + public int? MessageUserId { get; set; } + + [Column("MessageApprovedByUserID")] + public int? MessageApprovedByUserId { get; set; } + + public string MessageUserInfo { get; set; } = null!; + + [Column("MessageAvatarGUID")] + public Guid? MessageAvatarGuid { get; set; } + + public DateTime MessageInserted { get; set; } + + public DateTime MessageLastModified { get; set; } + + [Column("MessageGUID")] + public Guid MessageGuid { get; set; } + + public double? MessageRatingValue { get; set; } + + [Column("GroupID")] + public int? GroupId { get; set; } + + [Column("GroupGUID")] + public Guid? GroupGuid { get; set; } + + public DateTime? GroupLastModified { get; set; } + + [Column("GroupSiteID")] + public int? GroupSiteId { get; set; } + + [StringLength(200)] + public string? GroupDisplayName { get; set; } + + [StringLength(100)] + public string? GroupName { get; set; } + + public string? GroupDescription { get; set; } + + [Column("GroupNodeGUID")] + public Guid? GroupNodeGuid { get; set; } + + public int? GroupApproveMembers { get; set; } + + public int? GroupAccess { get; set; } + + [Column("GroupCreatedByUserID")] + public int? GroupCreatedByUserId { get; set; } + + [Column("GroupApprovedByUserID")] + public int? GroupApprovedByUserId { get; set; } + + [Column("GroupAvatarID")] + public int? GroupAvatarId { get; set; } + + public bool? GroupApproved { get; set; } + + public DateTime? GroupCreatedWhen { get; set; } + + public bool? GroupSendJoinLeaveNotification { get; set; } + + public bool? GroupSendWaitingForApprovalNotification { get; set; } + + public int? GroupSecurity { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsAclitemItemsAndOperator.cs b/Migration.Tool.K11/Models/ViewCmsAclitemItemsAndOperator.cs new file mode 100644 index 00000000..53e03dd5 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsAclitemItemsAndOperator.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsAclitemItemsAndOperator +{ + [Column("ACLOwnerNodeID")] + public int AclownerNodeId { get; set; } + + [Column("ACLItemID")] + public int AclitemId { get; set; } + + public int Allowed { get; set; } + + public int Denied { get; set; } + + [StringLength(51)] + public string? Operator { get; set; } + + [StringLength(100)] + public string? OperatorName { get; set; } + + [Column("ACLID")] + public int Aclid { get; set; } + + [StringLength(450)] + public string? OperatorFullName { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [Column("RoleID")] + public int? RoleId { get; set; } + + [Column("RoleGroupID")] + public int? RoleGroupId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs b/Migration.Tool.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs new file mode 100644 index 00000000..b7160468 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs @@ -0,0 +1,123 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsObjectVersionHistoryUserJoined +{ + [Column("VersionID")] + public int VersionId { get; set; } + + [Column("VersionObjectID")] + public int? VersionObjectId { get; set; } + + [StringLength(100)] + public string VersionObjectType { get; set; } = null!; + + [Column("VersionObjectSiteID")] + public int? VersionObjectSiteId { get; set; } + + [StringLength(450)] + public string VersionObjectDisplayName { get; set; } = null!; + + [Column("VersionXML")] + public string VersionXml { get; set; } = null!; + + [Column("VersionBinaryDataXML")] + public string? VersionBinaryDataXml { get; set; } + + [Column("VersionModifiedByUserID")] + public int? VersionModifiedByUserId { get; set; } + + public DateTime VersionModifiedWhen { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [StringLength(50)] + public string VersionNumber { get; set; } = null!; + + [Column("VersionSiteBindingIDs")] + public string? VersionSiteBindingIds { get; set; } + + public string? VersionComment { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(100)] + public string? UserName { get; set; } + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string? UserPassword { get; set; } + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool? UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid? UserGuid { get; set; } + + public DateTime? UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int? UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs b/Migration.Tool.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs new file mode 100644 index 00000000..f0e22df5 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs @@ -0,0 +1,57 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsPageTemplateCategoryPageTemplateJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(200)] + public string? CodeName { get; set; } + + [StringLength(200)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryTemplateChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [StringLength(20)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; + + public bool? Parameter { get; set; } + + public int? PageTemplateForAllPages { get; set; } + + [StringLength(10)] + public string? PageTemplateType { get; set; } + + public int? PageTemplateIsReusable { get; set; } + + [StringLength(200)] + public string? PageTemplateIconClass { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsRelationshipJoined.cs b/Migration.Tool.K11/Models/ViewCmsRelationshipJoined.cs new file mode 100644 index 00000000..b7aac3f1 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsRelationshipJoined.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsRelationshipJoined +{ + [Column("LeftNodeID")] + public int LeftNodeId { get; set; } + + [Column("LeftNodeGUID")] + public Guid LeftNodeGuid { get; set; } + + [StringLength(100)] + public string LeftNodeName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipName { get; set; } = null!; + + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + [Column("RightNodeID")] + public int RightNodeId { get; set; } + + [Column("RightNodeGUID")] + public Guid RightNodeGuid { get; set; } + + [StringLength(100)] + public string RightNodeName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipDisplayName { get; set; } = null!; + + public string? RelationshipCustomData { get; set; } + + [Column("LeftClassID")] + public int LeftClassId { get; set; } + + [Column("RightClassID")] + public int RightClassId { get; set; } + + [Column("RelationshipID")] + public int RelationshipId { get; set; } + + public int? RelationshipOrder { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsResourceStringJoined.cs b/Migration.Tool.K11/Models/ViewCmsResourceStringJoined.cs new file mode 100644 index 00000000..dc8dbf84 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsResourceStringJoined.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsResourceStringJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("TranslationID")] + public int? TranslationId { get; set; } + + [Column("TranslationStringID")] + public int? TranslationStringId { get; set; } + + [Column("TranslationCultureID")] + public int? TranslationCultureId { get; set; } + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int? CultureId { get; set; } + + [StringLength(200)] + public string? CultureName { get; set; } + + [StringLength(50)] + public string? CultureCode { get; set; } + + [Column("CultureGUID")] + public Guid? CultureGuid { get; set; } + + public DateTime? CultureLastModified { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Tool.K11/Models/ViewCmsResourceTranslatedJoined.cs new file mode 100644 index 00000000..0dcef1d0 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsResourceTranslatedJoined.cs @@ -0,0 +1,27 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsResourceTranslatedJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ViewCmsRoleResourcePermissionJoined.cs b/Migration.Tool.K11/Models/ViewCmsRoleResourcePermissionJoined.cs new file mode 100644 index 00000000..52eea7d3 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsRoleResourcePermissionJoined.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsRoleResourcePermissionJoined +{ + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + [StringLength(100)] + public string PermissionName { get; set; } = null!; + + [Column("PermissionID")] + public int PermissionId { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsSiteDocumentCount.cs b/Migration.Tool.K11/Models/ViewCmsSiteDocumentCount.cs new file mode 100644 index 00000000..a7713a38 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsSiteDocumentCount.cs @@ -0,0 +1,46 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsSiteDocumentCount +{ + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + [StringLength(200)] + public string SiteDisplayName { get; set; } = null!; + + public string? SiteDescription { get; set; } + + [StringLength(20)] + public string SiteStatus { get; set; } = null!; + + [StringLength(400)] + public string SiteDomainName { get; set; } = null!; + + [Column("SiteDefaultStylesheetID")] + public int? SiteDefaultStylesheetId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + public int? SiteDefaultEditorStylesheet { get; set; } + + [Column("SiteGUID")] + public Guid SiteGuid { get; set; } + + public DateTime SiteLastModified { get; set; } + + public bool? SiteIsContentOnly { get; set; } + + public int? Documents { get; set; } + + public bool? SiteIsOffline { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs b/Migration.Tool.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs new file mode 100644 index 00000000..6bd9f624 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsSiteRoleResourceUielementJoined +{ + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(200)] + public string ElementName { get; set; } = null!; + + [StringLength(100)] + public string? SiteName { get; set; } + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + [Column("RoleSiteID")] + public int? RoleSiteId { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsTreeJoined.cs b/Migration.Tool.K11/Models/ViewCmsTreeJoined.cs new file mode 100644 index 00000000..cef95a2d --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsTreeJoined.cs @@ -0,0 +1,291 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsTreeJoined +{ + [StringLength(100)] + public string ClassName { get; set; } = null!; + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [Column("NodeID")] + public int NodeId { get; set; } + + [StringLength(450)] + public string NodeAliasPath { get; set; } = null!; + + [StringLength(100)] + public string NodeName { get; set; } = null!; + + [StringLength(50)] + public string NodeAlias { get; set; } = null!; + + [Column("NodeClassID")] + public int NodeClassId { get; set; } + + [Column("NodeParentID")] + public int? NodeParentId { get; set; } + + public int NodeLevel { get; set; } + + [Column("NodeACLID")] + public int? NodeAclid { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeGUID")] + public Guid NodeGuid { get; set; } + + public int? NodeOrder { get; set; } + + public bool? IsSecuredNode { get; set; } + + public int? NodeCacheMinutes { get; set; } + + [Column("NodeSKUID")] + public int? NodeSkuid { get; set; } + + public string? NodeDocType { get; set; } + + public string? NodeHeadTags { get; set; } + + public string? NodeBodyElementAttributes { get; set; } + + [StringLength(200)] + public string? NodeInheritPageLevels { get; set; } + + [Column("RequiresSSL")] + public int? RequiresSsl { get; set; } + + [Column("NodeLinkedNodeID")] + public int? NodeLinkedNodeId { get; set; } + + public int? NodeOwner { get; set; } + + public string? NodeCustomData { get; set; } + + [Column("NodeGroupID")] + public int? NodeGroupId { get; set; } + + [Column("NodeLinkedNodeSiteID")] + public int? NodeLinkedNodeSiteId { get; set; } + + [Column("NodeTemplateID")] + public int? NodeTemplateId { get; set; } + + public bool? NodeTemplateForAllCultures { get; set; } + + public bool? NodeInheritPageTemplate { get; set; } + + public bool? NodeAllowCacheInFileSystem { get; set; } + + public bool? NodeHasChildren { get; set; } + + public bool? NodeHasLinks { get; set; } + + [Column("NodeOriginalNodeID")] + public int? NodeOriginalNodeId { get; set; } + + public bool NodeIsContentOnly { get; set; } + + [Column("NodeIsACLOwner")] + public bool NodeIsAclowner { get; set; } + + public string? NodeBodyScripts { get; set; } + + [Column("DocumentID")] + public int DocumentId { get; set; } + + [StringLength(100)] + public string DocumentName { get; set; } = null!; + + [StringLength(1500)] + public string? DocumentNamePath { get; set; } + + public DateTime? DocumentModifiedWhen { get; set; } + + [Column("DocumentModifiedByUserID")] + public int? DocumentModifiedByUserId { get; set; } + + public int? DocumentForeignKeyValue { get; set; } + + [Column("DocumentCreatedByUserID")] + public int? DocumentCreatedByUserId { get; set; } + + public DateTime? DocumentCreatedWhen { get; set; } + + [Column("DocumentCheckedOutByUserID")] + public int? DocumentCheckedOutByUserId { get; set; } + + public DateTime? DocumentCheckedOutWhen { get; set; } + + [Column("DocumentCheckedOutVersionHistoryID")] + public int? DocumentCheckedOutVersionHistoryId { get; set; } + + [Column("DocumentPublishedVersionHistoryID")] + public int? DocumentPublishedVersionHistoryId { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + public DateTime? DocumentPublishFrom { get; set; } + + public DateTime? DocumentPublishTo { get; set; } + + [StringLength(450)] + public string? DocumentUrlPath { get; set; } + + [StringLength(10)] + public string DocumentCulture { get; set; } = null!; + + [Column("DocumentNodeID")] + public int DocumentNodeId { get; set; } + + public string? DocumentPageTitle { get; set; } + + public string? DocumentPageKeyWords { get; set; } + + public string? DocumentPageDescription { get; set; } + + public bool DocumentShowInSiteMap { get; set; } + + public bool DocumentMenuItemHideInNavigation { get; set; } + + [StringLength(200)] + public string? DocumentMenuCaption { get; set; } + + [StringLength(100)] + public string? DocumentMenuStyle { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImage { get; set; } + + [Column("DocumentPageTemplateID")] + public int? DocumentPageTemplateId { get; set; } + + [StringLength(450)] + public string? DocumentMenuJavascript { get; set; } + + [StringLength(450)] + public string? DocumentMenuRedirectUrl { get; set; } + + public bool? DocumentUseNamePathForUrlPath { get; set; } + + [Column("DocumentStylesheetID")] + public int? DocumentStylesheetId { get; set; } + + public string? DocumentContent { get; set; } + + [StringLength(100)] + public string? DocumentMenuClass { get; set; } + + [StringLength(200)] + public string? DocumentMenuStyleHighlighted { get; set; } + + [StringLength(100)] + public string? DocumentMenuClassHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImageHighlighted { get; set; } + + public bool? DocumentMenuItemInactive { get; set; } + + public string? DocumentCustomData { get; set; } + + [StringLength(100)] + public string? DocumentExtensions { get; set; } + + public string? DocumentTags { get; set; } + + [Column("DocumentTagGroupID")] + public int? DocumentTagGroupId { get; set; } + + [StringLength(440)] + public string? DocumentWildcardRule { get; set; } + + public string? DocumentWebParts { get; set; } + + public double? DocumentRatingValue { get; set; } + + public int? DocumentRatings { get; set; } + + public int? DocumentPriority { get; set; } + + [StringLength(50)] + public string? DocumentType { get; set; } + + public DateTime? DocumentLastPublished { get; set; } + + public bool? DocumentUseCustomExtensions { get; set; } + + public string? DocumentGroupWebParts { get; set; } + + public bool? DocumentCheckedOutAutomatically { get; set; } + + [StringLength(200)] + public string? DocumentTrackConversionName { get; set; } + + [StringLength(100)] + public string? DocumentConversionValue { get; set; } + + public bool? DocumentSearchExcluded { get; set; } + + [StringLength(50)] + public string? DocumentLastVersionNumber { get; set; } + + public bool? DocumentIsArchived { get; set; } + + [StringLength(32)] + public string? DocumentHash { get; set; } + + public bool? DocumentLogVisitActivity { get; set; } + + [Column("DocumentGUID")] + public Guid? DocumentGuid { get; set; } + + [Column("DocumentWorkflowCycleGUID")] + public Guid? DocumentWorkflowCycleGuid { get; set; } + + [StringLength(100)] + public string? DocumentSitemapSettings { get; set; } + + public bool? DocumentIsWaitingForTranslation { get; set; } + + [Column("DocumentSKUName")] + [StringLength(440)] + public string? DocumentSkuname { get; set; } + + [Column("DocumentSKUDescription")] + public string? DocumentSkudescription { get; set; } + + [Column("DocumentSKUShortDescription")] + public string? DocumentSkushortDescription { get; set; } + + [StringLength(450)] + public string? DocumentWorkflowActionStatus { get; set; } + + public bool? DocumentMenuRedirectToFirstChild { get; set; } + + public bool DocumentCanBePublished { get; set; } + + public bool DocumentInheritsStylesheet { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsUser.cs b/Migration.Tool.K11/Models/ViewCmsUser.cs new file mode 100644 index 00000000..4736807f --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsUser.cs @@ -0,0 +1,217 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsUser +{ + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [Column("UserSettingsID")] + public int? UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + [StringLength(200)] + public string? UserMessagingNotificationEmail { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid? UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int? UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarFileName { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsUserDocument.cs b/Migration.Tool.K11/Models/ViewCmsUserDocument.cs new file mode 100644 index 00000000..ba06b097 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsUserDocument.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsUserDocument +{ + [StringLength(450)] + public string DocumentName { get; set; } = null!; + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeID")] + public int NodeId { get; set; } + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [StringLength(1500)] + public string? DocumentNamePath { get; set; } + + public DateTime? DocumentModifiedWhen { get; set; } + + [StringLength(10)] + public string DocumentCulture { get; set; } = null!; + + [StringLength(200)] + public string? CultureName { get; set; } + + [Column("UserID1")] + public int? UserId1 { get; set; } + + [Column("UserID2")] + public int? UserId2 { get; set; } + + [Column("UserID3")] + public int? UserId3 { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + [StringLength(450)] + public string NodeAliasPath { get; set; } = null!; + + [StringLength(12)] + [Unicode(false)] + public string Type { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ViewCmsUserRoleJoined.cs b/Migration.Tool.K11/Models/ViewCmsUserRoleJoined.cs new file mode 100644 index 00000000..03bd5533 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsUserRoleJoined.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsUserRoleJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(450)] + public string? FullName { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + [Column("RoleGroupID")] + public int? RoleGroupId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [StringLength(100)] + public string? SiteName { get; set; } + + [Column("SiteGUID")] + public Guid? SiteGuid { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsUserRoleMembershipRole.cs b/Migration.Tool.K11/Models/ViewCmsUserRoleMembershipRole.cs new file mode 100644 index 00000000..38bb4613 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsUserRoleMembershipRole.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsUserRoleMembershipRole +{ + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + public DateTime? ValidTo { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs b/Migration.Tool.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs new file mode 100644 index 00000000..d4e5a50a --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsUserRoleMembershipRoleValidOnlyJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsUserSettingsRoleJoined.cs b/Migration.Tool.K11/Models/ViewCmsUserSettingsRoleJoined.cs new file mode 100644 index 00000000..723b9b4e --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsUserSettingsRoleJoined.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsUserSettingsRoleJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + public bool UserEnabled { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs b/Migration.Tool.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs new file mode 100644 index 00000000..e1d571eb --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs @@ -0,0 +1,67 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsWebPartCategoryWebpartJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(100)] + public string CodeName { get; set; } = null!; + + [StringLength(100)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryWebPartChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [Column("WebPartParentID")] + public int? WebPartParentId { get; set; } + + [StringLength(100)] + public string? WebPartFileName { get; set; } + + [Column("WebPartGUID")] + public Guid? WebPartGuid { get; set; } + + public int? WebPartType { get; set; } + + [StringLength(1000)] + public string? WebPartDescription { get; set; } + + [StringLength(15)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; + + [Column("ThumbnailGUID")] + public Guid? ThumbnailGuid { get; set; } + + [StringLength(200)] + public string? IconClass { get; set; } + + public bool? WebPartSkipInsertProperties { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs b/Migration.Tool.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs new file mode 100644 index 00000000..de2bb979 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCmsWidgetCategoryWidgetJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(100)] + public string CodeName { get; set; } = null!; + + [StringLength(100)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? WidgetCategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? WidgetCategoryChildCount { get; set; } + + public int? WidgetCategoryWidgetChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [Column("WidgetWebPartID")] + public int? WidgetWebPartId { get; set; } + + public int WidgetSecurity { get; set; } + + public bool? WidgetForGroup { get; set; } + + public bool? WidgetForInline { get; set; } + + public bool? WidgetForUser { get; set; } + + public bool? WidgetForEditor { get; set; } + + public bool? WidgetForDashboard { get; set; } + + [Column("WidgetGUID")] + public Guid? WidgetGuid { get; set; } + + [StringLength(14)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs b/Migration.Tool.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs new file mode 100644 index 00000000..7832c0d8 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewComSkuoptionCategoryOptionCategoryJoined +{ + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("CategoryID")] + public int CategoryId { get; set; } + + public bool? AllowAllOptions { get; set; } + + [Column("SKUCategoryID")] + public int SkucategoryId { get; set; } + + [Column("SKUCategoryOrder")] + public int? SkucategoryOrder { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryName { get; set; } = null!; + + [StringLength(200)] + public string CategorySelectionType { get; set; } = null!; + + [StringLength(200)] + public string? CategoryDefaultOptions { get; set; } + + public string? CategoryDescription { get; set; } + + [StringLength(200)] + public string? CategoryDefaultRecord { get; set; } + + public bool CategoryEnabled { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + public bool? CategoryDisplayPrice { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + public int? CategoryTextMaxLength { get; set; } + + [StringLength(20)] + public string? CategoryType { get; set; } + + public int? CategoryTextMinLength { get; set; } + + [StringLength(200)] + public string? CategoryLiveSiteDisplayName { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCommunityFriendFriend.cs b/Migration.Tool.K11/Models/ViewCommunityFriendFriend.cs similarity index 99% rename from Migration.Toolkit.K11/Models/ViewCommunityFriendFriend.cs rename to Migration.Tool.K11/Models/ViewCommunityFriendFriend.cs index eb5b506c..860143df 100644 --- a/Migration.Toolkit.K11/Models/ViewCommunityFriendFriend.cs +++ b/Migration.Tool.K11/Models/ViewCommunityFriendFriend.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Keyless] public class ViewCommunityFriendFriend diff --git a/Migration.Toolkit.K11/Models/ViewCommunityFriendRequestedFriend.cs b/Migration.Tool.K11/Models/ViewCommunityFriendRequestedFriend.cs similarity index 99% rename from Migration.Toolkit.K11/Models/ViewCommunityFriendRequestedFriend.cs rename to Migration.Tool.K11/Models/ViewCommunityFriendRequestedFriend.cs index a2feb77d..33ee9f0d 100644 --- a/Migration.Toolkit.K11/Models/ViewCommunityFriendRequestedFriend.cs +++ b/Migration.Tool.K11/Models/ViewCommunityFriendRequestedFriend.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Keyless] public class ViewCommunityFriendRequestedFriend diff --git a/Migration.Tool.K11/Models/ViewCommunityGroup.cs b/Migration.Tool.K11/Models/ViewCommunityGroup.cs new file mode 100644 index 00000000..285d6473 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCommunityGroup.cs @@ -0,0 +1,66 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCommunityGroup +{ + [Column("GroupID")] + public int GroupId { get; set; } + + [Column("GroupGUID")] + public Guid GroupGuid { get; set; } + + public DateTime GroupLastModified { get; set; } + + [Column("GroupSiteID")] + public int GroupSiteId { get; set; } + + [StringLength(200)] + public string GroupDisplayName { get; set; } = null!; + + [StringLength(100)] + public string GroupName { get; set; } = null!; + + public string GroupDescription { get; set; } = null!; + + [Column("GroupNodeGUID")] + public Guid? GroupNodeGuid { get; set; } + + public int GroupApproveMembers { get; set; } + + public int GroupAccess { get; set; } + + [Column("GroupCreatedByUserID")] + public int? GroupCreatedByUserId { get; set; } + + [Column("GroupApprovedByUserID")] + public int? GroupApprovedByUserId { get; set; } + + [Column("GroupAvatarID")] + public int? GroupAvatarId { get; set; } + + public bool? GroupApproved { get; set; } + + public DateTime GroupCreatedWhen { get; set; } + + public bool? GroupSendJoinLeaveNotification { get; set; } + + public bool? GroupSendWaitingForApprovalNotification { get; set; } + + public int? GroupSecurity { get; set; } + + public bool? GroupLogActivity { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarFileName { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewCommunityMember.cs b/Migration.Tool.K11/Models/ViewCommunityMember.cs new file mode 100644 index 00000000..0c89d58f --- /dev/null +++ b/Migration.Tool.K11/Models/ViewCommunityMember.cs @@ -0,0 +1,248 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewCommunityMember +{ + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [Column("UserSettingsID")] + public int? UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + [StringLength(200)] + public string? UserMessagingNotificationEmail { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid? UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int? UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [Column("MemberID")] + public int? MemberId { get; set; } + + [Column("MemberGUID")] + public Guid? MemberGuid { get; set; } + + [Column("MemberUserID")] + public int? MemberUserId { get; set; } + + [Column("MemberGroupID")] + public int? MemberGroupId { get; set; } + + public DateTime? MemberJoined { get; set; } + + public DateTime? MemberApprovedWhen { get; set; } + + public DateTime? MemberRejectedWhen { get; set; } + + [Column("MemberApprovedByUserID")] + public int? MemberApprovedByUserId { get; set; } + + public string? MemberComment { get; set; } + + [Column("MemberInvitedByUserID")] + public int? MemberInvitedByUserId { get; set; } + + public int? MemberStatus { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } + + [StringLength(200)] + public string? AvatarName { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewForumsGroupForumPostJoined.cs b/Migration.Tool.K11/Models/ViewForumsGroupForumPostJoined.cs new file mode 100644 index 00000000..7335f867 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewForumsGroupForumPostJoined.cs @@ -0,0 +1,227 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewForumsGroupForumPostJoined +{ + [Column("ForumID")] + public int? ForumId { get; set; } + + [Column("ForumGroupID")] + public int? ForumGroupId { get; set; } + + [StringLength(200)] + public string? ForumName { get; set; } + + [StringLength(200)] + public string? ForumDisplayName { get; set; } + + public string? ForumDescription { get; set; } + + public int? ForumOrder { get; set; } + + [Column("ForumDocumentID")] + public int? ForumDocumentId { get; set; } + + public bool? ForumOpen { get; set; } + + public bool? ForumModerated { get; set; } + + public bool? ForumDisplayEmails { get; set; } + + public bool? ForumRequireEmail { get; set; } + + public int? ForumAccess { get; set; } + + public int? ForumThreads { get; set; } + + public int? ForumPosts { get; set; } + + public DateTime? ForumLastPostTime { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserName { get; set; } + + [StringLength(200)] + public string? ForumBaseUrl { get; set; } + + public bool? ForumAllowChangeName { get; set; } + + [Column("ForumHTMLEditor")] + public bool? ForumHtmleditor { get; set; } + + [Column("ForumUseCAPTCHA")] + public bool? ForumUseCaptcha { get; set; } + + [Column("ForumGUID")] + public Guid? ForumGuid { get; set; } + + public DateTime? ForumLastModified { get; set; } + + [StringLength(200)] + public string? ForumUnsubscriptionUrl { get; set; } + + public bool? ForumIsLocked { get; set; } + + public string? ForumSettings { get; set; } + + public bool? ForumAuthorEdit { get; set; } + + public bool? ForumAuthorDelete { get; set; } + + public int? ForumType { get; set; } + + public int? ForumIsAnswerLimit { get; set; } + + public int? ForumImageMaxSideSize { get; set; } + + public DateTime? ForumLastPostTimeAbsolute { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserNameAbsolute { get; set; } + + public int? ForumPostsAbsolute { get; set; } + + public int? ForumThreadsAbsolute { get; set; } + + public int? ForumAttachmentMaxFileSize { get; set; } + + public int? ForumDiscussionActions { get; set; } + + [Column("ForumSiteID")] + public int? ForumSiteId { get; set; } + + [Column("GroupID")] + public int? GroupId { get; set; } + + [Column("GroupSiteID")] + public int? GroupSiteId { get; set; } + + [StringLength(200)] + public string? GroupName { get; set; } + + [StringLength(200)] + public string? GroupDisplayName { get; set; } + + public int? GroupOrder { get; set; } + + public string? GroupDescription { get; set; } + + [Column("GroupGUID")] + public Guid? GroupGuid { get; set; } + + public DateTime? GroupLastModified { get; set; } + + [StringLength(200)] + public string? GroupBaseUrl { get; set; } + + [StringLength(200)] + public string? GroupUnsubscriptionUrl { get; set; } + + [Column("GroupGroupID")] + public int? GroupGroupId { get; set; } + + public bool? GroupAuthorEdit { get; set; } + + public bool? GroupAuthorDelete { get; set; } + + public int? GroupType { get; set; } + + public int? GroupIsAnswerLimit { get; set; } + + public int? GroupImageMaxSideSize { get; set; } + + public bool? GroupDisplayEmails { get; set; } + + public bool? GroupRequireEmail { get; set; } + + [Column("GroupHTMLEditor")] + public bool? GroupHtmleditor { get; set; } + + [Column("GroupUseCAPTCHA")] + public bool? GroupUseCaptcha { get; set; } + + public int? GroupAttachmentMaxFileSize { get; set; } + + public int? GroupDiscussionActions { get; set; } + + public int PostId { get; set; } + + [Column("PostForumID")] + public int PostForumId { get; set; } + + [Column("PostParentID")] + public int? PostParentId { get; set; } + + [Column("PostIDPath")] + [StringLength(450)] + public string PostIdpath { get; set; } = null!; + + public int PostLevel { get; set; } + + [StringLength(450)] + public string PostSubject { get; set; } = null!; + + [Column("PostUserID")] + public int? PostUserId { get; set; } + + [StringLength(200)] + public string PostUserName { get; set; } = null!; + + [StringLength(254)] + public string? PostUserMail { get; set; } + + public string? PostText { get; set; } + + public DateTime PostTime { get; set; } + + [Column("PostApprovedByUserID")] + public int? PostApprovedByUserId { get; set; } + + public int? PostThreadPosts { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserName { get; set; } + + public DateTime? PostThreadLastPostTime { get; set; } + + public string? PostUserSignature { get; set; } + + [Column("PostGUID")] + public Guid PostGuid { get; set; } + + public DateTime PostLastModified { get; set; } + + public bool? PostApproved { get; set; } + + public bool? PostIsLocked { get; set; } + + public int? PostIsAnswer { get; set; } + + public int PostStickOrder { get; set; } + + public int? PostViews { get; set; } + + public DateTime? PostLastEdit { get; set; } + + public string? PostInfo { get; set; } + + public int? PostAttachmentCount { get; set; } + + public int? PostType { get; set; } + + public int? PostThreadPostsAbsolute { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserNameAbsolute { get; set; } + + public DateTime? PostThreadLastPostTimeAbsolute { get; set; } + + public bool? PostQuestionSolved { get; set; } + + public int? PostIsNotAnswer { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewIntegrationTaskJoined.cs b/Migration.Tool.K11/Models/ViewIntegrationTaskJoined.cs new file mode 100644 index 00000000..1c13aaa3 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewIntegrationTaskJoined.cs @@ -0,0 +1,64 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewIntegrationTaskJoined +{ + [Column("SynchronizationID")] + public int? SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int? SynchronizationTaskId { get; set; } + + [Column("SynchronizationConnectorID")] + public int? SynchronizationConnectorId { get; set; } + + public DateTime? SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + public bool? SynchronizationIsRunning { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + [StringLength(450)] + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool TaskIsInbound { get; set; } + + [StringLength(50)] + public string? TaskProcessType { get; set; } + + public string TaskData { get; set; } = null!; + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(50)] + public string? TaskDataType { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewMembershipMembershipUserJoined.cs b/Migration.Tool.K11/Models/ViewMembershipMembershipUserJoined.cs new file mode 100644 index 00000000..77c20759 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewMembershipMembershipUserJoined.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewMembershipMembershipUserJoined +{ + [StringLength(200)] + public string MembershipDisplayName { get; set; } = null!; + + [Column("MembershipID")] + public int MembershipId { get; set; } + + public DateTime? ValidTo { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [Column("MembershipSiteID")] + public int? MembershipSiteId { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewMessagingContactList.cs b/Migration.Tool.K11/Models/ViewMessagingContactList.cs similarity index 95% rename from Migration.Toolkit.K11/Models/ViewMessagingContactList.cs rename to Migration.Tool.K11/Models/ViewMessagingContactList.cs index ba13561e..99e8b2e5 100644 --- a/Migration.Toolkit.K11/Models/ViewMessagingContactList.cs +++ b/Migration.Tool.K11/Models/ViewMessagingContactList.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Keyless] public class ViewMessagingContactList diff --git a/Migration.Toolkit.K11/Models/ViewMessagingIgnoreList.cs b/Migration.Tool.K11/Models/ViewMessagingIgnoreList.cs similarity index 93% rename from Migration.Toolkit.K11/Models/ViewMessagingIgnoreList.cs rename to Migration.Tool.K11/Models/ViewMessagingIgnoreList.cs index ea63aa7b..6c5ab7c3 100644 --- a/Migration.Toolkit.K11/Models/ViewMessagingIgnoreList.cs +++ b/Migration.Tool.K11/Models/ViewMessagingIgnoreList.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Keyless] public class ViewMessagingIgnoreList diff --git a/Migration.Tool.K11/Models/ViewNewsletterSubscriptionsJoined.cs b/Migration.Tool.K11/Models/ViewNewsletterSubscriptionsJoined.cs new file mode 100644 index 00000000..9868a2af --- /dev/null +++ b/Migration.Tool.K11/Models/ViewNewsletterSubscriptionsJoined.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewNewsletterSubscriptionsJoined +{ + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [StringLength(440)] + public string? SubscriberFullName { get; set; } + + [StringLength(254)] + public string? SubscriberEmail { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + [StringLength(100)] + public string? SubscriberType { get; set; } + + public int? SubscriberBounces { get; set; } + + [StringLength(250)] + public string NewsletterDisplayName { get; set; } = null!; + + [Column("SubscriberRelatedID")] + public int SubscriberRelatedId { get; set; } + + [Column("SubscriberNewsletterID")] + public int SubscriberNewsletterId { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Tool.K11/Models/ViewOmAccountContactAccountJoined.cs new file mode 100644 index 00000000..69822663 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewOmAccountContactAccountJoined.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewOmAccountContactAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewOmAccountContactContactJoined.cs b/Migration.Tool.K11/Models/ViewOmAccountContactContactJoined.cs new file mode 100644 index 00000000..5c6940c9 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewOmAccountContactContactJoined.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewOmAccountContactContactJoined +{ + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewOmAccountJoined.cs b/Migration.Tool.K11/Models/ViewOmAccountJoined.cs new file mode 100644 index 00000000..16acb048 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewOmAccountJoined.cs @@ -0,0 +1,101 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewOmAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [StringLength(100)] + public string? PrimaryContactFirstName { get; set; } + + [StringLength(100)] + public string? PrimaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? PrimaryContactLastName { get; set; } + + [StringLength(100)] + public string? SecondaryContactFirstName { get; set; } + + [StringLength(100)] + public string? SecondaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? SecondaryContactLastName { get; set; } + + [StringLength(200)] + public string? SubsidiaryOfName { get; set; } + + [StringLength(302)] + public string PrimaryContactFullName { get; set; } = null!; + + [StringLength(302)] + public string SecondaryContactFullName { get; set; } = null!; + + [StringLength(201)] + public string AccountFullAddress { get; set; } = null!; +} diff --git a/Migration.Tool.K11/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Tool.K11/Models/ViewOmContactGroupMemberAccountJoined.cs new file mode 100644 index 00000000..c026a738 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewOmContactGroupMemberAccountJoined.cs @@ -0,0 +1,77 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewOmContactGroupMemberAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberContactJoined.cs b/Migration.Tool.K11/Models/ViewOmContactGroupMemberContactJoined.cs similarity index 98% rename from Migration.Toolkit.K11/Models/ViewOmContactGroupMemberContactJoined.cs rename to Migration.Tool.K11/Models/ViewOmContactGroupMemberContactJoined.cs index 9d0f959f..ca98f424 100644 --- a/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberContactJoined.cs +++ b/Migration.Tool.K11/Models/ViewOmContactGroupMemberContactJoined.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.K11.Models; +namespace Migration.Tool.K11.Models; [Keyless] public class ViewOmContactGroupMemberContactJoined diff --git a/Migration.Tool.K11/Models/ViewPollAnswerCount.cs b/Migration.Tool.K11/Models/ViewPollAnswerCount.cs new file mode 100644 index 00000000..b43d0f94 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewPollAnswerCount.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewPollAnswerCount +{ + [Column("PollID")] + public int PollId { get; set; } + + [StringLength(200)] + public string PollCodeName { get; set; } = null!; + + [StringLength(200)] + public string PollDisplayName { get; set; } = null!; + + [StringLength(100)] + public string? PollTitle { get; set; } + + public DateTime? PollOpenFrom { get; set; } + + public DateTime? PollOpenTo { get; set; } + + public bool PollAllowMultipleAnswers { get; set; } + + [StringLength(450)] + public string PollQuestion { get; set; } = null!; + + public int PollAccess { get; set; } + + [StringLength(450)] + public string? PollResponseMessage { get; set; } + + [Column("PollGUID")] + public Guid PollGuid { get; set; } + + public DateTime PollLastModified { get; set; } + + [Column("PollGroupID")] + public int? PollGroupId { get; set; } + + [Column("PollSiteID")] + public int? PollSiteId { get; set; } + + public bool? PollLogActivity { get; set; } + + public int? AnswerCount { get; set; } +} diff --git a/Migration.Tool.K11/Models/ViewReportingCategoryReportJoined.cs b/Migration.Tool.K11/Models/ViewReportingCategoryReportJoined.cs new file mode 100644 index 00000000..63537444 --- /dev/null +++ b/Migration.Tool.K11/Models/ViewReportingCategoryReportJoined.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.K11.Models; + +[Keyless] +public class ViewReportingCategoryReportJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(200)] + public string CodeName { get; set; } = null!; + + [StringLength(440)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(651)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryReportChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + public string? ReportLayout { get; set; } + + public string? ReportParameters { get; set; } + + public int? ReportAccess { get; set; } + + [StringLength(14)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; +} diff --git a/Migration.Tool.K11/SettingsKeys.cs b/Migration.Tool.K11/SettingsKeys.cs new file mode 100644 index 00000000..39749d05 --- /dev/null +++ b/Migration.Tool.K11/SettingsKeys.cs @@ -0,0 +1,750 @@ +// ReSharper disable InconsistentNaming +// ReSharper disable IdentifierTypo + +namespace Migration.Tool.K11; + +public static class SettingsKeys +{ + public const string CMSABTestingEnabled = "CMSABTestingEnabled"; + public const string CMSAccessDeniedPageURL = "CMSAccessDeniedPageURL"; + public const string CMSActivityPointsForBlogCommentPost = "CMSActivityPointsForBlogCommentPost"; + public const string CMSActivityPointsForBlogPost = "CMSActivityPointsForBlogPost"; + public const string CMSActivityPointsForForumPost = "CMSActivityPointsForForumPost"; + public const string CMSActivityPointsForMessageBoardPost = "CMSActivityPointsForMessageBoardPost"; + public const string CMSActivityTrackedExtensions = "CMSActivityTrackedExtensions"; + public const string CMSAdminEmailAddress = "CMSAdminEmailAddress"; + public const string CMSAllowAttachmentTranslation = "CMSAllowAttachmentTranslation"; + public const string CMSAllowComponentsCSS = "CMSAllowComponentsCSS"; + public const string CMSAllowDynamicNewsletters = "CMSAllowDynamicNewsletters"; + public const string CMSAllowedURLCharacters = "CMSAllowedURLCharacters"; + public const string CMSAllowGlobalCategories = "CMSAllowGlobalCategories"; + public const string CMSAllowGZip = "CMSAllowGZip"; + public const string CMSAllowOnSiteEditing = "CMSAllowOnSiteEditing"; + public const string CMSAllowPermanentPreviewLink = "CMSAllowPermanentPreviewLink"; + public const string CMSAllowPreviewMode = "CMSAllowPreviewMode"; + public const string CMSAllowUrlsWithoutLanguagePrefixes = "CMSAllowUrlsWithoutLanguagePrefixes"; + public const string CMSAlternativeURLsConstraint = "CMSAlternativeURLsConstraint"; + public const string CMSAlternativeURLsErrorMessage = "CMSAlternativeURLsErrorMessage"; + public const string CMSAlternativeURLsExcludedURLs = "CMSAlternativeURLsExcludedURLs"; + public const string CMSAlternativeURLsMode = "CMSAlternativeURLsMode"; + public const string CMSAlternativeUrlUIEnabled = "CMSAlternativeUrlUIEnabled"; + public const string CMSAnalyticsEnabled = "CMSAnalyticsEnabled"; + public const string CMSAnalyticsExcludedFileExtensions = "CMSAnalyticsExcludedFileExtensions"; + public const string CMSAnalyticsExcludedIPs = "CMSAnalyticsExcludedIPs"; + public const string CMSAnalyticsExcludedURLs = "CMSAnalyticsExcludedURLs"; + public const string CMSAnalyticsExcludeSearchEngines = "CMSAnalyticsExcludeSearchEngines"; + public const string CMSAnalyticsTrackAggregatedViews = "CMSAnalyticsTrackAggregatedViews"; + public const string CMSAnalyticsTrackBrowserTypes = "CMSAnalyticsTrackBrowserTypes"; + public const string CMSAnalyticsTrackCountries = "CMSAnalyticsTrackCountries"; + public const string CMSAnalyticsTrackFileDownloads = "CMSAnalyticsTrackFileDownloads"; + public const string CMSAnalyticsTrackInvalidPages = "CMSAnalyticsTrackInvalidPages"; + public const string CMSAnalyticsTrackPageViews = "CMSAnalyticsTrackPageViews"; + public const string CMSAnalyticsTrackReferrals = "CMSAnalyticsTrackReferrals"; + public const string CMSAnalyticsTrackRegisteredUsers = "CMSAnalyticsTrackRegisteredUsers"; + public const string CMSAnalyticsTrackVisits = "CMSAnalyticsTrackVisits"; + public const string CMSAnalyticsVisitorsSmartCheck = "CMSAnalyticsVisitorsSmartCheck"; + public const string CMSApplicationHealthMonitoringInterval = "CMSApplicationHealthMonitoringInterval"; + public const string CMSApplicationID = "CMSApplicationID"; + public const string CMSApplicationSecret = "CMSApplicationSecret"; + public const string CMSApplicationState = "CMSApplicationState"; + public const string CMSArchiveEmails = "CMSArchiveEmails"; + public const string CMSAuthorizeNETAPILogin = "CMSAuthorizeNETAPILogin"; + public const string CMSAuthorizeNETTransactionKey = "CMSAuthorizeNETTransactionKey"; + public const string CMSAuthorizeNETTransactionType = "CMSAuthorizeNETTransactionType"; + public const string CMSAutocompleteEnableForLogin = "CMSAutocompleteEnableForLogin"; + public const string CMSAutomaticallySignInUser = "CMSAutomaticallySignInUser"; + public const string CMSAutoResizeImageHeight = "CMSAutoResizeImageHeight"; + public const string CMSAutoResizeImageMaxSideSize = "CMSAutoResizeImageMaxSideSize"; + public const string CMSAutoResizeImageWidth = "CMSAutoResizeImageWidth"; + public const string CMSAvatarHeight = "CMSAvatarHeight"; + public const string CMSAvatarMaxSideSize = "CMSAvatarMaxSideSize"; + public const string CMSAvatarType = "CMSAvatarType"; + public const string CMSAvatarWidth = "CMSAvatarWidth"; + public const string CMSBadWordsAction = "CMSBadWordsAction"; + public const string CMSBadWordsReplacement = "CMSBadWordsReplacement"; + public const string CMSBannedIPEnabled = "CMSBannedIPEnabled"; + public const string CMSBannedIPRedirectURL = "CMSBannedIPRedirectURL"; + public const string CMSBitlyAPIKey = "CMSBitlyAPIKey"; + public const string CMSBitlyLogin = "CMSBitlyLogin"; + public const string CMSBizFormFilesFolder = "CMSBizFormFilesFolder"; + public const string CMSBlockSubscribersGlobally = "CMSBlockSubscribersGlobally"; + public const string CMSBlogEnableOptIn = "CMSBlogEnableOptIn"; + public const string CMSBlogEnableOptInConfirmation = "CMSBlogEnableOptInConfirmation"; + public const string CMSBlogOptInApprovalPath = "CMSBlogOptInApprovalPath"; + public const string CMSBlogOptInInterval = "CMSBlogOptInInterval"; + public const string CMSBlogsUnsubscriptionUrl = "CMSBlogsUnsubscriptionUrl"; + public const string CMSBoardBaseUrl = "CMSBoardBaseUrl"; + public const string CMSBoardEnableOptIn = "CMSBoardEnableOptIn"; + public const string CMSBoardEnableOptInConfirmation = "CMSBoardEnableOptInConfirmation"; + public const string CMSBoardOptInApprovalPath = "CMSBoardOptInApprovalPath"; + public const string CMSBoardOptInInterval = "CMSBoardOptInInterval"; + public const string CMSBoardUnsubsriptionURL = "CMSBoardUnsubsriptionURL"; + public const string CMSBouncedEmailAddress = "CMSBouncedEmailAddress"; + public const string CMSBouncedEmailsLimit = "CMSBouncedEmailsLimit"; + public const string CMSCacheImages = "CMSCacheImages"; + public const string CMSCacheMinutes = "CMSCacheMinutes"; + public const string CMSCachePageInfo = "CMSCachePageInfo"; + public const string CMSCampaignNewPageLocation = "CMSCampaignNewPageLocation"; + public const string CMSCaptchaControl = "CMSCaptchaControl"; + public const string CMSChatAllowAnonymGlobally = "CMSChatAllowAnonymGlobally"; + public const string CMSChatDaysNeededToDeleteRecods = "CMSChatDaysNeededToDeleteRecods"; + public const string CMSChatDisplayAnnouncementAtFirstLoad = "CMSChatDisplayAnnouncementAtFirstLoad"; + public const string CMSChatDisplayChangeNicknameAtFirstLoad = "CMSChatDisplayChangeNicknameAtFirstLoad"; + public const string CMSChatDisplayEnterAtFirstLoad = "CMSChatDisplayEnterAtFirstLoad"; + public const string CMSChatDisplayInvitedAtFirstLoad = "CMSChatDisplayInvitedAtFirstLoad"; + public const string CMSChatDisplayKickAtFirstLoad = "CMSChatDisplayKickAtFirstLoad"; + public const string CMSChatDisplayLeaveAtFirstLoad = "CMSChatDisplayLeaveAtFirstLoad"; + public const string CMSChatDisplaySupportGreetingAtFirstLoad = "CMSChatDisplaySupportGreetingAtFirstLoad"; + public const string CMSChatEnableBBCode = "CMSChatEnableBBCode"; + public const string CMSChatEnableFloodProtection = "CMSChatEnableFloodProtection"; + public const string CMSChatEnableSmileys = "CMSChatEnableSmileys"; + public const string CMSChatEnableSoundLiveChat = "CMSChatEnableSoundLiveChat"; + public const string CMSChatEnableSoundSupportChat = "CMSChatEnableSoundSupportChat"; + public const string CMSChatErrorDeleteAllTrans = "CMSChatErrorDeleteAllTrans"; + public const string CMSChatErrorTrans = "CMSChatErrorTrans"; + public const string CMSChatFirstLoadMessagesCount = "CMSChatFirstLoadMessagesCount"; + public const string CMSChatFloodProtectionChangeNickname = "CMSChatFloodProtectionChangeNickname"; + public const string CMSChatFloodProtectionCreateRoom = "CMSChatFloodProtectionCreateRoom"; + public const string CMSChatFloodProtectionJoinRoom = "CMSChatFloodProtectionJoinRoom"; + public const string CMSChatFloodProtectionPostMessage = "CMSChatFloodProtectionPostMessage"; + public const string CMSChatForceAnonymUniqueNicknames = "CMSChatForceAnonymUniqueNicknames"; + public const string CMSChatGlobalPingInterval = "CMSChatGlobalPingInterval"; + public const string CMSChatGuestPrefix = "CMSChatGuestPrefix"; + public const string CMSChatInitiatedChatTrans = "CMSChatInitiatedChatTrans"; + public const string CMSChatKickLastingTime = "CMSChatKickLastingTime"; + public const string CMSChatMaximumMessageLength = "CMSChatMaximumMessageLength"; + public const string CMSChatNotificationTrans = "CMSChatNotificationTrans"; + public const string CMSChatOnlineUserTrans = "CMSChatOnlineUserTrans"; + public const string CMSChatRedirectURLJoin = "CMSChatRedirectURLJoin"; + public const string CMSChatRedirectURLLeave = "CMSChatRedirectURLLeave"; + public const string CMSChatRedirectURLLogin = "CMSChatRedirectURLLogin"; + public const string CMSChatRedirectURLLogout = "CMSChatRedirectURLLogout"; + public const string CMSChatResolveURLEnabled = "CMSChatResolveURLEnabled"; + public const string CMSChatRoomMessageTrans = "CMSChatRoomMessageTrans"; + public const string CMSChatRoomNameTrans = "CMSChatRoomNameTrans"; + public const string CMSChatRoomPingInterval = "CMSChatRoomPingInterval"; + public const string CMSChatRoomPopupWindow = "CMSChatRoomPopupWindow"; + public const string CMSChatRoomTrans = "CMSChatRoomTrans"; + public const string CMSChatRoomUserTrans = "CMSChatRoomUserTrans"; + public const string CMSChatSendSupportMessagesTo = "CMSChatSendSupportMessagesTo"; + public const string CMSChatSupportEnabled = "CMSChatSupportEnabled"; + public const string CMSChatSupportEngineerLogoutTimeout = "CMSChatSupportEngineerLogoutTimeout"; + public const string CMSChatSupportRequestTrans = "CMSChatSupportRequestTrans"; + public const string CMSChatSupportTakenRoomReleaseTimeout = "CMSChatSupportTakenRoomReleaseTimeout"; + public const string CMSChatUserLogoutTimeout = "CMSChatUserLogoutTimeout"; + public const string CMSChatWPDefaultGroupPagesBy = "CMSChatWPDefaultGroupPagesBy"; + public const string CMSChatWPDefaultInviteModePagingItems = "CMSChatWPDefaultInviteModePagingItems"; + public const string CMSChatWPDefaultInviteModeSearchMode = "CMSChatWPDefaultInviteModeSearchMode"; + public const string CMSChatWPDefaultPagingItems = "CMSChatWPDefaultPagingItems"; + public const string CMSChatWPDefaultSearchOnlineMaxUsers = "CMSChatWPDefaultSearchOnlineMaxUsers"; + public const string CMSChatWPDefaultShowFilterLimit = "CMSChatWPDefaultShowFilterLimit"; + public const string CMSCheapestVariantAdvertising = "CMSCheapestVariantAdvertising"; + public const string CMSCheckBadWords = "CMSCheckBadWords"; + public const string CMSCheckDocumentPermissions = "CMSCheckDocumentPermissions"; + public const string CMSCheckFilesPermissions = "CMSCheckFilesPermissions"; + public const string CMSCheckMediaFilePermissions = "CMSCheckMediaFilePermissions"; + public const string CMSCheckPagePermissions = "CMSCheckPagePermissions"; + public const string CMSCheckPublishedFiles = "CMSCheckPublishedFiles"; + public const string CMSClientCacheMinutes = "CMSClientCacheMinutes"; + public const string CMSCMActivitiesEnabled = "CMSCMActivitiesEnabled"; + public const string CMSCMAddingProductToSC = "CMSCMAddingProductToSC"; + public const string CMSCMAddingProductToWL = "CMSCMAddingProductToWL"; + public const string CMSCMBizFormSubmission = "CMSCMBizFormSubmission"; + public const string CMSCMBlogPostComments = "CMSCMBlogPostComments"; + public const string CMSCMBlogPostSubscription = "CMSCMBlogPostSubscription"; + public const string CMSCMClickthroughTracking = "CMSCMClickthroughTracking"; + public const string CMSCMContentRating = "CMSCMContentRating"; + public const string CMSCMCustomActivities = "CMSCMCustomActivities"; + public const string CMSCMCustomTableForm = "CMSCMCustomTableForm"; + public const string CMSCMEmailOpening = "CMSCMEmailOpening"; + public const string CMSCMEnableGeolocation = "CMSCMEnableGeolocation"; + public const string CMSCMEventBooking = "CMSCMEventBooking"; + public const string CMSCMExternalSearch = "CMSCMExternalSearch"; + public const string CMSCMForumPosts = "CMSCMForumPosts"; + public const string CMSCMForumPostSubscription = "CMSCMForumPostSubscription"; + public const string CMSCMGeoCity = "CMSCMGeoCity"; + public const string CMSCMGeoCountry = "CMSCMGeoCountry"; + public const string CMSCMGeoLatitude = "CMSCMGeoLatitude"; + public const string CMSCMGeoLongitude = "CMSCMGeoLongitude"; + public const string CMSCMGeoMetro = "CMSCMGeoMetro"; + public const string CMSCMGeoNewDB = "CMSCMGeoNewDB"; + public const string CMSCMGeoOrganization = "CMSCMGeoOrganization"; + public const string CMSCMGeoPostal = "CMSCMGeoPostal"; + public const string CMSCMGeoState = "CMSCMGeoState"; + public const string CMSCMGeoSuffix = "CMSCMGeoSuffix"; + public const string CMSCMLandingPage = "CMSCMLandingPage"; + public const string CMSCMMessageBoardPosts = "CMSCMMessageBoardPosts"; + public const string CMSCMMessageBoardSubscription = "CMSCMMessageBoardSubscription"; + public const string CMSCMNewsletterSubscribe = "CMSCMNewsletterSubscribe"; + public const string CMSCMNewsletterUnsubscribe = "CMSCMNewsletterUnsubscribe"; + public const string CMSCMNewsletterUnsubscribedFromAll = "CMSCMNewsletterUnsubscribedFromAll"; + public const string CMSCMPageVisits = "CMSCMPageVisits"; + public const string CMSCMPollVoting = "CMSCMPollVoting"; + public const string CMSCMPurchase = "CMSCMPurchase"; + public const string CMSCMPurchasedProduct = "CMSCMPurchasedProduct"; + public const string CMSCMRemovingProductFromSC = "CMSCMRemovingProductFromSC"; + public const string CMSCMSearch = "CMSCMSearch"; + public const string CMSCMStamp = "CMSCMStamp"; + public const string CMSCMUserLogin = "CMSCMUserLogin"; + public const string CMSCMUserRegistration = "CMSCMUserRegistration"; + public const string CMSCodeNamePrefix = "CMSCodeNamePrefix"; + public const string CMSCombineComponentsCSS = "CMSCombineComponentsCSS"; + public const string CMSCombineImagesWithDefaultCulture = "CMSCombineImagesWithDefaultCulture"; + public const string CMSCombineWithDefaultCulture = "CMSCombineWithDefaultCulture"; + public const string CMSConfirmChanges = "CMSConfirmChanges"; + public const string CMSContentImageWatermark = "CMSContentImageWatermark"; + public const string CMSContentPersonalizationEnabled = "CMSContentPersonalizationEnabled"; + public const string CMSControlElement = "CMSControlElement"; + public const string CMSConvertTablesToDivs = "CMSConvertTablesToDivs"; + public const string CMSDataVersion = "CMSDataVersion"; + public const string CMSDBSeparationStartedByServer = "CMSDBSeparationStartedByServer"; + public const string CMSDBVersion = "CMSDBVersion"; + public const string CMSDebugAllCache = "CMSDebugAllCache"; + public const string CMSDebugAllFiles = "CMSDebugAllFiles"; + public const string CMSDebugAllForEverything = "CMSDebugAllForEverything"; + public const string CMSDebugAllHandlers = "CMSDebugAllHandlers"; + public const string CMSDebugAllMacros = "CMSDebugAllMacros"; + public const string CMSDebugAllOutput = "CMSDebugAllOutput"; + public const string CMSDebugAllRequests = "CMSDebugAllRequests"; + public const string CMSDebugAllSecurity = "CMSDebugAllSecurity"; + public const string CMSDebugAllSQLQueries = "CMSDebugAllSQLQueries"; + public const string CMSDebugAllViewState = "CMSDebugAllViewState"; + public const string CMSDebugAllWebFarm = "CMSDebugAllWebFarm"; + public const string CMSDebugAnalytics = "CMSDebugAnalytics"; + public const string CMSDebugAnalyticsLive = "CMSDebugAnalyticsLive"; + public const string CMSDebugAnalyticsLogLength = "CMSDebugAnalyticsLogLength"; + public const string CMSDebugAnalyticsStack = "CMSDebugAnalyticsStack"; + public const string CMSDebugCache = "CMSDebugCache"; + public const string CMSDebugCacheLive = "CMSDebugCacheLive"; + public const string CMSDebugCacheLogLength = "CMSDebugCacheLogLength"; + public const string CMSDebugCacheStack = "CMSDebugCacheStack"; + public const string CMSDebugEverything = "CMSDebugEverything"; + public const string CMSDebugEverythingEverywhere = "CMSDebugEverythingEverywhere"; + public const string CMSDebugEverythingLive = "CMSDebugEverythingLive"; + public const string CMSDebugEverythingLogLength = "CMSDebugEverythingLogLength"; + public const string CMSDebugFiles = "CMSDebugFiles"; + public const string CMSDebugFilesLive = "CMSDebugFilesLive"; + public const string CMSDebugFilesLogLength = "CMSDebugFilesLogLength"; + public const string CMSDebugFilesStack = "CMSDebugFilesStack"; + public const string CMSDebugHandlers = "CMSDebugHandlers"; + public const string CMSDebugHandlersLive = "CMSDebugHandlersLive"; + public const string CMSDebugHandlersLogLength = "CMSDebugHandlersLogLength"; + public const string CMSDebugHandlersStack = "CMSDebugHandlersStack"; + public const string CMSDebugImportExport = "CMSDebugImportExport"; + public const string CMSDebugMacros = "CMSDebugMacros"; + public const string CMSDebugMacrosDetailed = "CMSDebugMacrosDetailed"; + public const string CMSDebugMacrosLive = "CMSDebugMacrosLive"; + public const string CMSDebugMacrosLogLength = "CMSDebugMacrosLogLength"; + public const string CMSDebugMacrosStack = "CMSDebugMacrosStack"; + public const string CMSDebugOutput = "CMSDebugOutput"; + public const string CMSDebugOutputLive = "CMSDebugOutputLive"; + public const string CMSDebugOutputLogLength = "CMSDebugOutputLogLength"; + public const string CMSDebugRequests = "CMSDebugRequests"; + public const string CMSDebugRequestsLive = "CMSDebugRequestsLive"; + public const string CMSDebugRequestsLogLength = "CMSDebugRequestsLogLength"; + public const string CMSDebugRequestsStack = "CMSDebugRequestsStack"; + public const string CMSDebugResources = "CMSDebugResources"; + public const string CMSDebugScheduler = "CMSDebugScheduler"; + public const string CMSDebugSecurity = "CMSDebugSecurity"; + public const string CMSDebugSecurityLive = "CMSDebugSecurityLive"; + public const string CMSDebugSecurityLogLength = "CMSDebugSecurityLogLength"; + public const string CMSDebugSecurityStack = "CMSDebugSecurityStack"; + public const string CMSDebugSQLConnections = "CMSDebugSQLConnections"; + public const string CMSDebugSQLQueries = "CMSDebugSQLQueries"; + public const string CMSDebugSQLQueriesLive = "CMSDebugSQLQueriesLive"; + public const string CMSDebugSQLQueriesLogLength = "CMSDebugSQLQueriesLogLength"; + public const string CMSDebugSQLQueriesStack = "CMSDebugSQLQueriesStack"; + public const string CMSDebugStackForEverything = "CMSDebugStackForEverything"; + public const string CMSDebugViewState = "CMSDebugViewState"; + public const string CMSDebugViewStateLive = "CMSDebugViewStateLive"; + public const string CMSDebugViewStateLogLength = "CMSDebugViewStateLogLength"; + public const string CMSDebugWebFarm = "CMSDebugWebFarm"; + public const string CMSDebugWebFarmLive = "CMSDebugWebFarmLive"; + public const string CMSDebugWebFarmLogLength = "CMSDebugWebFarmLogLength"; + public const string CMSDebugWebFarmStack = "CMSDebugWebFarmStack"; + public const string CMSDefaulPage = "CMSDefaulPage"; + public const string CMSDefaultAliasPath = "CMSDefaultAliasPath"; + public const string CMSDefaultControlForBoolean = "CMSDefaultControlForBoolean"; + public const string CMSDefaultControlForDateTime = "CMSDefaultControlForDateTime"; + public const string CMSDefaultControlForDecimal = "CMSDefaultControlForDecimal"; + public const string CMSDefaultControlForDocAttachments = "CMSDefaultControlForDocAttachments"; + public const string CMSDefaultControlForDocRelationships = "CMSDefaultControlForDocRelationships"; + public const string CMSDefaultControlForFile = "CMSDefaultControlForFile"; + public const string CMSDefaultControlForGUID = "CMSDefaultControlForGUID"; + public const string CMSDefaultControlForInteger = "CMSDefaultControlForInteger"; + public const string CMSDefaultControlForLongText = "CMSDefaultControlForLongText"; + public const string CMSDefaultControlForText = "CMSDefaultControlForText"; + public const string CMSDefaultCookieLevel = "CMSDefaultCookieLevel"; + public const string CMSDefaultCultureCode = "CMSDefaultCultureCode"; + public const string CMSDefaultDeletedNodePath = "CMSDefaultDeletedNodePath"; + public const string CMSDefaultProductImageUrl = "CMSDefaultProductImageUrl"; + public const string CMSDefaultReportConnectionString = "CMSDefaultReportConnectionString"; + public const string CMSDefaultUrlPathPrefix = "CMSDefaultUrlPathPrefix"; + public const string CMSDefaultUserID = "CMSDefaultUserID"; + public const string CMSDeleteInactiveContactsLastXDays = "CMSDeleteInactiveContactsLastXDays"; + public const string CMSDeleteInactiveContactsMethod = "CMSDeleteInactiveContactsMethod"; + public const string CMSDeleteNonActivatedUserAfter = "CMSDeleteNonActivatedUserAfter"; + public const string CMSDenyLoginInterval = "CMSDenyLoginInterval"; + public const string CMSDepartmentTemplatePath = "CMSDepartmentTemplatePath"; + public const string CMSDeploymentMode = "CMSDeploymentMode"; + public const string CMSDeviceProfilesEnable = "CMSDeviceProfilesEnable"; + public const string CMSDisableDebug = "CMSDisableDebug"; + public const string CMSDisplayAccountLockInformation = "CMSDisplayAccountLockInformation"; + public const string CMSDisplayArchivedIcon = "CMSDisplayArchivedIcon"; + public const string CMSDisplayCheckedOutIcon = "CMSDisplayCheckedOutIcon"; + public const string CMSDisplayLinkedIcon = "CMSDisplayLinkedIcon"; + public const string CMSDisplayNotPublishedIcon = "CMSDisplayNotPublishedIcon"; + public const string CMSDisplayNotTranslatedIcon = "CMSDisplayNotTranslatedIcon"; + public const string CMSDisplayPublishedIcon = "CMSDisplayPublishedIcon"; + public const string CMSDisplayRedirectedIcon = "CMSDisplayRedirectedIcon"; + public const string CMSDisplayVersionNotPublishedIcon = "CMSDisplayVersionNotPublishedIcon"; + public const string CMSEmailBatchSize = "CMSEmailBatchSize"; + public const string CMSEmailEncoding = "CMSEmailEncoding"; + public const string CMSEmailFormat = "CMSEmailFormat"; + public const string CMSEmailQueueEnabled = "CMSEmailQueueEnabled"; + public const string CMSEmailsEnabled = "CMSEmailsEnabled"; + public const string CMSEmailTranslationFrom = "CMSEmailTranslationFrom"; + public const string CMSEmailTranslationRecipients = "CMSEmailTranslationRecipients"; + public const string CMSEnableCI = "CMSEnableCI"; + public const string CMSEnableCodeEditSiteAdministrators = "CMSEnableCodeEditSiteAdministrators"; + public const string CMSEnableDefaultAvatars = "CMSEnableDefaultAvatars"; + public const string CMSEnableFacebookConnect = "CMSEnableFacebookConnect"; + public const string CMSEnableHealthMonitoring = "CMSEnableHealthMonitoring"; + public const string CMSEnableLinkedIn = "CMSEnableLinkedIn"; + public const string CMSEnableObjectsVersioning = "CMSEnableObjectsVersioning"; + public const string CMSEnableOnlineMarketing = "CMSEnableOnlineMarketing"; + public const string CMSEnableOpenID = "CMSEnableOpenID"; + public const string CMSEnableOutputCache = "CMSEnableOutputCache"; + public const string CMSEnablePartialCache = "CMSEnablePartialCache"; + public const string CMSEnableSiteCounters = "CMSEnableSiteCounters"; + public const string CMSEnableTranlsationRESTService = "CMSEnableTranlsationRESTService"; + public const string CMSEnableTranslations = "CMSEnableTranslations"; + public const string CMSEnableUserCounts = "CMSEnableUserCounts"; + public const string CMSEnableVersioningCMSAlternativeForm = "CMSEnableVersioningCMSAlternativeForm"; + public const string CMSEnableVersioningCMSCssStylesheet = "CMSEnableVersioningCMSCssStylesheet"; + public const string CMSEnableVersioningCMSCustomTable = "CMSEnableVersioningCMSCustomTable"; + public const string CMSEnableVersioningCMSDocumentType = "CMSEnableVersioningCMSDocumentType"; + public const string CMSEnableVersioningCMSEmailTemplate = "CMSEnableVersioningCMSEmailTemplate"; + public const string CMSEnableVersioningCMSForm = "CMSEnableVersioningCMSForm"; + public const string CMSEnableVersioningCMSLayout = "CMSEnableVersioningCMSLayout"; + public const string CMSEnableVersioningCMSPageTemplate = "CMSEnableVersioningCMSPageTemplate"; + public const string CMSEnableVersioningCMSQuery = "CMSEnableVersioningCMSQuery"; + public const string CMSEnableVersioningCMSTemplateDeviceLayout = "CMSEnableVersioningCMSTemplateDeviceLayout"; + public const string CMSEnableVersioningCMSTransformation = "CMSEnableVersioningCMSTransformation"; + public const string CMSEnableVersioningCMSUIElement = "CMSEnableVersioningCMSUIElement"; + public const string CMSEnableVersioningCMSWebPartContainer = "CMSEnableVersioningCMSWebPartContainer"; + public const string CMSEnableVersioningCMSWebPartLayout = "CMSEnableVersioningCMSWebPartLayout"; + public const string CMSEnableVersioningCMSWorkflow = "CMSEnableVersioningCMSWorkflow"; + public const string CMSEnableVersioningMAAutomationProcess = "CMSEnableVersioningMAAutomationProcess"; + public const string CMSEnableVersioningMediaFile = "CMSEnableVersioningMediaFile"; + public const string CMSEnableVersioningNewsletterEmailTemplate = "CMSEnableVersioningNewsletterEmailTemplate"; + public const string CMSEnableVersioningNewsletterEmailWidget = "CMSEnableVersioningNewsletterEmailWidget"; + public const string CMSEnableVersioningNewsletterIssue = "CMSEnableVersioningNewsletterIssue"; + public const string CMSEnableVersioningReportingReport = "CMSEnableVersioningReportingReport"; + public const string CMSEnableVersioningReportingReportGraph = "CMSEnableVersioningReportingReportGraph"; + public const string CMSEnableVersioningReportingReportTable = "CMSEnableVersioningReportingReportTable"; + public const string CMSEnableVersioningReportingReportValue = "CMSEnableVersioningReportingReportValue"; + public const string CMSEnableWebDAV = "CMSEnableWebDAV"; + public const string CMSEnableWindowsLiveID = "CMSEnableWindowsLiveID"; + public const string CMSEventManagerInvitationFrom = "CMSEventManagerInvitationFrom"; + public const string CMSEventManagerInvitationSubject = "CMSEventManagerInvitationSubject"; + public const string CMSEventManagerSenderName = "CMSEventManagerSenderName"; + public const string CMSExcludedAttributesFilterURLs = "CMSExcludedAttributesFilterURLs"; + public const string CMSExcludedFormFilterURLs = "CMSExcludedFormFilterURLs"; + public const string CMSExcludedHTML5FilterURLs = "CMSExcludedHTML5FilterURLs"; + public const string CMSExcludedJavascriptFilterURLs = "CMSExcludedJavascriptFilterURLs"; + public const string CMSExcludedLowercaseFilterURLs = "CMSExcludedLowercaseFilterURLs"; + public const string CMSExcludeDocumentsFromSearch = "CMSExcludeDocumentsFromSearch"; + public const string CMSExcludeDocumentTypesFromSearch = "CMSExcludeDocumentTypesFromSearch"; + public const string CMSExcludedResolveFilterURLs = "CMSExcludedResolveFilterURLs"; + public const string CMSExcludedSelfcloseFilterURLs = "CMSExcludedSelfcloseFilterURLs"; + public const string CMSExcludedURLs = "CMSExcludedURLs"; + public const string CMSExcludedXHTMLFilterURLs = "CMSExcludedXHTMLFilterURLs"; + public const string CMSExportLogObjectChanges = "CMSExportLogObjectChanges"; + public const string CMSFacebookApplicationSecret = "CMSFacebookApplicationSecret"; + public const string CMSFacebookConnectApiKey = "CMSFacebookConnectApiKey"; + public const string CMSFacebookMapUserProfile = "CMSFacebookMapUserProfile"; + public const string CMSFacebookRoles = "CMSFacebookRoles"; + public const string CMSFacebookUserMapping = "CMSFacebookUserMapping"; + public const string CMSFaviconPath = "CMSFaviconPath"; + public const string CMSFilesFolder = "CMSFilesFolder"; + public const string CMSFilesFriendlyURLExtension = "CMSFilesFriendlyURLExtension"; + public const string CMSFilesLocationType = "CMSFilesLocationType"; + public const string CMSFileSystemOutputCacheMinutes = "CMSFileSystemOutputCacheMinutes"; + public const string CMSFloodInterval = "CMSFloodInterval"; + public const string CMSFloodProtectionEnabled = "CMSFloodProtectionEnabled"; + public const string CMSForbiddenCharactersReplacement = "CMSForbiddenCharactersReplacement"; + public const string CMSForbiddenURLCharacters = "CMSForbiddenURLCharacters"; + public const string CMSForumAttachmentExtensions = "CMSForumAttachmentExtensions"; + public const string CMSForumBaseUrl = "CMSForumBaseUrl"; + public const string CMSForumEnableOptIn = "CMSForumEnableOptIn"; + public const string CMSForumEnableOptInConfirmation = "CMSForumEnableOptInConfirmation"; + public const string CMSForumMaxPostNode = "CMSForumMaxPostNode"; + public const string CMSForumOptInApprovalPath = "CMSForumOptInApprovalPath"; + public const string CMSForumOptInInterval = "CMSForumOptInInterval"; + public const string CMSForumUnsubscriptionUrl = "CMSForumUnsubscriptionUrl"; + public const string CMSFriendlyURLExtension = "CMSFriendlyURLExtension"; + public const string CMSGenerateNewsletters = "CMSGenerateNewsletters"; + public const string CMSGenerateThumbnails = "CMSGenerateThumbnails"; + public const string CMSGoogleSitemapURL = "CMSGoogleSitemapURL"; + public const string CMSGoogleTranslateAPIKey = "CMSGoogleTranslateAPIKey"; + public const string CMSGravatarDefaultImage = "CMSGravatarDefaultImage"; + public const string CMSGravatarRating = "CMSGravatarRating"; + public const string CMSGroupAvatarHeight = "CMSGroupAvatarHeight"; + public const string CMSGroupAvatarMaxSideSize = "CMSGroupAvatarMaxSideSize"; + public const string CMSGroupAvatarWidth = "CMSGroupAvatarWidth"; + public const string CMSGroupManagementPath = "CMSGroupManagementPath"; + public const string CMSGroupProfilePath = "CMSGroupProfilePath"; + public const string CMSGroupsSecurityAccessPath = "CMSGroupsSecurityAccessPath"; + public const string CMSGroupTemplatePath = "CMSGroupTemplatePath"; + public const string CMSHideUnavailableUserInterface = "CMSHideUnavailableUserInterface"; + public const string CMSHotfixDataVersion = "CMSHotfixDataVersion"; + public const string CMSHotfixProcedureInProgress = "CMSHotfixProcedureInProgress"; + public const string CMSHotfixVersion = "CMSHotfixVersion"; + public const string CMSImageWatermark = "CMSImageWatermark"; + public const string CMSImageWatermarkPosition = "CMSImageWatermarkPosition"; + public const string CMSIncludeTaxInPrices = "CMSIncludeTaxInPrices"; + public const string CMSIndentOutputHtml = "CMSIndentOutputHtml"; + public const string CMSIntegrationEnabled = "CMSIntegrationEnabled"; + public const string CMSIntegrationLogExternal = "CMSIntegrationLogExternal"; + public const string CMSIntegrationLogInternal = "CMSIntegrationLogInternal"; + public const string CMSIntegrationProcessExternal = "CMSIntegrationProcessExternal"; + public const string CMSIntegrationProcessInternal = "CMSIntegrationProcessInternal"; + public const string CMSInvitationAcceptationPath = "CMSInvitationAcceptationPath"; + public const string CMSInvitationValidity = "CMSInvitationValidity"; + public const string CMSKeepChangedDocumentAccesible = "CMSKeepChangedDocumentAccesible"; + public const string CMSKeepNewCheckedOut = "CMSKeepNewCheckedOut"; + public const string CMSLayoutMappingEnable = "CMSLayoutMappingEnable"; + public const string CMSLinkedInAccessToken = "CMSLinkedInAccessToken"; + public const string CMSLinkedInApiKey = "CMSLinkedInApiKey"; + public const string CMSLinkedInApplicationSecret = "CMSLinkedInApplicationSecret"; + public const string CMSLinkedInRoles = "CMSLinkedInRoles"; + public const string CMSLinkedInSignInPermissionScope = "CMSLinkedInSignInPermissionScope"; + public const string CMSLiveIDRequiredUserDataPage = "CMSLiveIDRequiredUserDataPage"; + public const string CMSLiveIDRoles = "CMSLiveIDRoles"; + public const string CMSLogAnalytics = "CMSLogAnalytics"; + public const string CMSLogCache = "CMSLogCache"; + public const string CMSLogEverythingToFile = "CMSLogEverythingToFile"; + public const string CMSLogFiles = "CMSLogFiles"; + public const string CMSLogHandlers = "CMSLogHandlers"; + public const string CMSLogMacros = "CMSLogMacros"; + public const string CMSLogMetadata = "CMSLogMetadata"; + public const string CMSLogOutput = "CMSLogOutput"; + public const string CMSLogPageNotFoundException = "CMSLogPageNotFoundException"; + public const string CMSLogRequests = "CMSLogRequests"; + public const string CMSLogSecurity = "CMSLogSecurity"; + public const string CMSLogSize = "CMSLogSize"; + public const string CMSLogSQLQueries = "CMSLogSQLQueries"; + public const string CMSLogToDatabase = "CMSLogToDatabase"; + public const string CMSLogToFileSystem = "CMSLogToFileSystem"; + public const string CMSLogToTrace = "CMSLogToTrace"; + public const string CMSLogViewState = "CMSLogViewState"; + public const string CMSLogWebFarm = "CMSLogWebFarm"; + public const string CMSManualTranslationDeleteSuccessfulSubmissions = "CMSManualTranslationDeleteSuccessfulSubmissions"; + public const string CMSManualTranslationExportFolder = "CMSManualTranslationExportFolder"; + public const string CMSManualTranslationImportFolder = "CMSManualTranslationImportFolder"; + public const string CMSMarkShoppingCartAsAbandonedPeriod = "CMSMarkShoppingCartAsAbandonedPeriod"; + public const string CMSMaxCacheFileSize = "CMSMaxCacheFileSize"; + public const string CMSMaximumInvalidLogonAttempts = "CMSMaximumInvalidLogonAttempts"; + public const string CMSMaxTreeNodes = "CMSMaxTreeNodes"; + public const string CMSMaxUITreeNodes = "CMSMaxUITreeNodes"; + public const string CMSMediaFileAllowedExtensions = "CMSMediaFileAllowedExtensions"; + public const string CMSMediaFileHiddenFolder = "CMSMediaFileHiddenFolder"; + public const string CMSMediaFilePreviewSuffix = "CMSMediaFilePreviewSuffix"; + public const string CMSMediaImageWatermark = "CMSMediaImageWatermark"; + public const string CMSMediaLibrariesFolder = "CMSMediaLibrariesFolder"; + public const string CMSMediaLibraryMaxSubFolders = "CMSMediaLibraryMaxSubFolders"; + public const string CMSMediaUsePermanentURLs = "CMSMediaUsePermanentURLs"; + public const string CMSMemberManagementPath = "CMSMemberManagementPath"; + public const string CMSMemberProfilePath = "CMSMemberProfilePath"; + public const string CMSMembershipReminder = "CMSMembershipReminder"; + public const string CMSMetaImageWatermark = "CMSMetaImageWatermark"; + public const string CMSMFDisplayInitToken = "CMSMFDisplayInitToken"; + public const string CMSMFEnabled = "CMSMFEnabled"; + public const string CMSMFRequired = "CMSMFRequired"; + public const string CMSMinWatermarkImageHeight = "CMSMinWatermarkImageHeight"; + public const string CMSMinWatermarkImageWidth = "CMSMinWatermarkImageWidth"; + public const string CMSModuleUsageTrackingEnabled = "CMSModuleUsageTrackingEnabled"; + public const string CMSModuleUsageTrackingIdentity = "CMSModuleUsageTrackingIdentity"; + public const string CMSMonitorBouncedEmails = "CMSMonitorBouncedEmails"; + public const string CMSMoveViewStateToEnd = "CMSMoveViewStateToEnd"; + public const string CMSMSTranslatorTextAPISubscriptionKey = "CMSMSTranslatorTextAPISubscriptionKey"; + public const string CMSMVTEnabled = "CMSMVTEnabled"; + public const string CMSMyAccountURL = "CMSMyAccountURL"; + public const string CMSNewDocumentOrder = "CMSNewDocumentOrder"; + public const string CMSNewsletterUnsubscriptionURL = "CMSNewsletterUnsubscriptionURL"; + public const string CMSNewsletterUseExternalService = "CMSNewsletterUseExternalService"; + public const string CMSNoreplyEmailAddress = "CMSNoreplyEmailAddress"; + public const string CMSObjectVersionHistoryLength = "CMSObjectVersionHistoryLength"; + public const string CMSObjectVersionHistoryMajorVersionsLength = "CMSObjectVersionHistoryMajorVersionsLength"; + public const string CMSObjectVersionHistoryPromoteToMajorTimeInterval = "CMSObjectVersionHistoryPromoteToMajorTimeInterval"; + public const string CMSObjectVersionHistoryUseLastVersionInterval = "CMSObjectVersionHistoryUseLastVersionInterval"; + public const string CMSOnSiteEditButton = "CMSOnSiteEditButton"; + public const string CMSOpenIDRoles = "CMSOpenIDRoles"; + public const string CMSOptInApprovalURL = "CMSOptInApprovalURL"; + public const string CMSOptInInterval = "CMSOptInInterval"; + public const string CMSOutputCacheItems = "CMSOutputCacheItems"; + public const string CMSPageDescriptionPrefix = "CMSPageDescriptionPrefix"; + public const string CMSPageKeyWordsPrefix = "CMSPageKeyWordsPrefix"; + public const string CMSPageNotFoundForNonPublished = "CMSPageNotFoundForNonPublished"; + public const string CMSPageNotFoundUrl = "CMSPageNotFoundUrl"; + public const string CMSPageTitleFormat = "CMSPageTitleFormat"; + public const string CMSPageTitlePrefix = "CMSPageTitlePrefix"; + public const string CMSPartialCacheItems = "CMSPartialCacheItems"; + public const string CMSPasswordExpiration = "CMSPasswordExpiration"; + public const string CMSPasswordExpirationBehaviour = "CMSPasswordExpirationBehaviour"; + public const string CMSPasswordExpirationEmail = "CMSPasswordExpirationEmail"; + public const string CMSPasswordExpirationPeriod = "CMSPasswordExpirationPeriod"; + public const string CMSPasswordExpirationWarningPeriod = "CMSPasswordExpirationWarningPeriod"; + public const string CMSPasswordFormat = "CMSPasswordFormat"; + public const string CMSPaypalCancelReturnUrl = "CMSPaypalCancelReturnUrl"; + public const string CMSPayPalCredentialsAccountType = "CMSPayPalCredentialsAccountType"; + public const string CMSPayPalCredentialsClientId = "CMSPayPalCredentialsClientId"; + public const string CMSPayPalCredentialsClientSecret = "CMSPayPalCredentialsClientSecret"; + public const string CMSPayPalReturnUrl = "CMSPayPalReturnUrl"; + public const string CMSPayPalTransactionType = "CMSPayPalTransactionType"; + public const string CMSPersonalizeUserInterface = "CMSPersonalizeUserInterface"; + public const string CMSPolicyForcePolicyOnLogon = "CMSPolicyForcePolicyOnLogon"; + public const string CMSPolicyMinimalLength = "CMSPolicyMinimalLength"; + public const string CMSPolicyNumberOfNonAlphaNumChars = "CMSPolicyNumberOfNonAlphaNumChars"; + public const string CMSPolicyRegularExpression = "CMSPolicyRegularExpression"; + public const string CMSPolicyViolationMessage = "CMSPolicyViolationMessage"; + public const string CMSPollsAllowGlobal = "CMSPollsAllowGlobal"; + public const string CMSPOP3AuthenticationMethod = "CMSPOP3AuthenticationMethod"; + public const string CMSPOP3Password = "CMSPOP3Password"; + public const string CMSPOP3ServerName = "CMSPOP3ServerName"; + public const string CMSPOP3ServerPort = "CMSPOP3ServerPort"; + public const string CMSPOP3UserName = "CMSPOP3UserName"; + public const string CMSPOP3UseSSL = "CMSPOP3UseSSL"; + public const string CMSPriceRounding = "CMSPriceRounding"; + public const string CMSProcessDomainPrefix = "CMSProcessDomainPrefix"; + public const string CMSReCaptchaPrivateKey = "CMSReCaptchaPrivateKey"; + public const string CMSReCaptchaPublicKey = "CMSReCaptchaPublicKey"; + public const string CMSRedirectAliasesToMainURL = "CMSRedirectAliasesToMainURL"; + public const string CMSRedirectFilesToDisk = "CMSRedirectFilesToDisk"; + public const string CMSRedirectInvalidCasePages = "CMSRedirectInvalidCasePages"; + public const string CMSRedirectToMainExtension = "CMSRedirectToMainExtension"; + public const string CMSRegistrationAdministratorApproval = "CMSRegistrationAdministratorApproval"; + public const string CMSRegistrationApprovalPath = "CMSRegistrationApprovalPath"; + public const string CMSRegistrationEmailConfirmation = "CMSRegistrationEmailConfirmation"; + public const string CMSRememberUniGridState = "CMSRememberUniGridState"; + public const string CMSRequiredLinkedInPage = "CMSRequiredLinkedInPage"; + public const string CMSRequiredOpenIDPage = "CMSRequiredOpenIDPage"; + public const string CMSReservedUserNames = "CMSReservedUserNames"; + public const string CMSResetPasswordInterval = "CMSResetPasswordInterval"; + public const string CMSResetPasswordURL = "CMSResetPasswordURL"; + public const string CMSResizeImagesToDevice = "CMSResizeImagesToDevice"; + public const string CMSResolveMacrosInCSS = "CMSResolveMacrosInCSS"; + public const string CMSResourceCompressionEnabled = "CMSResourceCompressionEnabled"; + public const string CMSRESTAllowedDocTypes = "CMSRESTAllowedDocTypes"; + public const string CMSRESTAllowedObjectTypes = "CMSRESTAllowedObjectTypes"; + public const string CMSRESTAllowSensitiveFields = "CMSRESTAllowSensitiveFields"; + public const string CMSRESTDefaultEncoding = "CMSRESTDefaultEncoding"; + public const string CMSRESTDocumentsReadOnly = "CMSRESTDocumentsReadOnly"; + public const string CMSRESTDocumentsSecurityCheck = "CMSRESTDocumentsSecurityCheck"; + public const string CMSRESTGenerateHash = "CMSRESTGenerateHash"; + public const string CMSRESTObjectsReadOnly = "CMSRESTObjectsReadOnly"; + public const string CMSRestoreObjects = "CMSRestoreObjects"; + public const string CMSRESTServiceEnabled = "CMSRESTServiceEnabled"; + public const string CMSRESTServiceTypeEnabled = "CMSRESTServiceTypeEnabled"; + public const string CMSRevalidateClientCache = "CMSRevalidateClientCache"; + public const string CMSRobotsPath = "CMSRobotsPath"; + public const string CMSSalesForceCredentials = "CMSSalesForceCredentials"; + public const string CMSSalesForceLeadReplicationBatchSize = "CMSSalesForceLeadReplicationBatchSize"; + public const string CMSSalesForceLeadReplicationDefaultCompanyName = "CMSSalesForceLeadReplicationDefaultCompanyName"; + public const string CMSSalesForceLeadReplicationEnabled = "CMSSalesForceLeadReplicationEnabled"; + public const string CMSSalesForceLeadReplicationLeadDescription = "CMSSalesForceLeadReplicationLeadDescription"; + public const string CMSSalesForceLeadReplicationMapping = "CMSSalesForceLeadReplicationMapping"; + public const string CMSSalesForceLeadReplicationMappingDateTime = "CMSSalesForceLeadReplicationMappingDateTime"; + public const string CMSSalesForceLeadReplicationMinScoreValue = "CMSSalesForceLeadReplicationMinScoreValue"; + public const string CMSSalesForceLeadReplicationScoreID = "CMSSalesForceLeadReplicationScoreID"; + public const string CMSSalesForceLeadReplicationUpdateEnabled = "CMSSalesForceLeadReplicationUpdateEnabled"; + public const string CMSSchedulerInterval = "CMSSchedulerInterval"; + public const string CMSSchedulerServiceInterval = "CMSSchedulerServiceInterval"; + public const string CMSSchedulerTasksEnabled = "CMSSchedulerTasksEnabled"; + public const string CMSSchedulerUseExternalService = "CMSSchedulerUseExternalService"; + public const string CMSScreenLockEnabled = "CMSScreenLockEnabled"; + public const string CMSScreenLockInterval = "CMSScreenLockInterval"; + public const string CMSScreenLockWarningInterval = "CMSScreenLockWarningInterval"; + public const string CMSScriptMinificationEnabled = "CMSScriptMinificationEnabled"; + public const string CMSSearchAllowedFileTypes = "CMSSearchAllowedFileTypes"; + public const string CMSSearchIndexingEnabled = "CMSSearchIndexingEnabled"; + public const string CMSSecuredAreasLogonPage = "CMSSecuredAreasLogonPage"; + public const string CMSSendAccountUnlockEmail = "CMSSendAccountUnlockEmail"; + public const string CMSSendBlogEmailsFrom = "CMSSendBlogEmailsFrom"; + public const string CMSSendBoardEmailsFrom = "CMSSendBoardEmailsFrom"; + public const string CMSSendEmailNotificationsFrom = "CMSSendEmailNotificationsFrom"; + public const string CMSSendErrorNotificationTo = "CMSSendErrorNotificationTo"; + public const string CMSSendForumEmailsFrom = "CMSSendForumEmailsFrom"; + public const string CMSSendPasswordEmailsFrom = "CMSSendPasswordEmailsFrom"; + public const string CMSSendPasswordResetConfirmation = "CMSSendPasswordResetConfirmation"; + public const string CMSSendWorkflowEmails = "CMSSendWorkflowEmails"; + public const string CMSSendWorkflowEmailsFrom = "CMSSendWorkflowEmailsFrom"; + public const string CMSServerTimeZone = "CMSServerTimeZone"; + public const string CMSServiceHealthMonitoringInterval = "CMSServiceHealthMonitoringInterval"; + public const string CMSSessionManagerSchedulerInterval = "CMSSessionManagerSchedulerInterval"; + public const string CMSSessionUseDBRepository = "CMSSessionUseDBRepository"; + public const string CMSSharePointCache = "CMSSharePointCache"; + public const string CMSSharePointCacheSizeLimit = "CMSSharePointCacheSizeLimit"; + public const string CMSShoppingCartExpirationPeriod = "CMSShoppingCartExpirationPeriod"; + public const string CMSShoppingCartURL = "CMSShoppingCartURL"; + public const string CMSSitemapPath = "CMSSitemapPath"; + public const string CMSSiteSharedAccounts = "CMSSiteSharedAccounts"; + public const string CMSSiteTimeZone = "CMSSiteTimeZone"; + public const string CMSSMTPServer = "CMSSMTPServer"; + public const string CMSSMTPServerPassword = "CMSSMTPServerPassword"; + public const string CMSSMTPServerTip = "CMSSMTPServerTip"; + public const string CMSSMTPServerUser = "CMSSMTPServerUser"; + public const string CMSSocialMarketingURLShorteningFacebook = "CMSSocialMarketingURLShorteningFacebook"; + public const string CMSSocialMarketingURLShorteningLinkedIn = "CMSSocialMarketingURLShorteningLinkedIn"; + public const string CMSSocialMarketingURLShorteningTwitter = "CMSSocialMarketingURLShorteningTwitter"; + public const string CMSStagingLogChanges = "CMSStagingLogChanges"; + public const string CMSStagingLogDataChanges = "CMSStagingLogDataChanges"; + public const string CMSStagingLogObjectChanges = "CMSStagingLogObjectChanges"; + public const string CMSStagingLogStagingChanges = "CMSStagingLogStagingChanges"; + public const string CMSStagingServiceAuthentication = "CMSStagingServiceAuthentication"; + public const string CMSStagingServiceEnabled = "CMSStagingServiceEnabled"; + public const string CMSStagingServicePassword = "CMSStagingServicePassword"; + public const string CMSStagingServiceUsername = "CMSStagingServiceUsername"; + public const string CMSStagingServiceX509ClientBase64KeyId = "CMSStagingServiceX509ClientBase64KeyId"; + public const string CMSStagingServiceX509ServerBase64KeyId = "CMSStagingServiceX509ServerBase64KeyId"; + public const string CMSStoreAddToShoppingCartConversionName = "CMSStoreAddToShoppingCartConversionName"; + public const string CMSStoreAddToShoppingCartConversionValue = "CMSStoreAddToShoppingCartConversionValue"; + public const string CMSStoreAllowAnonymousCustomers = "CMSStoreAllowAnonymousCustomers"; + public const string CMSStoreAllowGlobalDepartments = "CMSStoreAllowGlobalDepartments"; + public const string CMSStoreAllowGlobalManufacturers = "CMSStoreAllowGlobalManufacturers"; + public const string CMSStoreAllowGlobalPaymentMethods = "CMSStoreAllowGlobalPaymentMethods"; + public const string CMSStoreAllowGlobalProductOptions = "CMSStoreAllowGlobalProductOptions"; + public const string CMSStoreAllowGlobalProducts = "CMSStoreAllowGlobalProducts"; + public const string CMSStoreAllowGlobalSuppliers = "CMSStoreAllowGlobalSuppliers"; + public const string CMSStoreAllowProductsWithoutDocuments = "CMSStoreAllowProductsWithoutDocuments"; + public const string CMSStoreAltFormLayoutsInFS = "CMSStoreAltFormLayoutsInFS"; + public const string CMSStoreApplyTaxesBasedOn = "CMSStoreApplyTaxesBasedOn"; + public const string CMSStoreAutoRegisterCustomer = "CMSStoreAutoRegisterCustomer"; + public const string CMSStoreAutoRegistrationEmailTemplate = "CMSStoreAutoRegistrationEmailTemplate"; + public const string CMSStoreCheckoutProcess = "CMSStoreCheckoutProcess"; + public const string CMSStoreCSSStylesheetsInFS = "CMSStoreCSSStylesheetsInFS"; + public const string CMSStoreDefaultCountryName = "CMSStoreDefaultCountryName"; + public const string CMSStoreDisplayProductsInSectionsTree = "CMSStoreDisplayProductsInSectionsTree"; + public const string CMSStoreEProductsReminder = "CMSStoreEProductsReminder"; + public const string CMSStoreFormLayoutsInFS = "CMSStoreFormLayoutsInFS"; + public const string CMSStoreInvoiceNumberPattern = "CMSStoreInvoiceNumberPattern"; + public const string CMSStoreInvoiceTemplate = "CMSStoreInvoiceTemplate"; + public const string CMSStoreLayoutsInFS = "CMSStoreLayoutsInFS"; + public const string CMSStoreMassUnit = "CMSStoreMassUnit"; + public const string CMSStoreNewProductStatus = "CMSStoreNewProductStatus"; + public const string CMSStoreOrderConversionName = "CMSStoreOrderConversionName"; + public const string CMSStoreOrderConversionValue = "CMSStoreOrderConversionValue"; + public const string CMSStorePageTemplatesInFS = "CMSStorePageTemplatesInFS"; + public const string CMSStoreProductsAreNewFor = "CMSStoreProductsAreNewFor"; + public const string CMSStoreProductsStartingPath = "CMSStoreProductsStartingPath"; + public const string CMSStoreProductsTree = "CMSStoreProductsTree"; + public const string CMSStoreRedirectToShoppingCart = "CMSStoreRedirectToShoppingCart"; + public const string CMSStoreRegistrationConversionName = "CMSStoreRegistrationConversionName"; + public const string CMSStoreRegistrationConversionValue = "CMSStoreRegistrationConversionValue"; + public const string CMSStoreRelatedProductsRelationshipName = "CMSStoreRelatedProductsRelationshipName"; + public const string CMSStoreRequireCompanyInfo = "CMSStoreRequireCompanyInfo"; + public const string CMSStoreSendEmailsFrom = "CMSStoreSendEmailsFrom"; + public const string CMSStoreSendEmailsTo = "CMSStoreSendEmailsTo"; + public const string CMSStoreSendOrderNotification = "CMSStoreSendOrderNotification"; + public const string CMSStoreSendPaymentNotification = "CMSStoreSendPaymentNotification"; + public const string CMSStoreShowOrganizationID = "CMSStoreShowOrganizationID"; + public const string CMSStoreShowTaxRegistrationID = "CMSStoreShowTaxRegistrationID"; + public const string CMSStoreTransformationsInFS = "CMSStoreTransformationsInFS"; + public const string CMSStoreUseCustomerCultureForEmails = "CMSStoreUseCustomerCultureForEmails"; + public const string CMSStoreUseExtraCompanyAddress = "CMSStoreUseExtraCompanyAddress"; + public const string CMSStoreUseGlobalCredit = "CMSStoreUseGlobalCredit"; + public const string CMSStoreUseGlobalCurrencies = "CMSStoreUseGlobalCurrencies"; + public const string CMSStoreUseGlobalExchangeRates = "CMSStoreUseGlobalExchangeRates"; + public const string CMSStoreUseGlobalInternalStatus = "CMSStoreUseGlobalInternalStatus"; + public const string CMSStoreUseGlobalInvoice = "CMSStoreUseGlobalInvoice"; + public const string CMSStoreUseGlobalOrderStatus = "CMSStoreUseGlobalOrderStatus"; + public const string CMSStoreUseGlobalPublicStatus = "CMSStoreUseGlobalPublicStatus"; + public const string CMSStoreUseGlobalTaxClasses = "CMSStoreUseGlobalTaxClasses"; + public const string CMSStoreWebpartContainersInFS = "CMSStoreWebpartContainersInFS"; + public const string CMSStoreWebPartLayoutsInFS = "CMSStoreWebPartLayoutsInFS"; + public const string CMSStoreWeightFormattingString = "CMSStoreWeightFormattingString"; + public const string CMSStrandsAPIID = "CMSStrandsAPIID"; + public const string CMSStrandsAutomaticCatalogUploadEnabled = "CMSStrandsAutomaticCatalogUploadEnabled"; + public const string CMSStrandsAutomaticUploadFrequency = "CMSStrandsAutomaticUploadFrequency"; + public const string CMSStrandsCatalogFeedPassword = "CMSStrandsCatalogFeedPassword"; + public const string CMSStrandsCatalogFeedUsername = "CMSStrandsCatalogFeedUsername"; + public const string CMSStrandsCatalogTransformation = "CMSStrandsCatalogTransformation"; + public const string CMSStrandsCatalogWhereCondition = "CMSStrandsCatalogWhereCondition"; + public const string CMSStrandsDocumentTypes = "CMSStrandsDocumentTypes"; + public const string CMSStrandsPath = "CMSStrandsPath"; + public const string CMSStrandsValidationToken = "CMSStrandsValidationToken"; + public const string CMSStylesheetMinificationEnabled = "CMSStylesheetMinificationEnabled"; + public const string CMSTimeZonesEnable = "CMSTimeZonesEnable"; + public const string CMSTrackAverageTimeOnPage = "CMSTrackAverageTimeOnPage"; + public const string CMSTrackExitPages = "CMSTrackExitPages"; + public const string CMSTrackLandingPages = "CMSTrackLandingPages"; + public const string CMSTrackMobileDevices = "CMSTrackMobileDevices"; + public const string CMSTrackOnSiteKeywords = "CMSTrackOnSiteKeywords"; + public const string CMSTrackReferringSitesDirect = "CMSTrackReferringSitesDirect"; + public const string CMSTrackReferringSitesLocal = "CMSTrackReferringSitesLocal"; + public const string CMSTrackReferringSitesReferring = "CMSTrackReferringSitesReferring"; + public const string CMSTrackSearchCrawlers = "CMSTrackSearchCrawlers"; + public const string CMSTrackSearchEngines = "CMSTrackSearchEngines"; + public const string CMSTrackSearchKeywords = "CMSTrackSearchKeywords"; + public const string CMSTranslateFileTypes = "CMSTranslateFileTypes"; + public const string CMSTranslateWebpartProperties = "CMSTranslateWebpartProperties"; + public const string CMSTranslationsAutoImport = "CMSTranslationsAutoImport"; + public const string CMSTranslationsComPassword = "CMSTranslationsComPassword"; + public const string CMSTranslationsComProjectCode = "CMSTranslationsComProjectCode"; + public const string CMSTranslationsComURL = "CMSTranslationsComURL"; + public const string CMSTranslationsComUserName = "CMSTranslationsComUserName"; + public const string CMSTranslationsEncoding = "CMSTranslationsEncoding"; + public const string CMSTranslationsLastStatusCheck = "CMSTranslationsLastStatusCheck"; + public const string CMSUpdateDocumentAlias = "CMSUpdateDocumentAlias"; + public const string CMSUploadExtensions = "CMSUploadExtensions"; + public const string CMSUseAutomaticVersionNumbering = "CMSUseAutomaticVersionNumbering"; + public const string CMSUseBizFormsSiteFolder = "CMSUseBizFormsSiteFolder"; + public const string CMSUseCheckinCheckout = "CMSUseCheckinCheckout"; + public const string CMSUseDomainForCulture = "CMSUseDomainForCulture"; + public const string CMSUseEventLogListener = "CMSUseEventLogListener"; + public const string CMSUseExternalService = "CMSUseExternalService"; + public const string CMSUseFilesSiteFolder = "CMSUseFilesSiteFolder"; + public const string CMSUseLangPrefixForUrls = "CMSUseLangPrefixForUrls"; + public const string CMSUseMediaLibrariesSiteFolder = "CMSUseMediaLibrariesSiteFolder"; + public const string CMSUseNamePathForUrlPath = "CMSUseNamePathForUrlPath"; + public const string CMSUseNoFollowForUsersLinks = "CMSUseNoFollowForUsersLinks"; + public const string CMSUseObjectCheckinCheckout = "CMSUseObjectCheckinCheckout"; + public const string CMSUseParentGroupIDForNewDocuments = "CMSUseParentGroupIDForNewDocuments"; + public const string CMSUsePasswordPolicy = "CMSUsePasswordPolicy"; + public const string CMSUsePermanentRedirect = "CMSUsePermanentRedirect"; + public const string CMSUsePermanentURLs = "CMSUsePermanentURLs"; + public const string CMSUserAccountUnlockPath = "CMSUserAccountUnlockPath"; + public const string CMSUserUniqueEmail = "CMSUserUniqueEmail"; + public const string CMSUseSessionManagement = "CMSUseSessionManagement"; + public const string CMSUseSitePrefixForUserName = "CMSUseSitePrefixForUserName"; + public const string CMSUseSSL = "CMSUseSSL"; + public const string CMSUseSSLForAdministrationInterface = "CMSUseSSLForAdministrationInterface"; + public const string CMSUseURLsWithTrailingSlash = "CMSUseURLsWithTrailingSlash"; + public const string CMSVersionHistoryLength = "CMSVersionHistoryLength"; + public const string CMSVersioningExtensionsMediaFile = "CMSVersioningExtensionsMediaFile"; + public const string CMSVisitorStatusIdle = "CMSVisitorStatusIdle"; + public const string CMSWebAnalyticsUseJavascriptLogging = "CMSWebAnalyticsUseJavascriptLogging"; + public const string CMSWebDAVExtensions = "CMSWebDAVExtensions"; + public const string CMSWebFarmMaxFileSize = "CMSWebFarmMaxFileSize"; + public const string CMSWebFarmMode = "CMSWebFarmMode"; + public const string CMSWebFarmSynchronizeAttachments = "CMSWebFarmSynchronizeAttachments"; + public const string CMSWebFarmSynchronizeAvatars = "CMSWebFarmSynchronizeAvatars"; + public const string CMSWebFarmSynchronizeBizFormFiles = "CMSWebFarmSynchronizeBizFormFiles"; + public const string CMSWebFarmSynchronizeCache = "CMSWebFarmSynchronizeCache"; + public const string CMSWebFarmSynchronizeDeleteFiles = "CMSWebFarmSynchronizeDeleteFiles"; + public const string CMSWebFarmSynchronizeFiles = "CMSWebFarmSynchronizeFiles"; + public const string CMSWebFarmSynchronizeForumAttachments = "CMSWebFarmSynchronizeForumAttachments"; + public const string CMSWebFarmSynchronizeMediaFiles = "CMSWebFarmSynchronizeMediaFiles"; + public const string CMSWebFarmSynchronizeMetaFiles = "CMSWebFarmSynchronizeMetaFiles"; + public const string CMSWebFarmSynchronizePhysicalFiles = "CMSWebFarmSynchronizePhysicalFiles"; + public const string CMSWebFarmSynchronizeSmartSearch = "CMSWebFarmSynchronizeSmartSearch"; + public const string CMSWebFarmSyncInterval = "CMSWebFarmSyncInterval"; + public const string CMSWIFAllowedAudienceUris = "CMSWIFAllowedAudienceUris"; + public const string CMSWIFCertificateValidator = "CMSWIFCertificateValidator"; + public const string CMSWIFEnabled = "CMSWIFEnabled"; + public const string CMSWIFIdentityProviderURL = "CMSWIFIdentityProviderURL"; + public const string CMSWIFRealm = "CMSWIFRealm"; + public const string CMSWIFTrustedCertificateThumbprint = "CMSWIFTrustedCertificateThumbprint"; + public const string CMSWishlistURL = "CMSWishlistURL"; +} diff --git a/Migration.Tool.K11/SettingsKeys.tt b/Migration.Tool.K11/SettingsKeys.tt new file mode 100644 index 00000000..ff4a7f02 --- /dev/null +++ b/Migration.Tool.K11/SettingsKeys.tt @@ -0,0 +1,29 @@ +<#@ template language="C#" #> +<#@ assembly name="System.Data" #> +<#@ import namespace="System.Data.SqlClient" #> +// ReSharper disable InconsistentNaming +// ReSharper disable IdentifierTypo +namespace Migration.Tool.K11; + +public static class SettingsKeys { +<# + var connectionString = Environment.GetEnvironmentVariable("KENTICO_MT_DEV_KX12_CONNECTION_STRING"); + using var connection = new SqlConnection(connectionString); + using var cmd = connection.CreateCommand(); + cmd.CommandText = """ + SELECT KeyName + FROM CMS_SettingsKey + WHERE KeyName LIKE 'CMS%' + GROUP BY KeyName + ORDER BY KeyName + """; + connection.Open(); + using var reader = cmd.ExecuteReader(); + while (reader.Read()) + { + WriteLine($""" + public const string {reader[0]} = "{reader[0]}"; + """); + } +#> +} \ No newline at end of file diff --git a/Migration.Toolkit.K11/genModel.ps1 b/Migration.Tool.K11/genModel.ps1 similarity index 100% rename from Migration.Toolkit.K11/genModel.ps1 rename to Migration.Tool.K11/genModel.ps1 diff --git a/Migration.Tool.KX12/Auxiliary/Kx13FormControls.cs b/Migration.Tool.KX12/Auxiliary/Kx13FormControls.cs new file mode 100644 index 00000000..e9ed4906 --- /dev/null +++ b/Migration.Tool.KX12/Auxiliary/Kx13FormControls.cs @@ -0,0 +1,234 @@ +// ReSharper disable InconsistentNaming + +namespace Migration.Tool.KX12.Auxiliary; + +public class Kx12FormControls +{ + public class UserControlForText + { + public const string AbTestConversionTypeSelector = "ABTestConversionTypeSelector"; + public const string ActivityTypeSelector = "ActivityTypeSelector"; + public const string AllowedExtensionsSelector = "AllowedExtensionsSelector"; + public const string Selectalternativeform = "selectalternativeform"; + public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; + public const string AssemblyClassSelector = "AssemblyClassSelector"; + public const string Fieldselector = "fieldselector"; + public const string BizFormSelector = "BizFormSelector"; + public const string BundleInventoryTypeSelector = "BundleInventoryTypeSelector"; + public const string CampaignSelector = "CampaignSelector"; + public const string CategorySelector = "CategorySelector"; + public const string ClassFieldSelector = "ClassFieldSelector"; + public const string ClassFields = "Class_fields"; + public const string CodeName = "CodeName"; + public const string CodeNameWithPrefix = "CodeNameWithPrefix"; + public const string Selectcolor = "selectcolor"; + public const string Columns = "Columns"; + public const string ConnectionStringSelector = "Connection_string_selector"; + public const string ContactClassFields = "Contact_class_fields"; + public const string CountrySelector = "countrySelector"; + public const string CssStylesEditor = "CSS_Styles_Editor"; + public const string Selectculture = "selectculture"; + public const string CultureSelectorForSettings = "CultureSelectorForSettings"; + public const string CurrencySelector = "currencySelector"; + public const string CustomTableItemSelector = "CustomTableItemSelector"; + public const string CustomTableSelector = "CustomTableSelector"; + public const string Selectcolumns = "selectcolumns"; + public const string DepartmentSelector = "DepartmentSelector"; + public const string DropDownListControl = "DropDownListControl"; + public const string DueDateSelector = "Due_date_selector"; + public const string Emailinput = "emailinput"; + public const string EmailTemplateSelector = "Email_template_selector"; + public const string EmailTemplateTypeSelector = "Email_template_type_selector"; + public const string EncodingTextBox = "EncodingTextBox"; + public const string EncryptedPassword = "EncryptedPassword"; + public const string EnumSelector = "EnumSelector"; + public const string EventLogTypeSelector = "EventLogTypeSelector"; + public const string FacebookAutoPost = "Facebook_auto_post"; + public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; + public const string FileSystemSelector = "FileSystemSelector"; + public const string FontIconSelector = "FontIconSelector"; + public const string FormFieldSelector = "FormFieldSelector"; + public const string FormPassword = "FormPassword"; + public const string FullMediaLibrarySelector = "FullMediaLibrarySelector"; + public const string GetGoogleTranslatorApiKey = "Get_Google_Translator_API_key"; + public const string GetMsTranslatorTextApiKey = "GetMSTranslatorTextAPIKey"; + public const string GoToExternalUrl = "Go_to_external_URL"; + public const string GoogleAnalyticsParameterSelector = "Google_Analytics_parameter_selector"; + public const string Html5Input = "HTML5Input"; + public const string IconSelector = "IconSelector"; + public const string InternalStatusSelector = "InternalStatusSelector"; + public const string Internationalphone = "internationalphone"; + public const string LabelControl = "LabelControl"; + public const string LargeTextArea = "LargeTextArea"; + public const string LicenseSelector = "LicenseSelector"; + public const string LinkedInAutoPost = "LinkedInAutoPost"; + public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; + public const string ListBoxControl = "ListBoxControl"; + public const string LocalizableTextArea = "LocalizableTextArea"; + public const string LocalizableTextBox = "LocalizableTextBox"; + public const string MacroAnyAllBoolSelector = "Macro_any-all_bool_selector"; + public const string MacroAnyAllSelector = "MacroAnyAllSelector"; + public const string MacroDateOperator = "Macro_date_operator"; + public const string MacroEditor = "MacroEditor"; + public const string MacroEqualityOperator = "MacroEqualityOperator"; + public const string MacroNegationOperator = "MacroNegationOperator"; + public const string MacroNumericOperator = "Macro_numeric_operator"; + public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; + public const string MacroTextOperator = "Macro_text_operator"; + public const string MacroType = "MacroType"; + public const string ManufacturerSelector = "ManufacturerSelector"; + public const string MediaLibrarySelector = "MediaLibrarySelector"; + public const string MediaSelectionControl = "MediaSelectionControl"; + public const string MembershipSelector = "MembershipSelector"; + public const string MetafileUploaderControl = "MetafileUploaderControl"; + public const string ModuleSelector = "ModuleSelector"; + public const string MultipleCategoriesSelector = "MultipleCategoriesSelector"; + public const string MultipleChoiceControl = "MultipleChoiceControl"; + public const string RoleCheckboxSelector = "RoleCheckboxSelector"; + public const string SimpleCheckboxRoleSelector = "SimpleCheckboxRoleSelector"; + public const string SimpleCheckboxSiteSelector = "SimpleCheckboxSiteSelector"; + public const string MultipleUserSelector = "MultipleUserSelector"; + public const string NewsletterSelector = "NewsletterSelector"; + public const string NewsletterSelectorSimple = "NewsletterSelectorSimple"; + public const string NumericUpDown = "NumericUpDown"; + public const string ObjectColumnSelector = "ObjectColumnSelector"; + public const string ObjectSelector = "ObjectSelector"; + public const string ObjectTransformation = "ObjectTransformation"; + public const string ObjectTypeBinSelector = "ObjectTypeBinSelector"; + public const string ObjectTypeSelector = "ObjectTypeSelector"; + public const string OptionCategoryProductOptionSelector = "OptionCategoryProductOptionSelector"; + public const string OptionCategorySelectionTypeSelector = "OptionCategorySelectionTypeSelector"; + public const string OrderBy = "OrderBy"; + public const string OrderStatusSelector = "OrderStatusSelector"; + public const string DocumentCultureFilter = "DocumentCultureFilter"; + public const string PageLayoutCode = "Page_layout_code"; + public const string Selectdocument = "selectdocument"; + public const string PageTemplateLevels = "PageTemplateLevels"; + public const string Selectpagetemplate = "selectpagetemplate"; + public const string DocumentTypeIconSelector = "DocumentTypeIconSelector"; + public const string Selectclassnames = "selectclassnames"; + public const string Password = "Password"; + public const string PasswordStrength = "PasswordStrength"; + public const string PasswordConfirmator = "PasswordConfirmator"; + public const string Selectpath = "selectpath"; + public const string PaymentSelector = "paymentSelector"; + public const string ProductImageSelector = "ProductImageSelector"; + public const string ProductRelationshipNameSelector = "ProductRelationshipNameSelector"; + public const string ProductSectionsSelector = "ProductSectionsSelector"; + public const string ProductTypeSelector = "ProductTypeSelector"; + public const string PublicStatusSelector = "PublicStatusSelector"; + public const string Selectquery = "selectquery"; + public const string RadioButtonsControl = "RadioButtonsControl"; + public const string AgeRangeSelector = "AgeRangeSelector"; + public const string RelatedDocuments = "RelatedDocuments"; + public const string Relationshipconfiguration = "relationshipconfiguration"; + public const string SelectRelationshipName = "SelectRelationshipName"; + public const string ReportSelectorDropDown = "ReportSelectorDropDown"; + public const string RoleSelector = "RoleSelector"; + public const string SearchClassNameSelector = "SearchClassNameSelector"; + public const string SearchIndexSelector = "SearchIndexSelector"; + public const string SearchIndexTypeSelector = "SearchIndexTypeSelector"; + public const string SelectCmsVersion = "SelectCMSVersion"; + public const string SettingsKeyControlSelector = "SettingsKeyControlSelector"; + public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; + public const string SharePointListSelector = "SharePointListSelector"; + public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; + public const string ShippingSelector = "shippingSelector"; + public const string ShippingServiceSelector = "ShippingServiceSelector"; + public const string Selectsinglepath = "selectsinglepath"; + public const string SinglePathSelectorWithPermissions = "SinglePathSelectorWithPermissions"; + public const string SiteContentCulture = "SiteContentCulture"; + public const string SiteCultureSelector = "SiteCultureSelector"; + public const string SiteCultureSelectorAll = "SiteCultureSelectorAll"; + public const string Selectsite = "selectsite"; + public const string SiteSelectorWithAllFieldForGlobalAdmin = "SiteSelectorWithAllFieldForGlobalAdmin"; + public const string SkuSelector = "SKUSelector"; + public const string StopWordsSelector = "StopWordsSelector"; + public const string SupplierSelector = "SupplierSelector"; + public const string SupportedCultureSelector = "SupportedCultureSelector"; + public const string TableConversionSettings = "TableConversionSettings"; + public const string TagGroupSelector = "TagGroupSelector"; + public const string TagSelector = "TagSelector"; + public const string TaxAddressTypeSelector = "TaxAddressTypeSelector"; + public const string TextAreaControl = "TextAreaControl"; + public const string TextBoxControl = "TextBoxControl"; + public const string TextFilter = "TextFilter"; + public const string TextboxDefaultValueFromSetting = "Textbox_default_value_from_setting"; + public const string TextboxDoubleValidator = "Textbox_double_validator"; + public const string TimeZoneSelector = "TimeZoneSelector"; + public const string TimeZoneTypeSelector = "TimeZoneTypeSelector"; + public const string ToggleButton = "ToggleButton"; + public const string Selecttransformation = "selecttransformation"; + public const string TranslationServiceSelector = "Translation_service_selector"; + public const string TwitterAutoPost = "Twitter_auto_post"; + public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; + public const string Usphone = "usphone"; + public const string Uszipcode = "uszipcode"; + public const string UiCultureSelector = "UICultureSelector"; + public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; + public const string UniSelector = "Uni_selector"; + public const string UrlChecker = "UrlChecker"; + public const string UrlSelector = "URLSelector"; + public const string SmurlShortenerSelector = "SMURLShortenerSelector"; + public const string UserName = "UserName"; + public const string UserNameSelector = "UserNameSelector"; + public const string UserSelector = "UserSelector"; + public const string ValiditySelector = "ValiditySelector"; + public const string ViewSecureText = "ViewSecureText"; + public const string WhereCondition = "WhereCondition"; + public const string WorkflowScopeDefinition = "WorkflowScopeDefinition"; + } + + public class UserControlForLongText + { + public const string AbTestConversionSelector = "ABTestConversionSelector"; + public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; + public const string BbEditorControl = "BBEditorControl"; + public const string CacheDependencies = "CacheDependencies"; + public const string ClassFields = "Class_fields"; + public const string Columns = "Columns"; + public const string ConditionBuilder = "ConditionBuilder"; + public const string ContactClassFields = "Contact_class_fields"; + public const string CssStylesEditor = "CSS_Styles_Editor"; + public const string Selectcolumns = "selectcolumns"; + public const string DropDownListControl = "DropDownListControl"; + public const string FacebookAutoPost = "Facebook_auto_post"; + public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; + public const string FileSystemSelector = "FileSystemSelector"; + public const string Html5Input = "HTML5Input"; + public const string AutoResizeConfiguration = "AutoResizeConfiguration"; + public const string LabelControl = "LabelControl"; + public const string LargeTextArea = "LargeTextArea"; + public const string LinkedInAutoPost = "LinkedInAutoPost"; + public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; + public const string LocalizableTextArea = "LocalizableTextArea"; + public const string LocalizableTextBox = "LocalizableTextBox"; + public const string MacroEditor = "MacroEditor"; + public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; + public const string MultipleObjectBindingControl = "MultipleObjectBindingControl"; + public const string ObjectTypeSelector = "ObjectTypeSelector"; + public const string OptionsSelector = "OptionsSelector"; + public const string OrderBy = "OrderBy"; + public const string PageLayoutCode = "Page_layout_code"; + public const string ProductSectionsSelector = "ProductSectionsSelector"; + public const string RelatedDocuments = "RelatedDocuments"; + public const string ReportGraphSelector = "ReportGraphSelector"; + public const string ReportTableSelector = "ReportTableSelector"; + public const string ReportValueSelector = "ReportValueSelector"; + public const string HtmlAreaControl = "HtmlAreaControl"; + public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; + public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; + public const string TagSelector = "TagSelector"; + public const string TextAreaControl = "TextAreaControl"; + public const string TextBoxControl = "TextBoxControl"; + public const string TextFilter = "TextFilter"; + public const string TranslationServiceSelector = "Translation_service_selector"; + public const string TwitterAutoPost = "Twitter_auto_post"; + public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; + public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; + public const string UniSelector = "Uni_selector"; + public const string SmurlShortenerSelector = "SMURLShortenerSelector"; + public const string ViewSecureText = "ViewSecureText"; + public const string WhereCondition = "WhereCondition"; + } +} diff --git a/Migration.Toolkit.KX12/Context/KX12Context.cs b/Migration.Tool.KX12/Context/KX12Context.cs similarity index 99% rename from Migration.Toolkit.KX12/Context/KX12Context.cs rename to Migration.Tool.KX12/Context/KX12Context.cs index c2fefc4a..fd988794 100644 --- a/Migration.Toolkit.KX12/Context/KX12Context.cs +++ b/Migration.Tool.KX12/Context/KX12Context.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; -using Migration.Toolkit.KX12.Models; +using Migration.Tool.KX12.Models; -namespace Migration.Toolkit.KX12.Context; +namespace Migration.Tool.KX12.Context; public partial class KX12Context : DbContext { diff --git a/Migration.Tool.KX12/ContextCustomizations.cs b/Migration.Tool.KX12/ContextCustomizations.cs new file mode 100644 index 00000000..0bbc72c2 --- /dev/null +++ b/Migration.Tool.KX12/ContextCustomizations.cs @@ -0,0 +1,14 @@ +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Context; + +public partial class KX12Context +{ + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder + .EnableDetailedErrors() + .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); + base.OnConfiguring(optionsBuilder); + } +} diff --git a/Migration.Tool.KX12/DependencyInjectionExtensions.cs b/Migration.Tool.KX12/DependencyInjectionExtensions.cs new file mode 100644 index 00000000..8c807fc8 --- /dev/null +++ b/Migration.Tool.KX12/DependencyInjectionExtensions.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; + +using Migration.Tool.Common; +using Migration.Tool.KX12.Context; + +namespace Migration.Tool.KX12; + +public static class DependencyInjectionExtensions +{ + public static IServiceCollection UseKx12DbContext(this IServiceCollection services, ToolConfiguration toolConfiguration) + { + services.AddDbContextFactory(options => options.UseSqlServer(toolConfiguration.KxConnectionString)); + return services; + } +} diff --git a/Migration.Tool.KX12/Migration.Tool.KX12.csproj b/Migration.Tool.KX12/Migration.Tool.KX12.csproj new file mode 100644 index 00000000..49b635fb --- /dev/null +++ b/Migration.Tool.KX12/Migration.Tool.KX12.csproj @@ -0,0 +1,46 @@ + + + + + TextTemplatingFileGenerator + SettingsKeys.cs + + + + + + True + True + SettingsKeys.tt + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + diff --git a/Migration.Tool.KX12/Models/AnalyticsCampaign.cs b/Migration.Tool.KX12/Models/AnalyticsCampaign.cs new file mode 100644 index 00000000..69241e11 --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsCampaign.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_Campaign")] +[Index("CampaignScheduledTaskId", Name = "IX_Analytics_Campaign_CampaignScheduledTaskID")] +[Index("CampaignSiteId", Name = "IX_Analytics_Campaign_CampaignSiteID")] +public class AnalyticsCampaign +{ + [Key] + [Column("CampaignID")] + public int CampaignId { get; set; } + + [StringLength(200)] + public string CampaignName { get; set; } = null!; + + [StringLength(100)] + public string CampaignDisplayName { get; set; } = null!; + + public string? CampaignDescription { get; set; } + + [Column("CampaignSiteID")] + public int CampaignSiteId { get; set; } + + public DateTime? CampaignOpenFrom { get; set; } + + public DateTime? CampaignOpenTo { get; set; } + + [Column("CampaignGUID")] + public Guid CampaignGuid { get; set; } + + public DateTime CampaignLastModified { get; set; } + + [Column("CampaignUTMCode")] + [StringLength(200)] + public string? CampaignUtmcode { get; set; } + + public DateTime? CampaignCalculatedTo { get; set; } + + [Column("CampaignScheduledTaskID")] + public int? CampaignScheduledTaskId { get; set; } + + public int? CampaignVisitors { get; set; } + + [InverseProperty("CampaignAssetCampaign")] + public virtual ICollection AnalyticsCampaignAssets { get; set; } = new List(); + + [InverseProperty("CampaignConversionCampaign")] + public virtual ICollection AnalyticsCampaignConversions { get; set; } = new List(); + + [InverseProperty("CampaignObjectiveCampaign")] + public virtual AnalyticsCampaignObjective? AnalyticsCampaignObjective { get; set; } + + [ForeignKey("CampaignScheduledTaskId")] + [InverseProperty("AnalyticsCampaigns")] + public virtual CmsScheduledTask? CampaignScheduledTask { get; set; } + + [ForeignKey("CampaignSiteId")] + [InverseProperty("AnalyticsCampaigns")] + public virtual CmsSite CampaignSite { get; set; } = null!; + + [InverseProperty("FacebookPostCampaign")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); + + [InverseProperty("LinkedInPostCampaign")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); + + [InverseProperty("TwitterPostCampaign")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/AnalyticsCampaignAsset.cs b/Migration.Tool.KX12/Models/AnalyticsCampaignAsset.cs new file mode 100644 index 00000000..cc203246 --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsCampaignAsset.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_CampaignAsset")] +[Index("CampaignAssetCampaignId", Name = "IX_Analytics_CampaignAsset_CampaignAssetCampaignID")] +public class AnalyticsCampaignAsset +{ + [Key] + [Column("CampaignAssetID")] + public int CampaignAssetId { get; set; } + + public Guid CampaignAssetGuid { get; set; } + + public DateTime CampaignAssetLastModified { get; set; } + + public Guid CampaignAssetAssetGuid { get; set; } + + [Column("CampaignAssetCampaignID")] + public int CampaignAssetCampaignId { get; set; } + + [StringLength(200)] + public string CampaignAssetType { get; set; } = null!; + + [InverseProperty("CampaignAssetUrlCampaignAsset")] + public virtual ICollection AnalyticsCampaignAssetUrls { get; set; } = new List(); + + [ForeignKey("CampaignAssetCampaignId")] + [InverseProperty("AnalyticsCampaignAssets")] + public virtual AnalyticsCampaign CampaignAssetCampaign { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/AnalyticsCampaignAssetUrl.cs b/Migration.Tool.KX12/Models/AnalyticsCampaignAssetUrl.cs new file mode 100644 index 00000000..45679aae --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsCampaignAssetUrl.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_CampaignAssetUrl")] +[Index("CampaignAssetUrlCampaignAssetId", Name = "IX_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID")] +public class AnalyticsCampaignAssetUrl +{ + [Key] + [Column("CampaignAssetUrlID")] + public int CampaignAssetUrlId { get; set; } + + public Guid CampaignAssetUrlGuid { get; set; } + + public string CampaignAssetUrlTarget { get; set; } = null!; + + [StringLength(200)] + public string CampaignAssetUrlPageTitle { get; set; } = null!; + + [Column("CampaignAssetUrlCampaignAssetID")] + public int CampaignAssetUrlCampaignAssetId { get; set; } + + [ForeignKey("CampaignAssetUrlCampaignAssetId")] + [InverseProperty("AnalyticsCampaignAssetUrls")] + public virtual AnalyticsCampaignAsset CampaignAssetUrlCampaignAsset { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/AnalyticsCampaignConversion.cs b/Migration.Tool.KX12/Models/AnalyticsCampaignConversion.cs new file mode 100644 index 00000000..268cf8b4 --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsCampaignConversion.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_CampaignConversion")] +[Index("CampaignConversionCampaignId", Name = "IX_Analytics_CampaignConversion_CampaignConversionCampaignID")] +public class AnalyticsCampaignConversion +{ + [Key] + [Column("CampaignConversionID")] + public int CampaignConversionId { get; set; } + + public Guid CampaignConversionGuid { get; set; } + + public DateTime CampaignConversionLastModified { get; set; } + + [StringLength(100)] + public string CampaignConversionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string CampaignConversionName { get; set; } = null!; + + [Column("CampaignConversionCampaignID")] + public int CampaignConversionCampaignId { get; set; } + + public int CampaignConversionOrder { get; set; } + + [StringLength(250)] + public string CampaignConversionActivityType { get; set; } = null!; + + public int CampaignConversionHits { get; set; } + + [Column("CampaignConversionItemID")] + public int? CampaignConversionItemId { get; set; } + + public double CampaignConversionValue { get; set; } + + public bool CampaignConversionIsFunnelStep { get; set; } + + [Column("CampaignConversionURL")] + public string? CampaignConversionUrl { get; set; } + + [InverseProperty("CampaignConversionHitsConversion")] + public virtual ICollection AnalyticsCampaignConversionHits { get; set; } = new List(); + + [InverseProperty("CampaignObjectiveCampaignConversion")] + public virtual ICollection AnalyticsCampaignObjectives { get; set; } = new List(); + + [ForeignKey("CampaignConversionCampaignId")] + [InverseProperty("AnalyticsCampaignConversions")] + public virtual AnalyticsCampaign CampaignConversionCampaign { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/AnalyticsCampaignConversionHit.cs b/Migration.Tool.KX12/Models/AnalyticsCampaignConversionHit.cs new file mode 100644 index 00000000..094f850b --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsCampaignConversionHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_CampaignConversionHits")] +[Index("CampaignConversionHitsConversionId", Name = "IX_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID")] +public class AnalyticsCampaignConversionHit +{ + [Key] + [Column("CampaignConversionHitsID")] + public int CampaignConversionHitsId { get; set; } + + [Column("CampaignConversionHitsConversionID")] + public int CampaignConversionHitsConversionId { get; set; } + + public int CampaignConversionHitsCount { get; set; } + + [StringLength(200)] + public string CampaignConversionHitsSourceName { get; set; } = null!; + + [StringLength(200)] + public string? CampaignConversionHitsContentName { get; set; } + + [ForeignKey("CampaignConversionHitsConversionId")] + [InverseProperty("AnalyticsCampaignConversionHits")] + public virtual AnalyticsCampaignConversion CampaignConversionHitsConversion { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/AnalyticsCampaignObjective.cs b/Migration.Tool.KX12/Models/AnalyticsCampaignObjective.cs new file mode 100644 index 00000000..564db365 --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsCampaignObjective.cs @@ -0,0 +1,36 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_CampaignObjective")] +[Index("CampaignObjectiveCampaignId", Name = "CK_Analytics_CampaignObjective_CampaignObjectiveCampaignID", IsUnique = true)] +[Index("CampaignObjectiveCampaignConversionId", Name = "IX_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID")] +public class AnalyticsCampaignObjective +{ + [Key] + [Column("CampaignObjectiveID")] + public int CampaignObjectiveId { get; set; } + + public Guid CampaignObjectiveGuid { get; set; } + + public DateTime CampaignObjectiveLastModified { get; set; } + + [Column("CampaignObjectiveCampaignID")] + public int CampaignObjectiveCampaignId { get; set; } + + public int? CampaignObjectiveValue { get; set; } + + [Column("CampaignObjectiveCampaignConversionID")] + public int CampaignObjectiveCampaignConversionId { get; set; } + + [ForeignKey("CampaignObjectiveCampaignId")] + [InverseProperty("AnalyticsCampaignObjective")] + public virtual AnalyticsCampaign CampaignObjectiveCampaign { get; set; } = null!; + + [ForeignKey("CampaignObjectiveCampaignConversionId")] + [InverseProperty("AnalyticsCampaignObjectives")] + public virtual AnalyticsCampaignConversion CampaignObjectiveCampaignConversion { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/AnalyticsConversion.cs b/Migration.Tool.KX12/Models/AnalyticsConversion.cs new file mode 100644 index 00000000..e2a7b1c4 --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsConversion.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_Conversion")] +[Index("ConversionSiteId", Name = "IX_Analytics_Conversion_ConversionSiteID")] +public class AnalyticsConversion +{ + [Key] + [Column("ConversionID")] + public int ConversionId { get; set; } + + [StringLength(200)] + public string ConversionName { get; set; } = null!; + + [StringLength(200)] + public string ConversionDisplayName { get; set; } = null!; + + public string? ConversionDescription { get; set; } + + [Column("ConversionGUID")] + public Guid ConversionGuid { get; set; } + + public DateTime ConversionLastModified { get; set; } + + [Column("ConversionSiteID")] + public int ConversionSiteId { get; set; } + + [ForeignKey("ConversionSiteId")] + [InverseProperty("AnalyticsConversions")] + public virtual CmsSite ConversionSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/AnalyticsDayHit.cs b/Migration.Tool.KX12/Models/AnalyticsDayHit.cs new file mode 100644 index 00000000..9fd66bf7 --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsDayHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_DayHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_DayHits_HitsStatisticsID")] +public class AnalyticsDayHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsDayHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/AnalyticsExitPage.cs b/Migration.Tool.KX12/Models/AnalyticsExitPage.cs new file mode 100644 index 00000000..05220e1a --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsExitPage.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_ExitPages")] +[Index("ExitPageLastModified", Name = "IX_Analytics_ExitPages_ExitPageLastModified")] +public class AnalyticsExitPage +{ + [Key] + [StringLength(200)] + public string SessionIdentificator { get; set; } = null!; + + [Column("ExitPageNodeID")] + public int ExitPageNodeId { get; set; } + + public DateTime ExitPageLastModified { get; set; } + + [Column("ExitPageSiteID")] + public int ExitPageSiteId { get; set; } + + [StringLength(10)] + public string? ExitPageCulture { get; set; } +} diff --git a/Migration.Tool.KX12/Models/AnalyticsHourHit.cs b/Migration.Tool.KX12/Models/AnalyticsHourHit.cs new file mode 100644 index 00000000..3d751157 --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsHourHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_HourHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_HourHits_HitsStatisticsID")] +public class AnalyticsHourHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsHourHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/AnalyticsMonthHit.cs b/Migration.Tool.KX12/Models/AnalyticsMonthHit.cs new file mode 100644 index 00000000..ce045dbd --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsMonthHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_MonthHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_MonthHits_HitsStatisticsID")] +public class AnalyticsMonthHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsMonthHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/AnalyticsStatistic.cs b/Migration.Tool.KX12/Models/AnalyticsStatistic.cs new file mode 100644 index 00000000..3303e9a9 --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsStatistic.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_Statistics")] +[Index("StatisticsSiteId", Name = "IX_Analytics_Statistics_StatisticsSiteID")] +public class AnalyticsStatistic +{ + [Key] + [Column("StatisticsID")] + public int StatisticsId { get; set; } + + [Column("StatisticsSiteID")] + public int? StatisticsSiteId { get; set; } + + [StringLength(400)] + public string StatisticsCode { get; set; } = null!; + + [StringLength(450)] + public string? StatisticsObjectName { get; set; } + + [Column("StatisticsObjectID")] + public int? StatisticsObjectId { get; set; } + + [StringLength(10)] + public string? StatisticsObjectCulture { get; set; } + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsDayHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsHourHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsMonthHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsWeekHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsYearHits { get; set; } = new List(); + + [ForeignKey("StatisticsSiteId")] + [InverseProperty("AnalyticsStatistics")] + public virtual CmsSite? StatisticsSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/AnalyticsWeekHit.cs b/Migration.Tool.KX12/Models/AnalyticsWeekHit.cs new file mode 100644 index 00000000..87f325ba --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsWeekHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_WeekHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_WeekHits_HitsStatisticsID")] +public class AnalyticsWeekHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsWeekHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/AnalyticsYearHit.cs b/Migration.Tool.KX12/Models/AnalyticsYearHit.cs new file mode 100644 index 00000000..fd497b7e --- /dev/null +++ b/Migration.Tool.KX12/Models/AnalyticsYearHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Analytics_YearHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_WeekYearHits_HitsStatisticsID")] +public class AnalyticsYearHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsYearHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/BadWordsWord.cs b/Migration.Tool.KX12/Models/BadWordsWord.cs new file mode 100644 index 00000000..91cad08c --- /dev/null +++ b/Migration.Tool.KX12/Models/BadWordsWord.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("BadWords_Word")] +[Index("WordIsGlobal", Name = "IX_BadWords_Word_WordIsGlobal")] +public class BadWordsWord +{ + [Key] + [Column("WordID")] + public int WordId { get; set; } + + [Column("WordGUID")] + public Guid WordGuid { get; set; } + + public DateTime WordLastModified { get; set; } + + [StringLength(200)] + public string WordExpression { get; set; } = null!; + + [StringLength(200)] + public string? WordReplacement { get; set; } + + public int? WordAction { get; set; } + + public bool WordIsGlobal { get; set; } + + public bool WordIsRegularExpression { get; set; } + + public bool? WordMatchWholeWord { get; set; } + + [ForeignKey("WordId")] + [InverseProperty("Words")] + public virtual ICollection Cultures { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/BlogComment.cs b/Migration.Tool.KX12/Models/BlogComment.cs new file mode 100644 index 00000000..3e83feb7 --- /dev/null +++ b/Migration.Tool.KX12/Models/BlogComment.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Blog_Comment")] +[Index("CommentApprovedByUserId", Name = "IX_Blog_Comment_CommentApprovedByUserID")] +[Index("CommentPostDocumentId", Name = "IX_Blog_Comment_CommentPostDocumentID")] +[Index("CommentUserId", Name = "IX_Blog_Comment_CommentUserID")] +public class BlogComment +{ + [Key] + [Column("CommentID")] + public int CommentId { get; set; } + + [StringLength(200)] + public string CommentUserName { get; set; } = null!; + + [Column("CommentUserID")] + public int? CommentUserId { get; set; } + + [StringLength(450)] + public string? CommentUrl { get; set; } + + public string CommentText { get; set; } = null!; + + [Column("CommentApprovedByUserID")] + public int? CommentApprovedByUserId { get; set; } + + [Column("CommentPostDocumentID")] + public int CommentPostDocumentId { get; set; } + + public DateTime CommentDate { get; set; } + + public bool? CommentIsSpam { get; set; } + + public bool? CommentApproved { get; set; } + + [StringLength(254)] + public string? CommentEmail { get; set; } + + public string? CommentInfo { get; set; } + + [Column("CommentGUID")] + public Guid CommentGuid { get; set; } + + [ForeignKey("CommentApprovedByUserId")] + [InverseProperty("BlogCommentCommentApprovedByUsers")] + public virtual CmsUser? CommentApprovedByUser { get; set; } + + [ForeignKey("CommentPostDocumentId")] + [InverseProperty("BlogComments")] + public virtual CmsDocument CommentPostDocument { get; set; } = null!; + + [ForeignKey("CommentUserId")] + [InverseProperty("BlogCommentCommentUsers")] + public virtual CmsUser? CommentUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/BlogPostSubscription.cs b/Migration.Tool.KX12/Models/BlogPostSubscription.cs new file mode 100644 index 00000000..adc2d336 --- /dev/null +++ b/Migration.Tool.KX12/Models/BlogPostSubscription.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Blog_PostSubscription")] +[Index("SubscriptionPostDocumentId", Name = "IX_Blog_PostSubscription_SubscriptionPostDocumentID")] +[Index("SubscriptionUserId", Name = "IX_Blog_PostSubscription_SubscriptionUserID")] +public class BlogPostSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionPostDocumentID")] + public int SubscriptionPostDocumentId { get; set; } + + [Column("SubscriptionUserID")] + public int? SubscriptionUserId { get; set; } + + [StringLength(254)] + public string? SubscriptionEmail { get; set; } + + public DateTime SubscriptionLastModified { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [ForeignKey("SubscriptionPostDocumentId")] + [InverseProperty("BlogPostSubscriptions")] + public virtual CmsDocument SubscriptionPostDocument { get; set; } = null!; + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("BlogPostSubscriptions")] + public virtual CmsUser? SubscriptionUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/BoardBoard.cs b/Migration.Tool.KX12/Models/BoardBoard.cs new file mode 100644 index 00000000..01d9415a --- /dev/null +++ b/Migration.Tool.KX12/Models/BoardBoard.cs @@ -0,0 +1,116 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Board_Board")] +[Index("BoardDocumentId", "BoardName", Name = "IX_Board_Board_BoardDocumentID_BoardName", IsUnique = true)] +[Index("BoardGroupId", "BoardName", Name = "IX_Board_Board_BoardGroupID_BoardName")] +[Index("BoardSiteId", Name = "IX_Board_Board_BoardSiteID")] +[Index("BoardUserId", "BoardName", Name = "IX_Board_Board_BoardUserID_BoardName")] +public class BoardBoard +{ + [Key] + [Column("BoardID")] + public int BoardId { get; set; } + + [StringLength(250)] + public string BoardName { get; set; } = null!; + + [StringLength(250)] + public string BoardDisplayName { get; set; } = null!; + + public string BoardDescription { get; set; } = null!; + + public bool BoardOpened { get; set; } + + public DateTime? BoardOpenedFrom { get; set; } + + public DateTime? BoardOpenedTo { get; set; } + + public bool BoardEnabled { get; set; } + + public int BoardAccess { get; set; } + + public bool BoardModerated { get; set; } + + public bool BoardUseCaptcha { get; set; } + + public int BoardMessages { get; set; } + + public DateTime BoardLastModified { get; set; } + + [Column("BoardGUID")] + public Guid BoardGuid { get; set; } + + [Column("BoardDocumentID")] + public int BoardDocumentId { get; set; } + + [Column("BoardUserID")] + public int? BoardUserId { get; set; } + + [Column("BoardGroupID")] + public int? BoardGroupId { get; set; } + + public DateTime? BoardLastMessageTime { get; set; } + + [StringLength(250)] + public string? BoardLastMessageUserName { get; set; } + + [Column("BoardUnsubscriptionURL")] + [StringLength(450)] + public string? BoardUnsubscriptionUrl { get; set; } + + public bool? BoardRequireEmails { get; set; } + + [Column("BoardSiteID")] + public int BoardSiteId { get; set; } + + public bool BoardEnableSubscriptions { get; set; } + + [Column("BoardBaseURL")] + [StringLength(450)] + public string? BoardBaseUrl { get; set; } + + public bool? BoardLogActivity { get; set; } + + public bool? BoardEnableOptIn { get; set; } + + public bool? BoardSendOptInConfirmation { get; set; } + + [Column("BoardOptInApprovalURL")] + [StringLength(450)] + public string? BoardOptInApprovalUrl { get; set; } + + [ForeignKey("BoardDocumentId")] + [InverseProperty("BoardBoards")] + public virtual CmsDocument BoardDocument { get; set; } = null!; + + [ForeignKey("BoardGroupId")] + [InverseProperty("BoardBoards")] + public virtual CommunityGroup? BoardGroup { get; set; } + + [InverseProperty("MessageBoard")] + public virtual ICollection BoardMessagesNavigation { get; set; } = new List(); + + [ForeignKey("BoardSiteId")] + [InverseProperty("BoardBoards")] + public virtual CmsSite BoardSite { get; set; } = null!; + + [InverseProperty("SubscriptionBoard")] + public virtual ICollection BoardSubscriptions { get; set; } = new List(); + + [ForeignKey("BoardUserId")] + [InverseProperty("BoardBoards")] + public virtual CmsUser? BoardUser { get; set; } + + [ForeignKey("BoardId")] + [InverseProperty("Boards")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("BoardId")] + [InverseProperty("Boards")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/BoardMessage.cs b/Migration.Tool.KX12/Models/BoardMessage.cs new file mode 100644 index 00000000..3e5ae38f --- /dev/null +++ b/Migration.Tool.KX12/Models/BoardMessage.cs @@ -0,0 +1,69 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Board_Message")] +[Index("MessageApprovedByUserId", Name = "IX_Board_Message_MessageApprovedByUserID")] +[Index("MessageApproved", "MessageIsSpam", Name = "IX_Board_Message_MessageApproved_MessageIsSpam")] +[Index("MessageBoardId", "MessageGuid", Name = "IX_Board_Message_MessageBoardID_MessageGUID", IsUnique = true)] +[Index("MessageUserId", Name = "IX_Board_Message_MessageUserID")] +public class BoardMessage +{ + [Key] + [Column("MessageID")] + public int MessageId { get; set; } + + [StringLength(250)] + public string MessageUserName { get; set; } = null!; + + public string MessageText { get; set; } = null!; + + [StringLength(254)] + public string MessageEmail { get; set; } = null!; + + [Column("MessageURL")] + [StringLength(450)] + public string MessageUrl { get; set; } = null!; + + public bool MessageIsSpam { get; set; } + + [Column("MessageBoardID")] + public int MessageBoardId { get; set; } + + public bool MessageApproved { get; set; } + + [Column("MessageApprovedByUserID")] + public int? MessageApprovedByUserId { get; set; } + + [Column("MessageUserID")] + public int? MessageUserId { get; set; } + + public string MessageUserInfo { get; set; } = null!; + + [Column("MessageAvatarGUID")] + public Guid? MessageAvatarGuid { get; set; } + + public DateTime MessageInserted { get; set; } + + public DateTime MessageLastModified { get; set; } + + [Column("MessageGUID")] + public Guid MessageGuid { get; set; } + + public double? MessageRatingValue { get; set; } + + [ForeignKey("MessageApprovedByUserId")] + [InverseProperty("BoardMessageMessageApprovedByUsers")] + public virtual CmsUser? MessageApprovedByUser { get; set; } + + [ForeignKey("MessageBoardId")] + [InverseProperty("BoardMessagesNavigation")] + public virtual BoardBoard MessageBoard { get; set; } = null!; + + [ForeignKey("MessageUserId")] + [InverseProperty("BoardMessageMessageUsers")] + public virtual CmsUser? MessageUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/BoardSubscription.cs b/Migration.Tool.KX12/Models/BoardSubscription.cs new file mode 100644 index 00000000..4b956670 --- /dev/null +++ b/Migration.Tool.KX12/Models/BoardSubscription.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Board_Subscription")] +[Index("SubscriptionBoardId", Name = "IX_Board_Subscription_SubscriptionBoardID")] +[Index("SubscriptionUserId", Name = "IX_Board_Subscription_SubscriptionUserID")] +public class BoardSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionBoardID")] + public int SubscriptionBoardId { get; set; } + + [Column("SubscriptionUserID")] + public int? SubscriptionUserId { get; set; } + + [StringLength(254)] + public string SubscriptionEmail { get; set; } = null!; + + public DateTime SubscriptionLastModified { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [ForeignKey("SubscriptionBoardId")] + [InverseProperty("BoardSubscriptions")] + public virtual BoardBoard SubscriptionBoard { get; set; } = null!; + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("BoardSubscriptions")] + public virtual CmsUser? SubscriptionUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ChatInitiatedChatRequest.cs b/Migration.Tool.KX12/Models/ChatInitiatedChatRequest.cs new file mode 100644 index 00000000..930ccf42 --- /dev/null +++ b/Migration.Tool.KX12/Models/ChatInitiatedChatRequest.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Chat_InitiatedChatRequest")] +[Index("InitiatedChatRequestInitiatorChatUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestInitiatorChatUserID")] +[Index("InitiatedChatRequestUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestUserID")] +[Index("InitiatedChatRequestRoomId", Name = "UQ_Chat_InitiatedChatRequest_RoomID", IsUnique = true)] +[Index("InitiatedChatRequestUserId", "InitiatedChatRequestContactId", Name = "UQ_Chat_InitiatedChatRequest_UserIDContactID", IsUnique = true)] +public class ChatInitiatedChatRequest +{ + [Key] + [Column("InitiatedChatRequestID")] + public int InitiatedChatRequestId { get; set; } + + [Column("InitiatedChatRequestUserID")] + public int? InitiatedChatRequestUserId { get; set; } + + [Column("InitiatedChatRequestContactID")] + public int? InitiatedChatRequestContactId { get; set; } + + [Column("InitiatedChatRequestRoomID")] + public int InitiatedChatRequestRoomId { get; set; } + + public int InitiatedChatRequestState { get; set; } + + [StringLength(100)] + public string InitiatedChatRequestInitiatorName { get; set; } = null!; + + [Column("InitiatedChatRequestInitiatorChatUserID")] + public int InitiatedChatRequestInitiatorChatUserId { get; set; } + + public DateTime InitiatedChatRequestLastModification { get; set; } + + [ForeignKey("InitiatedChatRequestInitiatorChatUserId")] + [InverseProperty("ChatInitiatedChatRequests")] + public virtual ChatUser InitiatedChatRequestInitiatorChatUser { get; set; } = null!; + + [ForeignKey("InitiatedChatRequestRoomId")] + [InverseProperty("ChatInitiatedChatRequest")] + public virtual ChatRoom InitiatedChatRequestRoom { get; set; } = null!; + + [ForeignKey("InitiatedChatRequestUserId")] + [InverseProperty("ChatInitiatedChatRequests")] + public virtual CmsUser? InitiatedChatRequestUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ChatMessage.cs b/Migration.Tool.KX12/Models/ChatMessage.cs new file mode 100644 index 00000000..a9082b8a --- /dev/null +++ b/Migration.Tool.KX12/Models/ChatMessage.cs @@ -0,0 +1,53 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Chat_Message")] +[Index("ChatMessageLastModified", Name = "IX_Chat_Message_ChatMessageLastModified")] +[Index("ChatMessageRecipientId", Name = "IX_Chat_Message_ChatMessageRecipientID")] +[Index("ChatMessageRoomId", Name = "IX_Chat_Message_ChatMessageRoomID")] +[Index("ChatMessageSystemMessageType", Name = "IX_Chat_Message_ChatMessageSystemMessageType")] +[Index("ChatMessageUserId", Name = "IX_Chat_Message_ChatMessageUserID")] +public class ChatMessage +{ + [Key] + [Column("ChatMessageID")] + public int ChatMessageId { get; set; } + + public DateTime ChatMessageCreatedWhen { get; set; } + + [Column("ChatMessageIPAddress")] + public string ChatMessageIpaddress { get; set; } = null!; + + [Column("ChatMessageUserID")] + public int? ChatMessageUserId { get; set; } + + [Column("ChatMessageRoomID")] + public int ChatMessageRoomId { get; set; } + + public bool ChatMessageRejected { get; set; } + + public DateTime ChatMessageLastModified { get; set; } + + public string ChatMessageText { get; set; } = null!; + + public int ChatMessageSystemMessageType { get; set; } + + [Column("ChatMessageRecipientID")] + public int? ChatMessageRecipientId { get; set; } + + [ForeignKey("ChatMessageRecipientId")] + [InverseProperty("ChatMessageChatMessageRecipients")] + public virtual ChatUser? ChatMessageRecipient { get; set; } + + [ForeignKey("ChatMessageRoomId")] + [InverseProperty("ChatMessages")] + public virtual ChatRoom ChatMessageRoom { get; set; } = null!; + + [ForeignKey("ChatMessageUserId")] + [InverseProperty("ChatMessageChatMessageUsers")] + public virtual ChatUser? ChatMessageUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ChatNotification.cs b/Migration.Tool.KX12/Models/ChatNotification.cs new file mode 100644 index 00000000..7076c1a7 --- /dev/null +++ b/Migration.Tool.KX12/Models/ChatNotification.cs @@ -0,0 +1,54 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Chat_Notification")] +[Index("ChatNotificationReceiverId", Name = "IX_Chat_Notification_ChatNotificationReceiverID")] +[Index("ChatNotificationRoomId", Name = "IX_Chat_Notification_ChatNotificationRoomID")] +[Index("ChatNotificationSenderId", Name = "IX_Chat_Notification_ChatNotificationSenderID")] +[Index("ChatNotificationSiteId", Name = "IX_Chat_Notification_ChatNotificationSiteID")] +public class ChatNotification +{ + [Key] + [Column("ChatNotificationID")] + public int ChatNotificationId { get; set; } + + [Column("ChatNotificationSenderID")] + public int ChatNotificationSenderId { get; set; } + + [Column("ChatNotificationReceiverID")] + public int ChatNotificationReceiverId { get; set; } + + public bool ChatNotificationIsRead { get; set; } + + public int ChatNotificationType { get; set; } + + [Column("ChatNotificationRoomID")] + public int? ChatNotificationRoomId { get; set; } + + public DateTime ChatNotificationSendDateTime { get; set; } + + public DateTime? ChatNotificationReadDateTime { get; set; } + + [Column("ChatNotificationSiteID")] + public int? ChatNotificationSiteId { get; set; } + + [ForeignKey("ChatNotificationReceiverId")] + [InverseProperty("ChatNotificationChatNotificationReceivers")] + public virtual ChatUser ChatNotificationReceiver { get; set; } = null!; + + [ForeignKey("ChatNotificationRoomId")] + [InverseProperty("ChatNotifications")] + public virtual ChatRoom? ChatNotificationRoom { get; set; } + + [ForeignKey("ChatNotificationSenderId")] + [InverseProperty("ChatNotificationChatNotificationSenders")] + public virtual ChatUser ChatNotificationSender { get; set; } = null!; + + [ForeignKey("ChatNotificationSiteId")] + [InverseProperty("ChatNotifications")] + public virtual CmsSite? ChatNotificationSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ChatOnlineSupport.cs b/Migration.Tool.KX12/Models/ChatOnlineSupport.cs new file mode 100644 index 00000000..3f95eceb --- /dev/null +++ b/Migration.Tool.KX12/Models/ChatOnlineSupport.cs @@ -0,0 +1,36 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Chat_OnlineSupport")] +[Index("ChatOnlineSupportChatUserId", Name = "IX_Chat_OnlineSupport_ChatOnlineSupportChatUserID")] +[Index("ChatOnlineSupportSiteId", Name = "IX_Chat_OnlineSupport_SiteID")] +[Index("ChatOnlineSupportChatUserId", "ChatOnlineSupportSiteId", Name = "UQ_Chat_OnlineSupport_ChatUserID-SiteID", IsUnique = true)] +public class ChatOnlineSupport +{ + [Key] + [Column("ChatOnlineSupportID")] + public int ChatOnlineSupportId { get; set; } + + [Column("ChatOnlineSupportChatUserID")] + public int ChatOnlineSupportChatUserId { get; set; } + + public DateTime ChatOnlineSupportLastChecking { get; set; } + + [Column("ChatOnlineSupportSiteID")] + public int ChatOnlineSupportSiteId { get; set; } + + [StringLength(50)] + public string? ChatOnlineSupportToken { get; set; } + + [ForeignKey("ChatOnlineSupportChatUserId")] + [InverseProperty("ChatOnlineSupports")] + public virtual ChatUser ChatOnlineSupportChatUser { get; set; } = null!; + + [ForeignKey("ChatOnlineSupportSiteId")] + [InverseProperty("ChatOnlineSupports")] + public virtual CmsSite ChatOnlineSupportSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ChatOnlineUser.cs b/Migration.Tool.KX12/Models/ChatOnlineUser.cs new file mode 100644 index 00000000..90b6b6a4 --- /dev/null +++ b/Migration.Tool.KX12/Models/ChatOnlineUser.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Chat_OnlineUser")] +[Index("ChatOnlineUserChatUserId", Name = "IX_Chat_OnlineUser_ChatOnlineUserChatUserID")] +[Index("ChatOnlineUserSiteId", Name = "IX_Chat_OnlineUser_SiteID")] +[Index("ChatOnlineUserChatUserId", "ChatOnlineUserSiteId", Name = "UQ_Chat_OnlineUser_SiteID-ChatUserID", IsUnique = true)] +public class ChatOnlineUser +{ + [Key] + [Column("ChatOnlineUserID")] + public int ChatOnlineUserId { get; set; } + + [Column("ChatOnlineUserSiteID")] + public int ChatOnlineUserSiteId { get; set; } + + public DateTime? ChatOnlineUserLastChecking { get; set; } + + [Column("ChatOnlineUserChatUserID")] + public int ChatOnlineUserChatUserId { get; set; } + + public DateTime? ChatOnlineUserJoinTime { get; set; } + + public DateTime? ChatOnlineUserLeaveTime { get; set; } + + [StringLength(50)] + public string? ChatOnlineUserToken { get; set; } + + public bool ChatOnlineUserIsHidden { get; set; } + + [ForeignKey("ChatOnlineUserChatUserId")] + [InverseProperty("ChatOnlineUsers")] + public virtual ChatUser ChatOnlineUserChatUser { get; set; } = null!; + + [ForeignKey("ChatOnlineUserSiteId")] + [InverseProperty("ChatOnlineUsers")] + public virtual CmsSite ChatOnlineUserSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ChatPopupWindowSetting.cs b/Migration.Tool.KX12/Models/ChatPopupWindowSetting.cs new file mode 100644 index 00000000..42cbccf6 --- /dev/null +++ b/Migration.Tool.KX12/Models/ChatPopupWindowSetting.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("Chat_PopupWindowSettings")] +public class ChatPopupWindowSetting +{ + [Key] + [Column("ChatPopupWindowSettingsID")] + public int ChatPopupWindowSettingsId { get; set; } + + [StringLength(255)] + public string MessageTransformationName { get; set; } = null!; + + [StringLength(255)] + public string ErrorTransformationName { get; set; } = null!; + + [StringLength(255)] + public string ErrorClearTransformationName { get; set; } = null!; + + [StringLength(255)] + public string UserTransformationName { get; set; } = null!; + + public int ChatPopupWindowSettingsHashCode { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ChatRoom.cs b/Migration.Tool.KX12/Models/ChatRoom.cs new file mode 100644 index 00000000..063412ef --- /dev/null +++ b/Migration.Tool.KX12/Models/ChatRoom.cs @@ -0,0 +1,80 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Chat_Room")] +[Index("ChatRoomCreatedByChatUserId", Name = "IX_Chat_Room_ChatRoomCreatedByChatUserID")] +[Index("ChatRoomEnabled", Name = "IX_Chat_Room_Enabled")] +[Index("ChatRoomIsSupport", Name = "IX_Chat_Room_IsSupport")] +[Index("ChatRoomSiteId", Name = "IX_Chat_Room_SiteID")] +public class ChatRoom +{ + [Key] + [Column("ChatRoomID")] + public int ChatRoomId { get; set; } + + [StringLength(100)] + public string ChatRoomName { get; set; } = null!; + + [StringLength(100)] + public string ChatRoomDisplayName { get; set; } = null!; + + [Column("ChatRoomSiteID")] + public int? ChatRoomSiteId { get; set; } + + public bool ChatRoomEnabled { get; set; } + + public bool ChatRoomPrivate { get; set; } + + public bool ChatRoomAllowAnonym { get; set; } + + public DateTime ChatRoomCreatedWhen { get; set; } + + [StringLength(100)] + public string? ChatRoomPassword { get; set; } + + [Column("ChatRoomCreatedByChatUserID")] + public int? ChatRoomCreatedByChatUserId { get; set; } + + public bool ChatRoomIsSupport { get; set; } + + public bool ChatRoomIsOneToOne { get; set; } + + [StringLength(500)] + public string? ChatRoomDescription { get; set; } + + public DateTime ChatRoomLastModification { get; set; } + + public DateTime? ChatRoomScheduledToDelete { get; set; } + + public DateTime ChatRoomPrivateStateLastModification { get; set; } + + [Column("ChatRoomGUID")] + public Guid ChatRoomGuid { get; set; } + + [InverseProperty("InitiatedChatRequestRoom")] + public virtual ChatInitiatedChatRequest? ChatInitiatedChatRequest { get; set; } + + [InverseProperty("ChatMessageRoom")] + public virtual ICollection ChatMessages { get; set; } = new List(); + + [InverseProperty("ChatNotificationRoom")] + public virtual ICollection ChatNotifications { get; set; } = new List(); + + [ForeignKey("ChatRoomCreatedByChatUserId")] + [InverseProperty("ChatRooms")] + public virtual ChatUser? ChatRoomCreatedByChatUser { get; set; } + + [ForeignKey("ChatRoomSiteId")] + [InverseProperty("ChatRooms")] + public virtual CmsSite? ChatRoomSite { get; set; } + + [InverseProperty("ChatRoomUserRoom")] + public virtual ICollection ChatRoomUsers { get; set; } = new List(); + + [InverseProperty("ChatSupportTakenRoomRoom")] + public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/ChatRoomUser.cs b/Migration.Tool.KX12/Models/ChatRoomUser.cs new file mode 100644 index 00000000..58d2182c --- /dev/null +++ b/Migration.Tool.KX12/Models/ChatRoomUser.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Chat_RoomUser")] +[Index("ChatRoomUserChatUserId", Name = "IX_Chat_RoomUser_ChatRoomUserChatUserID")] +[Index("ChatRoomUserRoomId", Name = "IX_Chat_RoomUser_ChatRoomUserRoomID")] +[Index("ChatRoomUserRoomId", "ChatRoomUserChatUserId", Name = "UQ_Chat_RoomUser_RoomID-ChatUserID", IsUnique = true)] +public class ChatRoomUser +{ + [Key] + [Column("ChatRoomUserID")] + public int ChatRoomUserId { get; set; } + + [Column("ChatRoomUserRoomID")] + public int ChatRoomUserRoomId { get; set; } + + [Column("ChatRoomUserChatUserID")] + public int ChatRoomUserChatUserId { get; set; } + + public DateTime? ChatRoomUserLastChecking { get; set; } + + public DateTime? ChatRoomUserKickExpiration { get; set; } + + public DateTime? ChatRoomUserJoinTime { get; set; } + + public DateTime? ChatRoomUserLeaveTime { get; set; } + + public int ChatRoomUserAdminLevel { get; set; } + + public DateTime ChatRoomUserLastModification { get; set; } + + [ForeignKey("ChatRoomUserChatUserId")] + [InverseProperty("ChatRoomUsers")] + public virtual ChatUser ChatRoomUserChatUser { get; set; } = null!; + + [ForeignKey("ChatRoomUserRoomId")] + [InverseProperty("ChatRoomUsers")] + public virtual ChatRoom ChatRoomUserRoom { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ChatSupportCannedResponse.cs b/Migration.Tool.KX12/Models/ChatSupportCannedResponse.cs new file mode 100644 index 00000000..fd3885e1 --- /dev/null +++ b/Migration.Tool.KX12/Models/ChatSupportCannedResponse.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Chat_SupportCannedResponse")] +[Index("ChatSupportCannedResponseChatUserId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseChatUserID")] +[Index("ChatSupportCannedResponseSiteId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseSiteID")] +public class ChatSupportCannedResponse +{ + [Key] + [Column("ChatSupportCannedResponseID")] + public int ChatSupportCannedResponseId { get; set; } + + [Column("ChatSupportCannedResponseChatUserID")] + public int? ChatSupportCannedResponseChatUserId { get; set; } + + [StringLength(500)] + public string ChatSupportCannedResponseText { get; set; } = null!; + + [StringLength(50)] + public string ChatSupportCannedResponseTagName { get; set; } = null!; + + [Column("ChatSupportCannedResponseSiteID")] + public int? ChatSupportCannedResponseSiteId { get; set; } + + [StringLength(100)] + public string ChatSupportCannedResponseName { get; set; } = null!; + + [ForeignKey("ChatSupportCannedResponseChatUserId")] + [InverseProperty("ChatSupportCannedResponses")] + public virtual ChatUser? ChatSupportCannedResponseChatUser { get; set; } + + [ForeignKey("ChatSupportCannedResponseSiteId")] + [InverseProperty("ChatSupportCannedResponses")] + public virtual CmsSite? ChatSupportCannedResponseSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ChatSupportTakenRoom.cs b/Migration.Tool.KX12/Models/ChatSupportTakenRoom.cs new file mode 100644 index 00000000..8d6cf991 --- /dev/null +++ b/Migration.Tool.KX12/Models/ChatSupportTakenRoom.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Chat_SupportTakenRoom")] +[Index("ChatSupportTakenRoomChatUserId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomChatUserID")] +[Index("ChatSupportTakenRoomRoomId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomRoomID")] +public class ChatSupportTakenRoom +{ + [Key] + [Column("ChatSupportTakenRoomID")] + public int ChatSupportTakenRoomId { get; set; } + + [Column("ChatSupportTakenRoomChatUserID")] + public int? ChatSupportTakenRoomChatUserId { get; set; } + + [Column("ChatSupportTakenRoomRoomID")] + public int ChatSupportTakenRoomRoomId { get; set; } + + public DateTime? ChatSupportTakenRoomResolvedDateTime { get; set; } + + public DateTime ChatSupportTakenRoomLastModification { get; set; } + + [ForeignKey("ChatSupportTakenRoomChatUserId")] + [InverseProperty("ChatSupportTakenRooms")] + public virtual ChatUser? ChatSupportTakenRoomChatUser { get; set; } + + [ForeignKey("ChatSupportTakenRoomRoomId")] + [InverseProperty("ChatSupportTakenRooms")] + public virtual ChatRoom ChatSupportTakenRoomRoom { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ChatUser.cs b/Migration.Tool.KX12/Models/ChatUser.cs new file mode 100644 index 00000000..0f5d992c --- /dev/null +++ b/Migration.Tool.KX12/Models/ChatUser.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Chat_User")] +[Index("ChatUserUserId", Name = "IX_Chat_User_UserID")] +public class ChatUser +{ + [Key] + [Column("ChatUserID")] + public int ChatUserId { get; set; } + + [Column("ChatUserUserID")] + public int? ChatUserUserId { get; set; } + + [StringLength(50)] + public string ChatUserNickname { get; set; } = null!; + + public DateTime ChatUserLastModification { get; set; } + + [InverseProperty("InitiatedChatRequestInitiatorChatUser")] + public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); + + [InverseProperty("ChatMessageRecipient")] + public virtual ICollection ChatMessageChatMessageRecipients { get; set; } = new List(); + + [InverseProperty("ChatMessageUser")] + public virtual ICollection ChatMessageChatMessageUsers { get; set; } = new List(); + + [InverseProperty("ChatNotificationReceiver")] + public virtual ICollection ChatNotificationChatNotificationReceivers { get; set; } = new List(); + + [InverseProperty("ChatNotificationSender")] + public virtual ICollection ChatNotificationChatNotificationSenders { get; set; } = new List(); + + [InverseProperty("ChatOnlineSupportChatUser")] + public virtual ICollection ChatOnlineSupports { get; set; } = new List(); + + [InverseProperty("ChatOnlineUserChatUser")] + public virtual ICollection ChatOnlineUsers { get; set; } = new List(); + + [InverseProperty("ChatRoomUserChatUser")] + public virtual ICollection ChatRoomUsers { get; set; } = new List(); + + [InverseProperty("ChatRoomCreatedByChatUser")] + public virtual ICollection ChatRooms { get; set; } = new List(); + + [InverseProperty("ChatSupportCannedResponseChatUser")] + public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); + + [InverseProperty("ChatSupportTakenRoomChatUser")] + public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); + + [ForeignKey("ChatUserUserId")] + [InverseProperty("ChatUsers")] + public virtual CmsUser? ChatUserUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CiFileMetadatum.cs b/Migration.Tool.KX12/Models/CiFileMetadatum.cs new file mode 100644 index 00000000..d8b55535 --- /dev/null +++ b/Migration.Tool.KX12/Models/CiFileMetadatum.cs @@ -0,0 +1,21 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CI_FileMetadata")] +[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] +public class CiFileMetadatum +{ + [Key] + [Column("FileMetadataID")] + public int FileMetadataId { get; set; } + + [StringLength(260)] + public string FileLocation { get; set; } = null!; + + [StringLength(32)] + public string FileHash { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CiMigration.cs b/Migration.Tool.KX12/Models/CiMigration.cs new file mode 100644 index 00000000..d1a62c8e --- /dev/null +++ b/Migration.Tool.KX12/Models/CiMigration.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CI_Migration")] +[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] +public class CiMigration +{ + [Key] + [Column("MigrationID")] + public int MigrationId { get; set; } + + [StringLength(255)] + public string MigrationName { get; set; } = null!; + + [Precision(3)] + public DateTime DateApplied { get; set; } + + public int? RowsAffected { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsAbuseReport.cs b/Migration.Tool.KX12/Models/CmsAbuseReport.cs new file mode 100644 index 00000000..d5988408 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsAbuseReport.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_AbuseReport")] +[Index("ReportSiteId", Name = "IX_CMS_AbuseReport_ReportSiteID")] +[Index("ReportStatus", Name = "IX_CMS_AbuseReport_ReportStatus")] +[Index("ReportUserId", Name = "IX_CMS_AbuseReport_ReportUserID")] +public class CmsAbuseReport +{ + [Key] + [Column("ReportID")] + public int ReportId { get; set; } + + [Column("ReportGUID")] + public Guid ReportGuid { get; set; } + + [StringLength(100)] + public string? ReportTitle { get; set; } + + [Column("ReportURL")] + [StringLength(1000)] + public string ReportUrl { get; set; } = null!; + + [StringLength(50)] + public string ReportCulture { get; set; } = null!; + + [Column("ReportObjectID")] + public int? ReportObjectId { get; set; } + + [StringLength(100)] + public string? ReportObjectType { get; set; } + + public string ReportComment { get; set; } = null!; + + [Column("ReportUserID")] + public int? ReportUserId { get; set; } + + public DateTime ReportWhen { get; set; } + + public int ReportStatus { get; set; } + + [Column("ReportSiteID")] + public int ReportSiteId { get; set; } + + [ForeignKey("ReportSiteId")] + [InverseProperty("CmsAbuseReports")] + public virtual CmsSite ReportSite { get; set; } = null!; + + [ForeignKey("ReportUserId")] + [InverseProperty("CmsAbuseReports")] + public virtual CmsUser? ReportUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsAcl.cs b/Migration.Tool.KX12/Models/CmsAcl.cs new file mode 100644 index 00000000..adcf10ae --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsAcl.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_ACL")] +[Index("AclinheritedAcls", Name = "IX_CMS_ACL_ACLInheritedACLs")] +[Index("AclsiteId", Name = "IX_CMS_ACL_ACLSiteID")] +public class CmsAcl +{ + [Key] + [Column("ACLID")] + public int Aclid { get; set; } + + [Column("ACLInheritedACLs")] + public string AclinheritedAcls { get; set; } = null!; + + [Column("ACLGUID")] + public Guid Aclguid { get; set; } + + [Column("ACLLastModified")] + public DateTime AcllastModified { get; set; } + + [Column("ACLSiteID")] + public int? AclsiteId { get; set; } + + [ForeignKey("AclsiteId")] + [InverseProperty("CmsAcls")] + public virtual CmsSite? Aclsite { get; set; } + + [InverseProperty("Acl")] + public virtual ICollection CmsAclitems { get; set; } = new List(); + + [InverseProperty("NodeAcl")] + public virtual ICollection CmsTrees { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsAclitem.cs b/Migration.Tool.KX12/Models/CmsAclitem.cs new file mode 100644 index 00000000..a486424c --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsAclitem.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_ACLItem")] +[Index("Aclid", Name = "IX_CMS_ACLItem_ACLID")] +[Index("LastModifiedByUserId", Name = "IX_CMS_ACLItem_LastModifiedByUserID")] +[Index("RoleId", Name = "IX_CMS_ACLItem_RoleID")] +[Index("UserId", Name = "IX_CMS_ACLItem_UserID")] +public class CmsAclitem +{ + [Key] + [Column("ACLItemID")] + public int AclitemId { get; set; } + + [Column("ACLID")] + public int Aclid { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [Column("RoleID")] + public int? RoleId { get; set; } + + public int Allowed { get; set; } + + public int Denied { get; set; } + + public DateTime LastModified { get; set; } + + [Column("LastModifiedByUserID")] + public int? LastModifiedByUserId { get; set; } + + [Column("ACLItemGUID")] + public Guid AclitemGuid { get; set; } + + [ForeignKey("Aclid")] + [InverseProperty("CmsAclitems")] + public virtual CmsAcl Acl { get; set; } = null!; + + [ForeignKey("LastModifiedByUserId")] + [InverseProperty("CmsAclitemLastModifiedByUsers")] + public virtual CmsUser? LastModifiedByUser { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsAclitems")] + public virtual CmsRole? Role { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsAclitemUsers")] + public virtual CmsUser? User { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsAlternativeForm.cs b/Migration.Tool.KX12/Models/CmsAlternativeForm.cs new file mode 100644 index 00000000..3be726a0 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsAlternativeForm.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_AlternativeForm")] +[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] +[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] +public class CmsAlternativeForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(50)] + public string FormName { get; set; } = null!; + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public string? FormDefinition { get; set; } + + public string? FormLayout { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + [Column("FormCoupledClassID")] + public int? FormCoupledClassId { get; set; } + + public bool? FormHideNewParentFields { get; set; } + + [StringLength(50)] + public string? FormLayoutType { get; set; } + + [Column("FormVersionGUID")] + [StringLength(50)] + public string? FormVersionGuid { get; set; } + + [StringLength(400)] + public string? FormCustomizedColumns { get; set; } + + public bool? FormIsCustom { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsAlternativeFormFormClasses")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormCoupledClassId")] + [InverseProperty("CmsAlternativeFormFormCoupledClasses")] + public virtual CmsClass? FormCoupledClass { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsAlternativeUrl.cs b/Migration.Tool.KX12/Models/CmsAlternativeUrl.cs new file mode 100644 index 00000000..099048ef --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsAlternativeUrl.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_AlternativeUrl")] +[Index("AlternativeUrlDocumentId", Name = "IX_CMS_AlternativeUrl_AlternativeUrlDocumentID")] +[Index("AlternativeUrlSiteId", "AlternativeUrlUrl", Name = "IX_CMS_AlternativeUrl_AlternativeUrlSiteID_AlternativeUrlUrl", IsUnique = true)] +public class CmsAlternativeUrl +{ + [Key] + [Column("AlternativeUrlID")] + public int AlternativeUrlId { get; set; } + + [Column("AlternativeUrlGUID")] + public Guid AlternativeUrlGuid { get; set; } + + [Column("AlternativeUrlDocumentID")] + public int AlternativeUrlDocumentId { get; set; } + + [Column("AlternativeUrlSiteID")] + public int AlternativeUrlSiteId { get; set; } + + public string AlternativeUrlUrl { get; set; } = null!; + + public DateTime AlternativeUrlLastModified { get; set; } + + [ForeignKey("AlternativeUrlDocumentId")] + [InverseProperty("CmsAlternativeUrls")] + public virtual CmsDocument AlternativeUrlDocument { get; set; } = null!; + + [ForeignKey("AlternativeUrlSiteId")] + [InverseProperty("CmsAlternativeUrls")] + public virtual CmsSite AlternativeUrlSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsAttachment.cs b/Migration.Tool.KX12/Models/CmsAttachment.cs new file mode 100644 index 00000000..51f5ba7a --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsAttachment.cs @@ -0,0 +1,90 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Attachment")] +[Index("AttachmentDocumentId", Name = "IX_CMS_Attachment_AttachmentDocumentID")] +[Index("AttachmentGuid", "AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentGUID_AttachmentSiteID")] +[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentFormGuid", "AttachmentOrder", Name = "IX_CMS_Attachment_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentFormGUID_AttachmentOrder")] +[Index("AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentSiteID")] +[Index("AttachmentVariantParentId", Name = "IX_CMS_Attachment_AttachmentVariantParentID")] +public class CmsAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + public int? AttachmentImageWidth { get; set; } + + public int? AttachmentImageHeight { get; set; } + + [Column("AttachmentDocumentID")] + public int? AttachmentDocumentId { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + public bool? AttachmentIsUnsorted { get; set; } + + public int? AttachmentOrder { get; set; } + + [Column("AttachmentGroupGUID")] + public Guid? AttachmentGroupGuid { get; set; } + + [Column("AttachmentFormGUID")] + public Guid? AttachmentFormGuid { get; set; } + + [StringLength(32)] + public string? AttachmentHash { get; set; } + + [StringLength(250)] + public string? AttachmentTitle { get; set; } + + public string? AttachmentDescription { get; set; } + + public string? AttachmentCustomData { get; set; } + + public string? AttachmentSearchContent { get; set; } + + [StringLength(50)] + public string? AttachmentVariantDefinitionIdentifier { get; set; } + + [Column("AttachmentVariantParentID")] + public int? AttachmentVariantParentId { get; set; } + + [ForeignKey("AttachmentDocumentId")] + [InverseProperty("CmsAttachments")] + public virtual CmsDocument? AttachmentDocument { get; set; } + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("CmsAttachments")] + public virtual CmsSite AttachmentSite { get; set; } = null!; + + [ForeignKey("AttachmentVariantParentId")] + [InverseProperty("InverseAttachmentVariantParent")] + public virtual CmsAttachment? AttachmentVariantParent { get; set; } + + [InverseProperty("AttachmentVariantParent")] + public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsAttachmentHistory.cs b/Migration.Tool.KX12/Models/CmsAttachmentHistory.cs new file mode 100644 index 00000000..237992e2 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsAttachmentHistory.cs @@ -0,0 +1,89 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_AttachmentHistory")] +[Index("AttachmentGuid", Name = "IX_CMS_AttachmentHistory_AttachmentGUID")] +[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentOrder", Name = "IX_CMS_AttachmentHistory_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentOrder")] +[Index("AttachmentSiteId", Name = "IX_CMS_AttachmentHistory_AttachmentSiteID")] +[Index("AttachmentVariantParentId", Name = "IX_CMS_AttachmentHistory_AttachmentVariantParentID")] +public class CmsAttachmentHistory +{ + [Key] + [Column("AttachmentHistoryID")] + public int AttachmentHistoryId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + public int? AttachmentImageWidth { get; set; } + + public int? AttachmentImageHeight { get; set; } + + [Column("AttachmentDocumentID")] + public int AttachmentDocumentId { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public bool? AttachmentIsUnsorted { get; set; } + + public int? AttachmentOrder { get; set; } + + [Column("AttachmentGroupGUID")] + public Guid? AttachmentGroupGuid { get; set; } + + [StringLength(32)] + public string? AttachmentHash { get; set; } + + [StringLength(250)] + public string? AttachmentTitle { get; set; } + + public string? AttachmentDescription { get; set; } + + public string? AttachmentCustomData { get; set; } + + public DateTime? AttachmentLastModified { get; set; } + + [Column("AttachmentHistoryGUID")] + public Guid AttachmentHistoryGuid { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + public string? AttachmentSearchContent { get; set; } + + [StringLength(50)] + public string? AttachmentVariantDefinitionIdentifier { get; set; } + + [Column("AttachmentVariantParentID")] + public int? AttachmentVariantParentId { get; set; } + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("CmsAttachmentHistories")] + public virtual CmsSite AttachmentSite { get; set; } = null!; + + [ForeignKey("AttachmentVariantParentId")] + [InverseProperty("InverseAttachmentVariantParent")] + public virtual CmsAttachmentHistory? AttachmentVariantParent { get; set; } + + [InverseProperty("AttachmentVariantParent")] + public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); + + [ForeignKey("AttachmentHistoryId")] + [InverseProperty("AttachmentHistories")] + public virtual ICollection VersionHistories { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsAutomationHistory.cs b/Migration.Tool.KX12/Models/CmsAutomationHistory.cs new file mode 100644 index 00000000..ebcfd3d1 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsAutomationHistory.cs @@ -0,0 +1,81 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_AutomationHistory")] +[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] +[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] +[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] +[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] +[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] +[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] +public class CmsAutomationHistory +{ + [Key] + [Column("HistoryID")] + public int HistoryId { get; set; } + + [Column("HistoryStepID")] + public int? HistoryStepId { get; set; } + + [StringLength(440)] + public string? HistoryStepName { get; set; } + + [StringLength(450)] + public string HistoryStepDisplayName { get; set; } = null!; + + public int? HistoryStepType { get; set; } + + [Column("HistoryTargetStepID")] + public int? HistoryTargetStepId { get; set; } + + [StringLength(440)] + public string? HistoryTargetStepName { get; set; } + + [StringLength(450)] + public string? HistoryTargetStepDisplayName { get; set; } + + public int? HistoryTargetStepType { get; set; } + + [Column("HistoryApprovedByUserID")] + public int? HistoryApprovedByUserId { get; set; } + + public DateTime? HistoryApprovedWhen { get; set; } + + public string? HistoryComment { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + public bool HistoryWasRejected { get; set; } + + [Column("HistoryStateID")] + public int HistoryStateId { get; set; } + + [ForeignKey("HistoryApprovedByUserId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsUser? HistoryApprovedByUser { get; set; } + + [ForeignKey("HistoryStateId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsAutomationState HistoryState { get; set; } = null!; + + [ForeignKey("HistoryStepId")] + [InverseProperty("CmsAutomationHistoryHistorySteps")] + public virtual CmsWorkflowStep? HistoryStep { get; set; } + + [ForeignKey("HistoryTargetStepId")] + [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] + public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsAutomationState.cs b/Migration.Tool.KX12/Models/CmsAutomationState.cs new file mode 100644 index 00000000..0e489a6a --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsAutomationState.cs @@ -0,0 +1,70 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_AutomationState")] +[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] +[Index("StateSiteId", Name = "IX_CMS_AutomationState_StateSiteID")] +[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] +[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] +[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] +public class CmsAutomationState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [Column("StateStepID")] + public int StateStepId { get; set; } + + [Column("StateObjectID")] + public int StateObjectId { get; set; } + + [StringLength(100)] + public string StateObjectType { get; set; } = null!; + + [StringLength(450)] + public string? StateActionStatus { get; set; } + + public DateTime? StateCreated { get; set; } + + public DateTime? StateLastModified { get; set; } + + [Column("StateWorkflowID")] + public int StateWorkflowId { get; set; } + + public int? StateStatus { get; set; } + + [Column("StateSiteID")] + public int? StateSiteId { get; set; } + + [Column("StateUserID")] + public int? StateUserId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public string? StateCustomData { get; set; } + + [InverseProperty("HistoryState")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [ForeignKey("StateSiteId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsSite? StateSite { get; set; } + + [ForeignKey("StateStepId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflowStep StateStep { get; set; } = null!; + + [ForeignKey("StateUserId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsUser? StateUser { get; set; } + + [ForeignKey("StateWorkflowId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflow StateWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsAvatar.cs b/Migration.Tool.KX12/Models/CmsAvatar.cs new file mode 100644 index 00000000..91b7ab27 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsAvatar.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Avatar")] +[Index("AvatarGuid", Name = "IX_CMS_Avatar_AvatarGUID")] +[Index("AvatarType", "AvatarIsCustom", Name = "IX_CMS_Avatar_AvatarType_AvatarIsCustom")] +public class CmsAvatar +{ + [Key] + [Column("AvatarID")] + public int AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarName { get; set; } + + [StringLength(200)] + public string AvatarFileName { get; set; } = null!; + + [StringLength(10)] + public string AvatarFileExtension { get; set; } = null!; + + public byte[]? AvatarBinary { get; set; } + + [StringLength(50)] + public string AvatarType { get; set; } = null!; + + public bool AvatarIsCustom { get; set; } + + [Column("AvatarGUID")] + public Guid AvatarGuid { get; set; } + + public DateTime AvatarLastModified { get; set; } + + [StringLength(100)] + public string AvatarMimeType { get; set; } = null!; + + public int AvatarFileSize { get; set; } + + public int? AvatarImageHeight { get; set; } + + public int? AvatarImageWidth { get; set; } + + public bool? DefaultMaleUserAvatar { get; set; } + + public bool? DefaultFemaleUserAvatar { get; set; } + + public bool? DefaultGroupAvatar { get; set; } + + public bool? DefaultUserAvatar { get; set; } + + [InverseProperty("UserAvatar")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); + + [InverseProperty("GroupAvatar")] + public virtual ICollection CommunityGroups { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsBadge.cs b/Migration.Tool.KX12/Models/CmsBadge.cs new file mode 100644 index 00000000..695e59a1 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsBadge.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Badge")] +public class CmsBadge +{ + [Key] + [Column("BadgeID")] + public int BadgeId { get; set; } + + [StringLength(100)] + public string BadgeName { get; set; } = null!; + + [StringLength(200)] + public string BadgeDisplayName { get; set; } = null!; + + [Column("BadgeImageURL")] + [StringLength(200)] + public string? BadgeImageUrl { get; set; } + + public bool BadgeIsAutomatic { get; set; } + + public int? BadgeTopLimit { get; set; } + + [Column("BadgeGUID")] + public Guid BadgeGuid { get; set; } + + public DateTime BadgeLastModified { get; set; } + + [InverseProperty("UserBadge")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsBannedIp.cs b/Migration.Tool.KX12/Models/CmsBannedIp.cs new file mode 100644 index 00000000..18805306 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsBannedIp.cs @@ -0,0 +1,53 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_BannedIP")] +[Index("IpaddressSiteId", Name = "IX_CMS_BannedIP_IPAddressSiteID")] +public class CmsBannedIp +{ + [Key] + [Column("IPAddressID")] + public int IpaddressId { get; set; } + + [Column("IPAddress")] + [StringLength(100)] + public string Ipaddress { get; set; } = null!; + + [Column("IPAddressRegular")] + [StringLength(200)] + public string IpaddressRegular { get; set; } = null!; + + [Column("IPAddressAllowed")] + public bool IpaddressAllowed { get; set; } + + [Column("IPAddressAllowOverride")] + public bool IpaddressAllowOverride { get; set; } + + [Column("IPAddressBanReason")] + [StringLength(450)] + public string? IpaddressBanReason { get; set; } + + [Column("IPAddressBanType")] + [StringLength(100)] + public string IpaddressBanType { get; set; } = null!; + + [Column("IPAddressBanEnabled")] + public bool? IpaddressBanEnabled { get; set; } + + [Column("IPAddressSiteID")] + public int? IpaddressSiteId { get; set; } + + [Column("IPAddressGUID")] + public Guid IpaddressGuid { get; set; } + + [Column("IPAddressLastModified")] + public DateTime IpaddressLastModified { get; set; } + + [ForeignKey("IpaddressSiteId")] + [InverseProperty("CmsBannedIps")] + public virtual CmsSite? IpaddressSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsBanner.cs b/Migration.Tool.KX12/Models/CmsBanner.cs new file mode 100644 index 00000000..072fffd1 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsBanner.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Banner")] +[Index("BannerCategoryId", Name = "IX_CMS_Banner_BannerCategoryID")] +[Index("BannerSiteId", Name = "IX_CMS_Banner_BannerSiteID")] +public class CmsBanner +{ + [Key] + [Column("BannerID")] + public int BannerId { get; set; } + + [StringLength(256)] + public string BannerName { get; set; } = null!; + + [StringLength(256)] + public string BannerDisplayName { get; set; } = null!; + + [Column("BannerCategoryID")] + public int BannerCategoryId { get; set; } + + [Required] + public bool? BannerEnabled { get; set; } + + public DateTime? BannerFrom { get; set; } + + public DateTime? BannerTo { get; set; } + + public Guid BannerGuid { get; set; } + + public DateTime BannerLastModified { get; set; } + + public int BannerType { get; set; } + + [Column("BannerURL")] + [StringLength(2083)] + public string BannerUrl { get; set; } = null!; + + public bool BannerBlank { get; set; } + + public double BannerWeight { get; set; } + + public int? BannerHitsLeft { get; set; } + + public int? BannerClicksLeft { get; set; } + + [Column("BannerSiteID")] + public int? BannerSiteId { get; set; } + + public string BannerContent { get; set; } = null!; + + [ForeignKey("BannerCategoryId")] + [InverseProperty("CmsBanners")] + public virtual CmsBannerCategory BannerCategory { get; set; } = null!; + + [ForeignKey("BannerSiteId")] + [InverseProperty("CmsBanners")] + public virtual CmsSite? BannerSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsBannerCategory.cs b/Migration.Tool.KX12/Models/CmsBannerCategory.cs new file mode 100644 index 00000000..e747c005 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsBannerCategory.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_BannerCategory")] +[Index("BannerCategoryName", "BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategoryName_BannerCategorySiteID", IsUnique = true)] +[Index("BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategorySiteID")] +public class CmsBannerCategory +{ + [Key] + [Column("BannerCategoryID")] + public int BannerCategoryId { get; set; } + + [StringLength(100)] + public string BannerCategoryName { get; set; } = null!; + + [StringLength(200)] + public string BannerCategoryDisplayName { get; set; } = null!; + + [Column("BannerCategorySiteID")] + public int? BannerCategorySiteId { get; set; } + + public Guid BannerCategoryGuid { get; set; } + + public DateTime BannerCategoryLastModified { get; set; } + + [Required] + public bool? BannerCategoryEnabled { get; set; } + + [ForeignKey("BannerCategorySiteId")] + [InverseProperty("CmsBannerCategories")] + public virtual CmsSite? BannerCategorySite { get; set; } + + [InverseProperty("BannerCategory")] + public virtual ICollection CmsBanners { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsCategory.cs b/Migration.Tool.KX12/Models/CmsCategory.cs new file mode 100644 index 00000000..569aba8c --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsCategory.cs @@ -0,0 +1,66 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Category")] +[Index("CategorySiteId", Name = "IX_CMS_Category_CategorySiteID")] +[Index("CategoryUserId", Name = "IX_CMS_Category_CategoryUserID")] +public class CmsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(250)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(250)] + public string? CategoryName { get; set; } + + public string? CategoryDescription { get; set; } + + public int? CategoryCount { get; set; } + + [Required] + public bool? CategoryEnabled { get; set; } + + [Column("CategoryUserID")] + public int? CategoryUserId { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + [StringLength(1500)] + public string? CategoryNamePath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryOrder { get; set; } + + [ForeignKey("CategorySiteId")] + [InverseProperty("CmsCategories")] + public virtual CmsSite? CategorySite { get; set; } + + [ForeignKey("CategoryUserId")] + [InverseProperty("CmsCategories")] + public virtual CmsUser? CategoryUser { get; set; } + + [ForeignKey("CategoryId")] + [InverseProperty("Categories")] + public virtual ICollection Documents { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsClass.cs b/Migration.Tool.KX12/Models/CmsClass.cs new file mode 100644 index 00000000..0c0b6cbb --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsClass.cs @@ -0,0 +1,220 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Class")] +[Index("ClassDefaultPageTemplateId", Name = "IX_CMS_Class_ClassDefaultPageTemplateID")] +[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] +[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] +[Index("ClassPageTemplateCategoryId", Name = "IX_CMS_Class_ClassPageTemplateCategoryID")] +[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] +[Index("ClassShowAsSystemTable", "ClassIsCustomTable", "ClassIsCoupledClass", "ClassIsDocumentType", Name = "IX_CMS_Class_ClassShowAsSystemTable_ClassIsCustomTable_ClassIsCoupledClass_ClassIsDocumentType")] +public class CmsClass +{ + [Key] + [Column("ClassID")] + public int ClassId { get; set; } + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + public bool ClassUsesVersioning { get; set; } + + public bool ClassIsDocumentType { get; set; } + + public bool ClassIsCoupledClass { get; set; } + + public string ClassXmlSchema { get; set; } = null!; + + public string ClassFormDefinition { get; set; } = null!; + + [StringLength(450)] + public string? ClassEditingPageUrl { get; set; } + + [StringLength(450)] + public string? ClassListPageUrl { get; set; } + + [StringLength(100)] + public string ClassNodeNameSource { get; set; } = null!; + + [StringLength(100)] + public string? ClassTableName { get; set; } + + [StringLength(450)] + public string? ClassViewPageUrl { get; set; } + + [StringLength(450)] + public string? ClassPreviewPageUrl { get; set; } + + public string? ClassFormLayout { get; set; } + + [StringLength(450)] + public string? ClassNewPageUrl { get; set; } + + public bool? ClassShowAsSystemTable { get; set; } + + public bool? ClassUsePublishFromTo { get; set; } + + public bool? ClassShowTemplateSelection { get; set; } + + [Column("ClassSKUMappings")] + public string? ClassSkumappings { get; set; } + + public bool? ClassIsMenuItemType { get; set; } + + [StringLength(100)] + public string? ClassNodeAliasSource { get; set; } + + [Column("ClassDefaultPageTemplateID")] + public int? ClassDefaultPageTemplateId { get; set; } + + public DateTime ClassLastModified { get; set; } + + [Column("ClassGUID")] + public Guid ClassGuid { get; set; } + + [Column("ClassCreateSKU")] + public bool? ClassCreateSku { get; set; } + + public bool? ClassIsProduct { get; set; } + + public bool ClassIsCustomTable { get; set; } + + [StringLength(1000)] + public string? ClassShowColumns { get; set; } + + [StringLength(200)] + public string? ClassSearchTitleColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchContentColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchImageColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchCreationDateColumn { get; set; } + + public string? ClassSearchSettings { get; set; } + + [Column("ClassInheritsFromClassID")] + public int? ClassInheritsFromClassId { get; set; } + + public bool? ClassSearchEnabled { get; set; } + + [Column("ClassSKUDefaultDepartmentName")] + [StringLength(200)] + public string? ClassSkudefaultDepartmentName { get; set; } + + [Column("ClassSKUDefaultDepartmentID")] + public int? ClassSkudefaultDepartmentId { get; set; } + + public string? ClassContactMapping { get; set; } + + public bool? ClassContactOverwriteEnabled { get; set; } + + [Column("ClassSKUDefaultProductType")] + [StringLength(50)] + public string? ClassSkudefaultProductType { get; set; } + + [StringLength(100)] + public string? ClassConnectionString { get; set; } + + public bool? ClassIsProductSection { get; set; } + + [Column("ClassPageTemplateCategoryID")] + public int? ClassPageTemplateCategoryId { get; set; } + + [StringLength(50)] + public string? ClassFormLayoutType { get; set; } + + [Column("ClassVersionGUID")] + [StringLength(50)] + public string? ClassVersionGuid { get; set; } + + [StringLength(100)] + public string? ClassDefaultObjectType { get; set; } + + public bool? ClassIsForm { get; set; } + + [Column("ClassResourceID")] + public int? ClassResourceId { get; set; } + + [StringLength(400)] + public string? ClassCustomizedColumns { get; set; } + + public string? ClassCodeGenerationSettings { get; set; } + + [StringLength(200)] + public string? ClassIconClass { get; set; } + + public bool? ClassIsContentOnly { get; set; } + + [Column("ClassURLPattern")] + [StringLength(200)] + public string? ClassUrlpattern { get; set; } + + [ForeignKey("ClassDefaultPageTemplateId")] + [InverseProperty("CmsClasses")] + public virtual CmsPageTemplate? ClassDefaultPageTemplate { get; set; } + + [ForeignKey("ClassPageTemplateCategoryId")] + [InverseProperty("CmsClasses")] + public virtual CmsPageTemplateCategory? ClassPageTemplateCategory { get; set; } + + [ForeignKey("ClassResourceId")] + [InverseProperty("CmsClasses")] + public virtual CmsResource? ClassResource { get; set; } + + [InverseProperty("FormClass")] + public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); + + [InverseProperty("FormCoupledClass")] + public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); + + [InverseProperty("FormClass")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("PageTemplateScopeClass")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsPermissions { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsQueries { get; set; } = new List(); + + [InverseProperty("TransformationClass")] + public virtual ICollection CmsTransformations { get; set; } = new List(); + + [InverseProperty("NodeClass")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("VersionClass")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("ScopeClass")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [ForeignKey("ParentClassId")] + [InverseProperty("ParentClasses")] + public virtual ICollection ChildClasses { get; set; } = new List(); + + [ForeignKey("ChildClassId")] + [InverseProperty("ChildClasses")] + public virtual ICollection ParentClasses { get; set; } = new List(); + + [ForeignKey("ClassId")] + [InverseProperty("Classes")] + public virtual ICollection Scopes { get; set; } = new List(); + + [ForeignKey("ClassId")] + [InverseProperty("Classes")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsConsent.cs b/Migration.Tool.KX12/Models/CmsConsent.cs new file mode 100644 index 00000000..6b27ad1a --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsConsent.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Consent")] +public class CmsConsent +{ + [Key] + [Column("ConsentID")] + public int ConsentId { get; set; } + + [StringLength(200)] + public string ConsentDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ConsentName { get; set; } = null!; + + public string ConsentContent { get; set; } = null!; + + public Guid ConsentGuid { get; set; } + + public DateTime ConsentLastModified { get; set; } + + [StringLength(100)] + public string ConsentHash { get; set; } = null!; + + [InverseProperty("ConsentAgreementConsent")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [InverseProperty("ConsentArchiveConsent")] + public virtual ICollection CmsConsentArchives { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsConsentAgreement.cs b/Migration.Tool.KX12/Models/CmsConsentAgreement.cs new file mode 100644 index 00000000..32434cc7 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsConsentAgreement.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_ConsentAgreement")] +[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] +public class CmsConsentAgreement +{ + [Key] + [Column("ConsentAgreementID")] + public int ConsentAgreementId { get; set; } + + public Guid ConsentAgreementGuid { get; set; } + + public bool ConsentAgreementRevoked { get; set; } + + [Column("ConsentAgreementContactID")] + public int ConsentAgreementContactId { get; set; } + + [Column("ConsentAgreementConsentID")] + public int ConsentAgreementConsentId { get; set; } + + [StringLength(100)] + public string? ConsentAgreementConsentHash { get; set; } + + public DateTime ConsentAgreementTime { get; set; } + + [ForeignKey("ConsentAgreementConsentId")] + [InverseProperty("CmsConsentAgreements")] + public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; + + [ForeignKey("ConsentAgreementContactId")] + [InverseProperty("CmsConsentAgreements")] + public virtual OmContact ConsentAgreementContact { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsConsentArchive.cs b/Migration.Tool.KX12/Models/CmsConsentArchive.cs new file mode 100644 index 00000000..6e85e56e --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsConsentArchive.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_ConsentArchive")] +[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] +public class CmsConsentArchive +{ + [Key] + [Column("ConsentArchiveID")] + public int ConsentArchiveId { get; set; } + + public Guid ConsentArchiveGuid { get; set; } + + public DateTime ConsentArchiveLastModified { get; set; } + + [Column("ConsentArchiveConsentID")] + public int ConsentArchiveConsentId { get; set; } + + [StringLength(100)] + public string ConsentArchiveHash { get; set; } = null!; + + public string ConsentArchiveContent { get; set; } = null!; + + [ForeignKey("ConsentArchiveConsentId")] + [InverseProperty("CmsConsentArchives")] + public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsCountry.cs b/Migration.Tool.KX12/Models/CmsCountry.cs new file mode 100644 index 00000000..dbf79cbe --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsCountry.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Country")] +public class CmsCountry +{ + [Key] + [Column("CountryID")] + public int CountryId { get; set; } + + [StringLength(200)] + public string CountryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CountryName { get; set; } = null!; + + [Column("CountryGUID")] + public Guid CountryGuid { get; set; } + + public DateTime CountryLastModified { get; set; } + + [StringLength(2)] + public string? CountryTwoLetterCode { get; set; } + + [StringLength(3)] + public string? CountryThreeLetterCode { get; set; } + + [InverseProperty("Country")] + public virtual ICollection CmsStates { get; set; } = new List(); + + [InverseProperty("AddressCountry")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("AddressCountry")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("Country")] + public virtual ICollection ComTaxClassCountries { get; set; } = new List(); + + [InverseProperty("AccountCountry")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactCountry")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsCssStylesheet.cs b/Migration.Tool.KX12/Models/CmsCssStylesheet.cs new file mode 100644 index 00000000..03ec7130 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsCssStylesheet.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_CssStylesheet")] +[Index("StylesheetName", Name = "IX_CMS_CssStylesheet_StylesheetName")] +public class CmsCssStylesheet +{ + [Key] + [Column("StylesheetID")] + public int StylesheetId { get; set; } + + [StringLength(200)] + public string StylesheetDisplayName { get; set; } = null!; + + [StringLength(200)] + public string StylesheetName { get; set; } = null!; + + public string? StylesheetText { get; set; } + + [Column("StylesheetVersionGUID")] + public Guid? StylesheetVersionGuid { get; set; } + + [Column("StylesheetGUID")] + public Guid? StylesheetGuid { get; set; } + + public DateTime StylesheetLastModified { get; set; } + + public string? StylesheetDynamicCode { get; set; } + + [StringLength(200)] + public string? StylesheetDynamicLanguage { get; set; } + + [InverseProperty("DocumentStylesheet")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("SiteDefaultEditorStylesheetNavigation")] + public virtual ICollection CmsSiteSiteDefaultEditorStylesheetNavigations { get; set; } = new List(); + + [InverseProperty("SiteDefaultStylesheet")] + public virtual ICollection CmsSiteSiteDefaultStylesheets { get; set; } = new List(); + + [ForeignKey("StylesheetId")] + [InverseProperty("Stylesheets")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsCulture.cs b/Migration.Tool.KX12/Models/CmsCulture.cs new file mode 100644 index 00000000..4d5e1ae8 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsCulture.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Culture")] +[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] +[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] +public class CmsCulture +{ + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; + + [StringLength(200)] + public string CultureShortName { get; set; } = null!; + + [Column("CultureGUID")] + public Guid CultureGuid { get; set; } + + public DateTime CultureLastModified { get; set; } + + [StringLength(100)] + public string? CultureAlias { get; set; } + + [Column("CultureIsUICulture")] + public bool? CultureIsUiculture { get; set; } + + [InverseProperty("PageTemplateScopeCulture")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("TranslationCulture")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); + + [InverseProperty("Culture")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("ScopeCulture")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [ForeignKey("IndexCultureId")] + [InverseProperty("IndexCultures")] + public virtual ICollection Indices { get; set; } = new List(); + + [ForeignKey("CultureId")] + [InverseProperty("Cultures")] + public virtual ICollection Sites { get; set; } = new List(); + + [ForeignKey("CultureId")] + [InverseProperty("Cultures")] + public virtual ICollection Words { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsDeviceProfile.cs b/Migration.Tool.KX12/Models/CmsDeviceProfile.cs new file mode 100644 index 00000000..1457d38f --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsDeviceProfile.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_DeviceProfile")] +public class CmsDeviceProfile +{ + [Key] + [Column("ProfileID")] + public int ProfileId { get; set; } + + [StringLength(100)] + public string ProfileName { get; set; } = null!; + + [StringLength(200)] + public string ProfileDisplayName { get; set; } = null!; + + public int? ProfileOrder { get; set; } + + public string? ProfileMacro { get; set; } + + public string? ProfileUserAgents { get; set; } + + [Required] + public bool? ProfileEnabled { get; set; } + + public int? ProfilePreviewWidth { get; set; } + + public int? ProfilePreviewHeight { get; set; } + + [Column("ProfileGUID")] + public Guid? ProfileGuid { get; set; } + + public DateTime? ProfileLastModified { get; set; } + + [InverseProperty("DeviceProfile")] + public virtual ICollection CmsDeviceProfileLayouts { get; set; } = new List(); + + [InverseProperty("Profile")] + public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsDeviceProfileLayout.cs b/Migration.Tool.KX12/Models/CmsDeviceProfileLayout.cs new file mode 100644 index 00000000..861f93ae --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsDeviceProfileLayout.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_DeviceProfileLayout")] +[Index("DeviceProfileId", Name = "IX_CMS_DeviceProfileLayout_DeviceProfileID")] +[Index("SourceLayoutId", Name = "IX_CMS_DeviceProfileLayout_SourceLayoutID")] +[Index("TargetLayoutId", Name = "IX_CMS_DeviceProfileLayout_TargetLayoutID")] +public class CmsDeviceProfileLayout +{ + [Key] + [Column("DeviceProfileLayoutID")] + public int DeviceProfileLayoutId { get; set; } + + [Column("DeviceProfileID")] + public int DeviceProfileId { get; set; } + + [Column("SourceLayoutID")] + public int SourceLayoutId { get; set; } + + [Column("TargetLayoutID")] + public int TargetLayoutId { get; set; } + + [Column("DeviceProfileLayoutGUID")] + public Guid DeviceProfileLayoutGuid { get; set; } + + public DateTime DeviceProfileLayoutLastModified { get; set; } + + [ForeignKey("DeviceProfileId")] + [InverseProperty("CmsDeviceProfileLayouts")] + public virtual CmsDeviceProfile DeviceProfile { get; set; } = null!; + + [ForeignKey("SourceLayoutId")] + [InverseProperty("CmsDeviceProfileLayoutSourceLayouts")] + public virtual CmsLayout SourceLayout { get; set; } = null!; + + [ForeignKey("TargetLayoutId")] + [InverseProperty("CmsDeviceProfileLayoutTargetLayouts")] + public virtual CmsLayout TargetLayout { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsDocument.cs b/Migration.Tool.KX12/Models/CmsDocument.cs new file mode 100644 index 00000000..445a79b6 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsDocument.cs @@ -0,0 +1,293 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Document")] +[Index("DocumentCheckedOutByUserId", Name = "IX_CMS_Document_DocumentCheckedOutByUserID")] +[Index("DocumentCheckedOutVersionHistoryId", Name = "IX_CMS_Document_DocumentCheckedOutVersionHistoryID")] +[Index("DocumentCreatedByUserId", Name = "IX_CMS_Document_DocumentCreatedByUserID")] +[Index("DocumentCulture", Name = "IX_CMS_Document_DocumentCulture")] +[Index("DocumentForeignKeyValue", "DocumentId", "DocumentNodeId", Name = "IX_CMS_Document_DocumentForeignKeyValue_DocumentID_DocumentNodeID")] +[Index("DocumentModifiedByUserId", Name = "IX_CMS_Document_DocumentModifiedByUserID")] +[Index("DocumentNodeId", "DocumentId", "DocumentCulture", Name = "IX_CMS_Document_DocumentNodeID_DocumentID_DocumentCulture", IsUnique = true)] +[Index("DocumentPageTemplateId", Name = "IX_CMS_Document_DocumentPageTemplateID")] +[Index("DocumentPublishedVersionHistoryId", Name = "IX_CMS_Document_DocumentPublishedVersionHistoryID")] +[Index("DocumentTagGroupId", Name = "IX_CMS_Document_DocumentTagGroupID")] +[Index("DocumentUrlPath", Name = "IX_CMS_Document_DocumentUrlPath_DocumentID_DocumentNodeID")] +[Index("DocumentWildcardRule", "DocumentPriority", Name = "IX_CMS_Document_DocumentWildcardRule_DocumentPriority")] +[Index("DocumentWorkflowStepId", Name = "IX_CMS_Document_DocumentWorkflowStepID")] +public class CmsDocument +{ + [Key] + [Column("DocumentID")] + public int DocumentId { get; set; } + + [StringLength(100)] + public string DocumentName { get; set; } = null!; + + [StringLength(1500)] + public string? DocumentNamePath { get; set; } + + public DateTime? DocumentModifiedWhen { get; set; } + + [Column("DocumentModifiedByUserID")] + public int? DocumentModifiedByUserId { get; set; } + + public int? DocumentForeignKeyValue { get; set; } + + [Column("DocumentCreatedByUserID")] + public int? DocumentCreatedByUserId { get; set; } + + public DateTime? DocumentCreatedWhen { get; set; } + + [Column("DocumentCheckedOutByUserID")] + public int? DocumentCheckedOutByUserId { get; set; } + + public DateTime? DocumentCheckedOutWhen { get; set; } + + [Column("DocumentCheckedOutVersionHistoryID")] + public int? DocumentCheckedOutVersionHistoryId { get; set; } + + [Column("DocumentPublishedVersionHistoryID")] + public int? DocumentPublishedVersionHistoryId { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + public DateTime? DocumentPublishFrom { get; set; } + + public DateTime? DocumentPublishTo { get; set; } + + public string? DocumentUrlPath { get; set; } + + [StringLength(10)] + public string DocumentCulture { get; set; } = null!; + + [Column("DocumentNodeID")] + public int DocumentNodeId { get; set; } + + public string? DocumentPageTitle { get; set; } + + public string? DocumentPageKeyWords { get; set; } + + public string? DocumentPageDescription { get; set; } + + public bool DocumentShowInSiteMap { get; set; } + + public bool DocumentMenuItemHideInNavigation { get; set; } + + [StringLength(200)] + public string? DocumentMenuCaption { get; set; } + + [StringLength(100)] + public string? DocumentMenuStyle { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImage { get; set; } + + [Column("DocumentPageTemplateID")] + public int? DocumentPageTemplateId { get; set; } + + [StringLength(450)] + public string? DocumentMenuJavascript { get; set; } + + [StringLength(450)] + public string? DocumentMenuRedirectUrl { get; set; } + + public bool? DocumentUseNamePathForUrlPath { get; set; } + + [Column("DocumentStylesheetID")] + public int? DocumentStylesheetId { get; set; } + + public string? DocumentContent { get; set; } + + [StringLength(100)] + public string? DocumentMenuClass { get; set; } + + [StringLength(200)] + public string? DocumentMenuStyleHighlighted { get; set; } + + [StringLength(100)] + public string? DocumentMenuClassHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImageHighlighted { get; set; } + + public bool? DocumentMenuItemInactive { get; set; } + + public string? DocumentCustomData { get; set; } + + [StringLength(100)] + public string? DocumentExtensions { get; set; } + + public string? DocumentTags { get; set; } + + [Column("DocumentTagGroupID")] + public int? DocumentTagGroupId { get; set; } + + [StringLength(440)] + public string? DocumentWildcardRule { get; set; } + + public string? DocumentWebParts { get; set; } + + public double? DocumentRatingValue { get; set; } + + public int? DocumentRatings { get; set; } + + public int? DocumentPriority { get; set; } + + [StringLength(50)] + public string? DocumentType { get; set; } + + public DateTime? DocumentLastPublished { get; set; } + + public bool? DocumentUseCustomExtensions { get; set; } + + public string? DocumentGroupWebParts { get; set; } + + public bool? DocumentCheckedOutAutomatically { get; set; } + + [StringLength(200)] + public string? DocumentTrackConversionName { get; set; } + + [StringLength(100)] + public string? DocumentConversionValue { get; set; } + + public bool? DocumentSearchExcluded { get; set; } + + [StringLength(50)] + public string? DocumentLastVersionNumber { get; set; } + + public bool? DocumentIsArchived { get; set; } + + [StringLength(32)] + public string? DocumentHash { get; set; } + + public bool? DocumentLogVisitActivity { get; set; } + + [Column("DocumentGUID")] + public Guid? DocumentGuid { get; set; } + + [Column("DocumentWorkflowCycleGUID")] + public Guid? DocumentWorkflowCycleGuid { get; set; } + + [StringLength(100)] + public string? DocumentSitemapSettings { get; set; } + + public bool? DocumentIsWaitingForTranslation { get; set; } + + [Column("DocumentSKUName")] + [StringLength(440)] + public string? DocumentSkuname { get; set; } + + [Column("DocumentSKUDescription")] + public string? DocumentSkudescription { get; set; } + + [Column("DocumentSKUShortDescription")] + public string? DocumentSkushortDescription { get; set; } + + [StringLength(450)] + public string? DocumentWorkflowActionStatus { get; set; } + + public bool? DocumentMenuRedirectToFirstChild { get; set; } + + [Required] + public bool? DocumentCanBePublished { get; set; } + + [Required] + public bool? DocumentInheritsStylesheet { get; set; } + + public string? DocumentPageBuilderWidgets { get; set; } + + public string? DocumentPageTemplateConfiguration { get; set; } + + [Column("DocumentABTestConfiguration")] + public string? DocumentAbtestConfiguration { get; set; } + + [InverseProperty("CommentPostDocument")] + public virtual ICollection BlogComments { get; set; } = new List(); + + [InverseProperty("SubscriptionPostDocument")] + public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); + + [InverseProperty("BoardDocument")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("AlternativeUrlDocument")] + public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); + + [InverseProperty("AttachmentDocument")] + public virtual ICollection CmsAttachments { get; set; } = new List(); + + [InverseProperty("PersonalizationDocument")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [ForeignKey("DocumentCheckedOutByUserId")] + [InverseProperty("CmsDocumentDocumentCheckedOutByUsers")] + public virtual CmsUser? DocumentCheckedOutByUser { get; set; } + + [ForeignKey("DocumentCheckedOutVersionHistoryId")] + [InverseProperty("CmsDocumentDocumentCheckedOutVersionHistories")] + public virtual CmsVersionHistory? DocumentCheckedOutVersionHistory { get; set; } + + [ForeignKey("DocumentCreatedByUserId")] + [InverseProperty("CmsDocumentDocumentCreatedByUsers")] + public virtual CmsUser? DocumentCreatedByUser { get; set; } + + [ForeignKey("DocumentModifiedByUserId")] + [InverseProperty("CmsDocumentDocumentModifiedByUsers")] + public virtual CmsUser? DocumentModifiedByUser { get; set; } + + [ForeignKey("DocumentNodeId")] + [InverseProperty("CmsDocuments")] + public virtual CmsTree DocumentNode { get; set; } = null!; + + [ForeignKey("DocumentPageTemplateId")] + [InverseProperty("CmsDocuments")] + public virtual CmsPageTemplate? DocumentPageTemplate { get; set; } + + [ForeignKey("DocumentPublishedVersionHistoryId")] + [InverseProperty("CmsDocumentDocumentPublishedVersionHistories")] + public virtual CmsVersionHistory? DocumentPublishedVersionHistory { get; set; } + + [ForeignKey("DocumentStylesheetId")] + [InverseProperty("CmsDocuments")] + public virtual CmsCssStylesheet? DocumentStylesheet { get; set; } + + [ForeignKey("DocumentTagGroupId")] + [InverseProperty("CmsDocuments")] + public virtual CmsTagGroup? DocumentTagGroup { get; set; } + + [ForeignKey("DocumentWorkflowStepId")] + [InverseProperty("CmsDocuments")] + public virtual CmsWorkflowStep? DocumentWorkflowStep { get; set; } + + [InverseProperty("ForumDocument")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [InverseProperty("VariantDocument")] + public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); + + [ForeignKey("DocumentId")] + [InverseProperty("Documents")] + public virtual ICollection Categories { get; set; } = new List(); + + [ForeignKey("DocumentId")] + [InverseProperty("Documents")] + public virtual ICollection Tags { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsDocumentAlias.cs b/Migration.Tool.KX12/Models/CmsDocumentAlias.cs new file mode 100644 index 00000000..f3ca4a52 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsDocumentAlias.cs @@ -0,0 +1,54 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_DocumentAlias")] +[Index("AliasNodeId", Name = "IX_CMS_DocumentAlias_AliasNodeID")] +[Index("AliasSiteId", Name = "IX_CMS_DocumentAlias_AliasSiteID")] +[Index("AliasWildcardRule", "AliasPriority", Name = "IX_CMS_DocumentAlias_AliasWildcardRule_AliasPriority")] +[Index("AliasCulture", Name = "IX_CMS_Document_AliasCulture")] +public class CmsDocumentAlias +{ + [Key] + [Column("AliasID")] + public int AliasId { get; set; } + + [Column("AliasNodeID")] + public int AliasNodeId { get; set; } + + [StringLength(20)] + public string? AliasCulture { get; set; } + + [Column("AliasURLPath")] + public string? AliasUrlpath { get; set; } + + [StringLength(100)] + public string? AliasExtensions { get; set; } + + [StringLength(440)] + public string? AliasWildcardRule { get; set; } + + public int? AliasPriority { get; set; } + + [Column("AliasGUID")] + public Guid? AliasGuid { get; set; } + + public DateTime AliasLastModified { get; set; } + + [Column("AliasSiteID")] + public int AliasSiteId { get; set; } + + [StringLength(50)] + public string? AliasActionMode { get; set; } + + [ForeignKey("AliasNodeId")] + [InverseProperty("CmsDocumentAliases")] + public virtual CmsTree AliasNode { get; set; } = null!; + + [ForeignKey("AliasSiteId")] + [InverseProperty("CmsDocumentAliases")] + public virtual CmsSite AliasSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsDocumentTypeScope.cs b/Migration.Tool.KX12/Models/CmsDocumentTypeScope.cs new file mode 100644 index 00000000..1831baef --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsDocumentTypeScope.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_DocumentTypeScope")] +[Index("ScopeSiteId", Name = "IX_CMS_DocumentTypeScope_ScopeSiteID")] +public class CmsDocumentTypeScope +{ + [Key] + [Column("ScopeID")] + public int ScopeId { get; set; } + + public string ScopePath { get; set; } = null!; + + [Column("ScopeSiteID")] + public int? ScopeSiteId { get; set; } + + public DateTime ScopeLastModified { get; set; } + + [Column("ScopeGUID")] + public Guid? ScopeGuid { get; set; } + + public bool? ScopeIncludeChildren { get; set; } + + public bool? ScopeAllowAllTypes { get; set; } + + public bool? ScopeAllowLinks { get; set; } + + [Column("ScopeAllowABVariant")] + public bool? ScopeAllowAbvariant { get; set; } + + public string? ScopeMacroCondition { get; set; } + + [ForeignKey("ScopeSiteId")] + [InverseProperty("CmsDocumentTypeScopes")] + public virtual CmsSite? ScopeSite { get; set; } + + [ForeignKey("ScopeId")] + [InverseProperty("Scopes")] + public virtual ICollection Classes { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsEmail.cs b/Migration.Tool.KX12/Models/CmsEmail.cs new file mode 100644 index 00000000..04aaeab2 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsEmail.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Email")] +[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] +public class CmsEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [StringLength(254)] + public string EmailFrom { get; set; } = null!; + + [StringLength(998)] + public string? EmailTo { get; set; } + + [StringLength(998)] + public string? EmailCc { get; set; } + + [StringLength(998)] + public string? EmailBcc { get; set; } + + [StringLength(450)] + public string EmailSubject { get; set; } = null!; + + public string? EmailBody { get; set; } + + public string? EmailPlainTextBody { get; set; } + + public int EmailFormat { get; set; } + + public int EmailPriority { get; set; } + + [Column("EmailSiteID")] + public int? EmailSiteId { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + public DateTime EmailLastModified { get; set; } + + public int? EmailStatus { get; set; } + + public bool? EmailIsMass { get; set; } + + [StringLength(254)] + public string? EmailReplyTo { get; set; } + + public string? EmailHeaders { get; set; } + + public DateTime? EmailCreated { get; set; } + + [InverseProperty("Email")] + public virtual ICollection CmsEmailUsers { get; set; } = new List(); + + [ForeignKey("EmailId")] + [InverseProperty("Emails")] + public virtual ICollection Attachments { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsEmailAttachment.cs b/Migration.Tool.KX12/Models/CmsEmailAttachment.cs new file mode 100644 index 00000000..fd143dca --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsEmailAttachment.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_EmailAttachment")] +public class CmsEmailAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[] AttachmentBinary { get; set; } = null!; + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + [Column("AttachmentContentID")] + [StringLength(255)] + public string? AttachmentContentId { get; set; } + + [Column("AttachmentSiteID")] + public int? AttachmentSiteId { get; set; } + + [ForeignKey("AttachmentId")] + [InverseProperty("Attachments")] + public virtual ICollection Emails { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsEmailTemplate.cs b/Migration.Tool.KX12/Models/CmsEmailTemplate.cs new file mode 100644 index 00000000..98463009 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsEmailTemplate.cs @@ -0,0 +1,58 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_EmailTemplate")] +[Index("EmailTemplateName", "EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateName_EmailTemplateSiteID")] +[Index("EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateSiteID")] +public class CmsEmailTemplate +{ + [Key] + [Column("EmailTemplateID")] + public int EmailTemplateId { get; set; } + + [StringLength(200)] + public string EmailTemplateName { get; set; } = null!; + + [StringLength(200)] + public string EmailTemplateDisplayName { get; set; } = null!; + + public string? EmailTemplateText { get; set; } + + [Column("EmailTemplateSiteID")] + public int? EmailTemplateSiteId { get; set; } + + [Column("EmailTemplateGUID")] + public Guid EmailTemplateGuid { get; set; } + + public DateTime EmailTemplateLastModified { get; set; } + + public string? EmailTemplatePlainText { get; set; } + + [StringLength(250)] + public string? EmailTemplateSubject { get; set; } + + [StringLength(254)] + public string? EmailTemplateFrom { get; set; } + + [StringLength(998)] + public string? EmailTemplateCc { get; set; } + + [StringLength(998)] + public string? EmailTemplateBcc { get; set; } + + [StringLength(100)] + public string? EmailTemplateType { get; set; } + + public string? EmailTemplateDescription { get; set; } + + [StringLength(254)] + public string? EmailTemplateReplyTo { get; set; } + + [ForeignKey("EmailTemplateSiteId")] + [InverseProperty("CmsEmailTemplates")] + public virtual CmsSite? EmailTemplateSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsEmailUser.cs b/Migration.Tool.KX12/Models/CmsEmailUser.cs new file mode 100644 index 00000000..41e3a54a --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsEmailUser.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[PrimaryKey("EmailId", "UserId")] +[Table("CMS_EmailUser")] +[Index("Status", Name = "IX_CMS_EmailUser_Status")] +[Index("UserId", Name = "IX_CMS_EmailUser_UserID")] +public class CmsEmailUser +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [Key] + [Column("UserID")] + public int UserId { get; set; } + + public string? LastSendResult { get; set; } + + public DateTime? LastSendAttempt { get; set; } + + public int? Status { get; set; } + + [ForeignKey("EmailId")] + [InverseProperty("CmsEmailUsers")] + public virtual CmsEmail Email { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsEmailUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsEventLog.cs b/Migration.Tool.KX12/Models/CmsEventLog.cs new file mode 100644 index 00000000..aa29a914 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsEventLog.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_EventLog")] +[Index("SiteId", Name = "IX_CMS_EventLog_SiteID")] +public class CmsEventLog +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(5)] + public string EventType { get; set; } = null!; + + public DateTime EventTime { get; set; } + + [StringLength(100)] + public string Source { get; set; } = null!; + + [StringLength(100)] + public string EventCode { get; set; } = null!; + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(250)] + public string? UserName { get; set; } + + [Column("IPAddress")] + [StringLength(100)] + public string? Ipaddress { get; set; } + + [Column("NodeID")] + public int? NodeId { get; set; } + + [StringLength(100)] + public string? DocumentName { get; set; } + + public string? EventDescription { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + public string? EventUrl { get; set; } + + [StringLength(100)] + public string? EventMachineName { get; set; } + + public string? EventUserAgent { get; set; } + + public string? EventUrlReferrer { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsExternalLogin.cs b/Migration.Tool.KX12/Models/CmsExternalLogin.cs new file mode 100644 index 00000000..73f76e4b --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsExternalLogin.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_ExternalLogin")] +[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] +public class CmsExternalLogin +{ + [Key] + [Column("ExternalLoginID")] + public int ExternalLoginId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(200)] + public string? LoginProvider { get; set; } + + [StringLength(200)] + public string? IdentityKey { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsExternalLogins")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsForm.cs b/Migration.Tool.KX12/Models/CmsForm.cs new file mode 100644 index 00000000..1408ba1c --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsForm.cs @@ -0,0 +1,94 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Form")] +[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] +[Index("FormSiteId", Name = "IX_CMS_Form_FormSiteID")] +public class CmsForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(100)] + public string FormName { get; set; } = null!; + + [StringLength(998)] + public string? FormSendToEmail { get; set; } + + [StringLength(254)] + public string? FormSendFromEmail { get; set; } + + [StringLength(250)] + public string? FormEmailSubject { get; set; } + + public string? FormEmailTemplate { get; set; } + + public bool? FormEmailAttachUploadedDocs { get; set; } + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public int FormItems { get; set; } + + public string? FormReportFields { get; set; } + + [StringLength(400)] + public string? FormRedirectToUrl { get; set; } + + public string? FormDisplayText { get; set; } + + public bool FormClearAfterSave { get; set; } + + [StringLength(400)] + public string? FormSubmitButtonText { get; set; } + + [Column("FormSiteID")] + public int FormSiteId { get; set; } + + [StringLength(254)] + public string? FormConfirmationEmailField { get; set; } + + public string? FormConfirmationTemplate { get; set; } + + [StringLength(254)] + public string? FormConfirmationSendFromEmail { get; set; } + + [StringLength(250)] + public string? FormConfirmationEmailSubject { get; set; } + + public int? FormAccess { get; set; } + + [StringLength(255)] + public string? FormSubmitButtonImage { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + public bool? FormLogActivity { get; set; } + + public int FormDevelopmentModel { get; set; } + + public string? FormBuilderLayout { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsForms")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormSiteId")] + [InverseProperty("CmsForms")] + public virtual CmsSite FormSite { get; set; } = null!; + + [ForeignKey("FormId")] + [InverseProperty("Forms")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsFormUserControl.cs b/Migration.Tool.KX12/Models/CmsFormUserControl.cs new file mode 100644 index 00000000..f40845c9 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsFormUserControl.cs @@ -0,0 +1,108 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_FormUserControl")] +[Index("UserControlCodeName", Name = "IX_CMS_FormUserControl_UserControlCodeName", IsUnique = true)] +[Index("UserControlParentId", Name = "IX_CMS_FormUserControl_UserControlParentID")] +[Index("UserControlResourceId", Name = "IX_CMS_FormUserControl_UserControlResourceID")] +public class CmsFormUserControl +{ + [Key] + [Column("UserControlID")] + public int UserControlId { get; set; } + + [StringLength(200)] + public string UserControlDisplayName { get; set; } = null!; + + [StringLength(200)] + public string UserControlCodeName { get; set; } = null!; + + [StringLength(400)] + public string UserControlFileName { get; set; } = null!; + + public bool UserControlForText { get; set; } + + public bool UserControlForLongText { get; set; } + + public bool UserControlForInteger { get; set; } + + public bool UserControlForDecimal { get; set; } + + public bool UserControlForDateTime { get; set; } + + public bool UserControlForBoolean { get; set; } + + public bool UserControlForFile { get; set; } + + public bool UserControlShowInBizForms { get; set; } + + [StringLength(50)] + public string UserControlDefaultDataType { get; set; } = null!; + + public int? UserControlDefaultDataTypeSize { get; set; } + + public bool? UserControlShowInDocumentTypes { get; set; } + + public bool? UserControlShowInSystemTables { get; set; } + + public bool? UserControlShowInWebParts { get; set; } + + public bool? UserControlShowInReports { get; set; } + + [Column("UserControlGUID")] + public Guid UserControlGuid { get; set; } + + public DateTime UserControlLastModified { get; set; } + + public bool UserControlForGuid { get; set; } + + public bool? UserControlShowInCustomTables { get; set; } + + public bool UserControlForVisibility { get; set; } + + public string? UserControlParameters { get; set; } + + public bool UserControlForDocAttachments { get; set; } + + [Column("UserControlResourceID")] + public int? UserControlResourceId { get; set; } + + public int? UserControlType { get; set; } + + [Column("UserControlParentID")] + public int? UserControlParentId { get; set; } + + public string? UserControlDescription { get; set; } + + [Column("UserControlThumbnailGUID")] + public Guid? UserControlThumbnailGuid { get; set; } + + public int? UserControlPriority { get; set; } + + public bool? UserControlIsSystem { get; set; } + + public bool UserControlForBinary { get; set; } + + public bool UserControlForDocRelationships { get; set; } + + [StringLength(200)] + public string? UserControlAssemblyName { get; set; } + + [StringLength(200)] + public string? UserControlClassName { get; set; } + + [InverseProperty("UserControlParent")] + public virtual ICollection InverseUserControlParent { get; set; } = new List(); + + [ForeignKey("UserControlParentId")] + [InverseProperty("InverseUserControlParent")] + public virtual CmsFormUserControl? UserControlParent { get; set; } + + [ForeignKey("UserControlResourceId")] + [InverseProperty("CmsFormUserControls")] + public virtual CmsResource? UserControlResource { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsHelpTopic.cs b/Migration.Tool.KX12/Models/CmsHelpTopic.cs new file mode 100644 index 00000000..7eb0dad3 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsHelpTopic.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_HelpTopic")] +[Index("HelpTopicUielementId", Name = "IX_CMS_HelpTopic_HelpTopicUIElementID")] +public class CmsHelpTopic +{ + [Key] + [Column("HelpTopicID")] + public int HelpTopicId { get; set; } + + [Column("HelpTopicUIElementID")] + public int HelpTopicUielementId { get; set; } + + [StringLength(200)] + public string HelpTopicName { get; set; } = null!; + + [StringLength(1023)] + public string HelpTopicLink { get; set; } = null!; + + public DateTime HelpTopicLastModified { get; set; } + + [Column("HelpTopicGUID")] + public Guid HelpTopicGuid { get; set; } + + public int? HelpTopicOrder { get; set; } + + public string? HelpTopicVisibilityCondition { get; set; } + + [ForeignKey("HelpTopicUielementId")] + [InverseProperty("CmsHelpTopics")] + public virtual CmsUielement HelpTopicUielement { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsLayout.cs b/Migration.Tool.KX12/Models/CmsLayout.cs new file mode 100644 index 00000000..f124e190 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsLayout.cs @@ -0,0 +1,62 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Layout")] +[Index("LayoutDisplayName", Name = "IX_CMS_Layout_LayoutDisplayName")] +public class CmsLayout +{ + [Key] + [Column("LayoutID")] + public int LayoutId { get; set; } + + [StringLength(100)] + public string LayoutCodeName { get; set; } = null!; + + [StringLength(200)] + public string LayoutDisplayName { get; set; } = null!; + + public string? LayoutDescription { get; set; } + + public string LayoutCode { get; set; } = null!; + + [Column("LayoutVersionGUID")] + [StringLength(50)] + public string? LayoutVersionGuid { get; set; } + + [Column("LayoutGUID")] + public Guid LayoutGuid { get; set; } + + public DateTime LayoutLastModified { get; set; } + + [StringLength(50)] + public string? LayoutType { get; set; } + + [Column("LayoutCSS")] + public string? LayoutCss { get; set; } + + [Column("LayoutThumbnailGUID")] + public Guid? LayoutThumbnailGuid { get; set; } + + public int? LayoutZoneCount { get; set; } + + public bool? LayoutIsConvertible { get; set; } + + [StringLength(200)] + public string? LayoutIconClass { get; set; } + + [InverseProperty("SourceLayout")] + public virtual ICollection CmsDeviceProfileLayoutSourceLayouts { get; set; } = new List(); + + [InverseProperty("TargetLayout")] + public virtual ICollection CmsDeviceProfileLayoutTargetLayouts { get; set; } = new List(); + + [InverseProperty("PageTemplateLayoutNavigation")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("Layout")] + public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsLicenseKey.cs b/Migration.Tool.KX12/Models/CmsLicenseKey.cs new file mode 100644 index 00000000..3b409dc7 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsLicenseKey.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_LicenseKey")] +public class CmsLicenseKey +{ + [Key] + [Column("LicenseKeyID")] + public int LicenseKeyId { get; set; } + + [StringLength(255)] + public string? LicenseDomain { get; set; } + + public string? LicenseKey { get; set; } + + [StringLength(200)] + public string? LicenseEdition { get; set; } + + [StringLength(200)] + public string? LicenseExpiration { get; set; } + + public int? LicenseServers { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsMacroIdentity.cs b/Migration.Tool.KX12/Models/CmsMacroIdentity.cs new file mode 100644 index 00000000..802b35ac --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsMacroIdentity.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_MacroIdentity")] +[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] +public class CmsMacroIdentity +{ + [Key] + [Column("MacroIdentityID")] + public int MacroIdentityId { get; set; } + + public Guid MacroIdentityGuid { get; set; } + + public DateTime MacroIdentityLastModified { get; set; } + + [StringLength(200)] + public string MacroIdentityName { get; set; } = null!; + + [Column("MacroIdentityEffectiveUserID")] + public int? MacroIdentityEffectiveUserId { get; set; } + + [InverseProperty("UserMacroIdentityMacroIdentity")] + public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); + + [ForeignKey("MacroIdentityEffectiveUserId")] + [InverseProperty("CmsMacroIdentities")] + public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsMacroRule.cs b/Migration.Tool.KX12/Models/CmsMacroRule.cs new file mode 100644 index 00000000..be4feef0 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsMacroRule.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_MacroRule")] +public class CmsMacroRule +{ + [Key] + [Column("MacroRuleID")] + public int MacroRuleId { get; set; } + + [StringLength(200)] + public string MacroRuleName { get; set; } = null!; + + [StringLength(1000)] + public string MacroRuleText { get; set; } = null!; + + public string? MacroRuleParameters { get; set; } + + [StringLength(100)] + public string? MacroRuleResourceName { get; set; } + + public DateTime MacroRuleLastModified { get; set; } + + [Column("MacroRuleGUID")] + public Guid MacroRuleGuid { get; set; } + + public string MacroRuleCondition { get; set; } = null!; + + [StringLength(500)] + public string MacroRuleDisplayName { get; set; } = null!; + + public bool? MacroRuleIsCustom { get; set; } + + public bool MacroRuleRequiresContext { get; set; } + + [StringLength(450)] + public string? MacroRuleDescription { get; set; } + + [StringLength(2500)] + public string? MacroRuleRequiredData { get; set; } + + public bool? MacroRuleEnabled { get; set; } + + public int? MacroRuleAvailability { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsMembership.cs b/Migration.Tool.KX12/Models/CmsMembership.cs new file mode 100644 index 00000000..91b924f5 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsMembership.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Membership")] +[Index("MembershipSiteId", Name = "IX_CMS_Membership_MembershipSiteID")] +public class CmsMembership +{ + [Key] + [Column("MembershipID")] + public int MembershipId { get; set; } + + [StringLength(200)] + public string MembershipName { get; set; } = null!; + + [StringLength(200)] + public string MembershipDisplayName { get; set; } = null!; + + public string? MembershipDescription { get; set; } + + public DateTime MembershipLastModified { get; set; } + + [Column("MembershipGUID")] + public Guid MembershipGuid { get; set; } + + [Column("MembershipSiteID")] + public int? MembershipSiteId { get; set; } + + [InverseProperty("Membership")] + public virtual ICollection CmsMembershipUsers { get; set; } = new List(); + + [ForeignKey("MembershipSiteId")] + [InverseProperty("CmsMemberships")] + public virtual CmsSite? MembershipSite { get; set; } + + [ForeignKey("MembershipId")] + [InverseProperty("Memberships")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsMembershipUser.cs b/Migration.Tool.KX12/Models/CmsMembershipUser.cs new file mode 100644 index 00000000..3795f823 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsMembershipUser.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_MembershipUser")] +[Index("MembershipId", "UserId", Name = "IX_CMS_MembershipUser_MembershipID_UserID", IsUnique = true)] +[Index("UserId", Name = "IX_CMS_MembershipUser_UserID")] +public class CmsMembershipUser +{ + [Key] + [Column("MembershipUserID")] + public int MembershipUserId { get; set; } + + [Column("MembershipID")] + public int MembershipId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + public DateTime? ValidTo { get; set; } + + public bool? SendNotification { get; set; } + + [ForeignKey("MembershipId")] + [InverseProperty("CmsMembershipUsers")] + public virtual CmsMembership Membership { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsMembershipUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsMetaFile.cs b/Migration.Tool.KX12/Models/CmsMetaFile.cs new file mode 100644 index 00000000..098eae69 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsMetaFile.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_MetaFile")] +[Index("MetaFileGuid", "MetaFileSiteId", "MetaFileObjectType", "MetaFileObjectId", "MetaFileGroupName", Name = "IX_CMS_MetaFile_MetaFileGUID_MetaFileSiteID_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName")] +[Index("MetaFileSiteId", Name = "IX_CMS_MetaFile_MetaFileSiteID")] +public class CmsMetaFile +{ + [Key] + [Column("MetaFileID")] + public int MetaFileId { get; set; } + + [Column("MetaFileObjectID")] + public int MetaFileObjectId { get; set; } + + [StringLength(100)] + public string MetaFileObjectType { get; set; } = null!; + + [StringLength(100)] + public string? MetaFileGroupName { get; set; } + + [StringLength(250)] + public string MetaFileName { get; set; } = null!; + + [StringLength(50)] + public string MetaFileExtension { get; set; } = null!; + + public int MetaFileSize { get; set; } + + [StringLength(100)] + public string MetaFileMimeType { get; set; } = null!; + + public byte[]? MetaFileBinary { get; set; } + + public int? MetaFileImageWidth { get; set; } + + public int? MetaFileImageHeight { get; set; } + + [Column("MetaFileGUID")] + public Guid MetaFileGuid { get; set; } + + public DateTime MetaFileLastModified { get; set; } + + [Column("MetaFileSiteID")] + public int? MetaFileSiteId { get; set; } + + [StringLength(250)] + public string? MetaFileTitle { get; set; } + + public string? MetaFileDescription { get; set; } + + public string? MetaFileCustomData { get; set; } + + [ForeignKey("MetaFileSiteId")] + [InverseProperty("CmsMetaFiles")] + public virtual CmsSite? MetaFileSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsModuleLicenseKey.cs b/Migration.Tool.KX12/Models/CmsModuleLicenseKey.cs new file mode 100644 index 00000000..8e96f191 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsModuleLicenseKey.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_ModuleLicenseKey")] +[Index("ModuleLicenseKeyResourceId", Name = "IX_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID")] +public class CmsModuleLicenseKey +{ + [Key] + [Column("ModuleLicenseKeyID")] + public int ModuleLicenseKeyId { get; set; } + + public Guid ModuleLicenseKeyGuid { get; set; } + + public DateTime ModuleLicenseKeyLastModified { get; set; } + + public string ModuleLicenseKeyLicense { get; set; } = null!; + + [Column("ModuleLicenseKeyResourceID")] + public int ModuleLicenseKeyResourceId { get; set; } + + [ForeignKey("ModuleLicenseKeyResourceId")] + [InverseProperty("CmsModuleLicenseKeys")] + public virtual CmsResource ModuleLicenseKeyResource { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsModuleUsageCounter.cs b/Migration.Tool.KX12/Models/CmsModuleUsageCounter.cs new file mode 100644 index 00000000..bc04e3f9 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsModuleUsageCounter.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +[Table("CMS_ModuleUsageCounter")] +public class CmsModuleUsageCounter +{ + [Column("ModuleUsageCounterID")] + public int ModuleUsageCounterId { get; set; } + + [StringLength(200)] + public string ModuleUsageCounterName { get; set; } = null!; + + public long ModuleUsageCounterValue { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsObjectSetting.cs b/Migration.Tool.KX12/Models/CmsObjectSetting.cs new file mode 100644 index 00000000..26ee7aa1 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsObjectSetting.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_ObjectSettings")] +[Index("ObjectCheckedOutByUserId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutByUserID")] +[Index("ObjectCheckedOutVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID")] +[Index("ObjectPublishedVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectPublishedVersionHistoryID")] +[Index("ObjectSettingsObjectId", "ObjectSettingsObjectType", Name = "IX_CMS_ObjectSettings_ObjectSettingsObjectType_ObjectSettingsObjectID", IsUnique = true)] +[Index("ObjectWorkflowStepId", Name = "IX_CMS_ObjectSettings_ObjectWorkflowStepID")] +public class CmsObjectSetting +{ + [Key] + [Column("ObjectSettingsID")] + public int ObjectSettingsId { get; set; } + + public string? ObjectTags { get; set; } + + [Column("ObjectCheckedOutByUserID")] + public int? ObjectCheckedOutByUserId { get; set; } + + public DateTime? ObjectCheckedOutWhen { get; set; } + + [Column("ObjectCheckedOutVersionHistoryID")] + public int? ObjectCheckedOutVersionHistoryId { get; set; } + + [Column("ObjectWorkflowStepID")] + public int? ObjectWorkflowStepId { get; set; } + + [Column("ObjectPublishedVersionHistoryID")] + public int? ObjectPublishedVersionHistoryId { get; set; } + + [Column("ObjectSettingsObjectID")] + public int ObjectSettingsObjectId { get; set; } + + [StringLength(100)] + public string ObjectSettingsObjectType { get; set; } = null!; + + public string? ObjectComments { get; set; } + + public bool? ObjectWorkflowSendEmails { get; set; } + + [ForeignKey("ObjectCheckedOutByUserId")] + [InverseProperty("CmsObjectSettings")] + public virtual CmsUser? ObjectCheckedOutByUser { get; set; } + + [ForeignKey("ObjectCheckedOutVersionHistoryId")] + [InverseProperty("CmsObjectSettingObjectCheckedOutVersionHistories")] + public virtual CmsObjectVersionHistory? ObjectCheckedOutVersionHistory { get; set; } + + [ForeignKey("ObjectPublishedVersionHistoryId")] + [InverseProperty("CmsObjectSettingObjectPublishedVersionHistories")] + public virtual CmsObjectVersionHistory? ObjectPublishedVersionHistory { get; set; } + + [ForeignKey("ObjectWorkflowStepId")] + [InverseProperty("CmsObjectSettings")] + public virtual CmsWorkflowStep? ObjectWorkflowStep { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsObjectVersionHistory.cs b/Migration.Tool.KX12/Models/CmsObjectVersionHistory.cs new file mode 100644 index 00000000..c765816b --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsObjectVersionHistory.cs @@ -0,0 +1,72 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_ObjectVersionHistory")] +[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionModifiedByUserId", Name = "IX_CMS_ObjectVersionHistory_VersionModifiedByUserID")] +[Index("VersionObjectSiteId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectSiteID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionObjectType", "VersionObjectId", "VersionModifiedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectType_VersionObjectID_VersionModifiedWhen", IsDescending = new[] { false, false, true })] +public class CmsObjectVersionHistory +{ + [Key] + [Column("VersionID")] + public int VersionId { get; set; } + + [Column("VersionObjectID")] + public int? VersionObjectId { get; set; } + + [StringLength(100)] + public string VersionObjectType { get; set; } = null!; + + [Column("VersionObjectSiteID")] + public int? VersionObjectSiteId { get; set; } + + [StringLength(450)] + public string VersionObjectDisplayName { get; set; } = null!; + + [Column("VersionXML")] + public string VersionXml { get; set; } = null!; + + [Column("VersionBinaryDataXML")] + public string? VersionBinaryDataXml { get; set; } + + [Column("VersionModifiedByUserID")] + public int? VersionModifiedByUserId { get; set; } + + public DateTime VersionModifiedWhen { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [StringLength(50)] + public string VersionNumber { get; set; } = null!; + + [Column("VersionSiteBindingIDs")] + public string? VersionSiteBindingIds { get; set; } + + public string? VersionComment { get; set; } + + [InverseProperty("ObjectCheckedOutVersionHistory")] + public virtual ICollection CmsObjectSettingObjectCheckedOutVersionHistories { get; set; } = new List(); + + [InverseProperty("ObjectPublishedVersionHistory")] + public virtual ICollection CmsObjectSettingObjectPublishedVersionHistories { get; set; } = new List(); + + [ForeignKey("VersionDeletedByUserId")] + [InverseProperty("CmsObjectVersionHistoryVersionDeletedByUsers")] + public virtual CmsUser? VersionDeletedByUser { get; set; } + + [ForeignKey("VersionModifiedByUserId")] + [InverseProperty("CmsObjectVersionHistoryVersionModifiedByUsers")] + public virtual CmsUser? VersionModifiedByUser { get; set; } + + [ForeignKey("VersionObjectSiteId")] + [InverseProperty("CmsObjectVersionHistories")] + public virtual CmsSite? VersionObjectSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsObjectWorkflowTrigger.cs b/Migration.Tool.KX12/Models/CmsObjectWorkflowTrigger.cs new file mode 100644 index 00000000..8d5e7971 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsObjectWorkflowTrigger.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_ObjectWorkflowTrigger")] +[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] +public class CmsObjectWorkflowTrigger +{ + [Key] + [Column("TriggerID")] + public int TriggerId { get; set; } + + [Column("TriggerGUID")] + public Guid TriggerGuid { get; set; } + + public DateTime TriggerLastModified { get; set; } + + public int TriggerType { get; set; } + + public string? TriggerMacroCondition { get; set; } + + [Column("TriggerWorkflowID")] + public int TriggerWorkflowId { get; set; } + + [StringLength(450)] + public string TriggerDisplayName { get; set; } = null!; + + [StringLength(100)] + public string TriggerObjectType { get; set; } = null!; + + public string? TriggerParameters { get; set; } + + [StringLength(100)] + public string? TriggerTargetObjectType { get; set; } + + [Column("TriggerTargetObjectID")] + public int? TriggerTargetObjectId { get; set; } + + [ForeignKey("TriggerWorkflowId")] + [InverseProperty("CmsObjectWorkflowTriggers")] + public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsOpenIduser.cs b/Migration.Tool.KX12/Models/CmsOpenIduser.cs new file mode 100644 index 00000000..6eb83290 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsOpenIduser.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_OpenIDUser")] +[Index("OpenId", Name = "IX_CMS_OpenIDUser_OpenID")] +[Index("UserId", Name = "IX_CMS_OpenIDUser_UserID")] +public class CmsOpenIduser +{ + [Key] + [Column("OpenIDUserID")] + public int OpenIduserId { get; set; } + + [Column("OpenID")] + public string OpenId { get; set; } = null!; + + [Column("OpenIDProviderURL")] + [StringLength(450)] + public string? OpenIdproviderUrl { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsOpenIdusers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsPageTemplate.cs b/Migration.Tool.KX12/Models/CmsPageTemplate.cs new file mode 100644 index 00000000..ac76bcd0 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsPageTemplate.cs @@ -0,0 +1,135 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_PageTemplate")] +[Index("PageTemplateCodeName", "PageTemplateDisplayName", Name = "IX_CMS_PageTemplate_PageTemplateCodeName_PageTemplateDisplayName")] +[Index("PageTemplateIsReusable", "PageTemplateForAllPages", "PageTemplateShowAsMasterTemplate", Name = "IX_CMS_PageTemplate_PageTemplateIsReusable_PageTemplateForAllPages_PageTemplateShowAsMasterTemplate")] +[Index("PageTemplateLayoutId", Name = "IX_CMS_PageTemplate_PageTemplateLayoutID")] +[Index("PageTemplateSiteId", "PageTemplateCodeName", "PageTemplateGuid", Name = "IX_CMS_PageTemplate_PageTemplateSiteID_PageTemplateCodeName_PageTemplateGUID")] +public class CmsPageTemplate +{ + [Key] + [Column("PageTemplateID")] + public int PageTemplateId { get; set; } + + [StringLength(200)] + public string PageTemplateDisplayName { get; set; } = null!; + + [StringLength(100)] + public string PageTemplateCodeName { get; set; } = null!; + + public string? PageTemplateDescription { get; set; } + + [StringLength(400)] + public string? PageTemplateFile { get; set; } + + [Column("PageTemplateCategoryID")] + public int? PageTemplateCategoryId { get; set; } + + [Column("PageTemplateLayoutID")] + public int? PageTemplateLayoutId { get; set; } + + public string? PageTemplateWebParts { get; set; } + + public bool? PageTemplateIsReusable { get; set; } + + public bool? PageTemplateShowAsMasterTemplate { get; set; } + + [StringLength(200)] + public string? PageTemplateInheritPageLevels { get; set; } + + public string? PageTemplateLayout { get; set; } + + [Column("PageTemplateVersionGUID")] + [StringLength(200)] + public string? PageTemplateVersionGuid { get; set; } + + public string? PageTemplateHeader { get; set; } + + [Column("PageTemplateGUID")] + public Guid PageTemplateGuid { get; set; } + + public DateTime PageTemplateLastModified { get; set; } + + [Column("PageTemplateSiteID")] + public int? PageTemplateSiteId { get; set; } + + public bool? PageTemplateForAllPages { get; set; } + + [StringLength(10)] + public string PageTemplateType { get; set; } = null!; + + [StringLength(50)] + public string? PageTemplateLayoutType { get; set; } + + [Column("PageTemplateCSS")] + public string? PageTemplateCss { get; set; } + + public bool? PageTemplateIsAllowedForProductSection { get; set; } + + public bool? PageTemplateInheritParentHeader { get; set; } + + public bool? PageTemplateAllowInheritHeader { get; set; } + + [Column("PageTemplateThumbnailGUID")] + public Guid? PageTemplateThumbnailGuid { get; set; } + + public bool? PageTemplateCloneAsAdHoc { get; set; } + + [Column("PageTemplateNodeGUID")] + public Guid? PageTemplateNodeGuid { get; set; } + + [Column("PageTemplateMasterPageTemplateID")] + public int? PageTemplateMasterPageTemplateId { get; set; } + + public string? PageTemplateProperties { get; set; } + + public bool? PageTemplateIsLayout { get; set; } + + [StringLength(200)] + public string? PageTemplateIconClass { get; set; } + + [InverseProperty("ClassDefaultPageTemplate")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("DocumentPageTemplate")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("PageTemplateScopeTemplate")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("PageTemplate")] + public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); + + [InverseProperty("NodeTemplate")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("ElementPageTemplate")] + public virtual ICollection CmsUielements { get; set; } = new List(); + + [InverseProperty("MvtvariantPageTemplate")] + public virtual ICollection OmMvtvariants { get; set; } = new List(); + + [InverseProperty("VariantPageTemplate")] + public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); + + [ForeignKey("PageTemplateCategoryId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsPageTemplateCategory? PageTemplateCategory { get; set; } + + [ForeignKey("PageTemplateLayoutId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsLayout? PageTemplateLayoutNavigation { get; set; } + + [ForeignKey("PageTemplateSiteId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsSite? PageTemplateSite { get; set; } + + [ForeignKey("PageTemplateId")] + [InverseProperty("PageTemplates")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsPageTemplateCategory.cs b/Migration.Tool.KX12/Models/CmsPageTemplateCategory.cs new file mode 100644 index 00000000..dfab2345 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsPageTemplateCategory.cs @@ -0,0 +1,54 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_PageTemplateCategory")] +[Index("CategoryLevel", Name = "IX_CMS_PageTemplateCategory_CategoryLevel")] +[Index("CategoryParentId", Name = "IX_CMS_PageTemplateCategory_CategoryParentID")] +public class CmsPageTemplateCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(200)] + public string? CategoryName { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryTemplateChildCount { get; set; } + + public string? CategoryPath { get; set; } + + public int? CategoryLevel { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsPageTemplateCategory? CategoryParent { get; set; } + + [InverseProperty("ClassPageTemplateCategory")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("PageTemplateCategory")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsPageTemplateConfiguration.cs b/Migration.Tool.KX12/Models/CmsPageTemplateConfiguration.cs new file mode 100644 index 00000000..3b25fd79 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsPageTemplateConfiguration.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_PageTemplateConfiguration")] +[Index("PageTemplateConfigurationSiteId", Name = "IX_CMS_PageTemplateConfiguration_PageTemplateConfigurationSiteID")] +public class CmsPageTemplateConfiguration +{ + [Key] + [Column("PageTemplateConfigurationID")] + public int PageTemplateConfigurationId { get; set; } + + [Column("PageTemplateConfigurationGUID")] + public Guid PageTemplateConfigurationGuid { get; set; } + + [Column("PageTemplateConfigurationSiteID")] + public int PageTemplateConfigurationSiteId { get; set; } + + public DateTime PageTemplateConfigurationLastModified { get; set; } + + [StringLength(200)] + public string PageTemplateConfigurationName { get; set; } = null!; + + public string? PageTemplateConfigurationDescription { get; set; } + + [Column("PageTemplateConfigurationThumbnailGUID")] + public Guid? PageTemplateConfigurationThumbnailGuid { get; set; } + + public string PageTemplateConfigurationTemplate { get; set; } = null!; + + public string? PageTemplateConfigurationWidgets { get; set; } + + [ForeignKey("PageTemplateConfigurationSiteId")] + [InverseProperty("CmsPageTemplateConfigurations")] + public virtual CmsSite PageTemplateConfigurationSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsPageTemplateScope.cs b/Migration.Tool.KX12/Models/CmsPageTemplateScope.cs new file mode 100644 index 00000000..af91db09 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsPageTemplateScope.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_PageTemplateScope")] +[Index("PageTemplateScopeClassId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeClassID")] +[Index("PageTemplateScopeCultureId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeCultureID")] +[Index("PageTemplateScopeLevels", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeLevels")] +[Index("PageTemplateScopeSiteId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeSiteID")] +[Index("PageTemplateScopeTemplateId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeTemplateID")] +public class CmsPageTemplateScope +{ + [Key] + [Column("PageTemplateScopeID")] + public int PageTemplateScopeId { get; set; } + + public string PageTemplateScopePath { get; set; } = null!; + + public string? PageTemplateScopeLevels { get; set; } + + [Column("PageTemplateScopeCultureID")] + public int? PageTemplateScopeCultureId { get; set; } + + [Column("PageTemplateScopeClassID")] + public int? PageTemplateScopeClassId { get; set; } + + [Column("PageTemplateScopeTemplateID")] + public int PageTemplateScopeTemplateId { get; set; } + + [Column("PageTemplateScopeSiteID")] + public int? PageTemplateScopeSiteId { get; set; } + + public DateTime PageTemplateScopeLastModified { get; set; } + + [Column("PageTemplateScopeGUID")] + public Guid PageTemplateScopeGuid { get; set; } + + [ForeignKey("PageTemplateScopeClassId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsClass? PageTemplateScopeClass { get; set; } + + [ForeignKey("PageTemplateScopeCultureId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsCulture? PageTemplateScopeCulture { get; set; } + + [ForeignKey("PageTemplateScopeSiteId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsSite? PageTemplateScopeSite { get; set; } + + [ForeignKey("PageTemplateScopeTemplateId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsPageTemplate PageTemplateScopeTemplate { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsPermission.cs b/Migration.Tool.KX12/Models/CmsPermission.cs new file mode 100644 index 00000000..f6329311 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsPermission.cs @@ -0,0 +1,65 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Permission")] +[Index("ClassId", "PermissionName", Name = "IX_CMS_Permission_ClassID_PermissionName")] +[Index("ResourceId", "PermissionName", Name = "IX_CMS_Permission_ResourceID_PermissionName")] +public class CmsPermission +{ + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [StringLength(100)] + public string PermissionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string PermissionName { get; set; } = null!; + + [Column("ClassID")] + public int? ClassId { get; set; } + + [Column("ResourceID")] + public int? ResourceId { get; set; } + + [Column("PermissionGUID")] + public Guid PermissionGuid { get; set; } + + public DateTime PermissionLastModified { get; set; } + + public string? PermissionDescription { get; set; } + + public bool? PermissionDisplayInMatrix { get; set; } + + public int? PermissionOrder { get; set; } + + public bool? PermissionEditableByGlobalAdmin { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsPermissions")] + public virtual CmsClass? Class { get; set; } + + [InverseProperty("Permission")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection ForumsForumRoles { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); + + [ForeignKey("ResourceId")] + [InverseProperty("CmsPermissions")] + public virtual CmsResource? Resource { get; set; } + + [ForeignKey("PermissionId")] + [InverseProperty("Permissions")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsPersonalization.cs b/Migration.Tool.KX12/Models/CmsPersonalization.cs new file mode 100644 index 00000000..4925adeb --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsPersonalization.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Personalization")] +[Index("PersonalizationId", "PersonalizationUserId", "PersonalizationDocumentId", "PersonalizationDashboardName", Name = "IX_CMS_Personalization_PersonalizationID_PersonalizationUserID_PersonalizationDocumentID_PersonalizationDashboardName", + IsUnique = true)] +[Index("PersonalizationSiteId", Name = "IX_CMS_Personalization_PersonalizationSiteID_SiteID")] +[Index("PersonalizationUserId", Name = "IX_CMS_Personalization_PersonalizationUserID")] +public class CmsPersonalization +{ + [Key] + [Column("PersonalizationID")] + public int PersonalizationId { get; set; } + + [Column("PersonalizationGUID")] + public Guid PersonalizationGuid { get; set; } + + public DateTime PersonalizationLastModified { get; set; } + + [Column("PersonalizationUserID")] + public int? PersonalizationUserId { get; set; } + + [Column("PersonalizationDocumentID")] + public int? PersonalizationDocumentId { get; set; } + + public string? PersonalizationWebParts { get; set; } + + [StringLength(200)] + public string? PersonalizationDashboardName { get; set; } + + [Column("PersonalizationSiteID")] + public int? PersonalizationSiteId { get; set; } + + [ForeignKey("PersonalizationDocumentId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsDocument? PersonalizationDocument { get; set; } + + [ForeignKey("PersonalizationSiteId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsSite? PersonalizationSite { get; set; } + + [ForeignKey("PersonalizationUserId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsUser? PersonalizationUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsQuery.cs b/Migration.Tool.KX12/Models/CmsQuery.cs new file mode 100644 index 00000000..a2db89d5 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsQuery.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Query")] +[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] +public class CmsQuery +{ + [Key] + [Column("QueryID")] + public int QueryId { get; set; } + + [StringLength(100)] + public string QueryName { get; set; } = null!; + + [Column("QueryTypeID")] + public int QueryTypeId { get; set; } + + public string QueryText { get; set; } = null!; + + public bool QueryRequiresTransaction { get; set; } + + [Column("ClassID")] + public int? ClassId { get; set; } + + public bool QueryIsLocked { get; set; } + + public DateTime QueryLastModified { get; set; } + + [Column("QueryGUID")] + public Guid QueryGuid { get; set; } + + public bool? QueryIsCustom { get; set; } + + [StringLength(100)] + public string? QueryConnectionString { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsQueries")] + public virtual CmsClass? Class { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsRelationship.cs b/Migration.Tool.KX12/Models/CmsRelationship.cs new file mode 100644 index 00000000..49f4545b --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsRelationship.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Relationship")] +[Index("LeftNodeId", Name = "IX_CMS_Relationship_LeftNodeID")] +[Index("RelationshipNameId", Name = "IX_CMS_Relationship_RelationshipNameID")] +[Index("RightNodeId", Name = "IX_CMS_Relationship_RightNodeID")] +public class CmsRelationship +{ + [Key] + [Column("RelationshipID")] + public int RelationshipId { get; set; } + + [Column("LeftNodeID")] + public int LeftNodeId { get; set; } + + [Column("RightNodeID")] + public int RightNodeId { get; set; } + + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + public string? RelationshipCustomData { get; set; } + + public int? RelationshipOrder { get; set; } + + public bool? RelationshipIsAdHoc { get; set; } + + [ForeignKey("LeftNodeId")] + [InverseProperty("CmsRelationshipLeftNodes")] + public virtual CmsTree LeftNode { get; set; } = null!; + + [ForeignKey("RelationshipNameId")] + [InverseProperty("CmsRelationships")] + public virtual CmsRelationshipName RelationshipName { get; set; } = null!; + + [ForeignKey("RightNodeId")] + [InverseProperty("CmsRelationshipRightNodes")] + public virtual CmsTree RightNode { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsRelationshipName.cs b/Migration.Tool.KX12/Models/CmsRelationshipName.cs new file mode 100644 index 00000000..066f55d1 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsRelationshipName.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_RelationshipName")] +[Index("RelationshipAllowedObjects", Name = "IX_CMS_RelationshipName_RelationshipAllowedObjects")] +[Index("RelationshipName", "RelationshipDisplayName", Name = "IX_CMS_RelationshipName_RelationshipName_RelationshipDisplayName")] +public class CmsRelationshipName +{ + [Key] + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + [StringLength(200)] + public string RelationshipDisplayName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipName { get; set; } = null!; + + public string? RelationshipAllowedObjects { get; set; } + + [Column("RelationshipGUID")] + public Guid RelationshipGuid { get; set; } + + public DateTime RelationshipLastModified { get; set; } + + public bool? RelationshipNameIsAdHoc { get; set; } + + [InverseProperty("RelationshipName")] + public virtual ICollection CmsRelationships { get; set; } = new List(); + + [ForeignKey("RelationshipNameId")] + [InverseProperty("RelationshipNames")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsResource.cs b/Migration.Tool.KX12/Models/CmsResource.cs new file mode 100644 index 00000000..e9d4bf37 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsResource.cs @@ -0,0 +1,84 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Resource")] +[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] +public class CmsResource +{ + [Key] + [Column("ResourceID")] + public int ResourceId { get; set; } + + [StringLength(100)] + public string ResourceDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + public string? ResourceDescription { get; set; } + + public bool? ShowInDevelopment { get; set; } + + [Column("ResourceURL")] + [StringLength(1000)] + public string? ResourceUrl { get; set; } + + [Column("ResourceGUID")] + public Guid ResourceGuid { get; set; } + + public DateTime ResourceLastModified { get; set; } + + public bool? ResourceIsInDevelopment { get; set; } + + public bool? ResourceHasFiles { get; set; } + + [StringLength(200)] + public string? ResourceVersion { get; set; } + + [StringLength(200)] + public string? ResourceAuthor { get; set; } + + [StringLength(50)] + public string? ResourceInstallationState { get; set; } + + [StringLength(50)] + public string? ResourceInstalledVersion { get; set; } + + [InverseProperty("ClassResource")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("UserControlResource")] + public virtual ICollection CmsFormUserControls { get; set; } = new List(); + + [InverseProperty("ModuleLicenseKeyResource")] + public virtual ICollection CmsModuleLicenseKeys { get; set; } = new List(); + + [InverseProperty("Resource")] + public virtual ICollection CmsPermissions { get; set; } = new List(); + + [InverseProperty("ResourceLibraryResource")] + public virtual ICollection CmsResourceLibraries { get; set; } = new List(); + + [InverseProperty("TaskResource")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("CategoryResource")] + public virtual ICollection CmsSettingsCategories { get; set; } = new List(); + + [InverseProperty("ElementResource")] + public virtual ICollection CmsUielements { get; set; } = new List(); + + [InverseProperty("WebPartResource")] + public virtual ICollection CmsWebParts { get; set; } = new List(); + + [InverseProperty("ActionResource")] + public virtual ICollection CmsWorkflowActions { get; set; } = new List(); + + [ForeignKey("ResourceId")] + [InverseProperty("Resources")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsResourceLibrary.cs b/Migration.Tool.KX12/Models/CmsResourceLibrary.cs new file mode 100644 index 00000000..0a7d90ad --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsResourceLibrary.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_ResourceLibrary")] +[Index("ResourceLibraryResourceId", Name = "IX_CMS_ResourceLibrary")] +public class CmsResourceLibrary +{ + [Key] + [Column("ResourceLibraryID")] + public int ResourceLibraryId { get; set; } + + [Column("ResourceLibraryResourceID")] + public int ResourceLibraryResourceId { get; set; } + + [StringLength(200)] + public string ResourceLibraryPath { get; set; } = null!; + + [ForeignKey("ResourceLibraryResourceId")] + [InverseProperty("CmsResourceLibraries")] + public virtual CmsResource ResourceLibraryResource { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsResourceString.cs b/Migration.Tool.KX12/Models/CmsResourceString.cs new file mode 100644 index 00000000..f4994edc --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsResourceString.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_ResourceString")] +[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] +public class CmsResourceString +{ + [Key] + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("StringGUID")] + public Guid StringGuid { get; set; } + + [InverseProperty("TranslationString")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsResourceTranslation.cs b/Migration.Tool.KX12/Models/CmsResourceTranslation.cs new file mode 100644 index 00000000..17a283d4 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsResourceTranslation.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_ResourceTranslation")] +[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] +[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] +public class CmsResourceTranslation +{ + [Key] + [Column("TranslationID")] + public int TranslationId { get; set; } + + [Column("TranslationStringID")] + public int TranslationStringId { get; set; } + + public string? TranslationText { get; set; } + + [Column("TranslationCultureID")] + public int TranslationCultureId { get; set; } + + [ForeignKey("TranslationCultureId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsCulture TranslationCulture { get; set; } = null!; + + [ForeignKey("TranslationStringId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsResourceString TranslationString { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsRole.cs b/Migration.Tool.KX12/Models/CmsRole.cs new file mode 100644 index 00000000..c2669b44 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsRole.cs @@ -0,0 +1,97 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Role")] +[Index("RoleGroupId", Name = "IX_CMS_Role_RoleGroupID")] +[Index("SiteId", "RoleId", Name = "IX_CMS_Role_SiteID_RoleID")] +[Index("SiteId", "RoleName", "RoleGroupId", Name = "IX_CMS_Role_SiteID_RoleName_RoleGroupID", IsUnique = true)] +public class CmsRole +{ + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + public DateTime RoleLastModified { get; set; } + + [Column("RoleGroupID")] + public int? RoleGroupId { get; set; } + + public bool? RoleIsGroupAdministrator { get; set; } + + public bool? RoleIsDomain { get; set; } + + [InverseProperty("Role")] + public virtual ICollection CmsAclitems { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection ForumsForumRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); + + [ForeignKey("RoleGroupId")] + [InverseProperty("CmsRoles")] + public virtual CommunityGroup? RoleGroup { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsRoles")] + public virtual CmsSite? Site { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Boards { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Elements { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("RolesNavigation")] + public virtual ICollection ElementsNavigation { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Forms { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Memberships { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Permissions { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Polls { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsScheduledTask.cs b/Migration.Tool.KX12/Models/CmsScheduledTask.cs new file mode 100644 index 00000000..dde252c2 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsScheduledTask.cs @@ -0,0 +1,111 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_ScheduledTask")] +[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] +[Index("TaskResourceId", Name = "IX_CMS_ScheduledTask_TaskResourceID")] +[Index("TaskSiteId", "TaskDisplayName", Name = "IX_CMS_ScheduledTask_TaskSiteID_TaskDisplayName")] +[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] +public class CmsScheduledTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(200)] + public string TaskName { get; set; } = null!; + + [StringLength(200)] + public string TaskDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TaskAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string? TaskClass { get; set; } + + [StringLength(1000)] + public string TaskInterval { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime? TaskLastRunTime { get; set; } + + public DateTime? TaskNextRunTime { get; set; } + + public string? TaskLastResult { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + public bool? TaskDeleteAfterLastRun { get; set; } + + [StringLength(100)] + public string? TaskServerName { get; set; } + + [Column("TaskGUID")] + public Guid TaskGuid { get; set; } + + public DateTime TaskLastModified { get; set; } + + public int? TaskExecutions { get; set; } + + [Column("TaskResourceID")] + public int? TaskResourceId { get; set; } + + public bool? TaskRunInSeparateThread { get; set; } + + public bool? TaskUseExternalService { get; set; } + + public bool? TaskAllowExternalService { get; set; } + + public DateTime? TaskLastExecutionReset { get; set; } + + [StringLength(400)] + public string? TaskCondition { get; set; } + + public bool? TaskRunIndividually { get; set; } + + [Column("TaskUserID")] + public int? TaskUserId { get; set; } + + public int? TaskType { get; set; } + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [StringLength(200)] + public string? TaskExecutingServerName { get; set; } + + public bool TaskEnabled { get; set; } + + public bool TaskIsRunning { get; set; } + + [InverseProperty("CampaignScheduledTask")] + public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); + + [InverseProperty("TestWinnerScheduledTask")] + public virtual ICollection NewsletterAbtests { get; set; } = new List(); + + [InverseProperty("NewsletterDynamicScheduledTask")] + public virtual ICollection NewsletterNewsletters { get; set; } = new List(); + + [ForeignKey("TaskResourceId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsResource? TaskResource { get; set; } + + [ForeignKey("TaskSiteId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsSite? TaskSite { get; set; } + + [ForeignKey("TaskUserId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsUser? TaskUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsSearchEngine.cs b/Migration.Tool.KX12/Models/CmsSearchEngine.cs new file mode 100644 index 00000000..362811f0 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsSearchEngine.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_SearchEngine")] +public class CmsSearchEngine +{ + [Key] + [Column("SearchEngineID")] + public int SearchEngineId { get; set; } + + [StringLength(200)] + public string SearchEngineDisplayName { get; set; } = null!; + + [StringLength(200)] + public string SearchEngineName { get; set; } = null!; + + [StringLength(450)] + public string SearchEngineDomainRule { get; set; } = null!; + + [StringLength(200)] + public string? SearchEngineKeywordParameter { get; set; } + + [Column("SearchEngineGUID")] + public Guid SearchEngineGuid { get; set; } + + public DateTime SearchEngineLastModified { get; set; } + + [StringLength(200)] + public string? SearchEngineCrawler { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsSearchIndex.cs b/Migration.Tool.KX12/Models/CmsSearchIndex.cs new file mode 100644 index 00000000..9f8bd6ce --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsSearchIndex.cs @@ -0,0 +1,85 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_SearchIndex")] +public class CmsSearchIndex +{ + [Key] + [Column("IndexID")] + public int IndexId { get; set; } + + [StringLength(200)] + public string IndexName { get; set; } = null!; + + [StringLength(200)] + public string IndexDisplayName { get; set; } = null!; + + [StringLength(200)] + public string? IndexAnalyzerType { get; set; } + + public bool IndexIsCommunityGroup { get; set; } + + public string? IndexSettings { get; set; } + + [Column("IndexGUID")] + public Guid IndexGuid { get; set; } + + public DateTime IndexLastModified { get; set; } + + public DateTime? IndexLastRebuildTime { get; set; } + + [StringLength(200)] + public string IndexType { get; set; } = null!; + + [StringLength(200)] + public string? IndexStopWordsFile { get; set; } + + [StringLength(200)] + public string? IndexCustomAnalyzerAssemblyName { get; set; } + + [StringLength(200)] + public string? IndexCustomAnalyzerClassName { get; set; } + + public int? IndexBatchSize { get; set; } + + [StringLength(10)] + public string? IndexStatus { get; set; } + + public DateTime? IndexLastUpdate { get; set; } + + [StringLength(200)] + public string? IndexCrawlerUserName { get; set; } + + [StringLength(200)] + public string? IndexCrawlerFormsUserName { get; set; } + + [StringLength(200)] + public string? IndexCrawlerUserPassword { get; set; } + + [StringLength(200)] + public string? IndexCrawlerDomain { get; set; } + + public bool? IndexIsOutdated { get; set; } + + [StringLength(200)] + public string IndexProvider { get; set; } = null!; + + [StringLength(200)] + public string? IndexSearchServiceName { get; set; } + + [StringLength(200)] + public string? IndexAdminKey { get; set; } + + [StringLength(200)] + public string? IndexQueryKey { get; set; } + + [ForeignKey("IndexId")] + [InverseProperty("Indices")] + public virtual ICollection IndexCultures { get; set; } = new List(); + + [ForeignKey("IndexId")] + [InverseProperty("Indices")] + public virtual ICollection IndexSites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsSearchTask.cs b/Migration.Tool.KX12/Models/CmsSearchTask.cs new file mode 100644 index 00000000..a4c9b788 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsSearchTask.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_SearchTask")] +public class CmsSearchTask +{ + [Key] + [Column("SearchTaskID")] + public int SearchTaskId { get; set; } + + [StringLength(100)] + public string SearchTaskType { get; set; } = null!; + + [StringLength(100)] + public string? SearchTaskObjectType { get; set; } + + [StringLength(200)] + public string? SearchTaskField { get; set; } + + [StringLength(600)] + public string SearchTaskValue { get; set; } = null!; + + [StringLength(200)] + public string? SearchTaskServerName { get; set; } + + [StringLength(100)] + public string SearchTaskStatus { get; set; } = null!; + + public int SearchTaskPriority { get; set; } + + public DateTime SearchTaskCreated { get; set; } + + public string? SearchTaskErrorMessage { get; set; } + + [Column("SearchTaskRelatedObjectID")] + public int? SearchTaskRelatedObjectId { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsSearchTaskAzure.cs b/Migration.Tool.KX12/Models/CmsSearchTaskAzure.cs new file mode 100644 index 00000000..51632baa --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsSearchTaskAzure.cs @@ -0,0 +1,36 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_SearchTaskAzure")] +[Index("SearchTaskAzurePriority", Name = "IX_CMS_SearchTaskAzure_SearchTaskAzurePriority", AllDescending = true)] +public class CmsSearchTaskAzure +{ + [Key] + [Column("SearchTaskAzureID")] + public int SearchTaskAzureId { get; set; } + + [StringLength(100)] + public string SearchTaskAzureType { get; set; } = null!; + + [StringLength(100)] + public string? SearchTaskAzureObjectType { get; set; } + + [StringLength(200)] + public string? SearchTaskAzureMetadata { get; set; } + + [StringLength(600)] + public string SearchTaskAzureAdditionalData { get; set; } = null!; + + [Column("SearchTaskAzureInitiatorObjectID")] + public int? SearchTaskAzureInitiatorObjectId { get; set; } + + public int SearchTaskAzurePriority { get; set; } + + public string? SearchTaskAzureErrorMessage { get; set; } + + public DateTime SearchTaskAzureCreated { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsSession.cs b/Migration.Tool.KX12/Models/CmsSession.cs new file mode 100644 index 00000000..b8dff52c --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsSession.cs @@ -0,0 +1,65 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Session")] +[Index("SessionIdentificator", Name = "IX_CMS_Session_SessionIdentificator", IsUnique = true)] +[Index("SessionSiteId", Name = "IX_CMS_Session_SessionSiteID")] +[Index("SessionUserId", Name = "IX_CMS_Session_SessionUserID")] +[Index("SessionUserIsHidden", Name = "IX_CMS_Session_SessionUserIsHidden")] +public class CmsSession +{ + [StringLength(50)] + public string SessionIdentificator { get; set; } = null!; + + [Column("SessionUserID")] + public int? SessionUserId { get; set; } + + [StringLength(450)] + public string? SessionLocation { get; set; } + + public DateTime SessionLastActive { get; set; } + + public DateTime? SessionLastLogon { get; set; } + + public DateTime SessionExpires { get; set; } + + public bool SessionExpired { get; set; } + + [Column("SessionSiteID")] + public int? SessionSiteId { get; set; } + + public bool SessionUserIsHidden { get; set; } + + [StringLength(450)] + public string? SessionFullName { get; set; } + + [StringLength(254)] + public string? SessionEmail { get; set; } + + [StringLength(254)] + public string? SessionUserName { get; set; } + + [StringLength(254)] + public string? SessionNickName { get; set; } + + public DateTime? SessionUserCreated { get; set; } + + [Column("SessionContactID")] + public int? SessionContactId { get; set; } + + [Key] + [Column("SessionID")] + public int SessionId { get; set; } + + [ForeignKey("SessionSiteId")] + [InverseProperty("CmsSessions")] + public virtual CmsSite? SessionSite { get; set; } + + [ForeignKey("SessionUserId")] + [InverseProperty("CmsSessions")] + public virtual CmsUser? SessionUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsSettingsCategory.cs b/Migration.Tool.KX12/Models/CmsSettingsCategory.cs new file mode 100644 index 00000000..bace3aee --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsSettingsCategory.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_SettingsCategory")] +[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] +[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] +public class CmsSettingsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + public int? CategoryOrder { get; set; } + + [StringLength(100)] + public string? CategoryName { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + [StringLength(200)] + public string? CategoryIconPath { get; set; } + + public bool? CategoryIsGroup { get; set; } + + public bool? CategoryIsCustom { get; set; } + + [Column("CategoryResourceID")] + public int? CategoryResourceId { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsSettingsCategory? CategoryParent { get; set; } + + [ForeignKey("CategoryResourceId")] + [InverseProperty("CmsSettingsCategories")] + public virtual CmsResource? CategoryResource { get; set; } + + [InverseProperty("KeyCategory")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsSettingsKey.cs b/Migration.Tool.KX12/Models/CmsSettingsKey.cs new file mode 100644 index 00000000..58d83dec --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsSettingsKey.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_SettingsKey")] +[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] +[Index("SiteId", "KeyName", Name = "IX_CMS_SettingsKey_SiteID_KeyName")] +public class CmsSettingsKey +{ + [Key] + [Column("KeyID")] + public int KeyId { get; set; } + + [StringLength(100)] + public string KeyName { get; set; } = null!; + + [StringLength(200)] + public string KeyDisplayName { get; set; } = null!; + + public string? KeyDescription { get; set; } + + public string? KeyValue { get; set; } + + [StringLength(50)] + public string KeyType { get; set; } = null!; + + [Column("KeyCategoryID")] + public int? KeyCategoryId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("KeyGUID")] + public Guid KeyGuid { get; set; } + + public DateTime KeyLastModified { get; set; } + + public int? KeyOrder { get; set; } + + public string? KeyDefaultValue { get; set; } + + [StringLength(255)] + public string? KeyValidation { get; set; } + + [StringLength(200)] + public string? KeyEditingControlPath { get; set; } + + public bool? KeyIsGlobal { get; set; } + + public bool? KeyIsCustom { get; set; } + + public bool? KeyIsHidden { get; set; } + + public string? KeyFormControlSettings { get; set; } + + public string? KeyExplanationText { get; set; } + + [ForeignKey("KeyCategoryId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSettingsCategory? KeyCategory { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSite? Site { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsSite.cs b/Migration.Tool.KX12/Models/CmsSite.cs new file mode 100644 index 00000000..dab12d25 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsSite.cs @@ -0,0 +1,413 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Site")] +[Index("SiteDefaultEditorStylesheet", Name = "IX_CMS_Site_SiteDefaultEditorStylesheet")] +[Index("SiteDefaultStylesheetId", Name = "IX_CMS_Site_SiteDefaultStylesheetID")] +[Index("SiteDomainName", "SiteStatus", Name = "IX_CMS_Site_SiteDomainName_SiteStatus")] +[Index("SiteName", Name = "IX_CMS_Site_SiteName")] +public class CmsSite +{ + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + [StringLength(200)] + public string SiteDisplayName { get; set; } = null!; + + public string? SiteDescription { get; set; } + + [StringLength(20)] + public string SiteStatus { get; set; } = null!; + + [StringLength(400)] + public string SiteDomainName { get; set; } = null!; + + [Column("SiteDefaultStylesheetID")] + public int? SiteDefaultStylesheetId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + public int? SiteDefaultEditorStylesheet { get; set; } + + [Column("SiteGUID")] + public Guid SiteGuid { get; set; } + + public DateTime SiteLastModified { get; set; } + + public bool? SiteIsOffline { get; set; } + + [Column("SiteOfflineRedirectURL")] + [StringLength(400)] + public string? SiteOfflineRedirectUrl { get; set; } + + public string? SiteOfflineMessage { get; set; } + + [Column("SitePresentationURL")] + [StringLength(400)] + public string? SitePresentationUrl { get; set; } + + public bool? SiteIsContentOnly { get; set; } + + [InverseProperty("CampaignSite")] + public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); + + [InverseProperty("ConversionSite")] + public virtual ICollection AnalyticsConversions { get; set; } = new List(); + + [InverseProperty("StatisticsSite")] + public virtual ICollection AnalyticsStatistics { get; set; } = new List(); + + [InverseProperty("BoardSite")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("ChatNotificationSite")] + public virtual ICollection ChatNotifications { get; set; } = new List(); + + [InverseProperty("ChatOnlineSupportSite")] + public virtual ICollection ChatOnlineSupports { get; set; } = new List(); + + [InverseProperty("ChatOnlineUserSite")] + public virtual ICollection ChatOnlineUsers { get; set; } = new List(); + + [InverseProperty("ChatRoomSite")] + public virtual ICollection ChatRooms { get; set; } = new List(); + + [InverseProperty("ChatSupportCannedResponseSite")] + public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); + + [InverseProperty("ReportSite")] + public virtual ICollection CmsAbuseReports { get; set; } = new List(); + + [InverseProperty("Aclsite")] + public virtual ICollection CmsAcls { get; set; } = new List(); + + [InverseProperty("AlternativeUrlSite")] + public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection CmsAttachmentHistories { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection CmsAttachments { get; set; } = new List(); + + [InverseProperty("StateSite")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("IpaddressSite")] + public virtual ICollection CmsBannedIps { get; set; } = new List(); + + [InverseProperty("BannerCategorySite")] + public virtual ICollection CmsBannerCategories { get; set; } = new List(); + + [InverseProperty("BannerSite")] + public virtual ICollection CmsBanners { get; set; } = new List(); + + [InverseProperty("CategorySite")] + public virtual ICollection CmsCategories { get; set; } = new List(); + + [InverseProperty("AliasSite")] + public virtual ICollection CmsDocumentAliases { get; set; } = new List(); + + [InverseProperty("ScopeSite")] + public virtual ICollection CmsDocumentTypeScopes { get; set; } = new List(); + + [InverseProperty("EmailTemplateSite")] + public virtual ICollection CmsEmailTemplates { get; set; } = new List(); + + [InverseProperty("FormSite")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("MembershipSite")] + public virtual ICollection CmsMemberships { get; set; } = new List(); + + [InverseProperty("MetaFileSite")] + public virtual ICollection CmsMetaFiles { get; set; } = new List(); + + [InverseProperty("VersionObjectSite")] + public virtual ICollection CmsObjectVersionHistories { get; set; } = new List(); + + [InverseProperty("PageTemplateConfigurationSite")] + public virtual ICollection CmsPageTemplateConfigurations { get; set; } = new List(); + + [InverseProperty("PageTemplateScopeSite")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("PageTemplateSite")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("PersonalizationSite")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsRoles { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("SessionSite")] + public virtual ICollection CmsSessions { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsSiteDomainAliases { get; set; } = new List(); + + [InverseProperty("TagGroupSite")] + public virtual ICollection CmsTagGroups { get; set; } = new List(); + + [InverseProperty("NodeLinkedNodeSite")] + public virtual ICollection CmsTreeNodeLinkedNodeSites { get; set; } = new List(); + + [InverseProperty("NodeSite")] + public virtual ICollection CmsTreeNodeSites { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsUserSites { get; set; } = new List(); + + [InverseProperty("NodeSite")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("ScopeSite")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [InverseProperty("BrandSite")] + public virtual ICollection ComBrands { get; set; } = new List(); + + [InverseProperty("CarrierSite")] + public virtual ICollection ComCarriers { get; set; } = new List(); + + [InverseProperty("CollectionSite")] + public virtual ICollection ComCollections { get; set; } = new List(); + + [InverseProperty("CurrencySite")] + public virtual ICollection ComCurrencies { get; set; } = new List(); + + [InverseProperty("EventSite")] + public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); + + [InverseProperty("CustomerSite")] + public virtual ICollection ComCustomers { get; set; } = new List(); + + [InverseProperty("DepartmentSite")] + public virtual ICollection ComDepartments { get; set; } = new List(); + + [InverseProperty("DiscountSite")] + public virtual ICollection ComDiscounts { get; set; } = new List(); + + [InverseProperty("ExchangeTableSite")] + public virtual ICollection ComExchangeTables { get; set; } = new List(); + + [InverseProperty("GiftCardSite")] + public virtual ICollection ComGiftCards { get; set; } = new List(); + + [InverseProperty("InternalStatusSite")] + public virtual ICollection ComInternalStatuses { get; set; } = new List(); + + [InverseProperty("ManufacturerSite")] + public virtual ICollection ComManufacturers { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscountSite")] + public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); + + [InverseProperty("CategorySite")] + public virtual ICollection ComOptionCategories { get; set; } = new List(); + + [InverseProperty("StatusSite")] + public virtual ICollection ComOrderStatuses { get; set; } = new List(); + + [InverseProperty("OrderSite")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("PaymentOptionSite")] + public virtual ICollection ComPaymentOptions { get; set; } = new List(); + + [InverseProperty("PublicStatusSite")] + public virtual ICollection ComPublicStatuses { get; set; } = new List(); + + [InverseProperty("ShippingOptionSite")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); + + [InverseProperty("ShoppingCartSite")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [InverseProperty("Skusite")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [InverseProperty("SupplierSite")] + public virtual ICollection ComSuppliers { get; set; } = new List(); + + [InverseProperty("TaxClassSite")] + public virtual ICollection ComTaxClasses { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("GroupSite")] + public virtual ICollection CommunityGroups { get; set; } = new List(); + + [InverseProperty("ExportSite")] + public virtual ICollection ExportHistories { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection ExportTasks { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection ForumsAttachments { get; set; } = new List(); + + [InverseProperty("GroupSite")] + public virtual ICollection ForumsForumGroups { get; set; } = new List(); + + [InverseProperty("ForumSite")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection IntegrationTasks { get; set; } = new List(); + + [InverseProperty("FileSite")] + public virtual ICollection MediaFiles { get; set; } = new List(); + + [InverseProperty("LibrarySite")] + public virtual ICollection MediaLibraries { get; set; } = new List(); + + [InverseProperty("TemplateSite")] + public virtual ICollection NewsletterEmailTemplates { get; set; } = new List(); + + [InverseProperty("EmailWidgetSite")] + public virtual ICollection NewsletterEmailWidgets { get; set; } = new List(); + + [InverseProperty("EmailSite")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("IssueSite")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [InverseProperty("NewsletterSite")] + public virtual ICollection NewsletterNewsletters { get; set; } = new List(); + + [InverseProperty("SubscriberSite")] + public virtual ICollection NewsletterSubscribers { get; set; } = new List(); + + [InverseProperty("SubscriptionSite")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("TemplateSite")] + public virtual ICollection NotificationTemplates { get; set; } = new List(); + + [InverseProperty("AbtestSite")] + public virtual ICollection OmAbtests { get; set; } = new List(); + + [InverseProperty("AbvariantSite")] + public virtual ICollection OmAbvariants { get; set; } = new List(); + + [InverseProperty("MvtestSite")] + public virtual ICollection OmMvtests { get; set; } = new List(); + + [InverseProperty("PollSite")] + public virtual ICollection PollsPolls { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionSite")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("SharePointConnectionSite")] + public virtual ICollection SharePointSharePointConnections { get; set; } = new List(); + + [InverseProperty("SharePointFileSite")] + public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); + + [InverseProperty("SharePointLibrarySite")] + public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); + + [ForeignKey("SiteDefaultEditorStylesheet")] + [InverseProperty("CmsSiteSiteDefaultEditorStylesheetNavigations")] + public virtual CmsCssStylesheet? SiteDefaultEditorStylesheetNavigation { get; set; } + + [ForeignKey("SiteDefaultStylesheetId")] + [InverseProperty("CmsSiteSiteDefaultStylesheets")] + public virtual CmsCssStylesheet? SiteDefaultStylesheet { get; set; } + + [InverseProperty("FacebookAccountSite")] + public virtual ICollection SmFacebookAccounts { get; set; } = new List(); + + [InverseProperty("FacebookApplicationSite")] + public virtual ICollection SmFacebookApplications { get; set; } = new List(); + + [InverseProperty("FacebookPostSite")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); + + [InverseProperty("LinkedInApplicationSite")] + public virtual ICollection SmLinkedInApplications { get; set; } = new List(); + + [InverseProperty("LinkedInPostSite")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); + + [InverseProperty("TwitterAccountSite")] + public virtual ICollection SmTwitterAccounts { get; set; } = new List(); + + [InverseProperty("TwitterApplicationSite")] + public virtual ICollection SmTwitterApplications { get; set; } = new List(); + + [InverseProperty("TwitterPostSite")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); + + [InverseProperty("ServerSite")] + public virtual ICollection StagingServers { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection StagingTasks { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Classes { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Containers { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Cultures { get; set; } = new List(); + + [ForeignKey("IndexSiteId")] + [InverseProperty("IndexSites")] + public virtual ICollection Indices { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection PageTemplates { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Polls { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection RelationshipNames { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Resources { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Servers { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Stylesheets { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsSiteDomainAlias.cs b/Migration.Tool.KX12/Models/CmsSiteDomainAlias.cs new file mode 100644 index 00000000..e6968ad4 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsSiteDomainAlias.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_SiteDomainAlias")] +[Index("SiteDomainAliasName", Name = "IX_CMS_SiteDomainAlias_SiteDomainAliasName")] +[Index("SiteId", Name = "IX_CMS_SiteDomainAlias_SiteID")] +public class CmsSiteDomainAlias +{ + [Key] + [Column("SiteDomainAliasID")] + public int SiteDomainAliasId { get; set; } + + [StringLength(400)] + public string SiteDomainAliasName { get; set; } = null!; + + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + [Column("SiteDomainGUID")] + public Guid? SiteDomainGuid { get; set; } + + public DateTime SiteDomainLastModified { get; set; } + + [StringLength(450)] + public string? SiteDomainDefaultAliasPath { get; set; } + + [StringLength(450)] + public string? SiteDomainRedirectUrl { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsSiteDomainAliases")] + public virtual CmsSite Site { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsSmtpserver.cs b/Migration.Tool.KX12/Models/CmsSmtpserver.cs new file mode 100644 index 00000000..cd29e39b --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsSmtpserver.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_SMTPServer")] +public class CmsSmtpserver +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(200)] + public string ServerName { get; set; } = null!; + + [StringLength(50)] + public string? ServerUserName { get; set; } + + [StringLength(200)] + public string? ServerPassword { get; set; } + + [Column("ServerUseSSL")] + public bool ServerUseSsl { get; set; } + + public bool ServerEnabled { get; set; } + + public bool ServerIsGlobal { get; set; } + + [Column("ServerGUID")] + public Guid ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public int? ServerPriority { get; set; } + + public int? ServerDeliveryMethod { get; set; } + + [StringLength(450)] + public string? ServerPickupDirectory { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("Servers")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsState.cs b/Migration.Tool.KX12/Models/CmsState.cs new file mode 100644 index 00000000..5ac2b7a9 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsState.cs @@ -0,0 +1,52 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_State")] +[Index("CountryId", Name = "IX_CMS_State_CountryID")] +[Index("StateCode", Name = "IX_CMS_State_StateCode")] +public class CmsState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [StringLength(200)] + public string StateDisplayName { get; set; } = null!; + + [StringLength(200)] + public string StateName { get; set; } = null!; + + [StringLength(100)] + public string? StateCode { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public DateTime StateLastModified { get; set; } + + [InverseProperty("AddressState")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("AddressState")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("State")] + public virtual ICollection ComTaxClassStates { get; set; } = new List(); + + [ForeignKey("CountryId")] + [InverseProperty("CmsStates")] + public virtual CmsCountry Country { get; set; } = null!; + + [InverseProperty("AccountState")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactState")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsTag.cs b/Migration.Tool.KX12/Models/CmsTag.cs new file mode 100644 index 00000000..469b1499 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsTag.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Tag")] +[Index("TagGroupId", Name = "IX_CMS_Tag_TagGroupID")] +public class CmsTag +{ + [Key] + [Column("TagID")] + public int TagId { get; set; } + + [StringLength(250)] + public string TagName { get; set; } = null!; + + public int TagCount { get; set; } + + [Column("TagGroupID")] + public int TagGroupId { get; set; } + + [Column("TagGUID")] + public Guid TagGuid { get; set; } + + [ForeignKey("TagGroupId")] + [InverseProperty("CmsTags")] + public virtual CmsTagGroup TagGroup { get; set; } = null!; + + [ForeignKey("TagId")] + [InverseProperty("Tags")] + public virtual ICollection Documents { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsTagGroup.cs b/Migration.Tool.KX12/Models/CmsTagGroup.cs new file mode 100644 index 00000000..0fa387ff --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsTagGroup.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_TagGroup")] +[Index("TagGroupSiteId", Name = "IX_CMS_TagGroup_TagGroupSiteID")] +public class CmsTagGroup +{ + [Key] + [Column("TagGroupID")] + public int TagGroupId { get; set; } + + [StringLength(250)] + public string TagGroupDisplayName { get; set; } = null!; + + [StringLength(250)] + public string TagGroupName { get; set; } = null!; + + public string? TagGroupDescription { get; set; } + + [Column("TagGroupSiteID")] + public int TagGroupSiteId { get; set; } + + public bool TagGroupIsAdHoc { get; set; } + + public DateTime TagGroupLastModified { get; set; } + + [Column("TagGroupGUID")] + public Guid TagGroupGuid { get; set; } + + [InverseProperty("DocumentTagGroup")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("TagGroup")] + public virtual ICollection CmsTags { get; set; } = new List(); + + [ForeignKey("TagGroupSiteId")] + [InverseProperty("CmsTagGroups")] + public virtual CmsSite TagGroupSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsTemplateDeviceLayout.cs b/Migration.Tool.KX12/Models/CmsTemplateDeviceLayout.cs new file mode 100644 index 00000000..53dcfaa5 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsTemplateDeviceLayout.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_TemplateDeviceLayout")] +[Index("LayoutId", Name = "IX_CMS_TemplateDeviceLayout_LayoutID")] +[Index("PageTemplateId", "ProfileId", Name = "IX_CMS_TemplateDeviceLayout_PageTemplateID_ProfileID", IsUnique = true)] +[Index("ProfileId", Name = "IX_CMS_TemplateDeviceLayout_ProfileID")] +public class CmsTemplateDeviceLayout +{ + [Key] + [Column("TemplateDeviceLayoutID")] + public int TemplateDeviceLayoutId { get; set; } + + [Column("PageTemplateID")] + public int PageTemplateId { get; set; } + + [Column("ProfileID")] + public int ProfileId { get; set; } + + [Column("LayoutID")] + public int? LayoutId { get; set; } + + public string? LayoutCode { get; set; } + + [StringLength(50)] + public string? LayoutType { get; set; } + + [Column("LayoutCSS")] + public string? LayoutCss { get; set; } + + public DateTime LayoutLastModified { get; set; } + + [Column("LayoutGUID")] + public Guid LayoutGuid { get; set; } + + [Column("LayoutVersionGUID")] + [StringLength(50)] + public string? LayoutVersionGuid { get; set; } + + [ForeignKey("LayoutId")] + [InverseProperty("CmsTemplateDeviceLayouts")] + public virtual CmsLayout? Layout { get; set; } + + [ForeignKey("PageTemplateId")] + [InverseProperty("CmsTemplateDeviceLayouts")] + public virtual CmsPageTemplate PageTemplate { get; set; } = null!; + + [ForeignKey("ProfileId")] + [InverseProperty("CmsTemplateDeviceLayouts")] + public virtual CmsDeviceProfile Profile { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsTimeZone.cs b/Migration.Tool.KX12/Models/CmsTimeZone.cs new file mode 100644 index 00000000..0177a24a --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsTimeZone.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_TimeZone")] +public class CmsTimeZone +{ + [Key] + [Column("TimeZoneID")] + public int TimeZoneId { get; set; } + + [StringLength(200)] + public string TimeZoneName { get; set; } = null!; + + [StringLength(200)] + public string TimeZoneDisplayName { get; set; } = null!; + + [Column("TimeZoneGMT")] + public double TimeZoneGmt { get; set; } + + public bool? TimeZoneDaylight { get; set; } + + public DateTime TimeZoneRuleStartIn { get; set; } + + [StringLength(200)] + public string TimeZoneRuleStartRule { get; set; } = null!; + + public DateTime TimeZoneRuleEndIn { get; set; } + + [StringLength(200)] + public string TimeZoneRuleEndRule { get; set; } = null!; + + [Column("TimeZoneGUID")] + public Guid TimeZoneGuid { get; set; } + + public DateTime TimeZoneLastModified { get; set; } + + [InverseProperty("UserTimeZone")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsTransformation.cs b/Migration.Tool.KX12/Models/CmsTransformation.cs new file mode 100644 index 00000000..49fd0c66 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsTransformation.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Transformation")] +[Index("TransformationClassId", Name = "IX_CMS_Transformation_TransformationClassID")] +public class CmsTransformation +{ + [Key] + [Column("TransformationID")] + public int TransformationId { get; set; } + + [StringLength(100)] + public string TransformationName { get; set; } = null!; + + public string TransformationCode { get; set; } = null!; + + [StringLength(50)] + public string TransformationType { get; set; } = null!; + + [Column("TransformationClassID")] + public int TransformationClassId { get; set; } + + [Column("TransformationVersionGUID")] + [StringLength(50)] + public string? TransformationVersionGuid { get; set; } + + [Column("TransformationGUID")] + public Guid TransformationGuid { get; set; } + + public DateTime TransformationLastModified { get; set; } + + public bool? TransformationIsHierarchical { get; set; } + + [Column("TransformationHierarchicalXML")] + public string? TransformationHierarchicalXml { get; set; } + + [Column("TransformationCSS")] + public string? TransformationCss { get; set; } + + [StringLength(700)] + public string? TransformationPreferredDocument { get; set; } + + [ForeignKey("TransformationClassId")] + [InverseProperty("CmsTransformations")] + public virtual CmsClass TransformationClass { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsTranslationService.cs b/Migration.Tool.KX12/Models/CmsTranslationService.cs new file mode 100644 index 00000000..75efd0d8 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsTranslationService.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_TranslationService")] +public class CmsTranslationService +{ + [Key] + [Column("TranslationServiceID")] + public int TranslationServiceId { get; set; } + + [StringLength(200)] + public string TranslationServiceAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceClassName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceDisplayName { get; set; } = null!; + + public bool TranslationServiceIsMachine { get; set; } + + public DateTime TranslationServiceLastModified { get; set; } + + [Column("TranslationServiceGUID")] + public Guid TranslationServiceGuid { get; set; } + + public bool TranslationServiceEnabled { get; set; } + + public bool? TranslationServiceSupportsInstructions { get; set; } + + public bool? TranslationServiceSupportsPriority { get; set; } + + public bool? TranslationServiceSupportsDeadline { get; set; } + + public bool? TranslationServiceGenerateTargetTag { get; set; } + + [StringLength(1000)] + public string? TranslationServiceParameter { get; set; } + + public bool? TranslationServiceSupportsStatusUpdate { get; set; } + + public bool? TranslationServiceSupportsCancel { get; set; } + + [InverseProperty("SubmissionService")] + public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsTranslationSubmission.cs b/Migration.Tool.KX12/Models/CmsTranslationSubmission.cs new file mode 100644 index 00000000..3870e504 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsTranslationSubmission.cs @@ -0,0 +1,75 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_TranslationSubmission")] +[Index("SubmissionServiceId", Name = "IX_CMS_TranslationSubmission_SubmissionServiceID")] +[Index("SubmissionSubmittedByUserId", Name = "IX_CMS_TranslationSubmission_SubmissionSubmittedByUserID")] +public class CmsTranslationSubmission +{ + [Key] + [Column("SubmissionID")] + public int SubmissionId { get; set; } + + [StringLength(200)] + public string SubmissionName { get; set; } = null!; + + [StringLength(200)] + public string? SubmissionTicket { get; set; } + + public int SubmissionStatus { get; set; } + + [Column("SubmissionServiceID")] + public int SubmissionServiceId { get; set; } + + [StringLength(10)] + public string SubmissionSourceCulture { get; set; } = null!; + + public string SubmissionTargetCulture { get; set; } = null!; + + public int SubmissionPriority { get; set; } + + public DateTime? SubmissionDeadline { get; set; } + + [StringLength(500)] + public string? SubmissionInstructions { get; set; } + + public DateTime SubmissionLastModified { get; set; } + + [Column("SubmissionGUID")] + public Guid SubmissionGuid { get; set; } + + [Column("SubmissionSiteID")] + public int? SubmissionSiteId { get; set; } + + public double? SubmissionPrice { get; set; } + + public string? SubmissionStatusMessage { get; set; } + + public bool? SubmissionTranslateAttachments { get; set; } + + public int SubmissionItemCount { get; set; } + + public DateTime SubmissionDate { get; set; } + + public int? SubmissionWordCount { get; set; } + + public int? SubmissionCharCount { get; set; } + + [Column("SubmissionSubmittedByUserID")] + public int? SubmissionSubmittedByUserId { get; set; } + + [InverseProperty("SubmissionItemSubmission")] + public virtual ICollection CmsTranslationSubmissionItems { get; set; } = new List(); + + [ForeignKey("SubmissionServiceId")] + [InverseProperty("CmsTranslationSubmissions")] + public virtual CmsTranslationService SubmissionService { get; set; } = null!; + + [ForeignKey("SubmissionSubmittedByUserId")] + [InverseProperty("CmsTranslationSubmissions")] + public virtual CmsUser? SubmissionSubmittedByUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsTranslationSubmissionItem.cs b/Migration.Tool.KX12/Models/CmsTranslationSubmissionItem.cs new file mode 100644 index 00000000..7a267d14 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsTranslationSubmissionItem.cs @@ -0,0 +1,57 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_TranslationSubmissionItem")] +[Index("SubmissionItemSubmissionId", Name = "IX_CMS_TranslationSubmissionItem_SubmissionItemSubmissionID")] +public class CmsTranslationSubmissionItem +{ + [Key] + [Column("SubmissionItemID")] + public int SubmissionItemId { get; set; } + + [Column("SubmissionItemSubmissionID")] + public int SubmissionItemSubmissionId { get; set; } + + [Column("SubmissionItemSourceXLIFF")] + public string? SubmissionItemSourceXliff { get; set; } + + [Column("SubmissionItemTargetXLIFF")] + public string? SubmissionItemTargetXliff { get; set; } + + [StringLength(100)] + public string SubmissionItemObjectType { get; set; } = null!; + + [Column("SubmissionItemObjectID")] + public int SubmissionItemObjectId { get; set; } + + [Column("SubmissionItemGUID")] + public Guid SubmissionItemGuid { get; set; } + + public DateTime SubmissionItemLastModified { get; set; } + + [StringLength(200)] + public string SubmissionItemName { get; set; } = null!; + + public int? SubmissionItemWordCount { get; set; } + + public int? SubmissionItemCharCount { get; set; } + + public string? SubmissionItemCustomData { get; set; } + + [Column("SubmissionItemTargetObjectID")] + public int SubmissionItemTargetObjectId { get; set; } + + [StringLength(50)] + public string? SubmissionItemType { get; set; } + + [StringLength(10)] + public string? SubmissionItemTargetCulture { get; set; } + + [ForeignKey("SubmissionItemSubmissionId")] + [InverseProperty("CmsTranslationSubmissionItems")] + public virtual CmsTranslationSubmission SubmissionItemSubmission { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsTree.cs b/Migration.Tool.KX12/Models/CmsTree.cs new file mode 100644 index 00000000..18cac4b2 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsTree.cs @@ -0,0 +1,183 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Tree")] +[Index("NodeAclid", Name = "IX_CMS_Tree_NodeACLID")] +[Index("NodeAliasPath", Name = "IX_CMS_Tree_NodeAliasPath")] +[Index("NodeClassId", Name = "IX_CMS_Tree_NodeClassID")] +[Index("NodeGroupId", Name = "IX_CMS_Tree_NodeGroupID")] +[Index("NodeLevel", Name = "IX_CMS_Tree_NodeLevel")] +[Index("NodeLinkedNodeId", Name = "IX_CMS_Tree_NodeLinkedNodeID")] +[Index("NodeLinkedNodeSiteId", Name = "IX_CMS_Tree_NodeLinkedNodeSiteID")] +[Index("NodeOriginalNodeId", Name = "IX_CMS_Tree_NodeOriginalNodeID")] +[Index("NodeOwner", Name = "IX_CMS_Tree_NodeOwner")] +[Index("NodeParentId", "NodeAlias", "NodeName", Name = "IX_CMS_Tree_NodeParentID_NodeAlias_NodeName")] +[Index("NodeSkuid", Name = "IX_CMS_Tree_NodeSKUID")] +[Index("NodeSiteId", "NodeGuid", Name = "IX_CMS_Tree_NodeSiteID_NodeGUID", IsUnique = true)] +[Index("NodeTemplateId", Name = "IX_CMS_Tree_NodeTemplateID")] +public class CmsTree +{ + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + public string NodeAliasPath { get; set; } = null!; + + [StringLength(100)] + public string NodeName { get; set; } = null!; + + [StringLength(50)] + public string NodeAlias { get; set; } = null!; + + [Column("NodeClassID")] + public int NodeClassId { get; set; } + + [Column("NodeParentID")] + public int? NodeParentId { get; set; } + + public int NodeLevel { get; set; } + + [Column("NodeACLID")] + public int? NodeAclid { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeGUID")] + public Guid NodeGuid { get; set; } + + public int? NodeOrder { get; set; } + + public bool? IsSecuredNode { get; set; } + + public int? NodeCacheMinutes { get; set; } + + [Column("NodeSKUID")] + public int? NodeSkuid { get; set; } + + public string? NodeDocType { get; set; } + + public string? NodeHeadTags { get; set; } + + public string? NodeBodyElementAttributes { get; set; } + + [StringLength(200)] + public string? NodeInheritPageLevels { get; set; } + + [Column("RequiresSSL")] + public int? RequiresSsl { get; set; } + + [Column("NodeLinkedNodeID")] + public int? NodeLinkedNodeId { get; set; } + + public int? NodeOwner { get; set; } + + public string? NodeCustomData { get; set; } + + [Column("NodeGroupID")] + public int? NodeGroupId { get; set; } + + [Column("NodeLinkedNodeSiteID")] + public int? NodeLinkedNodeSiteId { get; set; } + + [Column("NodeTemplateID")] + public int? NodeTemplateId { get; set; } + + public bool? NodeTemplateForAllCultures { get; set; } + + public bool? NodeInheritPageTemplate { get; set; } + + public bool? NodeAllowCacheInFileSystem { get; set; } + + public bool? NodeHasChildren { get; set; } + + public bool? NodeHasLinks { get; set; } + + [Column("NodeOriginalNodeID")] + public int? NodeOriginalNodeId { get; set; } + + public bool NodeIsContentOnly { get; set; } + + [Column("NodeIsACLOwner")] + public bool NodeIsAclowner { get; set; } + + public string? NodeBodyScripts { get; set; } + + [InverseProperty("AliasNode")] + public virtual ICollection CmsDocumentAliases { get; set; } = new List(); + + [InverseProperty("DocumentNode")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("LeftNode")] + public virtual ICollection CmsRelationshipLeftNodes { get; set; } = new List(); + + [InverseProperty("RightNode")] + public virtual ICollection CmsRelationshipRightNodes { get; set; } = new List(); + + [InverseProperty("Node")] + public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); + + [InverseProperty("AttendeeEventNode")] + public virtual ICollection EventsAttendees { get; set; } = new List(); + + [InverseProperty("NodeLinkedNode")] + public virtual ICollection InverseNodeLinkedNode { get; set; } = new List(); + + [InverseProperty("NodeOriginalNode")] + public virtual ICollection InverseNodeOriginalNode { get; set; } = new List(); + + [InverseProperty("NodeParent")] + public virtual ICollection InverseNodeParent { get; set; } = new List(); + + [ForeignKey("NodeAclid")] + [InverseProperty("CmsTrees")] + public virtual CmsAcl? NodeAcl { get; set; } + + [ForeignKey("NodeClassId")] + [InverseProperty("CmsTrees")] + public virtual CmsClass NodeClass { get; set; } = null!; + + [ForeignKey("NodeGroupId")] + [InverseProperty("CmsTrees")] + public virtual CommunityGroup? NodeGroup { get; set; } + + [ForeignKey("NodeLinkedNodeId")] + [InverseProperty("InverseNodeLinkedNode")] + public virtual CmsTree? NodeLinkedNode { get; set; } + + [ForeignKey("NodeLinkedNodeSiteId")] + [InverseProperty("CmsTreeNodeLinkedNodeSites")] + public virtual CmsSite? NodeLinkedNodeSite { get; set; } + + [ForeignKey("NodeOriginalNodeId")] + [InverseProperty("InverseNodeOriginalNode")] + public virtual CmsTree? NodeOriginalNode { get; set; } + + [ForeignKey("NodeOwner")] + [InverseProperty("CmsTrees")] + public virtual CmsUser? NodeOwnerNavigation { get; set; } + + [ForeignKey("NodeParentId")] + [InverseProperty("InverseNodeParent")] + public virtual CmsTree? NodeParent { get; set; } + + [ForeignKey("NodeSiteId")] + [InverseProperty("CmsTreeNodeSites")] + public virtual CmsSite NodeSite { get; set; } = null!; + + [ForeignKey("NodeSkuid")] + [InverseProperty("CmsTrees")] + public virtual ComSku? NodeSku { get; set; } + + [ForeignKey("NodeTemplateId")] + [InverseProperty("CmsTrees")] + public virtual CmsPageTemplate? NodeTemplate { get; set; } + + [InverseProperty("Node")] + public virtual ICollection PersonasPersonaNodes { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsUielement.cs b/Migration.Tool.KX12/Models/CmsUielement.cs new file mode 100644 index 00000000..21d764c9 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsUielement.cs @@ -0,0 +1,115 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_UIElement")] +[Index("ElementGuid", Name = "IX_CMS_UIElement_ElementGUID", IsUnique = true)] +[Index("ElementPageTemplateId", Name = "IX_CMS_UIElement_ElementPageTemplateID")] +[Index("ElementParentId", Name = "IX_CMS_UIElement_ElementParentID")] +public class CmsUielement +{ + [Key] + [Column("ElementID")] + public int ElementId { get; set; } + + [StringLength(200)] + public string ElementDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ElementName { get; set; } = null!; + + [StringLength(200)] + public string? ElementCaption { get; set; } + + [Column("ElementTargetURL")] + [StringLength(650)] + public string? ElementTargetUrl { get; set; } + + [Column("ElementResourceID")] + public int ElementResourceId { get; set; } + + [Column("ElementParentID")] + public int? ElementParentId { get; set; } + + public int ElementChildCount { get; set; } + + public int? ElementOrder { get; set; } + + public int ElementLevel { get; set; } + + [Column("ElementIDPath")] + [StringLength(450)] + public string ElementIdpath { get; set; } = null!; + + [StringLength(200)] + public string? ElementIconPath { get; set; } + + public bool? ElementIsCustom { get; set; } + + public DateTime ElementLastModified { get; set; } + + [Column("ElementGUID")] + public Guid ElementGuid { get; set; } + + public int? ElementSize { get; set; } + + public string? ElementDescription { get; set; } + + [StringLength(20)] + public string? ElementFromVersion { get; set; } + + [Column("ElementPageTemplateID")] + public int? ElementPageTemplateId { get; set; } + + [StringLength(50)] + public string? ElementType { get; set; } + + public string? ElementProperties { get; set; } + + public bool? ElementIsMenu { get; set; } + + [StringLength(200)] + public string? ElementFeature { get; set; } + + [StringLength(100)] + public string? ElementIconClass { get; set; } + + public bool? ElementIsGlobalApplication { get; set; } + + public bool? ElementCheckModuleReadPermission { get; set; } + + public string? ElementAccessCondition { get; set; } + + public string? ElementVisibilityCondition { get; set; } + + public bool ElementRequiresGlobalAdminPriviligeLevel { get; set; } + + [InverseProperty("HelpTopicUielement")] + public virtual ICollection CmsHelpTopics { get; set; } = new List(); + + [ForeignKey("ElementPageTemplateId")] + [InverseProperty("CmsUielements")] + public virtual CmsPageTemplate? ElementPageTemplate { get; set; } + + [ForeignKey("ElementParentId")] + [InverseProperty("InverseElementParent")] + public virtual CmsUielement? ElementParent { get; set; } + + [ForeignKey("ElementResourceId")] + [InverseProperty("CmsUielements")] + public virtual CmsResource ElementResource { get; set; } = null!; + + [InverseProperty("ElementParent")] + public virtual ICollection InverseElementParent { get; set; } = new List(); + + [ForeignKey("ElementId")] + [InverseProperty("Elements")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("ElementId")] + [InverseProperty("ElementsNavigation")] + public virtual ICollection RolesNavigation { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsUser.cs b/Migration.Tool.KX12/Models/CmsUser.cs new file mode 100644 index 00000000..06e04635 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsUser.cs @@ -0,0 +1,305 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_User")] +[Index("Email", Name = "IX_CMS_User_Email")] +[Index("FullName", Name = "IX_CMS_User_FullName")] +[Index("UserEnabled", "UserIsHidden", Name = "IX_CMS_User_UserEnabled_UserIsHidden")] +[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] +[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] +[Index("UserPrivilegeLevel", Name = "IX_CMS_User_UserPrivilegeLevel")] +public class CmsUser +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [InverseProperty("CommentApprovedByUser")] + public virtual ICollection BlogCommentCommentApprovedByUsers { get; set; } = new List(); + + [InverseProperty("CommentUser")] + public virtual ICollection BlogCommentCommentUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); + + [InverseProperty("BoardUser")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("MessageApprovedByUser")] + public virtual ICollection BoardMessageMessageApprovedByUsers { get; set; } = new List(); + + [InverseProperty("MessageUser")] + public virtual ICollection BoardMessageMessageUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection BoardSubscriptions { get; set; } = new List(); + + [InverseProperty("InitiatedChatRequestUser")] + public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); + + [InverseProperty("ChatUserUser")] + public virtual ICollection ChatUsers { get; set; } = new List(); + + [InverseProperty("ReportUser")] + public virtual ICollection CmsAbuseReports { get; set; } = new List(); + + [InverseProperty("LastModifiedByUser")] + public virtual ICollection CmsAclitemLastModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsAclitemUsers { get; set; } = new List(); + + [InverseProperty("HistoryApprovedByUser")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateUser")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("CategoryUser")] + public virtual ICollection CmsCategories { get; set; } = new List(); + + [InverseProperty("DocumentCheckedOutByUser")] + public virtual ICollection CmsDocumentDocumentCheckedOutByUsers { get; set; } = new List(); + + [InverseProperty("DocumentCreatedByUser")] + public virtual ICollection CmsDocumentDocumentCreatedByUsers { get; set; } = new List(); + + [InverseProperty("DocumentModifiedByUser")] + public virtual ICollection CmsDocumentDocumentModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsEmailUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsExternalLogins { get; set; } = new List(); + + [InverseProperty("MacroIdentityEffectiveUser")] + public virtual ICollection CmsMacroIdentities { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsMembershipUsers { get; set; } = new List(); + + [InverseProperty("ObjectCheckedOutByUser")] + public virtual ICollection CmsObjectSettings { get; set; } = new List(); + + [InverseProperty("VersionDeletedByUser")] + public virtual ICollection CmsObjectVersionHistoryVersionDeletedByUsers { get; set; } = new List(); + + [InverseProperty("VersionModifiedByUser")] + public virtual ICollection CmsObjectVersionHistoryVersionModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsOpenIdusers { get; set; } = new List(); + + [InverseProperty("PersonalizationUser")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [InverseProperty("TaskUser")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("SessionUser")] + public virtual ICollection CmsSessions { get; set; } = new List(); + + [InverseProperty("SubmissionSubmittedByUser")] + public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); + + [InverseProperty("NodeOwnerNavigation")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("UserMacroIdentityUser")] + public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } + + [InverseProperty("User")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("UserActivatedByUser")] + public virtual ICollection CmsUserSettingUserActivatedByUsers { get; set; } = new List(); + + [InverseProperty("UserSettingsUserNavigation")] + public virtual CmsUserSetting? CmsUserSettingUserSettingsUserNavigation { get; set; } + + public virtual ICollection CmsUserSettingUserSettingsUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsUserSites { get; set; } = new List(); + + [InverseProperty("ModifiedByUser")] + public virtual ICollection CmsVersionHistoryModifiedByUsers { get; set; } = new List(); + + [InverseProperty("VersionDeletedByUser")] + public virtual ICollection CmsVersionHistoryVersionDeletedByUsers { get; set; } = new List(); + + [InverseProperty("ApprovedByUser")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); + + [InverseProperty("CustomerUser")] + public virtual ICollection ComCustomers { get; set; } = new List(); + + [InverseProperty("ChangedByUser")] + public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); + + [InverseProperty("OrderCreatedByUser")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartUser")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("GroupApprovedByUser")] + public virtual ICollection CommunityGroupGroupApprovedByUsers { get; set; } = new List(); + + [InverseProperty("GroupCreatedByUser")] + public virtual ICollection CommunityGroupGroupCreatedByUsers { get; set; } = new List(); + + [InverseProperty("MemberApprovedByUser")] + public virtual ICollection CommunityGroupMemberMemberApprovedByUsers { get; set; } = new List(); + + [InverseProperty("MemberInvitedByUser")] + public virtual ICollection CommunityGroupMemberMemberInvitedByUsers { get; set; } = new List(); + + [InverseProperty("MemberUser")] + public virtual ICollection CommunityGroupMemberMemberUsers { get; set; } = new List(); + + [InverseProperty("InvitedByUser")] + public virtual ICollection CommunityInvitationInvitedByUsers { get; set; } = new List(); + + [InverseProperty("InvitedUser")] + public virtual ICollection CommunityInvitationInvitedUsers { get; set; } = new List(); + + [InverseProperty("ExportUser")] + public virtual ICollection ExportHistories { get; set; } = new List(); + + [InverseProperty("PostApprovedByUser")] + public virtual ICollection ForumsForumPostPostApprovedByUsers { get; set; } = new List(); + + [InverseProperty("PostUser")] + public virtual ICollection ForumsForumPostPostUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [InverseProperty("FileCreatedByUser")] + public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); + + [InverseProperty("FileModifiedByUser")] + public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("AccountOwnerUser")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactOwnerUser")] + public virtual ICollection OmContacts { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionUser")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("SavedReportCreatedByUser")] + public virtual ICollection ReportingSavedReports { get; set; } = new List(); + + [InverseProperty("User")] + public virtual StagingTaskGroupUser? StagingTaskGroupUser { get; set; } + + [InverseProperty("User")] + public virtual ICollection StagingTaskUsers { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Boards { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Forums { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Workflows { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsUserCulture.cs b/Migration.Tool.KX12/Models/CmsUserCulture.cs new file mode 100644 index 00000000..6bd1b1fa --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsUserCulture.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[PrimaryKey("UserId", "CultureId", "SiteId")] +[Table("CMS_UserCulture")] +[Index("CultureId", Name = "IX_CMS_UserCulture_CultureID")] +[Index("SiteId", Name = "IX_CMS_UserCulture_SiteID")] +public class CmsUserCulture +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("CultureId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsCulture Culture { get; set; } = null!; + + [ForeignKey("SiteId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsUserMacroIdentity.cs b/Migration.Tool.KX12/Models/CmsUserMacroIdentity.cs new file mode 100644 index 00000000..5bfa9d8c --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsUserMacroIdentity.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_UserMacroIdentity")] +[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] +[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] +public class CmsUserMacroIdentity +{ + [Key] + [Column("UserMacroIdentityID")] + public int UserMacroIdentityId { get; set; } + + public DateTime UserMacroIdentityLastModified { get; set; } + + [Column("UserMacroIdentityUserID")] + public int UserMacroIdentityUserId { get; set; } + + [Column("UserMacroIdentityMacroIdentityID")] + public int? UserMacroIdentityMacroIdentityId { get; set; } + + public Guid UserMacroIdentityUserGuid { get; set; } + + [ForeignKey("UserMacroIdentityMacroIdentityId")] + [InverseProperty("CmsUserMacroIdentities")] + public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } + + [ForeignKey("UserMacroIdentityUserId")] + [InverseProperty("CmsUserMacroIdentity")] + public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsUserRole.cs b/Migration.Tool.KX12/Models/CmsUserRole.cs new file mode 100644 index 00000000..378fcf7b --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsUserRole.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_UserRole")] +[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] +[Index("RoleId", "ValidTo", "UserId", Name = "IX_CMS_UserRole_UserID")] +[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] +public class CmsUserRole +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } + + [Key] + [Column("UserRoleID")] + public int UserRoleId { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsUserSetting.cs b/Migration.Tool.KX12/Models/CmsUserSetting.cs new file mode 100644 index 00000000..b755f116 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsUserSetting.cs @@ -0,0 +1,167 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_UserSettings")] +[Index("UserActivatedByUserId", Name = "IX_CMS_UserSettings_UserActivatedByUserID")] +[Index("UserAuthenticationGuid", Name = "IX_CMS_UserSettings_UserAuthenticationGUID")] +[Index("UserAvatarId", Name = "IX_CMS_UserSettings_UserAvatarID")] +[Index("UserBadgeId", Name = "IX_CMS_UserSettings_UserBadgeID")] +[Index("UserFacebookId", Name = "IX_CMS_UserSettings_UserFacebookID")] +[Index("UserGender", Name = "IX_CMS_UserSettings_UserGender")] +[Index("UserNickName", Name = "IX_CMS_UserSettings_UserNickName")] +[Index("UserPasswordRequestHash", Name = "IX_CMS_UserSettings_UserPasswordRequestHash")] +[Index("UserSettingsUserGuid", Name = "IX_CMS_UserSettings_UserSettingsUserGUID")] +[Index("UserSettingsUserId", Name = "IX_CMS_UserSettings_UserSettingsUserID", IsUnique = true)] +[Index("UserTimeZoneId", Name = "IX_CMS_UserSettings_UserTimeZoneID")] +[Index("UserWaitingForApproval", Name = "IX_CMS_UserSettings_UserWaitingForApproval")] +[Index("WindowsLiveId", Name = "IX_CMS_UserSettings_WindowsLiveID")] +public class CmsUserSetting +{ + [Key] + [Column("UserSettingsID")] + public int UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [ForeignKey("UserActivatedByUserId")] + [InverseProperty("CmsUserSettingUserActivatedByUsers")] + public virtual CmsUser? UserActivatedByUser { get; set; } + + [ForeignKey("UserAvatarId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsAvatar? UserAvatar { get; set; } + + [ForeignKey("UserBadgeId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsBadge? UserBadge { get; set; } + + public virtual CmsUser UserSettingsUser { get; set; } = null!; + + [ForeignKey("UserSettingsUserId")] + [InverseProperty("CmsUserSettingUserSettingsUserNavigation")] + public virtual CmsUser UserSettingsUserNavigation { get; set; } = null!; + + [ForeignKey("UserTimeZoneId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsTimeZone? UserTimeZone { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsUserSite.cs b/Migration.Tool.KX12/Models/CmsUserSite.cs new file mode 100644 index 00000000..37b24222 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsUserSite.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_UserSite")] +[Index("SiteId", Name = "IX_CMS_UserSite_SiteID")] +[Index("UserId", "SiteId", Name = "IX_CMS_UserSite_UserID_SiteID", IsUnique = true)] +public class CmsUserSite +{ + [Key] + [Column("UserSiteID")] + public int UserSiteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsUserSites")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserSites")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsVersionHistory.cs b/Migration.Tool.KX12/Models/CmsVersionHistory.cs new file mode 100644 index 00000000..44c7f9d1 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsVersionHistory.cs @@ -0,0 +1,116 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_VersionHistory")] +[Index("ModifiedByUserId", Name = "IX_CMS_VersionHistory_ModifiedByUserID")] +[Index("NodeSiteId", Name = "IX_CMS_VersionHistory_NodeSiteID")] +[Index("ToBePublished", "PublishFrom", "PublishTo", Name = "IX_CMS_VersionHistory_ToBePublished_PublishFrom_PublishTo")] +[Index("VersionClassId", Name = "IX_CMS_VersionHistory_VersionClassID")] +[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_VersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionWorkflowId", Name = "IX_CMS_VersionHistory_VersionWorkflowID")] +[Index("VersionWorkflowStepId", Name = "IX_CMS_VersionHistory_VersionWorkflowStepID")] +public class CmsVersionHistory +{ + [Key] + [Column("VersionHistoryID")] + public int VersionHistoryId { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("DocumentID")] + public int? DocumentId { get; set; } + + [StringLength(450)] + public string DocumentNamePath { get; set; } = null!; + + [Column("NodeXML")] + public string NodeXml { get; set; } = null!; + + [Column("ModifiedByUserID")] + public int? ModifiedByUserId { get; set; } + + public DateTime ModifiedWhen { get; set; } + + [StringLength(50)] + public string? VersionNumber { get; set; } + + public string? VersionComment { get; set; } + + public bool ToBePublished { get; set; } + + public DateTime? PublishFrom { get; set; } + + public DateTime? PublishTo { get; set; } + + public DateTime? WasPublishedFrom { get; set; } + + public DateTime? WasPublishedTo { get; set; } + + [StringLength(100)] + public string? VersionDocumentName { get; set; } + + [StringLength(50)] + public string? VersionDocumentType { get; set; } + + [Column("VersionClassID")] + public int? VersionClassId { get; set; } + + [StringLength(450)] + public string? VersionMenuRedirectUrl { get; set; } + + [Column("VersionWorkflowID")] + public int? VersionWorkflowId { get; set; } + + [Column("VersionWorkflowStepID")] + public int? VersionWorkflowStepId { get; set; } + + [StringLength(450)] + public string? VersionNodeAliasPath { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [InverseProperty("DocumentCheckedOutVersionHistory")] + public virtual ICollection CmsDocumentDocumentCheckedOutVersionHistories { get; set; } = new List(); + + [InverseProperty("DocumentPublishedVersionHistory")] + public virtual ICollection CmsDocumentDocumentPublishedVersionHistories { get; set; } = new List(); + + [InverseProperty("VersionHistory")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [ForeignKey("ModifiedByUserId")] + [InverseProperty("CmsVersionHistoryModifiedByUsers")] + public virtual CmsUser? ModifiedByUser { get; set; } + + [ForeignKey("NodeSiteId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsSite NodeSite { get; set; } = null!; + + [ForeignKey("VersionClassId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsClass? VersionClass { get; set; } + + [ForeignKey("VersionDeletedByUserId")] + [InverseProperty("CmsVersionHistoryVersionDeletedByUsers")] + public virtual CmsUser? VersionDeletedByUser { get; set; } + + [ForeignKey("VersionWorkflowId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsWorkflow? VersionWorkflow { get; set; } + + [ForeignKey("VersionWorkflowStepId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsWorkflowStep? VersionWorkflowStep { get; set; } + + [ForeignKey("VersionHistoryId")] + [InverseProperty("VersionHistories")] + public virtual ICollection AttachmentHistories { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsWebFarmServer.cs b/Migration.Tool.KX12/Models/CmsWebFarmServer.cs new file mode 100644 index 00000000..f40070f0 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWebFarmServer.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WebFarmServer")] +[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] +public class CmsWebFarmServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(300)] + public string ServerDisplayName { get; set; } = null!; + + [StringLength(300)] + public string ServerName { get; set; } = null!; + + [Column("ServerGUID")] + public Guid? ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public bool ServerEnabled { get; set; } + + public bool IsExternalWebAppServer { get; set; } + + [InverseProperty("Server")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsWebFarmServerLog.cs b/Migration.Tool.KX12/Models/CmsWebFarmServerLog.cs new file mode 100644 index 00000000..22de549f --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWebFarmServerLog.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WebFarmServerLog")] +public class CmsWebFarmServerLog +{ + [Key] + [Column("WebFarmServerLogID")] + public int WebFarmServerLogId { get; set; } + + public DateTime LogTime { get; set; } + + [StringLength(200)] + public string LogCode { get; set; } = null!; + + [Column("ServerID")] + public int ServerId { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsWebFarmServerMonitoring.cs b/Migration.Tool.KX12/Models/CmsWebFarmServerMonitoring.cs new file mode 100644 index 00000000..ae471583 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWebFarmServerMonitoring.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WebFarmServerMonitoring")] +public class CmsWebFarmServerMonitoring +{ + [Key] + [Column("WebFarmServerMonitoringID")] + public int WebFarmServerMonitoringId { get; set; } + + [Column("ServerID")] + public int ServerId { get; set; } + + public DateTime? ServerPing { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsWebFarmServerTask.cs b/Migration.Tool.KX12/Models/CmsWebFarmServerTask.cs new file mode 100644 index 00000000..7c612b52 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWebFarmServerTask.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[PrimaryKey("ServerId", "TaskId")] +[Table("CMS_WebFarmServerTask")] +[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] +public class CmsWebFarmServerTask +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + public string? ErrorMessage { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmServer Server { get; set; } = null!; + + [ForeignKey("TaskId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmTask Task { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsWebFarmTask.cs b/Migration.Tool.KX12/Models/CmsWebFarmTask.cs new file mode 100644 index 00000000..b8fe71d7 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWebFarmTask.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WebFarmTask")] +[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] +public class CmsWebFarmTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(100)] + public string TaskType { get; set; } = null!; + + public string? TaskTextData { get; set; } + + public byte[]? TaskBinaryData { get; set; } + + public DateTime? TaskCreated { get; set; } + + public string? TaskTarget { get; set; } + + [StringLength(450)] + public string? TaskMachineName { get; set; } + + [Column("TaskGUID")] + public Guid? TaskGuid { get; set; } + + public bool? TaskIsAnonymous { get; set; } + + public string? TaskErrorMessage { get; set; } + + public bool? TaskIsMemory { get; set; } + + [InverseProperty("Task")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsWebPart.cs b/Migration.Tool.KX12/Models/CmsWebPart.cs new file mode 100644 index 00000000..009143f1 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWebPart.cs @@ -0,0 +1,85 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WebPart")] +[Index("WebPartCategoryId", Name = "IX_CMS_WebPart_WebPartCategoryID")] +[Index("WebPartName", Name = "IX_CMS_WebPart_WebPartName")] +[Index("WebPartParentId", Name = "IX_CMS_WebPart_WebPartParentID")] +[Index("WebPartResourceId", Name = "IX_CMS_WebPart_WebPartResourceID")] +public class CmsWebPart +{ + [Key] + [Column("WebPartID")] + public int WebPartId { get; set; } + + [StringLength(100)] + public string WebPartName { get; set; } = null!; + + [StringLength(100)] + public string WebPartDisplayName { get; set; } = null!; + + public string? WebPartDescription { get; set; } + + [StringLength(100)] + public string WebPartFileName { get; set; } = null!; + + public string WebPartProperties { get; set; } = null!; + + [Column("WebPartCategoryID")] + public int WebPartCategoryId { get; set; } + + [Column("WebPartParentID")] + public int? WebPartParentId { get; set; } + + public string? WebPartDocumentation { get; set; } + + [Column("WebPartGUID")] + public Guid WebPartGuid { get; set; } + + public DateTime WebPartLastModified { get; set; } + + public int? WebPartType { get; set; } + + public string? WebPartDefaultValues { get; set; } + + [Column("WebPartResourceID")] + public int? WebPartResourceId { get; set; } + + [Column("WebPartCSS")] + public string? WebPartCss { get; set; } + + public bool? WebPartSkipInsertProperties { get; set; } + + [Column("WebPartThumbnailGUID")] + public Guid? WebPartThumbnailGuid { get; set; } + + public string? WebPartDefaultConfiguration { get; set; } + + [StringLength(200)] + public string? WebPartIconClass { get; set; } + + [InverseProperty("WebPartLayoutWebPart")] + public virtual ICollection CmsWebPartLayouts { get; set; } = new List(); + + [InverseProperty("WidgetWebPart")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [InverseProperty("WebPartParent")] + public virtual ICollection InverseWebPartParent { get; set; } = new List(); + + [ForeignKey("WebPartCategoryId")] + [InverseProperty("CmsWebParts")] + public virtual CmsWebPartCategory WebPartCategory { get; set; } = null!; + + [ForeignKey("WebPartParentId")] + [InverseProperty("InverseWebPartParent")] + public virtual CmsWebPart? WebPartParent { get; set; } + + [ForeignKey("WebPartResourceId")] + [InverseProperty("CmsWebParts")] + public virtual CmsResource? WebPartResource { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsWebPartCategory.cs b/Migration.Tool.KX12/Models/CmsWebPartCategory.cs new file mode 100644 index 00000000..7353a869 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWebPartCategory.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WebPartCategory")] +[Index("CategoryParentId", Name = "IX_CMS_WebPartCategory_CategoryParentID")] +public class CmsWebPartCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(100)] + public string CategoryDisplayName { get; set; } = null!; + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(100)] + public string CategoryName { get; set; } = null!; + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public string CategoryPath { get; set; } = null!; + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryWebPartChildCount { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsWebPartCategory? CategoryParent { get; set; } + + [InverseProperty("WebPartCategory")] + public virtual ICollection CmsWebParts { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsWebPartContainer.cs b/Migration.Tool.KX12/Models/CmsWebPartContainer.cs new file mode 100644 index 00000000..87992200 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWebPartContainer.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WebPartContainer")] +[Index("ContainerName", Name = "IX_CMS_WebPartContainer_ContainerName")] +public class CmsWebPartContainer +{ + [Key] + [Column("ContainerID")] + public int ContainerId { get; set; } + + [StringLength(200)] + public string ContainerDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ContainerName { get; set; } = null!; + + public string? ContainerTextBefore { get; set; } + + public string? ContainerTextAfter { get; set; } + + [Column("ContainerGUID")] + public Guid ContainerGuid { get; set; } + + public DateTime ContainerLastModified { get; set; } + + [Column("ContainerCSS")] + public string? ContainerCss { get; set; } + + [ForeignKey("ContainerId")] + [InverseProperty("Containers")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsWebPartLayout.cs b/Migration.Tool.KX12/Models/CmsWebPartLayout.cs new file mode 100644 index 00000000..c076fd3e --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWebPartLayout.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WebPartLayout")] +[Index("WebPartLayoutWebPartId", Name = "IX_CMS_WebPartLayout_WebPartLayoutWebPartID")] +public class CmsWebPartLayout +{ + [Key] + [Column("WebPartLayoutID")] + public int WebPartLayoutId { get; set; } + + [StringLength(200)] + public string WebPartLayoutCodeName { get; set; } = null!; + + [StringLength(200)] + public string WebPartLayoutDisplayName { get; set; } = null!; + + public string? WebPartLayoutDescription { get; set; } + + public string? WebPartLayoutCode { get; set; } + + [Column("WebPartLayoutVersionGUID")] + [StringLength(100)] + public string? WebPartLayoutVersionGuid { get; set; } + + [Column("WebPartLayoutWebPartID")] + public int WebPartLayoutWebPartId { get; set; } + + [Column("WebPartLayoutGUID")] + public Guid WebPartLayoutGuid { get; set; } + + public DateTime WebPartLayoutLastModified { get; set; } + + [Column("WebPartLayoutCSS")] + public string? WebPartLayoutCss { get; set; } + + public bool? WebPartLayoutIsDefault { get; set; } + + [InverseProperty("WidgetLayout")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [ForeignKey("WebPartLayoutWebPartId")] + [InverseProperty("CmsWebPartLayouts")] + public virtual CmsWebPart WebPartLayoutWebPart { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsWebTemplate.cs b/Migration.Tool.KX12/Models/CmsWebTemplate.cs new file mode 100644 index 00000000..94de3edf --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWebTemplate.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WebTemplate")] +public class CmsWebTemplate +{ + [Key] + [Column("WebTemplateID")] + public int WebTemplateId { get; set; } + + [StringLength(200)] + public string WebTemplateDisplayName { get; set; } = null!; + + [StringLength(100)] + public string WebTemplateFileName { get; set; } = null!; + + public string WebTemplateDescription { get; set; } = null!; + + [Column("WebTemplateGUID")] + public Guid WebTemplateGuid { get; set; } + + public DateTime WebTemplateLastModified { get; set; } + + [StringLength(100)] + public string WebTemplateName { get; set; } = null!; + + public int WebTemplateOrder { get; set; } + + [StringLength(200)] + public string WebTemplateLicenses { get; set; } = null!; + + [Column("WebTemplateThumbnailGUID")] + public Guid? WebTemplateThumbnailGuid { get; set; } + + public string? WebTemplateShortDescription { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsWidget.cs b/Migration.Tool.KX12/Models/CmsWidget.cs new file mode 100644 index 00000000..2b6b9934 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWidget.cs @@ -0,0 +1,83 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Widget")] +[Index("WidgetCategoryId", Name = "IX_CMS_Widget_WidgetCategoryID")] +[Index("WidgetIsEnabled", "WidgetForGroup", "WidgetForEditor", "WidgetForUser", Name = "IX_CMS_Widget_WidgetIsEnabled_WidgetForGroup_WidgetForEditor_WidgetForUser")] +[Index("WidgetLayoutId", Name = "IX_CMS_Widget_WidgetLayoutID")] +[Index("WidgetWebPartId", Name = "IX_CMS_Widget_WidgetWebPartID")] +public class CmsWidget +{ + [Key] + [Column("WidgetID")] + public int WidgetId { get; set; } + + [Column("WidgetWebPartID")] + public int WidgetWebPartId { get; set; } + + [StringLength(100)] + public string WidgetDisplayName { get; set; } = null!; + + [StringLength(100)] + public string WidgetName { get; set; } = null!; + + public string? WidgetDescription { get; set; } + + [Column("WidgetCategoryID")] + public int WidgetCategoryId { get; set; } + + public string? WidgetProperties { get; set; } + + public int WidgetSecurity { get; set; } + + [Column("WidgetGUID")] + public Guid WidgetGuid { get; set; } + + public DateTime WidgetLastModified { get; set; } + + public bool WidgetIsEnabled { get; set; } + + public bool WidgetForGroup { get; set; } + + public bool WidgetForEditor { get; set; } + + public bool WidgetForUser { get; set; } + + public bool WidgetForDashboard { get; set; } + + public bool WidgetForInline { get; set; } + + public string? WidgetDocumentation { get; set; } + + public string? WidgetDefaultValues { get; set; } + + [Column("WidgetLayoutID")] + public int? WidgetLayoutId { get; set; } + + public bool? WidgetSkipInsertProperties { get; set; } + + [Column("WidgetThumbnailGUID")] + public Guid? WidgetThumbnailGuid { get; set; } + + [StringLength(200)] + public string? WidgetIconClass { get; set; } + + [InverseProperty("Widget")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [ForeignKey("WidgetCategoryId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWidgetCategory WidgetCategory { get; set; } = null!; + + [ForeignKey("WidgetLayoutId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWebPartLayout? WidgetLayout { get; set; } + + [ForeignKey("WidgetWebPartId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWebPart WidgetWebPart { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsWidgetCategory.cs b/Migration.Tool.KX12/Models/CmsWidgetCategory.cs new file mode 100644 index 00000000..5713d979 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWidgetCategory.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WidgetCategory")] +[Index("WidgetCategoryParentId", Name = "IX_CMS_WidgetCategory_WidgetCategoryParentID")] +public class CmsWidgetCategory +{ + [Key] + [Column("WidgetCategoryID")] + public int WidgetCategoryId { get; set; } + + [StringLength(100)] + public string WidgetCategoryName { get; set; } = null!; + + [StringLength(100)] + public string WidgetCategoryDisplayName { get; set; } = null!; + + [Column("WidgetCategoryParentID")] + public int? WidgetCategoryParentId { get; set; } + + public string WidgetCategoryPath { get; set; } = null!; + + public int WidgetCategoryLevel { get; set; } + + public int? WidgetCategoryChildCount { get; set; } + + public int? WidgetCategoryWidgetChildCount { get; set; } + + [StringLength(450)] + public string? WidgetCategoryImagePath { get; set; } + + [Column("WidgetCategoryGUID")] + public Guid WidgetCategoryGuid { get; set; } + + public DateTime WidgetCategoryLastModified { get; set; } + + [InverseProperty("WidgetCategory")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [InverseProperty("WidgetCategoryParent")] + public virtual ICollection InverseWidgetCategoryParent { get; set; } = new List(); + + [ForeignKey("WidgetCategoryParentId")] + [InverseProperty("InverseWidgetCategoryParent")] + public virtual CmsWidgetCategory? WidgetCategoryParent { get; set; } +} diff --git a/Migration.Tool.KX12/Models/CmsWidgetRole.cs b/Migration.Tool.KX12/Models/CmsWidgetRole.cs new file mode 100644 index 00000000..4251e827 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWidgetRole.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[PrimaryKey("WidgetId", "RoleId", "PermissionId")] +[Table("CMS_WidgetRole")] +[Index("PermissionId", Name = "IX_CMS_WidgetRole_PermissionID")] +[Index("RoleId", Name = "IX_CMS_WidgetRole_RoleID")] +public class CmsWidgetRole +{ + [Key] + [Column("WidgetID")] + public int WidgetId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("PermissionId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("WidgetId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsWidget Widget { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsWorkflow.cs b/Migration.Tool.KX12/Models/CmsWorkflow.cs new file mode 100644 index 00000000..d5dc3fa0 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWorkflow.cs @@ -0,0 +1,93 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_Workflow")] +public class CmsWorkflow +{ + [Key] + [Column("WorkflowID")] + public int WorkflowId { get; set; } + + public string WorkflowDisplayName { get; set; } = null!; + + [StringLength(450)] + public string WorkflowName { get; set; } = null!; + + [Column("WorkflowGUID")] + public Guid WorkflowGuid { get; set; } + + public DateTime WorkflowLastModified { get; set; } + + public bool? WorkflowAutoPublishChanges { get; set; } + + public bool? WorkflowUseCheckinCheckout { get; set; } + + public int? WorkflowType { get; set; } + + public bool? WorkflowSendEmails { get; set; } + + public bool? WorkflowSendApproveEmails { get; set; } + + public bool? WorkflowSendRejectEmails { get; set; } + + public bool? WorkflowSendPublishEmails { get; set; } + + public bool? WorkflowSendArchiveEmails { get; set; } + + [StringLength(200)] + public string? WorkflowApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowPublishedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowArchivedTemplateName { get; set; } + + public bool? WorkflowSendReadyForApprovalEmails { get; set; } + + [StringLength(200)] + public string? WorkflowReadyForApprovalTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowNotificationTemplateName { get; set; } + + public string? WorkflowAllowedObjects { get; set; } + + public int? WorkflowRecurrenceType { get; set; } + + [Required] + public bool? WorkflowEnabled { get; set; } + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateWorkflow")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("TriggerWorkflow")] + public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); + + [InverseProperty("VersionWorkflow")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [InverseProperty("ScopeWorkflow")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [InverseProperty("StepWorkflow")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); + + [InverseProperty("TransitionWorkflow")] + public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); + + [ForeignKey("WorkflowId")] + [InverseProperty("Workflows")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsWorkflowAction.cs b/Migration.Tool.KX12/Models/CmsWorkflowAction.cs new file mode 100644 index 00000000..ba2b3dd8 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWorkflowAction.cs @@ -0,0 +1,65 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WorkflowAction")] +[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] +public class CmsWorkflowAction +{ + [Key] + [Column("ActionID")] + public int ActionId { get; set; } + + [StringLength(200)] + public string ActionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ActionName { get; set; } = null!; + + public string? ActionParameters { get; set; } + + public string? ActionDescription { get; set; } + + [StringLength(200)] + public string ActionAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string ActionClass { get; set; } = null!; + + [Column("ActionResourceID")] + public int? ActionResourceId { get; set; } + + [Column("ActionThumbnailGUID")] + public Guid? ActionThumbnailGuid { get; set; } + + [Column("ActionGUID")] + public Guid ActionGuid { get; set; } + + public DateTime ActionLastModified { get; set; } + + [Required] + public bool? ActionEnabled { get; set; } + + public string? ActionAllowedObjects { get; set; } + + [Column("ActionIconGUID")] + public Guid? ActionIconGuid { get; set; } + + public int? ActionWorkflowType { get; set; } + + [StringLength(200)] + public string? ActionIconClass { get; set; } + + [StringLength(200)] + public string? ActionThumbnailClass { get; set; } + + [ForeignKey("ActionResourceId")] + [InverseProperty("CmsWorkflowActions")] + public virtual CmsResource? ActionResource { get; set; } + + [InverseProperty("StepAction")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CmsWorkflowHistory.cs b/Migration.Tool.KX12/Models/CmsWorkflowHistory.cs new file mode 100644 index 00000000..cb6fe4d5 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWorkflowHistory.cs @@ -0,0 +1,87 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WorkflowHistory")] +[Index("ApprovedByUserId", Name = "IX_CMS_WorkflowHistory_ApprovedByUserID")] +[Index("ApprovedWhen", Name = "IX_CMS_WorkflowHistory_ApprovedWhen")] +[Index("HistoryWorkflowId", Name = "IX_CMS_WorkflowHistory_HistoryWorkflowID")] +[Index("StepId", Name = "IX_CMS_WorkflowHistory_StepID")] +[Index("TargetStepId", Name = "IX_CMS_WorkflowHistory_TargetStepID")] +[Index("VersionHistoryId", Name = "IX_CMS_WorkflowHistory_VersionHistoryID")] +public class CmsWorkflowHistory +{ + [Key] + [Column("WorkflowHistoryID")] + public int WorkflowHistoryId { get; set; } + + [Column("VersionHistoryID")] + public int VersionHistoryId { get; set; } + + [Column("StepID")] + public int? StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [Column("ApprovedByUserID")] + public int? ApprovedByUserId { get; set; } + + public DateTime? ApprovedWhen { get; set; } + + public string? Comment { get; set; } + + public bool WasRejected { get; set; } + + [StringLength(440)] + public string? StepName { get; set; } + + [Column("TargetStepID")] + public int? TargetStepId { get; set; } + + [StringLength(440)] + public string? TargetStepName { get; set; } + + [StringLength(450)] + public string? TargetStepDisplayName { get; set; } + + public int? StepType { get; set; } + + public int? TargetStepType { get; set; } + + [StringLength(100)] + public string? HistoryObjectType { get; set; } + + [Column("HistoryObjectID")] + public int? HistoryObjectId { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int? HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + [ForeignKey("ApprovedByUserId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsUser? ApprovedByUser { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsWorkflow? HistoryWorkflow { get; set; } + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowHistorySteps")] + public virtual CmsWorkflowStep? Step { get; set; } + + [ForeignKey("TargetStepId")] + [InverseProperty("CmsWorkflowHistoryTargetSteps")] + public virtual CmsWorkflowStep? TargetStep { get; set; } + + [ForeignKey("VersionHistoryId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsVersionHistory VersionHistory { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsWorkflowScope.cs b/Migration.Tool.KX12/Models/CmsWorkflowScope.cs new file mode 100644 index 00000000..9c2d1fe4 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWorkflowScope.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WorkflowScope")] +[Index("ScopeClassId", Name = "IX_CMS_WorkflowScope_ScopeClassID")] +[Index("ScopeCultureId", Name = "IX_CMS_WorkflowScope_ScopeCultureID")] +[Index("ScopeSiteId", Name = "IX_CMS_WorkflowScope_ScopeSiteID")] +[Index("ScopeWorkflowId", Name = "IX_CMS_WorkflowScope_ScopeWorkflowID")] +public class CmsWorkflowScope +{ + [Key] + [Column("ScopeID")] + public int ScopeId { get; set; } + + public string ScopeStartingPath { get; set; } = null!; + + [Column("ScopeWorkflowID")] + public int ScopeWorkflowId { get; set; } + + [Column("ScopeClassID")] + public int? ScopeClassId { get; set; } + + [Column("ScopeSiteID")] + public int ScopeSiteId { get; set; } + + [Column("ScopeGUID")] + public Guid ScopeGuid { get; set; } + + public DateTime ScopeLastModified { get; set; } + + [Column("ScopeCultureID")] + public int? ScopeCultureId { get; set; } + + public bool? ScopeExcludeChildren { get; set; } + + public bool ScopeExcluded { get; set; } + + public string? ScopeMacroCondition { get; set; } + + [ForeignKey("ScopeClassId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsClass? ScopeClass { get; set; } + + [ForeignKey("ScopeCultureId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsCulture? ScopeCulture { get; set; } + + [ForeignKey("ScopeSiteId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsSite ScopeSite { get; set; } = null!; + + [ForeignKey("ScopeWorkflowId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsWorkflow ScopeWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsWorkflowStep.cs b/Migration.Tool.KX12/Models/CmsWorkflowStep.cs new file mode 100644 index 00000000..d4bfea04 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWorkflowStep.cs @@ -0,0 +1,114 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WorkflowStep")] +[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] +[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] +[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] +[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] +public class CmsWorkflowStep +{ + [Key] + [Column("StepID")] + public int StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [StringLength(440)] + public string? StepName { get; set; } + + public int? StepOrder { get; set; } + + [Column("StepWorkflowID")] + public int StepWorkflowId { get; set; } + + [Column("StepGUID")] + public Guid StepGuid { get; set; } + + public DateTime StepLastModified { get; set; } + + public int? StepType { get; set; } + + public bool? StepAllowReject { get; set; } + + public string? StepDefinition { get; set; } + + public int? StepRolesSecurity { get; set; } + + public int? StepUsersSecurity { get; set; } + + [StringLength(200)] + public string? StepApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? StepRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? StepReadyforApprovalTemplateName { get; set; } + + public bool? StepSendApproveEmails { get; set; } + + public bool? StepSendRejectEmails { get; set; } + + public bool? StepSendReadyForApprovalEmails { get; set; } + + public bool? StepSendEmails { get; set; } + + public bool? StepAllowPublish { get; set; } + + [Column("StepActionID")] + public int? StepActionId { get; set; } + + public string? StepActionParameters { get; set; } + + public int? StepWorkflowType { get; set; } + + [InverseProperty("HistoryStep")] + public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); + + [InverseProperty("HistoryTargetStep")] + public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("StateStep")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("DocumentWorkflowStep")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("ObjectWorkflowStep")] + public virtual ICollection CmsObjectSettings { get; set; } = new List(); + + [InverseProperty("VersionWorkflowStep")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowHistorySteps { get; set; } = new List(); + + [InverseProperty("TargetStep")] + public virtual ICollection CmsWorkflowHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); + + [InverseProperty("TransitionEndStep")] + public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); + + [InverseProperty("TransitionStartStep")] + public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); + + [ForeignKey("StepActionId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflowAction? StepAction { get; set; } + + [ForeignKey("StepWorkflowId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflow StepWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsWorkflowStepRole.cs b/Migration.Tool.KX12/Models/CmsWorkflowStepRole.cs new file mode 100644 index 00000000..67d3e57f --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWorkflowStepRole.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WorkflowStepRoles")] +[Index("RoleId", Name = "IX_CMS_WorkflowStepRoles_RoleID")] +public class CmsWorkflowStepRole +{ + [Key] + [Column("WorkflowStepRoleID")] + public int WorkflowStepRoleId { get; set; } + + [Column("StepID")] + public int StepId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [Column("StepSourcePointGUID")] + public Guid? StepSourcePointGuid { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsWorkflowStepRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowStepRoles")] + public virtual CmsWorkflowStep Step { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsWorkflowStepUser.cs b/Migration.Tool.KX12/Models/CmsWorkflowStepUser.cs new file mode 100644 index 00000000..71e5846d --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWorkflowStepUser.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WorkflowStepUser")] +[Index("UserId", Name = "IX_CMS_WorkflowStepUser_UserID")] +public class CmsWorkflowStepUser +{ + [Key] + [Column("WorkflowStepUserID")] + public int WorkflowStepUserId { get; set; } + + [Column("StepID")] + public int StepId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("StepSourcePointGUID")] + public Guid? StepSourcePointGuid { get; set; } + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowStepUsers")] + public virtual CmsWorkflowStep Step { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsWorkflowStepUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CmsWorkflowTransition.cs b/Migration.Tool.KX12/Models/CmsWorkflowTransition.cs new file mode 100644 index 00000000..777f7898 --- /dev/null +++ b/Migration.Tool.KX12/Models/CmsWorkflowTransition.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("CMS_WorkflowTransition")] +[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] +[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] +[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] +public class CmsWorkflowTransition +{ + [Key] + [Column("TransitionID")] + public int TransitionId { get; set; } + + [Column("TransitionStartStepID")] + public int TransitionStartStepId { get; set; } + + [Column("TransitionEndStepID")] + public int TransitionEndStepId { get; set; } + + public int TransitionType { get; set; } + + public DateTime TransitionLastModified { get; set; } + + [Column("TransitionSourcePointGUID")] + public Guid? TransitionSourcePointGuid { get; set; } + + [Column("TransitionWorkflowID")] + public int TransitionWorkflowId { get; set; } + + [ForeignKey("TransitionEndStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] + public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; + + [ForeignKey("TransitionStartStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] + public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; + + [ForeignKey("TransitionWorkflowId")] + [InverseProperty("CmsWorkflowTransitions")] + public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComAddress.cs b/Migration.Tool.KX12/Models/ComAddress.cs new file mode 100644 index 00000000..2185663a --- /dev/null +++ b/Migration.Tool.KX12/Models/ComAddress.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_Address")] +[Index("AddressCountryId", Name = "IX_COM_Address_AddressCountryID")] +[Index("AddressCustomerId", Name = "IX_COM_Address_AddressCustomerID")] +[Index("AddressStateId", Name = "IX_COM_Address_AddressStateID")] +public class ComAddress +{ + [Key] + [Column("AddressID")] + public int AddressId { get; set; } + + [StringLength(200)] + public string AddressName { get; set; } = null!; + + [StringLength(100)] + public string AddressLine1 { get; set; } = null!; + + [StringLength(100)] + public string? AddressLine2 { get; set; } + + [StringLength(100)] + public string AddressCity { get; set; } = null!; + + [StringLength(20)] + public string AddressZip { get; set; } = null!; + + [StringLength(26)] + public string? AddressPhone { get; set; } + + [Column("AddressCustomerID")] + public int AddressCustomerId { get; set; } + + [Column("AddressCountryID")] + public int AddressCountryId { get; set; } + + [Column("AddressStateID")] + public int? AddressStateId { get; set; } + + [StringLength(200)] + public string AddressPersonalName { get; set; } = null!; + + [Column("AddressGUID")] + public Guid? AddressGuid { get; set; } + + public DateTime AddressLastModified { get; set; } + + [ForeignKey("AddressCountryId")] + [InverseProperty("ComAddresses")] + public virtual CmsCountry AddressCountry { get; set; } = null!; + + [ForeignKey("AddressCustomerId")] + [InverseProperty("ComAddresses")] + public virtual ComCustomer AddressCustomer { get; set; } = null!; + + [ForeignKey("AddressStateId")] + [InverseProperty("ComAddresses")] + public virtual CmsState? AddressState { get; set; } + + [InverseProperty("ShoppingCartBillingAddress")] + public virtual ICollection ComShoppingCartShoppingCartBillingAddresses { get; set; } = new List(); + + [InverseProperty("ShoppingCartCompanyAddress")] + public virtual ICollection ComShoppingCartShoppingCartCompanyAddresses { get; set; } = new List(); + + [InverseProperty("ShoppingCartShippingAddress")] + public virtual ICollection ComShoppingCartShoppingCartShippingAddresses { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/ComBrand.cs b/Migration.Tool.KX12/Models/ComBrand.cs new file mode 100644 index 00000000..1910c125 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComBrand.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_Brand")] +[Index("BrandDisplayName", Name = "IX_COM_Brand_BrandDisplayName")] +[Index("BrandSiteId", "BrandEnabled", Name = "IX_COM_Brand_BrandSiteID_BrandEnabled")] +public class ComBrand +{ + [Key] + [Column("BrandID")] + public int BrandId { get; set; } + + [StringLength(200)] + public string BrandDisplayName { get; set; } = null!; + + [StringLength(200)] + public string BrandName { get; set; } = null!; + + public string? BrandDescription { get; set; } + + [StringLength(400)] + public string? BrandHomepage { get; set; } + + [Column("BrandThumbnailGUID")] + public Guid? BrandThumbnailGuid { get; set; } + + [Column("BrandSiteID")] + public int BrandSiteId { get; set; } + + [Required] + public bool? BrandEnabled { get; set; } + + public Guid BrandGuid { get; set; } + + public DateTime BrandLastModified { get; set; } + + [ForeignKey("BrandSiteId")] + [InverseProperty("ComBrands")] + public virtual CmsSite BrandSite { get; set; } = null!; + + [InverseProperty("Brand")] + public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); + + [InverseProperty("Skubrand")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/ComCarrier.cs b/Migration.Tool.KX12/Models/ComCarrier.cs new file mode 100644 index 00000000..f62e328d --- /dev/null +++ b/Migration.Tool.KX12/Models/ComCarrier.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_Carrier")] +[Index("CarrierSiteId", Name = "IX_COM_Carrier_CarrierSiteID")] +public class ComCarrier +{ + [Key] + [Column("CarrierID")] + public int CarrierId { get; set; } + + [StringLength(200)] + public string CarrierDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CarrierName { get; set; } = null!; + + [Column("CarrierSiteID")] + public int CarrierSiteId { get; set; } + + [Column("CarrierGUID")] + public Guid CarrierGuid { get; set; } + + [StringLength(200)] + public string CarrierAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string CarrierClassName { get; set; } = null!; + + public DateTime CarrierLastModified { get; set; } + + [ForeignKey("CarrierSiteId")] + [InverseProperty("ComCarriers")] + public virtual CmsSite CarrierSite { get; set; } = null!; + + [InverseProperty("ShippingOptionCarrier")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/ComCollection.cs b/Migration.Tool.KX12/Models/ComCollection.cs new file mode 100644 index 00000000..3edbca1b --- /dev/null +++ b/Migration.Tool.KX12/Models/ComCollection.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_Collection")] +[Index("CollectionDisplayName", Name = "IX_COM_Collection_CollectionDisplayName")] +[Index("CollectionSiteId", "CollectionEnabled", Name = "IX_COM_Collection_CollectionSiteID_CollectionEnabled")] +public class ComCollection +{ + [Key] + [Column("CollectionID")] + public int CollectionId { get; set; } + + [StringLength(200)] + public string CollectionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CollectionName { get; set; } = null!; + + public string? CollectionDescription { get; set; } + + [Column("CollectionSiteID")] + public int CollectionSiteId { get; set; } + + [Required] + public bool? CollectionEnabled { get; set; } + + public Guid CollectionGuid { get; set; } + + public DateTime CollectionLastModified { get; set; } + + [ForeignKey("CollectionSiteId")] + [InverseProperty("ComCollections")] + public virtual CmsSite CollectionSite { get; set; } = null!; + + [InverseProperty("Collection")] + public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); + + [InverseProperty("Skucollection")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/ComCouponCode.cs b/Migration.Tool.KX12/Models/ComCouponCode.cs new file mode 100644 index 00000000..fffd4196 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComCouponCode.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_CouponCode")] +[Index("CouponCodeDiscountId", Name = "IX_COM_CouponCode_CouponCodeDiscountID")] +public class ComCouponCode +{ + [Key] + [Column("CouponCodeID")] + public int CouponCodeId { get; set; } + + [StringLength(200)] + public string CouponCodeCode { get; set; } = null!; + + public int? CouponCodeUseCount { get; set; } + + public int? CouponCodeUseLimit { get; set; } + + [Column("CouponCodeDiscountID")] + public int CouponCodeDiscountId { get; set; } + + public DateTime CouponCodeLastModified { get; set; } + + [Column("CouponCodeGUID")] + public Guid CouponCodeGuid { get; set; } + + [ForeignKey("CouponCodeDiscountId")] + [InverseProperty("ComCouponCodes")] + public virtual ComDiscount CouponCodeDiscount { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComCurrency.cs b/Migration.Tool.KX12/Models/ComCurrency.cs new file mode 100644 index 00000000..d24eadd9 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComCurrency.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_Currency")] +[Index("CurrencyDisplayName", Name = "IX_COM_Currency_CurrencyDisplayName")] +[Index("CurrencySiteId", Name = "IX_COM_Currency_CurrencySiteID")] +public class ComCurrency +{ + [Key] + [Column("CurrencyID")] + public int CurrencyId { get; set; } + + [StringLength(200)] + public string CurrencyName { get; set; } = null!; + + [StringLength(200)] + public string CurrencyDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CurrencyCode { get; set; } = null!; + + public int? CurrencyRoundTo { get; set; } + + public bool CurrencyEnabled { get; set; } + + [StringLength(200)] + public string CurrencyFormatString { get; set; } = null!; + + public bool CurrencyIsMain { get; set; } + + [Column("CurrencyGUID")] + public Guid? CurrencyGuid { get; set; } + + public DateTime CurrencyLastModified { get; set; } + + [Column("CurrencySiteID")] + public int? CurrencySiteId { get; set; } + + [InverseProperty("ExchangeRateToCurrency")] + public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); + + [InverseProperty("OrderCurrency")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartCurrency")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("CurrencySiteId")] + [InverseProperty("ComCurrencies")] + public virtual CmsSite? CurrencySite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComCurrencyExchangeRate.cs b/Migration.Tool.KX12/Models/ComCurrencyExchangeRate.cs new file mode 100644 index 00000000..9e9c76ab --- /dev/null +++ b/Migration.Tool.KX12/Models/ComCurrencyExchangeRate.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_CurrencyExchangeRate")] +[Index("ExchangeRateToCurrencyId", Name = "IX_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID")] +[Index("ExchangeTableId", Name = "IX_COM_CurrencyExchangeRate_ExchangeTableID")] +public class ComCurrencyExchangeRate +{ + [Key] + [Column("ExchagneRateID")] + public int ExchagneRateId { get; set; } + + [Column("ExchangeRateToCurrencyID")] + public int ExchangeRateToCurrencyId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal ExchangeRateValue { get; set; } + + [Column("ExchangeTableID")] + public int ExchangeTableId { get; set; } + + [Column("ExchangeRateGUID")] + public Guid ExchangeRateGuid { get; set; } + + public DateTime ExchangeRateLastModified { get; set; } + + [ForeignKey("ExchangeRateToCurrencyId")] + [InverseProperty("ComCurrencyExchangeRates")] + public virtual ComCurrency ExchangeRateToCurrency { get; set; } = null!; + + [ForeignKey("ExchangeTableId")] + [InverseProperty("ComCurrencyExchangeRates")] + public virtual ComExchangeTable ExchangeTable { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComCustomer.cs b/Migration.Tool.KX12/Models/ComCustomer.cs new file mode 100644 index 00000000..aec84025 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComCustomer.cs @@ -0,0 +1,78 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_Customer")] +[Index("CustomerEmail", Name = "IX_COM_Customer_CustomerEmail")] +[Index("CustomerFirstName", Name = "IX_COM_Customer_CustomerFirstName")] +[Index("CustomerLastName", Name = "IX_COM_Customer_CustomerLastName")] +[Index("CustomerSiteId", Name = "IX_COM_Customer_CustomerSiteID")] +[Index("CustomerUserId", Name = "IX_COM_Customer_CustomerUserID")] +public class ComCustomer +{ + [Key] + [Column("CustomerID")] + public int CustomerId { get; set; } + + [StringLength(200)] + public string CustomerFirstName { get; set; } = null!; + + [StringLength(200)] + public string CustomerLastName { get; set; } = null!; + + [StringLength(254)] + public string? CustomerEmail { get; set; } + + [StringLength(26)] + public string? CustomerPhone { get; set; } + + [StringLength(50)] + public string? CustomerFax { get; set; } + + [StringLength(200)] + public string? CustomerCompany { get; set; } + + [Column("CustomerUserID")] + public int? CustomerUserId { get; set; } + + [Column("CustomerGUID")] + public Guid CustomerGuid { get; set; } + + [Column("CustomerTaxRegistrationID")] + [StringLength(50)] + public string? CustomerTaxRegistrationId { get; set; } + + [Column("CustomerOrganizationID")] + [StringLength(50)] + public string? CustomerOrganizationId { get; set; } + + public DateTime CustomerLastModified { get; set; } + + [Column("CustomerSiteID")] + public int? CustomerSiteId { get; set; } + + public DateTime? CustomerCreated { get; set; } + + [InverseProperty("AddressCustomer")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("EventCustomer")] + public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); + + [InverseProperty("OrderCustomer")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartCustomer")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("CustomerSiteId")] + [InverseProperty("ComCustomers")] + public virtual CmsSite? CustomerSite { get; set; } + + [ForeignKey("CustomerUserId")] + [InverseProperty("ComCustomers")] + public virtual CmsUser? CustomerUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComCustomerCreditHistory.cs b/Migration.Tool.KX12/Models/ComCustomerCreditHistory.cs new file mode 100644 index 00000000..2345df8d --- /dev/null +++ b/Migration.Tool.KX12/Models/ComCustomerCreditHistory.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_CustomerCreditHistory")] +[Index("EventCustomerId", "EventDate", Name = "IX_COM_CustomerCreditHistory_EventCustomerID_EventDate", IsDescending = new[] { false, true })] +[Index("EventSiteId", Name = "IX_COM_CustomerCreditHistory_EventSiteID")] +public class ComCustomerCreditHistory +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(200)] + public string EventName { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal EventCreditChange { get; set; } + + public DateTime EventDate { get; set; } + + public string? EventDescription { get; set; } + + [Column("EventCustomerID")] + public int EventCustomerId { get; set; } + + [Column("EventCreditGUID")] + public Guid? EventCreditGuid { get; set; } + + public DateTime EventCreditLastModified { get; set; } + + [Column("EventSiteID")] + public int? EventSiteId { get; set; } + + [ForeignKey("EventCustomerId")] + [InverseProperty("ComCustomerCreditHistories")] + public virtual ComCustomer EventCustomer { get; set; } = null!; + + [ForeignKey("EventSiteId")] + [InverseProperty("ComCustomerCreditHistories")] + public virtual CmsSite? EventSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComDepartment.cs b/Migration.Tool.KX12/Models/ComDepartment.cs new file mode 100644 index 00000000..a28a2f0e --- /dev/null +++ b/Migration.Tool.KX12/Models/ComDepartment.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_Department")] +[Index("DepartmentDefaultTaxClassId", Name = "IX_COM_Department_DepartmentDefaultTaxClassID")] +[Index("DepartmentDisplayName", Name = "IX_COM_Department_DepartmentDisplayName")] +[Index("DepartmentName", "DepartmentSiteId", Name = "IX_COM_Department_DepartmentName_DepartmentSiteID", IsUnique = true)] +[Index("DepartmentSiteId", Name = "IX_COM_Department_DepartmentSiteID")] +public class ComDepartment +{ + [Key] + [Column("DepartmentID")] + public int DepartmentId { get; set; } + + [StringLength(200)] + public string DepartmentName { get; set; } = null!; + + [StringLength(200)] + public string DepartmentDisplayName { get; set; } = null!; + + [Column("DepartmentDefaultTaxClassID")] + public int? DepartmentDefaultTaxClassId { get; set; } + + [Column("DepartmentGUID")] + public Guid DepartmentGuid { get; set; } + + public DateTime DepartmentLastModified { get; set; } + + [Column("DepartmentSiteID")] + public int? DepartmentSiteId { get; set; } + + [InverseProperty("Skudepartment")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("DepartmentDefaultTaxClassId")] + [InverseProperty("ComDepartments")] + public virtual ComTaxClass? DepartmentDefaultTaxClass { get; set; } + + [ForeignKey("DepartmentSiteId")] + [InverseProperty("ComDepartments")] + public virtual CmsSite? DepartmentSite { get; set; } + + [ForeignKey("DepartmentId")] + [InverseProperty("Departments")] + public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/ComDiscount.cs b/Migration.Tool.KX12/Models/ComDiscount.cs new file mode 100644 index 00000000..31742ac2 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComDiscount.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_Discount")] +[Index("DiscountSiteId", Name = "IX_COM_Discount_DiscountSiteID")] +public class ComDiscount +{ + [Key] + [Column("DiscountID")] + public int DiscountId { get; set; } + + [StringLength(200)] + public string DiscountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string DiscountName { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal DiscountValue { get; set; } + + [Required] + public bool? DiscountEnabled { get; set; } + + [Column("DiscountGUID")] + public Guid DiscountGuid { get; set; } + + public DateTime DiscountLastModified { get; set; } + + [Column("DiscountSiteID")] + public int DiscountSiteId { get; set; } + + public string? DiscountDescription { get; set; } + + public DateTime? DiscountValidFrom { get; set; } + + public DateTime? DiscountValidTo { get; set; } + + public double DiscountOrder { get; set; } + + public string? DiscountProductCondition { get; set; } + + [StringLength(400)] + public string? DiscountRoles { get; set; } + + [StringLength(200)] + public string? DiscountCustomerRestriction { get; set; } + + public bool DiscountIsFlat { get; set; } + + public string? DiscountCartCondition { get; set; } + + [StringLength(100)] + public string DiscountApplyTo { get; set; } = null!; + + [Required] + public bool? DiscountApplyFurtherDiscounts { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? DiscountOrderAmount { get; set; } + + public bool DiscountUsesCoupons { get; set; } + + [InverseProperty("CouponCodeDiscount")] + public virtual ICollection ComCouponCodes { get; set; } = new List(); + + [ForeignKey("DiscountSiteId")] + [InverseProperty("ComDiscounts")] + public virtual CmsSite DiscountSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComExchangeTable.cs b/Migration.Tool.KX12/Models/ComExchangeTable.cs new file mode 100644 index 00000000..2e91953e --- /dev/null +++ b/Migration.Tool.KX12/Models/ComExchangeTable.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_ExchangeTable")] +[Index("ExchangeTableSiteId", Name = "IX_COM_ExchangeTable_ExchangeTableSiteID")] +public class ComExchangeTable +{ + [Key] + [Column("ExchangeTableID")] + public int ExchangeTableId { get; set; } + + [StringLength(200)] + public string ExchangeTableDisplayName { get; set; } = null!; + + public DateTime? ExchangeTableValidFrom { get; set; } + + public DateTime? ExchangeTableValidTo { get; set; } + + [Column("ExchangeTableGUID")] + public Guid ExchangeTableGuid { get; set; } + + public DateTime ExchangeTableLastModified { get; set; } + + [Column("ExchangeTableSiteID")] + public int? ExchangeTableSiteId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? ExchangeTableRateFromGlobalCurrency { get; set; } + + [InverseProperty("ExchangeTable")] + public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); + + [ForeignKey("ExchangeTableSiteId")] + [InverseProperty("ComExchangeTables")] + public virtual CmsSite? ExchangeTableSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComGiftCard.cs b/Migration.Tool.KX12/Models/ComGiftCard.cs new file mode 100644 index 00000000..a59e3b27 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComGiftCard.cs @@ -0,0 +1,58 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_GiftCard")] +[Index("GiftCardSiteId", Name = "IX_COM_GiftCard_GiftCardSiteID")] +public class ComGiftCard +{ + [Key] + [Column("GiftCardID")] + public int GiftCardId { get; set; } + + public Guid GiftCardGuid { get; set; } + + [StringLength(200)] + public string GiftCardDisplayName { get; set; } = null!; + + [StringLength(200)] + public string GiftCardName { get; set; } = null!; + + public string? GiftCardDescription { get; set; } + + [Required] + public bool? GiftCardEnabled { get; set; } + + public DateTime GiftCardLastModified { get; set; } + + [Column("GiftCardSiteID")] + public int GiftCardSiteId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal GiftCardValue { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? GiftCardMinimumOrderPrice { get; set; } + + public string? GiftCardCartCondition { get; set; } + + public DateTime? GiftCardValidFrom { get; set; } + + public DateTime? GiftCardValidTo { get; set; } + + [StringLength(200)] + public string? GiftCardCustomerRestriction { get; set; } + + [StringLength(400)] + public string? GiftCardRoles { get; set; } + + [InverseProperty("GiftCardCouponCodeGiftCard")] + public virtual ICollection ComGiftCardCouponCodes { get; set; } = new List(); + + [ForeignKey("GiftCardSiteId")] + [InverseProperty("ComGiftCards")] + public virtual CmsSite GiftCardSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComGiftCardCouponCode.cs b/Migration.Tool.KX12/Models/ComGiftCardCouponCode.cs new file mode 100644 index 00000000..ee3e16e2 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComGiftCardCouponCode.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_GiftCardCouponCode")] +[Index("GiftCardCouponCodeGiftCardId", Name = "IX_COM_GiftCardCouponCodeGiftCardID")] +public class ComGiftCardCouponCode +{ + [Key] + [Column("GiftCardCouponCodeID")] + public int GiftCardCouponCodeId { get; set; } + + [StringLength(200)] + public string GiftCardCouponCodeCode { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal GiftCardCouponCodeRemainingValue { get; set; } + + [Column("GiftCardCouponCodeGiftCardID")] + public int GiftCardCouponCodeGiftCardId { get; set; } + + public Guid GiftCardCouponCodeGuid { get; set; } + + public DateTime GiftCardCouponCodeLastModified { get; set; } + + [ForeignKey("GiftCardCouponCodeGiftCardId")] + [InverseProperty("ComGiftCardCouponCodes")] + public virtual ComGiftCard GiftCardCouponCodeGiftCard { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComInternalStatus.cs b/Migration.Tool.KX12/Models/ComInternalStatus.cs new file mode 100644 index 00000000..4107df0a --- /dev/null +++ b/Migration.Tool.KX12/Models/ComInternalStatus.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_InternalStatus")] +[Index("InternalStatusSiteId", "InternalStatusDisplayName", "InternalStatusEnabled", Name = "IX_COM_InternalStatus_InternalStatusSiteID_InternalStatusDisplayName_InternalStatusEnabled")] +public class ComInternalStatus +{ + [Key] + [Column("InternalStatusID")] + public int InternalStatusId { get; set; } + + [StringLength(200)] + public string InternalStatusName { get; set; } = null!; + + [StringLength(200)] + public string InternalStatusDisplayName { get; set; } = null!; + + [Required] + public bool? InternalStatusEnabled { get; set; } + + [Column("InternalStatusGUID")] + public Guid InternalStatusGuid { get; set; } + + public DateTime InternalStatusLastModified { get; set; } + + [Column("InternalStatusSiteID")] + public int? InternalStatusSiteId { get; set; } + + [InverseProperty("SkuinternalStatus")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("InternalStatusSiteId")] + [InverseProperty("ComInternalStatuses")] + public virtual CmsSite? InternalStatusSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComManufacturer.cs b/Migration.Tool.KX12/Models/ComManufacturer.cs new file mode 100644 index 00000000..436d66c9 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComManufacturer.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_Manufacturer")] +[Index("ManufacturerSiteId", Name = "IX_COM_Manufacturer_ManufacturerSiteID")] +public class ComManufacturer +{ + [Key] + [Column("ManufacturerID")] + public int ManufacturerId { get; set; } + + [StringLength(200)] + public string ManufacturerDisplayName { get; set; } = null!; + + [StringLength(400)] + public string? ManufactureHomepage { get; set; } + + [Required] + public bool? ManufacturerEnabled { get; set; } + + [Column("ManufacturerGUID")] + public Guid ManufacturerGuid { get; set; } + + public DateTime ManufacturerLastModified { get; set; } + + [Column("ManufacturerSiteID")] + public int? ManufacturerSiteId { get; set; } + + [Column("ManufacturerThumbnailGUID")] + public Guid? ManufacturerThumbnailGuid { get; set; } + + public string? ManufacturerDescription { get; set; } + + [StringLength(200)] + public string? ManufacturerName { get; set; } + + [InverseProperty("Skumanufacturer")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("ManufacturerSiteId")] + [InverseProperty("ComManufacturers")] + public virtual CmsSite? ManufacturerSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComMultiBuyCouponCode.cs b/Migration.Tool.KX12/Models/ComMultiBuyCouponCode.cs new file mode 100644 index 00000000..b20a2913 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComMultiBuyCouponCode.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_MultiBuyCouponCode")] +[Index("MultiBuyCouponCodeMultiBuyDiscountId", Name = "IX_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID")] +public class ComMultiBuyCouponCode +{ + [Key] + [Column("MultiBuyCouponCodeID")] + public int MultiBuyCouponCodeId { get; set; } + + [StringLength(200)] + public string MultiBuyCouponCodeCode { get; set; } = null!; + + public int? MultiBuyCouponCodeUseLimit { get; set; } + + public int? MultiBuyCouponCodeUseCount { get; set; } + + [Column("MultiBuyCouponCodeMultiBuyDiscountID")] + public int MultiBuyCouponCodeMultiBuyDiscountId { get; set; } + + public DateTime MultiBuyCouponCodeLastModified { get; set; } + + [Column("MultiBuyCouponCodeGUID")] + public Guid MultiBuyCouponCodeGuid { get; set; } + + [ForeignKey("MultiBuyCouponCodeMultiBuyDiscountId")] + [InverseProperty("ComMultiBuyCouponCodes")] + public virtual ComMultiBuyDiscount MultiBuyCouponCodeMultiBuyDiscount { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComMultiBuyDiscount.cs b/Migration.Tool.KX12/Models/ComMultiBuyDiscount.cs new file mode 100644 index 00000000..cb2da9c9 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComMultiBuyDiscount.cs @@ -0,0 +1,97 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_MultiBuyDiscount")] +[Index("MultiBuyDiscountApplyToSkuid", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID")] +[Index("MultiBuyDiscountSiteId", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountSiteID")] +public class ComMultiBuyDiscount +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [StringLength(200)] + public string MultiBuyDiscountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string MultiBuyDiscountName { get; set; } = null!; + + public string? MultiBuyDiscountDescription { get; set; } + + [Required] + public bool? MultiBuyDiscountEnabled { get; set; } + + [Column("MultiBuyDiscountGUID")] + public Guid MultiBuyDiscountGuid { get; set; } + + public DateTime MultiBuyDiscountLastModified { get; set; } + + [Column("MultiBuyDiscountSiteID")] + public int MultiBuyDiscountSiteId { get; set; } + + [Required] + public bool? MultiBuyDiscountApplyFurtherDiscounts { get; set; } + + public int MultiBuyDiscountMinimumBuyCount { get; set; } + + public DateTime? MultiBuyDiscountValidFrom { get; set; } + + public DateTime? MultiBuyDiscountValidTo { get; set; } + + [StringLength(200)] + public string MultiBuyDiscountCustomerRestriction { get; set; } = null!; + + [StringLength(400)] + public string? MultiBuyDiscountRoles { get; set; } + + [Column("MultiBuyDiscountApplyToSKUID")] + public int? MultiBuyDiscountApplyToSkuid { get; set; } + + public int? MultiBuyDiscountLimitPerOrder { get; set; } + + public bool? MultiBuyDiscountUsesCoupons { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? MultiBuyDiscountValue { get; set; } + + public bool? MultiBuyDiscountIsFlat { get; set; } + + [Required] + public bool? MultiBuyDiscountAutoAddEnabled { get; set; } + + public int? MultiBuyDiscountPriority { get; set; } + + public bool MultiBuyDiscountIsProductCoupon { get; set; } + + [InverseProperty("MultiBuyCouponCodeMultiBuyDiscount")] + public virtual ICollection ComMultiBuyCouponCodes { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscount")] + public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); + + [InverseProperty("MultibuyDiscount")] + public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscount")] + public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); + + [ForeignKey("MultiBuyDiscountApplyToSkuid")] + [InverseProperty("ComMultiBuyDiscounts")] + public virtual ComSku? MultiBuyDiscountApplyToSku { get; set; } + + [ForeignKey("MultiBuyDiscountSiteId")] + [InverseProperty("ComMultiBuyDiscounts")] + public virtual CmsSite MultiBuyDiscountSite { get; set; } = null!; + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("MultiBuyDiscounts")] + public virtual ICollection Departments { get; set; } = new List(); + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("MultiBuyDiscounts")] + public virtual ICollection Skus { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/ComMultiBuyDiscountBrand.cs b/Migration.Tool.KX12/Models/ComMultiBuyDiscountBrand.cs new file mode 100644 index 00000000..ed29240e --- /dev/null +++ b/Migration.Tool.KX12/Models/ComMultiBuyDiscountBrand.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[PrimaryKey("MultiBuyDiscountId", "BrandId")] +[Table("COM_MultiBuyDiscountBrand")] +[Index("BrandId", Name = "IX_COM_MultiBuyDiscountBrand_BrandID")] +public class ComMultiBuyDiscountBrand +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [Key] + [Column("BrandID")] + public int BrandId { get; set; } + + [Required] + public bool? BrandIncluded { get; set; } + + [ForeignKey("BrandId")] + [InverseProperty("ComMultiBuyDiscountBrands")] + public virtual ComBrand Brand { get; set; } = null!; + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountBrands")] + public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComMultiBuyDiscountCollection.cs b/Migration.Tool.KX12/Models/ComMultiBuyDiscountCollection.cs new file mode 100644 index 00000000..5a83a512 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComMultiBuyDiscountCollection.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[PrimaryKey("MultibuyDiscountId", "CollectionId")] +[Table("COM_MultiBuyDiscountCollection")] +[Index("CollectionId", Name = "IX_COM_MultiBuyDiscountCollection_CollectionID")] +public class ComMultiBuyDiscountCollection +{ + [Key] + [Column("MultibuyDiscountID")] + public int MultibuyDiscountId { get; set; } + + [Key] + [Column("CollectionID")] + public int CollectionId { get; set; } + + [Required] + public bool? CollectionIncluded { get; set; } + + [ForeignKey("CollectionId")] + [InverseProperty("ComMultiBuyDiscountCollections")] + public virtual ComCollection Collection { get; set; } = null!; + + [ForeignKey("MultibuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountCollections")] + public virtual ComMultiBuyDiscount MultibuyDiscount { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComMultiBuyDiscountTree.cs b/Migration.Tool.KX12/Models/ComMultiBuyDiscountTree.cs new file mode 100644 index 00000000..031ebdf6 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComMultiBuyDiscountTree.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[PrimaryKey("MultiBuyDiscountId", "NodeId")] +[Table("COM_MultiBuyDiscountTree")] +[Index("NodeId", Name = "IX_COM_MultiBuyDiscountTree_NodeID")] +public class ComMultiBuyDiscountTree +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + [Required] + public bool? NodeIncluded { get; set; } + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountTrees")] + public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; + + [ForeignKey("NodeId")] + [InverseProperty("ComMultiBuyDiscountTrees")] + public virtual CmsTree Node { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComOptionCategory.cs b/Migration.Tool.KX12/Models/ComOptionCategory.cs new file mode 100644 index 00000000..78828244 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComOptionCategory.cs @@ -0,0 +1,65 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_OptionCategory")] +[Index("CategorySiteId", Name = "IX_COM_OptionCategory_CategorySiteID")] +public class ComOptionCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryName { get; set; } = null!; + + [StringLength(200)] + public string CategorySelectionType { get; set; } = null!; + + [StringLength(200)] + public string? CategoryDefaultOptions { get; set; } + + public string? CategoryDescription { get; set; } + + [StringLength(200)] + public string? CategoryDefaultRecord { get; set; } + + [Required] + public bool? CategoryEnabled { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + public bool? CategoryDisplayPrice { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + public int? CategoryTextMaxLength { get; set; } + + [StringLength(20)] + public string? CategoryType { get; set; } + + public int? CategoryTextMinLength { get; set; } + + [StringLength(200)] + public string? CategoryLiveSiteDisplayName { get; set; } + + [ForeignKey("CategorySiteId")] + [InverseProperty("ComOptionCategories")] + public virtual CmsSite? CategorySite { get; set; } + + [InverseProperty("Category")] + public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); + + [InverseProperty("SkuoptionCategory")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/ComOrder.cs b/Migration.Tool.KX12/Models/ComOrder.cs new file mode 100644 index 00000000..29bc6c0b --- /dev/null +++ b/Migration.Tool.KX12/Models/ComOrder.cs @@ -0,0 +1,131 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_Order")] +[Index("OrderCreatedByUserId", Name = "IX_COM_Order_OrderCreatedByUserID")] +[Index("OrderCurrencyId", Name = "IX_COM_Order_OrderCurrencyID")] +[Index("OrderCustomerId", Name = "IX_COM_Order_OrderCustomerID")] +[Index("OrderPaymentOptionId", Name = "IX_COM_Order_OrderPaymentOptionID")] +[Index("OrderShippingOptionId", Name = "IX_COM_Order_OrderShippingOptionID")] +[Index("OrderSiteId", "OrderDate", Name = "IX_COM_Order_OrderSiteID_OrderDate", IsDescending = new[] { false, true })] +[Index("OrderStatusId", Name = "IX_COM_Order_OrderStatusID")] +public class ComOrder +{ + [Key] + [Column("OrderID")] + public int OrderId { get; set; } + + [Column("OrderShippingOptionID")] + public int? OrderShippingOptionId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderTotalShipping { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderTotalPrice { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderTotalTax { get; set; } + + public DateTime OrderDate { get; set; } + + [Column("OrderStatusID")] + public int? OrderStatusId { get; set; } + + [Column("OrderCurrencyID")] + public int? OrderCurrencyId { get; set; } + + [Column("OrderCustomerID")] + public int OrderCustomerId { get; set; } + + [Column("OrderCreatedByUserID")] + public int? OrderCreatedByUserId { get; set; } + + public string? OrderNote { get; set; } + + [Column("OrderSiteID")] + public int OrderSiteId { get; set; } + + [Column("OrderPaymentOptionID")] + public int? OrderPaymentOptionId { get; set; } + + public string? OrderInvoice { get; set; } + + [StringLength(200)] + public string? OrderInvoiceNumber { get; set; } + + [StringLength(100)] + public string? OrderTrackingNumber { get; set; } + + public string? OrderCustomData { get; set; } + + public string? OrderPaymentResult { get; set; } + + [Column("OrderGUID")] + public Guid OrderGuid { get; set; } + + public DateTime OrderLastModified { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderTotalPriceInMainCurrency { get; set; } + + public bool? OrderIsPaid { get; set; } + + [StringLength(10)] + public string? OrderCulture { get; set; } + + public string? OrderDiscounts { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderGrandTotal { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderGrandTotalInMainCurrency { get; set; } + + public string? OrderOtherPayments { get; set; } + + public string? OrderTaxSummary { get; set; } + + public string? OrderCouponCodes { get; set; } + + [InverseProperty("AddressOrder")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("OrderItemOrder")] + public virtual ICollection ComOrderItems { get; set; } = new List(); + + [InverseProperty("Order")] + public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); + + [ForeignKey("OrderCreatedByUserId")] + [InverseProperty("ComOrders")] + public virtual CmsUser? OrderCreatedByUser { get; set; } + + [ForeignKey("OrderCurrencyId")] + [InverseProperty("ComOrders")] + public virtual ComCurrency? OrderCurrency { get; set; } + + [ForeignKey("OrderCustomerId")] + [InverseProperty("ComOrders")] + public virtual ComCustomer OrderCustomer { get; set; } = null!; + + [ForeignKey("OrderPaymentOptionId")] + [InverseProperty("ComOrders")] + public virtual ComPaymentOption? OrderPaymentOption { get; set; } + + [ForeignKey("OrderShippingOptionId")] + [InverseProperty("ComOrders")] + public virtual ComShippingOption? OrderShippingOption { get; set; } + + [ForeignKey("OrderSiteId")] + [InverseProperty("ComOrders")] + public virtual CmsSite OrderSite { get; set; } = null!; + + [ForeignKey("OrderStatusId")] + [InverseProperty("ComOrders")] + public virtual ComOrderStatus? OrderStatus { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComOrderAddress.cs b/Migration.Tool.KX12/Models/ComOrderAddress.cs new file mode 100644 index 00000000..fc4fc912 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComOrderAddress.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_OrderAddress")] +[Index("AddressCountryId", Name = "IX_COM_OrderAddress_AddressCountryID")] +[Index("AddressOrderId", "AddressType", Name = "IX_COM_OrderAddress_AddressOrderID_AddressType", IsUnique = true)] +[Index("AddressStateId", Name = "IX_COM_OrderAddress_AddressStateID")] +public class ComOrderAddress +{ + [Key] + [Column("AddressID")] + public int AddressId { get; set; } + + [StringLength(100)] + public string AddressLine1 { get; set; } = null!; + + [StringLength(100)] + public string? AddressLine2 { get; set; } + + [StringLength(100)] + public string AddressCity { get; set; } = null!; + + [StringLength(20)] + public string AddressZip { get; set; } = null!; + + [StringLength(26)] + public string? AddressPhone { get; set; } + + [Column("AddressCountryID")] + public int AddressCountryId { get; set; } + + [Column("AddressStateID")] + public int? AddressStateId { get; set; } + + [StringLength(200)] + public string AddressPersonalName { get; set; } = null!; + + [Column("AddressGUID")] + public Guid? AddressGuid { get; set; } + + public DateTime AddressLastModified { get; set; } + + [Column("AddressOrderID")] + public int AddressOrderId { get; set; } + + public int AddressType { get; set; } + + [ForeignKey("AddressCountryId")] + [InverseProperty("ComOrderAddresses")] + public virtual CmsCountry AddressCountry { get; set; } = null!; + + [ForeignKey("AddressOrderId")] + [InverseProperty("ComOrderAddresses")] + public virtual ComOrder AddressOrder { get; set; } = null!; + + [ForeignKey("AddressStateId")] + [InverseProperty("ComOrderAddresses")] + public virtual CmsState? AddressState { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComOrderItem.cs b/Migration.Tool.KX12/Models/ComOrderItem.cs new file mode 100644 index 00000000..3f4467b2 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComOrderItem.cs @@ -0,0 +1,69 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_OrderItem")] +[Index("OrderItemOrderId", Name = "IX_COM_OrderItem_OrderItemOrderID")] +[Index("OrderItemSkuid", Name = "IX_COM_OrderItem_OrderItemSKUID")] +public class ComOrderItem +{ + [Key] + [Column("OrderItemID")] + public int OrderItemId { get; set; } + + [Column("OrderItemOrderID")] + public int OrderItemOrderId { get; set; } + + [Column("OrderItemSKUID")] + public int OrderItemSkuid { get; set; } + + [Column("OrderItemSKUName")] + [StringLength(450)] + public string OrderItemSkuname { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderItemUnitPrice { get; set; } + + public int OrderItemUnitCount { get; set; } + + public string? OrderItemCustomData { get; set; } + + public Guid OrderItemGuid { get; set; } + + public Guid? OrderItemParentGuid { get; set; } + + public DateTime OrderItemLastModified { get; set; } + + public DateTime? OrderItemValidTo { get; set; } + + [Column("OrderItemBundleGUID")] + public Guid? OrderItemBundleGuid { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderItemTotalPriceInMainCurrency { get; set; } + + public bool? OrderItemSendNotification { get; set; } + + public string? OrderItemText { get; set; } + + public string? OrderItemProductDiscounts { get; set; } + + public string? OrderItemDiscountSummary { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderItemTotalPrice { get; set; } + + [InverseProperty("OrderItem")] + public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); + + [ForeignKey("OrderItemOrderId")] + [InverseProperty("ComOrderItems")] + public virtual ComOrder OrderItemOrder { get; set; } = null!; + + [ForeignKey("OrderItemSkuid")] + [InverseProperty("ComOrderItems")] + public virtual ComSku OrderItemSku { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComOrderItemSkufile.cs b/Migration.Tool.KX12/Models/ComOrderItemSkufile.cs new file mode 100644 index 00000000..05551e21 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComOrderItemSkufile.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_OrderItemSKUFile")] +[Index("FileId", Name = "IX_COM_OrderItemSKUFile_FileID")] +[Index("OrderItemId", Name = "IX_COM_OrderItemSKUFile_OrderItemID")] +public class ComOrderItemSkufile +{ + [Key] + [Column("OrderItemSKUFileID")] + public int OrderItemSkufileId { get; set; } + + public Guid Token { get; set; } + + [Column("OrderItemID")] + public int OrderItemId { get; set; } + + [Column("FileID")] + public int FileId { get; set; } + + [ForeignKey("FileId")] + [InverseProperty("ComOrderItemSkufiles")] + public virtual ComSkufile File { get; set; } = null!; + + [ForeignKey("OrderItemId")] + [InverseProperty("ComOrderItemSkufiles")] + public virtual ComOrderItem OrderItem { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComOrderStatus.cs b/Migration.Tool.KX12/Models/ComOrderStatus.cs new file mode 100644 index 00000000..f5d6020d --- /dev/null +++ b/Migration.Tool.KX12/Models/ComOrderStatus.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_OrderStatus")] +[Index("StatusSiteId", "StatusOrder", Name = "IX_COM_OrderStatus_StatusSiteID_StatusOrder")] +public class ComOrderStatus +{ + [Key] + [Column("StatusID")] + public int StatusId { get; set; } + + [StringLength(200)] + public string StatusName { get; set; } = null!; + + [StringLength(200)] + public string StatusDisplayName { get; set; } = null!; + + public int? StatusOrder { get; set; } + + [Required] + public bool? StatusEnabled { get; set; } + + [StringLength(7)] + public string? StatusColor { get; set; } + + [Column("StatusGUID")] + public Guid StatusGuid { get; set; } + + public DateTime StatusLastModified { get; set; } + + public bool? StatusSendNotification { get; set; } + + [Column("StatusSiteID")] + public int? StatusSiteId { get; set; } + + public bool? StatusOrderIsPaid { get; set; } + + [InverseProperty("FromStatus")] + public virtual ICollection ComOrderStatusUserFromStatuses { get; set; } = new List(); + + [InverseProperty("ToStatus")] + public virtual ICollection ComOrderStatusUserToStatuses { get; set; } = new List(); + + [InverseProperty("OrderStatus")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("PaymentOptionAuthorizedOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionAuthorizedOrderStatuses { get; set; } = new List(); + + [InverseProperty("PaymentOptionFailedOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionFailedOrderStatuses { get; set; } = new List(); + + [InverseProperty("PaymentOptionSucceededOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionSucceededOrderStatuses { get; set; } = new List(); + + [ForeignKey("StatusSiteId")] + [InverseProperty("ComOrderStatuses")] + public virtual CmsSite? StatusSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComOrderStatusUser.cs b/Migration.Tool.KX12/Models/ComOrderStatusUser.cs new file mode 100644 index 00000000..243ef478 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComOrderStatusUser.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_OrderStatusUser")] +[Index("ChangedByUserId", Name = "IX_COM_OrderStatusUser_ChangedByUserID")] +[Index("FromStatusId", Name = "IX_COM_OrderStatusUser_FromStatusID")] +[Index("OrderId", "Date", Name = "IX_COM_OrderStatusUser_OrderID_Date")] +[Index("ToStatusId", Name = "IX_COM_OrderStatusUser_ToStatusID")] +public class ComOrderStatusUser +{ + [Key] + [Column("OrderStatusUserID")] + public int OrderStatusUserId { get; set; } + + [Column("OrderID")] + public int OrderId { get; set; } + + [Column("FromStatusID")] + public int? FromStatusId { get; set; } + + [Column("ToStatusID")] + public int ToStatusId { get; set; } + + [Column("ChangedByUserID")] + public int? ChangedByUserId { get; set; } + + public DateTime Date { get; set; } + + public string? Note { get; set; } + + [ForeignKey("ChangedByUserId")] + [InverseProperty("ComOrderStatusUsers")] + public virtual CmsUser? ChangedByUser { get; set; } + + [ForeignKey("FromStatusId")] + [InverseProperty("ComOrderStatusUserFromStatuses")] + public virtual ComOrderStatus? FromStatus { get; set; } + + [ForeignKey("OrderId")] + [InverseProperty("ComOrderStatusUsers")] + public virtual ComOrder Order { get; set; } = null!; + + [ForeignKey("ToStatusId")] + [InverseProperty("ComOrderStatusUserToStatuses")] + public virtual ComOrderStatus ToStatus { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComPaymentOption.cs b/Migration.Tool.KX12/Models/ComPaymentOption.cs new file mode 100644 index 00000000..5f63b978 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComPaymentOption.cs @@ -0,0 +1,82 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_PaymentOption")] +[Index("PaymentOptionAuthorizedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID")] +[Index("PaymentOptionFailedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionFailedOrderStatusID")] +[Index("PaymentOptionSiteId", Name = "IX_COM_PaymentOption_PaymentOptionSiteID")] +[Index("PaymentOptionSucceededOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionSucceededOrderStatusID")] +public class ComPaymentOption +{ + [Key] + [Column("PaymentOptionID")] + public int PaymentOptionId { get; set; } + + [StringLength(200)] + public string PaymentOptionName { get; set; } = null!; + + [StringLength(200)] + public string PaymentOptionDisplayName { get; set; } = null!; + + [Required] + public bool? PaymentOptionEnabled { get; set; } + + [Column("PaymentOptionSiteID")] + public int? PaymentOptionSiteId { get; set; } + + [StringLength(500)] + public string? PaymentOptionPaymentGateUrl { get; set; } + + [StringLength(200)] + public string? PaymentOptionAssemblyName { get; set; } + + [StringLength(200)] + public string? PaymentOptionClassName { get; set; } + + [Column("PaymentOptionSucceededOrderStatusID")] + public int? PaymentOptionSucceededOrderStatusId { get; set; } + + [Column("PaymentOptionFailedOrderStatusID")] + public int? PaymentOptionFailedOrderStatusId { get; set; } + + [Column("PaymentOptionGUID")] + public Guid PaymentOptionGuid { get; set; } + + public DateTime PaymentOptionLastModified { get; set; } + + public bool? PaymentOptionAllowIfNoShipping { get; set; } + + [Column("PaymentOptionThumbnailGUID")] + public Guid? PaymentOptionThumbnailGuid { get; set; } + + public string? PaymentOptionDescription { get; set; } + + [Column("PaymentOptionAuthorizedOrderStatusID")] + public int? PaymentOptionAuthorizedOrderStatusId { get; set; } + + [InverseProperty("OrderPaymentOption")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartPaymentOption")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("PaymentOptionAuthorizedOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionAuthorizedOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionAuthorizedOrderStatus { get; set; } + + [ForeignKey("PaymentOptionFailedOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionFailedOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionFailedOrderStatus { get; set; } + + [ForeignKey("PaymentOptionSiteId")] + [InverseProperty("ComPaymentOptions")] + public virtual CmsSite? PaymentOptionSite { get; set; } + + [ForeignKey("PaymentOptionSucceededOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionSucceededOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionSucceededOrderStatus { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComPublicStatus.cs b/Migration.Tool.KX12/Models/ComPublicStatus.cs new file mode 100644 index 00000000..ae709dca --- /dev/null +++ b/Migration.Tool.KX12/Models/ComPublicStatus.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_PublicStatus")] +[Index("PublicStatusSiteId", Name = "IX_COM_PublicStatus_PublicStatusSiteID")] +public class ComPublicStatus +{ + [Key] + [Column("PublicStatusID")] + public int PublicStatusId { get; set; } + + [StringLength(200)] + public string PublicStatusName { get; set; } = null!; + + [StringLength(200)] + public string PublicStatusDisplayName { get; set; } = null!; + + [Required] + public bool? PublicStatusEnabled { get; set; } + + [Column("PublicStatusGUID")] + public Guid? PublicStatusGuid { get; set; } + + public DateTime PublicStatusLastModified { get; set; } + + [Column("PublicStatusSiteID")] + public int? PublicStatusSiteId { get; set; } + + [InverseProperty("SkupublicStatus")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("PublicStatusSiteId")] + [InverseProperty("ComPublicStatuses")] + public virtual CmsSite? PublicStatusSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComShippingCost.cs b/Migration.Tool.KX12/Models/ComShippingCost.cs new file mode 100644 index 00000000..7b722441 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComShippingCost.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_ShippingCost")] +[Index("ShippingCostShippingOptionId", Name = "IX_COM_ShippingCost_ShippingCostShippingOptionID")] +public class ComShippingCost +{ + [Key] + [Column("ShippingCostID")] + public int ShippingCostId { get; set; } + + [Column("ShippingCostShippingOptionID")] + public int ShippingCostShippingOptionId { get; set; } + + public double ShippingCostMinWeight { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal ShippingCostValue { get; set; } + + [Column("ShippingCostGUID")] + public Guid ShippingCostGuid { get; set; } + + public DateTime ShippingCostLastModified { get; set; } + + [ForeignKey("ShippingCostShippingOptionId")] + [InverseProperty("ComShippingCosts")] + public virtual ComShippingOption ShippingCostShippingOption { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComShippingOption.cs b/Migration.Tool.KX12/Models/ComShippingOption.cs new file mode 100644 index 00000000..bcf89334 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComShippingOption.cs @@ -0,0 +1,69 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_ShippingOption")] +[Index("ShippingOptionCarrierId", Name = "IX_COM_ShippingOption_ShippingOptionCarrierID")] +[Index("ShippingOptionSiteId", Name = "IX_COM_ShippingOption_ShippingOptionSiteID_ShippingOptionDisplayName_ShippingOptionEnabled")] +[Index("ShippingOptionTaxClassId", Name = "IX_COM_ShippingOption_ShippingOptionTaxClassID")] +public class ComShippingOption +{ + [Key] + [Column("ShippingOptionID")] + public int ShippingOptionId { get; set; } + + [StringLength(200)] + public string ShippingOptionName { get; set; } = null!; + + [StringLength(200)] + public string ShippingOptionDisplayName { get; set; } = null!; + + [Required] + public bool? ShippingOptionEnabled { get; set; } + + [Column("ShippingOptionSiteID")] + public int? ShippingOptionSiteId { get; set; } + + [Column("ShippingOptionGUID")] + public Guid ShippingOptionGuid { get; set; } + + public DateTime ShippingOptionLastModified { get; set; } + + [Column("ShippingOptionThumbnailGUID")] + public Guid? ShippingOptionThumbnailGuid { get; set; } + + public string? ShippingOptionDescription { get; set; } + + [Column("ShippingOptionCarrierID")] + public int? ShippingOptionCarrierId { get; set; } + + [StringLength(200)] + public string? ShippingOptionCarrierServiceName { get; set; } + + [Column("ShippingOptionTaxClassID")] + public int? ShippingOptionTaxClassId { get; set; } + + [InverseProperty("OrderShippingOption")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShippingCostShippingOption")] + public virtual ICollection ComShippingCosts { get; set; } = new List(); + + [InverseProperty("ShoppingCartShippingOption")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("ShippingOptionCarrierId")] + [InverseProperty("ComShippingOptions")] + public virtual ComCarrier? ShippingOptionCarrier { get; set; } + + [ForeignKey("ShippingOptionSiteId")] + [InverseProperty("ComShippingOptions")] + public virtual CmsSite? ShippingOptionSite { get; set; } + + [ForeignKey("ShippingOptionTaxClassId")] + [InverseProperty("ComShippingOptions")] + public virtual ComTaxClass? ShippingOptionTaxClass { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComShoppingCart.cs b/Migration.Tool.KX12/Models/ComShoppingCart.cs new file mode 100644 index 00000000..c0dc6c95 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComShoppingCart.cs @@ -0,0 +1,106 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_ShoppingCart")] +[Index("ShoppingCartBillingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartBillingAddressID")] +[Index("ShoppingCartCompanyAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartCompanyAddressID")] +[Index("ShoppingCartCurrencyId", Name = "IX_COM_ShoppingCart_ShoppingCartCurrencyID")] +[Index("ShoppingCartCustomerId", Name = "IX_COM_ShoppingCart_ShoppingCartCustomerID")] +[Index("ShoppingCartLastUpdate", Name = "IX_COM_ShoppingCart_ShoppingCartLastUpdate")] +[Index("ShoppingCartPaymentOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartPaymentOptionID")] +[Index("ShoppingCartShippingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingAddressID")] +[Index("ShoppingCartShippingOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingOptionID")] +[Index("ShoppingCartSiteId", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID")] +[Index("ShoppingCartGuid", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID_ShoppingCartGUID")] +[Index("ShoppingCartUserId", Name = "IX_COM_ShoppingCart_ShoppingCartUserID")] +public class ComShoppingCart +{ + [Key] + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [Column("ShoppingCartGUID")] + public Guid ShoppingCartGuid { get; set; } + + [Column("ShoppingCartUserID")] + public int? ShoppingCartUserId { get; set; } + + [Column("ShoppingCartSiteID")] + public int ShoppingCartSiteId { get; set; } + + public DateTime ShoppingCartLastUpdate { get; set; } + + [Column("ShoppingCartCurrencyID")] + public int? ShoppingCartCurrencyId { get; set; } + + [Column("ShoppingCartPaymentOptionID")] + public int? ShoppingCartPaymentOptionId { get; set; } + + [Column("ShoppingCartShippingOptionID")] + public int? ShoppingCartShippingOptionId { get; set; } + + [Column("ShoppingCartBillingAddressID")] + public int? ShoppingCartBillingAddressId { get; set; } + + [Column("ShoppingCartShippingAddressID")] + public int? ShoppingCartShippingAddressId { get; set; } + + [Column("ShoppingCartCustomerID")] + public int? ShoppingCartCustomerId { get; set; } + + public string? ShoppingCartNote { get; set; } + + [Column("ShoppingCartCompanyAddressID")] + public int? ShoppingCartCompanyAddressId { get; set; } + + public string? ShoppingCartCustomData { get; set; } + + [Column("ShoppingCartContactID")] + public int? ShoppingCartContactId { get; set; } + + [InverseProperty("ShoppingCart")] + public virtual ICollection ComShoppingCartCouponCodes { get; set; } = new List(); + + [InverseProperty("ShoppingCart")] + public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); + + [ForeignKey("ShoppingCartBillingAddressId")] + [InverseProperty("ComShoppingCartShoppingCartBillingAddresses")] + public virtual ComAddress? ShoppingCartBillingAddress { get; set; } + + [ForeignKey("ShoppingCartCompanyAddressId")] + [InverseProperty("ComShoppingCartShoppingCartCompanyAddresses")] + public virtual ComAddress? ShoppingCartCompanyAddress { get; set; } + + [ForeignKey("ShoppingCartCurrencyId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComCurrency? ShoppingCartCurrency { get; set; } + + [ForeignKey("ShoppingCartCustomerId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComCustomer? ShoppingCartCustomer { get; set; } + + [ForeignKey("ShoppingCartPaymentOptionId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComPaymentOption? ShoppingCartPaymentOption { get; set; } + + [ForeignKey("ShoppingCartShippingAddressId")] + [InverseProperty("ComShoppingCartShoppingCartShippingAddresses")] + public virtual ComAddress? ShoppingCartShippingAddress { get; set; } + + [ForeignKey("ShoppingCartShippingOptionId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComShippingOption? ShoppingCartShippingOption { get; set; } + + [ForeignKey("ShoppingCartSiteId")] + [InverseProperty("ComShoppingCarts")] + public virtual CmsSite ShoppingCartSite { get; set; } = null!; + + [ForeignKey("ShoppingCartUserId")] + [InverseProperty("ComShoppingCarts")] + public virtual CmsUser? ShoppingCartUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComShoppingCartCouponCode.cs b/Migration.Tool.KX12/Models/ComShoppingCartCouponCode.cs new file mode 100644 index 00000000..668c1101 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComShoppingCartCouponCode.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_ShoppingCartCouponCode")] +[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartCouponCode_ShoppingCartID")] +public class ComShoppingCartCouponCode +{ + [Key] + [Column("ShoppingCartCouponCodeID")] + public int ShoppingCartCouponCodeId { get; set; } + + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [StringLength(200)] + public string CouponCode { get; set; } = null!; + + [ForeignKey("ShoppingCartId")] + [InverseProperty("ComShoppingCartCouponCodes")] + public virtual ComShoppingCart ShoppingCart { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComShoppingCartSku.cs b/Migration.Tool.KX12/Models/ComShoppingCartSku.cs new file mode 100644 index 00000000..50549d59 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComShoppingCartSku.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_ShoppingCartSKU")] +[Index("Skuid", Name = "IX_COM_ShoppingCartSKU_SKUID")] +[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartSKU_ShoppingCartID")] +public class ComShoppingCartSku +{ + [Key] + [Column("CartItemID")] + public int CartItemId { get; set; } + + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("SKUUnits")] + public int Skuunits { get; set; } + + public string? CartItemCustomData { get; set; } + + public Guid? CartItemGuid { get; set; } + + public Guid? CartItemParentGuid { get; set; } + + public DateTime? CartItemValidTo { get; set; } + + [Column("CartItemBundleGUID")] + public Guid? CartItemBundleGuid { get; set; } + + public string? CartItemText { get; set; } + + public int? CartItemAutoAddedUnits { get; set; } + + [ForeignKey("ShoppingCartId")] + [InverseProperty("ComShoppingCartSkus")] + public virtual ComShoppingCart ShoppingCart { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComShoppingCartSkus")] + public virtual ComSku Sku { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComSku.cs b/Migration.Tool.KX12/Models/ComSku.cs new file mode 100644 index 00000000..320192f0 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComSku.cs @@ -0,0 +1,277 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_SKU")] +[Index("SkubrandId", Name = "IX_COM_SKU_SKUBrandID")] +[Index("SkucollectionId", Name = "IX_COM_SKU_SKUCollectionID")] +[Index("SkudepartmentId", Name = "IX_COM_SKU_SKUDepartmentID")] +[Index("SkuinternalStatusId", Name = "IX_COM_SKU_SKUInternalStatusID")] +[Index("SkumanufacturerId", Name = "IX_COM_SKU_SKUManufacturerID")] +[Index("Skuname", Name = "IX_COM_SKU_SKUName")] +[Index("SkuoptionCategoryId", Name = "IX_COM_SKU_SKUOptionCategoryID")] +[Index("SkuparentSkuid", Name = "IX_COM_SKU_SKUParentSKUID")] +[Index("Skuprice", Name = "IX_COM_SKU_SKUPrice")] +[Index("SkupublicStatusId", Name = "IX_COM_SKU_SKUPublicStatusID")] +[Index("SkusiteId", Name = "IX_COM_SKU_SKUSiteID")] +[Index("SkusupplierId", Name = "IX_COM_SKU_SKUSupplierID")] +[Index("SkutaxClassId", Name = "IX_COM_SKU_SKUTaxClassID")] +public class ComSku +{ + [Key] + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("SKUNumber")] + [StringLength(200)] + public string? Skunumber { get; set; } + + [Column("SKUName")] + [StringLength(440)] + public string Skuname { get; set; } = null!; + + [Column("SKUDescription")] + public string? Skudescription { get; set; } + + [Column("SKUPrice", TypeName = "decimal(18, 9)")] + public decimal Skuprice { get; set; } + + [Required] + [Column("SKUEnabled")] + public bool? Skuenabled { get; set; } + + [Column("SKUDepartmentID")] + public int? SkudepartmentId { get; set; } + + [Column("SKUManufacturerID")] + public int? SkumanufacturerId { get; set; } + + [Column("SKUInternalStatusID")] + public int? SkuinternalStatusId { get; set; } + + [Column("SKUPublicStatusID")] + public int? SkupublicStatusId { get; set; } + + [Column("SKUSupplierID")] + public int? SkusupplierId { get; set; } + + [Column("SKUAvailableInDays")] + public int? SkuavailableInDays { get; set; } + + [Column("SKUGUID")] + public Guid Skuguid { get; set; } + + [Column("SKUImagePath")] + [StringLength(450)] + public string? SkuimagePath { get; set; } + + [Column("SKUWeight")] + public double? Skuweight { get; set; } + + [Column("SKUWidth")] + public double? Skuwidth { get; set; } + + [Column("SKUDepth")] + public double? Skudepth { get; set; } + + [Column("SKUHeight")] + public double? Skuheight { get; set; } + + [Column("SKUAvailableItems")] + public int? SkuavailableItems { get; set; } + + [Column("SKUSellOnlyAvailable")] + public bool? SkusellOnlyAvailable { get; set; } + + [Column("SKUCustomData")] + public string? SkucustomData { get; set; } + + [Column("SKUOptionCategoryID")] + public int? SkuoptionCategoryId { get; set; } + + [Column("SKUOrder")] + public int? Skuorder { get; set; } + + [Column("SKULastModified")] + public DateTime SkulastModified { get; set; } + + [Column("SKUCreated")] + public DateTime? Skucreated { get; set; } + + [Column("SKUSiteID")] + public int? SkusiteId { get; set; } + + [Column("SKUNeedsShipping")] + public bool? SkuneedsShipping { get; set; } + + [Column("SKUValidUntil")] + public DateTime? SkuvalidUntil { get; set; } + + [Column("SKUProductType")] + [StringLength(50)] + public string? SkuproductType { get; set; } + + [Column("SKUMaxItemsInOrder")] + public int? SkumaxItemsInOrder { get; set; } + + [Column("SKUValidity")] + [StringLength(50)] + public string? Skuvalidity { get; set; } + + [Column("SKUValidFor")] + public int? SkuvalidFor { get; set; } + + [Column("SKUMembershipGUID")] + public Guid? SkumembershipGuid { get; set; } + + [Column("SKUConversionName")] + [StringLength(100)] + public string? SkuconversionName { get; set; } + + [Column("SKUConversionValue")] + [StringLength(200)] + public string? SkuconversionValue { get; set; } + + [Column("SKUBundleInventoryType")] + [StringLength(50)] + public string? SkubundleInventoryType { get; set; } + + [Column("SKUMinItemsInOrder")] + public int? SkuminItemsInOrder { get; set; } + + [Column("SKURetailPrice", TypeName = "decimal(18, 9)")] + public decimal? SkuretailPrice { get; set; } + + [Column("SKUParentSKUID")] + public int? SkuparentSkuid { get; set; } + + [Column("SKUShortDescription")] + public string? SkushortDescription { get; set; } + + [Column("SKUEproductFilesCount")] + public int? SkueproductFilesCount { get; set; } + + [Column("SKUBundleItemsCount")] + public int? SkubundleItemsCount { get; set; } + + [Column("SKUInStoreFrom")] + public DateTime? SkuinStoreFrom { get; set; } + + [Column("SKUReorderAt")] + public int? SkureorderAt { get; set; } + + [Column("SKUTrackInventory")] + [StringLength(50)] + public string? SkutrackInventory { get; set; } + + [Column("SKUTaxClassID")] + public int? SkutaxClassId { get; set; } + + [Column("SKUBrandID")] + public int? SkubrandId { get; set; } + + [Column("SKUCollectionID")] + public int? SkucollectionId { get; set; } + + [InverseProperty("NodeSku")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscountApplyToSku")] + public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); + + [InverseProperty("OrderItemSku")] + public virtual ICollection ComOrderItems { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); + + [InverseProperty("FileSku")] + public virtual ICollection ComSkufiles { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); + + [InverseProperty("VolumeDiscountSku")] + public virtual ICollection ComVolumeDiscounts { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("SkuparentSku")] + public virtual ICollection InverseSkuparentSku { get; set; } = new List(); + + [ForeignKey("SkubrandId")] + [InverseProperty("ComSkus")] + public virtual ComBrand? Skubrand { get; set; } + + [ForeignKey("SkucollectionId")] + [InverseProperty("ComSkus")] + public virtual ComCollection? Skucollection { get; set; } + + [ForeignKey("SkudepartmentId")] + [InverseProperty("ComSkus")] + public virtual ComDepartment? Skudepartment { get; set; } + + [ForeignKey("SkuinternalStatusId")] + [InverseProperty("ComSkus")] + public virtual ComInternalStatus? SkuinternalStatus { get; set; } + + [ForeignKey("SkumanufacturerId")] + [InverseProperty("ComSkus")] + public virtual ComManufacturer? Skumanufacturer { get; set; } + + [ForeignKey("SkuoptionCategoryId")] + [InverseProperty("ComSkus")] + public virtual ComOptionCategory? SkuoptionCategory { get; set; } + + [ForeignKey("SkuparentSkuid")] + [InverseProperty("InverseSkuparentSku")] + public virtual ComSku? SkuparentSku { get; set; } + + [ForeignKey("SkupublicStatusId")] + [InverseProperty("ComSkus")] + public virtual ComPublicStatus? SkupublicStatus { get; set; } + + [ForeignKey("SkusiteId")] + [InverseProperty("ComSkus")] + public virtual CmsSite? Skusite { get; set; } + + [ForeignKey("SkusupplierId")] + [InverseProperty("ComSkus")] + public virtual ComSupplier? Skusupplier { get; set; } + + [ForeignKey("SkutaxClassId")] + [InverseProperty("ComSkus")] + public virtual ComTaxClass? SkutaxClass { get; set; } + + [ForeignKey("Skuid")] + [InverseProperty("Skus")] + public virtual ICollection Bundles { get; set; } = new List(); + + [ForeignKey("Skuid")] + [InverseProperty("Skus")] + public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); + + [ForeignKey("Skuid")] + [InverseProperty("SkusNavigation")] + public virtual ICollection OptionSkus { get; set; } = new List(); + + [ForeignKey("VariantSkuid")] + [InverseProperty("VariantSkus")] + public virtual ICollection OptionSkusNavigation { get; set; } = new List(); + + [ForeignKey("BundleId")] + [InverseProperty("Bundles")] + public virtual ICollection Skus { get; set; } = new List(); + + [ForeignKey("OptionSkuid")] + [InverseProperty("OptionSkus")] + public virtual ICollection SkusNavigation { get; set; } = new List(); + + [ForeignKey("OptionSkuid")] + [InverseProperty("OptionSkusNavigation")] + public virtual ICollection VariantSkus { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/ComSkufile.cs b/Migration.Tool.KX12/Models/ComSkufile.cs new file mode 100644 index 00000000..d11005ab --- /dev/null +++ b/Migration.Tool.KX12/Models/ComSkufile.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_SKUFile")] +[Index("FileSkuid", Name = "IX_COM_SKUFile_FileSKUID")] +public class ComSkufile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileSKUID")] + public int FileSkuid { get; set; } + + [StringLength(450)] + public string FilePath { get; set; } = null!; + + [StringLength(50)] + public string FileType { get; set; } = null!; + + public DateTime FileLastModified { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [Column("FileMetaFileGUID")] + public Guid? FileMetaFileGuid { get; set; } + + [InverseProperty("File")] + public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); + + [ForeignKey("FileSkuid")] + [InverseProperty("ComSkufiles")] + public virtual ComSku FileSku { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComSkuoptionCategory.cs b/Migration.Tool.KX12/Models/ComSkuoptionCategory.cs new file mode 100644 index 00000000..198febbd --- /dev/null +++ b/Migration.Tool.KX12/Models/ComSkuoptionCategory.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_SKUOptionCategory")] +[Index("CategoryId", Name = "IX_COM_SKUOptionCategory_CategoryID")] +[Index("Skuid", Name = "IX_COM_SKUOptionCategory_SKUID")] +public class ComSkuoptionCategory +{ + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("CategoryID")] + public int CategoryId { get; set; } + + public bool? AllowAllOptions { get; set; } + + [Key] + [Column("SKUCategoryID")] + public int SkucategoryId { get; set; } + + [Column("SKUCategoryOrder")] + public int? SkucategoryOrder { get; set; } + + [ForeignKey("CategoryId")] + [InverseProperty("ComSkuoptionCategories")] + public virtual ComOptionCategory Category { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComSkuoptionCategories")] + public virtual ComSku Sku { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComSupplier.cs b/Migration.Tool.KX12/Models/ComSupplier.cs new file mode 100644 index 00000000..baca1dd2 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComSupplier.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_Supplier")] +[Index("SupplierSiteId", Name = "IX_COM_Supplier_SupplierSiteID")] +public class ComSupplier +{ + [Key] + [Column("SupplierID")] + public int SupplierId { get; set; } + + [StringLength(200)] + public string SupplierDisplayName { get; set; } = null!; + + [StringLength(50)] + public string? SupplierPhone { get; set; } + + [StringLength(254)] + public string? SupplierEmail { get; set; } + + [StringLength(50)] + public string? SupplierFax { get; set; } + + [Required] + public bool? SupplierEnabled { get; set; } + + [Column("SupplierGUID")] + public Guid SupplierGuid { get; set; } + + public DateTime SupplierLastModified { get; set; } + + [Column("SupplierSiteID")] + public int? SupplierSiteId { get; set; } + + [StringLength(200)] + public string? SupplierName { get; set; } + + [InverseProperty("Skusupplier")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("SupplierSiteId")] + [InverseProperty("ComSuppliers")] + public virtual CmsSite? SupplierSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComTaxClass.cs b/Migration.Tool.KX12/Models/ComTaxClass.cs new file mode 100644 index 00000000..e1c4956d --- /dev/null +++ b/Migration.Tool.KX12/Models/ComTaxClass.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_TaxClass")] +[Index("TaxClassSiteId", Name = "IX_COM_TaxClass_TaxClassSiteID")] +public class ComTaxClass +{ + [Key] + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [StringLength(200)] + public string TaxClassName { get; set; } = null!; + + [StringLength(200)] + public string TaxClassDisplayName { get; set; } = null!; + + [Column("TaxClassZeroIfIDSupplied")] + public bool? TaxClassZeroIfIdsupplied { get; set; } + + [Column("TaxClassGUID")] + public Guid TaxClassGuid { get; set; } + + public DateTime TaxClassLastModified { get; set; } + + [Column("TaxClassSiteID")] + public int? TaxClassSiteId { get; set; } + + [InverseProperty("DepartmentDefaultTaxClass")] + public virtual ICollection ComDepartments { get; set; } = new List(); + + [InverseProperty("ShippingOptionTaxClass")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); + + [InverseProperty("SkutaxClass")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [InverseProperty("TaxClass")] + public virtual ICollection ComTaxClassCountries { get; set; } = new List(); + + [InverseProperty("TaxClass")] + public virtual ICollection ComTaxClassStates { get; set; } = new List(); + + [ForeignKey("TaxClassSiteId")] + [InverseProperty("ComTaxClasses")] + public virtual CmsSite? TaxClassSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ComTaxClassCountry.cs b/Migration.Tool.KX12/Models/ComTaxClassCountry.cs new file mode 100644 index 00000000..90a13049 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComTaxClassCountry.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_TaxClassCountry")] +[Index("CountryId", Name = "IX_COM_TaxClassCountry_CountryID")] +[Index("TaxClassId", "CountryId", Name = "IX_COM_TaxClassCountry_TaxClassID_CountryID", IsUnique = true)] +public class ComTaxClassCountry +{ + [Key] + [Column("TaxClassCountryID")] + public int TaxClassCountryId { get; set; } + + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal TaxValue { get; set; } + + [ForeignKey("CountryId")] + [InverseProperty("ComTaxClassCountries")] + public virtual CmsCountry Country { get; set; } = null!; + + [ForeignKey("TaxClassId")] + [InverseProperty("ComTaxClassCountries")] + public virtual ComTaxClass TaxClass { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComTaxClassState.cs b/Migration.Tool.KX12/Models/ComTaxClassState.cs new file mode 100644 index 00000000..8d3f6a27 --- /dev/null +++ b/Migration.Tool.KX12/Models/ComTaxClassState.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_TaxClassState")] +[Index("StateId", Name = "IX_COM_TaxClassState_StateID")] +[Index("TaxClassId", "StateId", Name = "IX_COM_TaxClassState_TaxClassID_StateID", IsUnique = true)] +public class ComTaxClassState +{ + [Key] + [Column("TaxClassStateID")] + public int TaxClassStateId { get; set; } + + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [Column("StateID")] + public int StateId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal TaxValue { get; set; } + + [ForeignKey("StateId")] + [InverseProperty("ComTaxClassStates")] + public virtual CmsState State { get; set; } = null!; + + [ForeignKey("TaxClassId")] + [InverseProperty("ComTaxClassStates")] + public virtual ComTaxClass TaxClass { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComVolumeDiscount.cs b/Migration.Tool.KX12/Models/ComVolumeDiscount.cs new file mode 100644 index 00000000..2312826d --- /dev/null +++ b/Migration.Tool.KX12/Models/ComVolumeDiscount.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("COM_VolumeDiscount")] +[Index("VolumeDiscountSkuid", Name = "IX_COM_VolumeDiscount_VolumeDiscountSKUID")] +public class ComVolumeDiscount +{ + [Key] + [Column("VolumeDiscountID")] + public int VolumeDiscountId { get; set; } + + [Column("VolumeDiscountSKUID")] + public int VolumeDiscountSkuid { get; set; } + + public int VolumeDiscountMinCount { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal VolumeDiscountValue { get; set; } + + public bool VolumeDiscountIsFlatValue { get; set; } + + [Column("VolumeDiscountGUID")] + public Guid VolumeDiscountGuid { get; set; } + + public DateTime VolumeDiscountLastModified { get; set; } + + [ForeignKey("VolumeDiscountSkuid")] + [InverseProperty("ComVolumeDiscounts")] + public virtual ComSku VolumeDiscountSku { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ComWishlist.cs b/Migration.Tool.KX12/Models/ComWishlist.cs new file mode 100644 index 00000000..9ae2f28f --- /dev/null +++ b/Migration.Tool.KX12/Models/ComWishlist.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[PrimaryKey("UserId", "Skuid", "SiteId")] +[Table("COM_Wishlist")] +[Index("Skuid", Name = "IX_COM_Wishlist_SKUID")] +[Index("SiteId", "UserId", Name = "IX_COM_Wishlist_SiteID_UserID")] +public class ComWishlist +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [Key] + [Column("SKUID")] + public int Skuid { get; set; } + + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("ComWishlists")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComWishlists")] + public virtual ComSku Sku { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("ComWishlists")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CommunityGroup.cs b/Migration.Tool.KX12/Models/CommunityGroup.cs new file mode 100644 index 00000000..c42abe23 --- /dev/null +++ b/Migration.Tool.KX12/Models/CommunityGroup.cs @@ -0,0 +1,109 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Community_Group")] +[Index("GroupApproved", Name = "IX_Community_Group_GroupApproved")] +[Index("GroupApprovedByUserId", Name = "IX_Community_Group_GroupApprovedByUserID")] +[Index("GroupAvatarId", Name = "IX_Community_Group_GroupAvatarID")] +[Index("GroupCreatedByUserId", Name = "IX_Community_Group_GroupCreatedByUserID")] +[Index("GroupSiteId", "GroupName", Name = "IX_Community_Group_GroupSiteID_GroupName")] +public class CommunityGroup +{ + [Key] + [Column("GroupID")] + public int GroupId { get; set; } + + [Column("GroupGUID")] + public Guid GroupGuid { get; set; } + + public DateTime GroupLastModified { get; set; } + + [Column("GroupSiteID")] + public int GroupSiteId { get; set; } + + [StringLength(200)] + public string GroupDisplayName { get; set; } = null!; + + [StringLength(100)] + public string GroupName { get; set; } = null!; + + public string GroupDescription { get; set; } = null!; + + [Column("GroupNodeGUID")] + public Guid? GroupNodeGuid { get; set; } + + public int GroupApproveMembers { get; set; } + + public int GroupAccess { get; set; } + + [Column("GroupCreatedByUserID")] + public int? GroupCreatedByUserId { get; set; } + + [Column("GroupApprovedByUserID")] + public int? GroupApprovedByUserId { get; set; } + + [Column("GroupAvatarID")] + public int? GroupAvatarId { get; set; } + + public bool? GroupApproved { get; set; } + + public DateTime GroupCreatedWhen { get; set; } + + public bool? GroupSendJoinLeaveNotification { get; set; } + + public bool? GroupSendWaitingForApprovalNotification { get; set; } + + public int? GroupSecurity { get; set; } + + public bool? GroupLogActivity { get; set; } + + [InverseProperty("BoardGroup")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("RoleGroup")] + public virtual ICollection CmsRoles { get; set; } = new List(); + + [InverseProperty("NodeGroup")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("MemberGroup")] + public virtual ICollection CommunityGroupMembers { get; set; } = new List(); + + [InverseProperty("Group")] + public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); + + [InverseProperty("InvitationGroup")] + public virtual ICollection CommunityInvitations { get; set; } = new List(); + + [InverseProperty("GroupGroup")] + public virtual ICollection ForumsForumGroups { get; set; } = new List(); + + [InverseProperty("ForumCommunityGroup")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [ForeignKey("GroupApprovedByUserId")] + [InverseProperty("CommunityGroupGroupApprovedByUsers")] + public virtual CmsUser? GroupApprovedByUser { get; set; } + + [ForeignKey("GroupAvatarId")] + [InverseProperty("CommunityGroups")] + public virtual CmsAvatar? GroupAvatar { get; set; } + + [ForeignKey("GroupCreatedByUserId")] + [InverseProperty("CommunityGroupGroupCreatedByUsers")] + public virtual CmsUser? GroupCreatedByUser { get; set; } + + [ForeignKey("GroupSiteId")] + [InverseProperty("CommunityGroups")] + public virtual CmsSite GroupSite { get; set; } = null!; + + [InverseProperty("LibraryGroup")] + public virtual ICollection MediaLibraries { get; set; } = new List(); + + [InverseProperty("PollGroup")] + public virtual ICollection PollsPolls { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/CommunityGroupMember.cs b/Migration.Tool.KX12/Models/CommunityGroupMember.cs new file mode 100644 index 00000000..4d034cfe --- /dev/null +++ b/Migration.Tool.KX12/Models/CommunityGroupMember.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Community_GroupMember")] +[Index("MemberApprovedByUserId", Name = "IX_Community_GroupMember_MemberApprovedByUserID")] +[Index("MemberGroupId", Name = "IX_Community_GroupMember_MemberGroupID")] +[Index("MemberInvitedByUserId", Name = "IX_Community_GroupMember_MemberInvitedByUserID")] +[Index("MemberStatus", Name = "IX_Community_GroupMember_MemberStatus")] +[Index("MemberUserId", Name = "IX_Community_GroupMember_MemberUserID")] +public class CommunityGroupMember +{ + [Key] + [Column("MemberID")] + public int MemberId { get; set; } + + [Column("MemberGUID")] + public Guid MemberGuid { get; set; } + + [Column("MemberUserID")] + public int MemberUserId { get; set; } + + [Column("MemberGroupID")] + public int MemberGroupId { get; set; } + + public DateTime MemberJoined { get; set; } + + public DateTime? MemberApprovedWhen { get; set; } + + public DateTime? MemberRejectedWhen { get; set; } + + [Column("MemberApprovedByUserID")] + public int? MemberApprovedByUserId { get; set; } + + public string? MemberComment { get; set; } + + [Column("MemberInvitedByUserID")] + public int? MemberInvitedByUserId { get; set; } + + public int? MemberStatus { get; set; } + + [ForeignKey("MemberApprovedByUserId")] + [InverseProperty("CommunityGroupMemberMemberApprovedByUsers")] + public virtual CmsUser? MemberApprovedByUser { get; set; } + + [ForeignKey("MemberGroupId")] + [InverseProperty("CommunityGroupMembers")] + public virtual CommunityGroup MemberGroup { get; set; } = null!; + + [ForeignKey("MemberInvitedByUserId")] + [InverseProperty("CommunityGroupMemberMemberInvitedByUsers")] + public virtual CmsUser? MemberInvitedByUser { get; set; } + + [ForeignKey("MemberUserId")] + [InverseProperty("CommunityGroupMemberMemberUsers")] + public virtual CmsUser MemberUser { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CommunityGroupRolePermission.cs b/Migration.Tool.KX12/Models/CommunityGroupRolePermission.cs new file mode 100644 index 00000000..b152afdb --- /dev/null +++ b/Migration.Tool.KX12/Models/CommunityGroupRolePermission.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[PrimaryKey("GroupId", "RoleId", "PermissionId")] +[Table("Community_GroupRolePermission")] +[Index("PermissionId", Name = "IX_Community_GroupRolePermission_PermissionID")] +[Index("RoleId", Name = "IX_Community_GroupRolePermission_RoleID")] +public class CommunityGroupRolePermission +{ + [Key] + [Column("GroupID")] + public int GroupId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("GroupId")] + [InverseProperty("CommunityGroupRolePermissions")] + public virtual CommunityGroup Group { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("CommunityGroupRolePermissions")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("CommunityGroupRolePermissions")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/CommunityInvitation.cs b/Migration.Tool.KX12/Models/CommunityInvitation.cs new file mode 100644 index 00000000..2ac2f02c --- /dev/null +++ b/Migration.Tool.KX12/Models/CommunityInvitation.cs @@ -0,0 +1,52 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Community_Invitation")] +[Index("InvitationGroupId", Name = "IX_Community_Invitation_InvitationGroupID")] +[Index("InvitedByUserId", Name = "IX_Community_Invitation_InvitedByUserID")] +[Index("InvitedUserId", Name = "IX_Community_Invitation_InvitedUserID")] +public class CommunityInvitation +{ + [Key] + [Column("InvitationID")] + public int InvitationId { get; set; } + + [Column("InvitedUserID")] + public int? InvitedUserId { get; set; } + + [Column("InvitedByUserID")] + public int InvitedByUserId { get; set; } + + [Column("InvitationGroupID")] + public int? InvitationGroupId { get; set; } + + public DateTime? InvitationCreated { get; set; } + + public DateTime? InvitationValidTo { get; set; } + + public string? InvitationComment { get; set; } + + [Column("InvitationGUID")] + public Guid InvitationGuid { get; set; } + + public DateTime InvitationLastModified { get; set; } + + [StringLength(254)] + public string? InvitationUserEmail { get; set; } + + [ForeignKey("InvitationGroupId")] + [InverseProperty("CommunityInvitations")] + public virtual CommunityGroup? InvitationGroup { get; set; } + + [ForeignKey("InvitedByUserId")] + [InverseProperty("CommunityInvitationInvitedByUsers")] + public virtual CmsUser InvitedByUser { get; set; } = null!; + + [ForeignKey("InvitedUserId")] + [InverseProperty("CommunityInvitationInvitedUsers")] + public virtual CmsUser? InvitedUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ContentFile.cs b/Migration.Tool.KX12/Models/ContentFile.cs new file mode 100644 index 00000000..35fc1f82 --- /dev/null +++ b/Migration.Tool.KX12/Models/ContentFile.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("CONTENT_File")] +public class ContentFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [StringLength(500)] + public string? FileDescription { get; set; } + + [StringLength(100)] + public string FileName { get; set; } = null!; + + public Guid? FileAttachment { get; set; } +} diff --git a/Migration.Tool.KX12/Models/EventsAttendee.cs b/Migration.Tool.KX12/Models/EventsAttendee.cs new file mode 100644 index 00000000..3eeb93da --- /dev/null +++ b/Migration.Tool.KX12/Models/EventsAttendee.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Events_Attendee")] +[Index("AttendeeEventNodeId", Name = "IX_Events_Attendee_AttendeeEventNodeID")] +public class EventsAttendee +{ + [Key] + [Column("AttendeeID")] + public int AttendeeId { get; set; } + + [StringLength(254)] + public string AttendeeEmail { get; set; } = null!; + + [StringLength(100)] + public string? AttendeeFirstName { get; set; } + + [StringLength(100)] + public string? AttendeeLastName { get; set; } + + [StringLength(50)] + public string? AttendeePhone { get; set; } + + [Column("AttendeeEventNodeID")] + public int AttendeeEventNodeId { get; set; } + + [Column("AttendeeGUID")] + public Guid AttendeeGuid { get; set; } + + public DateTime AttendeeLastModified { get; set; } + + [ForeignKey("AttendeeEventNodeId")] + [InverseProperty("EventsAttendees")] + public virtual CmsTree AttendeeEventNode { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ExportHistory.cs b/Migration.Tool.KX12/Models/ExportHistory.cs new file mode 100644 index 00000000..9ab189ad --- /dev/null +++ b/Migration.Tool.KX12/Models/ExportHistory.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Export_History")] +[Index("ExportSiteId", Name = "IX_Export_History_ExportSiteID")] +[Index("ExportUserId", Name = "IX_Export_History_ExportUserID")] +public class ExportHistory +{ + [Key] + [Column("ExportID")] + public int ExportId { get; set; } + + public DateTime ExportDateTime { get; set; } + + [StringLength(450)] + public string ExportFileName { get; set; } = null!; + + [Column("ExportSiteID")] + public int? ExportSiteId { get; set; } + + [Column("ExportUserID")] + public int? ExportUserId { get; set; } + + public string? ExportSettings { get; set; } + + [ForeignKey("ExportSiteId")] + [InverseProperty("ExportHistories")] + public virtual CmsSite? ExportSite { get; set; } + + [ForeignKey("ExportUserId")] + [InverseProperty("ExportHistories")] + public virtual CmsUser? ExportUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ExportTask.cs b/Migration.Tool.KX12/Models/ExportTask.cs new file mode 100644 index 00000000..8082e2f4 --- /dev/null +++ b/Migration.Tool.KX12/Models/ExportTask.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Export_Task")] +[Index("TaskSiteId", "TaskObjectType", Name = "IX_Export_Task_TaskSiteID_TaskObjectType")] +public class ExportTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [ForeignKey("TaskSiteId")] + [InverseProperty("ExportTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ForumsAttachment.cs b/Migration.Tool.KX12/Models/ForumsAttachment.cs new file mode 100644 index 00000000..f29417d9 --- /dev/null +++ b/Migration.Tool.KX12/Models/ForumsAttachment.cs @@ -0,0 +1,52 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Forums_Attachment")] +[Index("AttachmentSiteId", "AttachmentGuid", Name = "IX_Forums_Attachment_AttachmentGUID", IsUnique = true)] +[Index("AttachmentPostId", Name = "IX_Forums_Attachment_AttachmentPostID")] +public class ForumsAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(200)] + public string AttachmentFileName { get; set; } = null!; + + [StringLength(10)] + public string AttachmentFileExtension { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public int AttachmentFileSize { get; set; } + + public int? AttachmentImageHeight { get; set; } + + public int? AttachmentImageWidth { get; set; } + + [Column("AttachmentPostID")] + public int AttachmentPostId { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + [ForeignKey("AttachmentPostId")] + [InverseProperty("ForumsAttachments")] + public virtual ForumsForumPost AttachmentPost { get; set; } = null!; + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("ForumsAttachments")] + public virtual CmsSite AttachmentSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ForumsForum.cs b/Migration.Tool.KX12/Models/ForumsForum.cs new file mode 100644 index 00000000..2cc1e9ef --- /dev/null +++ b/Migration.Tool.KX12/Models/ForumsForum.cs @@ -0,0 +1,146 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Forums_Forum")] +[Index("ForumCommunityGroupId", Name = "IX_Forums_Forum_ForumCommunityGroupID")] +[Index("ForumDocumentId", Name = "IX_Forums_Forum_ForumDocumentID")] +[Index("ForumSiteId", "ForumName", Name = "IX_Forums_Forum_ForumSiteID_ForumName")] +public class ForumsForum +{ + [Key] + [Column("ForumID")] + public int ForumId { get; set; } + + [Column("ForumGroupID")] + public int ForumGroupId { get; set; } + + [StringLength(200)] + public string ForumName { get; set; } = null!; + + [StringLength(200)] + public string ForumDisplayName { get; set; } = null!; + + public string? ForumDescription { get; set; } + + public int? ForumOrder { get; set; } + + [Column("ForumDocumentID")] + public int? ForumDocumentId { get; set; } + + public bool ForumOpen { get; set; } + + public bool ForumModerated { get; set; } + + public bool? ForumDisplayEmails { get; set; } + + public bool? ForumRequireEmail { get; set; } + + public int ForumAccess { get; set; } + + public int ForumThreads { get; set; } + + public int ForumPosts { get; set; } + + public DateTime? ForumLastPostTime { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserName { get; set; } + + [StringLength(200)] + public string? ForumBaseUrl { get; set; } + + public bool? ForumAllowChangeName { get; set; } + + [Column("ForumHTMLEditor")] + public bool? ForumHtmleditor { get; set; } + + [Column("ForumUseCAPTCHA")] + public bool? ForumUseCaptcha { get; set; } + + [Column("ForumGUID")] + public Guid ForumGuid { get; set; } + + public DateTime ForumLastModified { get; set; } + + [StringLength(200)] + public string? ForumUnsubscriptionUrl { get; set; } + + public bool? ForumIsLocked { get; set; } + + public string? ForumSettings { get; set; } + + public bool? ForumAuthorEdit { get; set; } + + public bool? ForumAuthorDelete { get; set; } + + public int? ForumType { get; set; } + + public int? ForumIsAnswerLimit { get; set; } + + public int? ForumImageMaxSideSize { get; set; } + + public DateTime? ForumLastPostTimeAbsolute { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserNameAbsolute { get; set; } + + public int? ForumPostsAbsolute { get; set; } + + public int? ForumThreadsAbsolute { get; set; } + + public int? ForumAttachmentMaxFileSize { get; set; } + + public int? ForumDiscussionActions { get; set; } + + [Column("ForumSiteID")] + public int ForumSiteId { get; set; } + + public bool? ForumLogActivity { get; set; } + + [Column("ForumCommunityGroupID")] + public int? ForumCommunityGroupId { get; set; } + + public bool? ForumEnableOptIn { get; set; } + + public bool? ForumSendOptInConfirmation { get; set; } + + [Column("ForumOptInApprovalURL")] + [StringLength(450)] + public string? ForumOptInApprovalUrl { get; set; } + + [ForeignKey("ForumCommunityGroupId")] + [InverseProperty("ForumsForums")] + public virtual CommunityGroup? ForumCommunityGroup { get; set; } + + [ForeignKey("ForumDocumentId")] + [InverseProperty("ForumsForums")] + public virtual CmsDocument? ForumDocument { get; set; } + + [ForeignKey("ForumGroupId")] + [InverseProperty("ForumsForums")] + public virtual ForumsForumGroup ForumGroup { get; set; } = null!; + + [ForeignKey("ForumSiteId")] + [InverseProperty("ForumsForums")] + public virtual CmsSite ForumSite { get; set; } = null!; + + [InverseProperty("PostForum")] + public virtual ICollection ForumsForumPosts { get; set; } = new List(); + + [InverseProperty("Forum")] + public virtual ICollection ForumsForumRoles { get; set; } = new List(); + + [InverseProperty("SubscriptionForum")] + public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); + + [InverseProperty("Forum")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [ForeignKey("ForumId")] + [InverseProperty("Forums")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/ForumsForumGroup.cs b/Migration.Tool.KX12/Models/ForumsForumGroup.cs new file mode 100644 index 00000000..86489e62 --- /dev/null +++ b/Migration.Tool.KX12/Models/ForumsForumGroup.cs @@ -0,0 +1,88 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Forums_ForumGroup")] +[Index("GroupGroupId", Name = "IX_Forums_ForumGroup_GroupGroupID")] +[Index("GroupSiteId", "GroupName", Name = "IX_Forums_ForumGroup_GroupSiteID_GroupName")] +public class ForumsForumGroup +{ + [Key] + [Column("GroupID")] + public int GroupId { get; set; } + + [Column("GroupSiteID")] + public int GroupSiteId { get; set; } + + [StringLength(200)] + public string GroupName { get; set; } = null!; + + [StringLength(200)] + public string GroupDisplayName { get; set; } = null!; + + public int? GroupOrder { get; set; } + + public string? GroupDescription { get; set; } + + [Column("GroupGUID")] + public Guid GroupGuid { get; set; } + + public DateTime GroupLastModified { get; set; } + + [StringLength(200)] + public string? GroupBaseUrl { get; set; } + + [StringLength(200)] + public string? GroupUnsubscriptionUrl { get; set; } + + [Column("GroupGroupID")] + public int? GroupGroupId { get; set; } + + public bool? GroupAuthorEdit { get; set; } + + public bool? GroupAuthorDelete { get; set; } + + public int? GroupType { get; set; } + + public int? GroupIsAnswerLimit { get; set; } + + public int? GroupImageMaxSideSize { get; set; } + + public bool? GroupDisplayEmails { get; set; } + + public bool? GroupRequireEmail { get; set; } + + [Column("GroupHTMLEditor")] + public bool? GroupHtmleditor { get; set; } + + [Column("GroupUseCAPTCHA")] + public bool? GroupUseCaptcha { get; set; } + + public int? GroupAttachmentMaxFileSize { get; set; } + + public int? GroupDiscussionActions { get; set; } + + public bool? GroupLogActivity { get; set; } + + public bool? GroupEnableOptIn { get; set; } + + public bool? GroupSendOptInConfirmation { get; set; } + + [Column("GroupOptInApprovalURL")] + [StringLength(450)] + public string? GroupOptInApprovalUrl { get; set; } + + [InverseProperty("ForumGroup")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [ForeignKey("GroupGroupId")] + [InverseProperty("ForumsForumGroups")] + public virtual CommunityGroup? GroupGroup { get; set; } + + [ForeignKey("GroupSiteId")] + [InverseProperty("ForumsForumGroups")] + public virtual CmsSite GroupSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ForumsForumPost.cs b/Migration.Tool.KX12/Models/ForumsForumPost.cs new file mode 100644 index 00000000..a16833e0 --- /dev/null +++ b/Migration.Tool.KX12/Models/ForumsForumPost.cs @@ -0,0 +1,123 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Forums_ForumPost")] +[Index("PostApproved", Name = "IX_Forums_ForumPost_PostApproved")] +[Index("PostApprovedByUserId", Name = "IX_Forums_ForumPost_PostApprovedByUserID")] +[Index("PostForumId", Name = "IX_Forums_ForumPost_PostForumID")] +[Index("PostLevel", Name = "IX_Forums_ForumPost_PostLevel")] +[Index("PostParentId", Name = "IX_Forums_ForumPost_PostParentID")] +[Index("PostUserId", Name = "IX_Forums_ForumPost_PostUserID")] +public class ForumsForumPost +{ + [Key] + public int PostId { get; set; } + + [Column("PostForumID")] + public int PostForumId { get; set; } + + [Column("PostParentID")] + public int? PostParentId { get; set; } + + [Column("PostIDPath")] + public string PostIdpath { get; set; } = null!; + + public int PostLevel { get; set; } + + [StringLength(450)] + public string PostSubject { get; set; } = null!; + + [Column("PostUserID")] + public int? PostUserId { get; set; } + + [StringLength(200)] + public string PostUserName { get; set; } = null!; + + [StringLength(254)] + public string? PostUserMail { get; set; } + + public string? PostText { get; set; } + + public DateTime PostTime { get; set; } + + [Column("PostApprovedByUserID")] + public int? PostApprovedByUserId { get; set; } + + public int? PostThreadPosts { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserName { get; set; } + + public DateTime? PostThreadLastPostTime { get; set; } + + public string? PostUserSignature { get; set; } + + [Column("PostGUID")] + public Guid PostGuid { get; set; } + + public DateTime PostLastModified { get; set; } + + public bool? PostApproved { get; set; } + + public bool? PostIsLocked { get; set; } + + public int? PostIsAnswer { get; set; } + + public int PostStickOrder { get; set; } + + public int? PostViews { get; set; } + + public DateTime? PostLastEdit { get; set; } + + public string? PostInfo { get; set; } + + public int? PostAttachmentCount { get; set; } + + public int? PostType { get; set; } + + public int? PostThreadPostsAbsolute { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserNameAbsolute { get; set; } + + public DateTime? PostThreadLastPostTimeAbsolute { get; set; } + + public bool? PostQuestionSolved { get; set; } + + public int? PostIsNotAnswer { get; set; } + + [Column("PostSiteID")] + public int? PostSiteId { get; set; } + + [InverseProperty("AttachmentPost")] + public virtual ICollection ForumsAttachments { get; set; } = new List(); + + [InverseProperty("SubscriptionPost")] + public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); + + [InverseProperty("Post")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [InverseProperty("PostParent")] + public virtual ICollection InversePostParent { get; set; } = new List(); + + [ForeignKey("PostApprovedByUserId")] + [InverseProperty("ForumsForumPostPostApprovedByUsers")] + public virtual CmsUser? PostApprovedByUser { get; set; } + + [ForeignKey("PostForumId")] + [InverseProperty("ForumsForumPosts")] + public virtual ForumsForum PostForum { get; set; } = null!; + + [ForeignKey("PostParentId")] + [InverseProperty("InversePostParent")] + public virtual ForumsForumPost? PostParent { get; set; } + + [ForeignKey("PostUserId")] + [InverseProperty("ForumsForumPostPostUsers")] + public virtual CmsUser? PostUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ForumsForumRole.cs b/Migration.Tool.KX12/Models/ForumsForumRole.cs new file mode 100644 index 00000000..379b5a41 --- /dev/null +++ b/Migration.Tool.KX12/Models/ForumsForumRole.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[PrimaryKey("ForumId", "RoleId", "PermissionId")] +[Table("Forums_ForumRoles")] +[Index("PermissionId", Name = "IX_Forums_ForumRoles_PermissionID")] +[Index("RoleId", Name = "IX_Forums_ForumRoles_RoleID")] +public class ForumsForumRole +{ + [Key] + [Column("ForumID")] + public int ForumId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("ForumId")] + [InverseProperty("ForumsForumRoles")] + public virtual ForumsForum Forum { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("ForumsForumRoles")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("ForumsForumRoles")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ForumsForumSubscription.cs b/Migration.Tool.KX12/Models/ForumsForumSubscription.cs new file mode 100644 index 00000000..ae1dd013 --- /dev/null +++ b/Migration.Tool.KX12/Models/ForumsForumSubscription.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Forums_ForumSubscription")] +[Index("SubscriptionForumId", Name = "IX_Forums_ForumSubscription_SubscriptionForumID")] +[Index("SubscriptionPostId", Name = "IX_Forums_ForumSubscription_SubscriptionPostID")] +[Index("SubscriptionUserId", Name = "IX_Forums_ForumSubscription_SubscriptionUserID")] +public class ForumsForumSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionUserID")] + public int? SubscriptionUserId { get; set; } + + [StringLength(254)] + public string? SubscriptionEmail { get; set; } + + [Column("SubscriptionForumID")] + public int SubscriptionForumId { get; set; } + + [Column("SubscriptionPostID")] + public int? SubscriptionPostId { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public DateTime SubscriptionLastModified { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [ForeignKey("SubscriptionForumId")] + [InverseProperty("ForumsForumSubscriptions")] + public virtual ForumsForum SubscriptionForum { get; set; } = null!; + + [ForeignKey("SubscriptionPostId")] + [InverseProperty("ForumsForumSubscriptions")] + public virtual ForumsForumPost? SubscriptionPost { get; set; } + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("ForumsForumSubscriptions")] + public virtual CmsUser? SubscriptionUser { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ForumsUserFavorite.cs b/Migration.Tool.KX12/Models/ForumsUserFavorite.cs new file mode 100644 index 00000000..d974b890 --- /dev/null +++ b/Migration.Tool.KX12/Models/ForumsUserFavorite.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Forums_UserFavorites")] +[Index("ForumId", Name = "IX_Forums_UserFavorites_ForumID")] +[Index("PostId", Name = "IX_Forums_UserFavorites_PostID")] +[Index("SiteId", Name = "IX_Forums_UserFavorites_SiteID")] +[Index("UserId", Name = "IX_Forums_UserFavorites_UserID")] +[Index("UserId", "PostId", "ForumId", Name = "IX_Forums_UserFavorites_UserID_PostID_ForumID", IsUnique = true)] +public class ForumsUserFavorite +{ + [Key] + [Column("FavoriteID")] + public int FavoriteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("PostID")] + public int? PostId { get; set; } + + [Column("ForumID")] + public int? ForumId { get; set; } + + [StringLength(100)] + public string? FavoriteName { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [Column("FavoriteGUID")] + public Guid FavoriteGuid { get; set; } + + public DateTime FavoriteLastModified { get; set; } + + [ForeignKey("ForumId")] + [InverseProperty("ForumsUserFavorites")] + public virtual ForumsForum? Forum { get; set; } + + [ForeignKey("PostId")] + [InverseProperty("ForumsUserFavorites")] + public virtual ForumsForumPost? Post { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("ForumsUserFavorites")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("ForumsUserFavorites")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/IntegrationConnector.cs b/Migration.Tool.KX12/Models/IntegrationConnector.cs new file mode 100644 index 00000000..452b9707 --- /dev/null +++ b/Migration.Tool.KX12/Models/IntegrationConnector.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Integration_Connector")] +[Index("ConnectorEnabled", Name = "IX_Integration_Connector_ConnectorEnabled")] +public class IntegrationConnector +{ + [Key] + [Column("ConnectorID")] + public int ConnectorId { get; set; } + + [StringLength(100)] + public string ConnectorName { get; set; } = null!; + + [StringLength(440)] + public string ConnectorDisplayName { get; set; } = null!; + + [StringLength(400)] + public string ConnectorAssemblyName { get; set; } = null!; + + [StringLength(400)] + public string ConnectorClassName { get; set; } = null!; + + [Required] + public bool? ConnectorEnabled { get; set; } + + public DateTime ConnectorLastModified { get; set; } + + [InverseProperty("SynchronizationConnector")] + public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/IntegrationSyncLog.cs b/Migration.Tool.KX12/Models/IntegrationSyncLog.cs new file mode 100644 index 00000000..9e42c970 --- /dev/null +++ b/Migration.Tool.KX12/Models/IntegrationSyncLog.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Integration_SyncLog")] +[Index("SyncLogSynchronizationId", Name = "IX_Integration_SyncLog_SyncLogTaskID")] +public class IntegrationSyncLog +{ + [Key] + [Column("SyncLogID")] + public int SyncLogId { get; set; } + + [Column("SyncLogSynchronizationID")] + public int SyncLogSynchronizationId { get; set; } + + public DateTime SyncLogTime { get; set; } + + public string? SyncLogErrorMessage { get; set; } + + [ForeignKey("SyncLogSynchronizationId")] + [InverseProperty("IntegrationSyncLogs")] + public virtual IntegrationSynchronization SyncLogSynchronization { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/IntegrationSynchronization.cs b/Migration.Tool.KX12/Models/IntegrationSynchronization.cs new file mode 100644 index 00000000..ce8e8285 --- /dev/null +++ b/Migration.Tool.KX12/Models/IntegrationSynchronization.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Integration_Synchronization")] +[Index("SynchronizationConnectorId", Name = "IX_Integration_Synchronization_SynchronizationConnectorID")] +[Index("SynchronizationTaskId", Name = "IX_Integration_Synchronization_SynchronizationTaskID")] +public class IntegrationSynchronization +{ + [Key] + [Column("SynchronizationID")] + public int SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int SynchronizationTaskId { get; set; } + + [Column("SynchronizationConnectorID")] + public int SynchronizationConnectorId { get; set; } + + public DateTime SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + public bool? SynchronizationIsRunning { get; set; } + + [InverseProperty("SyncLogSynchronization")] + public virtual ICollection IntegrationSyncLogs { get; set; } = new List(); + + [ForeignKey("SynchronizationConnectorId")] + [InverseProperty("IntegrationSynchronizations")] + public virtual IntegrationConnector SynchronizationConnector { get; set; } = null!; + + [ForeignKey("SynchronizationTaskId")] + [InverseProperty("IntegrationSynchronizations")] + public virtual IntegrationTask SynchronizationTask { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/IntegrationTask.cs b/Migration.Tool.KX12/Models/IntegrationTask.cs new file mode 100644 index 00000000..6541250e --- /dev/null +++ b/Migration.Tool.KX12/Models/IntegrationTask.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Integration_Task")] +[Index("TaskIsInbound", Name = "IX_Integration_Task_TaskIsInbound")] +[Index("TaskSiteId", Name = "IX_Integration_Task_TaskSiteID")] +[Index("TaskType", Name = "IX_Integration_Task_TaskType")] +public class IntegrationTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool TaskIsInbound { get; set; } + + [StringLength(50)] + public string? TaskProcessType { get; set; } + + public string TaskData { get; set; } = null!; + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(50)] + public string? TaskDataType { get; set; } + + [InverseProperty("SynchronizationTask")] + public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); + + [ForeignKey("TaskSiteId")] + [InverseProperty("IntegrationTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/MediaFile.cs b/Migration.Tool.KX12/Models/MediaFile.cs new file mode 100644 index 00000000..2aa1813a --- /dev/null +++ b/Migration.Tool.KX12/Models/MediaFile.cs @@ -0,0 +1,77 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Media_File")] +[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] +[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] +[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] +[Index("FileSiteId", "FileGuid", Name = "IX_Media_File_FileSiteID_FileGUID")] +public class MediaFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string FileTitle { get; set; } = null!; + + public string FileDescription { get; set; } = null!; + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public string FilePath { get; set; } = null!; + + public long FileSize { get; set; } + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileLibraryID")] + public int FileLibraryId { get; set; } + + [Column("FileSiteID")] + public int FileSiteId { get; set; } + + [Column("FileCreatedByUserID")] + public int? FileCreatedByUserId { get; set; } + + public DateTime FileCreatedWhen { get; set; } + + [Column("FileModifiedByUserID")] + public int? FileModifiedByUserId { get; set; } + + public DateTime FileModifiedWhen { get; set; } + + public string? FileCustomData { get; set; } + + [ForeignKey("FileCreatedByUserId")] + [InverseProperty("MediaFileFileCreatedByUsers")] + public virtual CmsUser? FileCreatedByUser { get; set; } + + [ForeignKey("FileLibraryId")] + [InverseProperty("MediaFiles")] + public virtual MediaLibrary FileLibrary { get; set; } = null!; + + [ForeignKey("FileModifiedByUserId")] + [InverseProperty("MediaFileFileModifiedByUsers")] + public virtual CmsUser? FileModifiedByUser { get; set; } + + [ForeignKey("FileSiteId")] + [InverseProperty("MediaFiles")] + public virtual CmsSite FileSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/MediaLibrary.cs b/Migration.Tool.KX12/Models/MediaLibrary.cs new file mode 100644 index 00000000..4d8d84fa --- /dev/null +++ b/Migration.Tool.KX12/Models/MediaLibrary.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Media_Library")] +[Index("LibraryGroupId", Name = "IX_Media_Library_LibraryGroupID")] +[Index("LibrarySiteId", "LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] +public class MediaLibrary +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [StringLength(250)] + public string LibraryName { get; set; } = null!; + + [StringLength(250)] + public string LibraryDisplayName { get; set; } = null!; + + public string? LibraryDescription { get; set; } + + [StringLength(250)] + public string LibraryFolder { get; set; } = null!; + + public int? LibraryAccess { get; set; } + + [Column("LibraryGroupID")] + public int? LibraryGroupId { get; set; } + + [Column("LibrarySiteID")] + public int LibrarySiteId { get; set; } + + [Column("LibraryGUID")] + public Guid? LibraryGuid { get; set; } + + public DateTime? LibraryLastModified { get; set; } + + [StringLength(450)] + public string? LibraryTeaserPath { get; set; } + + [Column("LibraryTeaserGUID")] + public Guid? LibraryTeaserGuid { get; set; } + + [ForeignKey("LibraryGroupId")] + [InverseProperty("MediaLibraries")] + public virtual CommunityGroup? LibraryGroup { get; set; } + + [ForeignKey("LibrarySiteId")] + [InverseProperty("MediaLibraries")] + public virtual CmsSite LibrarySite { get; set; } = null!; + + [InverseProperty("FileLibrary")] + public virtual ICollection MediaFiles { get; set; } = new List(); + + [InverseProperty("Library")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/MediaLibraryRolePermission.cs b/Migration.Tool.KX12/Models/MediaLibraryRolePermission.cs new file mode 100644 index 00000000..20197269 --- /dev/null +++ b/Migration.Tool.KX12/Models/MediaLibraryRolePermission.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[PrimaryKey("LibraryId", "RoleId", "PermissionId")] +[Table("Media_LibraryRolePermission")] +[Index("PermissionId", Name = "IX_Media_LibraryRolePermission_PermissionID")] +[Index("RoleId", Name = "IX_Media_LibraryRolePermission_RoleID")] +public class MediaLibraryRolePermission +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("LibraryId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual MediaLibrary Library { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/NewsletterAbtest.cs b/Migration.Tool.KX12/Models/NewsletterAbtest.cs new file mode 100644 index 00000000..82969008 --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterAbtest.cs @@ -0,0 +1,53 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_ABTest")] +[Index("TestIssueId", Name = "IX_Newsletter_ABTest_TestIssueID", IsUnique = true)] +[Index("TestWinnerIssueId", Name = "IX_Newsletter_ABTest_TestWinnerIssueID")] +[Index("TestWinnerScheduledTaskId", Name = "IX_Newsletter_ABTest_TestWinnerScheduledTaskID")] +public class NewsletterAbtest +{ + [Key] + [Column("TestID")] + public int TestId { get; set; } + + [Column("TestIssueID")] + public int TestIssueId { get; set; } + + public int TestWinnerOption { get; set; } + + public int? TestSelectWinnerAfter { get; set; } + + [Column("TestWinnerIssueID")] + public int? TestWinnerIssueId { get; set; } + + public DateTime? TestWinnerSelected { get; set; } + + public DateTime TestLastModified { get; set; } + + [Column("TestGUID")] + public Guid TestGuid { get; set; } + + [Column("TestWinnerScheduledTaskID")] + public int? TestWinnerScheduledTaskId { get; set; } + + public int TestSizePercentage { get; set; } + + public int? TestNumberPerVariantEmails { get; set; } + + [ForeignKey("TestIssueId")] + [InverseProperty("NewsletterAbtestTestIssue")] + public virtual NewsletterNewsletterIssue TestIssue { get; set; } = null!; + + [ForeignKey("TestWinnerIssueId")] + [InverseProperty("NewsletterAbtestTestWinnerIssues")] + public virtual NewsletterNewsletterIssue? TestWinnerIssue { get; set; } + + [ForeignKey("TestWinnerScheduledTaskId")] + [InverseProperty("NewsletterAbtests")] + public virtual CmsScheduledTask? TestWinnerScheduledTask { get; set; } +} diff --git a/Migration.Tool.KX12/Models/NewsletterClickedLink.cs b/Migration.Tool.KX12/Models/NewsletterClickedLink.cs new file mode 100644 index 00000000..738718aa --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterClickedLink.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_ClickedLink")] +[Index("ClickedLinkNewsletterLinkId", Name = "IX_Newsletter_ClickedLink_ClickedLinkNewsletterLinkID")] +public class NewsletterClickedLink +{ + [Key] + [Column("ClickedLinkID")] + public int ClickedLinkId { get; set; } + + public Guid ClickedLinkGuid { get; set; } + + [StringLength(254)] + public string ClickedLinkEmail { get; set; } = null!; + + [Column("ClickedLinkNewsletterLinkID")] + public int ClickedLinkNewsletterLinkId { get; set; } + + public DateTime? ClickedLinkTime { get; set; } + + [ForeignKey("ClickedLinkNewsletterLinkId")] + [InverseProperty("NewsletterClickedLinks")] + public virtual NewsletterLink ClickedLinkNewsletterLink { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/NewsletterEmail.cs b/Migration.Tool.KX12/Models/NewsletterEmail.cs new file mode 100644 index 00000000..f604ec77 --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterEmail.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_Emails")] +[Index("EmailGuid", Name = "IX_Newsletter_Emails_EmailGUID", IsUnique = true)] +[Index("EmailNewsletterIssueId", Name = "IX_Newsletter_Emails_EmailNewsletterIssueID")] +[Index("EmailSending", Name = "IX_Newsletter_Emails_EmailSending")] +[Index("EmailSiteId", Name = "IX_Newsletter_Emails_EmailSiteID")] +[Index("EmailSubscriberId", Name = "IX_Newsletter_Emails_EmailSubscriberID")] +public class NewsletterEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [Column("EmailNewsletterIssueID")] + public int EmailNewsletterIssueId { get; set; } + + [Column("EmailSubscriberID")] + public int? EmailSubscriberId { get; set; } + + [Column("EmailSiteID")] + public int EmailSiteId { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + public bool? EmailSending { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + [Column("EmailContactID")] + public int? EmailContactId { get; set; } + + [StringLength(254)] + public string? EmailAddress { get; set; } + + [ForeignKey("EmailNewsletterIssueId")] + [InverseProperty("NewsletterEmails")] + public virtual NewsletterNewsletterIssue EmailNewsletterIssue { get; set; } = null!; + + [ForeignKey("EmailSiteId")] + [InverseProperty("NewsletterEmails")] + public virtual CmsSite EmailSite { get; set; } = null!; + + [ForeignKey("EmailSubscriberId")] + [InverseProperty("NewsletterEmails")] + public virtual NewsletterSubscriber? EmailSubscriber { get; set; } +} diff --git a/Migration.Tool.KX12/Models/NewsletterEmailTemplate.cs b/Migration.Tool.KX12/Models/NewsletterEmailTemplate.cs new file mode 100644 index 00000000..02e32639 --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterEmailTemplate.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_EmailTemplate")] +[Index("TemplateSiteId", "TemplateName", Name = "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateName", IsUnique = true)] +public class NewsletterEmailTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(250)] + public string TemplateDisplayName { get; set; } = null!; + + [StringLength(250)] + public string TemplateName { get; set; } = null!; + + [Column("TemplateSiteID")] + public int TemplateSiteId { get; set; } + + [StringLength(50)] + public string TemplateType { get; set; } = null!; + + [Column("TemplateGUID")] + public Guid TemplateGuid { get; set; } + + public DateTime TemplateLastModified { get; set; } + + [StringLength(450)] + public string? TemplateSubject { get; set; } + + [Column("TemplateThumbnailGUID")] + public Guid? TemplateThumbnailGuid { get; set; } + + public string? TemplateDescription { get; set; } + + [StringLength(200)] + public string? TemplateIconClass { get; set; } + + public string? TemplateCode { get; set; } + + [Column("TemplateInlineCSS")] + public bool TemplateInlineCss { get; set; } + + [InverseProperty("Template")] + public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); + + [InverseProperty("IssueTemplate")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [InverseProperty("NewsletterOptInTemplate")] + public virtual ICollection NewsletterNewsletterNewsletterOptInTemplates { get; set; } = new List(); + + [InverseProperty("NewsletterUnsubscriptionTemplate")] + public virtual ICollection NewsletterNewsletterNewsletterUnsubscriptionTemplates { get; set; } = new List(); + + [ForeignKey("TemplateSiteId")] + [InverseProperty("NewsletterEmailTemplates")] + public virtual CmsSite TemplateSite { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("Templates")] + public virtual ICollection Newsletters { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/NewsletterEmailWidget.cs b/Migration.Tool.KX12/Models/NewsletterEmailWidget.cs new file mode 100644 index 00000000..ff633d85 --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterEmailWidget.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_EmailWidget")] +[Index("EmailWidgetSiteId", Name = "IX_Newsletter_EmailWidget_EmailWidgetSiteID")] +public class NewsletterEmailWidget +{ + [Key] + [Column("EmailWidgetID")] + public int EmailWidgetId { get; set; } + + public Guid EmailWidgetGuid { get; set; } + + public DateTime EmailWidgetLastModified { get; set; } + + [StringLength(250)] + public string EmailWidgetDisplayName { get; set; } = null!; + + [StringLength(250)] + public string EmailWidgetName { get; set; } = null!; + + public string? EmailWidgetDescription { get; set; } + + public string? EmailWidgetCode { get; set; } + + [Column("EmailWidgetSiteID")] + public int EmailWidgetSiteId { get; set; } + + [Column("EmailWidgetThumbnailGUID")] + public Guid? EmailWidgetThumbnailGuid { get; set; } + + [StringLength(200)] + public string? EmailWidgetIconCssClass { get; set; } + + public string? EmailWidgetProperties { get; set; } + + [ForeignKey("EmailWidgetSiteId")] + [InverseProperty("NewsletterEmailWidgets")] + public virtual CmsSite EmailWidgetSite { get; set; } = null!; + + [InverseProperty("EmailWidget")] + public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/NewsletterEmailWidgetTemplate.cs b/Migration.Tool.KX12/Models/NewsletterEmailWidgetTemplate.cs new file mode 100644 index 00000000..b903618f --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterEmailWidgetTemplate.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_EmailWidgetTemplate")] +[Index("EmailWidgetId", Name = "IX_Newsletter_EmailWidgetTemplate_EmailWidgetID")] +[Index("TemplateId", Name = "IX_Newsletter_EmailWidgetTemplate_TemplateID")] +public class NewsletterEmailWidgetTemplate +{ + [Key] + [Column("EmailWidgetTemplateID")] + public int EmailWidgetTemplateId { get; set; } + + [Column("EmailWidgetID")] + public int EmailWidgetId { get; set; } + + [Column("TemplateID")] + public int TemplateId { get; set; } + + [ForeignKey("EmailWidgetId")] + [InverseProperty("NewsletterEmailWidgetTemplates")] + public virtual NewsletterEmailWidget EmailWidget { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("NewsletterEmailWidgetTemplates")] + public virtual NewsletterEmailTemplate Template { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/NewsletterIssueContactGroup.cs b/Migration.Tool.KX12/Models/NewsletterIssueContactGroup.cs new file mode 100644 index 00000000..7da0c59e --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterIssueContactGroup.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_IssueContactGroup")] +[Index("ContactGroupId", Name = "IX_Newsletter_IssueContactGroup_ContactGroupID")] +public class NewsletterIssueContactGroup +{ + [Key] + [Column("IssueContactGroupID")] + public int IssueContactGroupId { get; set; } + + [Column("IssueID")] + public int IssueId { get; set; } + + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [ForeignKey("ContactGroupId")] + [InverseProperty("NewsletterIssueContactGroups")] + public virtual OmContactGroup ContactGroup { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/NewsletterLink.cs b/Migration.Tool.KX12/Models/NewsletterLink.cs new file mode 100644 index 00000000..e571311e --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterLink.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_Link")] +[Index("LinkIssueId", Name = "IX_Newsletter_Link_LinkIssueID")] +public class NewsletterLink +{ + [Key] + [Column("LinkID")] + public int LinkId { get; set; } + + [Column("LinkIssueID")] + public int LinkIssueId { get; set; } + + public string LinkTarget { get; set; } = null!; + + [StringLength(450)] + public string LinkDescription { get; set; } = null!; + + [Column("LinkGUID")] + public Guid LinkGuid { get; set; } + + [ForeignKey("LinkIssueId")] + [InverseProperty("NewsletterLinks")] + public virtual NewsletterNewsletterIssue LinkIssue { get; set; } = null!; + + [InverseProperty("ClickedLinkNewsletterLink")] + public virtual ICollection NewsletterClickedLinks { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/NewsletterNewsletter.cs b/Migration.Tool.KX12/Models/NewsletterNewsletter.cs new file mode 100644 index 00000000..5125e61c --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterNewsletter.cs @@ -0,0 +1,115 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_Newsletter")] +[Index("NewsletterDynamicScheduledTaskId", Name = "IX_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID")] +[Index("NewsletterOptInTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterOptInTemplateID")] +[Index("NewsletterSiteId", "NewsletterName", Name = "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterName", IsUnique = true)] +[Index("NewsletterSubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterSubscriptionTemplateID")] +[Index("NewsletterUnsubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID")] +public class NewsletterNewsletter +{ + [Key] + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + [StringLength(250)] + public string NewsletterDisplayName { get; set; } = null!; + + [StringLength(250)] + public string NewsletterName { get; set; } = null!; + + [Column("NewsletterSubscriptionTemplateID")] + public int? NewsletterSubscriptionTemplateId { get; set; } + + [Column("NewsletterUnsubscriptionTemplateID")] + public int NewsletterUnsubscriptionTemplateId { get; set; } + + [StringLength(200)] + public string NewsletterSenderName { get; set; } = null!; + + [StringLength(254)] + public string NewsletterSenderEmail { get; set; } = null!; + + [StringLength(100)] + public string? NewsletterDynamicSubject { get; set; } + + [Column("NewsletterDynamicURL")] + [StringLength(500)] + public string? NewsletterDynamicUrl { get; set; } + + [Column("NewsletterDynamicScheduledTaskID")] + public int? NewsletterDynamicScheduledTaskId { get; set; } + + [Column("NewsletterSiteID")] + public int NewsletterSiteId { get; set; } + + [Column("NewsletterGUID")] + public Guid NewsletterGuid { get; set; } + + [StringLength(1000)] + public string? NewsletterUnsubscribeUrl { get; set; } + + [StringLength(500)] + public string? NewsletterBaseUrl { get; set; } + + public DateTime NewsletterLastModified { get; set; } + + public bool? NewsletterEnableOptIn { get; set; } + + [Column("NewsletterOptInTemplateID")] + public int? NewsletterOptInTemplateId { get; set; } + + public bool? NewsletterSendOptInConfirmation { get; set; } + + [Column("NewsletterOptInApprovalURL")] + [StringLength(450)] + public string? NewsletterOptInApprovalUrl { get; set; } + + public bool? NewsletterTrackOpenEmails { get; set; } + + public bool? NewsletterTrackClickedLinks { get; set; } + + [StringLength(998)] + public string? NewsletterDraftEmails { get; set; } + + public bool? NewsletterLogActivity { get; set; } + + [StringLength(5)] + public string NewsletterSource { get; set; } = null!; + + public int NewsletterType { get; set; } + + [ForeignKey("NewsletterDynamicScheduledTaskId")] + [InverseProperty("NewsletterNewsletters")] + public virtual CmsScheduledTask? NewsletterDynamicScheduledTask { get; set; } + + [InverseProperty("IssueNewsletter")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [ForeignKey("NewsletterOptInTemplateId")] + [InverseProperty("NewsletterNewsletterNewsletterOptInTemplates")] + public virtual NewsletterEmailTemplate? NewsletterOptInTemplate { get; set; } + + [ForeignKey("NewsletterSiteId")] + [InverseProperty("NewsletterNewsletters")] + public virtual CmsSite NewsletterSite { get; set; } = null!; + + [InverseProperty("Newsletter")] + public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); + + [ForeignKey("NewsletterUnsubscriptionTemplateId")] + [InverseProperty("NewsletterNewsletterNewsletterUnsubscriptionTemplates")] + public virtual NewsletterEmailTemplate NewsletterUnsubscriptionTemplate { get; set; } = null!; + + [InverseProperty("UnsubscriptionNewsletter")] + public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); + + [ForeignKey("NewsletterId")] + [InverseProperty("Newsletters")] + public virtual ICollection Templates { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/NewsletterNewsletterIssue.cs b/Migration.Tool.KX12/Models/NewsletterNewsletterIssue.cs new file mode 100644 index 00000000..6948c535 --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterNewsletterIssue.cs @@ -0,0 +1,125 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_NewsletterIssue")] +[Index("IssueNewsletterId", Name = "IX_Newsletter_NewsletterIssue_IssueNewsletterID")] +[Index("IssueScheduledTaskId", Name = "IX_Newsletter_NewsletterIssue_IssueScheduledTaskID")] +[Index("IssueSiteId", Name = "IX_Newsletter_NewsletterIssue_IssueSiteID")] +[Index("IssueTemplateId", Name = "IX_Newsletter_NewsletterIssue_IssueTemplateID")] +[Index("IssueVariantOfIssueId", Name = "IX_Newsletter_NewsletterIssue_IssueVariantOfIssueID")] +public class NewsletterNewsletterIssue +{ + [Key] + [Column("IssueID")] + public int IssueId { get; set; } + + [StringLength(450)] + public string IssueSubject { get; set; } = null!; + + public string IssueText { get; set; } = null!; + + public int IssueUnsubscribed { get; set; } + + [Column("IssueNewsletterID")] + public int IssueNewsletterId { get; set; } + + [Column("IssueTemplateID")] + public int? IssueTemplateId { get; set; } + + public int IssueSentEmails { get; set; } + + public DateTime? IssueMailoutTime { get; set; } + + [Column("IssueGUID")] + public Guid IssueGuid { get; set; } + + public DateTime IssueLastModified { get; set; } + + [Column("IssueSiteID")] + public int IssueSiteId { get; set; } + + public int? IssueOpenedEmails { get; set; } + + public int? IssueBounces { get; set; } + + public int? IssueStatus { get; set; } + + [Column("IssueIsABTest")] + public bool? IssueIsAbtest { get; set; } + + [Column("IssueVariantOfIssueID")] + public int? IssueVariantOfIssueId { get; set; } + + [StringLength(200)] + public string? IssueVariantName { get; set; } + + [StringLength(200)] + public string? IssueSenderName { get; set; } + + [StringLength(254)] + public string? IssueSenderEmail { get; set; } + + [Column("IssueScheduledTaskID")] + public int? IssueScheduledTaskId { get; set; } + + [Column("IssueUTMSource")] + [StringLength(200)] + public string? IssueUtmsource { get; set; } + + [Column("IssueUseUTM")] + public bool IssueUseUtm { get; set; } + + [Column("IssueUTMCampaign")] + [StringLength(200)] + public string? IssueUtmcampaign { get; set; } + + [StringLength(200)] + public string IssueDisplayName { get; set; } = null!; + + public string? IssueWidgets { get; set; } + + public string? IssuePreheader { get; set; } + + public string? IssuePlainText { get; set; } + + [InverseProperty("IssueVariantOfIssue")] + public virtual ICollection InverseIssueVariantOfIssue { get; set; } = new List(); + + [ForeignKey("IssueNewsletterId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual NewsletterNewsletter IssueNewsletter { get; set; } = null!; + + [ForeignKey("IssueSiteId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual CmsSite IssueSite { get; set; } = null!; + + [ForeignKey("IssueTemplateId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual NewsletterEmailTemplate? IssueTemplate { get; set; } + + [ForeignKey("IssueVariantOfIssueId")] + [InverseProperty("InverseIssueVariantOfIssue")] + public virtual NewsletterNewsletterIssue? IssueVariantOfIssue { get; set; } + + [InverseProperty("TestIssue")] + public virtual NewsletterAbtest? NewsletterAbtestTestIssue { get; set; } + + [InverseProperty("TestWinnerIssue")] + public virtual ICollection NewsletterAbtestTestWinnerIssues { get; set; } = new List(); + + [InverseProperty("EmailNewsletterIssue")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("LinkIssue")] + public virtual ICollection NewsletterLinks { get; set; } = new List(); + + [InverseProperty("OpenedEmailIssue")] + public virtual ICollection NewsletterOpenedEmails { get; set; } = new List(); + + [InverseProperty("UnsubscriptionFromIssue")] + public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/NewsletterOpenedEmail.cs b/Migration.Tool.KX12/Models/NewsletterOpenedEmail.cs new file mode 100644 index 00000000..b4be3fff --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterOpenedEmail.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_OpenedEmail")] +[Index("OpenedEmailIssueId", Name = "IX_Newsletter_OpenedEmail_OpenedEmailIssueID")] +public class NewsletterOpenedEmail +{ + [Key] + [Column("OpenedEmailID")] + public int OpenedEmailId { get; set; } + + [StringLength(254)] + public string OpenedEmailEmail { get; set; } = null!; + + public Guid OpenedEmailGuid { get; set; } + + public DateTime? OpenedEmailTime { get; set; } + + [Column("OpenedEmailIssueID")] + public int OpenedEmailIssueId { get; set; } + + [ForeignKey("OpenedEmailIssueId")] + [InverseProperty("NewsletterOpenedEmails")] + public virtual NewsletterNewsletterIssue OpenedEmailIssue { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/NewsletterSubscriber.cs b/Migration.Tool.KX12/Models/NewsletterSubscriber.cs new file mode 100644 index 00000000..67e5e3b2 --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterSubscriber.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_Subscriber")] +[Index("SubscriberEmail", Name = "IX_Newsletter_Subscriber_SubscriberEmail")] +[Index("SubscriberType", "SubscriberRelatedId", Name = "IX_Newsletter_Subscriber_SubscriberType_SubscriberRelatedID")] +public class NewsletterSubscriber +{ + [Key] + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [StringLength(254)] + public string? SubscriberEmail { get; set; } + + [StringLength(200)] + public string? SubscriberFirstName { get; set; } + + [StringLength(200)] + public string? SubscriberLastName { get; set; } + + [Column("SubscriberSiteID")] + public int SubscriberSiteId { get; set; } + + [Column("SubscriberGUID")] + public Guid SubscriberGuid { get; set; } + + public string? SubscriberCustomData { get; set; } + + [StringLength(100)] + public string? SubscriberType { get; set; } + + [Column("SubscriberRelatedID")] + public int SubscriberRelatedId { get; set; } + + public DateTime SubscriberLastModified { get; set; } + + [StringLength(440)] + public string? SubscriberFullName { get; set; } + + public int? SubscriberBounces { get; set; } + + [InverseProperty("EmailSubscriber")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("Subscriber")] + public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); + + [ForeignKey("SubscriberSiteId")] + [InverseProperty("NewsletterSubscribers")] + public virtual CmsSite SubscriberSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/NewsletterSubscriberNewsletter.cs b/Migration.Tool.KX12/Models/NewsletterSubscriberNewsletter.cs new file mode 100644 index 00000000..ec45c349 --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterSubscriberNewsletter.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_SubscriberNewsletter")] +[Index("NewsletterId", "SubscriptionApproved", Name = "IX_Newsletter_SubscriberNewsletter_NewsletterID_SubscriptionApproved")] +[Index("SubscriberId", "NewsletterId", Name = "UQ_Newsletter_SubscriberNewsletter", IsUnique = true)] +public class NewsletterSubscriberNewsletter +{ + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + public DateTime SubscribedWhen { get; set; } + + public bool? SubscriptionApproved { get; set; } + + public DateTime? SubscriptionApprovedWhen { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [Key] + [Column("SubscriberNewsletterID")] + public int SubscriberNewsletterId { get; set; } + + [ForeignKey("NewsletterId")] + [InverseProperty("NewsletterSubscriberNewsletters")] + public virtual NewsletterNewsletter Newsletter { get; set; } = null!; + + [ForeignKey("SubscriberId")] + [InverseProperty("NewsletterSubscriberNewsletters")] + public virtual NewsletterSubscriber Subscriber { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/NewsletterUnsubscription.cs b/Migration.Tool.KX12/Models/NewsletterUnsubscription.cs new file mode 100644 index 00000000..5c6a0159 --- /dev/null +++ b/Migration.Tool.KX12/Models/NewsletterUnsubscription.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Newsletter_Unsubscription")] +[Index("UnsubscriptionEmail", "UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_Email_NewsletterID")] +[Index("UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_NewsletterID")] +[Index("UnsubscriptionFromIssueId", Name = "IX_Newsletter_Unsubscription_UnsubscriptionFromIssueID")] +public class NewsletterUnsubscription +{ + [Key] + [Column("UnsubscriptionID")] + public int UnsubscriptionId { get; set; } + + [StringLength(254)] + public string UnsubscriptionEmail { get; set; } = null!; + + public DateTime UnsubscriptionCreated { get; set; } + + [Column("UnsubscriptionNewsletterID")] + public int? UnsubscriptionNewsletterId { get; set; } + + [Column("UnsubscriptionFromIssueID")] + public int? UnsubscriptionFromIssueId { get; set; } + + [Column("UnsubscriptionGUID")] + public Guid UnsubscriptionGuid { get; set; } + + [ForeignKey("UnsubscriptionFromIssueId")] + [InverseProperty("NewsletterUnsubscriptions")] + public virtual NewsletterNewsletterIssue? UnsubscriptionFromIssue { get; set; } + + [ForeignKey("UnsubscriptionNewsletterId")] + [InverseProperty("NewsletterUnsubscriptions")] + public virtual NewsletterNewsletter? UnsubscriptionNewsletter { get; set; } +} diff --git a/Migration.Tool.KX12/Models/NotificationGateway.cs b/Migration.Tool.KX12/Models/NotificationGateway.cs new file mode 100644 index 00000000..9619b444 --- /dev/null +++ b/Migration.Tool.KX12/Models/NotificationGateway.cs @@ -0,0 +1,46 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("Notification_Gateway")] +public class NotificationGateway +{ + [Key] + [Column("GatewayID")] + public int GatewayId { get; set; } + + [StringLength(200)] + public string GatewayName { get; set; } = null!; + + [StringLength(200)] + public string GatewayDisplayName { get; set; } = null!; + + [StringLength(200)] + public string GatewayAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string GatewayClassName { get; set; } = null!; + + public string? GatewayDescription { get; set; } + + public bool? GatewaySupportsEmail { get; set; } + + public bool? GatewaySupportsPlainText { get; set; } + + [Column("GatewaySupportsHTMLText")] + public bool? GatewaySupportsHtmltext { get; set; } + + public DateTime GatewayLastModified { get; set; } + + [Column("GatewayGUID")] + public Guid GatewayGuid { get; set; } + + public bool? GatewayEnabled { get; set; } + + [InverseProperty("SubscriptionGateway")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("Gateway")] + public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/NotificationSubscription.cs b/Migration.Tool.KX12/Models/NotificationSubscription.cs new file mode 100644 index 00000000..3f9816a8 --- /dev/null +++ b/Migration.Tool.KX12/Models/NotificationSubscription.cs @@ -0,0 +1,76 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Notification_Subscription")] +[Index("SubscriptionEventSource", "SubscriptionEventCode", "SubscriptionEventObjectId", Name = "IX_Notification_Subscription_SubscriptionEventSource_SubscriptionEventCode_SubscriptionEventObjectID")] +[Index("SubscriptionGatewayId", Name = "IX_Notification_Subscription_SubscriptionGatewayID")] +[Index("SubscriptionSiteId", Name = "IX_Notification_Subscription_SubscriptionSiteID")] +[Index("SubscriptionTemplateId", Name = "IX_Notification_Subscription_SubscriptionTemplateID")] +[Index("SubscriptionUserId", Name = "IX_Notification_Subscription_SubscriptionUserID")] +public class NotificationSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionGatewayID")] + public int SubscriptionGatewayId { get; set; } + + [Column("SubscriptionTemplateID")] + public int SubscriptionTemplateId { get; set; } + + [StringLength(100)] + public string? SubscriptionEventSource { get; set; } + + [StringLength(100)] + public string? SubscriptionEventCode { get; set; } + + [StringLength(250)] + public string SubscriptionEventDisplayName { get; set; } = null!; + + [Column("SubscriptionEventObjectID")] + public int? SubscriptionEventObjectId { get; set; } + + public DateTime SubscriptionTime { get; set; } + + [Column("SubscriptionUserID")] + public int SubscriptionUserId { get; set; } + + [StringLength(250)] + public string SubscriptionTarget { get; set; } = null!; + + public DateTime SubscriptionLastModified { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public string? SubscriptionEventData1 { get; set; } + + public string? SubscriptionEventData2 { get; set; } + + [Column("SubscriptionUseHTML")] + public bool? SubscriptionUseHtml { get; set; } + + [Column("SubscriptionSiteID")] + public int? SubscriptionSiteId { get; set; } + + [ForeignKey("SubscriptionGatewayId")] + [InverseProperty("NotificationSubscriptions")] + public virtual NotificationGateway SubscriptionGateway { get; set; } = null!; + + [ForeignKey("SubscriptionSiteId")] + [InverseProperty("NotificationSubscriptions")] + public virtual CmsSite? SubscriptionSite { get; set; } + + [ForeignKey("SubscriptionTemplateId")] + [InverseProperty("NotificationSubscriptions")] + public virtual NotificationTemplate SubscriptionTemplate { get; set; } = null!; + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("NotificationSubscriptions")] + public virtual CmsUser SubscriptionUser { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/NotificationTemplate.cs b/Migration.Tool.KX12/Models/NotificationTemplate.cs new file mode 100644 index 00000000..ef3b173c --- /dev/null +++ b/Migration.Tool.KX12/Models/NotificationTemplate.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Notification_Template")] +[Index("TemplateSiteId", Name = "IX_Notification_Template_TemplateSiteID")] +public class NotificationTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(200)] + public string TemplateName { get; set; } = null!; + + [StringLength(200)] + public string TemplateDisplayName { get; set; } = null!; + + [Column("TemplateSiteID")] + public int? TemplateSiteId { get; set; } + + public DateTime TemplateLastModified { get; set; } + + [Column("TemplateGUID")] + public Guid TemplateGuid { get; set; } + + [InverseProperty("SubscriptionTemplate")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("Template")] + public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); + + [ForeignKey("TemplateSiteId")] + [InverseProperty("NotificationTemplates")] + public virtual CmsSite? TemplateSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/NotificationTemplateText.cs b/Migration.Tool.KX12/Models/NotificationTemplateText.cs new file mode 100644 index 00000000..4cc209fc --- /dev/null +++ b/Migration.Tool.KX12/Models/NotificationTemplateText.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Notification_TemplateText")] +[Index("GatewayId", Name = "IX_Notification_TemplateText_GatewayID")] +[Index("TemplateId", Name = "IX_Notification_TemplateText_TemplateID")] +public class NotificationTemplateText +{ + [Key] + [Column("TemplateTextID")] + public int TemplateTextId { get; set; } + + [Column("TemplateID")] + public int TemplateId { get; set; } + + [Column("GatewayID")] + public int GatewayId { get; set; } + + [StringLength(250)] + public string TemplateSubject { get; set; } = null!; + + [Column("TemplateHTMLText")] + public string TemplateHtmltext { get; set; } = null!; + + public string TemplatePlainText { get; set; } = null!; + + [Column("TemplateTextGUID")] + public Guid TemplateTextGuid { get; set; } + + public DateTime TemplateTextLastModified { get; set; } + + [ForeignKey("GatewayId")] + [InverseProperty("NotificationTemplateTexts")] + public virtual NotificationGateway Gateway { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("NotificationTemplateTexts")] + public virtual NotificationTemplate Template { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/OmAbtest.cs b/Migration.Tool.KX12/Models/OmAbtest.cs new file mode 100644 index 00000000..46d081d7 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmAbtest.cs @@ -0,0 +1,71 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_ABTest")] +[Index("AbtestSiteId", Name = "IX_OM_ABTest_SiteID")] +public class OmAbtest +{ + [Key] + [Column("ABTestID")] + public int AbtestId { get; set; } + + [Column("ABTestName")] + [StringLength(50)] + public string AbtestName { get; set; } = null!; + + [Column("ABTestDescription")] + public string? AbtestDescription { get; set; } + + [Column("ABTestCulture")] + [StringLength(50)] + public string? AbtestCulture { get; set; } + + [Column("ABTestOriginalPage")] + [StringLength(450)] + public string AbtestOriginalPage { get; set; } = null!; + + [Column("ABTestOpenFrom")] + public DateTime? AbtestOpenFrom { get; set; } + + [Column("ABTestOpenTo")] + public DateTime? AbtestOpenTo { get; set; } + + [Column("ABTestSiteID")] + public int AbtestSiteId { get; set; } + + [Column("ABTestGUID")] + public Guid AbtestGuid { get; set; } + + [Column("ABTestLastModified")] + public DateTime AbtestLastModified { get; set; } + + [Column("ABTestDisplayName")] + [StringLength(100)] + public string AbtestDisplayName { get; set; } = null!; + + [Column("ABTestIncludedTraffic")] + public int AbtestIncludedTraffic { get; set; } + + [Column("ABTestVisitorTargeting")] + public string? AbtestVisitorTargeting { get; set; } + + [Column("ABTestConversions")] + public string? AbtestConversions { get; set; } + + [Column("ABTestWinnerGUID")] + public Guid? AbtestWinnerGuid { get; set; } + + [ForeignKey("AbtestSiteId")] + [InverseProperty("OmAbtests")] + public virtual CmsSite AbtestSite { get; set; } = null!; + + [InverseProperty("AbvariantTest")] + public virtual ICollection OmAbvariantData { get; set; } = new List(); + + [InverseProperty("AbvariantTest")] + public virtual ICollection OmAbvariants { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/OmAbvariant.cs b/Migration.Tool.KX12/Models/OmAbvariant.cs new file mode 100644 index 00000000..de953de0 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmAbvariant.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_ABVariant")] +[Index("AbvariantSiteId", Name = "IX_OM_ABVariant_ABVariantSiteID")] +[Index("AbvariantTestId", Name = "IX_OM_ABVariant_ABVariantTestID")] +public class OmAbvariant +{ + [Key] + [Column("ABVariantID")] + public int AbvariantId { get; set; } + + [Column("ABVariantDisplayName")] + [StringLength(110)] + public string AbvariantDisplayName { get; set; } = null!; + + [Column("ABVariantName")] + [StringLength(50)] + public string AbvariantName { get; set; } = null!; + + [Column("ABVariantTestID")] + public int AbvariantTestId { get; set; } + + [Column("ABVariantPath")] + [StringLength(450)] + public string AbvariantPath { get; set; } = null!; + + [Column("ABVariantGUID")] + public Guid AbvariantGuid { get; set; } + + [Column("ABVariantLastModified")] + public DateTime AbvariantLastModified { get; set; } + + [Column("ABVariantSiteID")] + public int AbvariantSiteId { get; set; } + + [ForeignKey("AbvariantSiteId")] + [InverseProperty("OmAbvariants")] + public virtual CmsSite AbvariantSite { get; set; } = null!; + + [ForeignKey("AbvariantTestId")] + [InverseProperty("OmAbvariants")] + public virtual OmAbtest AbvariantTest { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/OmAbvariantDatum.cs b/Migration.Tool.KX12/Models/OmAbvariantDatum.cs new file mode 100644 index 00000000..c7d10730 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmAbvariantDatum.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_ABVariantData")] +[Index("AbvariantTestId", "AbvariantGuid", Name = "IX_OM_ABVariantData_ABVariantTestID_ABVariantGUID")] +public class OmAbvariantDatum +{ + [Key] + [Column("ABVariantID")] + public int AbvariantId { get; set; } + + [Column("ABVariantDisplayName")] + [StringLength(100)] + public string AbvariantDisplayName { get; set; } = null!; + + [Column("ABVariantGUID")] + public Guid AbvariantGuid { get; set; } + + [Column("ABVariantTestID")] + public int AbvariantTestId { get; set; } + + [Column("ABVariantIsOriginal")] + public bool AbvariantIsOriginal { get; set; } + + [ForeignKey("AbvariantTestId")] + [InverseProperty("OmAbvariantData")] + public virtual OmAbtest AbvariantTest { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/OmAccount.cs b/Migration.Tool.KX12/Models/OmAccount.cs new file mode 100644 index 00000000..dc654f3f --- /dev/null +++ b/Migration.Tool.KX12/Models/OmAccount.cs @@ -0,0 +1,113 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_Account")] +[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] +[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] +[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] +[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] +[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] +[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] +[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] +public class OmAccount +{ + [Key] + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [ForeignKey("AccountCountryId")] + [InverseProperty("OmAccounts")] + public virtual CmsCountry? AccountCountry { get; set; } + + [ForeignKey("AccountOwnerUserId")] + [InverseProperty("OmAccounts")] + public virtual CmsUser? AccountOwnerUser { get; set; } + + [ForeignKey("AccountPrimaryContactId")] + [InverseProperty("OmAccountAccountPrimaryContacts")] + public virtual OmContact? AccountPrimaryContact { get; set; } + + [ForeignKey("AccountSecondaryContactId")] + [InverseProperty("OmAccountAccountSecondaryContacts")] + public virtual OmContact? AccountSecondaryContact { get; set; } + + [ForeignKey("AccountStateId")] + [InverseProperty("OmAccounts")] + public virtual CmsState? AccountState { get; set; } + + [ForeignKey("AccountStatusId")] + [InverseProperty("OmAccounts")] + public virtual OmAccountStatus? AccountStatus { get; set; } + + [ForeignKey("AccountSubsidiaryOfId")] + [InverseProperty("InverseAccountSubsidiaryOf")] + public virtual OmAccount? AccountSubsidiaryOf { get; set; } + + [InverseProperty("AccountSubsidiaryOf")] + public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); + + [InverseProperty("Account")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/OmAccountContact.cs b/Migration.Tool.KX12/Models/OmAccountContact.cs new file mode 100644 index 00000000..4f2c82cf --- /dev/null +++ b/Migration.Tool.KX12/Models/OmAccountContact.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_AccountContact")] +[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] +[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] +[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] +public class OmAccountContact +{ + [Key] + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("AccountId")] + [InverseProperty("OmAccountContacts")] + public virtual OmAccount Account { get; set; } = null!; + + [ForeignKey("ContactId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("ContactRoleId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContactRole? ContactRole { get; set; } +} diff --git a/Migration.Tool.KX12/Models/OmAccountStatus.cs b/Migration.Tool.KX12/Models/OmAccountStatus.cs new file mode 100644 index 00000000..6d453a18 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmAccountStatus.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_AccountStatus")] +public class OmAccountStatus +{ + [Key] + [Column("AccountStatusID")] + public int AccountStatusId { get; set; } + + [StringLength(200)] + public string AccountStatusName { get; set; } = null!; + + [StringLength(200)] + public string AccountStatusDisplayName { get; set; } = null!; + + public string? AccountStatusDescription { get; set; } + + [InverseProperty("AccountStatus")] + public virtual ICollection OmAccounts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/OmActivity.cs b/Migration.Tool.KX12/Models/OmActivity.cs new file mode 100644 index 00000000..f746c8e8 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmActivity.cs @@ -0,0 +1,78 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_Activity")] +[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] +[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] +[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] +[Index("ActivitySiteId", Name = "IX_OM_Activity_ActivitySiteID")] +[Index("ActivityType", "ActivityItemId", "ActivityNodeId", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityNodeID_ActivityUTMSource_ActivityUTMContent_ActivityCampaign")] +public class OmActivity +{ + [Key] + [Column("ActivityID")] + public int ActivityId { get; set; } + + [Column("ActivityContactID")] + public int ActivityContactId { get; set; } + + public DateTime? ActivityCreated { get; set; } + + [StringLength(250)] + public string ActivityType { get; set; } = null!; + + [Column("ActivityItemID")] + public int? ActivityItemId { get; set; } + + [Column("ActivityItemDetailID")] + public int? ActivityItemDetailId { get; set; } + + [StringLength(250)] + public string? ActivityValue { get; set; } + + [Column("ActivityURL")] + public string? ActivityUrl { get; set; } + + [StringLength(250)] + public string? ActivityTitle { get; set; } + + [Column("ActivitySiteID")] + public int ActivitySiteId { get; set; } + + public string? ActivityComment { get; set; } + + [StringLength(200)] + public string? ActivityCampaign { get; set; } + + [Column("ActivityURLReferrer")] + public string? ActivityUrlreferrer { get; set; } + + [StringLength(10)] + public string? ActivityCulture { get; set; } + + [Column("ActivityNodeID")] + public int? ActivityNodeId { get; set; } + + [Column("ActivityUTMSource")] + [StringLength(200)] + public string? ActivityUtmsource { get; set; } + + [Column("ActivityABVariantName")] + [StringLength(200)] + public string? ActivityAbvariantName { get; set; } + + [Column("ActivityMVTCombinationName")] + [StringLength(200)] + public string? ActivityMvtcombinationName { get; set; } + + [Column("ActivityURLHash")] + public long ActivityUrlhash { get; set; } + + [Column("ActivityUTMContent")] + [StringLength(200)] + public string? ActivityUtmcontent { get; set; } +} diff --git a/Migration.Tool.KX12/Models/OmActivityRecalculationQueue.cs b/Migration.Tool.KX12/Models/OmActivityRecalculationQueue.cs new file mode 100644 index 00000000..def1e76f --- /dev/null +++ b/Migration.Tool.KX12/Models/OmActivityRecalculationQueue.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_ActivityRecalculationQueue")] +public class OmActivityRecalculationQueue +{ + [Key] + [Column("ActivityRecalculationQueueID")] + public int ActivityRecalculationQueueId { get; set; } + + [Column("ActivityRecalculationQueueActivityID")] + public int ActivityRecalculationQueueActivityId { get; set; } +} diff --git a/Migration.Tool.KX12/Models/OmActivityType.cs b/Migration.Tool.KX12/Models/OmActivityType.cs new file mode 100644 index 00000000..4aac98d5 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmActivityType.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_ActivityType")] +public class OmActivityType +{ + [Key] + [Column("ActivityTypeID")] + public int ActivityTypeId { get; set; } + + [StringLength(250)] + public string ActivityTypeDisplayName { get; set; } = null!; + + [StringLength(250)] + public string ActivityTypeName { get; set; } = null!; + + public bool? ActivityTypeEnabled { get; set; } + + public bool? ActivityTypeIsCustom { get; set; } + + public string? ActivityTypeDescription { get; set; } + + public bool? ActivityTypeManualCreationAllowed { get; set; } + + [StringLength(200)] + public string? ActivityTypeMainFormControl { get; set; } + + [StringLength(200)] + public string? ActivityTypeDetailFormControl { get; set; } + + public bool ActivityTypeIsHiddenInContentOnly { get; set; } + + [StringLength(7)] + public string? ActivityTypeColor { get; set; } +} diff --git a/Migration.Tool.KX12/Models/OmContact.cs b/Migration.Tool.KX12/Models/OmContact.cs new file mode 100644 index 00000000..e159041b --- /dev/null +++ b/Migration.Tool.KX12/Models/OmContact.cs @@ -0,0 +1,140 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_Contact")] +[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] +[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] +[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] +[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] +[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] +[Index("ContactPersonaId", "ContactLastName", Name = "IX_OM_Contact_ContactPersonaID_ContactLastName")] +[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] +[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] +public class OmContact +{ + [Key] + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(50)] + public string? ContactJobTitle { get; set; } + + [StringLength(100)] + public string? ContactAddress1 { get; set; } + + [StringLength(100)] + public string? ContactCity { get; set; } + + [Column("ContactZIP")] + [StringLength(100)] + public string? ContactZip { get; set; } + + [Column("ContactStateID")] + public int? ContactStateId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [StringLength(26)] + public string? ContactMobilePhone { get; set; } + + [StringLength(26)] + public string? ContactBusinessPhone { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + public DateTime? ContactBirthday { get; set; } + + public int? ContactGender { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + public string? ContactNotes { get; set; } + + [Column("ContactOwnerUserID")] + public int? ContactOwnerUserId { get; set; } + + public bool? ContactMonitored { get; set; } + + [Column("ContactGUID")] + public Guid ContactGuid { get; set; } + + public DateTime ContactLastModified { get; set; } + + public DateTime ContactCreated { get; set; } + + public int? ContactBounces { get; set; } + + [StringLength(200)] + public string? ContactCampaign { get; set; } + + [Column("ContactSalesForceLeadID")] + [StringLength(18)] + public string? ContactSalesForceLeadId { get; set; } + + public bool? ContactSalesForceLeadReplicationDisabled { get; set; } + + public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } + + public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } + + [StringLength(100)] + public string? ContactCompanyName { get; set; } + + public bool? ContactSalesForceLeadReplicationRequired { get; set; } + + [Column("ContactPersonaID")] + public int? ContactPersonaId { get; set; } + + [InverseProperty("ConsentAgreementContact")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [ForeignKey("ContactCountryId")] + [InverseProperty("OmContacts")] + public virtual CmsCountry? ContactCountry { get; set; } + + [ForeignKey("ContactOwnerUserId")] + [InverseProperty("OmContacts")] + public virtual CmsUser? ContactOwnerUser { get; set; } + + [ForeignKey("ContactStateId")] + [InverseProperty("OmContacts")] + public virtual CmsState? ContactState { get; set; } + + [ForeignKey("ContactStatusId")] + [InverseProperty("OmContacts")] + public virtual OmContactStatus? ContactStatus { get; set; } + + [InverseProperty("AccountPrimaryContact")] + public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); + + [InverseProperty("AccountSecondaryContact")] + public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmMemberships { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [InverseProperty("VisitorToContactContact")] + public virtual ICollection OmVisitorToContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/OmContactChangeRecalculationQueue.cs b/Migration.Tool.KX12/Models/OmContactChangeRecalculationQueue.cs new file mode 100644 index 00000000..b7ea9a81 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmContactChangeRecalculationQueue.cs @@ -0,0 +1,21 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_ContactChangeRecalculationQueue")] +public class OmContactChangeRecalculationQueue +{ + [Key] + [Column("ContactChangeRecalculationQueueID")] + public int ContactChangeRecalculationQueueId { get; set; } + + [Column("ContactChangeRecalculationQueueContactID")] + public int ContactChangeRecalculationQueueContactId { get; set; } + + public string? ContactChangeRecalculationQueueChangedColumns { get; set; } + + public bool ContactChangeRecalculationQueueContactIsNew { get; set; } + + public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } +} diff --git a/Migration.Tool.KX12/Models/OmContactGroup.cs b/Migration.Tool.KX12/Models/OmContactGroup.cs new file mode 100644 index 00000000..3c07655f --- /dev/null +++ b/Migration.Tool.KX12/Models/OmContactGroup.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_ContactGroup")] +public class OmContactGroup +{ + [Key] + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [StringLength(200)] + public string ContactGroupName { get; set; } = null!; + + [StringLength(200)] + public string ContactGroupDisplayName { get; set; } = null!; + + public string? ContactGroupDescription { get; set; } + + public string? ContactGroupDynamicCondition { get; set; } + + public bool? ContactGroupEnabled { get; set; } + + public DateTime? ContactGroupLastModified { get; set; } + + [Column("ContactGroupGUID")] + public Guid? ContactGroupGuid { get; set; } + + public int? ContactGroupStatus { get; set; } + + [InverseProperty("ContactGroup")] + public virtual ICollection NewsletterIssueContactGroups { get; set; } = new List(); + + [InverseProperty("ContactGroupMemberContactGroup")] + public virtual ICollection OmContactGroupMembers { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/OmContactGroupMember.cs b/Migration.Tool.KX12/Models/OmContactGroupMember.cs new file mode 100644 index 00000000..af9fbc41 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmContactGroupMember.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_ContactGroupMember")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] +[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] +public class OmContactGroupMember +{ + [Key] + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + public int ContactGroupMemberType { get; set; } + + [Column("ContactGroupMemberRelatedID")] + public int ContactGroupMemberRelatedId { get; set; } + + public bool? ContactGroupMemberFromCondition { get; set; } + + public bool? ContactGroupMemberFromAccount { get; set; } + + public bool? ContactGroupMemberFromManual { get; set; } + + [ForeignKey("ContactGroupMemberContactGroupId")] + [InverseProperty("OmContactGroupMembers")] + public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/OmContactRole.cs b/Migration.Tool.KX12/Models/OmContactRole.cs new file mode 100644 index 00000000..9c93578f --- /dev/null +++ b/Migration.Tool.KX12/Models/OmContactRole.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_ContactRole")] +public class OmContactRole +{ + [Key] + [Column("ContactRoleID")] + public int ContactRoleId { get; set; } + + [StringLength(200)] + public string ContactRoleName { get; set; } = null!; + + [StringLength(200)] + public string ContactRoleDisplayName { get; set; } = null!; + + public string? ContactRoleDescription { get; set; } + + [InverseProperty("ContactRole")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/OmContactStatus.cs b/Migration.Tool.KX12/Models/OmContactStatus.cs new file mode 100644 index 00000000..119d28e0 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmContactStatus.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_ContactStatus")] +public class OmContactStatus +{ + [Key] + [Column("ContactStatusID")] + public int ContactStatusId { get; set; } + + [StringLength(200)] + public string ContactStatusName { get; set; } = null!; + + [StringLength(200)] + public string ContactStatusDisplayName { get; set; } = null!; + + public string? ContactStatusDescription { get; set; } + + [InverseProperty("ContactStatus")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/OmMembership.cs b/Migration.Tool.KX12/Models/OmMembership.cs new file mode 100644 index 00000000..9f30dee4 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmMembership.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_Membership")] +[Index("ContactId", Name = "IX_OM_Membership_ContactID")] +[Index("RelatedId", Name = "IX_OM_Membership_RelatedID")] +public class OmMembership +{ + [Key] + [Column("MembershipID")] + public int MembershipId { get; set; } + + [Column("RelatedID")] + public int RelatedId { get; set; } + + public int MemberType { get; set; } + + [Column("MembershipGUID")] + public Guid MembershipGuid { get; set; } + + public DateTime MembershipCreated { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("ContactId")] + [InverseProperty("OmMemberships")] + public virtual OmContact Contact { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/OmMvtcombination.cs b/Migration.Tool.KX12/Models/OmMvtcombination.cs new file mode 100644 index 00000000..4761707c --- /dev/null +++ b/Migration.Tool.KX12/Models/OmMvtcombination.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_MVTCombination")] +[Index("MvtcombinationPageTemplateId", Name = "IX_OM_MVTCombination_MVTCombinationPageTemplateID")] +public class OmMvtcombination +{ + [Key] + [Column("MVTCombinationID")] + public int MvtcombinationId { get; set; } + + [Column("MVTCombinationName")] + [StringLength(200)] + public string MvtcombinationName { get; set; } = null!; + + [Column("MVTCombinationCustomName")] + [StringLength(200)] + public string? MvtcombinationCustomName { get; set; } + + [Column("MVTCombinationPageTemplateID")] + public int MvtcombinationPageTemplateId { get; set; } + + [Column("MVTCombinationEnabled")] + public bool MvtcombinationEnabled { get; set; } + + [Column("MVTCombinationGUID")] + public Guid MvtcombinationGuid { get; set; } + + [Column("MVTCombinationLastModified")] + public DateTime MvtcombinationLastModified { get; set; } + + [Column("MVTCombinationIsDefault")] + public bool? MvtcombinationIsDefault { get; set; } + + [Column("MVTCombinationConversions")] + public int? MvtcombinationConversions { get; set; } + + [Column("MVTCombinationDocumentID")] + public int? MvtcombinationDocumentId { get; set; } + + [ForeignKey("MvtcombinationId")] + [InverseProperty("Mvtcombinations")] + public virtual ICollection Mvtvariants { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/OmMvtest.cs b/Migration.Tool.KX12/Models/OmMvtest.cs new file mode 100644 index 00000000..63638012 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmMvtest.cs @@ -0,0 +1,66 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_MVTest")] +[Index("MvtestSiteId", Name = "IX_OM_MVTest_MVTestSiteID")] +public class OmMvtest +{ + [Key] + [Column("MVTestID")] + public int MvtestId { get; set; } + + [Column("MVTestName")] + [StringLength(50)] + public string MvtestName { get; set; } = null!; + + [Column("MVTestDescription")] + public string? MvtestDescription { get; set; } + + [Column("MVTestPage")] + [StringLength(450)] + public string MvtestPage { get; set; } = null!; + + [Column("MVTestSiteID")] + public int MvtestSiteId { get; set; } + + [Column("MVTestCulture")] + [StringLength(50)] + public string? MvtestCulture { get; set; } + + [Column("MVTestOpenFrom")] + public DateTime? MvtestOpenFrom { get; set; } + + [Column("MVTestOpenTo")] + public DateTime? MvtestOpenTo { get; set; } + + [Column("MVTestMaxConversions")] + public int? MvtestMaxConversions { get; set; } + + [Column("MVTestConversions")] + public int? MvtestConversions { get; set; } + + [Column("MVTestTargetConversionType")] + [StringLength(100)] + public string? MvtestTargetConversionType { get; set; } + + [Column("MVTestGUID")] + public Guid MvtestGuid { get; set; } + + [Column("MVTestLastModified")] + public DateTime MvtestLastModified { get; set; } + + [Column("MVTestEnabled")] + public bool MvtestEnabled { get; set; } + + [Column("MVTestDisplayName")] + [StringLength(100)] + public string MvtestDisplayName { get; set; } = null!; + + [ForeignKey("MvtestSiteId")] + [InverseProperty("OmMvtests")] + public virtual CmsSite MvtestSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/OmMvtvariant.cs b/Migration.Tool.KX12/Models/OmMvtvariant.cs new file mode 100644 index 00000000..039a4858 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmMvtvariant.cs @@ -0,0 +1,60 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_MVTVariant")] +[Index("MvtvariantPageTemplateId", Name = "IX_OM_MVTVariant_MVTVariantPageTemplateID")] +public class OmMvtvariant +{ + [Key] + [Column("MVTVariantID")] + public int MvtvariantId { get; set; } + + [Column("MVTVariantName")] + [StringLength(100)] + public string MvtvariantName { get; set; } = null!; + + [Column("MVTVariantDisplayName")] + [StringLength(200)] + public string MvtvariantDisplayName { get; set; } = null!; + + [Column("MVTVariantInstanceGUID")] + public Guid? MvtvariantInstanceGuid { get; set; } + + [Column("MVTVariantZoneID")] + [StringLength(200)] + public string? MvtvariantZoneId { get; set; } + + [Column("MVTVariantPageTemplateID")] + public int MvtvariantPageTemplateId { get; set; } + + [Required] + [Column("MVTVariantEnabled")] + public bool? MvtvariantEnabled { get; set; } + + [Column("MVTVariantWebParts")] + public string? MvtvariantWebParts { get; set; } + + [Column("MVTVariantGUID")] + public Guid MvtvariantGuid { get; set; } + + [Column("MVTVariantLastModified")] + public DateTime MvtvariantLastModified { get; set; } + + [Column("MVTVariantDescription")] + public string? MvtvariantDescription { get; set; } + + [Column("MVTVariantDocumentID")] + public int? MvtvariantDocumentId { get; set; } + + [ForeignKey("MvtvariantPageTemplateId")] + [InverseProperty("OmMvtvariants")] + public virtual CmsPageTemplate MvtvariantPageTemplate { get; set; } = null!; + + [ForeignKey("MvtvariantId")] + [InverseProperty("Mvtvariants")] + public virtual ICollection Mvtcombinations { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/OmPersonalizationVariant.cs b/Migration.Tool.KX12/Models/OmPersonalizationVariant.cs new file mode 100644 index 00000000..47cd06a6 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmPersonalizationVariant.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_PersonalizationVariant")] +[Index("VariantPageTemplateId", Name = "IX_OM_PersonalizationVariant_VariantDocumentID")] +[Index("VariantDocumentId", Name = "IX_OM_PersonalizationVariant_VariantPageTemplateID")] +public class OmPersonalizationVariant +{ + [Key] + [Column("VariantID")] + public int VariantId { get; set; } + + [Required] + public bool? VariantEnabled { get; set; } + + [StringLength(200)] + public string VariantName { get; set; } = null!; + + [StringLength(200)] + public string VariantDisplayName { get; set; } = null!; + + [Column("VariantInstanceGUID")] + public Guid? VariantInstanceGuid { get; set; } + + [Column("VariantZoneID")] + [StringLength(200)] + public string? VariantZoneId { get; set; } + + [Column("VariantPageTemplateID")] + public int VariantPageTemplateId { get; set; } + + public string VariantWebParts { get; set; } = null!; + + public int? VariantPosition { get; set; } + + [Column("VariantGUID")] + public Guid VariantGuid { get; set; } + + public DateTime VariantLastModified { get; set; } + + public string? VariantDescription { get; set; } + + [Column("VariantDocumentID")] + public int? VariantDocumentId { get; set; } + + public string VariantDisplayCondition { get; set; } = null!; + + [ForeignKey("VariantDocumentId")] + [InverseProperty("OmPersonalizationVariants")] + public virtual CmsDocument? VariantDocument { get; set; } + + [ForeignKey("VariantPageTemplateId")] + [InverseProperty("OmPersonalizationVariants")] + public virtual CmsPageTemplate VariantPageTemplate { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/OmRule.cs b/Migration.Tool.KX12/Models/OmRule.cs new file mode 100644 index 00000000..d63ba530 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmRule.cs @@ -0,0 +1,58 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_Rule")] +[Index("RuleScoreId", Name = "IX_OM_Rule_RuleScoreID")] +public class OmRule +{ + [Key] + [Column("RuleID")] + public int RuleId { get; set; } + + [Column("RuleScoreID")] + public int RuleScoreId { get; set; } + + [StringLength(200)] + public string RuleDisplayName { get; set; } = null!; + + [StringLength(200)] + public string RuleName { get; set; } = null!; + + public int RuleValue { get; set; } + + public bool? RuleIsRecurring { get; set; } + + public int? RuleMaxPoints { get; set; } + + public DateTime? RuleValidUntil { get; set; } + + [StringLength(50)] + public string? RuleValidity { get; set; } + + public int? RuleValidFor { get; set; } + + public int RuleType { get; set; } + + [StringLength(250)] + public string? RuleParameter { get; set; } + + public string RuleCondition { get; set; } = null!; + + public DateTime RuleLastModified { get; set; } + + [Column("RuleGUID")] + public Guid RuleGuid { get; set; } + + public bool RuleBelongsToPersona { get; set; } + + [InverseProperty("Rule")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [ForeignKey("RuleScoreId")] + [InverseProperty("OmRules")] + public virtual OmScore RuleScore { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/OmScore.cs b/Migration.Tool.KX12/Models/OmScore.cs new file mode 100644 index 00000000..c794a655 --- /dev/null +++ b/Migration.Tool.KX12/Models/OmScore.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_Score")] +public class OmScore +{ + [Key] + [Column("ScoreID")] + public int ScoreId { get; set; } + + [StringLength(200)] + public string ScoreName { get; set; } = null!; + + [StringLength(200)] + public string ScoreDisplayName { get; set; } = null!; + + public string? ScoreDescription { get; set; } + + public bool ScoreEnabled { get; set; } + + public int? ScoreEmailAtScore { get; set; } + + [StringLength(998)] + public string? ScoreNotificationEmail { get; set; } + + public DateTime ScoreLastModified { get; set; } + + [Column("ScoreGUID")] + public Guid ScoreGuid { get; set; } + + public int? ScoreStatus { get; set; } + + [Column("ScoreScheduledTaskID")] + public int? ScoreScheduledTaskId { get; set; } + + public bool ScoreBelongsToPersona { get; set; } + + [InverseProperty("RuleScore")] + public virtual ICollection OmRules { get; set; } = new List(); + + [InverseProperty("Score")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/OmScoreContactRule.cs b/Migration.Tool.KX12/Models/OmScoreContactRule.cs new file mode 100644 index 00000000..0ba96fda --- /dev/null +++ b/Migration.Tool.KX12/Models/OmScoreContactRule.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_ScoreContactRule")] +[Index("ContactId", Name = "IX_OM_ScoreContactRule_ContactID")] +[Index("RuleId", Name = "IX_OM_ScoreContactRule_RuleID")] +[Index("ScoreId", Name = "IX_OM_ScoreContactRule_ScoreID_ContactID_Value_Expiration")] +[Index("ScoreId", "ContactId", "RuleId", Name = "UQ_OM_ScoreContactRule", IsUnique = true)] +public class OmScoreContactRule +{ + [Column("ScoreID")] + public int ScoreId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("RuleID")] + public int RuleId { get; set; } + + public int Value { get; set; } + + public DateTime? Expiration { get; set; } + + [Key] + [Column("ScoreContactRuleID")] + public int ScoreContactRuleId { get; set; } + + [ForeignKey("ContactId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("RuleId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmRule Rule { get; set; } = null!; + + [ForeignKey("ScoreId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmScore Score { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/OmVisitorToContact.cs b/Migration.Tool.KX12/Models/OmVisitorToContact.cs new file mode 100644 index 00000000..0a506f8c --- /dev/null +++ b/Migration.Tool.KX12/Models/OmVisitorToContact.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("OM_VisitorToContact")] +[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] +[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] +public class OmVisitorToContact +{ + [Key] + [Column("VisitorToContactID")] + public int VisitorToContactId { get; set; } + + [Column("VisitorToContactVisitorGUID")] + public Guid VisitorToContactVisitorGuid { get; set; } + + [Column("VisitorToContactContactID")] + public int VisitorToContactContactId { get; set; } + + [ForeignKey("VisitorToContactContactId")] + [InverseProperty("OmVisitorToContacts")] + public virtual OmContact VisitorToContactContact { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/PersonasPersona.cs b/Migration.Tool.KX12/Models/PersonasPersona.cs new file mode 100644 index 00000000..f9db8ea1 --- /dev/null +++ b/Migration.Tool.KX12/Models/PersonasPersona.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Personas_Persona")] +[Index("PersonaScoreId", Name = "IX_Personas_Persona_PersonaScoreID")] +public class PersonasPersona +{ + [Key] + [Column("PersonaID")] + public int PersonaId { get; set; } + + [StringLength(200)] + public string PersonaDisplayName { get; set; } = null!; + + [StringLength(200)] + public string PersonaName { get; set; } = null!; + + public string? PersonaDescription { get; set; } + + [Required] + public bool? PersonaEnabled { get; set; } + + [Column("PersonaGUID")] + public Guid PersonaGuid { get; set; } + + [Column("PersonaScoreID")] + public int PersonaScoreId { get; set; } + + [Column("PersonaPictureMetafileGUID")] + public Guid? PersonaPictureMetafileGuid { get; set; } + + public int PersonaPointsThreshold { get; set; } + + [InverseProperty("PersonaContactHistoryPersona")] + public virtual ICollection PersonasPersonaContactHistories { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/PersonasPersonaContactHistory.cs b/Migration.Tool.KX12/Models/PersonasPersonaContactHistory.cs new file mode 100644 index 00000000..cfb58c2e --- /dev/null +++ b/Migration.Tool.KX12/Models/PersonasPersonaContactHistory.cs @@ -0,0 +1,27 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Personas_PersonaContactHistory")] +[Index("PersonaContactHistoryPersonaId", Name = "IX_Personas_PersonaContactHistoryPersonaID")] +public class PersonasPersonaContactHistory +{ + [Key] + [Column("PersonaContactHistoryID")] + public int PersonaContactHistoryId { get; set; } + + [Column("PersonaContactHistoryPersonaID")] + public int? PersonaContactHistoryPersonaId { get; set; } + + [Column(TypeName = "date")] + public DateTime PersonaContactHistoryDate { get; set; } + + public int PersonaContactHistoryContacts { get; set; } + + [ForeignKey("PersonaContactHistoryPersonaId")] + [InverseProperty("PersonasPersonaContactHistories")] + public virtual PersonasPersona? PersonaContactHistoryPersona { get; set; } +} diff --git a/Migration.Tool.KX12/Models/PersonasPersonaNode.cs b/Migration.Tool.KX12/Models/PersonasPersonaNode.cs new file mode 100644 index 00000000..f8340645 --- /dev/null +++ b/Migration.Tool.KX12/Models/PersonasPersonaNode.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[PrimaryKey("PersonaId", "NodeId")] +[Table("Personas_PersonaNode")] +[Index("NodeId", Name = "IX_Personas_PersonaNode_NodeID")] +[Index("PersonaId", Name = "IX_Personas_PersonaNode_PersonaID")] +public class PersonasPersonaNode +{ + [Key] + [Column("PersonaID")] + public int PersonaId { get; set; } + + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + [ForeignKey("NodeId")] + [InverseProperty("PersonasPersonaNodes")] + public virtual CmsTree Node { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/PollsPoll.cs b/Migration.Tool.KX12/Models/PollsPoll.cs new file mode 100644 index 00000000..385ce703 --- /dev/null +++ b/Migration.Tool.KX12/Models/PollsPoll.cs @@ -0,0 +1,71 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Polls_Poll")] +[Index("PollGroupId", Name = "IX_Polls_Poll_PollGroupID")] +[Index("PollSiteId", "PollCodeName", Name = "IX_Polls_Poll_PollSiteID_PollCodeName")] +public class PollsPoll +{ + [Key] + [Column("PollID")] + public int PollId { get; set; } + + [StringLength(200)] + public string PollCodeName { get; set; } = null!; + + [StringLength(200)] + public string PollDisplayName { get; set; } = null!; + + [StringLength(100)] + public string? PollTitle { get; set; } + + public DateTime? PollOpenFrom { get; set; } + + public DateTime? PollOpenTo { get; set; } + + public bool PollAllowMultipleAnswers { get; set; } + + [StringLength(450)] + public string PollQuestion { get; set; } = null!; + + public int PollAccess { get; set; } + + [StringLength(450)] + public string? PollResponseMessage { get; set; } + + [Column("PollGUID")] + public Guid PollGuid { get; set; } + + public DateTime PollLastModified { get; set; } + + [Column("PollGroupID")] + public int? PollGroupId { get; set; } + + [Column("PollSiteID")] + public int? PollSiteId { get; set; } + + public bool? PollLogActivity { get; set; } + + [ForeignKey("PollGroupId")] + [InverseProperty("PollsPolls")] + public virtual CommunityGroup? PollGroup { get; set; } + + [ForeignKey("PollSiteId")] + [InverseProperty("PollsPolls")] + public virtual CmsSite? PollSite { get; set; } + + [InverseProperty("AnswerPoll")] + public virtual ICollection PollsPollAnswers { get; set; } = new List(); + + [ForeignKey("PollId")] + [InverseProperty("Polls")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("PollId")] + [InverseProperty("Polls")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/PollsPollAnswer.cs b/Migration.Tool.KX12/Models/PollsPollAnswer.cs new file mode 100644 index 00000000..baf6f8b8 --- /dev/null +++ b/Migration.Tool.KX12/Models/PollsPollAnswer.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Polls_PollAnswer")] +[Index("AnswerPollId", Name = "IX_Polls_PollAnswer_AnswerPollID")] +public class PollsPollAnswer +{ + [Key] + [Column("AnswerID")] + public int AnswerId { get; set; } + + [StringLength(200)] + public string AnswerText { get; set; } = null!; + + public int? AnswerOrder { get; set; } + + public int? AnswerCount { get; set; } + + public bool? AnswerEnabled { get; set; } + + [Column("AnswerPollID")] + public int AnswerPollId { get; set; } + + [Column("AnswerGUID")] + public Guid AnswerGuid { get; set; } + + public DateTime AnswerLastModified { get; set; } + + [StringLength(100)] + public string? AnswerForm { get; set; } + + [StringLength(100)] + public string? AnswerAlternativeForm { get; set; } + + public bool? AnswerHideForm { get; set; } + + [ForeignKey("AnswerPollId")] + [InverseProperty("PollsPollAnswers")] + public virtual PollsPoll AnswerPoll { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ReportingReport.cs b/Migration.Tool.KX12/Models/ReportingReport.cs new file mode 100644 index 00000000..583ceed3 --- /dev/null +++ b/Migration.Tool.KX12/Models/ReportingReport.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Reporting_Report")] +[Index("ReportCategoryId", Name = "IX_Reporting_Report_ReportCategoryID")] +[Index("ReportGuid", "ReportName", Name = "IX_Reporting_Report_ReportGUID_ReportName")] +[Index("ReportName", Name = "IX_Reporting_Report_ReportName", IsUnique = true)] +public class ReportingReport +{ + [Key] + [Column("ReportID")] + public int ReportId { get; set; } + + [StringLength(200)] + public string ReportName { get; set; } = null!; + + [StringLength(440)] + public string ReportDisplayName { get; set; } = null!; + + public string? ReportLayout { get; set; } + + public string? ReportParameters { get; set; } + + [Column("ReportCategoryID")] + public int ReportCategoryId { get; set; } + + public int ReportAccess { get; set; } + + [Column("ReportGUID")] + public Guid ReportGuid { get; set; } + + public DateTime ReportLastModified { get; set; } + + public bool? ReportEnableSubscription { get; set; } + + [StringLength(100)] + public string? ReportConnectionString { get; set; } + + [ForeignKey("ReportCategoryId")] + [InverseProperty("ReportingReports")] + public virtual ReportingReportCategory ReportCategory { get; set; } = null!; + + [InverseProperty("GraphReport")] + public virtual ICollection ReportingReportGraphs { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionReport")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("TableReport")] + public virtual ICollection ReportingReportTables { get; set; } = new List(); + + [InverseProperty("ValueReport")] + public virtual ICollection ReportingReportValues { get; set; } = new List(); + + [InverseProperty("SavedReportReport")] + public virtual ICollection ReportingSavedReports { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/ReportingReportCategory.cs b/Migration.Tool.KX12/Models/ReportingReportCategory.cs new file mode 100644 index 00000000..6465144a --- /dev/null +++ b/Migration.Tool.KX12/Models/ReportingReportCategory.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Reporting_ReportCategory")] +[Index("CategoryParentId", Name = "IX_Reporting_ReportCategory_CategoryParentID")] +public class ReportingReportCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryCodeName { get; set; } = null!; + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public string CategoryPath { get; set; } = null!; + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryReportChildCount { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual ReportingReportCategory? CategoryParent { get; set; } + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); + + [InverseProperty("ReportCategory")] + public virtual ICollection ReportingReports { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/ReportingReportGraph.cs b/Migration.Tool.KX12/Models/ReportingReportGraph.cs new file mode 100644 index 00000000..cf0b9332 --- /dev/null +++ b/Migration.Tool.KX12/Models/ReportingReportGraph.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Reporting_ReportGraph")] +[Index("GraphGuid", Name = "IX_Reporting_ReportGraph_GraphGUID", IsUnique = true)] +[Index("GraphReportId", "GraphName", Name = "IX_Reporting_ReportGraph_GraphReportID_GraphName", IsUnique = true)] +public class ReportingReportGraph +{ + [Key] + [Column("GraphID")] + public int GraphId { get; set; } + + [StringLength(100)] + public string GraphName { get; set; } = null!; + + [StringLength(450)] + public string GraphDisplayName { get; set; } = null!; + + public string GraphQuery { get; set; } = null!; + + public bool GraphQueryIsStoredProcedure { get; set; } + + [StringLength(50)] + public string GraphType { get; set; } = null!; + + [Column("GraphReportID")] + public int GraphReportId { get; set; } + + [StringLength(200)] + public string? GraphTitle { get; set; } + + [Column("GraphXAxisTitle")] + [StringLength(200)] + public string? GraphXaxisTitle { get; set; } + + [Column("GraphYAxisTitle")] + [StringLength(200)] + public string? GraphYaxisTitle { get; set; } + + public int? GraphWidth { get; set; } + + public int? GraphHeight { get; set; } + + public int? GraphLegendPosition { get; set; } + + public string? GraphSettings { get; set; } + + [Column("GraphGUID")] + public Guid GraphGuid { get; set; } + + public DateTime GraphLastModified { get; set; } + + public bool? GraphIsHtml { get; set; } + + [StringLength(100)] + public string? GraphConnectionString { get; set; } + + [ForeignKey("GraphReportId")] + [InverseProperty("ReportingReportGraphs")] + public virtual ReportingReport GraphReport { get; set; } = null!; + + [InverseProperty("ReportSubscriptionGraph")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/ReportingReportSubscription.cs b/Migration.Tool.KX12/Models/ReportingReportSubscription.cs new file mode 100644 index 00000000..7d0768e4 --- /dev/null +++ b/Migration.Tool.KX12/Models/ReportingReportSubscription.cs @@ -0,0 +1,92 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Reporting_ReportSubscription")] +[Index("ReportSubscriptionGraphId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionGraphID")] +[Index("ReportSubscriptionReportId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionReportID")] +[Index("ReportSubscriptionSiteId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionSiteID")] +[Index("ReportSubscriptionTableId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionTableID")] +[Index("ReportSubscriptionUserId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionUserID")] +[Index("ReportSubscriptionValueId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionValueID")] +public class ReportingReportSubscription +{ + [Key] + [Column("ReportSubscriptionID")] + public int ReportSubscriptionId { get; set; } + + [Column("ReportSubscriptionReportID")] + public int ReportSubscriptionReportId { get; set; } + + [StringLength(1000)] + public string ReportSubscriptionInterval { get; set; } = null!; + + public string? ReportSubscriptionCondition { get; set; } + + [Required] + public bool? ReportSubscriptionEnabled { get; set; } + + public string? ReportSubscriptionParameters { get; set; } + + [Column("ReportSubscriptionGUID")] + public Guid ReportSubscriptionGuid { get; set; } + + public DateTime ReportSubscriptionLastModified { get; set; } + + [StringLength(200)] + public string? ReportSubscriptionSubject { get; set; } + + [Column("ReportSubscriptionGraphID")] + public int? ReportSubscriptionGraphId { get; set; } + + [Column("ReportSubscriptionTableID")] + public int? ReportSubscriptionTableId { get; set; } + + [Column("ReportSubscriptionValueID")] + public int? ReportSubscriptionValueId { get; set; } + + [Column("ReportSubscriptionUserID")] + public int ReportSubscriptionUserId { get; set; } + + [StringLength(400)] + public string ReportSubscriptionEmail { get; set; } = null!; + + [Required] + public bool? ReportSubscriptionOnlyNonEmpty { get; set; } + + public DateTime? ReportSubscriptionLastPostDate { get; set; } + + public DateTime? ReportSubscriptionNextPostDate { get; set; } + + [Column("ReportSubscriptionSiteID")] + public int ReportSubscriptionSiteId { get; set; } + + public string? ReportSubscriptionSettings { get; set; } + + [ForeignKey("ReportSubscriptionGraphId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportGraph? ReportSubscriptionGraph { get; set; } + + [ForeignKey("ReportSubscriptionReportId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReport ReportSubscriptionReport { get; set; } = null!; + + [ForeignKey("ReportSubscriptionSiteId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual CmsSite ReportSubscriptionSite { get; set; } = null!; + + [ForeignKey("ReportSubscriptionTableId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportTable? ReportSubscriptionTable { get; set; } + + [ForeignKey("ReportSubscriptionUserId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual CmsUser ReportSubscriptionUser { get; set; } = null!; + + [ForeignKey("ReportSubscriptionValueId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportValue? ReportSubscriptionValue { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ReportingReportTable.cs b/Migration.Tool.KX12/Models/ReportingReportTable.cs new file mode 100644 index 00000000..ce40a0ae --- /dev/null +++ b/Migration.Tool.KX12/Models/ReportingReportTable.cs @@ -0,0 +1,46 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Reporting_ReportTable")] +[Index("TableReportId", Name = "IX_Reporting_ReportTable_TableReportID")] +[Index("TableName", "TableReportId", Name = "IX_Reporting_ReportTable_TableReportID_TableName", IsUnique = true)] +public class ReportingReportTable +{ + [Key] + [Column("TableID")] + public int TableId { get; set; } + + [StringLength(100)] + public string TableName { get; set; } = null!; + + [StringLength(450)] + public string TableDisplayName { get; set; } = null!; + + public string TableQuery { get; set; } = null!; + + public bool TableQueryIsStoredProcedure { get; set; } + + [Column("TableReportID")] + public int TableReportId { get; set; } + + public string? TableSettings { get; set; } + + [Column("TableGUID")] + public Guid TableGuid { get; set; } + + public DateTime TableLastModified { get; set; } + + [StringLength(100)] + public string? TableConnectionString { get; set; } + + [InverseProperty("ReportSubscriptionTable")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [ForeignKey("TableReportId")] + [InverseProperty("ReportingReportTables")] + public virtual ReportingReport TableReport { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ReportingReportValue.cs b/Migration.Tool.KX12/Models/ReportingReportValue.cs new file mode 100644 index 00000000..96cc56ca --- /dev/null +++ b/Migration.Tool.KX12/Models/ReportingReportValue.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Reporting_ReportValue")] +[Index("ValueName", "ValueReportId", Name = "IX_Reporting_ReportValue_ValueName_ValueReportID")] +[Index("ValueReportId", Name = "IX_Reporting_ReportValue_ValueReportID")] +public class ReportingReportValue +{ + [Key] + [Column("ValueID")] + public int ValueId { get; set; } + + [StringLength(100)] + public string ValueName { get; set; } = null!; + + [StringLength(450)] + public string ValueDisplayName { get; set; } = null!; + + public string ValueQuery { get; set; } = null!; + + public bool ValueQueryIsStoredProcedure { get; set; } + + [StringLength(200)] + public string? ValueFormatString { get; set; } + + [Column("ValueReportID")] + public int ValueReportId { get; set; } + + [Column("ValueGUID")] + public Guid ValueGuid { get; set; } + + public DateTime ValueLastModified { get; set; } + + public string? ValueSettings { get; set; } + + [StringLength(100)] + public string? ValueConnectionString { get; set; } + + [InverseProperty("ReportSubscriptionValue")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [ForeignKey("ValueReportId")] + [InverseProperty("ReportingReportValues")] + public virtual ReportingReport ValueReport { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ReportingSavedGraph.cs b/Migration.Tool.KX12/Models/ReportingSavedGraph.cs new file mode 100644 index 00000000..26ccc4f6 --- /dev/null +++ b/Migration.Tool.KX12/Models/ReportingSavedGraph.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Reporting_SavedGraph")] +[Index("SavedGraphGuid", Name = "IX_Reporting_SavedGraph_SavedGraphGUID")] +[Index("SavedGraphSavedReportId", Name = "IX_Reporting_SavedGraph_SavedGraphSavedReportID")] +public class ReportingSavedGraph +{ + [Key] + [Column("SavedGraphID")] + public int SavedGraphId { get; set; } + + [Column("SavedGraphSavedReportID")] + public int SavedGraphSavedReportId { get; set; } + + [Column("SavedGraphGUID")] + public Guid SavedGraphGuid { get; set; } + + public byte[] SavedGraphBinary { get; set; } = null!; + + [StringLength(100)] + public string SavedGraphMimeType { get; set; } = null!; + + public DateTime SavedGraphLastModified { get; set; } + + [ForeignKey("SavedGraphSavedReportId")] + [InverseProperty("ReportingSavedGraphs")] + public virtual ReportingSavedReport SavedGraphSavedReport { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ReportingSavedReport.cs b/Migration.Tool.KX12/Models/ReportingSavedReport.cs new file mode 100644 index 00000000..8efe5a25 --- /dev/null +++ b/Migration.Tool.KX12/Models/ReportingSavedReport.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Reporting_SavedReport")] +[Index("SavedReportCreatedByUserId", Name = "IX_Reporting_SavedReport_SavedReportCreatedByUserID")] +public class ReportingSavedReport +{ + [Key] + [Column("SavedReportID")] + public int SavedReportId { get; set; } + + [Column("SavedReportReportID")] + public int SavedReportReportId { get; set; } + + [Column("SavedReportGUID")] + public Guid SavedReportGuid { get; set; } + + [StringLength(200)] + public string? SavedReportTitle { get; set; } + + public DateTime SavedReportDate { get; set; } + + [Column("SavedReportHTML")] + public string SavedReportHtml { get; set; } = null!; + + public string SavedReportParameters { get; set; } = null!; + + [Column("SavedReportCreatedByUserID")] + public int? SavedReportCreatedByUserId { get; set; } + + public DateTime SavedReportLastModified { get; set; } + + [InverseProperty("SavedGraphSavedReport")] + public virtual ICollection ReportingSavedGraphs { get; set; } = new List(); + + [ForeignKey("SavedReportCreatedByUserId")] + [InverseProperty("ReportingSavedReports")] + public virtual CmsUser? SavedReportCreatedByUser { get; set; } + + [ForeignKey("SavedReportReportId")] + [InverseProperty("ReportingSavedReports")] + public virtual ReportingReport SavedReportReport { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/SharePointSharePointConnection.cs b/Migration.Tool.KX12/Models/SharePointSharePointConnection.cs new file mode 100644 index 00000000..7f449ff3 --- /dev/null +++ b/Migration.Tool.KX12/Models/SharePointSharePointConnection.cs @@ -0,0 +1,54 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SharePoint_SharePointConnection")] +[Index("SharePointConnectionSiteId", Name = "IX_SharePoint_SharePointConnection_SharePointConnectionSiteID")] +public class SharePointSharePointConnection +{ + [Key] + [Column("SharePointConnectionID")] + public int SharePointConnectionId { get; set; } + + [Column("SharePointConnectionGUID")] + public Guid SharePointConnectionGuid { get; set; } + + [Column("SharePointConnectionSiteID")] + public int SharePointConnectionSiteId { get; set; } + + [StringLength(512)] + public string SharePointConnectionSiteUrl { get; set; } = null!; + + [StringLength(30)] + public string SharePointConnectionAuthMode { get; set; } = null!; + + [StringLength(100)] + public string SharePointConnectionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string SharePointConnectionName { get; set; } = null!; + + [StringLength(30)] + public string SharePointConnectionSharePointVersion { get; set; } = null!; + + [StringLength(100)] + public string? SharePointConnectionUserName { get; set; } + + [StringLength(100)] + public string? SharePointConnectionPassword { get; set; } + + [StringLength(100)] + public string? SharePointConnectionDomain { get; set; } + + public DateTime SharePointConnectionLastModified { get; set; } + + [ForeignKey("SharePointConnectionSiteId")] + [InverseProperty("SharePointSharePointConnections")] + public virtual CmsSite SharePointConnectionSite { get; set; } = null!; + + [InverseProperty("SharePointLibrarySharePointConnection")] + public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/SharePointSharePointFile.cs b/Migration.Tool.KX12/Models/SharePointSharePointFile.cs new file mode 100644 index 00000000..6849212b --- /dev/null +++ b/Migration.Tool.KX12/Models/SharePointSharePointFile.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SharePoint_SharePointFile")] +[Index("SharePointFileSiteId", Name = "IX_SharePoint_SharePointFile_SharePointFileSiteID")] +[Index("SharePointFileSharePointLibraryId", "SharePointFileServerRelativeUrl", Name = "UQ_SharePoint_SharePointFile_LibraryID_ServerRelativeURL", IsUnique = true)] +public class SharePointSharePointFile +{ + [Key] + [Column("SharePointFileID")] + public int SharePointFileId { get; set; } + + [Column("SharePointFileGUID")] + public Guid SharePointFileGuid { get; set; } + + [Column("SharePointFileSiteID")] + public int SharePointFileSiteId { get; set; } + + [StringLength(150)] + public string SharePointFileName { get; set; } = null!; + + [StringLength(150)] + public string? SharePointFileExtension { get; set; } + + [StringLength(255)] + public string? SharePointFileMimeType { get; set; } + + [Column("SharePointFileETag")] + [StringLength(255)] + public string? SharePointFileEtag { get; set; } + + public long SharePointFileSize { get; set; } + + public DateTime SharePointFileServerLastModified { get; set; } + + [Column("SharePointFileServerRelativeURL")] + [StringLength(300)] + public string SharePointFileServerRelativeUrl { get; set; } = null!; + + [Column("SharePointFileSharePointLibraryID")] + public int SharePointFileSharePointLibraryId { get; set; } + + public byte[]? SharePointFileBinary { get; set; } + + [ForeignKey("SharePointFileSharePointLibraryId")] + [InverseProperty("SharePointSharePointFiles")] + public virtual SharePointSharePointLibrary SharePointFileSharePointLibrary { get; set; } = null!; + + [ForeignKey("SharePointFileSiteId")] + [InverseProperty("SharePointSharePointFiles")] + public virtual CmsSite SharePointFileSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/SharePointSharePointLibrary.cs b/Migration.Tool.KX12/Models/SharePointSharePointLibrary.cs new file mode 100644 index 00000000..18fb5ffe --- /dev/null +++ b/Migration.Tool.KX12/Models/SharePointSharePointLibrary.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SharePoint_SharePointLibrary")] +[Index("SharePointLibrarySharePointConnectionId", Name = "IX_SharePoint_SharePointLibrary_SharePointLibrarySharepointConnectionID")] +[Index("SharePointLibrarySiteId", Name = "IX_SharePoint_SharePointLibrary_SharePointlibrarySiteID")] +public class SharePointSharePointLibrary +{ + [Key] + [Column("SharePointLibraryID")] + public int SharePointLibraryId { get; set; } + + [StringLength(100)] + public string SharePointLibraryName { get; set; } = null!; + + [Column("SharePointLibrarySharePointConnectionID")] + public int? SharePointLibrarySharePointConnectionId { get; set; } + + [StringLength(100)] + public string SharePointLibraryListTitle { get; set; } = null!; + + public int SharePointLibrarySynchronizationPeriod { get; set; } + + [Column("SharePointLibraryGUID")] + public Guid SharePointLibraryGuid { get; set; } + + [Column("SharePointLibrarySiteID")] + public int SharePointLibrarySiteId { get; set; } + + [StringLength(100)] + public string SharePointLibraryDisplayName { get; set; } = null!; + + public DateTime SharePointLibraryLastModified { get; set; } + + public int SharePointLibraryListType { get; set; } + + [ForeignKey("SharePointLibrarySharePointConnectionId")] + [InverseProperty("SharePointSharePointLibraries")] + public virtual SharePointSharePointConnection? SharePointLibrarySharePointConnection { get; set; } + + [ForeignKey("SharePointLibrarySiteId")] + [InverseProperty("SharePointSharePointLibraries")] + public virtual CmsSite SharePointLibrarySite { get; set; } = null!; + + [InverseProperty("SharePointFileSharePointLibrary")] + public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/SmFacebookAccount.cs b/Migration.Tool.KX12/Models/SmFacebookAccount.cs new file mode 100644 index 00000000..898e2c73 --- /dev/null +++ b/Migration.Tool.KX12/Models/SmFacebookAccount.cs @@ -0,0 +1,54 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_FacebookAccount")] +[Index("FacebookAccountFacebookApplicationId", Name = "IX_SM_FacebookAccount_FacebookAccountFacebookApplicationID")] +[Index("FacebookAccountSiteId", Name = "IX_SM_FacebookAccount_FacebookAccountSiteID")] +public class SmFacebookAccount +{ + [Key] + [Column("FacebookAccountID")] + public int FacebookAccountId { get; set; } + + [Column("FacebookAccountGUID")] + public Guid FacebookAccountGuid { get; set; } + + public DateTime FacebookAccountLastModified { get; set; } + + [Column("FacebookAccountSiteID")] + public int FacebookAccountSiteId { get; set; } + + [StringLength(200)] + public string FacebookAccountName { get; set; } = null!; + + [StringLength(200)] + public string FacebookAccountDisplayName { get; set; } = null!; + + [Column("FacebookAccountPageID")] + [StringLength(500)] + public string FacebookAccountPageId { get; set; } = null!; + + public string FacebookAccountPageAccessToken { get; set; } = null!; + + [Column("FacebookAccountFacebookApplicationID")] + public int FacebookAccountFacebookApplicationId { get; set; } + + public DateTime? FacebookAccountPageAccessTokenExpiration { get; set; } + + public bool? FacebookAccountIsDefault { get; set; } + + [ForeignKey("FacebookAccountFacebookApplicationId")] + [InverseProperty("SmFacebookAccounts")] + public virtual SmFacebookApplication FacebookAccountFacebookApplication { get; set; } = null!; + + [ForeignKey("FacebookAccountSiteId")] + [InverseProperty("SmFacebookAccounts")] + public virtual CmsSite FacebookAccountSite { get; set; } = null!; + + [InverseProperty("FacebookPostFacebookAccount")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/SmFacebookApplication.cs b/Migration.Tool.KX12/Models/SmFacebookApplication.cs new file mode 100644 index 00000000..acdd0f28 --- /dev/null +++ b/Migration.Tool.KX12/Models/SmFacebookApplication.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_FacebookApplication")] +[Index("FacebookApplicationSiteId", Name = "IX_SM_FacebookApplication_FacebookApplicationSiteID")] +public class SmFacebookApplication +{ + [Key] + [Column("FacebookApplicationID")] + public int FacebookApplicationId { get; set; } + + [StringLength(500)] + public string FacebookApplicationConsumerKey { get; set; } = null!; + + [StringLength(500)] + public string FacebookApplicationConsumerSecret { get; set; } = null!; + + [StringLength(200)] + public string FacebookApplicationName { get; set; } = null!; + + [StringLength(200)] + public string FacebookApplicationDisplayName { get; set; } = null!; + + [Column("FacebookApplicationGUID")] + public Guid FacebookApplicationGuid { get; set; } + + public DateTime FacebookApplicationLastModified { get; set; } + + [Column("FacebookApplicationSiteID")] + public int FacebookApplicationSiteId { get; set; } + + [ForeignKey("FacebookApplicationSiteId")] + [InverseProperty("SmFacebookApplications")] + public virtual CmsSite FacebookApplicationSite { get; set; } = null!; + + [InverseProperty("FacebookAccountFacebookApplication")] + public virtual ICollection SmFacebookAccounts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/SmFacebookPost.cs b/Migration.Tool.KX12/Models/SmFacebookPost.cs new file mode 100644 index 00000000..a04b16ed --- /dev/null +++ b/Migration.Tool.KX12/Models/SmFacebookPost.cs @@ -0,0 +1,88 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_FacebookPost")] +[Index("FacebookPostCampaignId", Name = "IX_SM_FacebookPost_FacebookPostCampaignID")] +[Index("FacebookPostFacebookAccountId", Name = "IX_SM_FacebookPost_FacebookPostFacebookAccountID")] +[Index("FacebookPostSiteId", Name = "IX_SM_FacebookPost_FacebookPostSiteID")] +public class SmFacebookPost +{ + [Key] + [Column("FacebookPostID")] + public int FacebookPostId { get; set; } + + [Column("FacebookPostGUID")] + public Guid FacebookPostGuid { get; set; } + + public DateTime FacebookPostLastModified { get; set; } + + [Column("FacebookPostSiteID")] + public int FacebookPostSiteId { get; set; } + + [Column("FacebookPostFacebookAccountID")] + public int FacebookPostFacebookAccountId { get; set; } + + public string FacebookPostText { get; set; } = null!; + + [Column("FacebookPostURLShortenerType")] + public int? FacebookPostUrlshortenerType { get; set; } + + public int? FacebookPostErrorCode { get; set; } + + public int? FacebookPostErrorSubcode { get; set; } + + [Column("FacebookPostExternalID")] + public string? FacebookPostExternalId { get; set; } + + public DateTime? FacebookPostPublishedDateTime { get; set; } + + public DateTime? FacebookPostScheduledPublishDateTime { get; set; } + + [Column("FacebookPostCampaignID")] + public int? FacebookPostCampaignId { get; set; } + + public bool? FacebookPostPostAfterDocumentPublish { get; set; } + + public int? FacebookPostInsightPeopleReached { get; set; } + + public int? FacebookPostInsightLikesFromPage { get; set; } + + public int? FacebookPostInsightCommentsFromPage { get; set; } + + public int? FacebookPostInsightSharesFromPage { get; set; } + + public int? FacebookPostInsightLikesTotal { get; set; } + + public int? FacebookPostInsightCommentsTotal { get; set; } + + public int? FacebookPostInsightNegativeHidePost { get; set; } + + public int? FacebookPostInsightNegativeHideAllPosts { get; set; } + + public int? FacebookPostInsightNegativeReportSpam { get; set; } + + public int? FacebookPostInsightNegativeUnlikePage { get; set; } + + public DateTime? FacebookPostInsightsLastUpdated { get; set; } + + [Column("FacebookPostDocumentGUID")] + public Guid? FacebookPostDocumentGuid { get; set; } + + public bool? FacebookPostIsCreatedByUser { get; set; } + + [ForeignKey("FacebookPostCampaignId")] + [InverseProperty("SmFacebookPosts")] + public virtual AnalyticsCampaign? FacebookPostCampaign { get; set; } + + [ForeignKey("FacebookPostFacebookAccountId")] + [InverseProperty("SmFacebookPosts")] + public virtual SmFacebookAccount FacebookPostFacebookAccount { get; set; } = null!; + + [ForeignKey("FacebookPostSiteId")] + [InverseProperty("SmFacebookPosts")] + public virtual CmsSite FacebookPostSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/SmInsight.cs b/Migration.Tool.KX12/Models/SmInsight.cs new file mode 100644 index 00000000..e9a3801e --- /dev/null +++ b/Migration.Tool.KX12/Models/SmInsight.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_Insight")] +[Index("InsightCodeName", "InsightPeriodType", Name = "IX_SM_Insight_InsightCodeName_InsightPeriodType")] +public class SmInsight +{ + [Key] + [Column("InsightID")] + public int InsightId { get; set; } + + [StringLength(200)] + public string InsightCodeName { get; set; } = null!; + + [Column("InsightExternalID")] + public string InsightExternalId { get; set; } = null!; + + [StringLength(20)] + public string InsightPeriodType { get; set; } = null!; + + public string? InsightValueName { get; set; } + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitDays { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitMonths { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitWeeks { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitYears { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/SmInsightHitDay.cs b/Migration.Tool.KX12/Models/SmInsightHitDay.cs new file mode 100644 index 00000000..8c27ba8e --- /dev/null +++ b/Migration.Tool.KX12/Models/SmInsightHitDay.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_InsightHit_Day")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Day_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitDay +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitDays")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/SmInsightHitMonth.cs b/Migration.Tool.KX12/Models/SmInsightHitMonth.cs new file mode 100644 index 00000000..46d3bc3f --- /dev/null +++ b/Migration.Tool.KX12/Models/SmInsightHitMonth.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_InsightHit_Month")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Month_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitMonth +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitMonths")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/SmInsightHitWeek.cs b/Migration.Tool.KX12/Models/SmInsightHitWeek.cs new file mode 100644 index 00000000..90154fed --- /dev/null +++ b/Migration.Tool.KX12/Models/SmInsightHitWeek.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_InsightHit_Week")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Week_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitWeek +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitWeeks")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/SmInsightHitYear.cs b/Migration.Tool.KX12/Models/SmInsightHitYear.cs new file mode 100644 index 00000000..6846454d --- /dev/null +++ b/Migration.Tool.KX12/Models/SmInsightHitYear.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_InsightHit_Year")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Year_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitYear +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitYears")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/SmLinkedInAccount.cs b/Migration.Tool.KX12/Models/SmLinkedInAccount.cs new file mode 100644 index 00000000..acb7a051 --- /dev/null +++ b/Migration.Tool.KX12/Models/SmLinkedInAccount.cs @@ -0,0 +1,46 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_LinkedInAccount")] +public class SmLinkedInAccount +{ + [Key] + [Column("LinkedInAccountID")] + public int LinkedInAccountId { get; set; } + + [StringLength(200)] + public string LinkedInAccountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string LinkedInAccountName { get; set; } = null!; + + public bool? LinkedInAccountIsDefault { get; set; } + + [StringLength(500)] + public string LinkedInAccountAccessToken { get; set; } = null!; + + public DateTime LinkedInAccountLastModified { get; set; } + + [Column("LinkedInAccountGUID")] + public Guid LinkedInAccountGuid { get; set; } + + [Column("LinkedInAccountSiteID")] + public int LinkedInAccountSiteId { get; set; } + + [Column("LinkedInAccountProfileID")] + [StringLength(50)] + public string LinkedInAccountProfileId { get; set; } = null!; + + [Column("LinkedInAccountLinkedInApplicationID")] + public int LinkedInAccountLinkedInApplicationId { get; set; } + + [StringLength(200)] + public string? LinkedInAccountProfileName { get; set; } + + public DateTime? LinkedInAccountAccessTokenExpiration { get; set; } + + [InverseProperty("LinkedInPostLinkedInAccount")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/SmLinkedInApplication.cs b/Migration.Tool.KX12/Models/SmLinkedInApplication.cs new file mode 100644 index 00000000..f4d80430 --- /dev/null +++ b/Migration.Tool.KX12/Models/SmLinkedInApplication.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_LinkedInApplication")] +[Index("LinkedInApplicationSiteId", Name = "IX_SM_LinkedInApplication_LinkedInApplicationSiteID")] +public class SmLinkedInApplication +{ + [Key] + [Column("LinkedInApplicationID")] + public int LinkedInApplicationId { get; set; } + + [StringLength(200)] + public string LinkedInApplicationDisplayName { get; set; } = null!; + + [StringLength(200)] + public string LinkedInApplicationName { get; set; } = null!; + + [StringLength(500)] + public string LinkedInApplicationConsumerSecret { get; set; } = null!; + + [StringLength(500)] + public string LinkedInApplicationConsumerKey { get; set; } = null!; + + public DateTime LinkedInApplicationLastModified { get; set; } + + [Column("LinkedInApplicationGUID")] + public Guid LinkedInApplicationGuid { get; set; } + + [Column("LinkedInApplicationSiteID")] + public int LinkedInApplicationSiteId { get; set; } + + [ForeignKey("LinkedInApplicationSiteId")] + [InverseProperty("SmLinkedInApplications")] + public virtual CmsSite LinkedInApplicationSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/SmLinkedInPost.cs b/Migration.Tool.KX12/Models/SmLinkedInPost.cs new file mode 100644 index 00000000..d0dc6383 --- /dev/null +++ b/Migration.Tool.KX12/Models/SmLinkedInPost.cs @@ -0,0 +1,84 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_LinkedInPost")] +[Index("LinkedInPostCampaignId", Name = "IX_SM_LinkedInPost_LinkedInPostCampaignID")] +[Index("LinkedInPostLinkedInAccountId", Name = "IX_SM_LinkedInPost_LinkedInPostLinkedInAccountID")] +[Index("LinkedInPostSiteId", Name = "IX_SM_LinkedInPost_LinkedInPostSiteID")] +public class SmLinkedInPost +{ + [Key] + [Column("LinkedInPostID")] + public int LinkedInPostId { get; set; } + + [Column("LinkedInPostLinkedInAccountID")] + public int LinkedInPostLinkedInAccountId { get; set; } + + [StringLength(700)] + public string LinkedInPostComment { get; set; } = null!; + + [Column("LinkedInPostSiteID")] + public int LinkedInPostSiteId { get; set; } + + [Column("LinkedInPostGUID")] + public Guid LinkedInPostGuid { get; set; } + + public DateTime? LinkedInPostLastModified { get; set; } + + [StringLength(200)] + public string? LinkedInPostUpdateKey { get; set; } + + [Column("LinkedInPostURLShortenerType")] + public int? LinkedInPostUrlshortenerType { get; set; } + + public DateTime? LinkedInPostScheduledPublishDateTime { get; set; } + + [Column("LinkedInPostCampaignID")] + public int? LinkedInPostCampaignId { get; set; } + + public DateTime? LinkedInPostPublishedDateTime { get; set; } + + [Column("LinkedInPostHTTPStatusCode")] + public int? LinkedInPostHttpstatusCode { get; set; } + + public int? LinkedInPostErrorCode { get; set; } + + public string? LinkedInPostErrorMessage { get; set; } + + [Column("LinkedInPostDocumentGUID")] + public Guid? LinkedInPostDocumentGuid { get; set; } + + public bool? LinkedInPostIsCreatedByUser { get; set; } + + public bool? LinkedInPostPostAfterDocumentPublish { get; set; } + + public DateTime? LinkedInPostInsightsLastUpdated { get; set; } + + public int? LinkedInPostCommentCount { get; set; } + + public int? LinkedInPostImpressionCount { get; set; } + + public int? LinkedInPostLikeCount { get; set; } + + public int? LinkedInPostShareCount { get; set; } + + public int? LinkedInPostClickCount { get; set; } + + public double? LinkedInPostEngagement { get; set; } + + [ForeignKey("LinkedInPostCampaignId")] + [InverseProperty("SmLinkedInPosts")] + public virtual AnalyticsCampaign? LinkedInPostCampaign { get; set; } + + [ForeignKey("LinkedInPostLinkedInAccountId")] + [InverseProperty("SmLinkedInPosts")] + public virtual SmLinkedInAccount LinkedInPostLinkedInAccount { get; set; } = null!; + + [ForeignKey("LinkedInPostSiteId")] + [InverseProperty("SmLinkedInPosts")] + public virtual CmsSite LinkedInPostSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/SmTwitterAccount.cs b/Migration.Tool.KX12/Models/SmTwitterAccount.cs new file mode 100644 index 00000000..835d02e0 --- /dev/null +++ b/Migration.Tool.KX12/Models/SmTwitterAccount.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_TwitterAccount")] +[Index("TwitterAccountSiteId", Name = "IX_SM_TwitterAccount_TwitterAccountSiteID")] +[Index("TwitterAccountTwitterApplicationId", Name = "IX_SM_TwitterAccount_TwitterAccountTwitterApplicationID")] +public class SmTwitterAccount +{ + [Key] + [Column("TwitterAccountID")] + public int TwitterAccountId { get; set; } + + [StringLength(200)] + public string TwitterAccountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TwitterAccountName { get; set; } = null!; + + public DateTime TwitterAccountLastModified { get; set; } + + [Column("TwitterAccountGUID")] + public Guid TwitterAccountGuid { get; set; } + + [Column("TwitterAccountSiteID")] + public int TwitterAccountSiteId { get; set; } + + [StringLength(500)] + public string TwitterAccountAccessToken { get; set; } = null!; + + [StringLength(500)] + public string TwitterAccountAccessTokenSecret { get; set; } = null!; + + [Column("TwitterAccountTwitterApplicationID")] + public int TwitterAccountTwitterApplicationId { get; set; } + + public int? TwitterAccountFollowers { get; set; } + + public int? TwitterAccountMentions { get; set; } + + [StringLength(40)] + public string? TwitterAccountMentionsRange { get; set; } + + [Column("TwitterAccountUserID")] + [StringLength(20)] + public string? TwitterAccountUserId { get; set; } + + public bool? TwitterAccountIsDefault { get; set; } + + [InverseProperty("TwitterPostTwitterAccount")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); + + [ForeignKey("TwitterAccountSiteId")] + [InverseProperty("SmTwitterAccounts")] + public virtual CmsSite TwitterAccountSite { get; set; } = null!; + + [ForeignKey("TwitterAccountTwitterApplicationId")] + [InverseProperty("SmTwitterAccounts")] + public virtual SmTwitterApplication TwitterAccountTwitterApplication { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/SmTwitterApplication.cs b/Migration.Tool.KX12/Models/SmTwitterApplication.cs new file mode 100644 index 00000000..c352058a --- /dev/null +++ b/Migration.Tool.KX12/Models/SmTwitterApplication.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_TwitterApplication")] +[Index("TwitterApplicationSiteId", Name = "IX_SM_TwitterApplication_TwitterApplicationSiteID")] +public class SmTwitterApplication +{ + [Key] + [Column("TwitterApplicationID")] + public int TwitterApplicationId { get; set; } + + [StringLength(200)] + public string TwitterApplicationDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TwitterApplicationName { get; set; } = null!; + + public DateTime TwitterApplicationLastModified { get; set; } + + [Column("TwitterApplicationGUID")] + public Guid TwitterApplicationGuid { get; set; } + + [Column("TwitterApplicationSiteID")] + public int TwitterApplicationSiteId { get; set; } + + [StringLength(500)] + public string TwitterApplicationConsumerKey { get; set; } = null!; + + [StringLength(500)] + public string TwitterApplicationConsumerSecret { get; set; } = null!; + + [InverseProperty("TwitterAccountTwitterApplication")] + public virtual ICollection SmTwitterAccounts { get; set; } = new List(); + + [ForeignKey("TwitterApplicationSiteId")] + [InverseProperty("SmTwitterApplications")] + public virtual CmsSite TwitterApplicationSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/SmTwitterPost.cs b/Migration.Tool.KX12/Models/SmTwitterPost.cs new file mode 100644 index 00000000..d52e34be --- /dev/null +++ b/Migration.Tool.KX12/Models/SmTwitterPost.cs @@ -0,0 +1,70 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("SM_TwitterPost")] +[Index("TwitterPostCampaignId", Name = "IX_SM_TwitterPost_TwitterPostCampaignID")] +[Index("TwitterPostSiteId", Name = "IX_SM_TwitterPost_TwitterPostSiteID")] +[Index("TwitterPostTwitterAccountId", Name = "IX_SM_TwitterPost_TwitterPostTwitterAccountID")] +public class SmTwitterPost +{ + [Key] + [Column("TwitterPostID")] + public int TwitterPostId { get; set; } + + [Column("TwitterPostGUID")] + public Guid TwitterPostGuid { get; set; } + + public DateTime TwitterPostLastModified { get; set; } + + [Column("TwitterPostSiteID")] + public int TwitterPostSiteId { get; set; } + + [Column("TwitterPostTwitterAccountID")] + public int TwitterPostTwitterAccountId { get; set; } + + public string TwitterPostText { get; set; } = null!; + + [Column("TwitterPostURLShortenerType")] + public int? TwitterPostUrlshortenerType { get; set; } + + [Column("TwitterPostExternalID")] + public string? TwitterPostExternalId { get; set; } + + public int? TwitterPostErrorCode { get; set; } + + public DateTime? TwitterPostPublishedDateTime { get; set; } + + public DateTime? TwitterPostScheduledPublishDateTime { get; set; } + + [Column("TwitterPostCampaignID")] + public int? TwitterPostCampaignId { get; set; } + + public int? TwitterPostFavorites { get; set; } + + public int? TwitterPostRetweets { get; set; } + + public bool? TwitterPostPostAfterDocumentPublish { get; set; } + + public DateTime? TwitterPostInsightsUpdateDateTime { get; set; } + + [Column("TwitterPostDocumentGUID")] + public Guid? TwitterPostDocumentGuid { get; set; } + + public bool? TwitterPostIsCreatedByUser { get; set; } + + [ForeignKey("TwitterPostCampaignId")] + [InverseProperty("SmTwitterPosts")] + public virtual AnalyticsCampaign? TwitterPostCampaign { get; set; } + + [ForeignKey("TwitterPostSiteId")] + [InverseProperty("SmTwitterPosts")] + public virtual CmsSite TwitterPostSite { get; set; } = null!; + + [ForeignKey("TwitterPostTwitterAccountId")] + [InverseProperty("SmTwitterPosts")] + public virtual SmTwitterAccount TwitterPostTwitterAccount { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/StagingServer.cs b/Migration.Tool.KX12/Models/StagingServer.cs new file mode 100644 index 00000000..eda733ef --- /dev/null +++ b/Migration.Tool.KX12/Models/StagingServer.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Staging_Server")] +[Index("ServerEnabled", Name = "IX_Staging_Server_ServerEnabled")] +[Index("ServerSiteId", Name = "IX_Staging_Server_ServerSiteID")] +public class StagingServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(100)] + public string ServerName { get; set; } = null!; + + [StringLength(440)] + public string ServerDisplayName { get; set; } = null!; + + [Column("ServerSiteID")] + public int ServerSiteId { get; set; } + + [Column("ServerURL")] + [StringLength(450)] + public string ServerUrl { get; set; } = null!; + + [Required] + public bool? ServerEnabled { get; set; } + + [StringLength(20)] + public string ServerAuthentication { get; set; } = null!; + + [StringLength(100)] + public string? ServerUsername { get; set; } + + [StringLength(100)] + public string? ServerPassword { get; set; } + + [Column("ServerX509ClientKeyID")] + [StringLength(200)] + public string? ServerX509clientKeyId { get; set; } + + [Column("ServerX509ServerKeyID")] + [StringLength(200)] + public string? ServerX509serverKeyId { get; set; } + + [Column("ServerGUID")] + public Guid ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + [ForeignKey("ServerSiteId")] + [InverseProperty("StagingServers")] + public virtual CmsSite ServerSite { get; set; } = null!; + + [InverseProperty("SynchronizationServer")] + public virtual ICollection StagingSynchronizations { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/StagingSynchronization.cs b/Migration.Tool.KX12/Models/StagingSynchronization.cs new file mode 100644 index 00000000..6bb5a840 --- /dev/null +++ b/Migration.Tool.KX12/Models/StagingSynchronization.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Staging_Synchronization")] +[Index("SynchronizationServerId", Name = "IX_Staging_Synchronization_SynchronizationServerID")] +[Index("SynchronizationTaskId", Name = "IX_Staging_Synchronization_SynchronizationTaskID")] +public class StagingSynchronization +{ + [Key] + [Column("SynchronizationID")] + public int SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int SynchronizationTaskId { get; set; } + + [Column("SynchronizationServerID")] + public int SynchronizationServerId { get; set; } + + public DateTime? SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + [ForeignKey("SynchronizationServerId")] + [InverseProperty("StagingSynchronizations")] + public virtual StagingServer SynchronizationServer { get; set; } = null!; + + [ForeignKey("SynchronizationTaskId")] + [InverseProperty("StagingSynchronizations")] + public virtual StagingTask SynchronizationTask { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/StagingTask.cs b/Migration.Tool.KX12/Models/StagingTask.cs new file mode 100644 index 00000000..67dc555a --- /dev/null +++ b/Migration.Tool.KX12/Models/StagingTask.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Staging_Task")] +[Index("TaskDocumentId", "TaskNodeId", "TaskRunning", Name = "IX_Staging_Task_TaskDocumentID_TaskNodeID_TaskRunning")] +[Index("TaskObjectType", "TaskObjectId", "TaskRunning", Name = "IX_Staging_Task_TaskObjectType_TaskObjectID_TaskRunning")] +[Index("TaskSiteId", Name = "IX_Staging_Task_TaskSiteID")] +[Index("TaskType", Name = "IX_Staging_Task_TaskType")] +public class StagingTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + [StringLength(450)] + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool? TaskRunning { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + public string? TaskServers { get; set; } + + [InverseProperty("SynchronizationTask")] + public virtual ICollection StagingSynchronizations { get; set; } = new List(); + + [InverseProperty("Task")] + public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); + + [InverseProperty("Task")] + public virtual ICollection StagingTaskUsers { get; set; } = new List(); + + [ForeignKey("TaskSiteId")] + [InverseProperty("StagingTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Tool.KX12/Models/StagingTaskGroup.cs b/Migration.Tool.KX12/Models/StagingTaskGroup.cs new file mode 100644 index 00000000..fd383a78 --- /dev/null +++ b/Migration.Tool.KX12/Models/StagingTaskGroup.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("staging_TaskGroup")] +public class StagingTaskGroup +{ + [Key] + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [StringLength(50)] + public string TaskGroupCodeName { get; set; } = null!; + + public Guid TaskGroupGuid { get; set; } + + public string? TaskGroupDescription { get; set; } + + [InverseProperty("TaskGroup")] + public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); + + [InverseProperty("TaskGroup")] + public virtual ICollection StagingTaskGroupUsers { get; set; } = new List(); +} diff --git a/Migration.Tool.KX12/Models/StagingTaskGroupTask.cs b/Migration.Tool.KX12/Models/StagingTaskGroupTask.cs new file mode 100644 index 00000000..510e7f9c --- /dev/null +++ b/Migration.Tool.KX12/Models/StagingTaskGroupTask.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("staging_TaskGroupTask")] +[Index("TaskGroupId", Name = "IX_Staging_TaskGroupTask_TaskGroupID")] +[Index("TaskId", Name = "IX_Staging_TaskGroupTask_TaskID")] +public class StagingTaskGroupTask +{ + [Key] + [Column("TaskGroupTaskID")] + public int TaskGroupTaskId { get; set; } + + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [ForeignKey("TaskId")] + [InverseProperty("StagingTaskGroupTasks")] + public virtual StagingTask Task { get; set; } = null!; + + [ForeignKey("TaskGroupId")] + [InverseProperty("StagingTaskGroupTasks")] + public virtual StagingTaskGroup TaskGroup { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/StagingTaskGroupUser.cs b/Migration.Tool.KX12/Models/StagingTaskGroupUser.cs new file mode 100644 index 00000000..3e19cb3a --- /dev/null +++ b/Migration.Tool.KX12/Models/StagingTaskGroupUser.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("staging_TaskGroupUser")] +[Index("TaskGroupId", Name = "IX_Staging_TaskGroupUser_TaskGroup_ID")] +[Index("UserId", Name = "IX_Staging_TaskGroupUser_UserID", IsUnique = true)] +public class StagingTaskGroupUser +{ + [Key] + [Column("TaskGroupUserID")] + public int TaskGroupUserId { get; set; } + + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("TaskGroupId")] + [InverseProperty("StagingTaskGroupUsers")] + public virtual StagingTaskGroup TaskGroup { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("StagingTaskGroupUser")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/StagingTaskUser.cs b/Migration.Tool.KX12/Models/StagingTaskUser.cs new file mode 100644 index 00000000..e612d3a9 --- /dev/null +++ b/Migration.Tool.KX12/Models/StagingTaskUser.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Table("Staging_TaskUser")] +[Index("TaskId", Name = "IX_Staging_TaskUser_TaskID")] +[Index("UserId", Name = "IX_Staging_TaskUser_UserID")] +public class StagingTaskUser +{ + [Key] + [Column("TaskUserID")] + public int TaskUserId { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("TaskId")] + [InverseProperty("StagingTaskUsers")] + public virtual StagingTask Task { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("StagingTaskUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/TempFile.cs b/Migration.Tool.KX12/Models/TempFile.cs new file mode 100644 index 00000000..77bae92e --- /dev/null +++ b/Migration.Tool.KX12/Models/TempFile.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("Temp_File")] +public class TempFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileParentGUID")] + public Guid FileParentGuid { get; set; } + + public int FileNumber { get; set; } + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + public long FileSize { get; set; } + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + public byte[]? FileBinary { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + public DateTime FileLastModified { get; set; } + + [StringLength(200)] + public string FileDirectory { get; set; } = null!; + + [StringLength(200)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string? FileTitle { get; set; } + + public string? FileDescription { get; set; } +} diff --git a/Migration.Tool.KX12/Models/TempPageBuilderWidget.cs b/Migration.Tool.KX12/Models/TempPageBuilderWidget.cs new file mode 100644 index 00000000..6913c282 --- /dev/null +++ b/Migration.Tool.KX12/Models/TempPageBuilderWidget.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX12.Models; + +[Table("Temp_PageBuilderWidgets")] +public class TempPageBuilderWidget +{ + [Key] + [Column("PageBuilderWidgetsID")] + public int PageBuilderWidgetsId { get; set; } + + public string? PageBuilderWidgetsConfiguration { get; set; } + + public Guid PageBuilderWidgetsGuid { get; set; } + + public DateTime PageBuilderWidgetsLastModified { get; set; } + + public string? PageBuilderTemplateConfiguration { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewBoardsBoardMessageJoined.cs b/Migration.Tool.KX12/Models/ViewBoardsBoardMessageJoined.cs new file mode 100644 index 00000000..da26e3f6 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewBoardsBoardMessageJoined.cs @@ -0,0 +1,158 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewBoardsBoardMessageJoined +{ + [Column("BoardID")] + public int BoardId { get; set; } + + [StringLength(250)] + public string BoardName { get; set; } = null!; + + [StringLength(250)] + public string BoardDisplayName { get; set; } = null!; + + public string BoardDescription { get; set; } = null!; + + public DateTime? BoardOpenedFrom { get; set; } + + public bool BoardOpened { get; set; } + + public DateTime? BoardOpenedTo { get; set; } + + public bool BoardEnabled { get; set; } + + public bool BoardModerated { get; set; } + + public int BoardAccess { get; set; } + + public bool BoardUseCaptcha { get; set; } + + public DateTime BoardLastModified { get; set; } + + public int BoardMessages { get; set; } + + [Column("BoardDocumentID")] + public int BoardDocumentId { get; set; } + + [Column("BoardGUID")] + public Guid BoardGuid { get; set; } + + [Column("BoardUserID")] + public int? BoardUserId { get; set; } + + [Column("BoardGroupID")] + public int? BoardGroupId { get; set; } + + public DateTime? BoardLastMessageTime { get; set; } + + [StringLength(250)] + public string? BoardLastMessageUserName { get; set; } + + [Column("BoardUnsubscriptionURL")] + [StringLength(450)] + public string? BoardUnsubscriptionUrl { get; set; } + + public bool? BoardRequireEmails { get; set; } + + [Column("BoardSiteID")] + public int BoardSiteId { get; set; } + + public bool BoardEnableSubscriptions { get; set; } + + [Column("BoardBaseURL")] + [StringLength(450)] + public string? BoardBaseUrl { get; set; } + + [Column("MessageID")] + public int MessageId { get; set; } + + [StringLength(250)] + public string MessageUserName { get; set; } = null!; + + public string MessageText { get; set; } = null!; + + [StringLength(254)] + public string MessageEmail { get; set; } = null!; + + [Column("MessageURL")] + [StringLength(450)] + public string MessageUrl { get; set; } = null!; + + public bool MessageIsSpam { get; set; } + + [Column("MessageBoardID")] + public int MessageBoardId { get; set; } + + public bool MessageApproved { get; set; } + + [Column("MessageUserID")] + public int? MessageUserId { get; set; } + + [Column("MessageApprovedByUserID")] + public int? MessageApprovedByUserId { get; set; } + + public string MessageUserInfo { get; set; } = null!; + + [Column("MessageAvatarGUID")] + public Guid? MessageAvatarGuid { get; set; } + + public DateTime MessageInserted { get; set; } + + public DateTime MessageLastModified { get; set; } + + [Column("MessageGUID")] + public Guid MessageGuid { get; set; } + + public double? MessageRatingValue { get; set; } + + [Column("GroupID")] + public int? GroupId { get; set; } + + [Column("GroupGUID")] + public Guid? GroupGuid { get; set; } + + public DateTime? GroupLastModified { get; set; } + + [Column("GroupSiteID")] + public int? GroupSiteId { get; set; } + + [StringLength(200)] + public string? GroupDisplayName { get; set; } + + [StringLength(100)] + public string? GroupName { get; set; } + + public string? GroupDescription { get; set; } + + [Column("GroupNodeGUID")] + public Guid? GroupNodeGuid { get; set; } + + public int? GroupApproveMembers { get; set; } + + public int? GroupAccess { get; set; } + + [Column("GroupCreatedByUserID")] + public int? GroupCreatedByUserId { get; set; } + + [Column("GroupApprovedByUserID")] + public int? GroupApprovedByUserId { get; set; } + + [Column("GroupAvatarID")] + public int? GroupAvatarId { get; set; } + + public bool? GroupApproved { get; set; } + + public DateTime? GroupCreatedWhen { get; set; } + + public bool? GroupSendJoinLeaveNotification { get; set; } + + public bool? GroupSendWaitingForApprovalNotification { get; set; } + + public int? GroupSecurity { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsAclitemItemsAndOperator.cs b/Migration.Tool.KX12/Models/ViewCmsAclitemItemsAndOperator.cs new file mode 100644 index 00000000..744ede47 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsAclitemItemsAndOperator.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsAclitemItemsAndOperator +{ + [Column("ACLOwnerNodeID")] + public int AclownerNodeId { get; set; } + + [Column("ACLItemID")] + public int AclitemId { get; set; } + + public int Allowed { get; set; } + + public int Denied { get; set; } + + [StringLength(51)] + public string? Operator { get; set; } + + [StringLength(100)] + public string? OperatorName { get; set; } + + [Column("ACLID")] + public int Aclid { get; set; } + + [StringLength(450)] + public string? OperatorFullName { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [Column("RoleID")] + public int? RoleId { get; set; } + + [Column("RoleGroupID")] + public int? RoleGroupId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs b/Migration.Tool.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs new file mode 100644 index 00000000..eeb573fc --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs @@ -0,0 +1,123 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsObjectVersionHistoryUserJoined +{ + [Column("VersionID")] + public int VersionId { get; set; } + + [Column("VersionObjectID")] + public int? VersionObjectId { get; set; } + + [StringLength(100)] + public string VersionObjectType { get; set; } = null!; + + [Column("VersionObjectSiteID")] + public int? VersionObjectSiteId { get; set; } + + [StringLength(450)] + public string VersionObjectDisplayName { get; set; } = null!; + + [Column("VersionXML")] + public string VersionXml { get; set; } = null!; + + [Column("VersionBinaryDataXML")] + public string? VersionBinaryDataXml { get; set; } + + [Column("VersionModifiedByUserID")] + public int? VersionModifiedByUserId { get; set; } + + public DateTime VersionModifiedWhen { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [StringLength(50)] + public string VersionNumber { get; set; } = null!; + + [Column("VersionSiteBindingIDs")] + public string? VersionSiteBindingIds { get; set; } + + public string? VersionComment { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(100)] + public string? UserName { get; set; } + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string? UserPassword { get; set; } + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool? UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid? UserGuid { get; set; } + + public DateTime? UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int? UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs b/Migration.Tool.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs new file mode 100644 index 00000000..bffc7c1f --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs @@ -0,0 +1,57 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsPageTemplateCategoryPageTemplateJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(200)] + public string? CodeName { get; set; } + + [StringLength(200)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryTemplateChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [StringLength(20)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; + + public bool? Parameter { get; set; } + + public int? PageTemplateForAllPages { get; set; } + + [StringLength(10)] + public string? PageTemplateType { get; set; } + + public int? PageTemplateIsReusable { get; set; } + + [StringLength(200)] + public string? PageTemplateIconClass { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsRelationshipJoined.cs b/Migration.Tool.KX12/Models/ViewCmsRelationshipJoined.cs new file mode 100644 index 00000000..5cdce8b1 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsRelationshipJoined.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsRelationshipJoined +{ + [Column("LeftNodeID")] + public int LeftNodeId { get; set; } + + [Column("LeftNodeGUID")] + public Guid LeftNodeGuid { get; set; } + + [StringLength(100)] + public string LeftNodeName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipName { get; set; } = null!; + + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + [Column("RightNodeID")] + public int RightNodeId { get; set; } + + [Column("RightNodeGUID")] + public Guid RightNodeGuid { get; set; } + + [StringLength(100)] + public string RightNodeName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipDisplayName { get; set; } = null!; + + public string? RelationshipCustomData { get; set; } + + [Column("LeftClassID")] + public int LeftClassId { get; set; } + + [Column("RightClassID")] + public int RightClassId { get; set; } + + [Column("RelationshipID")] + public int RelationshipId { get; set; } + + public int? RelationshipOrder { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsResourceStringJoined.cs b/Migration.Tool.KX12/Models/ViewCmsResourceStringJoined.cs new file mode 100644 index 00000000..6e46c908 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsResourceStringJoined.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsResourceStringJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("TranslationID")] + public int? TranslationId { get; set; } + + [Column("TranslationStringID")] + public int? TranslationStringId { get; set; } + + [Column("TranslationCultureID")] + public int? TranslationCultureId { get; set; } + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int? CultureId { get; set; } + + [StringLength(200)] + public string? CultureName { get; set; } + + [StringLength(50)] + public string? CultureCode { get; set; } + + [Column("CultureGUID")] + public Guid? CultureGuid { get; set; } + + public DateTime? CultureLastModified { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Tool.KX12/Models/ViewCmsResourceTranslatedJoined.cs new file mode 100644 index 00000000..bcd4c694 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsResourceTranslatedJoined.cs @@ -0,0 +1,27 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsResourceTranslatedJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs b/Migration.Tool.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs new file mode 100644 index 00000000..37d3e5bf --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsRoleResourcePermissionJoined +{ + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + [StringLength(100)] + public string PermissionName { get; set; } = null!; + + [Column("PermissionID")] + public int PermissionId { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsSiteDocumentCount.cs b/Migration.Tool.KX12/Models/ViewCmsSiteDocumentCount.cs new file mode 100644 index 00000000..426bc20e --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsSiteDocumentCount.cs @@ -0,0 +1,46 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsSiteDocumentCount +{ + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + [StringLength(200)] + public string SiteDisplayName { get; set; } = null!; + + public string? SiteDescription { get; set; } + + [StringLength(20)] + public string SiteStatus { get; set; } = null!; + + [StringLength(400)] + public string SiteDomainName { get; set; } = null!; + + [Column("SiteDefaultStylesheetID")] + public int? SiteDefaultStylesheetId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + public int? SiteDefaultEditorStylesheet { get; set; } + + [Column("SiteGUID")] + public Guid SiteGuid { get; set; } + + public DateTime SiteLastModified { get; set; } + + public bool? SiteIsContentOnly { get; set; } + + public int? Documents { get; set; } + + public bool? SiteIsOffline { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs b/Migration.Tool.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs new file mode 100644 index 00000000..7ecd2bed --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsSiteRoleResourceUielementJoined +{ + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(200)] + public string ElementName { get; set; } = null!; + + [StringLength(100)] + public string? SiteName { get; set; } + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + [Column("RoleSiteID")] + public int? RoleSiteId { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsTreeJoined.cs b/Migration.Tool.KX12/Models/ViewCmsTreeJoined.cs new file mode 100644 index 00000000..e1bcc887 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsTreeJoined.cs @@ -0,0 +1,298 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsTreeJoined +{ + [StringLength(100)] + public string ClassName { get; set; } = null!; + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [Column("NodeID")] + public int NodeId { get; set; } + + [StringLength(450)] + public string NodeAliasPath { get; set; } = null!; + + [StringLength(100)] + public string NodeName { get; set; } = null!; + + [StringLength(50)] + public string NodeAlias { get; set; } = null!; + + [Column("NodeClassID")] + public int NodeClassId { get; set; } + + [Column("NodeParentID")] + public int? NodeParentId { get; set; } + + public int NodeLevel { get; set; } + + [Column("NodeACLID")] + public int? NodeAclid { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeGUID")] + public Guid NodeGuid { get; set; } + + public int? NodeOrder { get; set; } + + public bool? IsSecuredNode { get; set; } + + public int? NodeCacheMinutes { get; set; } + + [Column("NodeSKUID")] + public int? NodeSkuid { get; set; } + + public string? NodeDocType { get; set; } + + public string? NodeHeadTags { get; set; } + + public string? NodeBodyElementAttributes { get; set; } + + [StringLength(200)] + public string? NodeInheritPageLevels { get; set; } + + [Column("RequiresSSL")] + public int? RequiresSsl { get; set; } + + [Column("NodeLinkedNodeID")] + public int? NodeLinkedNodeId { get; set; } + + public int? NodeOwner { get; set; } + + public string? NodeCustomData { get; set; } + + [Column("NodeGroupID")] + public int? NodeGroupId { get; set; } + + [Column("NodeLinkedNodeSiteID")] + public int? NodeLinkedNodeSiteId { get; set; } + + [Column("NodeTemplateID")] + public int? NodeTemplateId { get; set; } + + public bool? NodeTemplateForAllCultures { get; set; } + + public bool? NodeInheritPageTemplate { get; set; } + + public bool? NodeAllowCacheInFileSystem { get; set; } + + public bool? NodeHasChildren { get; set; } + + public bool? NodeHasLinks { get; set; } + + [Column("NodeOriginalNodeID")] + public int? NodeOriginalNodeId { get; set; } + + public bool NodeIsContentOnly { get; set; } + + [Column("NodeIsACLOwner")] + public bool NodeIsAclowner { get; set; } + + public string? NodeBodyScripts { get; set; } + + [Column("DocumentID")] + public int DocumentId { get; set; } + + [StringLength(100)] + public string DocumentName { get; set; } = null!; + + [StringLength(1500)] + public string? DocumentNamePath { get; set; } + + public DateTime? DocumentModifiedWhen { get; set; } + + [Column("DocumentModifiedByUserID")] + public int? DocumentModifiedByUserId { get; set; } + + public int? DocumentForeignKeyValue { get; set; } + + [Column("DocumentCreatedByUserID")] + public int? DocumentCreatedByUserId { get; set; } + + public DateTime? DocumentCreatedWhen { get; set; } + + [Column("DocumentCheckedOutByUserID")] + public int? DocumentCheckedOutByUserId { get; set; } + + public DateTime? DocumentCheckedOutWhen { get; set; } + + [Column("DocumentCheckedOutVersionHistoryID")] + public int? DocumentCheckedOutVersionHistoryId { get; set; } + + [Column("DocumentPublishedVersionHistoryID")] + public int? DocumentPublishedVersionHistoryId { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + public DateTime? DocumentPublishFrom { get; set; } + + public DateTime? DocumentPublishTo { get; set; } + + [StringLength(450)] + public string? DocumentUrlPath { get; set; } + + [StringLength(10)] + public string DocumentCulture { get; set; } = null!; + + [Column("DocumentNodeID")] + public int DocumentNodeId { get; set; } + + public string? DocumentPageTitle { get; set; } + + public string? DocumentPageKeyWords { get; set; } + + public string? DocumentPageDescription { get; set; } + + public bool DocumentShowInSiteMap { get; set; } + + public bool DocumentMenuItemHideInNavigation { get; set; } + + [StringLength(200)] + public string? DocumentMenuCaption { get; set; } + + [StringLength(100)] + public string? DocumentMenuStyle { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImage { get; set; } + + [Column("DocumentPageTemplateID")] + public int? DocumentPageTemplateId { get; set; } + + [StringLength(450)] + public string? DocumentMenuJavascript { get; set; } + + [StringLength(450)] + public string? DocumentMenuRedirectUrl { get; set; } + + public bool? DocumentUseNamePathForUrlPath { get; set; } + + [Column("DocumentStylesheetID")] + public int? DocumentStylesheetId { get; set; } + + public string? DocumentContent { get; set; } + + [StringLength(100)] + public string? DocumentMenuClass { get; set; } + + [StringLength(200)] + public string? DocumentMenuStyleHighlighted { get; set; } + + [StringLength(100)] + public string? DocumentMenuClassHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImageHighlighted { get; set; } + + public bool? DocumentMenuItemInactive { get; set; } + + public string? DocumentCustomData { get; set; } + + [StringLength(100)] + public string? DocumentExtensions { get; set; } + + public string? DocumentTags { get; set; } + + [Column("DocumentTagGroupID")] + public int? DocumentTagGroupId { get; set; } + + [StringLength(440)] + public string? DocumentWildcardRule { get; set; } + + public string? DocumentWebParts { get; set; } + + public double? DocumentRatingValue { get; set; } + + public int? DocumentRatings { get; set; } + + public int? DocumentPriority { get; set; } + + [StringLength(50)] + public string? DocumentType { get; set; } + + public DateTime? DocumentLastPublished { get; set; } + + public bool? DocumentUseCustomExtensions { get; set; } + + public string? DocumentGroupWebParts { get; set; } + + public bool? DocumentCheckedOutAutomatically { get; set; } + + [StringLength(200)] + public string? DocumentTrackConversionName { get; set; } + + [StringLength(100)] + public string? DocumentConversionValue { get; set; } + + public bool? DocumentSearchExcluded { get; set; } + + [StringLength(50)] + public string? DocumentLastVersionNumber { get; set; } + + public bool? DocumentIsArchived { get; set; } + + [StringLength(32)] + public string? DocumentHash { get; set; } + + public bool? DocumentLogVisitActivity { get; set; } + + [Column("DocumentGUID")] + public Guid? DocumentGuid { get; set; } + + [Column("DocumentWorkflowCycleGUID")] + public Guid? DocumentWorkflowCycleGuid { get; set; } + + [StringLength(100)] + public string? DocumentSitemapSettings { get; set; } + + public bool? DocumentIsWaitingForTranslation { get; set; } + + [Column("DocumentSKUName")] + [StringLength(440)] + public string? DocumentSkuname { get; set; } + + [Column("DocumentSKUDescription")] + public string? DocumentSkudescription { get; set; } + + [Column("DocumentSKUShortDescription")] + public string? DocumentSkushortDescription { get; set; } + + [StringLength(450)] + public string? DocumentWorkflowActionStatus { get; set; } + + public bool? DocumentMenuRedirectToFirstChild { get; set; } + + public bool DocumentCanBePublished { get; set; } + + public bool DocumentInheritsStylesheet { get; set; } + + public string? DocumentPageBuilderWidgets { get; set; } + + public string? DocumentPageTemplateConfiguration { get; set; } + + [Column("DocumentABTestConfiguration")] + public string? DocumentAbtestConfiguration { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsUser.cs b/Migration.Tool.KX12/Models/ViewCmsUser.cs new file mode 100644 index 00000000..24d64bb3 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsUser.cs @@ -0,0 +1,214 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsUser +{ + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [Column("UserSettingsID")] + public int? UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid? UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int? UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarFileName { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsUserDocument.cs b/Migration.Tool.KX12/Models/ViewCmsUserDocument.cs new file mode 100644 index 00000000..8b89f9b1 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsUserDocument.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsUserDocument +{ + [StringLength(450)] + public string DocumentName { get; set; } = null!; + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeID")] + public int NodeId { get; set; } + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [StringLength(1500)] + public string? DocumentNamePath { get; set; } + + public DateTime? DocumentModifiedWhen { get; set; } + + [StringLength(10)] + public string DocumentCulture { get; set; } = null!; + + [StringLength(200)] + public string? CultureName { get; set; } + + [Column("UserID1")] + public int? UserId1 { get; set; } + + [Column("UserID2")] + public int? UserId2 { get; set; } + + [Column("UserID3")] + public int? UserId3 { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + [StringLength(450)] + public string NodeAliasPath { get; set; } = null!; + + [StringLength(12)] + [Unicode(false)] + public string Type { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ViewCmsUserRoleJoined.cs b/Migration.Tool.KX12/Models/ViewCmsUserRoleJoined.cs new file mode 100644 index 00000000..ace22be5 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsUserRoleJoined.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsUserRoleJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(450)] + public string? FullName { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + [Column("RoleGroupID")] + public int? RoleGroupId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [StringLength(100)] + public string? SiteName { get; set; } + + [Column("SiteGUID")] + public Guid? SiteGuid { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsUserRoleMembershipRole.cs b/Migration.Tool.KX12/Models/ViewCmsUserRoleMembershipRole.cs new file mode 100644 index 00000000..decd28a0 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsUserRoleMembershipRole.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsUserRoleMembershipRole +{ + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + public DateTime? ValidTo { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs b/Migration.Tool.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs new file mode 100644 index 00000000..2b0bcc32 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsUserRoleMembershipRoleValidOnlyJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsUserSettingsRoleJoined.cs b/Migration.Tool.KX12/Models/ViewCmsUserSettingsRoleJoined.cs new file mode 100644 index 00000000..21275049 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsUserSettingsRoleJoined.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsUserSettingsRoleJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + public bool UserEnabled { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs b/Migration.Tool.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs new file mode 100644 index 00000000..fecd39db --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs @@ -0,0 +1,67 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsWebPartCategoryWebpartJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(100)] + public string CodeName { get; set; } = null!; + + [StringLength(100)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryWebPartChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [Column("WebPartParentID")] + public int? WebPartParentId { get; set; } + + [StringLength(100)] + public string? WebPartFileName { get; set; } + + [Column("WebPartGUID")] + public Guid? WebPartGuid { get; set; } + + public int? WebPartType { get; set; } + + [StringLength(1000)] + public string? WebPartDescription { get; set; } + + [StringLength(15)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; + + [Column("ThumbnailGUID")] + public Guid? ThumbnailGuid { get; set; } + + [StringLength(200)] + public string? IconClass { get; set; } + + public bool? WebPartSkipInsertProperties { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs b/Migration.Tool.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs new file mode 100644 index 00000000..3c17dc22 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCmsWidgetCategoryWidgetJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(100)] + public string CodeName { get; set; } = null!; + + [StringLength(100)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? WidgetCategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? WidgetCategoryChildCount { get; set; } + + public int? WidgetCategoryWidgetChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [Column("WidgetWebPartID")] + public int? WidgetWebPartId { get; set; } + + public int WidgetSecurity { get; set; } + + public bool? WidgetForGroup { get; set; } + + public bool? WidgetForInline { get; set; } + + public bool? WidgetForUser { get; set; } + + public bool? WidgetForEditor { get; set; } + + public bool? WidgetForDashboard { get; set; } + + [Column("WidgetGUID")] + public Guid? WidgetGuid { get; set; } + + [StringLength(14)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs b/Migration.Tool.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs new file mode 100644 index 00000000..67e923ac --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewComSkuoptionCategoryOptionCategoryJoined +{ + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("CategoryID")] + public int CategoryId { get; set; } + + public bool? AllowAllOptions { get; set; } + + [Column("SKUCategoryID")] + public int SkucategoryId { get; set; } + + [Column("SKUCategoryOrder")] + public int? SkucategoryOrder { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryName { get; set; } = null!; + + [StringLength(200)] + public string CategorySelectionType { get; set; } = null!; + + [StringLength(200)] + public string? CategoryDefaultOptions { get; set; } + + public string? CategoryDescription { get; set; } + + [StringLength(200)] + public string? CategoryDefaultRecord { get; set; } + + public bool CategoryEnabled { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + public bool? CategoryDisplayPrice { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + public int? CategoryTextMaxLength { get; set; } + + [StringLength(20)] + public string? CategoryType { get; set; } + + public int? CategoryTextMinLength { get; set; } + + [StringLength(200)] + public string? CategoryLiveSiteDisplayName { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCommunityGroup.cs b/Migration.Tool.KX12/Models/ViewCommunityGroup.cs new file mode 100644 index 00000000..63dfda2d --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCommunityGroup.cs @@ -0,0 +1,66 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCommunityGroup +{ + [Column("GroupID")] + public int GroupId { get; set; } + + [Column("GroupGUID")] + public Guid GroupGuid { get; set; } + + public DateTime GroupLastModified { get; set; } + + [Column("GroupSiteID")] + public int GroupSiteId { get; set; } + + [StringLength(200)] + public string GroupDisplayName { get; set; } = null!; + + [StringLength(100)] + public string GroupName { get; set; } = null!; + + public string GroupDescription { get; set; } = null!; + + [Column("GroupNodeGUID")] + public Guid? GroupNodeGuid { get; set; } + + public int GroupApproveMembers { get; set; } + + public int GroupAccess { get; set; } + + [Column("GroupCreatedByUserID")] + public int? GroupCreatedByUserId { get; set; } + + [Column("GroupApprovedByUserID")] + public int? GroupApprovedByUserId { get; set; } + + [Column("GroupAvatarID")] + public int? GroupAvatarId { get; set; } + + public bool? GroupApproved { get; set; } + + public DateTime GroupCreatedWhen { get; set; } + + public bool? GroupSendJoinLeaveNotification { get; set; } + + public bool? GroupSendWaitingForApprovalNotification { get; set; } + + public int? GroupSecurity { get; set; } + + public bool? GroupLogActivity { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarFileName { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewCommunityMember.cs b/Migration.Tool.KX12/Models/ViewCommunityMember.cs new file mode 100644 index 00000000..dd1cf1be --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewCommunityMember.cs @@ -0,0 +1,245 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewCommunityMember +{ + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [Column("UserSettingsID")] + public int? UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid? UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int? UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [Column("MemberID")] + public int? MemberId { get; set; } + + [Column("MemberGUID")] + public Guid? MemberGuid { get; set; } + + [Column("MemberUserID")] + public int? MemberUserId { get; set; } + + [Column("MemberGroupID")] + public int? MemberGroupId { get; set; } + + public DateTime? MemberJoined { get; set; } + + public DateTime? MemberApprovedWhen { get; set; } + + public DateTime? MemberRejectedWhen { get; set; } + + [Column("MemberApprovedByUserID")] + public int? MemberApprovedByUserId { get; set; } + + public string? MemberComment { get; set; } + + [Column("MemberInvitedByUserID")] + public int? MemberInvitedByUserId { get; set; } + + public int? MemberStatus { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } + + [StringLength(200)] + public string? AvatarName { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewForumsGroupForumPostJoined.cs b/Migration.Tool.KX12/Models/ViewForumsGroupForumPostJoined.cs new file mode 100644 index 00000000..6138fe3b --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewForumsGroupForumPostJoined.cs @@ -0,0 +1,227 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewForumsGroupForumPostJoined +{ + [Column("ForumID")] + public int? ForumId { get; set; } + + [Column("ForumGroupID")] + public int? ForumGroupId { get; set; } + + [StringLength(200)] + public string? ForumName { get; set; } + + [StringLength(200)] + public string? ForumDisplayName { get; set; } + + public string? ForumDescription { get; set; } + + public int? ForumOrder { get; set; } + + [Column("ForumDocumentID")] + public int? ForumDocumentId { get; set; } + + public bool? ForumOpen { get; set; } + + public bool? ForumModerated { get; set; } + + public bool? ForumDisplayEmails { get; set; } + + public bool? ForumRequireEmail { get; set; } + + public int? ForumAccess { get; set; } + + public int? ForumThreads { get; set; } + + public int? ForumPosts { get; set; } + + public DateTime? ForumLastPostTime { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserName { get; set; } + + [StringLength(200)] + public string? ForumBaseUrl { get; set; } + + public bool? ForumAllowChangeName { get; set; } + + [Column("ForumHTMLEditor")] + public bool? ForumHtmleditor { get; set; } + + [Column("ForumUseCAPTCHA")] + public bool? ForumUseCaptcha { get; set; } + + [Column("ForumGUID")] + public Guid? ForumGuid { get; set; } + + public DateTime? ForumLastModified { get; set; } + + [StringLength(200)] + public string? ForumUnsubscriptionUrl { get; set; } + + public bool? ForumIsLocked { get; set; } + + public string? ForumSettings { get; set; } + + public bool? ForumAuthorEdit { get; set; } + + public bool? ForumAuthorDelete { get; set; } + + public int? ForumType { get; set; } + + public int? ForumIsAnswerLimit { get; set; } + + public int? ForumImageMaxSideSize { get; set; } + + public DateTime? ForumLastPostTimeAbsolute { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserNameAbsolute { get; set; } + + public int? ForumPostsAbsolute { get; set; } + + public int? ForumThreadsAbsolute { get; set; } + + public int? ForumAttachmentMaxFileSize { get; set; } + + public int? ForumDiscussionActions { get; set; } + + [Column("ForumSiteID")] + public int? ForumSiteId { get; set; } + + [Column("GroupID")] + public int? GroupId { get; set; } + + [Column("GroupSiteID")] + public int? GroupSiteId { get; set; } + + [StringLength(200)] + public string? GroupName { get; set; } + + [StringLength(200)] + public string? GroupDisplayName { get; set; } + + public int? GroupOrder { get; set; } + + public string? GroupDescription { get; set; } + + [Column("GroupGUID")] + public Guid? GroupGuid { get; set; } + + public DateTime? GroupLastModified { get; set; } + + [StringLength(200)] + public string? GroupBaseUrl { get; set; } + + [StringLength(200)] + public string? GroupUnsubscriptionUrl { get; set; } + + [Column("GroupGroupID")] + public int? GroupGroupId { get; set; } + + public bool? GroupAuthorEdit { get; set; } + + public bool? GroupAuthorDelete { get; set; } + + public int? GroupType { get; set; } + + public int? GroupIsAnswerLimit { get; set; } + + public int? GroupImageMaxSideSize { get; set; } + + public bool? GroupDisplayEmails { get; set; } + + public bool? GroupRequireEmail { get; set; } + + [Column("GroupHTMLEditor")] + public bool? GroupHtmleditor { get; set; } + + [Column("GroupUseCAPTCHA")] + public bool? GroupUseCaptcha { get; set; } + + public int? GroupAttachmentMaxFileSize { get; set; } + + public int? GroupDiscussionActions { get; set; } + + public int PostId { get; set; } + + [Column("PostForumID")] + public int PostForumId { get; set; } + + [Column("PostParentID")] + public int? PostParentId { get; set; } + + [Column("PostIDPath")] + [StringLength(450)] + public string PostIdpath { get; set; } = null!; + + public int PostLevel { get; set; } + + [StringLength(450)] + public string PostSubject { get; set; } = null!; + + [Column("PostUserID")] + public int? PostUserId { get; set; } + + [StringLength(200)] + public string PostUserName { get; set; } = null!; + + [StringLength(254)] + public string? PostUserMail { get; set; } + + public string? PostText { get; set; } + + public DateTime PostTime { get; set; } + + [Column("PostApprovedByUserID")] + public int? PostApprovedByUserId { get; set; } + + public int? PostThreadPosts { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserName { get; set; } + + public DateTime? PostThreadLastPostTime { get; set; } + + public string? PostUserSignature { get; set; } + + [Column("PostGUID")] + public Guid PostGuid { get; set; } + + public DateTime PostLastModified { get; set; } + + public bool? PostApproved { get; set; } + + public bool? PostIsLocked { get; set; } + + public int? PostIsAnswer { get; set; } + + public int PostStickOrder { get; set; } + + public int? PostViews { get; set; } + + public DateTime? PostLastEdit { get; set; } + + public string? PostInfo { get; set; } + + public int? PostAttachmentCount { get; set; } + + public int? PostType { get; set; } + + public int? PostThreadPostsAbsolute { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserNameAbsolute { get; set; } + + public DateTime? PostThreadLastPostTimeAbsolute { get; set; } + + public bool? PostQuestionSolved { get; set; } + + public int? PostIsNotAnswer { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewIntegrationTaskJoined.cs b/Migration.Tool.KX12/Models/ViewIntegrationTaskJoined.cs new file mode 100644 index 00000000..99bc478c --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewIntegrationTaskJoined.cs @@ -0,0 +1,64 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewIntegrationTaskJoined +{ + [Column("SynchronizationID")] + public int? SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int? SynchronizationTaskId { get; set; } + + [Column("SynchronizationConnectorID")] + public int? SynchronizationConnectorId { get; set; } + + public DateTime? SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + public bool? SynchronizationIsRunning { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + [StringLength(450)] + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool TaskIsInbound { get; set; } + + [StringLength(50)] + public string? TaskProcessType { get; set; } + + public string TaskData { get; set; } = null!; + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(50)] + public string? TaskDataType { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewMembershipMembershipUserJoined.cs b/Migration.Tool.KX12/Models/ViewMembershipMembershipUserJoined.cs new file mode 100644 index 00000000..548546b5 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewMembershipMembershipUserJoined.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewMembershipMembershipUserJoined +{ + [StringLength(200)] + public string MembershipDisplayName { get; set; } = null!; + + [Column("MembershipID")] + public int MembershipId { get; set; } + + public DateTime? ValidTo { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [Column("MembershipSiteID")] + public int? MembershipSiteId { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewNewsletterSubscriptionsJoined.cs b/Migration.Tool.KX12/Models/ViewNewsletterSubscriptionsJoined.cs new file mode 100644 index 00000000..cd762e44 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewNewsletterSubscriptionsJoined.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewNewsletterSubscriptionsJoined +{ + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [StringLength(440)] + public string? SubscriberFullName { get; set; } + + [StringLength(254)] + public string? SubscriberEmail { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + [StringLength(100)] + public string? SubscriberType { get; set; } + + public int? SubscriberBounces { get; set; } + + [StringLength(250)] + public string NewsletterDisplayName { get; set; } = null!; + + [Column("SubscriberRelatedID")] + public int SubscriberRelatedId { get; set; } + + [Column("SubscriberNewsletterID")] + public int SubscriberNewsletterId { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Tool.KX12/Models/ViewOmAccountContactAccountJoined.cs new file mode 100644 index 00000000..074506fd --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewOmAccountContactAccountJoined.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewOmAccountContactAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewOmAccountContactContactJoined.cs b/Migration.Tool.KX12/Models/ViewOmAccountContactContactJoined.cs new file mode 100644 index 00000000..164e3112 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewOmAccountContactContactJoined.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewOmAccountContactContactJoined +{ + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewOmAccountJoined.cs b/Migration.Tool.KX12/Models/ViewOmAccountJoined.cs new file mode 100644 index 00000000..ad0a888d --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewOmAccountJoined.cs @@ -0,0 +1,101 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewOmAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [StringLength(100)] + public string? PrimaryContactFirstName { get; set; } + + [StringLength(100)] + public string? PrimaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? PrimaryContactLastName { get; set; } + + [StringLength(100)] + public string? SecondaryContactFirstName { get; set; } + + [StringLength(100)] + public string? SecondaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? SecondaryContactLastName { get; set; } + + [StringLength(200)] + public string? SubsidiaryOfName { get; set; } + + [StringLength(302)] + public string PrimaryContactFullName { get; set; } = null!; + + [StringLength(302)] + public string SecondaryContactFullName { get; set; } = null!; + + [StringLength(201)] + public string AccountFullAddress { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Tool.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs new file mode 100644 index 00000000..842673b7 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs @@ -0,0 +1,77 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewOmContactGroupMemberAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewPollAnswerCount.cs b/Migration.Tool.KX12/Models/ViewPollAnswerCount.cs new file mode 100644 index 00000000..46033186 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewPollAnswerCount.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewPollAnswerCount +{ + [Column("PollID")] + public int PollId { get; set; } + + [StringLength(200)] + public string PollCodeName { get; set; } = null!; + + [StringLength(200)] + public string PollDisplayName { get; set; } = null!; + + [StringLength(100)] + public string? PollTitle { get; set; } + + public DateTime? PollOpenFrom { get; set; } + + public DateTime? PollOpenTo { get; set; } + + public bool PollAllowMultipleAnswers { get; set; } + + [StringLength(450)] + public string PollQuestion { get; set; } = null!; + + public int PollAccess { get; set; } + + [StringLength(450)] + public string? PollResponseMessage { get; set; } + + [Column("PollGUID")] + public Guid PollGuid { get; set; } + + public DateTime PollLastModified { get; set; } + + [Column("PollGroupID")] + public int? PollGroupId { get; set; } + + [Column("PollSiteID")] + public int? PollSiteId { get; set; } + + public bool? PollLogActivity { get; set; } + + public int? AnswerCount { get; set; } +} diff --git a/Migration.Tool.KX12/Models/ViewReportingCategoryReportJoined.cs b/Migration.Tool.KX12/Models/ViewReportingCategoryReportJoined.cs new file mode 100644 index 00000000..509da1d9 --- /dev/null +++ b/Migration.Tool.KX12/Models/ViewReportingCategoryReportJoined.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX12.Models; + +[Keyless] +public class ViewReportingCategoryReportJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(200)] + public string CodeName { get; set; } = null!; + + [StringLength(440)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(651)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryReportChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + public string? ReportLayout { get; set; } + + public string? ReportParameters { get; set; } + + public int? ReportAccess { get; set; } + + [StringLength(14)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; +} diff --git a/Migration.Tool.KX12/SettingsKeys.cs b/Migration.Tool.KX12/SettingsKeys.cs new file mode 100644 index 00000000..79c945de --- /dev/null +++ b/Migration.Tool.KX12/SettingsKeys.cs @@ -0,0 +1,749 @@ +// ReSharper disable InconsistentNaming +// ReSharper disable IdentifierTypo +namespace Migration.Tool.KX12; + +public static class SettingsKeys +{ + public const string CMSABTestingEnabled = "CMSABTestingEnabled"; + public const string CMSAccessDeniedPageURL = "CMSAccessDeniedPageURL"; + public const string CMSActivityPointsForBlogCommentPost = "CMSActivityPointsForBlogCommentPost"; + public const string CMSActivityPointsForBlogPost = "CMSActivityPointsForBlogPost"; + public const string CMSActivityPointsForForumPost = "CMSActivityPointsForForumPost"; + public const string CMSActivityPointsForMessageBoardPost = "CMSActivityPointsForMessageBoardPost"; + public const string CMSActivityTrackedExtensions = "CMSActivityTrackedExtensions"; + public const string CMSAdminEmailAddress = "CMSAdminEmailAddress"; + public const string CMSAllowAttachmentTranslation = "CMSAllowAttachmentTranslation"; + public const string CMSAllowComponentsCSS = "CMSAllowComponentsCSS"; + public const string CMSAllowDynamicNewsletters = "CMSAllowDynamicNewsletters"; + public const string CMSAllowedURLCharacters = "CMSAllowedURLCharacters"; + public const string CMSAllowGlobalCategories = "CMSAllowGlobalCategories"; + public const string CMSAllowGZip = "CMSAllowGZip"; + public const string CMSAllowOnSiteEditing = "CMSAllowOnSiteEditing"; + public const string CMSAllowPermanentPreviewLink = "CMSAllowPermanentPreviewLink"; + public const string CMSAllowPreviewMode = "CMSAllowPreviewMode"; + public const string CMSAllowUrlsWithoutLanguagePrefixes = "CMSAllowUrlsWithoutLanguagePrefixes"; + public const string CMSAlternativeURLsConstraint = "CMSAlternativeURLsConstraint"; + public const string CMSAlternativeURLsErrorMessage = "CMSAlternativeURLsErrorMessage"; + public const string CMSAlternativeURLsExcludedURLs = "CMSAlternativeURLsExcludedURLs"; + public const string CMSAlternativeURLsMode = "CMSAlternativeURLsMode"; + public const string CMSAlternativeUrlUIEnabled = "CMSAlternativeUrlUIEnabled"; + public const string CMSAnalyticsEnabled = "CMSAnalyticsEnabled"; + public const string CMSAnalyticsExcludedFileExtensions = "CMSAnalyticsExcludedFileExtensions"; + public const string CMSAnalyticsExcludedIPs = "CMSAnalyticsExcludedIPs"; + public const string CMSAnalyticsExcludedURLs = "CMSAnalyticsExcludedURLs"; + public const string CMSAnalyticsExcludeSearchEngines = "CMSAnalyticsExcludeSearchEngines"; + public const string CMSAnalyticsTrackAggregatedViews = "CMSAnalyticsTrackAggregatedViews"; + public const string CMSAnalyticsTrackBrowserTypes = "CMSAnalyticsTrackBrowserTypes"; + public const string CMSAnalyticsTrackCountries = "CMSAnalyticsTrackCountries"; + public const string CMSAnalyticsTrackFileDownloads = "CMSAnalyticsTrackFileDownloads"; + public const string CMSAnalyticsTrackInvalidPages = "CMSAnalyticsTrackInvalidPages"; + public const string CMSAnalyticsTrackPageViews = "CMSAnalyticsTrackPageViews"; + public const string CMSAnalyticsTrackReferrals = "CMSAnalyticsTrackReferrals"; + public const string CMSAnalyticsTrackRegisteredUsers = "CMSAnalyticsTrackRegisteredUsers"; + public const string CMSAnalyticsTrackVisits = "CMSAnalyticsTrackVisits"; + public const string CMSAnalyticsVisitorsSmartCheck = "CMSAnalyticsVisitorsSmartCheck"; + public const string CMSApplicationHealthMonitoringInterval = "CMSApplicationHealthMonitoringInterval"; + public const string CMSApplicationID = "CMSApplicationID"; + public const string CMSApplicationSecret = "CMSApplicationSecret"; + public const string CMSApplicationState = "CMSApplicationState"; + public const string CMSArchiveEmails = "CMSArchiveEmails"; + public const string CMSAuthorizeNETAPILogin = "CMSAuthorizeNETAPILogin"; + public const string CMSAuthorizeNETTransactionKey = "CMSAuthorizeNETTransactionKey"; + public const string CMSAuthorizeNETTransactionType = "CMSAuthorizeNETTransactionType"; + public const string CMSAutocompleteEnableForLogin = "CMSAutocompleteEnableForLogin"; + public const string CMSAutomaticallySignInUser = "CMSAutomaticallySignInUser"; + public const string CMSAutoResizeImageHeight = "CMSAutoResizeImageHeight"; + public const string CMSAutoResizeImageMaxSideSize = "CMSAutoResizeImageMaxSideSize"; + public const string CMSAutoResizeImageWidth = "CMSAutoResizeImageWidth"; + public const string CMSAvatarHeight = "CMSAvatarHeight"; + public const string CMSAvatarMaxSideSize = "CMSAvatarMaxSideSize"; + public const string CMSAvatarType = "CMSAvatarType"; + public const string CMSAvatarWidth = "CMSAvatarWidth"; + public const string CMSBadWordsAction = "CMSBadWordsAction"; + public const string CMSBadWordsReplacement = "CMSBadWordsReplacement"; + public const string CMSBannedIPEnabled = "CMSBannedIPEnabled"; + public const string CMSBannedIPRedirectURL = "CMSBannedIPRedirectURL"; + public const string CMSBitlyAPIKey = "CMSBitlyAPIKey"; + public const string CMSBitlyLogin = "CMSBitlyLogin"; + public const string CMSBizFormFilesFolder = "CMSBizFormFilesFolder"; + public const string CMSBlockSubscribersGlobally = "CMSBlockSubscribersGlobally"; + public const string CMSBlogEnableOptIn = "CMSBlogEnableOptIn"; + public const string CMSBlogEnableOptInConfirmation = "CMSBlogEnableOptInConfirmation"; + public const string CMSBlogOptInApprovalPath = "CMSBlogOptInApprovalPath"; + public const string CMSBlogOptInInterval = "CMSBlogOptInInterval"; + public const string CMSBlogsUnsubscriptionUrl = "CMSBlogsUnsubscriptionUrl"; + public const string CMSBoardBaseUrl = "CMSBoardBaseUrl"; + public const string CMSBoardEnableOptIn = "CMSBoardEnableOptIn"; + public const string CMSBoardEnableOptInConfirmation = "CMSBoardEnableOptInConfirmation"; + public const string CMSBoardOptInApprovalPath = "CMSBoardOptInApprovalPath"; + public const string CMSBoardOptInInterval = "CMSBoardOptInInterval"; + public const string CMSBoardUnsubsriptionURL = "CMSBoardUnsubsriptionURL"; + public const string CMSBouncedEmailAddress = "CMSBouncedEmailAddress"; + public const string CMSBouncedEmailsLimit = "CMSBouncedEmailsLimit"; + public const string CMSCacheImages = "CMSCacheImages"; + public const string CMSCacheMinutes = "CMSCacheMinutes"; + public const string CMSCachePageInfo = "CMSCachePageInfo"; + public const string CMSCampaignNewPageLocation = "CMSCampaignNewPageLocation"; + public const string CMSCaptchaControl = "CMSCaptchaControl"; + public const string CMSChatAllowAnonymGlobally = "CMSChatAllowAnonymGlobally"; + public const string CMSChatDaysNeededToDeleteRecods = "CMSChatDaysNeededToDeleteRecods"; + public const string CMSChatDisplayAnnouncementAtFirstLoad = "CMSChatDisplayAnnouncementAtFirstLoad"; + public const string CMSChatDisplayChangeNicknameAtFirstLoad = "CMSChatDisplayChangeNicknameAtFirstLoad"; + public const string CMSChatDisplayEnterAtFirstLoad = "CMSChatDisplayEnterAtFirstLoad"; + public const string CMSChatDisplayInvitedAtFirstLoad = "CMSChatDisplayInvitedAtFirstLoad"; + public const string CMSChatDisplayKickAtFirstLoad = "CMSChatDisplayKickAtFirstLoad"; + public const string CMSChatDisplayLeaveAtFirstLoad = "CMSChatDisplayLeaveAtFirstLoad"; + public const string CMSChatDisplaySupportGreetingAtFirstLoad = "CMSChatDisplaySupportGreetingAtFirstLoad"; + public const string CMSChatEnableBBCode = "CMSChatEnableBBCode"; + public const string CMSChatEnableFloodProtection = "CMSChatEnableFloodProtection"; + public const string CMSChatEnableSmileys = "CMSChatEnableSmileys"; + public const string CMSChatEnableSoundLiveChat = "CMSChatEnableSoundLiveChat"; + public const string CMSChatEnableSoundSupportChat = "CMSChatEnableSoundSupportChat"; + public const string CMSChatErrorDeleteAllTrans = "CMSChatErrorDeleteAllTrans"; + public const string CMSChatErrorTrans = "CMSChatErrorTrans"; + public const string CMSChatFirstLoadMessagesCount = "CMSChatFirstLoadMessagesCount"; + public const string CMSChatFloodProtectionChangeNickname = "CMSChatFloodProtectionChangeNickname"; + public const string CMSChatFloodProtectionCreateRoom = "CMSChatFloodProtectionCreateRoom"; + public const string CMSChatFloodProtectionJoinRoom = "CMSChatFloodProtectionJoinRoom"; + public const string CMSChatFloodProtectionPostMessage = "CMSChatFloodProtectionPostMessage"; + public const string CMSChatForceAnonymUniqueNicknames = "CMSChatForceAnonymUniqueNicknames"; + public const string CMSChatGlobalPingInterval = "CMSChatGlobalPingInterval"; + public const string CMSChatGuestPrefix = "CMSChatGuestPrefix"; + public const string CMSChatInitiatedChatTrans = "CMSChatInitiatedChatTrans"; + public const string CMSChatKickLastingTime = "CMSChatKickLastingTime"; + public const string CMSChatMaximumMessageLength = "CMSChatMaximumMessageLength"; + public const string CMSChatNotificationTrans = "CMSChatNotificationTrans"; + public const string CMSChatOnlineUserTrans = "CMSChatOnlineUserTrans"; + public const string CMSChatRedirectURLJoin = "CMSChatRedirectURLJoin"; + public const string CMSChatRedirectURLLeave = "CMSChatRedirectURLLeave"; + public const string CMSChatRedirectURLLogin = "CMSChatRedirectURLLogin"; + public const string CMSChatRedirectURLLogout = "CMSChatRedirectURLLogout"; + public const string CMSChatResolveURLEnabled = "CMSChatResolveURLEnabled"; + public const string CMSChatRoomMessageTrans = "CMSChatRoomMessageTrans"; + public const string CMSChatRoomNameTrans = "CMSChatRoomNameTrans"; + public const string CMSChatRoomPingInterval = "CMSChatRoomPingInterval"; + public const string CMSChatRoomPopupWindow = "CMSChatRoomPopupWindow"; + public const string CMSChatRoomTrans = "CMSChatRoomTrans"; + public const string CMSChatRoomUserTrans = "CMSChatRoomUserTrans"; + public const string CMSChatSendSupportMessagesTo = "CMSChatSendSupportMessagesTo"; + public const string CMSChatSupportEnabled = "CMSChatSupportEnabled"; + public const string CMSChatSupportEngineerLogoutTimeout = "CMSChatSupportEngineerLogoutTimeout"; + public const string CMSChatSupportRequestTrans = "CMSChatSupportRequestTrans"; + public const string CMSChatSupportTakenRoomReleaseTimeout = "CMSChatSupportTakenRoomReleaseTimeout"; + public const string CMSChatUserLogoutTimeout = "CMSChatUserLogoutTimeout"; + public const string CMSChatWPDefaultGroupPagesBy = "CMSChatWPDefaultGroupPagesBy"; + public const string CMSChatWPDefaultInviteModePagingItems = "CMSChatWPDefaultInviteModePagingItems"; + public const string CMSChatWPDefaultInviteModeSearchMode = "CMSChatWPDefaultInviteModeSearchMode"; + public const string CMSChatWPDefaultPagingItems = "CMSChatWPDefaultPagingItems"; + public const string CMSChatWPDefaultSearchOnlineMaxUsers = "CMSChatWPDefaultSearchOnlineMaxUsers"; + public const string CMSChatWPDefaultShowFilterLimit = "CMSChatWPDefaultShowFilterLimit"; + public const string CMSCheapestVariantAdvertising = "CMSCheapestVariantAdvertising"; + public const string CMSCheckBadWords = "CMSCheckBadWords"; + public const string CMSCheckDocumentPermissions = "CMSCheckDocumentPermissions"; + public const string CMSCheckFilesPermissions = "CMSCheckFilesPermissions"; + public const string CMSCheckMediaFilePermissions = "CMSCheckMediaFilePermissions"; + public const string CMSCheckPagePermissions = "CMSCheckPagePermissions"; + public const string CMSCheckPublishedFiles = "CMSCheckPublishedFiles"; + public const string CMSClientCacheMinutes = "CMSClientCacheMinutes"; + public const string CMSCMActivitiesEnabled = "CMSCMActivitiesEnabled"; + public const string CMSCMAddingProductToSC = "CMSCMAddingProductToSC"; + public const string CMSCMAddingProductToWL = "CMSCMAddingProductToWL"; + public const string CMSCMBizFormSubmission = "CMSCMBizFormSubmission"; + public const string CMSCMBlogPostComments = "CMSCMBlogPostComments"; + public const string CMSCMBlogPostSubscription = "CMSCMBlogPostSubscription"; + public const string CMSCMClickthroughTracking = "CMSCMClickthroughTracking"; + public const string CMSCMContentRating = "CMSCMContentRating"; + public const string CMSCMCustomActivities = "CMSCMCustomActivities"; + public const string CMSCMCustomTableForm = "CMSCMCustomTableForm"; + public const string CMSCMEmailOpening = "CMSCMEmailOpening"; + public const string CMSCMEnableGeolocation = "CMSCMEnableGeolocation"; + public const string CMSCMEventBooking = "CMSCMEventBooking"; + public const string CMSCMExternalSearch = "CMSCMExternalSearch"; + public const string CMSCMForumPosts = "CMSCMForumPosts"; + public const string CMSCMForumPostSubscription = "CMSCMForumPostSubscription"; + public const string CMSCMGeoCity = "CMSCMGeoCity"; + public const string CMSCMGeoCountry = "CMSCMGeoCountry"; + public const string CMSCMGeoLatitude = "CMSCMGeoLatitude"; + public const string CMSCMGeoLongitude = "CMSCMGeoLongitude"; + public const string CMSCMGeoMetro = "CMSCMGeoMetro"; + public const string CMSCMGeoNewDB = "CMSCMGeoNewDB"; + public const string CMSCMGeoOrganization = "CMSCMGeoOrganization"; + public const string CMSCMGeoPostal = "CMSCMGeoPostal"; + public const string CMSCMGeoState = "CMSCMGeoState"; + public const string CMSCMGeoSuffix = "CMSCMGeoSuffix"; + public const string CMSCMLandingPage = "CMSCMLandingPage"; + public const string CMSCMMessageBoardPosts = "CMSCMMessageBoardPosts"; + public const string CMSCMMessageBoardSubscription = "CMSCMMessageBoardSubscription"; + public const string CMSCMNewsletterSubscribe = "CMSCMNewsletterSubscribe"; + public const string CMSCMNewsletterUnsubscribe = "CMSCMNewsletterUnsubscribe"; + public const string CMSCMNewsletterUnsubscribedFromAll = "CMSCMNewsletterUnsubscribedFromAll"; + public const string CMSCMPageVisits = "CMSCMPageVisits"; + public const string CMSCMPollVoting = "CMSCMPollVoting"; + public const string CMSCMPurchase = "CMSCMPurchase"; + public const string CMSCMPurchasedProduct = "CMSCMPurchasedProduct"; + public const string CMSCMRemovingProductFromSC = "CMSCMRemovingProductFromSC"; + public const string CMSCMSearch = "CMSCMSearch"; + public const string CMSCMStamp = "CMSCMStamp"; + public const string CMSCMUserLogin = "CMSCMUserLogin"; + public const string CMSCMUserRegistration = "CMSCMUserRegistration"; + public const string CMSCodeNamePrefix = "CMSCodeNamePrefix"; + public const string CMSCombineComponentsCSS = "CMSCombineComponentsCSS"; + public const string CMSCombineImagesWithDefaultCulture = "CMSCombineImagesWithDefaultCulture"; + public const string CMSCombineWithDefaultCulture = "CMSCombineWithDefaultCulture"; + public const string CMSConfirmChanges = "CMSConfirmChanges"; + public const string CMSContentImageWatermark = "CMSContentImageWatermark"; + public const string CMSContentPersonalizationEnabled = "CMSContentPersonalizationEnabled"; + public const string CMSControlElement = "CMSControlElement"; + public const string CMSConvertTablesToDivs = "CMSConvertTablesToDivs"; + public const string CMSDataVersion = "CMSDataVersion"; + public const string CMSDBSeparationStartedByServer = "CMSDBSeparationStartedByServer"; + public const string CMSDBVersion = "CMSDBVersion"; + public const string CMSDebugAllCache = "CMSDebugAllCache"; + public const string CMSDebugAllFiles = "CMSDebugAllFiles"; + public const string CMSDebugAllForEverything = "CMSDebugAllForEverything"; + public const string CMSDebugAllHandlers = "CMSDebugAllHandlers"; + public const string CMSDebugAllMacros = "CMSDebugAllMacros"; + public const string CMSDebugAllOutput = "CMSDebugAllOutput"; + public const string CMSDebugAllRequests = "CMSDebugAllRequests"; + public const string CMSDebugAllSecurity = "CMSDebugAllSecurity"; + public const string CMSDebugAllSQLQueries = "CMSDebugAllSQLQueries"; + public const string CMSDebugAllViewState = "CMSDebugAllViewState"; + public const string CMSDebugAllWebFarm = "CMSDebugAllWebFarm"; + public const string CMSDebugAnalytics = "CMSDebugAnalytics"; + public const string CMSDebugAnalyticsLive = "CMSDebugAnalyticsLive"; + public const string CMSDebugAnalyticsLogLength = "CMSDebugAnalyticsLogLength"; + public const string CMSDebugAnalyticsStack = "CMSDebugAnalyticsStack"; + public const string CMSDebugCache = "CMSDebugCache"; + public const string CMSDebugCacheLive = "CMSDebugCacheLive"; + public const string CMSDebugCacheLogLength = "CMSDebugCacheLogLength"; + public const string CMSDebugCacheStack = "CMSDebugCacheStack"; + public const string CMSDebugEverything = "CMSDebugEverything"; + public const string CMSDebugEverythingEverywhere = "CMSDebugEverythingEverywhere"; + public const string CMSDebugEverythingLive = "CMSDebugEverythingLive"; + public const string CMSDebugEverythingLogLength = "CMSDebugEverythingLogLength"; + public const string CMSDebugFiles = "CMSDebugFiles"; + public const string CMSDebugFilesLive = "CMSDebugFilesLive"; + public const string CMSDebugFilesLogLength = "CMSDebugFilesLogLength"; + public const string CMSDebugFilesStack = "CMSDebugFilesStack"; + public const string CMSDebugHandlers = "CMSDebugHandlers"; + public const string CMSDebugHandlersLive = "CMSDebugHandlersLive"; + public const string CMSDebugHandlersLogLength = "CMSDebugHandlersLogLength"; + public const string CMSDebugHandlersStack = "CMSDebugHandlersStack"; + public const string CMSDebugImportExport = "CMSDebugImportExport"; + public const string CMSDebugMacros = "CMSDebugMacros"; + public const string CMSDebugMacrosDetailed = "CMSDebugMacrosDetailed"; + public const string CMSDebugMacrosLive = "CMSDebugMacrosLive"; + public const string CMSDebugMacrosLogLength = "CMSDebugMacrosLogLength"; + public const string CMSDebugMacrosStack = "CMSDebugMacrosStack"; + public const string CMSDebugOutput = "CMSDebugOutput"; + public const string CMSDebugOutputLive = "CMSDebugOutputLive"; + public const string CMSDebugOutputLogLength = "CMSDebugOutputLogLength"; + public const string CMSDebugRequests = "CMSDebugRequests"; + public const string CMSDebugRequestsLive = "CMSDebugRequestsLive"; + public const string CMSDebugRequestsLogLength = "CMSDebugRequestsLogLength"; + public const string CMSDebugRequestsStack = "CMSDebugRequestsStack"; + public const string CMSDebugResources = "CMSDebugResources"; + public const string CMSDebugScheduler = "CMSDebugScheduler"; + public const string CMSDebugSecurity = "CMSDebugSecurity"; + public const string CMSDebugSecurityLive = "CMSDebugSecurityLive"; + public const string CMSDebugSecurityLogLength = "CMSDebugSecurityLogLength"; + public const string CMSDebugSecurityStack = "CMSDebugSecurityStack"; + public const string CMSDebugSQLConnections = "CMSDebugSQLConnections"; + public const string CMSDebugSQLQueries = "CMSDebugSQLQueries"; + public const string CMSDebugSQLQueriesLive = "CMSDebugSQLQueriesLive"; + public const string CMSDebugSQLQueriesLogLength = "CMSDebugSQLQueriesLogLength"; + public const string CMSDebugSQLQueriesStack = "CMSDebugSQLQueriesStack"; + public const string CMSDebugStackForEverything = "CMSDebugStackForEverything"; + public const string CMSDebugViewState = "CMSDebugViewState"; + public const string CMSDebugViewStateLive = "CMSDebugViewStateLive"; + public const string CMSDebugViewStateLogLength = "CMSDebugViewStateLogLength"; + public const string CMSDebugWebFarm = "CMSDebugWebFarm"; + public const string CMSDebugWebFarmLive = "CMSDebugWebFarmLive"; + public const string CMSDebugWebFarmLogLength = "CMSDebugWebFarmLogLength"; + public const string CMSDebugWebFarmStack = "CMSDebugWebFarmStack"; + public const string CMSDefaulPage = "CMSDefaulPage"; + public const string CMSDefaultAliasPath = "CMSDefaultAliasPath"; + public const string CMSDefaultControlForBoolean = "CMSDefaultControlForBoolean"; + public const string CMSDefaultControlForDateTime = "CMSDefaultControlForDateTime"; + public const string CMSDefaultControlForDecimal = "CMSDefaultControlForDecimal"; + public const string CMSDefaultControlForDocAttachments = "CMSDefaultControlForDocAttachments"; + public const string CMSDefaultControlForDocRelationships = "CMSDefaultControlForDocRelationships"; + public const string CMSDefaultControlForFile = "CMSDefaultControlForFile"; + public const string CMSDefaultControlForGUID = "CMSDefaultControlForGUID"; + public const string CMSDefaultControlForInteger = "CMSDefaultControlForInteger"; + public const string CMSDefaultControlForLongText = "CMSDefaultControlForLongText"; + public const string CMSDefaultControlForText = "CMSDefaultControlForText"; + public const string CMSDefaultCookieLevel = "CMSDefaultCookieLevel"; + public const string CMSDefaultCultureCode = "CMSDefaultCultureCode"; + public const string CMSDefaultDeletedNodePath = "CMSDefaultDeletedNodePath"; + public const string CMSDefaultProductImageUrl = "CMSDefaultProductImageUrl"; + public const string CMSDefaultReportConnectionString = "CMSDefaultReportConnectionString"; + public const string CMSDefaultUrlPathPrefix = "CMSDefaultUrlPathPrefix"; + public const string CMSDefaultUserID = "CMSDefaultUserID"; + public const string CMSDeleteInactiveContactsLastXDays = "CMSDeleteInactiveContactsLastXDays"; + public const string CMSDeleteInactiveContactsMethod = "CMSDeleteInactiveContactsMethod"; + public const string CMSDeleteNonActivatedUserAfter = "CMSDeleteNonActivatedUserAfter"; + public const string CMSDenyLoginInterval = "CMSDenyLoginInterval"; + public const string CMSDepartmentTemplatePath = "CMSDepartmentTemplatePath"; + public const string CMSDeploymentMode = "CMSDeploymentMode"; + public const string CMSDeviceProfilesEnable = "CMSDeviceProfilesEnable"; + public const string CMSDisableDebug = "CMSDisableDebug"; + public const string CMSDisplayAccountLockInformation = "CMSDisplayAccountLockInformation"; + public const string CMSDisplayArchivedIcon = "CMSDisplayArchivedIcon"; + public const string CMSDisplayCheckedOutIcon = "CMSDisplayCheckedOutIcon"; + public const string CMSDisplayLinkedIcon = "CMSDisplayLinkedIcon"; + public const string CMSDisplayNotPublishedIcon = "CMSDisplayNotPublishedIcon"; + public const string CMSDisplayNotTranslatedIcon = "CMSDisplayNotTranslatedIcon"; + public const string CMSDisplayPublishedIcon = "CMSDisplayPublishedIcon"; + public const string CMSDisplayRedirectedIcon = "CMSDisplayRedirectedIcon"; + public const string CMSDisplayVersionNotPublishedIcon = "CMSDisplayVersionNotPublishedIcon"; + public const string CMSEmailBatchSize = "CMSEmailBatchSize"; + public const string CMSEmailEncoding = "CMSEmailEncoding"; + public const string CMSEmailFormat = "CMSEmailFormat"; + public const string CMSEmailQueueEnabled = "CMSEmailQueueEnabled"; + public const string CMSEmailsEnabled = "CMSEmailsEnabled"; + public const string CMSEmailTranslationFrom = "CMSEmailTranslationFrom"; + public const string CMSEmailTranslationRecipients = "CMSEmailTranslationRecipients"; + public const string CMSEnableCI = "CMSEnableCI"; + public const string CMSEnableCodeEditSiteAdministrators = "CMSEnableCodeEditSiteAdministrators"; + public const string CMSEnableDefaultAvatars = "CMSEnableDefaultAvatars"; + public const string CMSEnableFacebookConnect = "CMSEnableFacebookConnect"; + public const string CMSEnableHealthMonitoring = "CMSEnableHealthMonitoring"; + public const string CMSEnableLinkedIn = "CMSEnableLinkedIn"; + public const string CMSEnableObjectsVersioning = "CMSEnableObjectsVersioning"; + public const string CMSEnableOnlineMarketing = "CMSEnableOnlineMarketing"; + public const string CMSEnableOpenID = "CMSEnableOpenID"; + public const string CMSEnableOutputCache = "CMSEnableOutputCache"; + public const string CMSEnablePartialCache = "CMSEnablePartialCache"; + public const string CMSEnableSiteCounters = "CMSEnableSiteCounters"; + public const string CMSEnableTranlsationRESTService = "CMSEnableTranlsationRESTService"; + public const string CMSEnableTranslations = "CMSEnableTranslations"; + public const string CMSEnableUserCounts = "CMSEnableUserCounts"; + public const string CMSEnableVersioningCMSAlternativeForm = "CMSEnableVersioningCMSAlternativeForm"; + public const string CMSEnableVersioningCMSCssStylesheet = "CMSEnableVersioningCMSCssStylesheet"; + public const string CMSEnableVersioningCMSCustomTable = "CMSEnableVersioningCMSCustomTable"; + public const string CMSEnableVersioningCMSDocumentType = "CMSEnableVersioningCMSDocumentType"; + public const string CMSEnableVersioningCMSEmailTemplate = "CMSEnableVersioningCMSEmailTemplate"; + public const string CMSEnableVersioningCMSForm = "CMSEnableVersioningCMSForm"; + public const string CMSEnableVersioningCMSLayout = "CMSEnableVersioningCMSLayout"; + public const string CMSEnableVersioningCMSPageTemplate = "CMSEnableVersioningCMSPageTemplate"; + public const string CMSEnableVersioningCMSQuery = "CMSEnableVersioningCMSQuery"; + public const string CMSEnableVersioningCMSTemplateDeviceLayout = "CMSEnableVersioningCMSTemplateDeviceLayout"; + public const string CMSEnableVersioningCMSTransformation = "CMSEnableVersioningCMSTransformation"; + public const string CMSEnableVersioningCMSUIElement = "CMSEnableVersioningCMSUIElement"; + public const string CMSEnableVersioningCMSWebPartContainer = "CMSEnableVersioningCMSWebPartContainer"; + public const string CMSEnableVersioningCMSWebPartLayout = "CMSEnableVersioningCMSWebPartLayout"; + public const string CMSEnableVersioningCMSWorkflow = "CMSEnableVersioningCMSWorkflow"; + public const string CMSEnableVersioningMAAutomationProcess = "CMSEnableVersioningMAAutomationProcess"; + public const string CMSEnableVersioningMediaFile = "CMSEnableVersioningMediaFile"; + public const string CMSEnableVersioningNewsletterEmailTemplate = "CMSEnableVersioningNewsletterEmailTemplate"; + public const string CMSEnableVersioningNewsletterEmailWidget = "CMSEnableVersioningNewsletterEmailWidget"; + public const string CMSEnableVersioningNewsletterIssue = "CMSEnableVersioningNewsletterIssue"; + public const string CMSEnableVersioningReportingReport = "CMSEnableVersioningReportingReport"; + public const string CMSEnableVersioningReportingReportGraph = "CMSEnableVersioningReportingReportGraph"; + public const string CMSEnableVersioningReportingReportTable = "CMSEnableVersioningReportingReportTable"; + public const string CMSEnableVersioningReportingReportValue = "CMSEnableVersioningReportingReportValue"; + public const string CMSEnableWebDAV = "CMSEnableWebDAV"; + public const string CMSEnableWindowsLiveID = "CMSEnableWindowsLiveID"; + public const string CMSEventManagerInvitationFrom = "CMSEventManagerInvitationFrom"; + public const string CMSEventManagerInvitationSubject = "CMSEventManagerInvitationSubject"; + public const string CMSEventManagerSenderName = "CMSEventManagerSenderName"; + public const string CMSExcludedAttributesFilterURLs = "CMSExcludedAttributesFilterURLs"; + public const string CMSExcludedFormFilterURLs = "CMSExcludedFormFilterURLs"; + public const string CMSExcludedHTML5FilterURLs = "CMSExcludedHTML5FilterURLs"; + public const string CMSExcludedJavascriptFilterURLs = "CMSExcludedJavascriptFilterURLs"; + public const string CMSExcludedLowercaseFilterURLs = "CMSExcludedLowercaseFilterURLs"; + public const string CMSExcludeDocumentsFromSearch = "CMSExcludeDocumentsFromSearch"; + public const string CMSExcludeDocumentTypesFromSearch = "CMSExcludeDocumentTypesFromSearch"; + public const string CMSExcludedResolveFilterURLs = "CMSExcludedResolveFilterURLs"; + public const string CMSExcludedSelfcloseFilterURLs = "CMSExcludedSelfcloseFilterURLs"; + public const string CMSExcludedURLs = "CMSExcludedURLs"; + public const string CMSExcludedXHTMLFilterURLs = "CMSExcludedXHTMLFilterURLs"; + public const string CMSExportLogObjectChanges = "CMSExportLogObjectChanges"; + public const string CMSFacebookApplicationSecret = "CMSFacebookApplicationSecret"; + public const string CMSFacebookConnectApiKey = "CMSFacebookConnectApiKey"; + public const string CMSFacebookMapUserProfile = "CMSFacebookMapUserProfile"; + public const string CMSFacebookRoles = "CMSFacebookRoles"; + public const string CMSFacebookUserMapping = "CMSFacebookUserMapping"; + public const string CMSFaviconPath = "CMSFaviconPath"; + public const string CMSFilesFolder = "CMSFilesFolder"; + public const string CMSFilesFriendlyURLExtension = "CMSFilesFriendlyURLExtension"; + public const string CMSFilesLocationType = "CMSFilesLocationType"; + public const string CMSFileSystemOutputCacheMinutes = "CMSFileSystemOutputCacheMinutes"; + public const string CMSFloodInterval = "CMSFloodInterval"; + public const string CMSFloodProtectionEnabled = "CMSFloodProtectionEnabled"; + public const string CMSForbiddenCharactersReplacement = "CMSForbiddenCharactersReplacement"; + public const string CMSForbiddenURLCharacters = "CMSForbiddenURLCharacters"; + public const string CMSForumAttachmentExtensions = "CMSForumAttachmentExtensions"; + public const string CMSForumBaseUrl = "CMSForumBaseUrl"; + public const string CMSForumEnableOptIn = "CMSForumEnableOptIn"; + public const string CMSForumEnableOptInConfirmation = "CMSForumEnableOptInConfirmation"; + public const string CMSForumMaxPostNode = "CMSForumMaxPostNode"; + public const string CMSForumOptInApprovalPath = "CMSForumOptInApprovalPath"; + public const string CMSForumOptInInterval = "CMSForumOptInInterval"; + public const string CMSForumUnsubscriptionUrl = "CMSForumUnsubscriptionUrl"; + public const string CMSFriendlyURLExtension = "CMSFriendlyURLExtension"; + public const string CMSGenerateNewsletters = "CMSGenerateNewsletters"; + public const string CMSGenerateThumbnails = "CMSGenerateThumbnails"; + public const string CMSGoogleSitemapURL = "CMSGoogleSitemapURL"; + public const string CMSGoogleTranslateAPIKey = "CMSGoogleTranslateAPIKey"; + public const string CMSGravatarDefaultImage = "CMSGravatarDefaultImage"; + public const string CMSGravatarRating = "CMSGravatarRating"; + public const string CMSGroupAvatarHeight = "CMSGroupAvatarHeight"; + public const string CMSGroupAvatarMaxSideSize = "CMSGroupAvatarMaxSideSize"; + public const string CMSGroupAvatarWidth = "CMSGroupAvatarWidth"; + public const string CMSGroupManagementPath = "CMSGroupManagementPath"; + public const string CMSGroupProfilePath = "CMSGroupProfilePath"; + public const string CMSGroupsSecurityAccessPath = "CMSGroupsSecurityAccessPath"; + public const string CMSGroupTemplatePath = "CMSGroupTemplatePath"; + public const string CMSHideUnavailableUserInterface = "CMSHideUnavailableUserInterface"; + public const string CMSHotfixDataVersion = "CMSHotfixDataVersion"; + public const string CMSHotfixProcedureInProgress = "CMSHotfixProcedureInProgress"; + public const string CMSHotfixVersion = "CMSHotfixVersion"; + public const string CMSImageWatermark = "CMSImageWatermark"; + public const string CMSImageWatermarkPosition = "CMSImageWatermarkPosition"; + public const string CMSIncludeTaxInPrices = "CMSIncludeTaxInPrices"; + public const string CMSIndentOutputHtml = "CMSIndentOutputHtml"; + public const string CMSIntegrationEnabled = "CMSIntegrationEnabled"; + public const string CMSIntegrationLogExternal = "CMSIntegrationLogExternal"; + public const string CMSIntegrationLogInternal = "CMSIntegrationLogInternal"; + public const string CMSIntegrationProcessExternal = "CMSIntegrationProcessExternal"; + public const string CMSIntegrationProcessInternal = "CMSIntegrationProcessInternal"; + public const string CMSInvitationAcceptationPath = "CMSInvitationAcceptationPath"; + public const string CMSInvitationValidity = "CMSInvitationValidity"; + public const string CMSKeepChangedDocumentAccesible = "CMSKeepChangedDocumentAccesible"; + public const string CMSKeepNewCheckedOut = "CMSKeepNewCheckedOut"; + public const string CMSLayoutMappingEnable = "CMSLayoutMappingEnable"; + public const string CMSLinkedInAccessToken = "CMSLinkedInAccessToken"; + public const string CMSLinkedInApiKey = "CMSLinkedInApiKey"; + public const string CMSLinkedInApplicationSecret = "CMSLinkedInApplicationSecret"; + public const string CMSLinkedInRoles = "CMSLinkedInRoles"; + public const string CMSLinkedInSignInPermissionScope = "CMSLinkedInSignInPermissionScope"; + public const string CMSLiveIDRequiredUserDataPage = "CMSLiveIDRequiredUserDataPage"; + public const string CMSLiveIDRoles = "CMSLiveIDRoles"; + public const string CMSLogAnalytics = "CMSLogAnalytics"; + public const string CMSLogCache = "CMSLogCache"; + public const string CMSLogEverythingToFile = "CMSLogEverythingToFile"; + public const string CMSLogFiles = "CMSLogFiles"; + public const string CMSLogHandlers = "CMSLogHandlers"; + public const string CMSLogMacros = "CMSLogMacros"; + public const string CMSLogMetadata = "CMSLogMetadata"; + public const string CMSLogOutput = "CMSLogOutput"; + public const string CMSLogPageNotFoundException = "CMSLogPageNotFoundException"; + public const string CMSLogRequests = "CMSLogRequests"; + public const string CMSLogSecurity = "CMSLogSecurity"; + public const string CMSLogSize = "CMSLogSize"; + public const string CMSLogSQLQueries = "CMSLogSQLQueries"; + public const string CMSLogToDatabase = "CMSLogToDatabase"; + public const string CMSLogToFileSystem = "CMSLogToFileSystem"; + public const string CMSLogToTrace = "CMSLogToTrace"; + public const string CMSLogViewState = "CMSLogViewState"; + public const string CMSLogWebFarm = "CMSLogWebFarm"; + public const string CMSManualTranslationDeleteSuccessfulSubmissions = "CMSManualTranslationDeleteSuccessfulSubmissions"; + public const string CMSManualTranslationExportFolder = "CMSManualTranslationExportFolder"; + public const string CMSManualTranslationImportFolder = "CMSManualTranslationImportFolder"; + public const string CMSMarkShoppingCartAsAbandonedPeriod = "CMSMarkShoppingCartAsAbandonedPeriod"; + public const string CMSMaxCacheFileSize = "CMSMaxCacheFileSize"; + public const string CMSMaximumInvalidLogonAttempts = "CMSMaximumInvalidLogonAttempts"; + public const string CMSMaxTreeNodes = "CMSMaxTreeNodes"; + public const string CMSMaxUITreeNodes = "CMSMaxUITreeNodes"; + public const string CMSMediaFileAllowedExtensions = "CMSMediaFileAllowedExtensions"; + public const string CMSMediaFileHiddenFolder = "CMSMediaFileHiddenFolder"; + public const string CMSMediaFilePreviewSuffix = "CMSMediaFilePreviewSuffix"; + public const string CMSMediaImageWatermark = "CMSMediaImageWatermark"; + public const string CMSMediaLibrariesFolder = "CMSMediaLibrariesFolder"; + public const string CMSMediaLibraryMaxSubFolders = "CMSMediaLibraryMaxSubFolders"; + public const string CMSMediaUsePermanentURLs = "CMSMediaUsePermanentURLs"; + public const string CMSMemberManagementPath = "CMSMemberManagementPath"; + public const string CMSMemberProfilePath = "CMSMemberProfilePath"; + public const string CMSMembershipReminder = "CMSMembershipReminder"; + public const string CMSMetaImageWatermark = "CMSMetaImageWatermark"; + public const string CMSMFDisplayInitToken = "CMSMFDisplayInitToken"; + public const string CMSMFEnabled = "CMSMFEnabled"; + public const string CMSMFRequired = "CMSMFRequired"; + public const string CMSMinWatermarkImageHeight = "CMSMinWatermarkImageHeight"; + public const string CMSMinWatermarkImageWidth = "CMSMinWatermarkImageWidth"; + public const string CMSModuleUsageTrackingEnabled = "CMSModuleUsageTrackingEnabled"; + public const string CMSModuleUsageTrackingIdentity = "CMSModuleUsageTrackingIdentity"; + public const string CMSMonitorBouncedEmails = "CMSMonitorBouncedEmails"; + public const string CMSMoveViewStateToEnd = "CMSMoveViewStateToEnd"; + public const string CMSMSTranslatorTextAPISubscriptionKey = "CMSMSTranslatorTextAPISubscriptionKey"; + public const string CMSMVTEnabled = "CMSMVTEnabled"; + public const string CMSMyAccountURL = "CMSMyAccountURL"; + public const string CMSNewDocumentOrder = "CMSNewDocumentOrder"; + public const string CMSNewsletterUnsubscriptionURL = "CMSNewsletterUnsubscriptionURL"; + public const string CMSNewsletterUseExternalService = "CMSNewsletterUseExternalService"; + public const string CMSNoreplyEmailAddress = "CMSNoreplyEmailAddress"; + public const string CMSObjectVersionHistoryLength = "CMSObjectVersionHistoryLength"; + public const string CMSObjectVersionHistoryMajorVersionsLength = "CMSObjectVersionHistoryMajorVersionsLength"; + public const string CMSObjectVersionHistoryPromoteToMajorTimeInterval = "CMSObjectVersionHistoryPromoteToMajorTimeInterval"; + public const string CMSObjectVersionHistoryUseLastVersionInterval = "CMSObjectVersionHistoryUseLastVersionInterval"; + public const string CMSOnSiteEditButton = "CMSOnSiteEditButton"; + public const string CMSOpenIDRoles = "CMSOpenIDRoles"; + public const string CMSOptInApprovalURL = "CMSOptInApprovalURL"; + public const string CMSOptInInterval = "CMSOptInInterval"; + public const string CMSOutputCacheItems = "CMSOutputCacheItems"; + public const string CMSPageDescriptionPrefix = "CMSPageDescriptionPrefix"; + public const string CMSPageKeyWordsPrefix = "CMSPageKeyWordsPrefix"; + public const string CMSPageNotFoundForNonPublished = "CMSPageNotFoundForNonPublished"; + public const string CMSPageNotFoundUrl = "CMSPageNotFoundUrl"; + public const string CMSPageTitleFormat = "CMSPageTitleFormat"; + public const string CMSPageTitlePrefix = "CMSPageTitlePrefix"; + public const string CMSPartialCacheItems = "CMSPartialCacheItems"; + public const string CMSPasswordExpiration = "CMSPasswordExpiration"; + public const string CMSPasswordExpirationBehaviour = "CMSPasswordExpirationBehaviour"; + public const string CMSPasswordExpirationEmail = "CMSPasswordExpirationEmail"; + public const string CMSPasswordExpirationPeriod = "CMSPasswordExpirationPeriod"; + public const string CMSPasswordExpirationWarningPeriod = "CMSPasswordExpirationWarningPeriod"; + public const string CMSPasswordFormat = "CMSPasswordFormat"; + public const string CMSPaypalCancelReturnUrl = "CMSPaypalCancelReturnUrl"; + public const string CMSPayPalCredentialsAccountType = "CMSPayPalCredentialsAccountType"; + public const string CMSPayPalCredentialsClientId = "CMSPayPalCredentialsClientId"; + public const string CMSPayPalCredentialsClientSecret = "CMSPayPalCredentialsClientSecret"; + public const string CMSPayPalReturnUrl = "CMSPayPalReturnUrl"; + public const string CMSPayPalTransactionType = "CMSPayPalTransactionType"; + public const string CMSPersonalizeUserInterface = "CMSPersonalizeUserInterface"; + public const string CMSPolicyForcePolicyOnLogon = "CMSPolicyForcePolicyOnLogon"; + public const string CMSPolicyMinimalLength = "CMSPolicyMinimalLength"; + public const string CMSPolicyNumberOfNonAlphaNumChars = "CMSPolicyNumberOfNonAlphaNumChars"; + public const string CMSPolicyRegularExpression = "CMSPolicyRegularExpression"; + public const string CMSPolicyViolationMessage = "CMSPolicyViolationMessage"; + public const string CMSPollsAllowGlobal = "CMSPollsAllowGlobal"; + public const string CMSPOP3AuthenticationMethod = "CMSPOP3AuthenticationMethod"; + public const string CMSPOP3Password = "CMSPOP3Password"; + public const string CMSPOP3ServerName = "CMSPOP3ServerName"; + public const string CMSPOP3ServerPort = "CMSPOP3ServerPort"; + public const string CMSPOP3UserName = "CMSPOP3UserName"; + public const string CMSPOP3UseSSL = "CMSPOP3UseSSL"; + public const string CMSPriceRounding = "CMSPriceRounding"; + public const string CMSProcessDomainPrefix = "CMSProcessDomainPrefix"; + public const string CMSReCaptchaPrivateKey = "CMSReCaptchaPrivateKey"; + public const string CMSReCaptchaPublicKey = "CMSReCaptchaPublicKey"; + public const string CMSRedirectAliasesToMainURL = "CMSRedirectAliasesToMainURL"; + public const string CMSRedirectFilesToDisk = "CMSRedirectFilesToDisk"; + public const string CMSRedirectInvalidCasePages = "CMSRedirectInvalidCasePages"; + public const string CMSRedirectToMainExtension = "CMSRedirectToMainExtension"; + public const string CMSRegistrationAdministratorApproval = "CMSRegistrationAdministratorApproval"; + public const string CMSRegistrationApprovalPath = "CMSRegistrationApprovalPath"; + public const string CMSRegistrationEmailConfirmation = "CMSRegistrationEmailConfirmation"; + public const string CMSRememberUniGridState = "CMSRememberUniGridState"; + public const string CMSRequiredLinkedInPage = "CMSRequiredLinkedInPage"; + public const string CMSRequiredOpenIDPage = "CMSRequiredOpenIDPage"; + public const string CMSReservedUserNames = "CMSReservedUserNames"; + public const string CMSResetPasswordInterval = "CMSResetPasswordInterval"; + public const string CMSResetPasswordURL = "CMSResetPasswordURL"; + public const string CMSResizeImagesToDevice = "CMSResizeImagesToDevice"; + public const string CMSResolveMacrosInCSS = "CMSResolveMacrosInCSS"; + public const string CMSResourceCompressionEnabled = "CMSResourceCompressionEnabled"; + public const string CMSRESTAllowedDocTypes = "CMSRESTAllowedDocTypes"; + public const string CMSRESTAllowedObjectTypes = "CMSRESTAllowedObjectTypes"; + public const string CMSRESTAllowSensitiveFields = "CMSRESTAllowSensitiveFields"; + public const string CMSRESTDefaultEncoding = "CMSRESTDefaultEncoding"; + public const string CMSRESTDocumentsReadOnly = "CMSRESTDocumentsReadOnly"; + public const string CMSRESTDocumentsSecurityCheck = "CMSRESTDocumentsSecurityCheck"; + public const string CMSRESTGenerateHash = "CMSRESTGenerateHash"; + public const string CMSRESTObjectsReadOnly = "CMSRESTObjectsReadOnly"; + public const string CMSRestoreObjects = "CMSRestoreObjects"; + public const string CMSRESTServiceEnabled = "CMSRESTServiceEnabled"; + public const string CMSRESTServiceTypeEnabled = "CMSRESTServiceTypeEnabled"; + public const string CMSRevalidateClientCache = "CMSRevalidateClientCache"; + public const string CMSRobotsPath = "CMSRobotsPath"; + public const string CMSSalesForceCredentials = "CMSSalesForceCredentials"; + public const string CMSSalesForceLeadReplicationBatchSize = "CMSSalesForceLeadReplicationBatchSize"; + public const string CMSSalesForceLeadReplicationDefaultCompanyName = "CMSSalesForceLeadReplicationDefaultCompanyName"; + public const string CMSSalesForceLeadReplicationEnabled = "CMSSalesForceLeadReplicationEnabled"; + public const string CMSSalesForceLeadReplicationLeadDescription = "CMSSalesForceLeadReplicationLeadDescription"; + public const string CMSSalesForceLeadReplicationMapping = "CMSSalesForceLeadReplicationMapping"; + public const string CMSSalesForceLeadReplicationMappingDateTime = "CMSSalesForceLeadReplicationMappingDateTime"; + public const string CMSSalesForceLeadReplicationMinScoreValue = "CMSSalesForceLeadReplicationMinScoreValue"; + public const string CMSSalesForceLeadReplicationScoreID = "CMSSalesForceLeadReplicationScoreID"; + public const string CMSSalesForceLeadReplicationUpdateEnabled = "CMSSalesForceLeadReplicationUpdateEnabled"; + public const string CMSSchedulerInterval = "CMSSchedulerInterval"; + public const string CMSSchedulerServiceInterval = "CMSSchedulerServiceInterval"; + public const string CMSSchedulerTasksEnabled = "CMSSchedulerTasksEnabled"; + public const string CMSSchedulerUseExternalService = "CMSSchedulerUseExternalService"; + public const string CMSScreenLockEnabled = "CMSScreenLockEnabled"; + public const string CMSScreenLockInterval = "CMSScreenLockInterval"; + public const string CMSScreenLockWarningInterval = "CMSScreenLockWarningInterval"; + public const string CMSScriptMinificationEnabled = "CMSScriptMinificationEnabled"; + public const string CMSSearchAllowedFileTypes = "CMSSearchAllowedFileTypes"; + public const string CMSSearchIndexingEnabled = "CMSSearchIndexingEnabled"; + public const string CMSSecuredAreasLogonPage = "CMSSecuredAreasLogonPage"; + public const string CMSSendAccountUnlockEmail = "CMSSendAccountUnlockEmail"; + public const string CMSSendBlogEmailsFrom = "CMSSendBlogEmailsFrom"; + public const string CMSSendBoardEmailsFrom = "CMSSendBoardEmailsFrom"; + public const string CMSSendEmailNotificationsFrom = "CMSSendEmailNotificationsFrom"; + public const string CMSSendErrorNotificationTo = "CMSSendErrorNotificationTo"; + public const string CMSSendForumEmailsFrom = "CMSSendForumEmailsFrom"; + public const string CMSSendPasswordEmailsFrom = "CMSSendPasswordEmailsFrom"; + public const string CMSSendPasswordResetConfirmation = "CMSSendPasswordResetConfirmation"; + public const string CMSSendWorkflowEmails = "CMSSendWorkflowEmails"; + public const string CMSSendWorkflowEmailsFrom = "CMSSendWorkflowEmailsFrom"; + public const string CMSServerTimeZone = "CMSServerTimeZone"; + public const string CMSServiceHealthMonitoringInterval = "CMSServiceHealthMonitoringInterval"; + public const string CMSSessionManagerSchedulerInterval = "CMSSessionManagerSchedulerInterval"; + public const string CMSSessionUseDBRepository = "CMSSessionUseDBRepository"; + public const string CMSSharePointCache = "CMSSharePointCache"; + public const string CMSSharePointCacheSizeLimit = "CMSSharePointCacheSizeLimit"; + public const string CMSShoppingCartExpirationPeriod = "CMSShoppingCartExpirationPeriod"; + public const string CMSShoppingCartURL = "CMSShoppingCartURL"; + public const string CMSSitemapPath = "CMSSitemapPath"; + public const string CMSSiteSharedAccounts = "CMSSiteSharedAccounts"; + public const string CMSSiteTimeZone = "CMSSiteTimeZone"; + public const string CMSSMTPServer = "CMSSMTPServer"; + public const string CMSSMTPServerPassword = "CMSSMTPServerPassword"; + public const string CMSSMTPServerTip = "CMSSMTPServerTip"; + public const string CMSSMTPServerUser = "CMSSMTPServerUser"; + public const string CMSSocialMarketingURLShorteningFacebook = "CMSSocialMarketingURLShorteningFacebook"; + public const string CMSSocialMarketingURLShorteningLinkedIn = "CMSSocialMarketingURLShorteningLinkedIn"; + public const string CMSSocialMarketingURLShorteningTwitter = "CMSSocialMarketingURLShorteningTwitter"; + public const string CMSStagingLogChanges = "CMSStagingLogChanges"; + public const string CMSStagingLogDataChanges = "CMSStagingLogDataChanges"; + public const string CMSStagingLogObjectChanges = "CMSStagingLogObjectChanges"; + public const string CMSStagingLogStagingChanges = "CMSStagingLogStagingChanges"; + public const string CMSStagingServiceAuthentication = "CMSStagingServiceAuthentication"; + public const string CMSStagingServiceEnabled = "CMSStagingServiceEnabled"; + public const string CMSStagingServicePassword = "CMSStagingServicePassword"; + public const string CMSStagingServiceUsername = "CMSStagingServiceUsername"; + public const string CMSStagingServiceX509ClientBase64KeyId = "CMSStagingServiceX509ClientBase64KeyId"; + public const string CMSStagingServiceX509ServerBase64KeyId = "CMSStagingServiceX509ServerBase64KeyId"; + public const string CMSStoreAddToShoppingCartConversionName = "CMSStoreAddToShoppingCartConversionName"; + public const string CMSStoreAddToShoppingCartConversionValue = "CMSStoreAddToShoppingCartConversionValue"; + public const string CMSStoreAllowAnonymousCustomers = "CMSStoreAllowAnonymousCustomers"; + public const string CMSStoreAllowGlobalDepartments = "CMSStoreAllowGlobalDepartments"; + public const string CMSStoreAllowGlobalManufacturers = "CMSStoreAllowGlobalManufacturers"; + public const string CMSStoreAllowGlobalPaymentMethods = "CMSStoreAllowGlobalPaymentMethods"; + public const string CMSStoreAllowGlobalProductOptions = "CMSStoreAllowGlobalProductOptions"; + public const string CMSStoreAllowGlobalProducts = "CMSStoreAllowGlobalProducts"; + public const string CMSStoreAllowGlobalSuppliers = "CMSStoreAllowGlobalSuppliers"; + public const string CMSStoreAllowProductsWithoutDocuments = "CMSStoreAllowProductsWithoutDocuments"; + public const string CMSStoreAltFormLayoutsInFS = "CMSStoreAltFormLayoutsInFS"; + public const string CMSStoreApplyTaxesBasedOn = "CMSStoreApplyTaxesBasedOn"; + public const string CMSStoreAutoRegisterCustomer = "CMSStoreAutoRegisterCustomer"; + public const string CMSStoreAutoRegistrationEmailTemplate = "CMSStoreAutoRegistrationEmailTemplate"; + public const string CMSStoreCheckoutProcess = "CMSStoreCheckoutProcess"; + public const string CMSStoreCSSStylesheetsInFS = "CMSStoreCSSStylesheetsInFS"; + public const string CMSStoreDefaultCountryName = "CMSStoreDefaultCountryName"; + public const string CMSStoreDisplayProductsInSectionsTree = "CMSStoreDisplayProductsInSectionsTree"; + public const string CMSStoreEProductsReminder = "CMSStoreEProductsReminder"; + public const string CMSStoreFormLayoutsInFS = "CMSStoreFormLayoutsInFS"; + public const string CMSStoreInvoiceNumberPattern = "CMSStoreInvoiceNumberPattern"; + public const string CMSStoreInvoiceTemplate = "CMSStoreInvoiceTemplate"; + public const string CMSStoreLayoutsInFS = "CMSStoreLayoutsInFS"; + public const string CMSStoreMassUnit = "CMSStoreMassUnit"; + public const string CMSStoreNewProductStatus = "CMSStoreNewProductStatus"; + public const string CMSStoreOrderConversionName = "CMSStoreOrderConversionName"; + public const string CMSStoreOrderConversionValue = "CMSStoreOrderConversionValue"; + public const string CMSStorePageTemplatesInFS = "CMSStorePageTemplatesInFS"; + public const string CMSStoreProductsAreNewFor = "CMSStoreProductsAreNewFor"; + public const string CMSStoreProductsStartingPath = "CMSStoreProductsStartingPath"; + public const string CMSStoreProductsTree = "CMSStoreProductsTree"; + public const string CMSStoreRedirectToShoppingCart = "CMSStoreRedirectToShoppingCart"; + public const string CMSStoreRegistrationConversionName = "CMSStoreRegistrationConversionName"; + public const string CMSStoreRegistrationConversionValue = "CMSStoreRegistrationConversionValue"; + public const string CMSStoreRelatedProductsRelationshipName = "CMSStoreRelatedProductsRelationshipName"; + public const string CMSStoreRequireCompanyInfo = "CMSStoreRequireCompanyInfo"; + public const string CMSStoreSendEmailsFrom = "CMSStoreSendEmailsFrom"; + public const string CMSStoreSendEmailsTo = "CMSStoreSendEmailsTo"; + public const string CMSStoreSendOrderNotification = "CMSStoreSendOrderNotification"; + public const string CMSStoreSendPaymentNotification = "CMSStoreSendPaymentNotification"; + public const string CMSStoreShowOrganizationID = "CMSStoreShowOrganizationID"; + public const string CMSStoreShowTaxRegistrationID = "CMSStoreShowTaxRegistrationID"; + public const string CMSStoreTransformationsInFS = "CMSStoreTransformationsInFS"; + public const string CMSStoreUseCustomerCultureForEmails = "CMSStoreUseCustomerCultureForEmails"; + public const string CMSStoreUseExtraCompanyAddress = "CMSStoreUseExtraCompanyAddress"; + public const string CMSStoreUseGlobalCredit = "CMSStoreUseGlobalCredit"; + public const string CMSStoreUseGlobalCurrencies = "CMSStoreUseGlobalCurrencies"; + public const string CMSStoreUseGlobalExchangeRates = "CMSStoreUseGlobalExchangeRates"; + public const string CMSStoreUseGlobalInternalStatus = "CMSStoreUseGlobalInternalStatus"; + public const string CMSStoreUseGlobalInvoice = "CMSStoreUseGlobalInvoice"; + public const string CMSStoreUseGlobalOrderStatus = "CMSStoreUseGlobalOrderStatus"; + public const string CMSStoreUseGlobalPublicStatus = "CMSStoreUseGlobalPublicStatus"; + public const string CMSStoreUseGlobalTaxClasses = "CMSStoreUseGlobalTaxClasses"; + public const string CMSStoreWebpartContainersInFS = "CMSStoreWebpartContainersInFS"; + public const string CMSStoreWebPartLayoutsInFS = "CMSStoreWebPartLayoutsInFS"; + public const string CMSStoreWeightFormattingString = "CMSStoreWeightFormattingString"; + public const string CMSStrandsAPIID = "CMSStrandsAPIID"; + public const string CMSStrandsAutomaticCatalogUploadEnabled = "CMSStrandsAutomaticCatalogUploadEnabled"; + public const string CMSStrandsAutomaticUploadFrequency = "CMSStrandsAutomaticUploadFrequency"; + public const string CMSStrandsCatalogFeedPassword = "CMSStrandsCatalogFeedPassword"; + public const string CMSStrandsCatalogFeedUsername = "CMSStrandsCatalogFeedUsername"; + public const string CMSStrandsCatalogTransformation = "CMSStrandsCatalogTransformation"; + public const string CMSStrandsCatalogWhereCondition = "CMSStrandsCatalogWhereCondition"; + public const string CMSStrandsDocumentTypes = "CMSStrandsDocumentTypes"; + public const string CMSStrandsPath = "CMSStrandsPath"; + public const string CMSStrandsValidationToken = "CMSStrandsValidationToken"; + public const string CMSStylesheetMinificationEnabled = "CMSStylesheetMinificationEnabled"; + public const string CMSTimeZonesEnable = "CMSTimeZonesEnable"; + public const string CMSTrackAverageTimeOnPage = "CMSTrackAverageTimeOnPage"; + public const string CMSTrackExitPages = "CMSTrackExitPages"; + public const string CMSTrackLandingPages = "CMSTrackLandingPages"; + public const string CMSTrackMobileDevices = "CMSTrackMobileDevices"; + public const string CMSTrackOnSiteKeywords = "CMSTrackOnSiteKeywords"; + public const string CMSTrackReferringSitesDirect = "CMSTrackReferringSitesDirect"; + public const string CMSTrackReferringSitesLocal = "CMSTrackReferringSitesLocal"; + public const string CMSTrackReferringSitesReferring = "CMSTrackReferringSitesReferring"; + public const string CMSTrackSearchCrawlers = "CMSTrackSearchCrawlers"; + public const string CMSTrackSearchEngines = "CMSTrackSearchEngines"; + public const string CMSTrackSearchKeywords = "CMSTrackSearchKeywords"; + public const string CMSTranslateFileTypes = "CMSTranslateFileTypes"; + public const string CMSTranslateWebpartProperties = "CMSTranslateWebpartProperties"; + public const string CMSTranslationsAutoImport = "CMSTranslationsAutoImport"; + public const string CMSTranslationsComPassword = "CMSTranslationsComPassword"; + public const string CMSTranslationsComProjectCode = "CMSTranslationsComProjectCode"; + public const string CMSTranslationsComURL = "CMSTranslationsComURL"; + public const string CMSTranslationsComUserName = "CMSTranslationsComUserName"; + public const string CMSTranslationsEncoding = "CMSTranslationsEncoding"; + public const string CMSTranslationsLastStatusCheck = "CMSTranslationsLastStatusCheck"; + public const string CMSUpdateDocumentAlias = "CMSUpdateDocumentAlias"; + public const string CMSUploadExtensions = "CMSUploadExtensions"; + public const string CMSUseAutomaticVersionNumbering = "CMSUseAutomaticVersionNumbering"; + public const string CMSUseBizFormsSiteFolder = "CMSUseBizFormsSiteFolder"; + public const string CMSUseCheckinCheckout = "CMSUseCheckinCheckout"; + public const string CMSUseDomainForCulture = "CMSUseDomainForCulture"; + public const string CMSUseEventLogListener = "CMSUseEventLogListener"; + public const string CMSUseExternalService = "CMSUseExternalService"; + public const string CMSUseFilesSiteFolder = "CMSUseFilesSiteFolder"; + public const string CMSUseLangPrefixForUrls = "CMSUseLangPrefixForUrls"; + public const string CMSUseMediaLibrariesSiteFolder = "CMSUseMediaLibrariesSiteFolder"; + public const string CMSUseNamePathForUrlPath = "CMSUseNamePathForUrlPath"; + public const string CMSUseNoFollowForUsersLinks = "CMSUseNoFollowForUsersLinks"; + public const string CMSUseObjectCheckinCheckout = "CMSUseObjectCheckinCheckout"; + public const string CMSUseParentGroupIDForNewDocuments = "CMSUseParentGroupIDForNewDocuments"; + public const string CMSUsePasswordPolicy = "CMSUsePasswordPolicy"; + public const string CMSUsePermanentRedirect = "CMSUsePermanentRedirect"; + public const string CMSUsePermanentURLs = "CMSUsePermanentURLs"; + public const string CMSUserAccountUnlockPath = "CMSUserAccountUnlockPath"; + public const string CMSUserUniqueEmail = "CMSUserUniqueEmail"; + public const string CMSUseSessionManagement = "CMSUseSessionManagement"; + public const string CMSUseSitePrefixForUserName = "CMSUseSitePrefixForUserName"; + public const string CMSUseSSL = "CMSUseSSL"; + public const string CMSUseSSLForAdministrationInterface = "CMSUseSSLForAdministrationInterface"; + public const string CMSUseURLsWithTrailingSlash = "CMSUseURLsWithTrailingSlash"; + public const string CMSVersionHistoryLength = "CMSVersionHistoryLength"; + public const string CMSVersioningExtensionsMediaFile = "CMSVersioningExtensionsMediaFile"; + public const string CMSVisitorStatusIdle = "CMSVisitorStatusIdle"; + public const string CMSWebAnalyticsUseJavascriptLogging = "CMSWebAnalyticsUseJavascriptLogging"; + public const string CMSWebDAVExtensions = "CMSWebDAVExtensions"; + public const string CMSWebFarmMaxFileSize = "CMSWebFarmMaxFileSize"; + public const string CMSWebFarmMode = "CMSWebFarmMode"; + public const string CMSWebFarmSynchronizeAttachments = "CMSWebFarmSynchronizeAttachments"; + public const string CMSWebFarmSynchronizeAvatars = "CMSWebFarmSynchronizeAvatars"; + public const string CMSWebFarmSynchronizeBizFormFiles = "CMSWebFarmSynchronizeBizFormFiles"; + public const string CMSWebFarmSynchronizeCache = "CMSWebFarmSynchronizeCache"; + public const string CMSWebFarmSynchronizeDeleteFiles = "CMSWebFarmSynchronizeDeleteFiles"; + public const string CMSWebFarmSynchronizeFiles = "CMSWebFarmSynchronizeFiles"; + public const string CMSWebFarmSynchronizeForumAttachments = "CMSWebFarmSynchronizeForumAttachments"; + public const string CMSWebFarmSynchronizeMediaFiles = "CMSWebFarmSynchronizeMediaFiles"; + public const string CMSWebFarmSynchronizeMetaFiles = "CMSWebFarmSynchronizeMetaFiles"; + public const string CMSWebFarmSynchronizePhysicalFiles = "CMSWebFarmSynchronizePhysicalFiles"; + public const string CMSWebFarmSynchronizeSmartSearch = "CMSWebFarmSynchronizeSmartSearch"; + public const string CMSWebFarmSyncInterval = "CMSWebFarmSyncInterval"; + public const string CMSWIFAllowedAudienceUris = "CMSWIFAllowedAudienceUris"; + public const string CMSWIFCertificateValidator = "CMSWIFCertificateValidator"; + public const string CMSWIFEnabled = "CMSWIFEnabled"; + public const string CMSWIFIdentityProviderURL = "CMSWIFIdentityProviderURL"; + public const string CMSWIFRealm = "CMSWIFRealm"; + public const string CMSWIFTrustedCertificateThumbprint = "CMSWIFTrustedCertificateThumbprint"; + public const string CMSWishlistURL = "CMSWishlistURL"; +} diff --git a/Migration.Tool.KX12/SettingsKeys.tt b/Migration.Tool.KX12/SettingsKeys.tt new file mode 100644 index 00000000..85023908 --- /dev/null +++ b/Migration.Tool.KX12/SettingsKeys.tt @@ -0,0 +1,29 @@ +<#@ template language="C#" #> +<#@ assembly name="System.Data" #> +<#@ import namespace="System.Data.SqlClient" #> +// ReSharper disable InconsistentNaming +// ReSharper disable IdentifierTypo +namespace Migration.Tool.KX12; + +public static class SettingsKeys { +<# + var connectionString = Environment.GetEnvironmentVariable("KENTICO_MT_DEV_KX12_CONNECTION_STRING"); + using var connection = new SqlConnection(connectionString); + using var cmd = connection.CreateCommand(); + cmd.CommandText = """ + SELECT KeyName + FROM CMS_SettingsKey + WHERE KeyName LIKE 'CMS%' + GROUP BY KeyName + ORDER BY KeyName + """; + connection.Open(); + using var reader = cmd.ExecuteReader(); + while (reader.Read()) + { + WriteLine($""" + public const string {reader[0]} = "{reader[0]}"; + """); + } +#> +} \ No newline at end of file diff --git a/Migration.Toolkit.KX12/genModel.ps1 b/Migration.Tool.KX12/genModel.ps1 similarity index 100% rename from Migration.Toolkit.KX12/genModel.ps1 rename to Migration.Tool.KX12/genModel.ps1 diff --git a/Migration.Toolkit.KX13/Context/KX13Context.cs b/Migration.Tool.KX13/Context/KX13Context.cs similarity index 99% rename from Migration.Toolkit.KX13/Context/KX13Context.cs rename to Migration.Tool.KX13/Context/KX13Context.cs index 51e3f425..a8c21b84 100644 --- a/Migration.Toolkit.KX13/Context/KX13Context.cs +++ b/Migration.Tool.KX13/Context/KX13Context.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; -using Migration.Toolkit.KX13.Models; +using Migration.Tool.KX13.Models; -namespace Migration.Toolkit.KX13.Context; +namespace Migration.Tool.KX13.Context; public partial class KX13Context : DbContext { diff --git a/Migration.Tool.KX13/DependencyInjectionExtensions.cs b/Migration.Tool.KX13/DependencyInjectionExtensions.cs new file mode 100644 index 00000000..b0c1f532 --- /dev/null +++ b/Migration.Tool.KX13/DependencyInjectionExtensions.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; + +using Migration.Tool.Common; +using Migration.Tool.KX13.Context; + +namespace Migration.Tool.KX13; + +public static class DependencyInjectionExtensions +{ + public static IServiceCollection UseKx13DbContext(this IServiceCollection services, ToolConfiguration toolConfiguration) + { + services.AddDbContextFactory(options => options.UseSqlServer(toolConfiguration.KxConnectionString)); + return services; + } +} diff --git a/Migration.Toolkit.KX13/KX13ContextCustomizations.cs b/Migration.Tool.KX13/KX13ContextCustomizations.cs similarity index 89% rename from Migration.Toolkit.KX13/KX13ContextCustomizations.cs rename to Migration.Tool.KX13/KX13ContextCustomizations.cs index ad2652f3..3edf7f77 100644 --- a/Migration.Toolkit.KX13/KX13ContextCustomizations.cs +++ b/Migration.Tool.KX13/KX13ContextCustomizations.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KX13.Context; +namespace Migration.Tool.KX13.Context; public partial class KX13Context { diff --git a/Migration.Tool.KX13/Migration.Tool.KX13.csproj b/Migration.Tool.KX13/Migration.Tool.KX13.csproj new file mode 100644 index 00000000..090daac0 --- /dev/null +++ b/Migration.Tool.KX13/Migration.Tool.KX13.csproj @@ -0,0 +1,42 @@ + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + TextTemplatingFileGenerator + SettingsKeys.cs + + + + + + True + True + SettingsKeys.tt + + + + + + + + + + + + diff --git a/Migration.Tool.KX13/Models/AnalyticsCampaign.cs b/Migration.Tool.KX13/Models/AnalyticsCampaign.cs new file mode 100644 index 00000000..a360fb71 --- /dev/null +++ b/Migration.Tool.KX13/Models/AnalyticsCampaign.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Analytics_Campaign")] +[Index("CampaignScheduledTaskId", Name = "IX_Analytics_Campaign_CampaignScheduledTaskID")] +[Index("CampaignSiteId", Name = "IX_Analytics_Campaign_CampaignSiteID")] +public class AnalyticsCampaign +{ + [Key] + [Column("CampaignID")] + public int CampaignId { get; set; } + + [StringLength(200)] + public string CampaignName { get; set; } = null!; + + [StringLength(100)] + public string CampaignDisplayName { get; set; } = null!; + + public string? CampaignDescription { get; set; } + + [Column("CampaignSiteID")] + public int CampaignSiteId { get; set; } + + public DateTime? CampaignOpenFrom { get; set; } + + public DateTime? CampaignOpenTo { get; set; } + + [Column("CampaignGUID")] + public Guid CampaignGuid { get; set; } + + public DateTime CampaignLastModified { get; set; } + + [Column("CampaignUTMCode")] + [StringLength(200)] + public string? CampaignUtmcode { get; set; } + + public DateTime? CampaignCalculatedTo { get; set; } + + [Column("CampaignScheduledTaskID")] + public int? CampaignScheduledTaskId { get; set; } + + public int? CampaignVisitors { get; set; } + + [InverseProperty("CampaignAssetCampaign")] + public virtual ICollection AnalyticsCampaignAssets { get; set; } = new List(); + + [InverseProperty("CampaignConversionCampaign")] + public virtual ICollection AnalyticsCampaignConversions { get; set; } = new List(); + + [InverseProperty("CampaignObjectiveCampaign")] + public virtual AnalyticsCampaignObjective? AnalyticsCampaignObjective { get; set; } + + [ForeignKey("CampaignScheduledTaskId")] + [InverseProperty("AnalyticsCampaigns")] + public virtual CmsScheduledTask? CampaignScheduledTask { get; set; } + + [ForeignKey("CampaignSiteId")] + [InverseProperty("AnalyticsCampaigns")] + public virtual CmsSite CampaignSite { get; set; } = null!; + + [InverseProperty("FacebookPostCampaign")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); + + [InverseProperty("LinkedInPostCampaign")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); + + [InverseProperty("TwitterPostCampaign")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/AnalyticsCampaignAsset.cs b/Migration.Tool.KX13/Models/AnalyticsCampaignAsset.cs new file mode 100644 index 00000000..162dc9a5 --- /dev/null +++ b/Migration.Tool.KX13/Models/AnalyticsCampaignAsset.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Analytics_CampaignAsset")] +[Index("CampaignAssetCampaignId", Name = "IX_Analytics_CampaignAsset_CampaignAssetCampaignID")] +public class AnalyticsCampaignAsset +{ + [Key] + [Column("CampaignAssetID")] + public int CampaignAssetId { get; set; } + + public Guid CampaignAssetGuid { get; set; } + + public DateTime CampaignAssetLastModified { get; set; } + + public Guid CampaignAssetAssetGuid { get; set; } + + [Column("CampaignAssetCampaignID")] + public int CampaignAssetCampaignId { get; set; } + + [StringLength(200)] + public string CampaignAssetType { get; set; } = null!; + + [InverseProperty("CampaignAssetUrlCampaignAsset")] + public virtual ICollection AnalyticsCampaignAssetUrls { get; set; } = new List(); + + [ForeignKey("CampaignAssetCampaignId")] + [InverseProperty("AnalyticsCampaignAssets")] + public virtual AnalyticsCampaign CampaignAssetCampaign { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/AnalyticsCampaignAssetUrl.cs b/Migration.Tool.KX13/Models/AnalyticsCampaignAssetUrl.cs new file mode 100644 index 00000000..62b433c2 --- /dev/null +++ b/Migration.Tool.KX13/Models/AnalyticsCampaignAssetUrl.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Analytics_CampaignAssetUrl")] +[Index("CampaignAssetUrlCampaignAssetId", Name = "IX_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID")] +public class AnalyticsCampaignAssetUrl +{ + [Key] + [Column("CampaignAssetUrlID")] + public int CampaignAssetUrlId { get; set; } + + public Guid CampaignAssetUrlGuid { get; set; } + + public string CampaignAssetUrlTarget { get; set; } = null!; + + [StringLength(200)] + public string CampaignAssetUrlPageTitle { get; set; } = null!; + + [Column("CampaignAssetUrlCampaignAssetID")] + public int CampaignAssetUrlCampaignAssetId { get; set; } + + [ForeignKey("CampaignAssetUrlCampaignAssetId")] + [InverseProperty("AnalyticsCampaignAssetUrls")] + public virtual AnalyticsCampaignAsset CampaignAssetUrlCampaignAsset { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/AnalyticsCampaignConversion.cs b/Migration.Tool.KX13/Models/AnalyticsCampaignConversion.cs new file mode 100644 index 00000000..8c766817 --- /dev/null +++ b/Migration.Tool.KX13/Models/AnalyticsCampaignConversion.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Analytics_CampaignConversion")] +[Index("CampaignConversionCampaignId", Name = "IX_Analytics_CampaignConversion_CampaignConversionCampaignID")] +public class AnalyticsCampaignConversion +{ + [Key] + [Column("CampaignConversionID")] + public int CampaignConversionId { get; set; } + + public Guid CampaignConversionGuid { get; set; } + + public DateTime CampaignConversionLastModified { get; set; } + + [StringLength(100)] + public string CampaignConversionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string CampaignConversionName { get; set; } = null!; + + [Column("CampaignConversionCampaignID")] + public int CampaignConversionCampaignId { get; set; } + + public int CampaignConversionOrder { get; set; } + + [StringLength(250)] + public string CampaignConversionActivityType { get; set; } = null!; + + public int CampaignConversionHits { get; set; } + + [Column("CampaignConversionItemID")] + public int? CampaignConversionItemId { get; set; } + + public double CampaignConversionValue { get; set; } + + public bool CampaignConversionIsFunnelStep { get; set; } + + [Column("CampaignConversionURL")] + public string? CampaignConversionUrl { get; set; } + + [InverseProperty("CampaignConversionHitsConversion")] + public virtual ICollection AnalyticsCampaignConversionHits { get; set; } = new List(); + + [InverseProperty("CampaignObjectiveCampaignConversion")] + public virtual ICollection AnalyticsCampaignObjectives { get; set; } = new List(); + + [ForeignKey("CampaignConversionCampaignId")] + [InverseProperty("AnalyticsCampaignConversions")] + public virtual AnalyticsCampaign CampaignConversionCampaign { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/AnalyticsCampaignConversionHit.cs b/Migration.Tool.KX13/Models/AnalyticsCampaignConversionHit.cs new file mode 100644 index 00000000..f7b815a2 --- /dev/null +++ b/Migration.Tool.KX13/Models/AnalyticsCampaignConversionHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Analytics_CampaignConversionHits")] +[Index("CampaignConversionHitsConversionId", Name = "IX_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID")] +public class AnalyticsCampaignConversionHit +{ + [Key] + [Column("CampaignConversionHitsID")] + public int CampaignConversionHitsId { get; set; } + + [Column("CampaignConversionHitsConversionID")] + public int CampaignConversionHitsConversionId { get; set; } + + public int CampaignConversionHitsCount { get; set; } + + [StringLength(200)] + public string CampaignConversionHitsSourceName { get; set; } = null!; + + [StringLength(200)] + public string? CampaignConversionHitsContentName { get; set; } + + [ForeignKey("CampaignConversionHitsConversionId")] + [InverseProperty("AnalyticsCampaignConversionHits")] + public virtual AnalyticsCampaignConversion CampaignConversionHitsConversion { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/AnalyticsCampaignObjective.cs b/Migration.Tool.KX13/Models/AnalyticsCampaignObjective.cs new file mode 100644 index 00000000..2b593c04 --- /dev/null +++ b/Migration.Tool.KX13/Models/AnalyticsCampaignObjective.cs @@ -0,0 +1,36 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Analytics_CampaignObjective")] +[Index("CampaignObjectiveCampaignId", Name = "CK_Analytics_CampaignObjective_CampaignObjectiveCampaignID", IsUnique = true)] +[Index("CampaignObjectiveCampaignConversionId", Name = "IX_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID")] +public class AnalyticsCampaignObjective +{ + [Key] + [Column("CampaignObjectiveID")] + public int CampaignObjectiveId { get; set; } + + public Guid CampaignObjectiveGuid { get; set; } + + public DateTime CampaignObjectiveLastModified { get; set; } + + [Column("CampaignObjectiveCampaignID")] + public int CampaignObjectiveCampaignId { get; set; } + + public int? CampaignObjectiveValue { get; set; } + + [Column("CampaignObjectiveCampaignConversionID")] + public int CampaignObjectiveCampaignConversionId { get; set; } + + [ForeignKey("CampaignObjectiveCampaignId")] + [InverseProperty("AnalyticsCampaignObjective")] + public virtual AnalyticsCampaign CampaignObjectiveCampaign { get; set; } = null!; + + [ForeignKey("CampaignObjectiveCampaignConversionId")] + [InverseProperty("AnalyticsCampaignObjectives")] + public virtual AnalyticsCampaignConversion CampaignObjectiveCampaignConversion { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/AnalyticsDayHit.cs b/Migration.Tool.KX13/Models/AnalyticsDayHit.cs new file mode 100644 index 00000000..a4bac65d --- /dev/null +++ b/Migration.Tool.KX13/Models/AnalyticsDayHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Analytics_DayHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_DayHits_HitsStatisticsID")] +public class AnalyticsDayHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsDayHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/AnalyticsExitPage.cs b/Migration.Tool.KX13/Models/AnalyticsExitPage.cs new file mode 100644 index 00000000..2d15095e --- /dev/null +++ b/Migration.Tool.KX13/Models/AnalyticsExitPage.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Analytics_ExitPages")] +[Index("ExitPageLastModified", Name = "IX_Analytics_ExitPages_ExitPageLastModified")] +[Index("ExitPageSessionIdentifier", Name = "UQ_Analytics_ExitPages_ExitPageSessionIdentifier", IsUnique = true)] +public class AnalyticsExitPage +{ + public DateTime ExitPageLastModified { get; set; } + + [Column("ExitPageSiteID")] + public int ExitPageSiteId { get; set; } + + [StringLength(50)] + public string? ExitPageCulture { get; set; } + + [Key] + public int ExitPageId { get; set; } + + [StringLength(1000)] + public string ExitPageUrl { get; set; } = null!; + + public Guid ExitPageSessionIdentifier { get; set; } + + [ForeignKey("ExitPageSiteId")] + [InverseProperty("AnalyticsExitPages")] + public virtual CmsSite ExitPageSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/AnalyticsHourHit.cs b/Migration.Tool.KX13/Models/AnalyticsHourHit.cs new file mode 100644 index 00000000..563b8efb --- /dev/null +++ b/Migration.Tool.KX13/Models/AnalyticsHourHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Analytics_HourHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_HourHits_HitsStatisticsID")] +public class AnalyticsHourHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsHourHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/AnalyticsMonthHit.cs b/Migration.Tool.KX13/Models/AnalyticsMonthHit.cs new file mode 100644 index 00000000..390efcdc --- /dev/null +++ b/Migration.Tool.KX13/Models/AnalyticsMonthHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Analytics_MonthHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_MonthHits_HitsStatisticsID")] +public class AnalyticsMonthHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsMonthHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/AnalyticsStatistic.cs b/Migration.Tool.KX13/Models/AnalyticsStatistic.cs new file mode 100644 index 00000000..39abed06 --- /dev/null +++ b/Migration.Tool.KX13/Models/AnalyticsStatistic.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Analytics_Statistics")] +[Index("StatisticsSiteId", Name = "IX_Analytics_Statistics_StatisticsSiteID")] +public class AnalyticsStatistic +{ + [Key] + [Column("StatisticsID")] + public int StatisticsId { get; set; } + + [Column("StatisticsSiteID")] + public int? StatisticsSiteId { get; set; } + + [StringLength(400)] + public string StatisticsCode { get; set; } = null!; + + [StringLength(1000)] + public string? StatisticsObjectName { get; set; } + + [Column("StatisticsObjectID")] + public int? StatisticsObjectId { get; set; } + + [StringLength(50)] + public string? StatisticsObjectCulture { get; set; } + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsDayHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsHourHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsMonthHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsWeekHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsYearHits { get; set; } = new List(); + + [ForeignKey("StatisticsSiteId")] + [InverseProperty("AnalyticsStatistics")] + public virtual CmsSite? StatisticsSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/AnalyticsWeekHit.cs b/Migration.Tool.KX13/Models/AnalyticsWeekHit.cs new file mode 100644 index 00000000..633a1fd8 --- /dev/null +++ b/Migration.Tool.KX13/Models/AnalyticsWeekHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Analytics_WeekHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_WeekHits_HitsStatisticsID")] +public class AnalyticsWeekHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsWeekHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/AnalyticsYearHit.cs b/Migration.Tool.KX13/Models/AnalyticsYearHit.cs new file mode 100644 index 00000000..dc0e15ba --- /dev/null +++ b/Migration.Tool.KX13/Models/AnalyticsYearHit.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Analytics_YearHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_WeekYearHits_HitsStatisticsID")] +public class AnalyticsYearHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsYearHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CiFileMetadatum.cs b/Migration.Tool.KX13/Models/CiFileMetadatum.cs new file mode 100644 index 00000000..66181a35 --- /dev/null +++ b/Migration.Tool.KX13/Models/CiFileMetadatum.cs @@ -0,0 +1,21 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CI_FileMetadata")] +[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] +public class CiFileMetadatum +{ + [Key] + [Column("FileMetadataID")] + public int FileMetadataId { get; set; } + + [StringLength(260)] + public string FileLocation { get; set; } = null!; + + [StringLength(32)] + public string FileHash { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CiMigration.cs b/Migration.Tool.KX13/Models/CiMigration.cs new file mode 100644 index 00000000..1d03de47 --- /dev/null +++ b/Migration.Tool.KX13/Models/CiMigration.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CI_Migration")] +[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] +public class CiMigration +{ + [Key] + [Column("MigrationID")] + public int MigrationId { get; set; } + + [StringLength(255)] + public string MigrationName { get; set; } = null!; + + [Precision(3)] + public DateTime DateApplied { get; set; } + + public int? RowsAffected { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsAcl.cs b/Migration.Tool.KX13/Models/CmsAcl.cs new file mode 100644 index 00000000..504b92a8 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsAcl.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_ACL")] +[Index("AclinheritedAcls", Name = "IX_CMS_ACL_ACLInheritedACLs")] +[Index("AclsiteId", Name = "IX_CMS_ACL_ACLSiteID")] +public class CmsAcl +{ + [Key] + [Column("ACLID")] + public int Aclid { get; set; } + + [Column("ACLInheritedACLs")] + public string AclinheritedAcls { get; set; } = null!; + + [Column("ACLGUID")] + public Guid Aclguid { get; set; } + + [Column("ACLLastModified")] + public DateTime AcllastModified { get; set; } + + [Column("ACLSiteID")] + public int? AclsiteId { get; set; } + + [ForeignKey("AclsiteId")] + [InverseProperty("CmsAcls")] + public virtual CmsSite? Aclsite { get; set; } + + [InverseProperty("Acl")] + public virtual ICollection CmsAclitems { get; set; } = new List(); + + [InverseProperty("NodeAcl")] + public virtual ICollection CmsTrees { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsAclitem.cs b/Migration.Tool.KX13/Models/CmsAclitem.cs new file mode 100644 index 00000000..58b7cb80 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsAclitem.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_ACLItem")] +[Index("Aclid", Name = "IX_CMS_ACLItem_ACLID")] +[Index("LastModifiedByUserId", Name = "IX_CMS_ACLItem_LastModifiedByUserID")] +[Index("RoleId", Name = "IX_CMS_ACLItem_RoleID")] +[Index("UserId", Name = "IX_CMS_ACLItem_UserID")] +public class CmsAclitem +{ + [Key] + [Column("ACLItemID")] + public int AclitemId { get; set; } + + [Column("ACLID")] + public int Aclid { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [Column("RoleID")] + public int? RoleId { get; set; } + + public int Allowed { get; set; } + + public int Denied { get; set; } + + public DateTime LastModified { get; set; } + + [Column("LastModifiedByUserID")] + public int? LastModifiedByUserId { get; set; } + + [Column("ACLItemGUID")] + public Guid AclitemGuid { get; set; } + + [ForeignKey("Aclid")] + [InverseProperty("CmsAclitems")] + public virtual CmsAcl Acl { get; set; } = null!; + + [ForeignKey("LastModifiedByUserId")] + [InverseProperty("CmsAclitemLastModifiedByUsers")] + public virtual CmsUser? LastModifiedByUser { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsAclitems")] + public virtual CmsRole? Role { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsAclitemUsers")] + public virtual CmsUser? User { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsAlternativeForm.cs b/Migration.Tool.KX13/Models/CmsAlternativeForm.cs new file mode 100644 index 00000000..0c5c850b --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsAlternativeForm.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_AlternativeForm")] +[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] +[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] +public class CmsAlternativeForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(50)] + public string FormName { get; set; } = null!; + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public string? FormDefinition { get; set; } + + public string? FormLayout { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + [Column("FormCoupledClassID")] + public int? FormCoupledClassId { get; set; } + + public bool? FormHideNewParentFields { get; set; } + + [StringLength(50)] + public string? FormLayoutType { get; set; } + + [Column("FormVersionGUID")] + [StringLength(50)] + public string? FormVersionGuid { get; set; } + + [StringLength(400)] + public string? FormCustomizedColumns { get; set; } + + public bool? FormIsCustom { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsAlternativeFormFormClasses")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormCoupledClassId")] + [InverseProperty("CmsAlternativeFormFormCoupledClasses")] + public virtual CmsClass? FormCoupledClass { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsAlternativeUrl.cs b/Migration.Tool.KX13/Models/CmsAlternativeUrl.cs new file mode 100644 index 00000000..5e997b08 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsAlternativeUrl.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_AlternativeUrl")] +[Index("AlternativeUrlDocumentId", Name = "IX_CMS_AlternativeUrl_AlternativeUrlDocumentID")] +[Index("AlternativeUrlSiteId", "AlternativeUrlUrl", Name = "IX_CMS_AlternativeUrl_AlternativeUrlSiteID_AlternativeUrlUrl", IsUnique = true)] +public class CmsAlternativeUrl +{ + [Key] + [Column("AlternativeUrlID")] + public int AlternativeUrlId { get; set; } + + [Column("AlternativeUrlGUID")] + public Guid AlternativeUrlGuid { get; set; } + + [Column("AlternativeUrlDocumentID")] + public int AlternativeUrlDocumentId { get; set; } + + [Column("AlternativeUrlSiteID")] + public int AlternativeUrlSiteId { get; set; } + + [StringLength(400)] + public string AlternativeUrlUrl { get; set; } = null!; + + public DateTime AlternativeUrlLastModified { get; set; } + + [ForeignKey("AlternativeUrlDocumentId")] + [InverseProperty("CmsAlternativeUrls")] + public virtual CmsDocument AlternativeUrlDocument { get; set; } = null!; + + [ForeignKey("AlternativeUrlSiteId")] + [InverseProperty("CmsAlternativeUrls")] + public virtual CmsSite AlternativeUrlSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsAttachment.cs b/Migration.Tool.KX13/Models/CmsAttachment.cs new file mode 100644 index 00000000..b22b45d8 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsAttachment.cs @@ -0,0 +1,90 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Attachment")] +[Index("AttachmentDocumentId", Name = "IX_CMS_Attachment_AttachmentDocumentID")] +[Index("AttachmentGuid", "AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentGUID_AttachmentSiteID")] +[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentFormGuid", "AttachmentOrder", Name = "IX_CMS_Attachment_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentFormGUID_AttachmentOrder")] +[Index("AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentSiteID")] +[Index("AttachmentVariantParentId", Name = "IX_CMS_Attachment_AttachmentVariantParentID")] +public class CmsAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + public int? AttachmentImageWidth { get; set; } + + public int? AttachmentImageHeight { get; set; } + + [Column("AttachmentDocumentID")] + public int? AttachmentDocumentId { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + public bool? AttachmentIsUnsorted { get; set; } + + public int? AttachmentOrder { get; set; } + + [Column("AttachmentGroupGUID")] + public Guid? AttachmentGroupGuid { get; set; } + + [Column("AttachmentFormGUID")] + public Guid? AttachmentFormGuid { get; set; } + + [StringLength(32)] + public string? AttachmentHash { get; set; } + + [StringLength(250)] + public string? AttachmentTitle { get; set; } + + public string? AttachmentDescription { get; set; } + + public string? AttachmentCustomData { get; set; } + + public string? AttachmentSearchContent { get; set; } + + [StringLength(50)] + public string? AttachmentVariantDefinitionIdentifier { get; set; } + + [Column("AttachmentVariantParentID")] + public int? AttachmentVariantParentId { get; set; } + + [ForeignKey("AttachmentDocumentId")] + [InverseProperty("CmsAttachments")] + public virtual CmsDocument? AttachmentDocument { get; set; } + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("CmsAttachments")] + public virtual CmsSite AttachmentSite { get; set; } = null!; + + [ForeignKey("AttachmentVariantParentId")] + [InverseProperty("InverseAttachmentVariantParent")] + public virtual CmsAttachment? AttachmentVariantParent { get; set; } + + [InverseProperty("AttachmentVariantParent")] + public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsAttachmentHistory.cs b/Migration.Tool.KX13/Models/CmsAttachmentHistory.cs new file mode 100644 index 00000000..6e22f0cb --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsAttachmentHistory.cs @@ -0,0 +1,89 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_AttachmentHistory")] +[Index("AttachmentGuid", Name = "IX_CMS_AttachmentHistory_AttachmentGUID")] +[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentOrder", Name = "IX_CMS_AttachmentHistory_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentOrder")] +[Index("AttachmentSiteId", Name = "IX_CMS_AttachmentHistory_AttachmentSiteID")] +[Index("AttachmentVariantParentId", Name = "IX_CMS_AttachmentHistory_AttachmentVariantParentID")] +public class CmsAttachmentHistory +{ + [Key] + [Column("AttachmentHistoryID")] + public int AttachmentHistoryId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + public int? AttachmentImageWidth { get; set; } + + public int? AttachmentImageHeight { get; set; } + + [Column("AttachmentDocumentID")] + public int AttachmentDocumentId { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public bool? AttachmentIsUnsorted { get; set; } + + public int? AttachmentOrder { get; set; } + + [Column("AttachmentGroupGUID")] + public Guid? AttachmentGroupGuid { get; set; } + + [StringLength(32)] + public string? AttachmentHash { get; set; } + + [StringLength(250)] + public string? AttachmentTitle { get; set; } + + public string? AttachmentDescription { get; set; } + + public string? AttachmentCustomData { get; set; } + + public DateTime? AttachmentLastModified { get; set; } + + [Column("AttachmentHistoryGUID")] + public Guid AttachmentHistoryGuid { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + public string? AttachmentSearchContent { get; set; } + + [StringLength(50)] + public string? AttachmentVariantDefinitionIdentifier { get; set; } + + [Column("AttachmentVariantParentID")] + public int? AttachmentVariantParentId { get; set; } + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("CmsAttachmentHistories")] + public virtual CmsSite AttachmentSite { get; set; } = null!; + + [ForeignKey("AttachmentVariantParentId")] + [InverseProperty("InverseAttachmentVariantParent")] + public virtual CmsAttachmentHistory? AttachmentVariantParent { get; set; } + + [InverseProperty("AttachmentVariantParent")] + public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); + + [ForeignKey("AttachmentHistoryId")] + [InverseProperty("AttachmentHistories")] + public virtual ICollection VersionHistories { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsAutomationHistory.cs b/Migration.Tool.KX13/Models/CmsAutomationHistory.cs new file mode 100644 index 00000000..a9495814 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsAutomationHistory.cs @@ -0,0 +1,81 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_AutomationHistory")] +[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] +[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] +[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] +[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] +[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] +[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] +public class CmsAutomationHistory +{ + [Key] + [Column("HistoryID")] + public int HistoryId { get; set; } + + [Column("HistoryStepID")] + public int? HistoryStepId { get; set; } + + [StringLength(440)] + public string? HistoryStepName { get; set; } + + [StringLength(450)] + public string HistoryStepDisplayName { get; set; } = null!; + + public int? HistoryStepType { get; set; } + + [Column("HistoryTargetStepID")] + public int? HistoryTargetStepId { get; set; } + + [StringLength(440)] + public string? HistoryTargetStepName { get; set; } + + [StringLength(450)] + public string? HistoryTargetStepDisplayName { get; set; } + + public int? HistoryTargetStepType { get; set; } + + [Column("HistoryApprovedByUserID")] + public int? HistoryApprovedByUserId { get; set; } + + public DateTime? HistoryApprovedWhen { get; set; } + + public string? HistoryComment { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + public bool HistoryWasRejected { get; set; } + + [Column("HistoryStateID")] + public int HistoryStateId { get; set; } + + [ForeignKey("HistoryApprovedByUserId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsUser? HistoryApprovedByUser { get; set; } + + [ForeignKey("HistoryStateId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsAutomationState HistoryState { get; set; } = null!; + + [ForeignKey("HistoryStepId")] + [InverseProperty("CmsAutomationHistoryHistorySteps")] + public virtual CmsWorkflowStep? HistoryStep { get; set; } + + [ForeignKey("HistoryTargetStepId")] + [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] + public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsAutomationState.cs b/Migration.Tool.KX13/Models/CmsAutomationState.cs new file mode 100644 index 00000000..33b0aa9f --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsAutomationState.cs @@ -0,0 +1,70 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_AutomationState")] +[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] +[Index("StateSiteId", Name = "IX_CMS_AutomationState_StateSiteID")] +[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] +[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] +[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] +public class CmsAutomationState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [Column("StateStepID")] + public int StateStepId { get; set; } + + [Column("StateObjectID")] + public int StateObjectId { get; set; } + + [StringLength(100)] + public string StateObjectType { get; set; } = null!; + + [StringLength(450)] + public string? StateActionStatus { get; set; } + + public DateTime? StateCreated { get; set; } + + public DateTime? StateLastModified { get; set; } + + [Column("StateWorkflowID")] + public int StateWorkflowId { get; set; } + + public int? StateStatus { get; set; } + + [Column("StateSiteID")] + public int? StateSiteId { get; set; } + + [Column("StateUserID")] + public int? StateUserId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public string? StateCustomData { get; set; } + + [InverseProperty("HistoryState")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [ForeignKey("StateSiteId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsSite? StateSite { get; set; } + + [ForeignKey("StateStepId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflowStep StateStep { get; set; } = null!; + + [ForeignKey("StateUserId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsUser? StateUser { get; set; } + + [ForeignKey("StateWorkflowId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflow StateWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsAutomationTemplate.cs b/Migration.Tool.KX13/Models/CmsAutomationTemplate.cs new file mode 100644 index 00000000..232b4cf4 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsAutomationTemplate.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_AutomationTemplate")] +[Index("TemplateDisplayName", Name = "IX_CMS_AutomationTemplate_TemplateDisplayName")] +public class CmsAutomationTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(250)] + public string TemplateDisplayName { get; set; } = null!; + + public string? TemplateDescription { get; set; } + + [StringLength(200)] + public string? TemplateIconClass { get; set; } + + public string? TemplateConfiguration { get; set; } + + public Guid TemplateGuid { get; set; } + + public DateTime TemplateLastModified { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsAvatar.cs b/Migration.Tool.KX13/Models/CmsAvatar.cs new file mode 100644 index 00000000..84ce524e --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsAvatar.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Avatar")] +[Index("AvatarGuid", Name = "IX_CMS_Avatar_AvatarGUID")] +public class CmsAvatar +{ + [Key] + [Column("AvatarID")] + public int AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarName { get; set; } + + [StringLength(200)] + public string AvatarFileName { get; set; } = null!; + + [StringLength(10)] + public string AvatarFileExtension { get; set; } = null!; + + public byte[]? AvatarBinary { get; set; } + + [Column("AvatarGUID")] + public Guid AvatarGuid { get; set; } + + public DateTime AvatarLastModified { get; set; } + + [StringLength(100)] + public string AvatarMimeType { get; set; } = null!; + + public int AvatarFileSize { get; set; } + + public int? AvatarImageHeight { get; set; } + + public int? AvatarImageWidth { get; set; } + + [InverseProperty("UserAvatar")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsCategory.cs b/Migration.Tool.KX13/Models/CmsCategory.cs new file mode 100644 index 00000000..d5bf8920 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsCategory.cs @@ -0,0 +1,66 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Category")] +[Index("CategorySiteId", Name = "IX_CMS_Category_CategorySiteID")] +[Index("CategoryUserId", Name = "IX_CMS_Category_CategoryUserID")] +public class CmsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(250)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(250)] + public string? CategoryName { get; set; } + + public string? CategoryDescription { get; set; } + + public int? CategoryCount { get; set; } + + [Required] + public bool? CategoryEnabled { get; set; } + + [Column("CategoryUserID")] + public int? CategoryUserId { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + [StringLength(1500)] + public string? CategoryNamePath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryOrder { get; set; } + + [ForeignKey("CategorySiteId")] + [InverseProperty("CmsCategories")] + public virtual CmsSite? CategorySite { get; set; } + + [ForeignKey("CategoryUserId")] + [InverseProperty("CmsCategories")] + public virtual CmsUser? CategoryUser { get; set; } + + [ForeignKey("CategoryId")] + [InverseProperty("Categories")] + public virtual ICollection Documents { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsClass.cs b/Migration.Tool.KX13/Models/CmsClass.cs new file mode 100644 index 00000000..144d50ca --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsClass.cs @@ -0,0 +1,195 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Class")] +[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] +[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] +[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] +[Index("ClassShowAsSystemTable", "ClassIsCustomTable", "ClassIsCoupledClass", "ClassIsDocumentType", Name = "IX_CMS_Class_ClassShowAsSystemTable_ClassIsCustomTable_ClassIsCoupledClass_ClassIsDocumentType")] +public class CmsClass +{ + [Key] + [Column("ClassID")] + public int ClassId { get; set; } + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + public bool ClassUsesVersioning { get; set; } + + public bool ClassIsDocumentType { get; set; } + + public bool ClassIsCoupledClass { get; set; } + + public string ClassXmlSchema { get; set; } = null!; + + public string ClassFormDefinition { get; set; } = null!; + + [StringLength(100)] + public string ClassNodeNameSource { get; set; } = null!; + + [StringLength(100)] + public string? ClassTableName { get; set; } + + public string? ClassFormLayout { get; set; } + + public bool? ClassShowAsSystemTable { get; set; } + + public bool? ClassUsePublishFromTo { get; set; } + + public bool? ClassShowTemplateSelection { get; set; } + + [Column("ClassSKUMappings")] + public string? ClassSkumappings { get; set; } + + public bool? ClassIsMenuItemType { get; set; } + + [StringLength(100)] + public string? ClassNodeAliasSource { get; set; } + + public DateTime ClassLastModified { get; set; } + + [Column("ClassGUID")] + public Guid ClassGuid { get; set; } + + [Column("ClassCreateSKU")] + public bool? ClassCreateSku { get; set; } + + public bool? ClassIsProduct { get; set; } + + public bool ClassIsCustomTable { get; set; } + + [StringLength(1000)] + public string? ClassShowColumns { get; set; } + + [StringLength(200)] + public string? ClassSearchTitleColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchContentColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchImageColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchCreationDateColumn { get; set; } + + public string? ClassSearchSettings { get; set; } + + [Column("ClassInheritsFromClassID")] + public int? ClassInheritsFromClassId { get; set; } + + public bool? ClassSearchEnabled { get; set; } + + [Column("ClassSKUDefaultDepartmentName")] + [StringLength(200)] + public string? ClassSkudefaultDepartmentName { get; set; } + + [Column("ClassSKUDefaultDepartmentID")] + public int? ClassSkudefaultDepartmentId { get; set; } + + public string? ClassContactMapping { get; set; } + + public bool? ClassContactOverwriteEnabled { get; set; } + + [Column("ClassSKUDefaultProductType")] + [StringLength(50)] + public string? ClassSkudefaultProductType { get; set; } + + [StringLength(100)] + public string? ClassConnectionString { get; set; } + + public bool? ClassIsProductSection { get; set; } + + [StringLength(50)] + public string? ClassFormLayoutType { get; set; } + + [Column("ClassVersionGUID")] + [StringLength(50)] + public string? ClassVersionGuid { get; set; } + + [StringLength(100)] + public string? ClassDefaultObjectType { get; set; } + + public bool? ClassIsForm { get; set; } + + [Column("ClassResourceID")] + public int? ClassResourceId { get; set; } + + [StringLength(400)] + public string? ClassCustomizedColumns { get; set; } + + public string? ClassCodeGenerationSettings { get; set; } + + [StringLength(200)] + public string? ClassIconClass { get; set; } + + [Column("ClassURLPattern")] + [StringLength(200)] + public string? ClassUrlpattern { get; set; } + + public bool ClassUsesPageBuilder { get; set; } + + public bool ClassIsNavigationItem { get; set; } + + [Column("ClassHasURL")] + public bool ClassHasUrl { get; set; } + + public bool ClassHasMetadata { get; set; } + + public int? ClassSearchIndexDataSource { get; set; } + + [ForeignKey("ClassResourceId")] + [InverseProperty("CmsClasses")] + public virtual CmsResource? ClassResource { get; set; } + + [InverseProperty("FormClass")] + public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); + + [InverseProperty("FormCoupledClass")] + public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); + + [InverseProperty("FormClass")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsPermissions { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsQueries { get; set; } = new List(); + + [InverseProperty("TransformationClass")] + public virtual ICollection CmsTransformations { get; set; } = new List(); + + [InverseProperty("NodeClass")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("VersionClass")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("ScopeClass")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [ForeignKey("ParentClassId")] + [InverseProperty("ParentClasses")] + public virtual ICollection ChildClasses { get; set; } = new List(); + + [ForeignKey("ChildClassId")] + [InverseProperty("ChildClasses")] + public virtual ICollection ParentClasses { get; set; } = new List(); + + [ForeignKey("ClassId")] + [InverseProperty("Classes")] + public virtual ICollection Scopes { get; set; } = new List(); + + [ForeignKey("ClassId")] + [InverseProperty("Classes")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsConsent.cs b/Migration.Tool.KX13/Models/CmsConsent.cs new file mode 100644 index 00000000..a579278a --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsConsent.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Consent")] +public class CmsConsent +{ + [Key] + [Column("ConsentID")] + public int ConsentId { get; set; } + + [StringLength(200)] + public string ConsentDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ConsentName { get; set; } = null!; + + public string ConsentContent { get; set; } = null!; + + public Guid ConsentGuid { get; set; } + + public DateTime ConsentLastModified { get; set; } + + [StringLength(100)] + public string ConsentHash { get; set; } = null!; + + [InverseProperty("ConsentAgreementConsent")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [InverseProperty("ConsentArchiveConsent")] + public virtual ICollection CmsConsentArchives { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsConsentAgreement.cs b/Migration.Tool.KX13/Models/CmsConsentAgreement.cs new file mode 100644 index 00000000..07c84599 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsConsentAgreement.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_ConsentAgreement")] +[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] +public class CmsConsentAgreement +{ + [Key] + [Column("ConsentAgreementID")] + public int ConsentAgreementId { get; set; } + + public Guid ConsentAgreementGuid { get; set; } + + public bool ConsentAgreementRevoked { get; set; } + + [Column("ConsentAgreementContactID")] + public int ConsentAgreementContactId { get; set; } + + [Column("ConsentAgreementConsentID")] + public int ConsentAgreementConsentId { get; set; } + + [StringLength(100)] + public string? ConsentAgreementConsentHash { get; set; } + + public DateTime ConsentAgreementTime { get; set; } + + [ForeignKey("ConsentAgreementConsentId")] + [InverseProperty("CmsConsentAgreements")] + public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; + + [ForeignKey("ConsentAgreementContactId")] + [InverseProperty("CmsConsentAgreements")] + public virtual OmContact ConsentAgreementContact { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsConsentArchive.cs b/Migration.Tool.KX13/Models/CmsConsentArchive.cs new file mode 100644 index 00000000..a7024218 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsConsentArchive.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_ConsentArchive")] +[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] +public class CmsConsentArchive +{ + [Key] + [Column("ConsentArchiveID")] + public int ConsentArchiveId { get; set; } + + public Guid ConsentArchiveGuid { get; set; } + + public DateTime ConsentArchiveLastModified { get; set; } + + [Column("ConsentArchiveConsentID")] + public int ConsentArchiveConsentId { get; set; } + + [StringLength(100)] + public string ConsentArchiveHash { get; set; } = null!; + + public string ConsentArchiveContent { get; set; } = null!; + + [ForeignKey("ConsentArchiveConsentId")] + [InverseProperty("CmsConsentArchives")] + public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsCountry.cs b/Migration.Tool.KX13/Models/CmsCountry.cs new file mode 100644 index 00000000..5393ce4f --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsCountry.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Country")] +public class CmsCountry +{ + [Key] + [Column("CountryID")] + public int CountryId { get; set; } + + [StringLength(200)] + public string CountryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CountryName { get; set; } = null!; + + [Column("CountryGUID")] + public Guid CountryGuid { get; set; } + + public DateTime CountryLastModified { get; set; } + + [StringLength(2)] + public string? CountryTwoLetterCode { get; set; } + + [StringLength(3)] + public string? CountryThreeLetterCode { get; set; } + + [InverseProperty("Country")] + public virtual ICollection CmsStates { get; set; } = new List(); + + [InverseProperty("AddressCountry")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("AddressCountry")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("Country")] + public virtual ICollection ComTaxClassCountries { get; set; } = new List(); + + [InverseProperty("AccountCountry")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactCountry")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsCulture.cs b/Migration.Tool.KX13/Models/CmsCulture.cs new file mode 100644 index 00000000..6e4a8e1d --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsCulture.cs @@ -0,0 +1,53 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Culture")] +[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] +[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] +public class CmsCulture +{ + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; + + [StringLength(200)] + public string CultureShortName { get; set; } = null!; + + [Column("CultureGUID")] + public Guid CultureGuid { get; set; } + + public DateTime CultureLastModified { get; set; } + + [StringLength(100)] + public string? CultureAlias { get; set; } + + [Column("CultureIsUICulture")] + public bool? CultureIsUiculture { get; set; } + + [InverseProperty("TranslationCulture")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); + + [InverseProperty("Culture")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("ScopeCulture")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [ForeignKey("IndexCultureId")] + [InverseProperty("IndexCultures")] + public virtual ICollection Indices { get; set; } = new List(); + + [ForeignKey("CultureId")] + [InverseProperty("Cultures")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsDocument.cs b/Migration.Tool.KX13/Models/CmsDocument.cs new file mode 100644 index 00000000..602f8e4c --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsDocument.cs @@ -0,0 +1,166 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Document")] +[Index("DocumentCheckedOutByUserId", Name = "IX_CMS_Document_DocumentCheckedOutByUserID")] +[Index("DocumentCheckedOutVersionHistoryId", Name = "IX_CMS_Document_DocumentCheckedOutVersionHistoryID")] +[Index("DocumentCreatedByUserId", Name = "IX_CMS_Document_DocumentCreatedByUserID")] +[Index("DocumentCulture", Name = "IX_CMS_Document_DocumentCulture")] +[Index("DocumentForeignKeyValue", "DocumentId", "DocumentNodeId", Name = "IX_CMS_Document_DocumentForeignKeyValue_DocumentID_DocumentNodeID")] +[Index("DocumentModifiedByUserId", Name = "IX_CMS_Document_DocumentModifiedByUserID")] +[Index("DocumentNodeId", "DocumentId", "DocumentCulture", Name = "IX_CMS_Document_DocumentNodeID_DocumentID_DocumentCulture", IsUnique = true)] +[Index("DocumentPublishedVersionHistoryId", Name = "IX_CMS_Document_DocumentPublishedVersionHistoryID")] +[Index("DocumentTagGroupId", Name = "IX_CMS_Document_DocumentTagGroupID")] +[Index("DocumentWorkflowStepId", Name = "IX_CMS_Document_DocumentWorkflowStepID")] +public class CmsDocument +{ + [Key] + [Column("DocumentID")] + public int DocumentId { get; set; } + + [StringLength(100)] + public string DocumentName { get; set; } = null!; + + public DateTime? DocumentModifiedWhen { get; set; } + + [Column("DocumentModifiedByUserID")] + public int? DocumentModifiedByUserId { get; set; } + + public int? DocumentForeignKeyValue { get; set; } + + [Column("DocumentCreatedByUserID")] + public int? DocumentCreatedByUserId { get; set; } + + public DateTime? DocumentCreatedWhen { get; set; } + + [Column("DocumentCheckedOutByUserID")] + public int? DocumentCheckedOutByUserId { get; set; } + + public DateTime? DocumentCheckedOutWhen { get; set; } + + [Column("DocumentCheckedOutVersionHistoryID")] + public int? DocumentCheckedOutVersionHistoryId { get; set; } + + [Column("DocumentPublishedVersionHistoryID")] + public int? DocumentPublishedVersionHistoryId { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + public DateTime? DocumentPublishFrom { get; set; } + + public DateTime? DocumentPublishTo { get; set; } + + [StringLength(50)] + public string DocumentCulture { get; set; } = null!; + + [Column("DocumentNodeID")] + public int DocumentNodeId { get; set; } + + public string? DocumentPageTitle { get; set; } + + public string? DocumentPageKeyWords { get; set; } + + public string? DocumentPageDescription { get; set; } + + public string? DocumentContent { get; set; } + + public string? DocumentCustomData { get; set; } + + public string? DocumentTags { get; set; } + + [Column("DocumentTagGroupID")] + public int? DocumentTagGroupId { get; set; } + + public DateTime? DocumentLastPublished { get; set; } + + public bool? DocumentSearchExcluded { get; set; } + + [StringLength(50)] + public string? DocumentLastVersionNumber { get; set; } + + public bool? DocumentIsArchived { get; set; } + + [Column("DocumentGUID")] + public Guid? DocumentGuid { get; set; } + + [Column("DocumentWorkflowCycleGUID")] + public Guid? DocumentWorkflowCycleGuid { get; set; } + + public bool? DocumentIsWaitingForTranslation { get; set; } + + [Column("DocumentSKUName")] + [StringLength(440)] + public string? DocumentSkuname { get; set; } + + [Column("DocumentSKUDescription")] + public string? DocumentSkudescription { get; set; } + + [Column("DocumentSKUShortDescription")] + public string? DocumentSkushortDescription { get; set; } + + [StringLength(450)] + public string? DocumentWorkflowActionStatus { get; set; } + + [Required] + public bool? DocumentCanBePublished { get; set; } + + public string? DocumentPageBuilderWidgets { get; set; } + + public string? DocumentPageTemplateConfiguration { get; set; } + + [Column("DocumentABTestConfiguration")] + public string? DocumentAbtestConfiguration { get; set; } + + public bool DocumentShowInMenu { get; set; } + + [InverseProperty("AlternativeUrlDocument")] + public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); + + [InverseProperty("AttachmentDocument")] + public virtual ICollection CmsAttachments { get; set; } = new List(); + + [ForeignKey("DocumentCheckedOutByUserId")] + [InverseProperty("CmsDocumentDocumentCheckedOutByUsers")] + public virtual CmsUser? DocumentCheckedOutByUser { get; set; } + + [ForeignKey("DocumentCheckedOutVersionHistoryId")] + [InverseProperty("CmsDocumentDocumentCheckedOutVersionHistories")] + public virtual CmsVersionHistory? DocumentCheckedOutVersionHistory { get; set; } + + [ForeignKey("DocumentCreatedByUserId")] + [InverseProperty("CmsDocumentDocumentCreatedByUsers")] + public virtual CmsUser? DocumentCreatedByUser { get; set; } + + [ForeignKey("DocumentModifiedByUserId")] + [InverseProperty("CmsDocumentDocumentModifiedByUsers")] + public virtual CmsUser? DocumentModifiedByUser { get; set; } + + [ForeignKey("DocumentNodeId")] + [InverseProperty("CmsDocuments")] + public virtual CmsTree DocumentNode { get; set; } = null!; + + [ForeignKey("DocumentPublishedVersionHistoryId")] + [InverseProperty("CmsDocumentDocumentPublishedVersionHistories")] + public virtual CmsVersionHistory? DocumentPublishedVersionHistory { get; set; } + + [ForeignKey("DocumentTagGroupId")] + [InverseProperty("CmsDocuments")] + public virtual CmsTagGroup? DocumentTagGroup { get; set; } + + [ForeignKey("DocumentWorkflowStepId")] + [InverseProperty("CmsDocuments")] + public virtual CmsWorkflowStep? DocumentWorkflowStep { get; set; } + + [ForeignKey("DocumentId")] + [InverseProperty("Documents")] + public virtual ICollection Categories { get; set; } = new List(); + + [ForeignKey("DocumentId")] + [InverseProperty("Documents")] + public virtual ICollection Tags { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsDocumentTypeScope.cs b/Migration.Tool.KX13/Models/CmsDocumentTypeScope.cs new file mode 100644 index 00000000..5f1519c9 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsDocumentTypeScope.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_DocumentTypeScope")] +[Index("ScopeSiteId", Name = "IX_CMS_DocumentTypeScope_ScopeSiteID")] +public class CmsDocumentTypeScope +{ + [Key] + [Column("ScopeID")] + public int ScopeId { get; set; } + + public string ScopePath { get; set; } = null!; + + [Column("ScopeSiteID")] + public int? ScopeSiteId { get; set; } + + public DateTime ScopeLastModified { get; set; } + + [Column("ScopeGUID")] + public Guid? ScopeGuid { get; set; } + + public bool? ScopeIncludeChildren { get; set; } + + public bool? ScopeAllowAllTypes { get; set; } + + public bool? ScopeAllowLinks { get; set; } + + public string? ScopeMacroCondition { get; set; } + + [ForeignKey("ScopeSiteId")] + [InverseProperty("CmsDocumentTypeScopes")] + public virtual CmsSite? ScopeSite { get; set; } + + [ForeignKey("ScopeId")] + [InverseProperty("Scopes")] + public virtual ICollection Classes { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsEmail.cs b/Migration.Tool.KX13/Models/CmsEmail.cs new file mode 100644 index 00000000..46de9c36 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsEmail.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Email")] +[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] +public class CmsEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [StringLength(254)] + public string EmailFrom { get; set; } = null!; + + [StringLength(998)] + public string? EmailTo { get; set; } + + [StringLength(998)] + public string? EmailCc { get; set; } + + [StringLength(998)] + public string? EmailBcc { get; set; } + + [StringLength(450)] + public string EmailSubject { get; set; } = null!; + + public string? EmailBody { get; set; } + + public string? EmailPlainTextBody { get; set; } + + public int EmailFormat { get; set; } + + public int EmailPriority { get; set; } + + [Column("EmailSiteID")] + public int? EmailSiteId { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + public DateTime EmailLastModified { get; set; } + + public int? EmailStatus { get; set; } + + public bool? EmailIsMass { get; set; } + + [StringLength(254)] + public string? EmailReplyTo { get; set; } + + public string? EmailHeaders { get; set; } + + public DateTime? EmailCreated { get; set; } + + [InverseProperty("Email")] + public virtual ICollection CmsEmailUsers { get; set; } = new List(); + + [ForeignKey("EmailId")] + [InverseProperty("Emails")] + public virtual ICollection Attachments { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsEmailAttachment.cs b/Migration.Tool.KX13/Models/CmsEmailAttachment.cs new file mode 100644 index 00000000..501521f9 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsEmailAttachment.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_EmailAttachment")] +public class CmsEmailAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[] AttachmentBinary { get; set; } = null!; + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + [Column("AttachmentContentID")] + [StringLength(255)] + public string? AttachmentContentId { get; set; } + + [Column("AttachmentSiteID")] + public int? AttachmentSiteId { get; set; } + + [ForeignKey("AttachmentId")] + [InverseProperty("Attachments")] + public virtual ICollection Emails { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsEmailTemplate.cs b/Migration.Tool.KX13/Models/CmsEmailTemplate.cs new file mode 100644 index 00000000..bed80929 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsEmailTemplate.cs @@ -0,0 +1,58 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_EmailTemplate")] +[Index("EmailTemplateName", "EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateName_EmailTemplateSiteID")] +[Index("EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateSiteID")] +public class CmsEmailTemplate +{ + [Key] + [Column("EmailTemplateID")] + public int EmailTemplateId { get; set; } + + [StringLength(200)] + public string EmailTemplateName { get; set; } = null!; + + [StringLength(200)] + public string EmailTemplateDisplayName { get; set; } = null!; + + public string? EmailTemplateText { get; set; } + + [Column("EmailTemplateSiteID")] + public int? EmailTemplateSiteId { get; set; } + + [Column("EmailTemplateGUID")] + public Guid EmailTemplateGuid { get; set; } + + public DateTime EmailTemplateLastModified { get; set; } + + public string? EmailTemplatePlainText { get; set; } + + [StringLength(250)] + public string? EmailTemplateSubject { get; set; } + + [StringLength(254)] + public string? EmailTemplateFrom { get; set; } + + [StringLength(998)] + public string? EmailTemplateCc { get; set; } + + [StringLength(998)] + public string? EmailTemplateBcc { get; set; } + + [StringLength(100)] + public string? EmailTemplateType { get; set; } + + public string? EmailTemplateDescription { get; set; } + + [StringLength(254)] + public string? EmailTemplateReplyTo { get; set; } + + [ForeignKey("EmailTemplateSiteId")] + [InverseProperty("CmsEmailTemplates")] + public virtual CmsSite? EmailTemplateSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsEmailUser.cs b/Migration.Tool.KX13/Models/CmsEmailUser.cs new file mode 100644 index 00000000..5715fc4e --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsEmailUser.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[PrimaryKey("EmailId", "UserId")] +[Table("CMS_EmailUser")] +[Index("Status", Name = "IX_CMS_EmailUser_Status")] +[Index("UserId", Name = "IX_CMS_EmailUser_UserID")] +public class CmsEmailUser +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [Key] + [Column("UserID")] + public int UserId { get; set; } + + public string? LastSendResult { get; set; } + + public DateTime? LastSendAttempt { get; set; } + + public int? Status { get; set; } + + [ForeignKey("EmailId")] + [InverseProperty("CmsEmailUsers")] + public virtual CmsEmail Email { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsEmailUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsEventLog.cs b/Migration.Tool.KX13/Models/CmsEventLog.cs new file mode 100644 index 00000000..863d1cd5 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsEventLog.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_EventLog")] +[Index("SiteId", Name = "IX_CMS_EventLog_SiteID")] +public class CmsEventLog +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(5)] + public string EventType { get; set; } = null!; + + public DateTime EventTime { get; set; } + + [StringLength(100)] + public string Source { get; set; } = null!; + + [StringLength(100)] + public string EventCode { get; set; } = null!; + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(250)] + public string? UserName { get; set; } + + [Column("IPAddress")] + [StringLength(100)] + public string? Ipaddress { get; set; } + + [Column("NodeID")] + public int? NodeId { get; set; } + + [StringLength(100)] + public string? DocumentName { get; set; } + + public string? EventDescription { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + public string? EventUrl { get; set; } + + [StringLength(100)] + public string? EventMachineName { get; set; } + + public string? EventUserAgent { get; set; } + + public string? EventUrlReferrer { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsExternalLogin.cs b/Migration.Tool.KX13/Models/CmsExternalLogin.cs new file mode 100644 index 00000000..38f870dd --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsExternalLogin.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_ExternalLogin")] +[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] +public class CmsExternalLogin +{ + [Key] + [Column("ExternalLoginID")] + public int ExternalLoginId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(200)] + public string? LoginProvider { get; set; } + + [StringLength(200)] + public string? IdentityKey { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsExternalLogins")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsForm.cs b/Migration.Tool.KX13/Models/CmsForm.cs new file mode 100644 index 00000000..4ae75502 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsForm.cs @@ -0,0 +1,93 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Form")] +[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] +[Index("FormSiteId", Name = "IX_CMS_Form_FormSiteID")] +public class CmsForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(100)] + public string FormName { get; set; } = null!; + + [StringLength(998)] + public string? FormSendToEmail { get; set; } + + [StringLength(254)] + public string? FormSendFromEmail { get; set; } + + [StringLength(250)] + public string? FormEmailSubject { get; set; } + + public string? FormEmailTemplate { get; set; } + + public bool? FormEmailAttachUploadedDocs { get; set; } + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public int FormItems { get; set; } + + public string? FormReportFields { get; set; } + + [StringLength(400)] + public string? FormRedirectToUrl { get; set; } + + public string? FormDisplayText { get; set; } + + public bool FormClearAfterSave { get; set; } + + [StringLength(400)] + public string? FormSubmitButtonText { get; set; } + + [Column("FormSiteID")] + public int FormSiteId { get; set; } + + [StringLength(254)] + public string? FormConfirmationEmailField { get; set; } + + public string? FormConfirmationTemplate { get; set; } + + [StringLength(254)] + public string? FormConfirmationSendFromEmail { get; set; } + + [StringLength(250)] + public string? FormConfirmationEmailSubject { get; set; } + + public int? FormAccess { get; set; } + + [StringLength(255)] + public string? FormSubmitButtonImage { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + [Required] + public bool? FormLogActivity { get; set; } + + public string? FormBuilderLayout { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsForms")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormSiteId")] + [InverseProperty("CmsForms")] + public virtual CmsSite FormSite { get; set; } = null!; + + [ForeignKey("FormId")] + [InverseProperty("Forms")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsFormUserControl.cs b/Migration.Tool.KX13/Models/CmsFormUserControl.cs new file mode 100644 index 00000000..ac3610df --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsFormUserControl.cs @@ -0,0 +1,94 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_FormUserControl")] +[Index("UserControlCodeName", Name = "IX_CMS_FormUserControl_UserControlCodeName", IsUnique = true)] +[Index("UserControlParentId", Name = "IX_CMS_FormUserControl_UserControlParentID")] +[Index("UserControlResourceId", Name = "IX_CMS_FormUserControl_UserControlResourceID")] +public class CmsFormUserControl +{ + [Key] + [Column("UserControlID")] + public int UserControlId { get; set; } + + [StringLength(200)] + public string UserControlDisplayName { get; set; } = null!; + + [StringLength(200)] + public string UserControlCodeName { get; set; } = null!; + + [StringLength(400)] + public string UserControlFileName { get; set; } = null!; + + public bool UserControlForText { get; set; } + + public bool UserControlForLongText { get; set; } + + public bool UserControlForInteger { get; set; } + + public bool UserControlForDecimal { get; set; } + + public bool UserControlForDateTime { get; set; } + + public bool UserControlForBoolean { get; set; } + + public bool UserControlForFile { get; set; } + + public bool? UserControlShowInDocumentTypes { get; set; } + + public bool? UserControlShowInSystemTables { get; set; } + + public bool? UserControlShowInWebParts { get; set; } + + public bool? UserControlShowInReports { get; set; } + + [Column("UserControlGUID")] + public Guid UserControlGuid { get; set; } + + public DateTime UserControlLastModified { get; set; } + + public bool UserControlForGuid { get; set; } + + public bool? UserControlShowInCustomTables { get; set; } + + public string? UserControlParameters { get; set; } + + public bool UserControlForDocAttachments { get; set; } + + [Column("UserControlResourceID")] + public int? UserControlResourceId { get; set; } + + [Column("UserControlParentID")] + public int? UserControlParentId { get; set; } + + public string? UserControlDescription { get; set; } + + public int? UserControlPriority { get; set; } + + public bool? UserControlIsSystem { get; set; } + + public bool UserControlForBinary { get; set; } + + public bool UserControlForDocRelationships { get; set; } + + [StringLength(200)] + public string? UserControlAssemblyName { get; set; } + + [StringLength(200)] + public string? UserControlClassName { get; set; } + + [InverseProperty("UserControlParent")] + public virtual ICollection InverseUserControlParent { get; set; } = new List(); + + [ForeignKey("UserControlParentId")] + [InverseProperty("InverseUserControlParent")] + public virtual CmsFormUserControl? UserControlParent { get; set; } + + [ForeignKey("UserControlResourceId")] + [InverseProperty("CmsFormUserControls")] + public virtual CmsResource? UserControlResource { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsHelpTopic.cs b/Migration.Tool.KX13/Models/CmsHelpTopic.cs new file mode 100644 index 00000000..e88d369d --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsHelpTopic.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_HelpTopic")] +[Index("HelpTopicUielementId", Name = "IX_CMS_HelpTopic_HelpTopicUIElementID")] +public class CmsHelpTopic +{ + [Key] + [Column("HelpTopicID")] + public int HelpTopicId { get; set; } + + [Column("HelpTopicUIElementID")] + public int HelpTopicUielementId { get; set; } + + [StringLength(200)] + public string HelpTopicName { get; set; } = null!; + + [StringLength(1023)] + public string HelpTopicLink { get; set; } = null!; + + public DateTime HelpTopicLastModified { get; set; } + + [Column("HelpTopicGUID")] + public Guid HelpTopicGuid { get; set; } + + public int? HelpTopicOrder { get; set; } + + public string? HelpTopicVisibilityCondition { get; set; } + + [ForeignKey("HelpTopicUielementId")] + [InverseProperty("CmsHelpTopics")] + public virtual CmsUielement HelpTopicUielement { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsLayout.cs b/Migration.Tool.KX13/Models/CmsLayout.cs new file mode 100644 index 00000000..35cb2bb0 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsLayout.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Layout")] +[Index("LayoutDisplayName", Name = "IX_CMS_Layout_LayoutDisplayName")] +public class CmsLayout +{ + [Key] + [Column("LayoutID")] + public int LayoutId { get; set; } + + [StringLength(100)] + public string LayoutCodeName { get; set; } = null!; + + [StringLength(200)] + public string LayoutDisplayName { get; set; } = null!; + + public string? LayoutDescription { get; set; } + + public string LayoutCode { get; set; } = null!; + + [Column("LayoutVersionGUID")] + [StringLength(50)] + public string? LayoutVersionGuid { get; set; } + + [Column("LayoutGUID")] + public Guid LayoutGuid { get; set; } + + public DateTime LayoutLastModified { get; set; } + + [StringLength(50)] + public string? LayoutType { get; set; } + + [Column("LayoutCSS")] + public string? LayoutCss { get; set; } + + [InverseProperty("PageTemplateLayoutNavigation")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsLicenseKey.cs b/Migration.Tool.KX13/Models/CmsLicenseKey.cs new file mode 100644 index 00000000..effbdef9 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsLicenseKey.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_LicenseKey")] +public class CmsLicenseKey +{ + [Key] + [Column("LicenseKeyID")] + public int LicenseKeyId { get; set; } + + [StringLength(255)] + public string? LicenseDomain { get; set; } + + public string? LicenseKey { get; set; } + + [StringLength(200)] + public string? LicenseEdition { get; set; } + + [StringLength(200)] + public string? LicenseExpiration { get; set; } + + public int? LicenseServers { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsMacroIdentity.cs b/Migration.Tool.KX13/Models/CmsMacroIdentity.cs new file mode 100644 index 00000000..2df2578c --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsMacroIdentity.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_MacroIdentity")] +[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] +public class CmsMacroIdentity +{ + [Key] + [Column("MacroIdentityID")] + public int MacroIdentityId { get; set; } + + public Guid MacroIdentityGuid { get; set; } + + public DateTime MacroIdentityLastModified { get; set; } + + [StringLength(200)] + public string MacroIdentityName { get; set; } = null!; + + [Column("MacroIdentityEffectiveUserID")] + public int? MacroIdentityEffectiveUserId { get; set; } + + [InverseProperty("UserMacroIdentityMacroIdentity")] + public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); + + [ForeignKey("MacroIdentityEffectiveUserId")] + [InverseProperty("CmsMacroIdentities")] + public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsMacroRule.cs b/Migration.Tool.KX13/Models/CmsMacroRule.cs new file mode 100644 index 00000000..41f0502d --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsMacroRule.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_MacroRule")] +public class CmsMacroRule +{ + [Key] + [Column("MacroRuleID")] + public int MacroRuleId { get; set; } + + [StringLength(200)] + public string MacroRuleName { get; set; } = null!; + + [StringLength(1000)] + public string MacroRuleText { get; set; } = null!; + + public string? MacroRuleParameters { get; set; } + + [StringLength(100)] + public string? MacroRuleResourceName { get; set; } + + public DateTime MacroRuleLastModified { get; set; } + + [Column("MacroRuleGUID")] + public Guid MacroRuleGuid { get; set; } + + public string MacroRuleCondition { get; set; } = null!; + + [StringLength(500)] + public string MacroRuleDisplayName { get; set; } = null!; + + public bool? MacroRuleIsCustom { get; set; } + + public bool MacroRuleRequiresContext { get; set; } + + [StringLength(450)] + public string? MacroRuleDescription { get; set; } + + [StringLength(2500)] + public string? MacroRuleRequiredData { get; set; } + + public bool? MacroRuleEnabled { get; set; } + + public int? MacroRuleAvailability { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsMembership.cs b/Migration.Tool.KX13/Models/CmsMembership.cs new file mode 100644 index 00000000..736094a7 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsMembership.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Membership")] +[Index("MembershipSiteId", Name = "IX_CMS_Membership_MembershipSiteID")] +public class CmsMembership +{ + [Key] + [Column("MembershipID")] + public int MembershipId { get; set; } + + [StringLength(200)] + public string MembershipName { get; set; } = null!; + + [StringLength(200)] + public string MembershipDisplayName { get; set; } = null!; + + public string? MembershipDescription { get; set; } + + public DateTime MembershipLastModified { get; set; } + + [Column("MembershipGUID")] + public Guid MembershipGuid { get; set; } + + [Column("MembershipSiteID")] + public int? MembershipSiteId { get; set; } + + [InverseProperty("Membership")] + public virtual ICollection CmsMembershipUsers { get; set; } = new List(); + + [ForeignKey("MembershipSiteId")] + [InverseProperty("CmsMemberships")] + public virtual CmsSite? MembershipSite { get; set; } + + [ForeignKey("MembershipId")] + [InverseProperty("Memberships")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsMembershipUser.cs b/Migration.Tool.KX13/Models/CmsMembershipUser.cs new file mode 100644 index 00000000..76d39cdd --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsMembershipUser.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_MembershipUser")] +[Index("MembershipId", "UserId", Name = "IX_CMS_MembershipUser_MembershipID_UserID", IsUnique = true)] +[Index("UserId", Name = "IX_CMS_MembershipUser_UserID")] +public class CmsMembershipUser +{ + [Key] + [Column("MembershipUserID")] + public int MembershipUserId { get; set; } + + [Column("MembershipID")] + public int MembershipId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + public DateTime? ValidTo { get; set; } + + public bool? SendNotification { get; set; } + + [ForeignKey("MembershipId")] + [InverseProperty("CmsMembershipUsers")] + public virtual CmsMembership Membership { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsMembershipUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsMetaFile.cs b/Migration.Tool.KX13/Models/CmsMetaFile.cs new file mode 100644 index 00000000..80cdb386 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsMetaFile.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_MetaFile")] +[Index("MetaFileGuid", "MetaFileSiteId", "MetaFileObjectType", "MetaFileObjectId", "MetaFileGroupName", Name = "IX_CMS_MetaFile_MetaFileGUID_MetaFileSiteID_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName")] +[Index("MetaFileSiteId", Name = "IX_CMS_MetaFile_MetaFileSiteID")] +public class CmsMetaFile +{ + [Key] + [Column("MetaFileID")] + public int MetaFileId { get; set; } + + [Column("MetaFileObjectID")] + public int MetaFileObjectId { get; set; } + + [StringLength(100)] + public string MetaFileObjectType { get; set; } = null!; + + [StringLength(100)] + public string? MetaFileGroupName { get; set; } + + [StringLength(250)] + public string MetaFileName { get; set; } = null!; + + [StringLength(50)] + public string MetaFileExtension { get; set; } = null!; + + public int MetaFileSize { get; set; } + + [StringLength(100)] + public string MetaFileMimeType { get; set; } = null!; + + public byte[]? MetaFileBinary { get; set; } + + public int? MetaFileImageWidth { get; set; } + + public int? MetaFileImageHeight { get; set; } + + [Column("MetaFileGUID")] + public Guid MetaFileGuid { get; set; } + + public DateTime MetaFileLastModified { get; set; } + + [Column("MetaFileSiteID")] + public int? MetaFileSiteId { get; set; } + + [StringLength(250)] + public string? MetaFileTitle { get; set; } + + public string? MetaFileDescription { get; set; } + + public string? MetaFileCustomData { get; set; } + + [ForeignKey("MetaFileSiteId")] + [InverseProperty("CmsMetaFiles")] + public virtual CmsSite? MetaFileSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsModuleLicenseKey.cs b/Migration.Tool.KX13/Models/CmsModuleLicenseKey.cs new file mode 100644 index 00000000..ae4c9fe6 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsModuleLicenseKey.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_ModuleLicenseKey")] +[Index("ModuleLicenseKeyResourceId", Name = "IX_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID")] +public class CmsModuleLicenseKey +{ + [Key] + [Column("ModuleLicenseKeyID")] + public int ModuleLicenseKeyId { get; set; } + + public Guid ModuleLicenseKeyGuid { get; set; } + + public DateTime ModuleLicenseKeyLastModified { get; set; } + + public string ModuleLicenseKeyLicense { get; set; } = null!; + + [Column("ModuleLicenseKeyResourceID")] + public int ModuleLicenseKeyResourceId { get; set; } + + [ForeignKey("ModuleLicenseKeyResourceId")] + [InverseProperty("CmsModuleLicenseKeys")] + public virtual CmsResource ModuleLicenseKeyResource { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsModuleUsageCounter.cs b/Migration.Tool.KX13/Models/CmsModuleUsageCounter.cs new file mode 100644 index 00000000..1844c54f --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsModuleUsageCounter.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +[Table("CMS_ModuleUsageCounter")] +public class CmsModuleUsageCounter +{ + [Column("ModuleUsageCounterID")] + public int ModuleUsageCounterId { get; set; } + + [StringLength(200)] + public string ModuleUsageCounterName { get; set; } = null!; + + public long ModuleUsageCounterValue { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsObjectSetting.cs b/Migration.Tool.KX13/Models/CmsObjectSetting.cs new file mode 100644 index 00000000..33202b4b --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsObjectSetting.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_ObjectSettings")] +[Index("ObjectCheckedOutByUserId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutByUserID")] +[Index("ObjectCheckedOutVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID")] +[Index("ObjectPublishedVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectPublishedVersionHistoryID")] +[Index("ObjectSettingsObjectId", "ObjectSettingsObjectType", Name = "IX_CMS_ObjectSettings_ObjectSettingsObjectType_ObjectSettingsObjectID", IsUnique = true)] +[Index("ObjectWorkflowStepId", Name = "IX_CMS_ObjectSettings_ObjectWorkflowStepID")] +public class CmsObjectSetting +{ + [Key] + [Column("ObjectSettingsID")] + public int ObjectSettingsId { get; set; } + + public string? ObjectTags { get; set; } + + [Column("ObjectCheckedOutByUserID")] + public int? ObjectCheckedOutByUserId { get; set; } + + public DateTime? ObjectCheckedOutWhen { get; set; } + + [Column("ObjectCheckedOutVersionHistoryID")] + public int? ObjectCheckedOutVersionHistoryId { get; set; } + + [Column("ObjectWorkflowStepID")] + public int? ObjectWorkflowStepId { get; set; } + + [Column("ObjectPublishedVersionHistoryID")] + public int? ObjectPublishedVersionHistoryId { get; set; } + + [Column("ObjectSettingsObjectID")] + public int ObjectSettingsObjectId { get; set; } + + [StringLength(100)] + public string ObjectSettingsObjectType { get; set; } = null!; + + public string? ObjectComments { get; set; } + + public bool? ObjectWorkflowSendEmails { get; set; } + + [ForeignKey("ObjectCheckedOutByUserId")] + [InverseProperty("CmsObjectSettings")] + public virtual CmsUser? ObjectCheckedOutByUser { get; set; } + + [ForeignKey("ObjectCheckedOutVersionHistoryId")] + [InverseProperty("CmsObjectSettingObjectCheckedOutVersionHistories")] + public virtual CmsObjectVersionHistory? ObjectCheckedOutVersionHistory { get; set; } + + [ForeignKey("ObjectPublishedVersionHistoryId")] + [InverseProperty("CmsObjectSettingObjectPublishedVersionHistories")] + public virtual CmsObjectVersionHistory? ObjectPublishedVersionHistory { get; set; } + + [ForeignKey("ObjectWorkflowStepId")] + [InverseProperty("CmsObjectSettings")] + public virtual CmsWorkflowStep? ObjectWorkflowStep { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsObjectVersionHistory.cs b/Migration.Tool.KX13/Models/CmsObjectVersionHistory.cs new file mode 100644 index 00000000..42f832da --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsObjectVersionHistory.cs @@ -0,0 +1,72 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_ObjectVersionHistory")] +[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionModifiedByUserId", Name = "IX_CMS_ObjectVersionHistory_VersionModifiedByUserID")] +[Index("VersionObjectSiteId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectSiteID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionObjectType", "VersionObjectId", "VersionModifiedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectType_VersionObjectID_VersionModifiedWhen", IsDescending = new[] { false, false, true })] +public class CmsObjectVersionHistory +{ + [Key] + [Column("VersionID")] + public int VersionId { get; set; } + + [Column("VersionObjectID")] + public int? VersionObjectId { get; set; } + + [StringLength(100)] + public string VersionObjectType { get; set; } = null!; + + [Column("VersionObjectSiteID")] + public int? VersionObjectSiteId { get; set; } + + [StringLength(450)] + public string VersionObjectDisplayName { get; set; } = null!; + + [Column("VersionXML")] + public string VersionXml { get; set; } = null!; + + [Column("VersionBinaryDataXML")] + public string? VersionBinaryDataXml { get; set; } + + [Column("VersionModifiedByUserID")] + public int? VersionModifiedByUserId { get; set; } + + public DateTime VersionModifiedWhen { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [StringLength(50)] + public string VersionNumber { get; set; } = null!; + + [Column("VersionSiteBindingIDs")] + public string? VersionSiteBindingIds { get; set; } + + public string? VersionComment { get; set; } + + [InverseProperty("ObjectCheckedOutVersionHistory")] + public virtual ICollection CmsObjectSettingObjectCheckedOutVersionHistories { get; set; } = new List(); + + [InverseProperty("ObjectPublishedVersionHistory")] + public virtual ICollection CmsObjectSettingObjectPublishedVersionHistories { get; set; } = new List(); + + [ForeignKey("VersionDeletedByUserId")] + [InverseProperty("CmsObjectVersionHistoryVersionDeletedByUsers")] + public virtual CmsUser? VersionDeletedByUser { get; set; } + + [ForeignKey("VersionModifiedByUserId")] + [InverseProperty("CmsObjectVersionHistoryVersionModifiedByUsers")] + public virtual CmsUser? VersionModifiedByUser { get; set; } + + [ForeignKey("VersionObjectSiteId")] + [InverseProperty("CmsObjectVersionHistories")] + public virtual CmsSite? VersionObjectSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsObjectWorkflowTrigger.cs b/Migration.Tool.KX13/Models/CmsObjectWorkflowTrigger.cs new file mode 100644 index 00000000..d6794396 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsObjectWorkflowTrigger.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_ObjectWorkflowTrigger")] +[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] +public class CmsObjectWorkflowTrigger +{ + [Key] + [Column("TriggerID")] + public int TriggerId { get; set; } + + [Column("TriggerGUID")] + public Guid TriggerGuid { get; set; } + + public DateTime TriggerLastModified { get; set; } + + public int TriggerType { get; set; } + + public string? TriggerMacroCondition { get; set; } + + [Column("TriggerWorkflowID")] + public int TriggerWorkflowId { get; set; } + + [StringLength(450)] + public string TriggerDisplayName { get; set; } = null!; + + [StringLength(100)] + public string TriggerObjectType { get; set; } = null!; + + public string? TriggerParameters { get; set; } + + [StringLength(100)] + public string? TriggerTargetObjectType { get; set; } + + [Column("TriggerTargetObjectID")] + public int? TriggerTargetObjectId { get; set; } + + [ForeignKey("TriggerWorkflowId")] + [InverseProperty("CmsObjectWorkflowTriggers")] + public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsPageFormerUrlPath.cs b/Migration.Tool.KX13/Models/CmsPageFormerUrlPath.cs new file mode 100644 index 00000000..87dfebb3 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsPageFormerUrlPath.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_PageFormerUrlPath")] +[Index("PageFormerUrlPathNodeId", Name = "IX_CMS_PageFormerUrlPath_PageFormerUrlPathNodeID")] +[Index("PageFormerUrlPathSiteId", Name = "IX_CMS_PageFormerUrlPath_PageFormerUrlPathSiteID")] +[Index("PageFormerUrlPathUrlPathHash", "PageFormerUrlPathCulture", "PageFormerUrlPathSiteId", Name = "IX_CMS_PageFormerUrlPath_UrlPathHash_Culture_SiteID", IsUnique = true)] +public class CmsPageFormerUrlPath +{ + [Key] + [Column("PageFormerUrlPathID")] + public int PageFormerUrlPathId { get; set; } + + [StringLength(2000)] + public string PageFormerUrlPathUrlPath { get; set; } = null!; + + [StringLength(64)] + public string PageFormerUrlPathUrlPathHash { get; set; } = null!; + + [StringLength(50)] + public string PageFormerUrlPathCulture { get; set; } = null!; + + [Column("PageFormerUrlPathNodeID")] + public int PageFormerUrlPathNodeId { get; set; } + + [Column("PageFormerUrlPathSiteID")] + public int PageFormerUrlPathSiteId { get; set; } + + public DateTime PageFormerUrlPathLastModified { get; set; } + + [ForeignKey("PageFormerUrlPathNodeId")] + [InverseProperty("CmsPageFormerUrlPaths")] + public virtual CmsTree PageFormerUrlPathNode { get; set; } = null!; + + [ForeignKey("PageFormerUrlPathSiteId")] + [InverseProperty("CmsPageFormerUrlPaths")] + public virtual CmsSite PageFormerUrlPathSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsPageTemplate.cs b/Migration.Tool.KX13/Models/CmsPageTemplate.cs new file mode 100644 index 00000000..2cf85519 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsPageTemplate.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_PageTemplate")] +[Index("PageTemplateCodeName", "PageTemplateDisplayName", Name = "IX_CMS_PageTemplate_PageTemplateCodeName_PageTemplateDisplayName")] +[Index("PageTemplateLayoutId", Name = "IX_CMS_PageTemplate_PageTemplateLayoutID")] +public class CmsPageTemplate +{ + [Key] + [Column("PageTemplateID")] + public int PageTemplateId { get; set; } + + [StringLength(200)] + public string PageTemplateDisplayName { get; set; } = null!; + + [StringLength(100)] + public string PageTemplateCodeName { get; set; } = null!; + + public string? PageTemplateDescription { get; set; } + + [Column("PageTemplateCategoryID")] + public int? PageTemplateCategoryId { get; set; } + + [Column("PageTemplateLayoutID")] + public int? PageTemplateLayoutId { get; set; } + + public string? PageTemplateWebParts { get; set; } + + public string? PageTemplateLayout { get; set; } + + [Column("PageTemplateVersionGUID")] + [StringLength(200)] + public string? PageTemplateVersionGuid { get; set; } + + [Column("PageTemplateGUID")] + public Guid PageTemplateGuid { get; set; } + + public DateTime PageTemplateLastModified { get; set; } + + [StringLength(10)] + public string PageTemplateType { get; set; } = null!; + + [StringLength(50)] + public string? PageTemplateLayoutType { get; set; } + + [Column("PageTemplateCSS")] + public string? PageTemplateCss { get; set; } + + [Column("PageTemplateThumbnailGUID")] + public Guid? PageTemplateThumbnailGuid { get; set; } + + public string? PageTemplateProperties { get; set; } + + public bool? PageTemplateIsLayout { get; set; } + + [StringLength(200)] + public string? PageTemplateIconClass { get; set; } + + [InverseProperty("ElementPageTemplate")] + public virtual ICollection CmsUielements { get; set; } = new List(); + + [ForeignKey("PageTemplateCategoryId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsPageTemplateCategory? PageTemplateCategory { get; set; } + + [ForeignKey("PageTemplateLayoutId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsLayout? PageTemplateLayoutNavigation { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsPageTemplateCategory.cs b/Migration.Tool.KX13/Models/CmsPageTemplateCategory.cs new file mode 100644 index 00000000..a079bf60 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsPageTemplateCategory.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_PageTemplateCategory")] +[Index("CategoryLevel", Name = "IX_CMS_PageTemplateCategory_CategoryLevel")] +[Index("CategoryParentId", Name = "IX_CMS_PageTemplateCategory_CategoryParentID")] +public class CmsPageTemplateCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(200)] + public string? CategoryName { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryTemplateChildCount { get; set; } + + public string? CategoryPath { get; set; } + + public int? CategoryLevel { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsPageTemplateCategory? CategoryParent { get; set; } + + [InverseProperty("PageTemplateCategory")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsPageTemplateConfiguration.cs b/Migration.Tool.KX13/Models/CmsPageTemplateConfiguration.cs new file mode 100644 index 00000000..e273f1cf --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsPageTemplateConfiguration.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_PageTemplateConfiguration")] +[Index("PageTemplateConfigurationSiteId", Name = "IX_CMS_PageTemplateConfiguration_PageTemplateConfigurationSiteID")] +public class CmsPageTemplateConfiguration +{ + [Key] + [Column("PageTemplateConfigurationID")] + public int PageTemplateConfigurationId { get; set; } + + [Column("PageTemplateConfigurationGUID")] + public Guid PageTemplateConfigurationGuid { get; set; } + + [Column("PageTemplateConfigurationSiteID")] + public int PageTemplateConfigurationSiteId { get; set; } + + public DateTime PageTemplateConfigurationLastModified { get; set; } + + [StringLength(200)] + public string PageTemplateConfigurationName { get; set; } = null!; + + public string? PageTemplateConfigurationDescription { get; set; } + + [Column("PageTemplateConfigurationThumbnailGUID")] + public Guid? PageTemplateConfigurationThumbnailGuid { get; set; } + + public string PageTemplateConfigurationTemplate { get; set; } = null!; + + public string? PageTemplateConfigurationWidgets { get; set; } + + [ForeignKey("PageTemplateConfigurationSiteId")] + [InverseProperty("CmsPageTemplateConfigurations")] + public virtual CmsSite PageTemplateConfigurationSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsPageUrlPath.cs b/Migration.Tool.KX13/Models/CmsPageUrlPath.cs new file mode 100644 index 00000000..edbdddb4 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsPageUrlPath.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_PageUrlPath")] +[Index("PageUrlPathNodeId", Name = "IX_CMS_PageUrlPath_PageUrlPathNodeID")] +[Index("PageUrlPathSiteId", Name = "IX_CMS_PageUrlPath_PageUrlPathSiteID")] +[Index("PageUrlPathUrlPathHash", "PageUrlPathCulture", "PageUrlPathSiteId", Name = "IX_CMS_PageUrlPath_PageUrlPathUrlPathHash_PageUrlPathCulture_PageUrlPathSiteID", IsUnique = true)] +public class CmsPageUrlPath +{ + [Key] + [Column("PageUrlPathID")] + public int PageUrlPathId { get; set; } + + [Column("PageUrlPathGUID")] + public Guid PageUrlPathGuid { get; set; } + + [StringLength(50)] + public string PageUrlPathCulture { get; set; } = null!; + + [Column("PageUrlPathNodeID")] + public int PageUrlPathNodeId { get; set; } + + [StringLength(2000)] + public string PageUrlPathUrlPath { get; set; } = null!; + + [StringLength(64)] + public string PageUrlPathUrlPathHash { get; set; } = null!; + + [Column("PageUrlPathSiteID")] + public int PageUrlPathSiteId { get; set; } + + public DateTime PageUrlPathLastModified { get; set; } + + [ForeignKey("PageUrlPathNodeId")] + [InverseProperty("CmsPageUrlPaths")] + public virtual CmsTree PageUrlPathNode { get; set; } = null!; + + [ForeignKey("PageUrlPathSiteId")] + [InverseProperty("CmsPageUrlPaths")] + public virtual CmsSite PageUrlPathSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsPermission.cs b/Migration.Tool.KX13/Models/CmsPermission.cs new file mode 100644 index 00000000..a7127cb8 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsPermission.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Permission")] +[Index("ClassId", "PermissionName", Name = "IX_CMS_Permission_ClassID_PermissionName")] +[Index("ResourceId", "PermissionName", Name = "IX_CMS_Permission_ResourceID_PermissionName")] +public class CmsPermission +{ + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [StringLength(100)] + public string PermissionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string PermissionName { get; set; } = null!; + + [Column("ClassID")] + public int? ClassId { get; set; } + + [Column("ResourceID")] + public int? ResourceId { get; set; } + + [Column("PermissionGUID")] + public Guid PermissionGuid { get; set; } + + public DateTime PermissionLastModified { get; set; } + + public string? PermissionDescription { get; set; } + + public bool? PermissionDisplayInMatrix { get; set; } + + public int? PermissionOrder { get; set; } + + public bool? PermissionEditableByGlobalAdmin { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsPermissions")] + public virtual CmsClass? Class { get; set; } + + [InverseProperty("Permission")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); + + [ForeignKey("ResourceId")] + [InverseProperty("CmsPermissions")] + public virtual CmsResource? Resource { get; set; } + + [ForeignKey("PermissionId")] + [InverseProperty("Permissions")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsPersonalization.cs b/Migration.Tool.KX13/Models/CmsPersonalization.cs new file mode 100644 index 00000000..61418b61 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsPersonalization.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Personalization")] +[Index("PersonalizationSiteId", Name = "IX_CMS_Personalization_PersonalizationSiteID_SiteID")] +[Index("PersonalizationUserId", Name = "IX_CMS_Personalization_PersonalizationUserID")] +public class CmsPersonalization +{ + [Key] + [Column("PersonalizationID")] + public int PersonalizationId { get; set; } + + [Column("PersonalizationGUID")] + public Guid PersonalizationGuid { get; set; } + + public DateTime PersonalizationLastModified { get; set; } + + [Column("PersonalizationUserID")] + public int? PersonalizationUserId { get; set; } + + public string? PersonalizationWebParts { get; set; } + + [StringLength(200)] + public string? PersonalizationDashboardName { get; set; } + + [Column("PersonalizationSiteID")] + public int? PersonalizationSiteId { get; set; } + + [ForeignKey("PersonalizationSiteId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsSite? PersonalizationSite { get; set; } + + [ForeignKey("PersonalizationUserId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsUser? PersonalizationUser { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsQuery.cs b/Migration.Tool.KX13/Models/CmsQuery.cs new file mode 100644 index 00000000..59f744c7 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsQuery.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Query")] +[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] +public class CmsQuery +{ + [Key] + [Column("QueryID")] + public int QueryId { get; set; } + + [StringLength(100)] + public string QueryName { get; set; } = null!; + + [Column("QueryTypeID")] + public int QueryTypeId { get; set; } + + public string QueryText { get; set; } = null!; + + public bool QueryRequiresTransaction { get; set; } + + [Column("ClassID")] + public int? ClassId { get; set; } + + public bool QueryIsLocked { get; set; } + + public DateTime QueryLastModified { get; set; } + + [Column("QueryGUID")] + public Guid QueryGuid { get; set; } + + public bool? QueryIsCustom { get; set; } + + [StringLength(100)] + public string? QueryConnectionString { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsQueries")] + public virtual CmsClass? Class { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsRelationship.cs b/Migration.Tool.KX13/Models/CmsRelationship.cs new file mode 100644 index 00000000..e523c99a --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsRelationship.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Relationship")] +[Index("LeftNodeId", Name = "IX_CMS_Relationship_LeftNodeID")] +[Index("RelationshipNameId", Name = "IX_CMS_Relationship_RelationshipNameID")] +[Index("RightNodeId", Name = "IX_CMS_Relationship_RightNodeID")] +public class CmsRelationship +{ + [Key] + [Column("RelationshipID")] + public int RelationshipId { get; set; } + + [Column("LeftNodeID")] + public int LeftNodeId { get; set; } + + [Column("RightNodeID")] + public int RightNodeId { get; set; } + + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + public string? RelationshipCustomData { get; set; } + + public int? RelationshipOrder { get; set; } + + public bool? RelationshipIsAdHoc { get; set; } + + [ForeignKey("LeftNodeId")] + [InverseProperty("CmsRelationshipLeftNodes")] + public virtual CmsTree LeftNode { get; set; } = null!; + + [ForeignKey("RelationshipNameId")] + [InverseProperty("CmsRelationships")] + public virtual CmsRelationshipName RelationshipName { get; set; } = null!; + + [ForeignKey("RightNodeId")] + [InverseProperty("CmsRelationshipRightNodes")] + public virtual CmsTree RightNode { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsRelationshipName.cs b/Migration.Tool.KX13/Models/CmsRelationshipName.cs new file mode 100644 index 00000000..07a35678 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsRelationshipName.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_RelationshipName")] +[Index("RelationshipAllowedObjects", Name = "IX_CMS_RelationshipName_RelationshipAllowedObjects")] +[Index("RelationshipName", "RelationshipDisplayName", Name = "IX_CMS_RelationshipName_RelationshipName_RelationshipDisplayName")] +public class CmsRelationshipName +{ + [Key] + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + [StringLength(200)] + public string RelationshipDisplayName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipName { get; set; } = null!; + + public string? RelationshipAllowedObjects { get; set; } + + [Column("RelationshipGUID")] + public Guid RelationshipGuid { get; set; } + + public DateTime RelationshipLastModified { get; set; } + + public bool? RelationshipNameIsAdHoc { get; set; } + + [InverseProperty("RelationshipName")] + public virtual ICollection CmsRelationships { get; set; } = new List(); + + [ForeignKey("RelationshipNameId")] + [InverseProperty("RelationshipNames")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsResource.cs b/Migration.Tool.KX13/Models/CmsResource.cs new file mode 100644 index 00000000..320425ba --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsResource.cs @@ -0,0 +1,84 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Resource")] +[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] +public class CmsResource +{ + [Key] + [Column("ResourceID")] + public int ResourceId { get; set; } + + [StringLength(100)] + public string ResourceDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + public string? ResourceDescription { get; set; } + + public bool? ShowInDevelopment { get; set; } + + [Column("ResourceURL")] + [StringLength(1000)] + public string? ResourceUrl { get; set; } + + [Column("ResourceGUID")] + public Guid ResourceGuid { get; set; } + + public DateTime ResourceLastModified { get; set; } + + public bool? ResourceIsInDevelopment { get; set; } + + public bool? ResourceHasFiles { get; set; } + + [StringLength(200)] + public string? ResourceVersion { get; set; } + + [StringLength(200)] + public string? ResourceAuthor { get; set; } + + [StringLength(50)] + public string? ResourceInstallationState { get; set; } + + [StringLength(50)] + public string? ResourceInstalledVersion { get; set; } + + [InverseProperty("ClassResource")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("UserControlResource")] + public virtual ICollection CmsFormUserControls { get; set; } = new List(); + + [InverseProperty("ModuleLicenseKeyResource")] + public virtual ICollection CmsModuleLicenseKeys { get; set; } = new List(); + + [InverseProperty("Resource")] + public virtual ICollection CmsPermissions { get; set; } = new List(); + + [InverseProperty("ResourceLibraryResource")] + public virtual ICollection CmsResourceLibraries { get; set; } = new List(); + + [InverseProperty("TaskResource")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("CategoryResource")] + public virtual ICollection CmsSettingsCategories { get; set; } = new List(); + + [InverseProperty("ElementResource")] + public virtual ICollection CmsUielements { get; set; } = new List(); + + [InverseProperty("WebPartResource")] + public virtual ICollection CmsWebParts { get; set; } = new List(); + + [InverseProperty("ActionResource")] + public virtual ICollection CmsWorkflowActions { get; set; } = new List(); + + [ForeignKey("ResourceId")] + [InverseProperty("Resources")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsResourceLibrary.cs b/Migration.Tool.KX13/Models/CmsResourceLibrary.cs new file mode 100644 index 00000000..c9fdf2f3 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsResourceLibrary.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_ResourceLibrary")] +[Index("ResourceLibraryResourceId", Name = "IX_CMS_ResourceLibrary")] +public class CmsResourceLibrary +{ + [Key] + [Column("ResourceLibraryID")] + public int ResourceLibraryId { get; set; } + + [Column("ResourceLibraryResourceID")] + public int ResourceLibraryResourceId { get; set; } + + [StringLength(200)] + public string ResourceLibraryPath { get; set; } = null!; + + [ForeignKey("ResourceLibraryResourceId")] + [InverseProperty("CmsResourceLibraries")] + public virtual CmsResource ResourceLibraryResource { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsResourceString.cs b/Migration.Tool.KX13/Models/CmsResourceString.cs new file mode 100644 index 00000000..bdb4cae3 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsResourceString.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_ResourceString")] +[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] +public class CmsResourceString +{ + [Key] + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("StringGUID")] + public Guid StringGuid { get; set; } + + [InverseProperty("TranslationString")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsResourceTranslation.cs b/Migration.Tool.KX13/Models/CmsResourceTranslation.cs new file mode 100644 index 00000000..8882a85e --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsResourceTranslation.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_ResourceTranslation")] +[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] +[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] +public class CmsResourceTranslation +{ + [Key] + [Column("TranslationID")] + public int TranslationId { get; set; } + + [Column("TranslationStringID")] + public int TranslationStringId { get; set; } + + public string? TranslationText { get; set; } + + [Column("TranslationCultureID")] + public int TranslationCultureId { get; set; } + + [ForeignKey("TranslationCultureId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsCulture TranslationCulture { get; set; } = null!; + + [ForeignKey("TranslationStringId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsResourceString TranslationString { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsRole.cs b/Migration.Tool.KX13/Models/CmsRole.cs new file mode 100644 index 00000000..2c8bbe9d --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsRole.cs @@ -0,0 +1,72 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Role")] +[Index("SiteId", "RoleId", Name = "IX_CMS_Role_SiteID_RoleID")] +public class CmsRole +{ + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + public DateTime RoleLastModified { get; set; } + + public bool? RoleIsDomain { get; set; } + + [InverseProperty("Role")] + public virtual ICollection CmsAclitems { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("CmsRoles")] + public virtual CmsSite? Site { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Elements { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("RolesNavigation")] + public virtual ICollection ElementsNavigation { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Forms { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Memberships { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Permissions { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsScheduledTask.cs b/Migration.Tool.KX13/Models/CmsScheduledTask.cs new file mode 100644 index 00000000..9ffe2364 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsScheduledTask.cs @@ -0,0 +1,113 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_ScheduledTask")] +[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] +[Index("TaskResourceId", Name = "IX_CMS_ScheduledTask_TaskResourceID")] +[Index("TaskSiteId", "TaskDisplayName", Name = "IX_CMS_ScheduledTask_TaskSiteID_TaskDisplayName")] +[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] +public class CmsScheduledTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(200)] + public string TaskName { get; set; } = null!; + + [StringLength(200)] + public string TaskDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TaskAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string? TaskClass { get; set; } + + [StringLength(1000)] + public string TaskInterval { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime? TaskLastRunTime { get; set; } + + public DateTime? TaskNextRunTime { get; set; } + + public string? TaskLastResult { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + public bool? TaskDeleteAfterLastRun { get; set; } + + [StringLength(100)] + public string? TaskServerName { get; set; } + + [Column("TaskGUID")] + public Guid TaskGuid { get; set; } + + public DateTime TaskLastModified { get; set; } + + public int? TaskExecutions { get; set; } + + [Column("TaskResourceID")] + public int? TaskResourceId { get; set; } + + public bool? TaskRunInSeparateThread { get; set; } + + public bool? TaskUseExternalService { get; set; } + + public bool? TaskAllowExternalService { get; set; } + + public DateTime? TaskLastExecutionReset { get; set; } + + [StringLength(400)] + public string? TaskCondition { get; set; } + + public bool? TaskRunIndividually { get; set; } + + [Column("TaskUserID")] + public int? TaskUserId { get; set; } + + public int? TaskType { get; set; } + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [StringLength(200)] + public string? TaskExecutingServerName { get; set; } + + public bool TaskEnabled { get; set; } + + public bool TaskIsRunning { get; set; } + + public int TaskAvailability { get; set; } + + [InverseProperty("CampaignScheduledTask")] + public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); + + [InverseProperty("TestWinnerScheduledTask")] + public virtual ICollection NewsletterAbtests { get; set; } = new List(); + + [InverseProperty("NewsletterDynamicScheduledTask")] + public virtual ICollection NewsletterNewsletters { get; set; } = new List(); + + [ForeignKey("TaskResourceId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsResource? TaskResource { get; set; } + + [ForeignKey("TaskSiteId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsSite? TaskSite { get; set; } + + [ForeignKey("TaskUserId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsUser? TaskUser { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsSearchEngine.cs b/Migration.Tool.KX13/Models/CmsSearchEngine.cs new file mode 100644 index 00000000..67ad9f84 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsSearchEngine.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_SearchEngine")] +public class CmsSearchEngine +{ + [Key] + [Column("SearchEngineID")] + public int SearchEngineId { get; set; } + + [StringLength(200)] + public string SearchEngineDisplayName { get; set; } = null!; + + [StringLength(200)] + public string SearchEngineName { get; set; } = null!; + + [StringLength(450)] + public string SearchEngineDomainRule { get; set; } = null!; + + [StringLength(200)] + public string? SearchEngineKeywordParameter { get; set; } + + [Column("SearchEngineGUID")] + public Guid SearchEngineGuid { get; set; } + + public DateTime SearchEngineLastModified { get; set; } + + [StringLength(200)] + public string? SearchEngineCrawler { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsSearchIndex.cs b/Migration.Tool.KX13/Models/CmsSearchIndex.cs new file mode 100644 index 00000000..b8911017 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsSearchIndex.cs @@ -0,0 +1,74 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_SearchIndex")] +public class CmsSearchIndex +{ + [Key] + [Column("IndexID")] + public int IndexId { get; set; } + + [StringLength(200)] + public string IndexName { get; set; } = null!; + + [StringLength(200)] + public string IndexDisplayName { get; set; } = null!; + + [StringLength(200)] + public string? IndexAnalyzerType { get; set; } + + public string? IndexSettings { get; set; } + + [Column("IndexGUID")] + public Guid IndexGuid { get; set; } + + public DateTime IndexLastModified { get; set; } + + public DateTime? IndexLastRebuildTime { get; set; } + + [StringLength(200)] + public string IndexType { get; set; } = null!; + + [StringLength(200)] + public string? IndexStopWordsFile { get; set; } + + [StringLength(200)] + public string? IndexCustomAnalyzerAssemblyName { get; set; } + + [StringLength(200)] + public string? IndexCustomAnalyzerClassName { get; set; } + + public int? IndexBatchSize { get; set; } + + [StringLength(10)] + public string? IndexStatus { get; set; } + + public DateTime? IndexLastUpdate { get; set; } + + public bool? IndexIsOutdated { get; set; } + + [StringLength(200)] + public string IndexProvider { get; set; } = null!; + + [StringLength(200)] + public string? IndexSearchServiceName { get; set; } + + [StringLength(200)] + public string? IndexAdminKey { get; set; } + + [StringLength(200)] + public string? IndexQueryKey { get; set; } + + [StringLength(200)] + public string? IndexCrawlerUser { get; set; } + + [ForeignKey("IndexId")] + [InverseProperty("Indices")] + public virtual ICollection IndexCultures { get; set; } = new List(); + + [ForeignKey("IndexId")] + [InverseProperty("Indices")] + public virtual ICollection IndexSites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsSearchTask.cs b/Migration.Tool.KX13/Models/CmsSearchTask.cs new file mode 100644 index 00000000..4147cf26 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsSearchTask.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_SearchTask")] +public class CmsSearchTask +{ + [Key] + [Column("SearchTaskID")] + public int SearchTaskId { get; set; } + + [StringLength(100)] + public string SearchTaskType { get; set; } = null!; + + [StringLength(100)] + public string? SearchTaskObjectType { get; set; } + + [StringLength(200)] + public string? SearchTaskField { get; set; } + + [StringLength(600)] + public string SearchTaskValue { get; set; } = null!; + + [StringLength(200)] + public string? SearchTaskServerName { get; set; } + + [StringLength(100)] + public string SearchTaskStatus { get; set; } = null!; + + public int SearchTaskPriority { get; set; } + + public DateTime SearchTaskCreated { get; set; } + + public string? SearchTaskErrorMessage { get; set; } + + [Column("SearchTaskRelatedObjectID")] + public int? SearchTaskRelatedObjectId { get; set; } + + [StringLength(100)] + public string? SearchTaskIndexerName { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsSearchTaskAzure.cs b/Migration.Tool.KX13/Models/CmsSearchTaskAzure.cs new file mode 100644 index 00000000..fe77c9c9 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsSearchTaskAzure.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_SearchTaskAzure")] +[Index("SearchTaskAzurePriority", Name = "IX_CMS_SearchTaskAzure_SearchTaskAzurePriority", AllDescending = true)] +public class CmsSearchTaskAzure +{ + [Key] + [Column("SearchTaskAzureID")] + public int SearchTaskAzureId { get; set; } + + [StringLength(100)] + public string SearchTaskAzureType { get; set; } = null!; + + [StringLength(100)] + public string? SearchTaskAzureObjectType { get; set; } + + [StringLength(200)] + public string? SearchTaskAzureMetadata { get; set; } + + [StringLength(600)] + public string SearchTaskAzureAdditionalData { get; set; } = null!; + + [Column("SearchTaskAzureInitiatorObjectID")] + public int? SearchTaskAzureInitiatorObjectId { get; set; } + + public int SearchTaskAzurePriority { get; set; } + + public string? SearchTaskAzureErrorMessage { get; set; } + + public DateTime SearchTaskAzureCreated { get; set; } + + [StringLength(100)] + public string? SearchTaskAzureIndexerName { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsSettingsCategory.cs b/Migration.Tool.KX13/Models/CmsSettingsCategory.cs new file mode 100644 index 00000000..1953b913 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsSettingsCategory.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_SettingsCategory")] +[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] +[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] +public class CmsSettingsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + public int? CategoryOrder { get; set; } + + [StringLength(100)] + public string? CategoryName { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + [StringLength(200)] + public string? CategoryIconPath { get; set; } + + public bool? CategoryIsGroup { get; set; } + + public bool? CategoryIsCustom { get; set; } + + [Column("CategoryResourceID")] + public int? CategoryResourceId { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsSettingsCategory? CategoryParent { get; set; } + + [ForeignKey("CategoryResourceId")] + [InverseProperty("CmsSettingsCategories")] + public virtual CmsResource? CategoryResource { get; set; } + + [InverseProperty("KeyCategory")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsSettingsKey.cs b/Migration.Tool.KX13/Models/CmsSettingsKey.cs new file mode 100644 index 00000000..0c46128f --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsSettingsKey.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_SettingsKey")] +[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] +[Index("SiteId", "KeyName", Name = "IX_CMS_SettingsKey_SiteID_KeyName")] +public class CmsSettingsKey +{ + [Key] + [Column("KeyID")] + public int KeyId { get; set; } + + [StringLength(100)] + public string KeyName { get; set; } = null!; + + [StringLength(200)] + public string KeyDisplayName { get; set; } = null!; + + public string? KeyDescription { get; set; } + + public string? KeyValue { get; set; } + + [StringLength(50)] + public string KeyType { get; set; } = null!; + + [Column("KeyCategoryID")] + public int? KeyCategoryId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("KeyGUID")] + public Guid KeyGuid { get; set; } + + public DateTime KeyLastModified { get; set; } + + public int? KeyOrder { get; set; } + + public string? KeyDefaultValue { get; set; } + + [StringLength(255)] + public string? KeyValidation { get; set; } + + [StringLength(200)] + public string? KeyEditingControlPath { get; set; } + + public bool? KeyIsGlobal { get; set; } + + public bool? KeyIsCustom { get; set; } + + public bool? KeyIsHidden { get; set; } + + public string? KeyFormControlSettings { get; set; } + + public string? KeyExplanationText { get; set; } + + [ForeignKey("KeyCategoryId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSettingsCategory? KeyCategory { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSite? Site { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsSite.cs b/Migration.Tool.KX13/Models/CmsSite.cs new file mode 100644 index 00000000..85425964 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsSite.cs @@ -0,0 +1,310 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Site")] +[Index("SiteDomainName", "SiteStatus", Name = "IX_CMS_Site_SiteDomainName_SiteStatus")] +[Index("SiteName", Name = "IX_CMS_Site_SiteName")] +public class CmsSite +{ + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + [StringLength(200)] + public string SiteDisplayName { get; set; } = null!; + + public string? SiteDescription { get; set; } + + [StringLength(20)] + public string SiteStatus { get; set; } = null!; + + [StringLength(400)] + public string SiteDomainName { get; set; } = null!; + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + [Column("SiteGUID")] + public Guid SiteGuid { get; set; } + + public DateTime SiteLastModified { get; set; } + + [Column("SitePresentationURL")] + [StringLength(400)] + public string SitePresentationUrl { get; set; } = null!; + + [InverseProperty("CampaignSite")] + public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); + + [InverseProperty("ExitPageSite")] + public virtual ICollection AnalyticsExitPages { get; set; } = new List(); + + [InverseProperty("StatisticsSite")] + public virtual ICollection AnalyticsStatistics { get; set; } = new List(); + + [InverseProperty("Aclsite")] + public virtual ICollection CmsAcls { get; set; } = new List(); + + [InverseProperty("AlternativeUrlSite")] + public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection CmsAttachmentHistories { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection CmsAttachments { get; set; } = new List(); + + [InverseProperty("StateSite")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("CategorySite")] + public virtual ICollection CmsCategories { get; set; } = new List(); + + [InverseProperty("ScopeSite")] + public virtual ICollection CmsDocumentTypeScopes { get; set; } = new List(); + + [InverseProperty("EmailTemplateSite")] + public virtual ICollection CmsEmailTemplates { get; set; } = new List(); + + [InverseProperty("FormSite")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("MembershipSite")] + public virtual ICollection CmsMemberships { get; set; } = new List(); + + [InverseProperty("MetaFileSite")] + public virtual ICollection CmsMetaFiles { get; set; } = new List(); + + [InverseProperty("VersionObjectSite")] + public virtual ICollection CmsObjectVersionHistories { get; set; } = new List(); + + [InverseProperty("PageFormerUrlPathSite")] + public virtual ICollection CmsPageFormerUrlPaths { get; set; } = new List(); + + [InverseProperty("PageTemplateConfigurationSite")] + public virtual ICollection CmsPageTemplateConfigurations { get; set; } = new List(); + + [InverseProperty("PageUrlPathSite")] + public virtual ICollection CmsPageUrlPaths { get; set; } = new List(); + + [InverseProperty("PersonalizationSite")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsRoles { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsSiteDomainAliases { get; set; } = new List(); + + [InverseProperty("TagGroupSite")] + public virtual ICollection CmsTagGroups { get; set; } = new List(); + + [InverseProperty("NodeLinkedNodeSite")] + public virtual ICollection CmsTreeNodeLinkedNodeSites { get; set; } = new List(); + + [InverseProperty("NodeSite")] + public virtual ICollection CmsTreeNodeSites { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsUserSites { get; set; } = new List(); + + [InverseProperty("NodeSite")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("ScopeSite")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [InverseProperty("BrandSite")] + public virtual ICollection ComBrands { get; set; } = new List(); + + [InverseProperty("CarrierSite")] + public virtual ICollection ComCarriers { get; set; } = new List(); + + [InverseProperty("CollectionSite")] + public virtual ICollection ComCollections { get; set; } = new List(); + + [InverseProperty("CurrencySite")] + public virtual ICollection ComCurrencies { get; set; } = new List(); + + [InverseProperty("EventSite")] + public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); + + [InverseProperty("CustomerSite")] + public virtual ICollection ComCustomers { get; set; } = new List(); + + [InverseProperty("DepartmentSite")] + public virtual ICollection ComDepartments { get; set; } = new List(); + + [InverseProperty("DiscountSite")] + public virtual ICollection ComDiscounts { get; set; } = new List(); + + [InverseProperty("ExchangeTableSite")] + public virtual ICollection ComExchangeTables { get; set; } = new List(); + + [InverseProperty("GiftCardSite")] + public virtual ICollection ComGiftCards { get; set; } = new List(); + + [InverseProperty("InternalStatusSite")] + public virtual ICollection ComInternalStatuses { get; set; } = new List(); + + [InverseProperty("ManufacturerSite")] + public virtual ICollection ComManufacturers { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscountSite")] + public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); + + [InverseProperty("CategorySite")] + public virtual ICollection ComOptionCategories { get; set; } = new List(); + + [InverseProperty("StatusSite")] + public virtual ICollection ComOrderStatuses { get; set; } = new List(); + + [InverseProperty("OrderSite")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("PaymentOptionSite")] + public virtual ICollection ComPaymentOptions { get; set; } = new List(); + + [InverseProperty("PublicStatusSite")] + public virtual ICollection ComPublicStatuses { get; set; } = new List(); + + [InverseProperty("ShippingOptionSite")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); + + [InverseProperty("ShoppingCartSite")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [InverseProperty("Skusite")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [InverseProperty("SupplierSite")] + public virtual ICollection ComSuppliers { get; set; } = new List(); + + [InverseProperty("TaxClassSite")] + public virtual ICollection ComTaxClasses { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("ExportSite")] + public virtual ICollection ExportHistories { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection ExportTasks { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection IntegrationTasks { get; set; } = new List(); + + [InverseProperty("FileSite")] + public virtual ICollection MediaFiles { get; set; } = new List(); + + [InverseProperty("LibrarySite")] + public virtual ICollection MediaLibraries { get; set; } = new List(); + + [InverseProperty("TemplateSite")] + public virtual ICollection NewsletterEmailTemplates { get; set; } = new List(); + + [InverseProperty("EmailWidgetSite")] + public virtual ICollection NewsletterEmailWidgets { get; set; } = new List(); + + [InverseProperty("EmailSite")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("IssueSite")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [InverseProperty("NewsletterSite")] + public virtual ICollection NewsletterNewsletters { get; set; } = new List(); + + [InverseProperty("SubscriberSite")] + public virtual ICollection NewsletterSubscribers { get; set; } = new List(); + + [InverseProperty("AbtestSite")] + public virtual ICollection OmAbtests { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionSite")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("SharePointConnectionSite")] + public virtual ICollection SharePointSharePointConnections { get; set; } = new List(); + + [InverseProperty("SharePointFileSite")] + public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); + + [InverseProperty("SharePointLibrarySite")] + public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); + + [InverseProperty("FacebookAccountSite")] + public virtual ICollection SmFacebookAccounts { get; set; } = new List(); + + [InverseProperty("FacebookApplicationSite")] + public virtual ICollection SmFacebookApplications { get; set; } = new List(); + + [InverseProperty("FacebookPostSite")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); + + [InverseProperty("LinkedInApplicationSite")] + public virtual ICollection SmLinkedInApplications { get; set; } = new List(); + + [InverseProperty("LinkedInPostSite")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); + + [InverseProperty("TwitterAccountSite")] + public virtual ICollection SmTwitterAccounts { get; set; } = new List(); + + [InverseProperty("TwitterApplicationSite")] + public virtual ICollection SmTwitterApplications { get; set; } = new List(); + + [InverseProperty("TwitterPostSite")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); + + [InverseProperty("ServerSite")] + public virtual ICollection StagingServers { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection StagingTasks { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Classes { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Containers { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Cultures { get; set; } = new List(); + + [ForeignKey("IndexSiteId")] + [InverseProperty("IndexSites")] + public virtual ICollection Indices { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection RelationshipNames { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Resources { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Servers { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsSiteDomainAlias.cs b/Migration.Tool.KX13/Models/CmsSiteDomainAlias.cs new file mode 100644 index 00000000..1287737f --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsSiteDomainAlias.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_SiteDomainAlias")] +[Index("SiteDomainAliasName", Name = "IX_CMS_SiteDomainAlias_SiteDomainAliasName")] +[Index("SiteId", Name = "IX_CMS_SiteDomainAlias_SiteID")] +public class CmsSiteDomainAlias +{ + [Key] + [Column("SiteDomainAliasID")] + public int SiteDomainAliasId { get; set; } + + [StringLength(400)] + public string? SiteDomainAliasName { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + [Column("SiteDomainGUID")] + public Guid? SiteDomainGuid { get; set; } + + public DateTime SiteDomainLastModified { get; set; } + + [StringLength(400)] + public string? SiteDomainPresentationUrl { get; set; } + + public int SiteDomainAliasType { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsSiteDomainAliases")] + public virtual CmsSite Site { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsSmtpserver.cs b/Migration.Tool.KX13/Models/CmsSmtpserver.cs new file mode 100644 index 00000000..0aca415e --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsSmtpserver.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_SMTPServer")] +public class CmsSmtpserver +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(200)] + public string ServerName { get; set; } = null!; + + [StringLength(50)] + public string? ServerUserName { get; set; } + + [StringLength(200)] + public string? ServerPassword { get; set; } + + [Column("ServerUseSSL")] + public bool ServerUseSsl { get; set; } + + public bool ServerEnabled { get; set; } + + public bool ServerIsGlobal { get; set; } + + [Column("ServerGUID")] + public Guid ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public int? ServerPriority { get; set; } + + public int? ServerDeliveryMethod { get; set; } + + [StringLength(450)] + public string? ServerPickupDirectory { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("Servers")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsState.cs b/Migration.Tool.KX13/Models/CmsState.cs new file mode 100644 index 00000000..c15bde3c --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsState.cs @@ -0,0 +1,52 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_State")] +[Index("CountryId", Name = "IX_CMS_State_CountryID")] +[Index("StateCode", Name = "IX_CMS_State_StateCode")] +public class CmsState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [StringLength(200)] + public string StateDisplayName { get; set; } = null!; + + [StringLength(200)] + public string StateName { get; set; } = null!; + + [StringLength(100)] + public string? StateCode { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public DateTime StateLastModified { get; set; } + + [InverseProperty("AddressState")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("AddressState")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("State")] + public virtual ICollection ComTaxClassStates { get; set; } = new List(); + + [ForeignKey("CountryId")] + [InverseProperty("CmsStates")] + public virtual CmsCountry Country { get; set; } = null!; + + [InverseProperty("AccountState")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactState")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsTag.cs b/Migration.Tool.KX13/Models/CmsTag.cs new file mode 100644 index 00000000..40664bd8 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsTag.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Tag")] +[Index("TagGroupId", Name = "IX_CMS_Tag_TagGroupID")] +public class CmsTag +{ + [Key] + [Column("TagID")] + public int TagId { get; set; } + + [StringLength(250)] + public string TagName { get; set; } = null!; + + public int TagCount { get; set; } + + [Column("TagGroupID")] + public int TagGroupId { get; set; } + + [Column("TagGUID")] + public Guid TagGuid { get; set; } + + [ForeignKey("TagGroupId")] + [InverseProperty("CmsTags")] + public virtual CmsTagGroup TagGroup { get; set; } = null!; + + [ForeignKey("TagId")] + [InverseProperty("Tags")] + public virtual ICollection Documents { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsTagGroup.cs b/Migration.Tool.KX13/Models/CmsTagGroup.cs new file mode 100644 index 00000000..d738246e --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsTagGroup.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_TagGroup")] +[Index("TagGroupSiteId", Name = "IX_CMS_TagGroup_TagGroupSiteID")] +public class CmsTagGroup +{ + [Key] + [Column("TagGroupID")] + public int TagGroupId { get; set; } + + [StringLength(250)] + public string TagGroupDisplayName { get; set; } = null!; + + [StringLength(250)] + public string TagGroupName { get; set; } = null!; + + public string? TagGroupDescription { get; set; } + + [Column("TagGroupSiteID")] + public int TagGroupSiteId { get; set; } + + public bool TagGroupIsAdHoc { get; set; } + + public DateTime TagGroupLastModified { get; set; } + + [Column("TagGroupGUID")] + public Guid TagGroupGuid { get; set; } + + [InverseProperty("DocumentTagGroup")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("TagGroup")] + public virtual ICollection CmsTags { get; set; } = new List(); + + [ForeignKey("TagGroupSiteId")] + [InverseProperty("CmsTagGroups")] + public virtual CmsSite TagGroupSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsTimeZone.cs b/Migration.Tool.KX13/Models/CmsTimeZone.cs new file mode 100644 index 00000000..433e162f --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsTimeZone.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_TimeZone")] +public class CmsTimeZone +{ + [Key] + [Column("TimeZoneID")] + public int TimeZoneId { get; set; } + + [StringLength(200)] + public string TimeZoneName { get; set; } = null!; + + [StringLength(200)] + public string TimeZoneDisplayName { get; set; } = null!; + + [Column("TimeZoneGMT")] + public double TimeZoneGmt { get; set; } + + public bool? TimeZoneDaylight { get; set; } + + public DateTime TimeZoneRuleStartIn { get; set; } + + [StringLength(200)] + public string TimeZoneRuleStartRule { get; set; } = null!; + + public DateTime TimeZoneRuleEndIn { get; set; } + + [StringLength(200)] + public string TimeZoneRuleEndRule { get; set; } = null!; + + [Column("TimeZoneGUID")] + public Guid TimeZoneGuid { get; set; } + + public DateTime TimeZoneLastModified { get; set; } + + [InverseProperty("UserTimeZone")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsTransformation.cs b/Migration.Tool.KX13/Models/CmsTransformation.cs new file mode 100644 index 00000000..d6874293 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsTransformation.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Transformation")] +[Index("TransformationClassId", Name = "IX_CMS_Transformation_TransformationClassID")] +public class CmsTransformation +{ + [Key] + [Column("TransformationID")] + public int TransformationId { get; set; } + + [StringLength(100)] + public string TransformationName { get; set; } = null!; + + public string TransformationCode { get; set; } = null!; + + [StringLength(50)] + public string TransformationType { get; set; } = null!; + + [Column("TransformationClassID")] + public int TransformationClassId { get; set; } + + [Column("TransformationVersionGUID")] + [StringLength(50)] + public string? TransformationVersionGuid { get; set; } + + [Column("TransformationGUID")] + public Guid TransformationGuid { get; set; } + + public DateTime TransformationLastModified { get; set; } + + [ForeignKey("TransformationClassId")] + [InverseProperty("CmsTransformations")] + public virtual CmsClass TransformationClass { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsTranslationService.cs b/Migration.Tool.KX13/Models/CmsTranslationService.cs new file mode 100644 index 00000000..038b53f2 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsTranslationService.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_TranslationService")] +public class CmsTranslationService +{ + [Key] + [Column("TranslationServiceID")] + public int TranslationServiceId { get; set; } + + [StringLength(200)] + public string TranslationServiceAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceClassName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceDisplayName { get; set; } = null!; + + public bool TranslationServiceIsMachine { get; set; } + + public DateTime TranslationServiceLastModified { get; set; } + + [Column("TranslationServiceGUID")] + public Guid TranslationServiceGuid { get; set; } + + public bool TranslationServiceEnabled { get; set; } + + public bool? TranslationServiceSupportsInstructions { get; set; } + + public bool? TranslationServiceSupportsPriority { get; set; } + + public bool? TranslationServiceSupportsDeadline { get; set; } + + [StringLength(1000)] + public string? TranslationServiceParameter { get; set; } + + public bool? TranslationServiceSupportsStatusUpdate { get; set; } + + public bool? TranslationServiceSupportsCancel { get; set; } + + [InverseProperty("SubmissionService")] + public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsTranslationSubmission.cs b/Migration.Tool.KX13/Models/CmsTranslationSubmission.cs new file mode 100644 index 00000000..6a5e3443 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsTranslationSubmission.cs @@ -0,0 +1,75 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_TranslationSubmission")] +[Index("SubmissionServiceId", Name = "IX_CMS_TranslationSubmission_SubmissionServiceID")] +[Index("SubmissionSubmittedByUserId", Name = "IX_CMS_TranslationSubmission_SubmissionSubmittedByUserID")] +public class CmsTranslationSubmission +{ + [Key] + [Column("SubmissionID")] + public int SubmissionId { get; set; } + + [StringLength(200)] + public string SubmissionName { get; set; } = null!; + + [StringLength(200)] + public string? SubmissionTicket { get; set; } + + public int SubmissionStatus { get; set; } + + [Column("SubmissionServiceID")] + public int SubmissionServiceId { get; set; } + + [StringLength(50)] + public string SubmissionSourceCulture { get; set; } = null!; + + public string SubmissionTargetCulture { get; set; } = null!; + + public int SubmissionPriority { get; set; } + + public DateTime? SubmissionDeadline { get; set; } + + [StringLength(500)] + public string? SubmissionInstructions { get; set; } + + public DateTime SubmissionLastModified { get; set; } + + [Column("SubmissionGUID")] + public Guid SubmissionGuid { get; set; } + + [Column("SubmissionSiteID")] + public int? SubmissionSiteId { get; set; } + + public double? SubmissionPrice { get; set; } + + public string? SubmissionStatusMessage { get; set; } + + public bool? SubmissionTranslateAttachments { get; set; } + + public int SubmissionItemCount { get; set; } + + public DateTime SubmissionDate { get; set; } + + public int? SubmissionWordCount { get; set; } + + public int? SubmissionCharCount { get; set; } + + [Column("SubmissionSubmittedByUserID")] + public int? SubmissionSubmittedByUserId { get; set; } + + [InverseProperty("SubmissionItemSubmission")] + public virtual ICollection CmsTranslationSubmissionItems { get; set; } = new List(); + + [ForeignKey("SubmissionServiceId")] + [InverseProperty("CmsTranslationSubmissions")] + public virtual CmsTranslationService SubmissionService { get; set; } = null!; + + [ForeignKey("SubmissionSubmittedByUserId")] + [InverseProperty("CmsTranslationSubmissions")] + public virtual CmsUser? SubmissionSubmittedByUser { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsTranslationSubmissionItem.cs b/Migration.Tool.KX13/Models/CmsTranslationSubmissionItem.cs new file mode 100644 index 00000000..11e1f8a7 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsTranslationSubmissionItem.cs @@ -0,0 +1,57 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_TranslationSubmissionItem")] +[Index("SubmissionItemSubmissionId", Name = "IX_CMS_TranslationSubmissionItem_SubmissionItemSubmissionID")] +public class CmsTranslationSubmissionItem +{ + [Key] + [Column("SubmissionItemID")] + public int SubmissionItemId { get; set; } + + [Column("SubmissionItemSubmissionID")] + public int SubmissionItemSubmissionId { get; set; } + + [Column("SubmissionItemSourceXLIFF")] + public string? SubmissionItemSourceXliff { get; set; } + + [Column("SubmissionItemTargetXLIFF")] + public string? SubmissionItemTargetXliff { get; set; } + + [StringLength(100)] + public string SubmissionItemObjectType { get; set; } = null!; + + [Column("SubmissionItemObjectID")] + public int SubmissionItemObjectId { get; set; } + + [Column("SubmissionItemGUID")] + public Guid SubmissionItemGuid { get; set; } + + public DateTime SubmissionItemLastModified { get; set; } + + [StringLength(200)] + public string SubmissionItemName { get; set; } = null!; + + public int? SubmissionItemWordCount { get; set; } + + public int? SubmissionItemCharCount { get; set; } + + public string? SubmissionItemCustomData { get; set; } + + [Column("SubmissionItemTargetObjectID")] + public int SubmissionItemTargetObjectId { get; set; } + + [StringLength(50)] + public string? SubmissionItemType { get; set; } + + [StringLength(50)] + public string? SubmissionItemTargetCulture { get; set; } + + [ForeignKey("SubmissionItemSubmissionId")] + [InverseProperty("CmsTranslationSubmissionItems")] + public virtual CmsTranslationSubmission SubmissionItemSubmission { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsTree.cs b/Migration.Tool.KX13/Models/CmsTree.cs new file mode 100644 index 00000000..df50c625 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsTree.cs @@ -0,0 +1,140 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Tree")] +[Index("NodeAclid", Name = "IX_CMS_Tree_NodeACLID")] +[Index("NodeAliasPath", Name = "IX_CMS_Tree_NodeAliasPath")] +[Index("NodeClassId", Name = "IX_CMS_Tree_NodeClassID")] +[Index("NodeLevel", Name = "IX_CMS_Tree_NodeLevel")] +[Index("NodeLinkedNodeId", Name = "IX_CMS_Tree_NodeLinkedNodeID")] +[Index("NodeLinkedNodeSiteId", Name = "IX_CMS_Tree_NodeLinkedNodeSiteID")] +[Index("NodeOriginalNodeId", Name = "IX_CMS_Tree_NodeOriginalNodeID")] +[Index("NodeOwner", Name = "IX_CMS_Tree_NodeOwner")] +[Index("NodeParentId", "NodeAlias", "NodeName", Name = "IX_CMS_Tree_NodeParentID_NodeAlias_NodeName")] +[Index("NodeSkuid", Name = "IX_CMS_Tree_NodeSKUID")] +[Index("NodeSiteId", "NodeGuid", Name = "IX_CMS_Tree_NodeSiteID_NodeGUID", IsUnique = true)] +public class CmsTree +{ + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + public string NodeAliasPath { get; set; } = null!; + + [StringLength(100)] + public string NodeName { get; set; } = null!; + + [StringLength(50)] + public string NodeAlias { get; set; } = null!; + + [Column("NodeClassID")] + public int NodeClassId { get; set; } + + [Column("NodeParentID")] + public int? NodeParentId { get; set; } + + public int NodeLevel { get; set; } + + [Column("NodeACLID")] + public int? NodeAclid { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeGUID")] + public Guid NodeGuid { get; set; } + + public int? NodeOrder { get; set; } + + public bool? IsSecuredNode { get; set; } + + [Column("NodeSKUID")] + public int? NodeSkuid { get; set; } + + [Column("NodeLinkedNodeID")] + public int? NodeLinkedNodeId { get; set; } + + public int? NodeOwner { get; set; } + + public string? NodeCustomData { get; set; } + + [Column("NodeLinkedNodeSiteID")] + public int? NodeLinkedNodeSiteId { get; set; } + + public bool? NodeHasChildren { get; set; } + + public bool? NodeHasLinks { get; set; } + + [Column("NodeOriginalNodeID")] + public int? NodeOriginalNodeId { get; set; } + + [Column("NodeIsACLOwner")] + public bool NodeIsAclowner { get; set; } + + [InverseProperty("DocumentNode")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("PageFormerUrlPathNode")] + public virtual ICollection CmsPageFormerUrlPaths { get; set; } = new List(); + + [InverseProperty("PageUrlPathNode")] + public virtual ICollection CmsPageUrlPaths { get; set; } = new List(); + + [InverseProperty("LeftNode")] + public virtual ICollection CmsRelationshipLeftNodes { get; set; } = new List(); + + [InverseProperty("RightNode")] + public virtual ICollection CmsRelationshipRightNodes { get; set; } = new List(); + + [InverseProperty("Node")] + public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); + + [InverseProperty("NodeLinkedNode")] + public virtual ICollection InverseNodeLinkedNode { get; set; } = new List(); + + [InverseProperty("NodeOriginalNode")] + public virtual ICollection InverseNodeOriginalNode { get; set; } = new List(); + + [InverseProperty("NodeParent")] + public virtual ICollection InverseNodeParent { get; set; } = new List(); + + [ForeignKey("NodeAclid")] + [InverseProperty("CmsTrees")] + public virtual CmsAcl? NodeAcl { get; set; } + + [ForeignKey("NodeClassId")] + [InverseProperty("CmsTrees")] + public virtual CmsClass NodeClass { get; set; } = null!; + + [ForeignKey("NodeLinkedNodeId")] + [InverseProperty("InverseNodeLinkedNode")] + public virtual CmsTree? NodeLinkedNode { get; set; } + + [ForeignKey("NodeLinkedNodeSiteId")] + [InverseProperty("CmsTreeNodeLinkedNodeSites")] + public virtual CmsSite? NodeLinkedNodeSite { get; set; } + + [ForeignKey("NodeOriginalNodeId")] + [InverseProperty("InverseNodeOriginalNode")] + public virtual CmsTree? NodeOriginalNode { get; set; } + + [ForeignKey("NodeOwner")] + [InverseProperty("CmsTrees")] + public virtual CmsUser? NodeOwnerNavigation { get; set; } + + [ForeignKey("NodeParentId")] + [InverseProperty("InverseNodeParent")] + public virtual CmsTree? NodeParent { get; set; } + + [ForeignKey("NodeSiteId")] + [InverseProperty("CmsTreeNodeSites")] + public virtual CmsSite NodeSite { get; set; } = null!; + + [ForeignKey("NodeSkuid")] + [InverseProperty("CmsTrees")] + public virtual ComSku? NodeSku { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsUielement.cs b/Migration.Tool.KX13/Models/CmsUielement.cs new file mode 100644 index 00000000..447f2168 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsUielement.cs @@ -0,0 +1,115 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_UIElement")] +[Index("ElementGuid", Name = "IX_CMS_UIElement_ElementGUID", IsUnique = true)] +[Index("ElementPageTemplateId", Name = "IX_CMS_UIElement_ElementPageTemplateID")] +[Index("ElementParentId", Name = "IX_CMS_UIElement_ElementParentID")] +public class CmsUielement +{ + [Key] + [Column("ElementID")] + public int ElementId { get; set; } + + [StringLength(200)] + public string ElementDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ElementName { get; set; } = null!; + + [StringLength(200)] + public string? ElementCaption { get; set; } + + [Column("ElementTargetURL")] + [StringLength(650)] + public string? ElementTargetUrl { get; set; } + + [Column("ElementResourceID")] + public int ElementResourceId { get; set; } + + [Column("ElementParentID")] + public int? ElementParentId { get; set; } + + public int ElementChildCount { get; set; } + + public int? ElementOrder { get; set; } + + public int ElementLevel { get; set; } + + [Column("ElementIDPath")] + [StringLength(450)] + public string ElementIdpath { get; set; } = null!; + + [StringLength(200)] + public string? ElementIconPath { get; set; } + + public bool? ElementIsCustom { get; set; } + + public DateTime ElementLastModified { get; set; } + + [Column("ElementGUID")] + public Guid ElementGuid { get; set; } + + public int? ElementSize { get; set; } + + public string? ElementDescription { get; set; } + + [StringLength(20)] + public string? ElementFromVersion { get; set; } + + [Column("ElementPageTemplateID")] + public int? ElementPageTemplateId { get; set; } + + [StringLength(50)] + public string? ElementType { get; set; } + + public string? ElementProperties { get; set; } + + public bool? ElementIsMenu { get; set; } + + [StringLength(200)] + public string? ElementFeature { get; set; } + + [StringLength(100)] + public string? ElementIconClass { get; set; } + + public bool? ElementIsGlobalApplication { get; set; } + + public bool? ElementCheckModuleReadPermission { get; set; } + + public string? ElementAccessCondition { get; set; } + + public string? ElementVisibilityCondition { get; set; } + + public bool ElementRequiresGlobalAdminPriviligeLevel { get; set; } + + [InverseProperty("HelpTopicUielement")] + public virtual ICollection CmsHelpTopics { get; set; } = new List(); + + [ForeignKey("ElementPageTemplateId")] + [InverseProperty("CmsUielements")] + public virtual CmsPageTemplate? ElementPageTemplate { get; set; } + + [ForeignKey("ElementParentId")] + [InverseProperty("InverseElementParent")] + public virtual CmsUielement? ElementParent { get; set; } + + [ForeignKey("ElementResourceId")] + [InverseProperty("CmsUielements")] + public virtual CmsResource ElementResource { get; set; } = null!; + + [InverseProperty("ElementParent")] + public virtual ICollection InverseElementParent { get; set; } = new List(); + + [ForeignKey("ElementId")] + [InverseProperty("Elements")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("ElementId")] + [InverseProperty("ElementsNavigation")] + public virtual ICollection RolesNavigation { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsUser.cs b/Migration.Tool.KX13/Models/CmsUser.cs new file mode 100644 index 00000000..dd16d0b7 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsUser.cs @@ -0,0 +1,223 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_User")] +[Index("Email", Name = "IX_CMS_User_Email")] +[Index("FullName", Name = "IX_CMS_User_FullName")] +[Index("UserEnabled", "UserIsHidden", Name = "IX_CMS_User_UserEnabled_UserIsHidden")] +[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] +[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] +[Index("UserPrivilegeLevel", Name = "IX_CMS_User_UserPrivilegeLevel")] +public class CmsUser +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(50)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(50)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [InverseProperty("LastModifiedByUser")] + public virtual ICollection CmsAclitemLastModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsAclitemUsers { get; set; } = new List(); + + [InverseProperty("HistoryApprovedByUser")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateUser")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("CategoryUser")] + public virtual ICollection CmsCategories { get; set; } = new List(); + + [InverseProperty("DocumentCheckedOutByUser")] + public virtual ICollection CmsDocumentDocumentCheckedOutByUsers { get; set; } = new List(); + + [InverseProperty("DocumentCreatedByUser")] + public virtual ICollection CmsDocumentDocumentCreatedByUsers { get; set; } = new List(); + + [InverseProperty("DocumentModifiedByUser")] + public virtual ICollection CmsDocumentDocumentModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsEmailUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsExternalLogins { get; set; } = new List(); + + [InverseProperty("MacroIdentityEffectiveUser")] + public virtual ICollection CmsMacroIdentities { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsMembershipUsers { get; set; } = new List(); + + [InverseProperty("ObjectCheckedOutByUser")] + public virtual ICollection CmsObjectSettings { get; set; } = new List(); + + [InverseProperty("VersionDeletedByUser")] + public virtual ICollection CmsObjectVersionHistoryVersionDeletedByUsers { get; set; } = new List(); + + [InverseProperty("VersionModifiedByUser")] + public virtual ICollection CmsObjectVersionHistoryVersionModifiedByUsers { get; set; } = new List(); + + [InverseProperty("PersonalizationUser")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [InverseProperty("TaskUser")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("SubmissionSubmittedByUser")] + public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); + + [InverseProperty("NodeOwnerNavigation")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("UserMacroIdentityUser")] + public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } + + [InverseProperty("User")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("UserActivatedByUser")] + public virtual ICollection CmsUserSettingUserActivatedByUsers { get; set; } = new List(); + + [InverseProperty("UserSettingsUserNavigation")] + public virtual CmsUserSetting? CmsUserSettingUserSettingsUserNavigation { get; set; } + + public virtual ICollection CmsUserSettingUserSettingsUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsUserSites { get; set; } = new List(); + + [InverseProperty("ModifiedByUser")] + public virtual ICollection CmsVersionHistoryModifiedByUsers { get; set; } = new List(); + + [InverseProperty("VersionDeletedByUser")] + public virtual ICollection CmsVersionHistoryVersionDeletedByUsers { get; set; } = new List(); + + [InverseProperty("ApprovedByUser")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); + + [InverseProperty("CustomerUser")] + public virtual ICollection ComCustomers { get; set; } = new List(); + + [InverseProperty("ChangedByUser")] + public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); + + [InverseProperty("OrderCreatedByUser")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartUser")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("ExportUser")] + public virtual ICollection ExportHistories { get; set; } = new List(); + + [InverseProperty("FileCreatedByUser")] + public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); + + [InverseProperty("FileModifiedByUser")] + public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); + + [InverseProperty("AccountOwnerUser")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactOwnerUser")] + public virtual ICollection OmContacts { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionUser")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("SavedReportCreatedByUser")] + public virtual ICollection ReportingSavedReports { get; set; } = new List(); + + [InverseProperty("User")] + public virtual StagingTaskGroupUser? StagingTaskGroupUser { get; set; } + + [InverseProperty("User")] + public virtual ICollection StagingTaskUsers { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Workflows { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsUserCulture.cs b/Migration.Tool.KX13/Models/CmsUserCulture.cs new file mode 100644 index 00000000..36918e81 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsUserCulture.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[PrimaryKey("UserId", "CultureId", "SiteId")] +[Table("CMS_UserCulture")] +[Index("CultureId", Name = "IX_CMS_UserCulture_CultureID")] +[Index("SiteId", Name = "IX_CMS_UserCulture_SiteID")] +public class CmsUserCulture +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("CultureId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsCulture Culture { get; set; } = null!; + + [ForeignKey("SiteId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsUserMacroIdentity.cs b/Migration.Tool.KX13/Models/CmsUserMacroIdentity.cs new file mode 100644 index 00000000..39de8381 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsUserMacroIdentity.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_UserMacroIdentity")] +[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] +[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] +public class CmsUserMacroIdentity +{ + [Key] + [Column("UserMacroIdentityID")] + public int UserMacroIdentityId { get; set; } + + public DateTime UserMacroIdentityLastModified { get; set; } + + [Column("UserMacroIdentityUserID")] + public int UserMacroIdentityUserId { get; set; } + + [Column("UserMacroIdentityMacroIdentityID")] + public int? UserMacroIdentityMacroIdentityId { get; set; } + + public Guid UserMacroIdentityUserGuid { get; set; } + + [ForeignKey("UserMacroIdentityMacroIdentityId")] + [InverseProperty("CmsUserMacroIdentities")] + public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } + + [ForeignKey("UserMacroIdentityUserId")] + [InverseProperty("CmsUserMacroIdentity")] + public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsUserRole.cs b/Migration.Tool.KX13/Models/CmsUserRole.cs new file mode 100644 index 00000000..18e140f9 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsUserRole.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_UserRole")] +[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] +[Index("RoleId", "ValidTo", "UserId", Name = "IX_CMS_UserRole_UserID")] +[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] +public class CmsUserRole +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } + + [Key] + [Column("UserRoleID")] + public int UserRoleId { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsUserSetting.cs b/Migration.Tool.KX13/Models/CmsUserSetting.cs new file mode 100644 index 00000000..eb04e7b1 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsUserSetting.cs @@ -0,0 +1,121 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_UserSettings")] +[Index("UserActivatedByUserId", Name = "IX_CMS_UserSettings_UserActivatedByUserID")] +[Index("UserAuthenticationGuid", Name = "IX_CMS_UserSettings_UserAuthenticationGUID")] +[Index("UserAvatarId", Name = "IX_CMS_UserSettings_UserAvatarID")] +[Index("UserGender", Name = "IX_CMS_UserSettings_UserGender")] +[Index("UserNickName", Name = "IX_CMS_UserSettings_UserNickName")] +[Index("UserPasswordRequestHash", Name = "IX_CMS_UserSettings_UserPasswordRequestHash")] +[Index("UserSettingsUserGuid", Name = "IX_CMS_UserSettings_UserSettingsUserGUID")] +[Index("UserSettingsUserId", Name = "IX_CMS_UserSettings_UserSettingsUserID", IsUnique = true)] +[Index("UserTimeZoneId", Name = "IX_CMS_UserSettings_UserTimeZoneID")] +[Index("UserWaitingForApproval", Name = "IX_CMS_UserSettings_UserWaitingForApproval")] +public class CmsUserSetting +{ + [Key] + [Column("UserSettingsID")] + public int UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int UserSettingsUserId { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [ForeignKey("UserActivatedByUserId")] + [InverseProperty("CmsUserSettingUserActivatedByUsers")] + public virtual CmsUser? UserActivatedByUser { get; set; } + + [ForeignKey("UserAvatarId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsAvatar? UserAvatar { get; set; } + + public virtual CmsUser UserSettingsUser { get; set; } = null!; + + [ForeignKey("UserSettingsUserId")] + [InverseProperty("CmsUserSettingUserSettingsUserNavigation")] + public virtual CmsUser UserSettingsUserNavigation { get; set; } = null!; + + [ForeignKey("UserTimeZoneId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsTimeZone? UserTimeZone { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsUserSite.cs b/Migration.Tool.KX13/Models/CmsUserSite.cs new file mode 100644 index 00000000..ed8e6b56 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsUserSite.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_UserSite")] +[Index("SiteId", Name = "IX_CMS_UserSite_SiteID")] +[Index("UserId", "SiteId", Name = "IX_CMS_UserSite_UserID_SiteID", IsUnique = true)] +public class CmsUserSite +{ + [Key] + [Column("UserSiteID")] + public int UserSiteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsUserSites")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserSites")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsVersionHistory.cs b/Migration.Tool.KX13/Models/CmsVersionHistory.cs new file mode 100644 index 00000000..5724992a --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsVersionHistory.cs @@ -0,0 +1,107 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_VersionHistory")] +[Index("ModifiedByUserId", Name = "IX_CMS_VersionHistory_ModifiedByUserID")] +[Index("NodeSiteId", Name = "IX_CMS_VersionHistory_NodeSiteID")] +[Index("ToBePublished", "PublishFrom", "PublishTo", Name = "IX_CMS_VersionHistory_ToBePublished_PublishFrom_PublishTo")] +[Index("VersionClassId", Name = "IX_CMS_VersionHistory_VersionClassID")] +[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_VersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionWorkflowId", Name = "IX_CMS_VersionHistory_VersionWorkflowID")] +[Index("VersionWorkflowStepId", Name = "IX_CMS_VersionHistory_VersionWorkflowStepID")] +public class CmsVersionHistory +{ + [Key] + [Column("VersionHistoryID")] + public int VersionHistoryId { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("DocumentID")] + public int? DocumentId { get; set; } + + [Column("NodeXML")] + public string NodeXml { get; set; } = null!; + + [Column("ModifiedByUserID")] + public int? ModifiedByUserId { get; set; } + + public DateTime ModifiedWhen { get; set; } + + [StringLength(50)] + public string? VersionNumber { get; set; } + + public string? VersionComment { get; set; } + + public bool ToBePublished { get; set; } + + public DateTime? PublishFrom { get; set; } + + public DateTime? PublishTo { get; set; } + + public DateTime? WasPublishedFrom { get; set; } + + public DateTime? WasPublishedTo { get; set; } + + [StringLength(100)] + public string? VersionDocumentName { get; set; } + + [Column("VersionClassID")] + public int? VersionClassId { get; set; } + + [Column("VersionWorkflowID")] + public int? VersionWorkflowId { get; set; } + + [Column("VersionWorkflowStepID")] + public int? VersionWorkflowStepId { get; set; } + + [StringLength(450)] + public string? VersionNodeAliasPath { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [InverseProperty("DocumentCheckedOutVersionHistory")] + public virtual ICollection CmsDocumentDocumentCheckedOutVersionHistories { get; set; } = new List(); + + [InverseProperty("DocumentPublishedVersionHistory")] + public virtual ICollection CmsDocumentDocumentPublishedVersionHistories { get; set; } = new List(); + + [InverseProperty("VersionHistory")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [ForeignKey("ModifiedByUserId")] + [InverseProperty("CmsVersionHistoryModifiedByUsers")] + public virtual CmsUser? ModifiedByUser { get; set; } + + [ForeignKey("NodeSiteId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsSite NodeSite { get; set; } = null!; + + [ForeignKey("VersionClassId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsClass? VersionClass { get; set; } + + [ForeignKey("VersionDeletedByUserId")] + [InverseProperty("CmsVersionHistoryVersionDeletedByUsers")] + public virtual CmsUser? VersionDeletedByUser { get; set; } + + [ForeignKey("VersionWorkflowId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsWorkflow? VersionWorkflow { get; set; } + + [ForeignKey("VersionWorkflowStepId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsWorkflowStep? VersionWorkflowStep { get; set; } + + [ForeignKey("VersionHistoryId")] + [InverseProperty("VersionHistories")] + public virtual ICollection AttachmentHistories { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsWebFarmServer.cs b/Migration.Tool.KX13/Models/CmsWebFarmServer.cs new file mode 100644 index 00000000..1471f23b --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWebFarmServer.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WebFarmServer")] +[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] +public class CmsWebFarmServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(300)] + public string ServerDisplayName { get; set; } = null!; + + [StringLength(300)] + public string ServerName { get; set; } = null!; + + [Column("ServerGUID")] + public Guid? ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public bool ServerEnabled { get; set; } + + public bool IsExternalWebAppServer { get; set; } + + [InverseProperty("Server")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsWebFarmServerLog.cs b/Migration.Tool.KX13/Models/CmsWebFarmServerLog.cs new file mode 100644 index 00000000..62633733 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWebFarmServerLog.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WebFarmServerLog")] +public class CmsWebFarmServerLog +{ + [Key] + [Column("WebFarmServerLogID")] + public int WebFarmServerLogId { get; set; } + + public DateTime LogTime { get; set; } + + [StringLength(200)] + public string LogCode { get; set; } = null!; + + [Column("ServerID")] + public int ServerId { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsWebFarmServerMonitoring.cs b/Migration.Tool.KX13/Models/CmsWebFarmServerMonitoring.cs new file mode 100644 index 00000000..03994c34 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWebFarmServerMonitoring.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WebFarmServerMonitoring")] +public class CmsWebFarmServerMonitoring +{ + [Key] + [Column("WebFarmServerMonitoringID")] + public int WebFarmServerMonitoringId { get; set; } + + [Column("ServerID")] + public int ServerId { get; set; } + + public DateTime? ServerPing { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsWebFarmServerTask.cs b/Migration.Tool.KX13/Models/CmsWebFarmServerTask.cs new file mode 100644 index 00000000..785a6759 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWebFarmServerTask.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[PrimaryKey("ServerId", "TaskId")] +[Table("CMS_WebFarmServerTask")] +[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] +public class CmsWebFarmServerTask +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + public string? ErrorMessage { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmServer Server { get; set; } = null!; + + [ForeignKey("TaskId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmTask Task { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsWebFarmTask.cs b/Migration.Tool.KX13/Models/CmsWebFarmTask.cs new file mode 100644 index 00000000..69eff0a5 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWebFarmTask.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WebFarmTask")] +[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] +public class CmsWebFarmTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(100)] + public string TaskType { get; set; } = null!; + + public string? TaskTextData { get; set; } + + public byte[]? TaskBinaryData { get; set; } + + public DateTime? TaskCreated { get; set; } + + public string? TaskTarget { get; set; } + + [StringLength(450)] + public string? TaskMachineName { get; set; } + + [Column("TaskGUID")] + public Guid? TaskGuid { get; set; } + + public bool? TaskIsAnonymous { get; set; } + + public string? TaskErrorMessage { get; set; } + + public bool? TaskIsMemory { get; set; } + + [InverseProperty("Task")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsWebPart.cs b/Migration.Tool.KX13/Models/CmsWebPart.cs new file mode 100644 index 00000000..134bbb4a --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWebPart.cs @@ -0,0 +1,83 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WebPart")] +[Index("WebPartCategoryId", Name = "IX_CMS_WebPart_WebPartCategoryID")] +[Index("WebPartName", Name = "IX_CMS_WebPart_WebPartName")] +[Index("WebPartParentId", Name = "IX_CMS_WebPart_WebPartParentID")] +[Index("WebPartResourceId", Name = "IX_CMS_WebPart_WebPartResourceID")] +public class CmsWebPart +{ + [Key] + [Column("WebPartID")] + public int WebPartId { get; set; } + + [StringLength(100)] + public string WebPartName { get; set; } = null!; + + [StringLength(100)] + public string WebPartDisplayName { get; set; } = null!; + + public string? WebPartDescription { get; set; } + + [StringLength(100)] + public string WebPartFileName { get; set; } = null!; + + public string WebPartProperties { get; set; } = null!; + + [Column("WebPartCategoryID")] + public int WebPartCategoryId { get; set; } + + [Column("WebPartParentID")] + public int? WebPartParentId { get; set; } + + public string? WebPartDocumentation { get; set; } + + [Column("WebPartGUID")] + public Guid WebPartGuid { get; set; } + + public DateTime WebPartLastModified { get; set; } + + public int? WebPartType { get; set; } + + public string? WebPartDefaultValues { get; set; } + + [Column("WebPartResourceID")] + public int? WebPartResourceId { get; set; } + + [Column("WebPartCSS")] + public string? WebPartCss { get; set; } + + public bool? WebPartSkipInsertProperties { get; set; } + + [Column("WebPartThumbnailGUID")] + public Guid? WebPartThumbnailGuid { get; set; } + + [StringLength(200)] + public string? WebPartIconClass { get; set; } + + [InverseProperty("WebPartLayoutWebPart")] + public virtual ICollection CmsWebPartLayouts { get; set; } = new List(); + + [InverseProperty("WidgetWebPart")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [InverseProperty("WebPartParent")] + public virtual ICollection InverseWebPartParent { get; set; } = new List(); + + [ForeignKey("WebPartCategoryId")] + [InverseProperty("CmsWebParts")] + public virtual CmsWebPartCategory WebPartCategory { get; set; } = null!; + + [ForeignKey("WebPartParentId")] + [InverseProperty("InverseWebPartParent")] + public virtual CmsWebPart? WebPartParent { get; set; } + + [ForeignKey("WebPartResourceId")] + [InverseProperty("CmsWebParts")] + public virtual CmsResource? WebPartResource { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsWebPartCategory.cs b/Migration.Tool.KX13/Models/CmsWebPartCategory.cs new file mode 100644 index 00000000..4c0ae76a --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWebPartCategory.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WebPartCategory")] +[Index("CategoryParentId", Name = "IX_CMS_WebPartCategory_CategoryParentID")] +public class CmsWebPartCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(100)] + public string CategoryDisplayName { get; set; } = null!; + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(100)] + public string CategoryName { get; set; } = null!; + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public string CategoryPath { get; set; } = null!; + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryWebPartChildCount { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsWebPartCategory? CategoryParent { get; set; } + + [InverseProperty("WebPartCategory")] + public virtual ICollection CmsWebParts { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsWebPartContainer.cs b/Migration.Tool.KX13/Models/CmsWebPartContainer.cs new file mode 100644 index 00000000..2a116696 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWebPartContainer.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WebPartContainer")] +[Index("ContainerName", Name = "IX_CMS_WebPartContainer_ContainerName")] +public class CmsWebPartContainer +{ + [Key] + [Column("ContainerID")] + public int ContainerId { get; set; } + + [StringLength(200)] + public string ContainerDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ContainerName { get; set; } = null!; + + public string? ContainerTextBefore { get; set; } + + public string? ContainerTextAfter { get; set; } + + [Column("ContainerGUID")] + public Guid ContainerGuid { get; set; } + + public DateTime ContainerLastModified { get; set; } + + [Column("ContainerCSS")] + public string? ContainerCss { get; set; } + + [ForeignKey("ContainerId")] + [InverseProperty("Containers")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsWebPartLayout.cs b/Migration.Tool.KX13/Models/CmsWebPartLayout.cs new file mode 100644 index 00000000..974d786a --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWebPartLayout.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WebPartLayout")] +[Index("WebPartLayoutWebPartId", Name = "IX_CMS_WebPartLayout_WebPartLayoutWebPartID")] +public class CmsWebPartLayout +{ + [Key] + [Column("WebPartLayoutID")] + public int WebPartLayoutId { get; set; } + + [StringLength(200)] + public string WebPartLayoutCodeName { get; set; } = null!; + + [StringLength(200)] + public string WebPartLayoutDisplayName { get; set; } = null!; + + public string? WebPartLayoutDescription { get; set; } + + public string? WebPartLayoutCode { get; set; } + + [Column("WebPartLayoutVersionGUID")] + [StringLength(100)] + public string? WebPartLayoutVersionGuid { get; set; } + + [Column("WebPartLayoutWebPartID")] + public int WebPartLayoutWebPartId { get; set; } + + [Column("WebPartLayoutGUID")] + public Guid WebPartLayoutGuid { get; set; } + + public DateTime WebPartLayoutLastModified { get; set; } + + [Column("WebPartLayoutCSS")] + public string? WebPartLayoutCss { get; set; } + + public bool? WebPartLayoutIsDefault { get; set; } + + [InverseProperty("WidgetLayout")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [ForeignKey("WebPartLayoutWebPartId")] + [InverseProperty("CmsWebPartLayouts")] + public virtual CmsWebPart WebPartLayoutWebPart { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsWidget.cs b/Migration.Tool.KX13/Models/CmsWidget.cs new file mode 100644 index 00000000..19c1e949 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWidget.cs @@ -0,0 +1,72 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Widget")] +[Index("WidgetCategoryId", Name = "IX_CMS_Widget_WidgetCategoryID")] +[Index("WidgetLayoutId", Name = "IX_CMS_Widget_WidgetLayoutID")] +[Index("WidgetWebPartId", Name = "IX_CMS_Widget_WidgetWebPartID")] +public class CmsWidget +{ + [Key] + [Column("WidgetID")] + public int WidgetId { get; set; } + + [Column("WidgetWebPartID")] + public int WidgetWebPartId { get; set; } + + [StringLength(100)] + public string WidgetDisplayName { get; set; } = null!; + + [StringLength(100)] + public string WidgetName { get; set; } = null!; + + public string? WidgetDescription { get; set; } + + [Column("WidgetCategoryID")] + public int WidgetCategoryId { get; set; } + + public string? WidgetProperties { get; set; } + + public int WidgetSecurity { get; set; } + + [Column("WidgetGUID")] + public Guid WidgetGuid { get; set; } + + public DateTime WidgetLastModified { get; set; } + + public bool WidgetIsEnabled { get; set; } + + public string? WidgetDocumentation { get; set; } + + public string? WidgetDefaultValues { get; set; } + + [Column("WidgetLayoutID")] + public int? WidgetLayoutId { get; set; } + + public bool? WidgetSkipInsertProperties { get; set; } + + [Column("WidgetThumbnailGUID")] + public Guid? WidgetThumbnailGuid { get; set; } + + [StringLength(200)] + public string? WidgetIconClass { get; set; } + + [InverseProperty("Widget")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [ForeignKey("WidgetCategoryId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWidgetCategory WidgetCategory { get; set; } = null!; + + [ForeignKey("WidgetLayoutId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWebPartLayout? WidgetLayout { get; set; } + + [ForeignKey("WidgetWebPartId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWebPart WidgetWebPart { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsWidgetCategory.cs b/Migration.Tool.KX13/Models/CmsWidgetCategory.cs new file mode 100644 index 00000000..494af384 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWidgetCategory.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WidgetCategory")] +[Index("WidgetCategoryParentId", Name = "IX_CMS_WidgetCategory_WidgetCategoryParentID")] +public class CmsWidgetCategory +{ + [Key] + [Column("WidgetCategoryID")] + public int WidgetCategoryId { get; set; } + + [StringLength(100)] + public string WidgetCategoryName { get; set; } = null!; + + [StringLength(100)] + public string WidgetCategoryDisplayName { get; set; } = null!; + + [Column("WidgetCategoryParentID")] + public int? WidgetCategoryParentId { get; set; } + + public string WidgetCategoryPath { get; set; } = null!; + + public int WidgetCategoryLevel { get; set; } + + public int? WidgetCategoryChildCount { get; set; } + + public int? WidgetCategoryWidgetChildCount { get; set; } + + [StringLength(450)] + public string? WidgetCategoryImagePath { get; set; } + + [Column("WidgetCategoryGUID")] + public Guid WidgetCategoryGuid { get; set; } + + public DateTime WidgetCategoryLastModified { get; set; } + + [InverseProperty("WidgetCategory")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [InverseProperty("WidgetCategoryParent")] + public virtual ICollection InverseWidgetCategoryParent { get; set; } = new List(); + + [ForeignKey("WidgetCategoryParentId")] + [InverseProperty("InverseWidgetCategoryParent")] + public virtual CmsWidgetCategory? WidgetCategoryParent { get; set; } +} diff --git a/Migration.Tool.KX13/Models/CmsWidgetRole.cs b/Migration.Tool.KX13/Models/CmsWidgetRole.cs new file mode 100644 index 00000000..65134556 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWidgetRole.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[PrimaryKey("WidgetId", "RoleId", "PermissionId")] +[Table("CMS_WidgetRole")] +[Index("PermissionId", Name = "IX_CMS_WidgetRole_PermissionID")] +[Index("RoleId", Name = "IX_CMS_WidgetRole_RoleID")] +public class CmsWidgetRole +{ + [Key] + [Column("WidgetID")] + public int WidgetId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("PermissionId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("WidgetId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsWidget Widget { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsWorkflow.cs b/Migration.Tool.KX13/Models/CmsWorkflow.cs new file mode 100644 index 00000000..7fa227dc --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWorkflow.cs @@ -0,0 +1,93 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_Workflow")] +public class CmsWorkflow +{ + [Key] + [Column("WorkflowID")] + public int WorkflowId { get; set; } + + public string WorkflowDisplayName { get; set; } = null!; + + [StringLength(450)] + public string WorkflowName { get; set; } = null!; + + [Column("WorkflowGUID")] + public Guid WorkflowGuid { get; set; } + + public DateTime WorkflowLastModified { get; set; } + + public bool? WorkflowAutoPublishChanges { get; set; } + + public bool? WorkflowUseCheckinCheckout { get; set; } + + public int? WorkflowType { get; set; } + + public bool? WorkflowSendEmails { get; set; } + + public bool? WorkflowSendApproveEmails { get; set; } + + public bool? WorkflowSendRejectEmails { get; set; } + + public bool? WorkflowSendPublishEmails { get; set; } + + public bool? WorkflowSendArchiveEmails { get; set; } + + [StringLength(200)] + public string? WorkflowApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowPublishedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowArchivedTemplateName { get; set; } + + public bool? WorkflowSendReadyForApprovalEmails { get; set; } + + [StringLength(200)] + public string? WorkflowReadyForApprovalTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowNotificationTemplateName { get; set; } + + public string? WorkflowAllowedObjects { get; set; } + + public int? WorkflowRecurrenceType { get; set; } + + [Required] + public bool? WorkflowEnabled { get; set; } + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateWorkflow")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("TriggerWorkflow")] + public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); + + [InverseProperty("VersionWorkflow")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [InverseProperty("ScopeWorkflow")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [InverseProperty("StepWorkflow")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); + + [InverseProperty("TransitionWorkflow")] + public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); + + [ForeignKey("WorkflowId")] + [InverseProperty("Workflows")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsWorkflowAction.cs b/Migration.Tool.KX13/Models/CmsWorkflowAction.cs new file mode 100644 index 00000000..eecf632d --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWorkflowAction.cs @@ -0,0 +1,71 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WorkflowAction")] +[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] +public class CmsWorkflowAction +{ + [Key] + [Column("ActionID")] + public int ActionId { get; set; } + + [StringLength(200)] + public string ActionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ActionName { get; set; } = null!; + + public string? ActionParameters { get; set; } + + public string? ActionDescription { get; set; } + + [StringLength(200)] + public string ActionAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string ActionClass { get; set; } = null!; + + [Column("ActionResourceID")] + public int? ActionResourceId { get; set; } + + [Column("ActionThumbnailGUID")] + public Guid? ActionThumbnailGuid { get; set; } + + [Column("ActionGUID")] + public Guid ActionGuid { get; set; } + + public DateTime ActionLastModified { get; set; } + + [Required] + public bool? ActionEnabled { get; set; } + + public string? ActionAllowedObjects { get; set; } + + [Column("ActionIconGUID")] + public Guid? ActionIconGuid { get; set; } + + public int? ActionWorkflowType { get; set; } + + [StringLength(200)] + public string? ActionIconClass { get; set; } + + [StringLength(200)] + public string? ActionThumbnailClass { get; set; } + + [StringLength(200)] + public string? ActionDataProviderClass { get; set; } + + [StringLength(200)] + public string? ActionDataProviderAssemblyName { get; set; } + + [ForeignKey("ActionResourceId")] + [InverseProperty("CmsWorkflowActions")] + public virtual CmsResource? ActionResource { get; set; } + + [InverseProperty("StepAction")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/CmsWorkflowHistory.cs b/Migration.Tool.KX13/Models/CmsWorkflowHistory.cs new file mode 100644 index 00000000..c530fd62 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWorkflowHistory.cs @@ -0,0 +1,87 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WorkflowHistory")] +[Index("ApprovedByUserId", Name = "IX_CMS_WorkflowHistory_ApprovedByUserID")] +[Index("ApprovedWhen", Name = "IX_CMS_WorkflowHistory_ApprovedWhen")] +[Index("HistoryWorkflowId", Name = "IX_CMS_WorkflowHistory_HistoryWorkflowID")] +[Index("StepId", Name = "IX_CMS_WorkflowHistory_StepID")] +[Index("TargetStepId", Name = "IX_CMS_WorkflowHistory_TargetStepID")] +[Index("VersionHistoryId", Name = "IX_CMS_WorkflowHistory_VersionHistoryID")] +public class CmsWorkflowHistory +{ + [Key] + [Column("WorkflowHistoryID")] + public int WorkflowHistoryId { get; set; } + + [Column("VersionHistoryID")] + public int VersionHistoryId { get; set; } + + [Column("StepID")] + public int? StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [Column("ApprovedByUserID")] + public int? ApprovedByUserId { get; set; } + + public DateTime? ApprovedWhen { get; set; } + + public string? Comment { get; set; } + + public bool WasRejected { get; set; } + + [StringLength(440)] + public string? StepName { get; set; } + + [Column("TargetStepID")] + public int? TargetStepId { get; set; } + + [StringLength(440)] + public string? TargetStepName { get; set; } + + [StringLength(450)] + public string? TargetStepDisplayName { get; set; } + + public int? StepType { get; set; } + + public int? TargetStepType { get; set; } + + [StringLength(100)] + public string? HistoryObjectType { get; set; } + + [Column("HistoryObjectID")] + public int? HistoryObjectId { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int? HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + [ForeignKey("ApprovedByUserId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsUser? ApprovedByUser { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsWorkflow? HistoryWorkflow { get; set; } + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowHistorySteps")] + public virtual CmsWorkflowStep? Step { get; set; } + + [ForeignKey("TargetStepId")] + [InverseProperty("CmsWorkflowHistoryTargetSteps")] + public virtual CmsWorkflowStep? TargetStep { get; set; } + + [ForeignKey("VersionHistoryId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsVersionHistory VersionHistory { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsWorkflowScope.cs b/Migration.Tool.KX13/Models/CmsWorkflowScope.cs new file mode 100644 index 00000000..f0ea8709 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWorkflowScope.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WorkflowScope")] +[Index("ScopeClassId", Name = "IX_CMS_WorkflowScope_ScopeClassID")] +[Index("ScopeCultureId", Name = "IX_CMS_WorkflowScope_ScopeCultureID")] +[Index("ScopeSiteId", Name = "IX_CMS_WorkflowScope_ScopeSiteID")] +[Index("ScopeWorkflowId", Name = "IX_CMS_WorkflowScope_ScopeWorkflowID")] +public class CmsWorkflowScope +{ + [Key] + [Column("ScopeID")] + public int ScopeId { get; set; } + + public string ScopeStartingPath { get; set; } = null!; + + [Column("ScopeWorkflowID")] + public int ScopeWorkflowId { get; set; } + + [Column("ScopeClassID")] + public int? ScopeClassId { get; set; } + + [Column("ScopeSiteID")] + public int ScopeSiteId { get; set; } + + [Column("ScopeGUID")] + public Guid ScopeGuid { get; set; } + + public DateTime ScopeLastModified { get; set; } + + [Column("ScopeCultureID")] + public int? ScopeCultureId { get; set; } + + public bool? ScopeExcludeChildren { get; set; } + + public bool ScopeExcluded { get; set; } + + public string? ScopeMacroCondition { get; set; } + + [ForeignKey("ScopeClassId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsClass? ScopeClass { get; set; } + + [ForeignKey("ScopeCultureId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsCulture? ScopeCulture { get; set; } + + [ForeignKey("ScopeSiteId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsSite ScopeSite { get; set; } = null!; + + [ForeignKey("ScopeWorkflowId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsWorkflow ScopeWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsWorkflowStep.cs b/Migration.Tool.KX13/Models/CmsWorkflowStep.cs new file mode 100644 index 00000000..49bf9b84 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWorkflowStep.cs @@ -0,0 +1,114 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WorkflowStep")] +[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] +[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] +[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] +[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] +public class CmsWorkflowStep +{ + [Key] + [Column("StepID")] + public int StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [StringLength(440)] + public string? StepName { get; set; } + + public int? StepOrder { get; set; } + + [Column("StepWorkflowID")] + public int StepWorkflowId { get; set; } + + [Column("StepGUID")] + public Guid StepGuid { get; set; } + + public DateTime StepLastModified { get; set; } + + public int? StepType { get; set; } + + public bool? StepAllowReject { get; set; } + + public string? StepDefinition { get; set; } + + public int? StepRolesSecurity { get; set; } + + public int? StepUsersSecurity { get; set; } + + [StringLength(200)] + public string? StepApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? StepRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? StepReadyforApprovalTemplateName { get; set; } + + public bool? StepSendApproveEmails { get; set; } + + public bool? StepSendRejectEmails { get; set; } + + public bool? StepSendReadyForApprovalEmails { get; set; } + + public bool? StepSendEmails { get; set; } + + public bool? StepAllowPublish { get; set; } + + [Column("StepActionID")] + public int? StepActionId { get; set; } + + public string? StepActionParameters { get; set; } + + public int? StepWorkflowType { get; set; } + + [InverseProperty("HistoryStep")] + public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); + + [InverseProperty("HistoryTargetStep")] + public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("StateStep")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("DocumentWorkflowStep")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("ObjectWorkflowStep")] + public virtual ICollection CmsObjectSettings { get; set; } = new List(); + + [InverseProperty("VersionWorkflowStep")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowHistorySteps { get; set; } = new List(); + + [InverseProperty("TargetStep")] + public virtual ICollection CmsWorkflowHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); + + [InverseProperty("TransitionEndStep")] + public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); + + [InverseProperty("TransitionStartStep")] + public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); + + [ForeignKey("StepActionId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflowAction? StepAction { get; set; } + + [ForeignKey("StepWorkflowId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflow StepWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsWorkflowStepRole.cs b/Migration.Tool.KX13/Models/CmsWorkflowStepRole.cs new file mode 100644 index 00000000..75dd468a --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWorkflowStepRole.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WorkflowStepRoles")] +[Index("RoleId", Name = "IX_CMS_WorkflowStepRoles_RoleID")] +public class CmsWorkflowStepRole +{ + [Key] + [Column("WorkflowStepRoleID")] + public int WorkflowStepRoleId { get; set; } + + [Column("StepID")] + public int StepId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [Column("StepSourcePointGUID")] + public Guid? StepSourcePointGuid { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsWorkflowStepRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowStepRoles")] + public virtual CmsWorkflowStep Step { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsWorkflowStepUser.cs b/Migration.Tool.KX13/Models/CmsWorkflowStepUser.cs new file mode 100644 index 00000000..138e6f3d --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWorkflowStepUser.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WorkflowStepUser")] +[Index("UserId", Name = "IX_CMS_WorkflowStepUser_UserID")] +public class CmsWorkflowStepUser +{ + [Key] + [Column("WorkflowStepUserID")] + public int WorkflowStepUserId { get; set; } + + [Column("StepID")] + public int StepId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("StepSourcePointGUID")] + public Guid? StepSourcePointGuid { get; set; } + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowStepUsers")] + public virtual CmsWorkflowStep Step { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsWorkflowStepUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/CmsWorkflowTransition.cs b/Migration.Tool.KX13/Models/CmsWorkflowTransition.cs new file mode 100644 index 00000000..1fe296b7 --- /dev/null +++ b/Migration.Tool.KX13/Models/CmsWorkflowTransition.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("CMS_WorkflowTransition")] +[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] +[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] +[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] +public class CmsWorkflowTransition +{ + [Key] + [Column("TransitionID")] + public int TransitionId { get; set; } + + [Column("TransitionStartStepID")] + public int TransitionStartStepId { get; set; } + + [Column("TransitionEndStepID")] + public int TransitionEndStepId { get; set; } + + public int TransitionType { get; set; } + + public DateTime TransitionLastModified { get; set; } + + [Column("TransitionSourcePointGUID")] + public Guid? TransitionSourcePointGuid { get; set; } + + [Column("TransitionWorkflowID")] + public int TransitionWorkflowId { get; set; } + + [ForeignKey("TransitionEndStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] + public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; + + [ForeignKey("TransitionStartStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] + public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; + + [ForeignKey("TransitionWorkflowId")] + [InverseProperty("CmsWorkflowTransitions")] + public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComAddress.cs b/Migration.Tool.KX13/Models/ComAddress.cs new file mode 100644 index 00000000..d0c316bd --- /dev/null +++ b/Migration.Tool.KX13/Models/ComAddress.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_Address")] +[Index("AddressCountryId", Name = "IX_COM_Address_AddressCountryID")] +[Index("AddressCustomerId", Name = "IX_COM_Address_AddressCustomerID")] +[Index("AddressStateId", Name = "IX_COM_Address_AddressStateID")] +public class ComAddress +{ + [Key] + [Column("AddressID")] + public int AddressId { get; set; } + + [StringLength(200)] + public string AddressName { get; set; } = null!; + + [StringLength(100)] + public string AddressLine1 { get; set; } = null!; + + [StringLength(100)] + public string? AddressLine2 { get; set; } + + [StringLength(100)] + public string AddressCity { get; set; } = null!; + + [StringLength(20)] + public string AddressZip { get; set; } = null!; + + [StringLength(26)] + public string? AddressPhone { get; set; } + + [Column("AddressCustomerID")] + public int AddressCustomerId { get; set; } + + [Column("AddressCountryID")] + public int AddressCountryId { get; set; } + + [Column("AddressStateID")] + public int? AddressStateId { get; set; } + + [StringLength(200)] + public string AddressPersonalName { get; set; } = null!; + + [Column("AddressGUID")] + public Guid? AddressGuid { get; set; } + + public DateTime AddressLastModified { get; set; } + + [ForeignKey("AddressCountryId")] + [InverseProperty("ComAddresses")] + public virtual CmsCountry AddressCountry { get; set; } = null!; + + [ForeignKey("AddressCustomerId")] + [InverseProperty("ComAddresses")] + public virtual ComCustomer AddressCustomer { get; set; } = null!; + + [ForeignKey("AddressStateId")] + [InverseProperty("ComAddresses")] + public virtual CmsState? AddressState { get; set; } + + [InverseProperty("ShoppingCartBillingAddress")] + public virtual ICollection ComShoppingCartShoppingCartBillingAddresses { get; set; } = new List(); + + [InverseProperty("ShoppingCartCompanyAddress")] + public virtual ICollection ComShoppingCartShoppingCartCompanyAddresses { get; set; } = new List(); + + [InverseProperty("ShoppingCartShippingAddress")] + public virtual ICollection ComShoppingCartShoppingCartShippingAddresses { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/ComBrand.cs b/Migration.Tool.KX13/Models/ComBrand.cs new file mode 100644 index 00000000..d7f185b0 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComBrand.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_Brand")] +[Index("BrandDisplayName", Name = "IX_COM_Brand_BrandDisplayName")] +[Index("BrandSiteId", "BrandEnabled", Name = "IX_COM_Brand_BrandSiteID_BrandEnabled")] +public class ComBrand +{ + [Key] + [Column("BrandID")] + public int BrandId { get; set; } + + [StringLength(200)] + public string BrandDisplayName { get; set; } = null!; + + [StringLength(200)] + public string BrandName { get; set; } = null!; + + public string? BrandDescription { get; set; } + + [StringLength(400)] + public string? BrandHomepage { get; set; } + + [Column("BrandThumbnailGUID")] + public Guid? BrandThumbnailGuid { get; set; } + + [Column("BrandSiteID")] + public int BrandSiteId { get; set; } + + [Required] + public bool? BrandEnabled { get; set; } + + public Guid BrandGuid { get; set; } + + public DateTime BrandLastModified { get; set; } + + [ForeignKey("BrandSiteId")] + [InverseProperty("ComBrands")] + public virtual CmsSite BrandSite { get; set; } = null!; + + [InverseProperty("Brand")] + public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); + + [InverseProperty("Skubrand")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/ComCarrier.cs b/Migration.Tool.KX13/Models/ComCarrier.cs new file mode 100644 index 00000000..de0d3426 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComCarrier.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_Carrier")] +[Index("CarrierSiteId", Name = "IX_COM_Carrier_CarrierSiteID")] +public class ComCarrier +{ + [Key] + [Column("CarrierID")] + public int CarrierId { get; set; } + + [StringLength(200)] + public string CarrierDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CarrierName { get; set; } = null!; + + [Column("CarrierSiteID")] + public int CarrierSiteId { get; set; } + + [Column("CarrierGUID")] + public Guid CarrierGuid { get; set; } + + [StringLength(200)] + public string CarrierAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string CarrierClassName { get; set; } = null!; + + public DateTime CarrierLastModified { get; set; } + + [ForeignKey("CarrierSiteId")] + [InverseProperty("ComCarriers")] + public virtual CmsSite CarrierSite { get; set; } = null!; + + [InverseProperty("ShippingOptionCarrier")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/ComCollection.cs b/Migration.Tool.KX13/Models/ComCollection.cs new file mode 100644 index 00000000..f9105a37 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComCollection.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_Collection")] +[Index("CollectionDisplayName", Name = "IX_COM_Collection_CollectionDisplayName")] +[Index("CollectionSiteId", "CollectionEnabled", Name = "IX_COM_Collection_CollectionSiteID_CollectionEnabled")] +public class ComCollection +{ + [Key] + [Column("CollectionID")] + public int CollectionId { get; set; } + + [StringLength(200)] + public string CollectionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CollectionName { get; set; } = null!; + + public string? CollectionDescription { get; set; } + + [Column("CollectionSiteID")] + public int CollectionSiteId { get; set; } + + [Required] + public bool? CollectionEnabled { get; set; } + + public Guid CollectionGuid { get; set; } + + public DateTime CollectionLastModified { get; set; } + + [ForeignKey("CollectionSiteId")] + [InverseProperty("ComCollections")] + public virtual CmsSite CollectionSite { get; set; } = null!; + + [InverseProperty("Collection")] + public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); + + [InverseProperty("Skucollection")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/ComCouponCode.cs b/Migration.Tool.KX13/Models/ComCouponCode.cs new file mode 100644 index 00000000..640d361b --- /dev/null +++ b/Migration.Tool.KX13/Models/ComCouponCode.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_CouponCode")] +[Index("CouponCodeDiscountId", Name = "IX_COM_CouponCode_CouponCodeDiscountID")] +public class ComCouponCode +{ + [Key] + [Column("CouponCodeID")] + public int CouponCodeId { get; set; } + + [StringLength(200)] + public string CouponCodeCode { get; set; } = null!; + + public int? CouponCodeUseCount { get; set; } + + public int? CouponCodeUseLimit { get; set; } + + [Column("CouponCodeDiscountID")] + public int CouponCodeDiscountId { get; set; } + + public DateTime CouponCodeLastModified { get; set; } + + [Column("CouponCodeGUID")] + public Guid CouponCodeGuid { get; set; } + + [ForeignKey("CouponCodeDiscountId")] + [InverseProperty("ComCouponCodes")] + public virtual ComDiscount CouponCodeDiscount { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComCurrency.cs b/Migration.Tool.KX13/Models/ComCurrency.cs new file mode 100644 index 00000000..a306b9d6 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComCurrency.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_Currency")] +[Index("CurrencyDisplayName", Name = "IX_COM_Currency_CurrencyDisplayName")] +[Index("CurrencySiteId", Name = "IX_COM_Currency_CurrencySiteID")] +public class ComCurrency +{ + [Key] + [Column("CurrencyID")] + public int CurrencyId { get; set; } + + [StringLength(200)] + public string CurrencyName { get; set; } = null!; + + [StringLength(200)] + public string CurrencyDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CurrencyCode { get; set; } = null!; + + public int? CurrencyRoundTo { get; set; } + + public bool CurrencyEnabled { get; set; } + + [StringLength(200)] + public string CurrencyFormatString { get; set; } = null!; + + public bool CurrencyIsMain { get; set; } + + [Column("CurrencyGUID")] + public Guid? CurrencyGuid { get; set; } + + public DateTime CurrencyLastModified { get; set; } + + [Column("CurrencySiteID")] + public int? CurrencySiteId { get; set; } + + [InverseProperty("ExchangeRateToCurrency")] + public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); + + [InverseProperty("OrderCurrency")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartCurrency")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("CurrencySiteId")] + [InverseProperty("ComCurrencies")] + public virtual CmsSite? CurrencySite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComCurrencyExchangeRate.cs b/Migration.Tool.KX13/Models/ComCurrencyExchangeRate.cs new file mode 100644 index 00000000..9fc5e26c --- /dev/null +++ b/Migration.Tool.KX13/Models/ComCurrencyExchangeRate.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_CurrencyExchangeRate")] +[Index("ExchangeRateToCurrencyId", Name = "IX_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID")] +[Index("ExchangeTableId", Name = "IX_COM_CurrencyExchangeRate_ExchangeTableID")] +public class ComCurrencyExchangeRate +{ + [Key] + [Column("ExchagneRateID")] + public int ExchagneRateId { get; set; } + + [Column("ExchangeRateToCurrencyID")] + public int ExchangeRateToCurrencyId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal ExchangeRateValue { get; set; } + + [Column("ExchangeTableID")] + public int ExchangeTableId { get; set; } + + [Column("ExchangeRateGUID")] + public Guid ExchangeRateGuid { get; set; } + + public DateTime ExchangeRateLastModified { get; set; } + + [ForeignKey("ExchangeRateToCurrencyId")] + [InverseProperty("ComCurrencyExchangeRates")] + public virtual ComCurrency ExchangeRateToCurrency { get; set; } = null!; + + [ForeignKey("ExchangeTableId")] + [InverseProperty("ComCurrencyExchangeRates")] + public virtual ComExchangeTable ExchangeTable { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComCustomer.cs b/Migration.Tool.KX13/Models/ComCustomer.cs new file mode 100644 index 00000000..bf5450f7 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComCustomer.cs @@ -0,0 +1,78 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_Customer")] +[Index("CustomerEmail", Name = "IX_COM_Customer_CustomerEmail")] +[Index("CustomerFirstName", Name = "IX_COM_Customer_CustomerFirstName")] +[Index("CustomerLastName", Name = "IX_COM_Customer_CustomerLastName")] +[Index("CustomerSiteId", Name = "IX_COM_Customer_CustomerSiteID")] +[Index("CustomerUserId", Name = "IX_COM_Customer_CustomerUserID")] +public class ComCustomer +{ + [Key] + [Column("CustomerID")] + public int CustomerId { get; set; } + + [StringLength(200)] + public string CustomerFirstName { get; set; } = null!; + + [StringLength(200)] + public string CustomerLastName { get; set; } = null!; + + [StringLength(254)] + public string? CustomerEmail { get; set; } + + [StringLength(26)] + public string? CustomerPhone { get; set; } + + [StringLength(50)] + public string? CustomerFax { get; set; } + + [StringLength(200)] + public string? CustomerCompany { get; set; } + + [Column("CustomerUserID")] + public int? CustomerUserId { get; set; } + + [Column("CustomerGUID")] + public Guid CustomerGuid { get; set; } + + [Column("CustomerTaxRegistrationID")] + [StringLength(50)] + public string? CustomerTaxRegistrationId { get; set; } + + [Column("CustomerOrganizationID")] + [StringLength(50)] + public string? CustomerOrganizationId { get; set; } + + public DateTime CustomerLastModified { get; set; } + + [Column("CustomerSiteID")] + public int? CustomerSiteId { get; set; } + + public DateTime? CustomerCreated { get; set; } + + [InverseProperty("AddressCustomer")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("EventCustomer")] + public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); + + [InverseProperty("OrderCustomer")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartCustomer")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("CustomerSiteId")] + [InverseProperty("ComCustomers")] + public virtual CmsSite? CustomerSite { get; set; } + + [ForeignKey("CustomerUserId")] + [InverseProperty("ComCustomers")] + public virtual CmsUser? CustomerUser { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComCustomerCreditHistory.cs b/Migration.Tool.KX13/Models/ComCustomerCreditHistory.cs new file mode 100644 index 00000000..5e8eb5ea --- /dev/null +++ b/Migration.Tool.KX13/Models/ComCustomerCreditHistory.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_CustomerCreditHistory")] +[Index("EventCustomerId", "EventDate", Name = "IX_COM_CustomerCreditHistory_EventCustomerID_EventDate", IsDescending = new[] { false, true })] +[Index("EventSiteId", Name = "IX_COM_CustomerCreditHistory_EventSiteID")] +public class ComCustomerCreditHistory +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(200)] + public string EventName { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal EventCreditChange { get; set; } + + public DateTime EventDate { get; set; } + + public string? EventDescription { get; set; } + + [Column("EventCustomerID")] + public int EventCustomerId { get; set; } + + [Column("EventCreditGUID")] + public Guid? EventCreditGuid { get; set; } + + public DateTime EventCreditLastModified { get; set; } + + [Column("EventSiteID")] + public int? EventSiteId { get; set; } + + [ForeignKey("EventCustomerId")] + [InverseProperty("ComCustomerCreditHistories")] + public virtual ComCustomer EventCustomer { get; set; } = null!; + + [ForeignKey("EventSiteId")] + [InverseProperty("ComCustomerCreditHistories")] + public virtual CmsSite? EventSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComDepartment.cs b/Migration.Tool.KX13/Models/ComDepartment.cs new file mode 100644 index 00000000..75279d08 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComDepartment.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_Department")] +[Index("DepartmentDefaultTaxClassId", Name = "IX_COM_Department_DepartmentDefaultTaxClassID")] +[Index("DepartmentDisplayName", Name = "IX_COM_Department_DepartmentDisplayName")] +[Index("DepartmentName", "DepartmentSiteId", Name = "IX_COM_Department_DepartmentName_DepartmentSiteID", IsUnique = true)] +[Index("DepartmentSiteId", Name = "IX_COM_Department_DepartmentSiteID")] +public class ComDepartment +{ + [Key] + [Column("DepartmentID")] + public int DepartmentId { get; set; } + + [StringLength(200)] + public string DepartmentName { get; set; } = null!; + + [StringLength(200)] + public string DepartmentDisplayName { get; set; } = null!; + + [Column("DepartmentDefaultTaxClassID")] + public int? DepartmentDefaultTaxClassId { get; set; } + + [Column("DepartmentGUID")] + public Guid DepartmentGuid { get; set; } + + public DateTime DepartmentLastModified { get; set; } + + [Column("DepartmentSiteID")] + public int? DepartmentSiteId { get; set; } + + [InverseProperty("Skudepartment")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("DepartmentDefaultTaxClassId")] + [InverseProperty("ComDepartments")] + public virtual ComTaxClass? DepartmentDefaultTaxClass { get; set; } + + [ForeignKey("DepartmentSiteId")] + [InverseProperty("ComDepartments")] + public virtual CmsSite? DepartmentSite { get; set; } + + [ForeignKey("DepartmentId")] + [InverseProperty("Departments")] + public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/ComDiscount.cs b/Migration.Tool.KX13/Models/ComDiscount.cs new file mode 100644 index 00000000..c70e0123 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComDiscount.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_Discount")] +[Index("DiscountSiteId", Name = "IX_COM_Discount_DiscountSiteID")] +public class ComDiscount +{ + [Key] + [Column("DiscountID")] + public int DiscountId { get; set; } + + [StringLength(200)] + public string DiscountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string DiscountName { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal DiscountValue { get; set; } + + [Required] + public bool? DiscountEnabled { get; set; } + + [Column("DiscountGUID")] + public Guid DiscountGuid { get; set; } + + public DateTime DiscountLastModified { get; set; } + + [Column("DiscountSiteID")] + public int DiscountSiteId { get; set; } + + public string? DiscountDescription { get; set; } + + public DateTime? DiscountValidFrom { get; set; } + + public DateTime? DiscountValidTo { get; set; } + + public double DiscountOrder { get; set; } + + public string? DiscountProductCondition { get; set; } + + [StringLength(400)] + public string? DiscountRoles { get; set; } + + [StringLength(200)] + public string? DiscountCustomerRestriction { get; set; } + + public bool DiscountIsFlat { get; set; } + + public string? DiscountCartCondition { get; set; } + + [StringLength(100)] + public string DiscountApplyTo { get; set; } = null!; + + [Required] + public bool? DiscountApplyFurtherDiscounts { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? DiscountOrderAmount { get; set; } + + public bool DiscountUsesCoupons { get; set; } + + [InverseProperty("CouponCodeDiscount")] + public virtual ICollection ComCouponCodes { get; set; } = new List(); + + [ForeignKey("DiscountSiteId")] + [InverseProperty("ComDiscounts")] + public virtual CmsSite DiscountSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComExchangeTable.cs b/Migration.Tool.KX13/Models/ComExchangeTable.cs new file mode 100644 index 00000000..a3368460 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComExchangeTable.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_ExchangeTable")] +[Index("ExchangeTableSiteId", Name = "IX_COM_ExchangeTable_ExchangeTableSiteID")] +public class ComExchangeTable +{ + [Key] + [Column("ExchangeTableID")] + public int ExchangeTableId { get; set; } + + [StringLength(200)] + public string ExchangeTableDisplayName { get; set; } = null!; + + public DateTime? ExchangeTableValidFrom { get; set; } + + public DateTime? ExchangeTableValidTo { get; set; } + + [Column("ExchangeTableGUID")] + public Guid ExchangeTableGuid { get; set; } + + public DateTime ExchangeTableLastModified { get; set; } + + [Column("ExchangeTableSiteID")] + public int? ExchangeTableSiteId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? ExchangeTableRateFromGlobalCurrency { get; set; } + + [InverseProperty("ExchangeTable")] + public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); + + [ForeignKey("ExchangeTableSiteId")] + [InverseProperty("ComExchangeTables")] + public virtual CmsSite? ExchangeTableSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComGiftCard.cs b/Migration.Tool.KX13/Models/ComGiftCard.cs new file mode 100644 index 00000000..0e4180b4 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComGiftCard.cs @@ -0,0 +1,58 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_GiftCard")] +[Index("GiftCardSiteId", Name = "IX_COM_GiftCard_GiftCardSiteID")] +public class ComGiftCard +{ + [Key] + [Column("GiftCardID")] + public int GiftCardId { get; set; } + + public Guid GiftCardGuid { get; set; } + + [StringLength(200)] + public string GiftCardDisplayName { get; set; } = null!; + + [StringLength(200)] + public string GiftCardName { get; set; } = null!; + + public string? GiftCardDescription { get; set; } + + [Required] + public bool? GiftCardEnabled { get; set; } + + public DateTime GiftCardLastModified { get; set; } + + [Column("GiftCardSiteID")] + public int GiftCardSiteId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal GiftCardValue { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? GiftCardMinimumOrderPrice { get; set; } + + public string? GiftCardCartCondition { get; set; } + + public DateTime? GiftCardValidFrom { get; set; } + + public DateTime? GiftCardValidTo { get; set; } + + [StringLength(200)] + public string? GiftCardCustomerRestriction { get; set; } + + [StringLength(400)] + public string? GiftCardRoles { get; set; } + + [InverseProperty("GiftCardCouponCodeGiftCard")] + public virtual ICollection ComGiftCardCouponCodes { get; set; } = new List(); + + [ForeignKey("GiftCardSiteId")] + [InverseProperty("ComGiftCards")] + public virtual CmsSite GiftCardSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComGiftCardCouponCode.cs b/Migration.Tool.KX13/Models/ComGiftCardCouponCode.cs new file mode 100644 index 00000000..9f2c2e93 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComGiftCardCouponCode.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_GiftCardCouponCode")] +[Index("GiftCardCouponCodeGiftCardId", Name = "IX_COM_GiftCardCouponCodeGiftCardID")] +public class ComGiftCardCouponCode +{ + [Key] + [Column("GiftCardCouponCodeID")] + public int GiftCardCouponCodeId { get; set; } + + [StringLength(200)] + public string GiftCardCouponCodeCode { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal GiftCardCouponCodeRemainingValue { get; set; } + + [Column("GiftCardCouponCodeGiftCardID")] + public int GiftCardCouponCodeGiftCardId { get; set; } + + public Guid GiftCardCouponCodeGuid { get; set; } + + public DateTime GiftCardCouponCodeLastModified { get; set; } + + [ForeignKey("GiftCardCouponCodeGiftCardId")] + [InverseProperty("ComGiftCardCouponCodes")] + public virtual ComGiftCard GiftCardCouponCodeGiftCard { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComInternalStatus.cs b/Migration.Tool.KX13/Models/ComInternalStatus.cs new file mode 100644 index 00000000..0e0c9db5 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComInternalStatus.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_InternalStatus")] +[Index("InternalStatusSiteId", "InternalStatusDisplayName", "InternalStatusEnabled", Name = "IX_COM_InternalStatus_InternalStatusSiteID_InternalStatusDisplayName_InternalStatusEnabled")] +public class ComInternalStatus +{ + [Key] + [Column("InternalStatusID")] + public int InternalStatusId { get; set; } + + [StringLength(200)] + public string InternalStatusName { get; set; } = null!; + + [StringLength(200)] + public string InternalStatusDisplayName { get; set; } = null!; + + [Required] + public bool? InternalStatusEnabled { get; set; } + + [Column("InternalStatusGUID")] + public Guid InternalStatusGuid { get; set; } + + public DateTime InternalStatusLastModified { get; set; } + + [Column("InternalStatusSiteID")] + public int? InternalStatusSiteId { get; set; } + + [InverseProperty("SkuinternalStatus")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("InternalStatusSiteId")] + [InverseProperty("ComInternalStatuses")] + public virtual CmsSite? InternalStatusSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComManufacturer.cs b/Migration.Tool.KX13/Models/ComManufacturer.cs new file mode 100644 index 00000000..344b29cc --- /dev/null +++ b/Migration.Tool.KX13/Models/ComManufacturer.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_Manufacturer")] +[Index("ManufacturerSiteId", Name = "IX_COM_Manufacturer_ManufacturerSiteID")] +public class ComManufacturer +{ + [Key] + [Column("ManufacturerID")] + public int ManufacturerId { get; set; } + + [StringLength(200)] + public string ManufacturerDisplayName { get; set; } = null!; + + [StringLength(400)] + public string? ManufactureHomepage { get; set; } + + [Required] + public bool? ManufacturerEnabled { get; set; } + + [Column("ManufacturerGUID")] + public Guid ManufacturerGuid { get; set; } + + public DateTime ManufacturerLastModified { get; set; } + + [Column("ManufacturerSiteID")] + public int? ManufacturerSiteId { get; set; } + + [Column("ManufacturerThumbnailGUID")] + public Guid? ManufacturerThumbnailGuid { get; set; } + + public string? ManufacturerDescription { get; set; } + + [StringLength(200)] + public string? ManufacturerName { get; set; } + + [InverseProperty("Skumanufacturer")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("ManufacturerSiteId")] + [InverseProperty("ComManufacturers")] + public virtual CmsSite? ManufacturerSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComMultiBuyCouponCode.cs b/Migration.Tool.KX13/Models/ComMultiBuyCouponCode.cs new file mode 100644 index 00000000..30137b2b --- /dev/null +++ b/Migration.Tool.KX13/Models/ComMultiBuyCouponCode.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_MultiBuyCouponCode")] +[Index("MultiBuyCouponCodeMultiBuyDiscountId", Name = "IX_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID")] +public class ComMultiBuyCouponCode +{ + [Key] + [Column("MultiBuyCouponCodeID")] + public int MultiBuyCouponCodeId { get; set; } + + [StringLength(200)] + public string MultiBuyCouponCodeCode { get; set; } = null!; + + public int? MultiBuyCouponCodeUseLimit { get; set; } + + public int? MultiBuyCouponCodeUseCount { get; set; } + + [Column("MultiBuyCouponCodeMultiBuyDiscountID")] + public int MultiBuyCouponCodeMultiBuyDiscountId { get; set; } + + public DateTime MultiBuyCouponCodeLastModified { get; set; } + + [Column("MultiBuyCouponCodeGUID")] + public Guid MultiBuyCouponCodeGuid { get; set; } + + [ForeignKey("MultiBuyCouponCodeMultiBuyDiscountId")] + [InverseProperty("ComMultiBuyCouponCodes")] + public virtual ComMultiBuyDiscount MultiBuyCouponCodeMultiBuyDiscount { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComMultiBuyDiscount.cs b/Migration.Tool.KX13/Models/ComMultiBuyDiscount.cs new file mode 100644 index 00000000..375f4e7b --- /dev/null +++ b/Migration.Tool.KX13/Models/ComMultiBuyDiscount.cs @@ -0,0 +1,97 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_MultiBuyDiscount")] +[Index("MultiBuyDiscountApplyToSkuid", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID")] +[Index("MultiBuyDiscountSiteId", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountSiteID")] +public class ComMultiBuyDiscount +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [StringLength(200)] + public string MultiBuyDiscountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string MultiBuyDiscountName { get; set; } = null!; + + public string? MultiBuyDiscountDescription { get; set; } + + [Required] + public bool? MultiBuyDiscountEnabled { get; set; } + + [Column("MultiBuyDiscountGUID")] + public Guid MultiBuyDiscountGuid { get; set; } + + public DateTime MultiBuyDiscountLastModified { get; set; } + + [Column("MultiBuyDiscountSiteID")] + public int MultiBuyDiscountSiteId { get; set; } + + [Required] + public bool? MultiBuyDiscountApplyFurtherDiscounts { get; set; } + + public int MultiBuyDiscountMinimumBuyCount { get; set; } + + public DateTime? MultiBuyDiscountValidFrom { get; set; } + + public DateTime? MultiBuyDiscountValidTo { get; set; } + + [StringLength(200)] + public string MultiBuyDiscountCustomerRestriction { get; set; } = null!; + + [StringLength(400)] + public string? MultiBuyDiscountRoles { get; set; } + + [Column("MultiBuyDiscountApplyToSKUID")] + public int? MultiBuyDiscountApplyToSkuid { get; set; } + + public int? MultiBuyDiscountLimitPerOrder { get; set; } + + public bool? MultiBuyDiscountUsesCoupons { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? MultiBuyDiscountValue { get; set; } + + public bool? MultiBuyDiscountIsFlat { get; set; } + + [Required] + public bool? MultiBuyDiscountAutoAddEnabled { get; set; } + + public int? MultiBuyDiscountPriority { get; set; } + + public bool MultiBuyDiscountIsProductCoupon { get; set; } + + [InverseProperty("MultiBuyCouponCodeMultiBuyDiscount")] + public virtual ICollection ComMultiBuyCouponCodes { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscount")] + public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); + + [InverseProperty("MultibuyDiscount")] + public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscount")] + public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); + + [ForeignKey("MultiBuyDiscountApplyToSkuid")] + [InverseProperty("ComMultiBuyDiscounts")] + public virtual ComSku? MultiBuyDiscountApplyToSku { get; set; } + + [ForeignKey("MultiBuyDiscountSiteId")] + [InverseProperty("ComMultiBuyDiscounts")] + public virtual CmsSite MultiBuyDiscountSite { get; set; } = null!; + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("MultiBuyDiscounts")] + public virtual ICollection Departments { get; set; } = new List(); + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("MultiBuyDiscounts")] + public virtual ICollection Skus { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/ComMultiBuyDiscountBrand.cs b/Migration.Tool.KX13/Models/ComMultiBuyDiscountBrand.cs new file mode 100644 index 00000000..b0fd74ce --- /dev/null +++ b/Migration.Tool.KX13/Models/ComMultiBuyDiscountBrand.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[PrimaryKey("MultiBuyDiscountId", "BrandId")] +[Table("COM_MultiBuyDiscountBrand")] +[Index("BrandId", Name = "IX_COM_MultiBuyDiscountBrand_BrandID")] +public class ComMultiBuyDiscountBrand +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [Key] + [Column("BrandID")] + public int BrandId { get; set; } + + [Required] + public bool? BrandIncluded { get; set; } + + [ForeignKey("BrandId")] + [InverseProperty("ComMultiBuyDiscountBrands")] + public virtual ComBrand Brand { get; set; } = null!; + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountBrands")] + public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComMultiBuyDiscountCollection.cs b/Migration.Tool.KX13/Models/ComMultiBuyDiscountCollection.cs new file mode 100644 index 00000000..d2f98e8e --- /dev/null +++ b/Migration.Tool.KX13/Models/ComMultiBuyDiscountCollection.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[PrimaryKey("MultibuyDiscountId", "CollectionId")] +[Table("COM_MultiBuyDiscountCollection")] +[Index("CollectionId", Name = "IX_COM_MultiBuyDiscountCollection_CollectionID")] +public class ComMultiBuyDiscountCollection +{ + [Key] + [Column("MultibuyDiscountID")] + public int MultibuyDiscountId { get; set; } + + [Key] + [Column("CollectionID")] + public int CollectionId { get; set; } + + [Required] + public bool? CollectionIncluded { get; set; } + + [ForeignKey("CollectionId")] + [InverseProperty("ComMultiBuyDiscountCollections")] + public virtual ComCollection Collection { get; set; } = null!; + + [ForeignKey("MultibuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountCollections")] + public virtual ComMultiBuyDiscount MultibuyDiscount { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComMultiBuyDiscountTree.cs b/Migration.Tool.KX13/Models/ComMultiBuyDiscountTree.cs new file mode 100644 index 00000000..1313d034 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComMultiBuyDiscountTree.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[PrimaryKey("MultiBuyDiscountId", "NodeId")] +[Table("COM_MultiBuyDiscountTree")] +[Index("NodeId", Name = "IX_COM_MultiBuyDiscountTree_NodeID")] +public class ComMultiBuyDiscountTree +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + [Required] + public bool? NodeIncluded { get; set; } + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountTrees")] + public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; + + [ForeignKey("NodeId")] + [InverseProperty("ComMultiBuyDiscountTrees")] + public virtual CmsTree Node { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComOptionCategory.cs b/Migration.Tool.KX13/Models/ComOptionCategory.cs new file mode 100644 index 00000000..e8c0f916 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComOptionCategory.cs @@ -0,0 +1,65 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_OptionCategory")] +[Index("CategorySiteId", Name = "IX_COM_OptionCategory_CategorySiteID")] +public class ComOptionCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryName { get; set; } = null!; + + [StringLength(200)] + public string CategorySelectionType { get; set; } = null!; + + [StringLength(200)] + public string? CategoryDefaultOptions { get; set; } + + public string? CategoryDescription { get; set; } + + [StringLength(200)] + public string? CategoryDefaultRecord { get; set; } + + [Required] + public bool? CategoryEnabled { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + public bool? CategoryDisplayPrice { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + public int? CategoryTextMaxLength { get; set; } + + [StringLength(20)] + public string? CategoryType { get; set; } + + public int? CategoryTextMinLength { get; set; } + + [StringLength(200)] + public string? CategoryLiveSiteDisplayName { get; set; } + + [ForeignKey("CategorySiteId")] + [InverseProperty("ComOptionCategories")] + public virtual CmsSite? CategorySite { get; set; } + + [InverseProperty("Category")] + public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); + + [InverseProperty("SkuoptionCategory")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/ComOrder.cs b/Migration.Tool.KX13/Models/ComOrder.cs new file mode 100644 index 00000000..cedced41 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComOrder.cs @@ -0,0 +1,131 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_Order")] +[Index("OrderCreatedByUserId", Name = "IX_COM_Order_OrderCreatedByUserID")] +[Index("OrderCurrencyId", Name = "IX_COM_Order_OrderCurrencyID")] +[Index("OrderCustomerId", Name = "IX_COM_Order_OrderCustomerID")] +[Index("OrderPaymentOptionId", Name = "IX_COM_Order_OrderPaymentOptionID")] +[Index("OrderShippingOptionId", Name = "IX_COM_Order_OrderShippingOptionID")] +[Index("OrderSiteId", "OrderDate", Name = "IX_COM_Order_OrderSiteID_OrderDate", IsDescending = new[] { false, true })] +[Index("OrderStatusId", Name = "IX_COM_Order_OrderStatusID")] +public class ComOrder +{ + [Key] + [Column("OrderID")] + public int OrderId { get; set; } + + [Column("OrderShippingOptionID")] + public int? OrderShippingOptionId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderTotalShipping { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderTotalPrice { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderTotalTax { get; set; } + + public DateTime OrderDate { get; set; } + + [Column("OrderStatusID")] + public int? OrderStatusId { get; set; } + + [Column("OrderCurrencyID")] + public int? OrderCurrencyId { get; set; } + + [Column("OrderCustomerID")] + public int OrderCustomerId { get; set; } + + [Column("OrderCreatedByUserID")] + public int? OrderCreatedByUserId { get; set; } + + public string? OrderNote { get; set; } + + [Column("OrderSiteID")] + public int OrderSiteId { get; set; } + + [Column("OrderPaymentOptionID")] + public int? OrderPaymentOptionId { get; set; } + + public string? OrderInvoice { get; set; } + + [StringLength(200)] + public string? OrderInvoiceNumber { get; set; } + + [StringLength(100)] + public string? OrderTrackingNumber { get; set; } + + public string? OrderCustomData { get; set; } + + public string? OrderPaymentResult { get; set; } + + [Column("OrderGUID")] + public Guid OrderGuid { get; set; } + + public DateTime OrderLastModified { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderTotalPriceInMainCurrency { get; set; } + + public bool? OrderIsPaid { get; set; } + + [StringLength(50)] + public string? OrderCulture { get; set; } + + public string? OrderDiscounts { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderGrandTotal { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderGrandTotalInMainCurrency { get; set; } + + public string? OrderOtherPayments { get; set; } + + public string? OrderTaxSummary { get; set; } + + public string? OrderCouponCodes { get; set; } + + [InverseProperty("AddressOrder")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("OrderItemOrder")] + public virtual ICollection ComOrderItems { get; set; } = new List(); + + [InverseProperty("Order")] + public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); + + [ForeignKey("OrderCreatedByUserId")] + [InverseProperty("ComOrders")] + public virtual CmsUser? OrderCreatedByUser { get; set; } + + [ForeignKey("OrderCurrencyId")] + [InverseProperty("ComOrders")] + public virtual ComCurrency? OrderCurrency { get; set; } + + [ForeignKey("OrderCustomerId")] + [InverseProperty("ComOrders")] + public virtual ComCustomer OrderCustomer { get; set; } = null!; + + [ForeignKey("OrderPaymentOptionId")] + [InverseProperty("ComOrders")] + public virtual ComPaymentOption? OrderPaymentOption { get; set; } + + [ForeignKey("OrderShippingOptionId")] + [InverseProperty("ComOrders")] + public virtual ComShippingOption? OrderShippingOption { get; set; } + + [ForeignKey("OrderSiteId")] + [InverseProperty("ComOrders")] + public virtual CmsSite OrderSite { get; set; } = null!; + + [ForeignKey("OrderStatusId")] + [InverseProperty("ComOrders")] + public virtual ComOrderStatus? OrderStatus { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComOrderAddress.cs b/Migration.Tool.KX13/Models/ComOrderAddress.cs new file mode 100644 index 00000000..6cb8bfa8 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComOrderAddress.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_OrderAddress")] +[Index("AddressCountryId", Name = "IX_COM_OrderAddress_AddressCountryID")] +[Index("AddressOrderId", "AddressType", Name = "IX_COM_OrderAddress_AddressOrderID_AddressType", IsUnique = true)] +[Index("AddressStateId", Name = "IX_COM_OrderAddress_AddressStateID")] +public class ComOrderAddress +{ + [Key] + [Column("AddressID")] + public int AddressId { get; set; } + + [StringLength(100)] + public string AddressLine1 { get; set; } = null!; + + [StringLength(100)] + public string? AddressLine2 { get; set; } + + [StringLength(100)] + public string AddressCity { get; set; } = null!; + + [StringLength(20)] + public string AddressZip { get; set; } = null!; + + [StringLength(26)] + public string? AddressPhone { get; set; } + + [Column("AddressCountryID")] + public int AddressCountryId { get; set; } + + [Column("AddressStateID")] + public int? AddressStateId { get; set; } + + [StringLength(200)] + public string AddressPersonalName { get; set; } = null!; + + [Column("AddressGUID")] + public Guid? AddressGuid { get; set; } + + public DateTime AddressLastModified { get; set; } + + [Column("AddressOrderID")] + public int AddressOrderId { get; set; } + + public int AddressType { get; set; } + + [ForeignKey("AddressCountryId")] + [InverseProperty("ComOrderAddresses")] + public virtual CmsCountry AddressCountry { get; set; } = null!; + + [ForeignKey("AddressOrderId")] + [InverseProperty("ComOrderAddresses")] + public virtual ComOrder AddressOrder { get; set; } = null!; + + [ForeignKey("AddressStateId")] + [InverseProperty("ComOrderAddresses")] + public virtual CmsState? AddressState { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComOrderItem.cs b/Migration.Tool.KX13/Models/ComOrderItem.cs new file mode 100644 index 00000000..224ec4c5 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComOrderItem.cs @@ -0,0 +1,69 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_OrderItem")] +[Index("OrderItemOrderId", Name = "IX_COM_OrderItem_OrderItemOrderID")] +[Index("OrderItemSkuid", Name = "IX_COM_OrderItem_OrderItemSKUID")] +public class ComOrderItem +{ + [Key] + [Column("OrderItemID")] + public int OrderItemId { get; set; } + + [Column("OrderItemOrderID")] + public int OrderItemOrderId { get; set; } + + [Column("OrderItemSKUID")] + public int OrderItemSkuid { get; set; } + + [Column("OrderItemSKUName")] + [StringLength(450)] + public string OrderItemSkuname { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderItemUnitPrice { get; set; } + + public int OrderItemUnitCount { get; set; } + + public string? OrderItemCustomData { get; set; } + + public Guid OrderItemGuid { get; set; } + + public Guid? OrderItemParentGuid { get; set; } + + public DateTime OrderItemLastModified { get; set; } + + public DateTime? OrderItemValidTo { get; set; } + + [Column("OrderItemBundleGUID")] + public Guid? OrderItemBundleGuid { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderItemTotalPriceInMainCurrency { get; set; } + + public bool? OrderItemSendNotification { get; set; } + + public string? OrderItemText { get; set; } + + public string? OrderItemProductDiscounts { get; set; } + + public string? OrderItemDiscountSummary { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderItemTotalPrice { get; set; } + + [InverseProperty("OrderItem")] + public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); + + [ForeignKey("OrderItemOrderId")] + [InverseProperty("ComOrderItems")] + public virtual ComOrder OrderItemOrder { get; set; } = null!; + + [ForeignKey("OrderItemSkuid")] + [InverseProperty("ComOrderItems")] + public virtual ComSku OrderItemSku { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComOrderItemSkufile.cs b/Migration.Tool.KX13/Models/ComOrderItemSkufile.cs new file mode 100644 index 00000000..a2724634 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComOrderItemSkufile.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_OrderItemSKUFile")] +[Index("FileId", Name = "IX_COM_OrderItemSKUFile_FileID")] +[Index("OrderItemId", Name = "IX_COM_OrderItemSKUFile_OrderItemID")] +public class ComOrderItemSkufile +{ + [Key] + [Column("OrderItemSKUFileID")] + public int OrderItemSkufileId { get; set; } + + public Guid Token { get; set; } + + [Column("OrderItemID")] + public int OrderItemId { get; set; } + + [Column("FileID")] + public int FileId { get; set; } + + [ForeignKey("FileId")] + [InverseProperty("ComOrderItemSkufiles")] + public virtual ComSkufile File { get; set; } = null!; + + [ForeignKey("OrderItemId")] + [InverseProperty("ComOrderItemSkufiles")] + public virtual ComOrderItem OrderItem { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComOrderStatus.cs b/Migration.Tool.KX13/Models/ComOrderStatus.cs new file mode 100644 index 00000000..298f5b44 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComOrderStatus.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_OrderStatus")] +[Index("StatusSiteId", "StatusOrder", Name = "IX_COM_OrderStatus_StatusSiteID_StatusOrder")] +public class ComOrderStatus +{ + [Key] + [Column("StatusID")] + public int StatusId { get; set; } + + [StringLength(200)] + public string StatusName { get; set; } = null!; + + [StringLength(200)] + public string StatusDisplayName { get; set; } = null!; + + public int? StatusOrder { get; set; } + + [Required] + public bool? StatusEnabled { get; set; } + + [StringLength(7)] + public string? StatusColor { get; set; } + + [Column("StatusGUID")] + public Guid StatusGuid { get; set; } + + public DateTime StatusLastModified { get; set; } + + public bool? StatusSendNotification { get; set; } + + [Column("StatusSiteID")] + public int? StatusSiteId { get; set; } + + public bool? StatusOrderIsPaid { get; set; } + + [InverseProperty("FromStatus")] + public virtual ICollection ComOrderStatusUserFromStatuses { get; set; } = new List(); + + [InverseProperty("ToStatus")] + public virtual ICollection ComOrderStatusUserToStatuses { get; set; } = new List(); + + [InverseProperty("OrderStatus")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("PaymentOptionAuthorizedOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionAuthorizedOrderStatuses { get; set; } = new List(); + + [InverseProperty("PaymentOptionFailedOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionFailedOrderStatuses { get; set; } = new List(); + + [InverseProperty("PaymentOptionSucceededOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionSucceededOrderStatuses { get; set; } = new List(); + + [ForeignKey("StatusSiteId")] + [InverseProperty("ComOrderStatuses")] + public virtual CmsSite? StatusSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComOrderStatusUser.cs b/Migration.Tool.KX13/Models/ComOrderStatusUser.cs new file mode 100644 index 00000000..7381ec52 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComOrderStatusUser.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_OrderStatusUser")] +[Index("ChangedByUserId", Name = "IX_COM_OrderStatusUser_ChangedByUserID")] +[Index("FromStatusId", Name = "IX_COM_OrderStatusUser_FromStatusID")] +[Index("OrderId", "Date", Name = "IX_COM_OrderStatusUser_OrderID_Date")] +[Index("ToStatusId", Name = "IX_COM_OrderStatusUser_ToStatusID")] +public class ComOrderStatusUser +{ + [Key] + [Column("OrderStatusUserID")] + public int OrderStatusUserId { get; set; } + + [Column("OrderID")] + public int OrderId { get; set; } + + [Column("FromStatusID")] + public int? FromStatusId { get; set; } + + [Column("ToStatusID")] + public int ToStatusId { get; set; } + + [Column("ChangedByUserID")] + public int? ChangedByUserId { get; set; } + + public DateTime Date { get; set; } + + public string? Note { get; set; } + + [ForeignKey("ChangedByUserId")] + [InverseProperty("ComOrderStatusUsers")] + public virtual CmsUser? ChangedByUser { get; set; } + + [ForeignKey("FromStatusId")] + [InverseProperty("ComOrderStatusUserFromStatuses")] + public virtual ComOrderStatus? FromStatus { get; set; } + + [ForeignKey("OrderId")] + [InverseProperty("ComOrderStatusUsers")] + public virtual ComOrder Order { get; set; } = null!; + + [ForeignKey("ToStatusId")] + [InverseProperty("ComOrderStatusUserToStatuses")] + public virtual ComOrderStatus ToStatus { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComPaymentOption.cs b/Migration.Tool.KX13/Models/ComPaymentOption.cs new file mode 100644 index 00000000..fd017538 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComPaymentOption.cs @@ -0,0 +1,82 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_PaymentOption")] +[Index("PaymentOptionAuthorizedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID")] +[Index("PaymentOptionFailedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionFailedOrderStatusID")] +[Index("PaymentOptionSiteId", Name = "IX_COM_PaymentOption_PaymentOptionSiteID")] +[Index("PaymentOptionSucceededOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionSucceededOrderStatusID")] +public class ComPaymentOption +{ + [Key] + [Column("PaymentOptionID")] + public int PaymentOptionId { get; set; } + + [StringLength(200)] + public string PaymentOptionName { get; set; } = null!; + + [StringLength(200)] + public string PaymentOptionDisplayName { get; set; } = null!; + + [Required] + public bool? PaymentOptionEnabled { get; set; } + + [Column("PaymentOptionSiteID")] + public int? PaymentOptionSiteId { get; set; } + + [StringLength(500)] + public string? PaymentOptionPaymentGateUrl { get; set; } + + [StringLength(200)] + public string? PaymentOptionAssemblyName { get; set; } + + [StringLength(200)] + public string? PaymentOptionClassName { get; set; } + + [Column("PaymentOptionSucceededOrderStatusID")] + public int? PaymentOptionSucceededOrderStatusId { get; set; } + + [Column("PaymentOptionFailedOrderStatusID")] + public int? PaymentOptionFailedOrderStatusId { get; set; } + + [Column("PaymentOptionGUID")] + public Guid PaymentOptionGuid { get; set; } + + public DateTime PaymentOptionLastModified { get; set; } + + public bool? PaymentOptionAllowIfNoShipping { get; set; } + + [Column("PaymentOptionThumbnailGUID")] + public Guid? PaymentOptionThumbnailGuid { get; set; } + + public string? PaymentOptionDescription { get; set; } + + [Column("PaymentOptionAuthorizedOrderStatusID")] + public int? PaymentOptionAuthorizedOrderStatusId { get; set; } + + [InverseProperty("OrderPaymentOption")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartPaymentOption")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("PaymentOptionAuthorizedOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionAuthorizedOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionAuthorizedOrderStatus { get; set; } + + [ForeignKey("PaymentOptionFailedOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionFailedOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionFailedOrderStatus { get; set; } + + [ForeignKey("PaymentOptionSiteId")] + [InverseProperty("ComPaymentOptions")] + public virtual CmsSite? PaymentOptionSite { get; set; } + + [ForeignKey("PaymentOptionSucceededOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionSucceededOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionSucceededOrderStatus { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComPublicStatus.cs b/Migration.Tool.KX13/Models/ComPublicStatus.cs new file mode 100644 index 00000000..44055636 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComPublicStatus.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_PublicStatus")] +[Index("PublicStatusSiteId", Name = "IX_COM_PublicStatus_PublicStatusSiteID")] +public class ComPublicStatus +{ + [Key] + [Column("PublicStatusID")] + public int PublicStatusId { get; set; } + + [StringLength(200)] + public string PublicStatusName { get; set; } = null!; + + [StringLength(200)] + public string PublicStatusDisplayName { get; set; } = null!; + + [Required] + public bool? PublicStatusEnabled { get; set; } + + [Column("PublicStatusGUID")] + public Guid? PublicStatusGuid { get; set; } + + public DateTime PublicStatusLastModified { get; set; } + + [Column("PublicStatusSiteID")] + public int? PublicStatusSiteId { get; set; } + + [InverseProperty("SkupublicStatus")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("PublicStatusSiteId")] + [InverseProperty("ComPublicStatuses")] + public virtual CmsSite? PublicStatusSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComShippingCost.cs b/Migration.Tool.KX13/Models/ComShippingCost.cs new file mode 100644 index 00000000..60c87946 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComShippingCost.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_ShippingCost")] +[Index("ShippingCostShippingOptionId", Name = "IX_COM_ShippingCost_ShippingCostShippingOptionID")] +public class ComShippingCost +{ + [Key] + [Column("ShippingCostID")] + public int ShippingCostId { get; set; } + + [Column("ShippingCostShippingOptionID")] + public int ShippingCostShippingOptionId { get; set; } + + public double ShippingCostMinWeight { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal ShippingCostValue { get; set; } + + [Column("ShippingCostGUID")] + public Guid ShippingCostGuid { get; set; } + + public DateTime ShippingCostLastModified { get; set; } + + [ForeignKey("ShippingCostShippingOptionId")] + [InverseProperty("ComShippingCosts")] + public virtual ComShippingOption ShippingCostShippingOption { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComShippingOption.cs b/Migration.Tool.KX13/Models/ComShippingOption.cs new file mode 100644 index 00000000..944c9881 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComShippingOption.cs @@ -0,0 +1,69 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_ShippingOption")] +[Index("ShippingOptionCarrierId", Name = "IX_COM_ShippingOption_ShippingOptionCarrierID")] +[Index("ShippingOptionSiteId", Name = "IX_COM_ShippingOption_ShippingOptionSiteID_ShippingOptionDisplayName_ShippingOptionEnabled")] +[Index("ShippingOptionTaxClassId", Name = "IX_COM_ShippingOption_ShippingOptionTaxClassID")] +public class ComShippingOption +{ + [Key] + [Column("ShippingOptionID")] + public int ShippingOptionId { get; set; } + + [StringLength(200)] + public string ShippingOptionName { get; set; } = null!; + + [StringLength(200)] + public string ShippingOptionDisplayName { get; set; } = null!; + + [Required] + public bool? ShippingOptionEnabled { get; set; } + + [Column("ShippingOptionSiteID")] + public int? ShippingOptionSiteId { get; set; } + + [Column("ShippingOptionGUID")] + public Guid ShippingOptionGuid { get; set; } + + public DateTime ShippingOptionLastModified { get; set; } + + [Column("ShippingOptionThumbnailGUID")] + public Guid? ShippingOptionThumbnailGuid { get; set; } + + public string? ShippingOptionDescription { get; set; } + + [Column("ShippingOptionCarrierID")] + public int? ShippingOptionCarrierId { get; set; } + + [StringLength(200)] + public string? ShippingOptionCarrierServiceName { get; set; } + + [Column("ShippingOptionTaxClassID")] + public int? ShippingOptionTaxClassId { get; set; } + + [InverseProperty("OrderShippingOption")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShippingCostShippingOption")] + public virtual ICollection ComShippingCosts { get; set; } = new List(); + + [InverseProperty("ShoppingCartShippingOption")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("ShippingOptionCarrierId")] + [InverseProperty("ComShippingOptions")] + public virtual ComCarrier? ShippingOptionCarrier { get; set; } + + [ForeignKey("ShippingOptionSiteId")] + [InverseProperty("ComShippingOptions")] + public virtual CmsSite? ShippingOptionSite { get; set; } + + [ForeignKey("ShippingOptionTaxClassId")] + [InverseProperty("ComShippingOptions")] + public virtual ComTaxClass? ShippingOptionTaxClass { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComShoppingCart.cs b/Migration.Tool.KX13/Models/ComShoppingCart.cs new file mode 100644 index 00000000..de0492d3 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComShoppingCart.cs @@ -0,0 +1,106 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_ShoppingCart")] +[Index("ShoppingCartBillingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartBillingAddressID")] +[Index("ShoppingCartCompanyAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartCompanyAddressID")] +[Index("ShoppingCartCurrencyId", Name = "IX_COM_ShoppingCart_ShoppingCartCurrencyID")] +[Index("ShoppingCartCustomerId", Name = "IX_COM_ShoppingCart_ShoppingCartCustomerID")] +[Index("ShoppingCartLastUpdate", Name = "IX_COM_ShoppingCart_ShoppingCartLastUpdate")] +[Index("ShoppingCartPaymentOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartPaymentOptionID")] +[Index("ShoppingCartShippingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingAddressID")] +[Index("ShoppingCartShippingOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingOptionID")] +[Index("ShoppingCartSiteId", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID")] +[Index("ShoppingCartGuid", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID_ShoppingCartGUID")] +[Index("ShoppingCartUserId", Name = "IX_COM_ShoppingCart_ShoppingCartUserID")] +public class ComShoppingCart +{ + [Key] + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [Column("ShoppingCartGUID")] + public Guid ShoppingCartGuid { get; set; } + + [Column("ShoppingCartUserID")] + public int? ShoppingCartUserId { get; set; } + + [Column("ShoppingCartSiteID")] + public int ShoppingCartSiteId { get; set; } + + public DateTime ShoppingCartLastUpdate { get; set; } + + [Column("ShoppingCartCurrencyID")] + public int? ShoppingCartCurrencyId { get; set; } + + [Column("ShoppingCartPaymentOptionID")] + public int? ShoppingCartPaymentOptionId { get; set; } + + [Column("ShoppingCartShippingOptionID")] + public int? ShoppingCartShippingOptionId { get; set; } + + [Column("ShoppingCartBillingAddressID")] + public int? ShoppingCartBillingAddressId { get; set; } + + [Column("ShoppingCartShippingAddressID")] + public int? ShoppingCartShippingAddressId { get; set; } + + [Column("ShoppingCartCustomerID")] + public int? ShoppingCartCustomerId { get; set; } + + public string? ShoppingCartNote { get; set; } + + [Column("ShoppingCartCompanyAddressID")] + public int? ShoppingCartCompanyAddressId { get; set; } + + public string? ShoppingCartCustomData { get; set; } + + [Column("ShoppingCartContactID")] + public int? ShoppingCartContactId { get; set; } + + [InverseProperty("ShoppingCart")] + public virtual ICollection ComShoppingCartCouponCodes { get; set; } = new List(); + + [InverseProperty("ShoppingCart")] + public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); + + [ForeignKey("ShoppingCartBillingAddressId")] + [InverseProperty("ComShoppingCartShoppingCartBillingAddresses")] + public virtual ComAddress? ShoppingCartBillingAddress { get; set; } + + [ForeignKey("ShoppingCartCompanyAddressId")] + [InverseProperty("ComShoppingCartShoppingCartCompanyAddresses")] + public virtual ComAddress? ShoppingCartCompanyAddress { get; set; } + + [ForeignKey("ShoppingCartCurrencyId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComCurrency? ShoppingCartCurrency { get; set; } + + [ForeignKey("ShoppingCartCustomerId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComCustomer? ShoppingCartCustomer { get; set; } + + [ForeignKey("ShoppingCartPaymentOptionId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComPaymentOption? ShoppingCartPaymentOption { get; set; } + + [ForeignKey("ShoppingCartShippingAddressId")] + [InverseProperty("ComShoppingCartShoppingCartShippingAddresses")] + public virtual ComAddress? ShoppingCartShippingAddress { get; set; } + + [ForeignKey("ShoppingCartShippingOptionId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComShippingOption? ShoppingCartShippingOption { get; set; } + + [ForeignKey("ShoppingCartSiteId")] + [InverseProperty("ComShoppingCarts")] + public virtual CmsSite ShoppingCartSite { get; set; } = null!; + + [ForeignKey("ShoppingCartUserId")] + [InverseProperty("ComShoppingCarts")] + public virtual CmsUser? ShoppingCartUser { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComShoppingCartCouponCode.cs b/Migration.Tool.KX13/Models/ComShoppingCartCouponCode.cs new file mode 100644 index 00000000..0a936fbe --- /dev/null +++ b/Migration.Tool.KX13/Models/ComShoppingCartCouponCode.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_ShoppingCartCouponCode")] +[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartCouponCode_ShoppingCartID")] +public class ComShoppingCartCouponCode +{ + [Key] + [Column("ShoppingCartCouponCodeID")] + public int ShoppingCartCouponCodeId { get; set; } + + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [StringLength(200)] + public string CouponCode { get; set; } = null!; + + [ForeignKey("ShoppingCartId")] + [InverseProperty("ComShoppingCartCouponCodes")] + public virtual ComShoppingCart ShoppingCart { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComShoppingCartSku.cs b/Migration.Tool.KX13/Models/ComShoppingCartSku.cs new file mode 100644 index 00000000..cc575b40 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComShoppingCartSku.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_ShoppingCartSKU")] +[Index("Skuid", Name = "IX_COM_ShoppingCartSKU_SKUID")] +[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartSKU_ShoppingCartID")] +public class ComShoppingCartSku +{ + [Key] + [Column("CartItemID")] + public int CartItemId { get; set; } + + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("SKUUnits")] + public int Skuunits { get; set; } + + public string? CartItemCustomData { get; set; } + + public Guid? CartItemGuid { get; set; } + + public Guid? CartItemParentGuid { get; set; } + + public DateTime? CartItemValidTo { get; set; } + + [Column("CartItemBundleGUID")] + public Guid? CartItemBundleGuid { get; set; } + + public string? CartItemText { get; set; } + + public int? CartItemAutoAddedUnits { get; set; } + + [ForeignKey("ShoppingCartId")] + [InverseProperty("ComShoppingCartSkus")] + public virtual ComShoppingCart ShoppingCart { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComShoppingCartSkus")] + public virtual ComSku Sku { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComSku.cs b/Migration.Tool.KX13/Models/ComSku.cs new file mode 100644 index 00000000..f8fbce39 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComSku.cs @@ -0,0 +1,269 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_SKU")] +[Index("SkubrandId", Name = "IX_COM_SKU_SKUBrandID")] +[Index("SkucollectionId", Name = "IX_COM_SKU_SKUCollectionID")] +[Index("SkudepartmentId", Name = "IX_COM_SKU_SKUDepartmentID")] +[Index("SkuinternalStatusId", Name = "IX_COM_SKU_SKUInternalStatusID")] +[Index("SkumanufacturerId", Name = "IX_COM_SKU_SKUManufacturerID")] +[Index("Skuname", Name = "IX_COM_SKU_SKUName")] +[Index("SkuoptionCategoryId", Name = "IX_COM_SKU_SKUOptionCategoryID")] +[Index("SkuparentSkuid", Name = "IX_COM_SKU_SKUParentSKUID")] +[Index("Skuprice", Name = "IX_COM_SKU_SKUPrice")] +[Index("SkupublicStatusId", Name = "IX_COM_SKU_SKUPublicStatusID")] +[Index("SkusiteId", Name = "IX_COM_SKU_SKUSiteID")] +[Index("SkusupplierId", Name = "IX_COM_SKU_SKUSupplierID")] +[Index("SkutaxClassId", Name = "IX_COM_SKU_SKUTaxClassID")] +public class ComSku +{ + [Key] + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("SKUNumber")] + [StringLength(200)] + public string? Skunumber { get; set; } + + [Column("SKUName")] + [StringLength(440)] + public string Skuname { get; set; } = null!; + + [Column("SKUDescription")] + public string? Skudescription { get; set; } + + [Column("SKUPrice", TypeName = "decimal(18, 9)")] + public decimal Skuprice { get; set; } + + [Required] + [Column("SKUEnabled")] + public bool? Skuenabled { get; set; } + + [Column("SKUDepartmentID")] + public int? SkudepartmentId { get; set; } + + [Column("SKUManufacturerID")] + public int? SkumanufacturerId { get; set; } + + [Column("SKUInternalStatusID")] + public int? SkuinternalStatusId { get; set; } + + [Column("SKUPublicStatusID")] + public int? SkupublicStatusId { get; set; } + + [Column("SKUSupplierID")] + public int? SkusupplierId { get; set; } + + [Column("SKUAvailableInDays")] + public int? SkuavailableInDays { get; set; } + + [Column("SKUGUID")] + public Guid Skuguid { get; set; } + + [Column("SKUImagePath")] + [StringLength(450)] + public string? SkuimagePath { get; set; } + + [Column("SKUWeight")] + public double? Skuweight { get; set; } + + [Column("SKUWidth")] + public double? Skuwidth { get; set; } + + [Column("SKUDepth")] + public double? Skudepth { get; set; } + + [Column("SKUHeight")] + public double? Skuheight { get; set; } + + [Column("SKUAvailableItems")] + public int? SkuavailableItems { get; set; } + + [Column("SKUSellOnlyAvailable")] + public bool? SkusellOnlyAvailable { get; set; } + + [Column("SKUCustomData")] + public string? SkucustomData { get; set; } + + [Column("SKUOptionCategoryID")] + public int? SkuoptionCategoryId { get; set; } + + [Column("SKUOrder")] + public int? Skuorder { get; set; } + + [Column("SKULastModified")] + public DateTime SkulastModified { get; set; } + + [Column("SKUCreated")] + public DateTime? Skucreated { get; set; } + + [Column("SKUSiteID")] + public int? SkusiteId { get; set; } + + [Column("SKUNeedsShipping")] + public bool? SkuneedsShipping { get; set; } + + [Column("SKUValidUntil")] + public DateTime? SkuvalidUntil { get; set; } + + [Column("SKUProductType")] + [StringLength(50)] + public string? SkuproductType { get; set; } + + [Column("SKUMaxItemsInOrder")] + public int? SkumaxItemsInOrder { get; set; } + + [Column("SKUValidity")] + [StringLength(50)] + public string? Skuvalidity { get; set; } + + [Column("SKUValidFor")] + public int? SkuvalidFor { get; set; } + + [Column("SKUMembershipGUID")] + public Guid? SkumembershipGuid { get; set; } + + [Column("SKUBundleInventoryType")] + [StringLength(50)] + public string? SkubundleInventoryType { get; set; } + + [Column("SKUMinItemsInOrder")] + public int? SkuminItemsInOrder { get; set; } + + [Column("SKURetailPrice", TypeName = "decimal(18, 9)")] + public decimal? SkuretailPrice { get; set; } + + [Column("SKUParentSKUID")] + public int? SkuparentSkuid { get; set; } + + [Column("SKUShortDescription")] + public string? SkushortDescription { get; set; } + + [Column("SKUEproductFilesCount")] + public int? SkueproductFilesCount { get; set; } + + [Column("SKUBundleItemsCount")] + public int? SkubundleItemsCount { get; set; } + + [Column("SKUInStoreFrom")] + public DateTime? SkuinStoreFrom { get; set; } + + [Column("SKUReorderAt")] + public int? SkureorderAt { get; set; } + + [Column("SKUTrackInventory")] + [StringLength(50)] + public string? SkutrackInventory { get; set; } + + [Column("SKUTaxClassID")] + public int? SkutaxClassId { get; set; } + + [Column("SKUBrandID")] + public int? SkubrandId { get; set; } + + [Column("SKUCollectionID")] + public int? SkucollectionId { get; set; } + + [InverseProperty("NodeSku")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscountApplyToSku")] + public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); + + [InverseProperty("OrderItemSku")] + public virtual ICollection ComOrderItems { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); + + [InverseProperty("FileSku")] + public virtual ICollection ComSkufiles { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); + + [InverseProperty("VolumeDiscountSku")] + public virtual ICollection ComVolumeDiscounts { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("SkuparentSku")] + public virtual ICollection InverseSkuparentSku { get; set; } = new List(); + + [ForeignKey("SkubrandId")] + [InverseProperty("ComSkus")] + public virtual ComBrand? Skubrand { get; set; } + + [ForeignKey("SkucollectionId")] + [InverseProperty("ComSkus")] + public virtual ComCollection? Skucollection { get; set; } + + [ForeignKey("SkudepartmentId")] + [InverseProperty("ComSkus")] + public virtual ComDepartment? Skudepartment { get; set; } + + [ForeignKey("SkuinternalStatusId")] + [InverseProperty("ComSkus")] + public virtual ComInternalStatus? SkuinternalStatus { get; set; } + + [ForeignKey("SkumanufacturerId")] + [InverseProperty("ComSkus")] + public virtual ComManufacturer? Skumanufacturer { get; set; } + + [ForeignKey("SkuoptionCategoryId")] + [InverseProperty("ComSkus")] + public virtual ComOptionCategory? SkuoptionCategory { get; set; } + + [ForeignKey("SkuparentSkuid")] + [InverseProperty("InverseSkuparentSku")] + public virtual ComSku? SkuparentSku { get; set; } + + [ForeignKey("SkupublicStatusId")] + [InverseProperty("ComSkus")] + public virtual ComPublicStatus? SkupublicStatus { get; set; } + + [ForeignKey("SkusiteId")] + [InverseProperty("ComSkus")] + public virtual CmsSite? Skusite { get; set; } + + [ForeignKey("SkusupplierId")] + [InverseProperty("ComSkus")] + public virtual ComSupplier? Skusupplier { get; set; } + + [ForeignKey("SkutaxClassId")] + [InverseProperty("ComSkus")] + public virtual ComTaxClass? SkutaxClass { get; set; } + + [ForeignKey("Skuid")] + [InverseProperty("Skus")] + public virtual ICollection Bundles { get; set; } = new List(); + + [ForeignKey("Skuid")] + [InverseProperty("Skus")] + public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); + + [ForeignKey("Skuid")] + [InverseProperty("SkusNavigation")] + public virtual ICollection OptionSkus { get; set; } = new List(); + + [ForeignKey("VariantSkuid")] + [InverseProperty("VariantSkus")] + public virtual ICollection OptionSkusNavigation { get; set; } = new List(); + + [ForeignKey("BundleId")] + [InverseProperty("Bundles")] + public virtual ICollection Skus { get; set; } = new List(); + + [ForeignKey("OptionSkuid")] + [InverseProperty("OptionSkus")] + public virtual ICollection SkusNavigation { get; set; } = new List(); + + [ForeignKey("OptionSkuid")] + [InverseProperty("OptionSkusNavigation")] + public virtual ICollection VariantSkus { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/ComSkufile.cs b/Migration.Tool.KX13/Models/ComSkufile.cs new file mode 100644 index 00000000..4e85a39f --- /dev/null +++ b/Migration.Tool.KX13/Models/ComSkufile.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_SKUFile")] +[Index("FileSkuid", Name = "IX_COM_SKUFile_FileSKUID")] +public class ComSkufile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileSKUID")] + public int FileSkuid { get; set; } + + [StringLength(450)] + public string FilePath { get; set; } = null!; + + [StringLength(50)] + public string FileType { get; set; } = null!; + + public DateTime FileLastModified { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [Column("FileMetaFileGUID")] + public Guid? FileMetaFileGuid { get; set; } + + [InverseProperty("File")] + public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); + + [ForeignKey("FileSkuid")] + [InverseProperty("ComSkufiles")] + public virtual ComSku FileSku { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComSkuoptionCategory.cs b/Migration.Tool.KX13/Models/ComSkuoptionCategory.cs new file mode 100644 index 00000000..bf39adb4 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComSkuoptionCategory.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_SKUOptionCategory")] +[Index("CategoryId", Name = "IX_COM_SKUOptionCategory_CategoryID")] +[Index("Skuid", Name = "IX_COM_SKUOptionCategory_SKUID")] +public class ComSkuoptionCategory +{ + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("CategoryID")] + public int CategoryId { get; set; } + + public bool? AllowAllOptions { get; set; } + + [Key] + [Column("SKUCategoryID")] + public int SkucategoryId { get; set; } + + [Column("SKUCategoryOrder")] + public int? SkucategoryOrder { get; set; } + + [ForeignKey("CategoryId")] + [InverseProperty("ComSkuoptionCategories")] + public virtual ComOptionCategory Category { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComSkuoptionCategories")] + public virtual ComSku Sku { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComSupplier.cs b/Migration.Tool.KX13/Models/ComSupplier.cs new file mode 100644 index 00000000..7c8ea8f3 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComSupplier.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_Supplier")] +[Index("SupplierSiteId", Name = "IX_COM_Supplier_SupplierSiteID")] +public class ComSupplier +{ + [Key] + [Column("SupplierID")] + public int SupplierId { get; set; } + + [StringLength(200)] + public string SupplierDisplayName { get; set; } = null!; + + [StringLength(50)] + public string? SupplierPhone { get; set; } + + [StringLength(254)] + public string? SupplierEmail { get; set; } + + [StringLength(50)] + public string? SupplierFax { get; set; } + + [Required] + public bool? SupplierEnabled { get; set; } + + [Column("SupplierGUID")] + public Guid SupplierGuid { get; set; } + + public DateTime SupplierLastModified { get; set; } + + [Column("SupplierSiteID")] + public int? SupplierSiteId { get; set; } + + [StringLength(200)] + public string? SupplierName { get; set; } + + [InverseProperty("Skusupplier")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("SupplierSiteId")] + [InverseProperty("ComSuppliers")] + public virtual CmsSite? SupplierSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComTaxClass.cs b/Migration.Tool.KX13/Models/ComTaxClass.cs new file mode 100644 index 00000000..3f249a26 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComTaxClass.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_TaxClass")] +[Index("TaxClassSiteId", Name = "IX_COM_TaxClass_TaxClassSiteID")] +public class ComTaxClass +{ + [Key] + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [StringLength(200)] + public string TaxClassName { get; set; } = null!; + + [StringLength(200)] + public string TaxClassDisplayName { get; set; } = null!; + + [Column("TaxClassZeroIfIDSupplied")] + public bool? TaxClassZeroIfIdsupplied { get; set; } + + [Column("TaxClassGUID")] + public Guid TaxClassGuid { get; set; } + + public DateTime TaxClassLastModified { get; set; } + + [Column("TaxClassSiteID")] + public int? TaxClassSiteId { get; set; } + + [InverseProperty("DepartmentDefaultTaxClass")] + public virtual ICollection ComDepartments { get; set; } = new List(); + + [InverseProperty("ShippingOptionTaxClass")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); + + [InverseProperty("SkutaxClass")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [InverseProperty("TaxClass")] + public virtual ICollection ComTaxClassCountries { get; set; } = new List(); + + [InverseProperty("TaxClass")] + public virtual ICollection ComTaxClassStates { get; set; } = new List(); + + [ForeignKey("TaxClassSiteId")] + [InverseProperty("ComTaxClasses")] + public virtual CmsSite? TaxClassSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ComTaxClassCountry.cs b/Migration.Tool.KX13/Models/ComTaxClassCountry.cs new file mode 100644 index 00000000..a9daab00 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComTaxClassCountry.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_TaxClassCountry")] +[Index("CountryId", Name = "IX_COM_TaxClassCountry_CountryID")] +[Index("TaxClassId", "CountryId", Name = "IX_COM_TaxClassCountry_TaxClassID_CountryID", IsUnique = true)] +public class ComTaxClassCountry +{ + [Key] + [Column("TaxClassCountryID")] + public int TaxClassCountryId { get; set; } + + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal TaxValue { get; set; } + + [ForeignKey("CountryId")] + [InverseProperty("ComTaxClassCountries")] + public virtual CmsCountry Country { get; set; } = null!; + + [ForeignKey("TaxClassId")] + [InverseProperty("ComTaxClassCountries")] + public virtual ComTaxClass TaxClass { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComTaxClassState.cs b/Migration.Tool.KX13/Models/ComTaxClassState.cs new file mode 100644 index 00000000..538e6670 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComTaxClassState.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_TaxClassState")] +[Index("StateId", Name = "IX_COM_TaxClassState_StateID")] +[Index("TaxClassId", "StateId", Name = "IX_COM_TaxClassState_TaxClassID_StateID", IsUnique = true)] +public class ComTaxClassState +{ + [Key] + [Column("TaxClassStateID")] + public int TaxClassStateId { get; set; } + + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [Column("StateID")] + public int StateId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal TaxValue { get; set; } + + [ForeignKey("StateId")] + [InverseProperty("ComTaxClassStates")] + public virtual CmsState State { get; set; } = null!; + + [ForeignKey("TaxClassId")] + [InverseProperty("ComTaxClassStates")] + public virtual ComTaxClass TaxClass { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComVolumeDiscount.cs b/Migration.Tool.KX13/Models/ComVolumeDiscount.cs new file mode 100644 index 00000000..dff290c8 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComVolumeDiscount.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("COM_VolumeDiscount")] +[Index("VolumeDiscountSkuid", Name = "IX_COM_VolumeDiscount_VolumeDiscountSKUID")] +public class ComVolumeDiscount +{ + [Key] + [Column("VolumeDiscountID")] + public int VolumeDiscountId { get; set; } + + [Column("VolumeDiscountSKUID")] + public int VolumeDiscountSkuid { get; set; } + + public int VolumeDiscountMinCount { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal VolumeDiscountValue { get; set; } + + public bool VolumeDiscountIsFlatValue { get; set; } + + [Column("VolumeDiscountGUID")] + public Guid VolumeDiscountGuid { get; set; } + + public DateTime VolumeDiscountLastModified { get; set; } + + [ForeignKey("VolumeDiscountSkuid")] + [InverseProperty("ComVolumeDiscounts")] + public virtual ComSku VolumeDiscountSku { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ComWishlist.cs b/Migration.Tool.KX13/Models/ComWishlist.cs new file mode 100644 index 00000000..fb1eb279 --- /dev/null +++ b/Migration.Tool.KX13/Models/ComWishlist.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[PrimaryKey("UserId", "Skuid", "SiteId")] +[Table("COM_Wishlist")] +[Index("Skuid", Name = "IX_COM_Wishlist_SKUID")] +[Index("SiteId", "UserId", Name = "IX_COM_Wishlist_SiteID_UserID")] +public class ComWishlist +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [Key] + [Column("SKUID")] + public int Skuid { get; set; } + + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("ComWishlists")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComWishlists")] + public virtual ComSku Sku { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("ComWishlists")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ExportHistory.cs b/Migration.Tool.KX13/Models/ExportHistory.cs new file mode 100644 index 00000000..8370f7c1 --- /dev/null +++ b/Migration.Tool.KX13/Models/ExportHistory.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Export_History")] +[Index("ExportSiteId", Name = "IX_Export_History_ExportSiteID")] +[Index("ExportUserId", Name = "IX_Export_History_ExportUserID")] +public class ExportHistory +{ + [Key] + [Column("ExportID")] + public int ExportId { get; set; } + + public DateTime ExportDateTime { get; set; } + + [StringLength(450)] + public string ExportFileName { get; set; } = null!; + + [Column("ExportSiteID")] + public int? ExportSiteId { get; set; } + + [Column("ExportUserID")] + public int? ExportUserId { get; set; } + + public string? ExportSettings { get; set; } + + [ForeignKey("ExportSiteId")] + [InverseProperty("ExportHistories")] + public virtual CmsSite? ExportSite { get; set; } + + [ForeignKey("ExportUserId")] + [InverseProperty("ExportHistories")] + public virtual CmsUser? ExportUser { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ExportTask.cs b/Migration.Tool.KX13/Models/ExportTask.cs new file mode 100644 index 00000000..0685eab0 --- /dev/null +++ b/Migration.Tool.KX13/Models/ExportTask.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Export_Task")] +[Index("TaskSiteId", "TaskObjectType", Name = "IX_Export_Task_TaskSiteID_TaskObjectType")] +public class ExportTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [ForeignKey("TaskSiteId")] + [InverseProperty("ExportTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/IntegrationConnector.cs b/Migration.Tool.KX13/Models/IntegrationConnector.cs new file mode 100644 index 00000000..8c1a337f --- /dev/null +++ b/Migration.Tool.KX13/Models/IntegrationConnector.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Integration_Connector")] +[Index("ConnectorEnabled", Name = "IX_Integration_Connector_ConnectorEnabled")] +public class IntegrationConnector +{ + [Key] + [Column("ConnectorID")] + public int ConnectorId { get; set; } + + [StringLength(100)] + public string ConnectorName { get; set; } = null!; + + [StringLength(440)] + public string ConnectorDisplayName { get; set; } = null!; + + [StringLength(400)] + public string ConnectorAssemblyName { get; set; } = null!; + + [StringLength(400)] + public string ConnectorClassName { get; set; } = null!; + + [Required] + public bool? ConnectorEnabled { get; set; } + + public DateTime ConnectorLastModified { get; set; } + + [InverseProperty("SynchronizationConnector")] + public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/IntegrationSyncLog.cs b/Migration.Tool.KX13/Models/IntegrationSyncLog.cs new file mode 100644 index 00000000..bb6fc81b --- /dev/null +++ b/Migration.Tool.KX13/Models/IntegrationSyncLog.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Integration_SyncLog")] +[Index("SyncLogSynchronizationId", Name = "IX_Integration_SyncLog_SyncLogTaskID")] +public class IntegrationSyncLog +{ + [Key] + [Column("SyncLogID")] + public int SyncLogId { get; set; } + + [Column("SyncLogSynchronizationID")] + public int SyncLogSynchronizationId { get; set; } + + public DateTime SyncLogTime { get; set; } + + public string? SyncLogErrorMessage { get; set; } + + [ForeignKey("SyncLogSynchronizationId")] + [InverseProperty("IntegrationSyncLogs")] + public virtual IntegrationSynchronization SyncLogSynchronization { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/IntegrationSynchronization.cs b/Migration.Tool.KX13/Models/IntegrationSynchronization.cs new file mode 100644 index 00000000..e70fa0ca --- /dev/null +++ b/Migration.Tool.KX13/Models/IntegrationSynchronization.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Integration_Synchronization")] +[Index("SynchronizationConnectorId", Name = "IX_Integration_Synchronization_SynchronizationConnectorID")] +[Index("SynchronizationTaskId", Name = "IX_Integration_Synchronization_SynchronizationTaskID")] +public class IntegrationSynchronization +{ + [Key] + [Column("SynchronizationID")] + public int SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int SynchronizationTaskId { get; set; } + + [Column("SynchronizationConnectorID")] + public int SynchronizationConnectorId { get; set; } + + public DateTime SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + public bool? SynchronizationIsRunning { get; set; } + + [InverseProperty("SyncLogSynchronization")] + public virtual ICollection IntegrationSyncLogs { get; set; } = new List(); + + [ForeignKey("SynchronizationConnectorId")] + [InverseProperty("IntegrationSynchronizations")] + public virtual IntegrationConnector SynchronizationConnector { get; set; } = null!; + + [ForeignKey("SynchronizationTaskId")] + [InverseProperty("IntegrationSynchronizations")] + public virtual IntegrationTask SynchronizationTask { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/IntegrationTask.cs b/Migration.Tool.KX13/Models/IntegrationTask.cs new file mode 100644 index 00000000..920951d6 --- /dev/null +++ b/Migration.Tool.KX13/Models/IntegrationTask.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Integration_Task")] +[Index("TaskIsInbound", Name = "IX_Integration_Task_TaskIsInbound")] +[Index("TaskSiteId", Name = "IX_Integration_Task_TaskSiteID")] +[Index("TaskType", Name = "IX_Integration_Task_TaskType")] +public class IntegrationTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool TaskIsInbound { get; set; } + + [StringLength(50)] + public string? TaskProcessType { get; set; } + + public string TaskData { get; set; } = null!; + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(50)] + public string? TaskDataType { get; set; } + + [InverseProperty("SynchronizationTask")] + public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); + + [ForeignKey("TaskSiteId")] + [InverseProperty("IntegrationTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/MediaFile.cs b/Migration.Tool.KX13/Models/MediaFile.cs new file mode 100644 index 00000000..dc62dec1 --- /dev/null +++ b/Migration.Tool.KX13/Models/MediaFile.cs @@ -0,0 +1,77 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Media_File")] +[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] +[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] +[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] +[Index("FileSiteId", "FileGuid", Name = "IX_Media_File_FileSiteID_FileGUID")] +public class MediaFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string FileTitle { get; set; } = null!; + + public string FileDescription { get; set; } = null!; + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public string FilePath { get; set; } = null!; + + public long FileSize { get; set; } + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileLibraryID")] + public int FileLibraryId { get; set; } + + [Column("FileSiteID")] + public int FileSiteId { get; set; } + + [Column("FileCreatedByUserID")] + public int? FileCreatedByUserId { get; set; } + + public DateTime FileCreatedWhen { get; set; } + + [Column("FileModifiedByUserID")] + public int? FileModifiedByUserId { get; set; } + + public DateTime FileModifiedWhen { get; set; } + + public string? FileCustomData { get; set; } + + [ForeignKey("FileCreatedByUserId")] + [InverseProperty("MediaFileFileCreatedByUsers")] + public virtual CmsUser? FileCreatedByUser { get; set; } + + [ForeignKey("FileLibraryId")] + [InverseProperty("MediaFiles")] + public virtual MediaLibrary FileLibrary { get; set; } = null!; + + [ForeignKey("FileModifiedByUserId")] + [InverseProperty("MediaFileFileModifiedByUsers")] + public virtual CmsUser? FileModifiedByUser { get; set; } + + [ForeignKey("FileSiteId")] + [InverseProperty("MediaFiles")] + public virtual CmsSite FileSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/MediaLibrary.cs b/Migration.Tool.KX13/Models/MediaLibrary.cs new file mode 100644 index 00000000..4d46a77d --- /dev/null +++ b/Migration.Tool.KX13/Models/MediaLibrary.cs @@ -0,0 +1,54 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Media_Library")] +[Index("LibrarySiteId", "LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] +public class MediaLibrary +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [StringLength(250)] + public string LibraryName { get; set; } = null!; + + [StringLength(250)] + public string LibraryDisplayName { get; set; } = null!; + + public string? LibraryDescription { get; set; } + + [StringLength(250)] + public string LibraryFolder { get; set; } = null!; + + public int? LibraryAccess { get; set; } + + [Column("LibrarySiteID")] + public int LibrarySiteId { get; set; } + + [Column("LibraryGUID")] + public Guid? LibraryGuid { get; set; } + + public DateTime? LibraryLastModified { get; set; } + + [StringLength(450)] + public string? LibraryTeaserPath { get; set; } + + [Column("LibraryTeaserGUID")] + public Guid? LibraryTeaserGuid { get; set; } + + public bool? LibraryUseDirectPathForContent { get; set; } + + [ForeignKey("LibrarySiteId")] + [InverseProperty("MediaLibraries")] + public virtual CmsSite LibrarySite { get; set; } = null!; + + [InverseProperty("FileLibrary")] + public virtual ICollection MediaFiles { get; set; } = new List(); + + [InverseProperty("Library")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/MediaLibraryRolePermission.cs b/Migration.Tool.KX13/Models/MediaLibraryRolePermission.cs new file mode 100644 index 00000000..e35cbb85 --- /dev/null +++ b/Migration.Tool.KX13/Models/MediaLibraryRolePermission.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[PrimaryKey("LibraryId", "RoleId", "PermissionId")] +[Table("Media_LibraryRolePermission")] +[Index("PermissionId", Name = "IX_Media_LibraryRolePermission_PermissionID")] +[Index("RoleId", Name = "IX_Media_LibraryRolePermission_RoleID")] +public class MediaLibraryRolePermission +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("LibraryId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual MediaLibrary Library { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/NewsletterAbtest.cs b/Migration.Tool.KX13/Models/NewsletterAbtest.cs new file mode 100644 index 00000000..660344af --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterAbtest.cs @@ -0,0 +1,53 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_ABTest")] +[Index("TestIssueId", Name = "IX_Newsletter_ABTest_TestIssueID", IsUnique = true)] +[Index("TestWinnerIssueId", Name = "IX_Newsletter_ABTest_TestWinnerIssueID")] +[Index("TestWinnerScheduledTaskId", Name = "IX_Newsletter_ABTest_TestWinnerScheduledTaskID")] +public class NewsletterAbtest +{ + [Key] + [Column("TestID")] + public int TestId { get; set; } + + [Column("TestIssueID")] + public int TestIssueId { get; set; } + + public int TestWinnerOption { get; set; } + + public int? TestSelectWinnerAfter { get; set; } + + [Column("TestWinnerIssueID")] + public int? TestWinnerIssueId { get; set; } + + public DateTime? TestWinnerSelected { get; set; } + + public DateTime TestLastModified { get; set; } + + [Column("TestGUID")] + public Guid TestGuid { get; set; } + + [Column("TestWinnerScheduledTaskID")] + public int? TestWinnerScheduledTaskId { get; set; } + + public int TestSizePercentage { get; set; } + + public int? TestNumberPerVariantEmails { get; set; } + + [ForeignKey("TestIssueId")] + [InverseProperty("NewsletterAbtestTestIssue")] + public virtual NewsletterNewsletterIssue TestIssue { get; set; } = null!; + + [ForeignKey("TestWinnerIssueId")] + [InverseProperty("NewsletterAbtestTestWinnerIssues")] + public virtual NewsletterNewsletterIssue? TestWinnerIssue { get; set; } + + [ForeignKey("TestWinnerScheduledTaskId")] + [InverseProperty("NewsletterAbtests")] + public virtual CmsScheduledTask? TestWinnerScheduledTask { get; set; } +} diff --git a/Migration.Tool.KX13/Models/NewsletterClickedLink.cs b/Migration.Tool.KX13/Models/NewsletterClickedLink.cs new file mode 100644 index 00000000..ef559603 --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterClickedLink.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_ClickedLink")] +[Index("ClickedLinkNewsletterLinkId", Name = "IX_Newsletter_ClickedLink_ClickedLinkNewsletterLinkID")] +public class NewsletterClickedLink +{ + [Key] + [Column("ClickedLinkID")] + public int ClickedLinkId { get; set; } + + public Guid ClickedLinkGuid { get; set; } + + [StringLength(254)] + public string ClickedLinkEmail { get; set; } = null!; + + [Column("ClickedLinkNewsletterLinkID")] + public int ClickedLinkNewsletterLinkId { get; set; } + + public DateTime? ClickedLinkTime { get; set; } + + [ForeignKey("ClickedLinkNewsletterLinkId")] + [InverseProperty("NewsletterClickedLinks")] + public virtual NewsletterLink ClickedLinkNewsletterLink { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/NewsletterEmail.cs b/Migration.Tool.KX13/Models/NewsletterEmail.cs new file mode 100644 index 00000000..12516ce5 --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterEmail.cs @@ -0,0 +1,55 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_Emails")] +[Index("EmailGuid", Name = "IX_Newsletter_Emails_EmailGUID", IsUnique = true)] +[Index("EmailNewsletterIssueId", Name = "IX_Newsletter_Emails_EmailNewsletterIssueID")] +[Index("EmailSending", Name = "IX_Newsletter_Emails_EmailSending")] +[Index("EmailSiteId", Name = "IX_Newsletter_Emails_EmailSiteID")] +[Index("EmailSubscriberId", Name = "IX_Newsletter_Emails_EmailSubscriberID")] +public class NewsletterEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [Column("EmailNewsletterIssueID")] + public int EmailNewsletterIssueId { get; set; } + + [Column("EmailSubscriberID")] + public int? EmailSubscriberId { get; set; } + + [Column("EmailSiteID")] + public int EmailSiteId { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + public bool? EmailSending { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + [Column("EmailContactID")] + public int? EmailContactId { get; set; } + + [StringLength(254)] + public string? EmailAddress { get; set; } + + [ForeignKey("EmailNewsletterIssueId")] + [InverseProperty("NewsletterEmails")] + public virtual NewsletterNewsletterIssue EmailNewsletterIssue { get; set; } = null!; + + [ForeignKey("EmailSiteId")] + [InverseProperty("NewsletterEmails")] + public virtual CmsSite EmailSite { get; set; } = null!; + + [ForeignKey("EmailSubscriberId")] + [InverseProperty("NewsletterEmails")] + public virtual NewsletterSubscriber? EmailSubscriber { get; set; } +} diff --git a/Migration.Tool.KX13/Models/NewsletterEmailTemplate.cs b/Migration.Tool.KX13/Models/NewsletterEmailTemplate.cs new file mode 100644 index 00000000..e054522b --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterEmailTemplate.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_EmailTemplate")] +[Index("TemplateSiteId", "TemplateName", Name = "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateName", IsUnique = true)] +public class NewsletterEmailTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(250)] + public string TemplateDisplayName { get; set; } = null!; + + [StringLength(250)] + public string TemplateName { get; set; } = null!; + + [Column("TemplateSiteID")] + public int TemplateSiteId { get; set; } + + [StringLength(50)] + public string TemplateType { get; set; } = null!; + + [Column("TemplateGUID")] + public Guid TemplateGuid { get; set; } + + public DateTime TemplateLastModified { get; set; } + + [StringLength(450)] + public string? TemplateSubject { get; set; } + + [Column("TemplateThumbnailGUID")] + public Guid? TemplateThumbnailGuid { get; set; } + + public string? TemplateDescription { get; set; } + + [StringLength(200)] + public string? TemplateIconClass { get; set; } + + public string? TemplateCode { get; set; } + + [Column("TemplateInlineCSS")] + public bool TemplateInlineCss { get; set; } + + [InverseProperty("Template")] + public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); + + [InverseProperty("IssueTemplate")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [InverseProperty("NewsletterOptInTemplate")] + public virtual ICollection NewsletterNewsletterNewsletterOptInTemplates { get; set; } = new List(); + + [InverseProperty("NewsletterUnsubscriptionTemplate")] + public virtual ICollection NewsletterNewsletterNewsletterUnsubscriptionTemplates { get; set; } = new List(); + + [ForeignKey("TemplateSiteId")] + [InverseProperty("NewsletterEmailTemplates")] + public virtual CmsSite TemplateSite { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("Templates")] + public virtual ICollection Newsletters { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/NewsletterEmailWidget.cs b/Migration.Tool.KX13/Models/NewsletterEmailWidget.cs new file mode 100644 index 00000000..c1e42a9b --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterEmailWidget.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_EmailWidget")] +[Index("EmailWidgetSiteId", Name = "IX_Newsletter_EmailWidget_EmailWidgetSiteID")] +public class NewsletterEmailWidget +{ + [Key] + [Column("EmailWidgetID")] + public int EmailWidgetId { get; set; } + + public Guid EmailWidgetGuid { get; set; } + + public DateTime EmailWidgetLastModified { get; set; } + + [StringLength(250)] + public string EmailWidgetDisplayName { get; set; } = null!; + + [StringLength(250)] + public string EmailWidgetName { get; set; } = null!; + + public string? EmailWidgetDescription { get; set; } + + public string? EmailWidgetCode { get; set; } + + [Column("EmailWidgetSiteID")] + public int EmailWidgetSiteId { get; set; } + + [Column("EmailWidgetThumbnailGUID")] + public Guid? EmailWidgetThumbnailGuid { get; set; } + + [StringLength(200)] + public string? EmailWidgetIconCssClass { get; set; } + + public string? EmailWidgetProperties { get; set; } + + [ForeignKey("EmailWidgetSiteId")] + [InverseProperty("NewsletterEmailWidgets")] + public virtual CmsSite EmailWidgetSite { get; set; } = null!; + + [InverseProperty("EmailWidget")] + public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/NewsletterEmailWidgetTemplate.cs b/Migration.Tool.KX13/Models/NewsletterEmailWidgetTemplate.cs new file mode 100644 index 00000000..1bc6c7bb --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterEmailWidgetTemplate.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_EmailWidgetTemplate")] +[Index("EmailWidgetId", Name = "IX_Newsletter_EmailWidgetTemplate_EmailWidgetID")] +[Index("TemplateId", Name = "IX_Newsletter_EmailWidgetTemplate_TemplateID")] +public class NewsletterEmailWidgetTemplate +{ + [Key] + [Column("EmailWidgetTemplateID")] + public int EmailWidgetTemplateId { get; set; } + + [Column("EmailWidgetID")] + public int EmailWidgetId { get; set; } + + [Column("TemplateID")] + public int TemplateId { get; set; } + + [ForeignKey("EmailWidgetId")] + [InverseProperty("NewsletterEmailWidgetTemplates")] + public virtual NewsletterEmailWidget EmailWidget { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("NewsletterEmailWidgetTemplates")] + public virtual NewsletterEmailTemplate Template { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/NewsletterIssueContactGroup.cs b/Migration.Tool.KX13/Models/NewsletterIssueContactGroup.cs new file mode 100644 index 00000000..408df52c --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterIssueContactGroup.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_IssueContactGroup")] +[Index("ContactGroupId", Name = "IX_Newsletter_IssueContactGroup_ContactGroupID")] +public class NewsletterIssueContactGroup +{ + [Key] + [Column("IssueContactGroupID")] + public int IssueContactGroupId { get; set; } + + [Column("IssueID")] + public int IssueId { get; set; } + + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [ForeignKey("ContactGroupId")] + [InverseProperty("NewsletterIssueContactGroups")] + public virtual OmContactGroup ContactGroup { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/NewsletterLink.cs b/Migration.Tool.KX13/Models/NewsletterLink.cs new file mode 100644 index 00000000..063ddf40 --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterLink.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_Link")] +[Index("LinkIssueId", Name = "IX_Newsletter_Link_LinkIssueID")] +public class NewsletterLink +{ + [Key] + [Column("LinkID")] + public int LinkId { get; set; } + + [Column("LinkIssueID")] + public int LinkIssueId { get; set; } + + public string LinkTarget { get; set; } = null!; + + [StringLength(450)] + public string LinkDescription { get; set; } = null!; + + [Column("LinkGUID")] + public Guid LinkGuid { get; set; } + + [ForeignKey("LinkIssueId")] + [InverseProperty("NewsletterLinks")] + public virtual NewsletterNewsletterIssue LinkIssue { get; set; } = null!; + + [InverseProperty("ClickedLinkNewsletterLink")] + public virtual ICollection NewsletterClickedLinks { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/NewsletterNewsletter.cs b/Migration.Tool.KX13/Models/NewsletterNewsletter.cs new file mode 100644 index 00000000..8e8a4d8a --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterNewsletter.cs @@ -0,0 +1,115 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_Newsletter")] +[Index("NewsletterDynamicScheduledTaskId", Name = "IX_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID")] +[Index("NewsletterOptInTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterOptInTemplateID")] +[Index("NewsletterSiteId", "NewsletterName", Name = "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterName", IsUnique = true)] +[Index("NewsletterSubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterSubscriptionTemplateID")] +[Index("NewsletterUnsubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID")] +public class NewsletterNewsletter +{ + [Key] + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + [StringLength(250)] + public string NewsletterDisplayName { get; set; } = null!; + + [StringLength(250)] + public string NewsletterName { get; set; } = null!; + + [Column("NewsletterSubscriptionTemplateID")] + public int? NewsletterSubscriptionTemplateId { get; set; } + + [Column("NewsletterUnsubscriptionTemplateID")] + public int NewsletterUnsubscriptionTemplateId { get; set; } + + [StringLength(200)] + public string NewsletterSenderName { get; set; } = null!; + + [StringLength(254)] + public string NewsletterSenderEmail { get; set; } = null!; + + [StringLength(100)] + public string? NewsletterDynamicSubject { get; set; } + + [Column("NewsletterDynamicURL")] + [StringLength(500)] + public string? NewsletterDynamicUrl { get; set; } + + [Column("NewsletterDynamicScheduledTaskID")] + public int? NewsletterDynamicScheduledTaskId { get; set; } + + [Column("NewsletterSiteID")] + public int NewsletterSiteId { get; set; } + + [Column("NewsletterGUID")] + public Guid NewsletterGuid { get; set; } + + [StringLength(1000)] + public string? NewsletterUnsubscribeUrl { get; set; } + + [StringLength(500)] + public string? NewsletterBaseUrl { get; set; } + + public DateTime NewsletterLastModified { get; set; } + + public bool? NewsletterEnableOptIn { get; set; } + + [Column("NewsletterOptInTemplateID")] + public int? NewsletterOptInTemplateId { get; set; } + + public bool? NewsletterSendOptInConfirmation { get; set; } + + [Column("NewsletterOptInApprovalURL")] + [StringLength(450)] + public string? NewsletterOptInApprovalUrl { get; set; } + + public bool? NewsletterTrackOpenEmails { get; set; } + + public bool? NewsletterTrackClickedLinks { get; set; } + + [StringLength(998)] + public string? NewsletterDraftEmails { get; set; } + + public bool? NewsletterLogActivity { get; set; } + + [StringLength(5)] + public string NewsletterSource { get; set; } = null!; + + public int NewsletterType { get; set; } + + [ForeignKey("NewsletterDynamicScheduledTaskId")] + [InverseProperty("NewsletterNewsletters")] + public virtual CmsScheduledTask? NewsletterDynamicScheduledTask { get; set; } + + [InverseProperty("IssueNewsletter")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [ForeignKey("NewsletterOptInTemplateId")] + [InverseProperty("NewsletterNewsletterNewsletterOptInTemplates")] + public virtual NewsletterEmailTemplate? NewsletterOptInTemplate { get; set; } + + [ForeignKey("NewsletterSiteId")] + [InverseProperty("NewsletterNewsletters")] + public virtual CmsSite NewsletterSite { get; set; } = null!; + + [InverseProperty("Newsletter")] + public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); + + [ForeignKey("NewsletterUnsubscriptionTemplateId")] + [InverseProperty("NewsletterNewsletterNewsletterUnsubscriptionTemplates")] + public virtual NewsletterEmailTemplate NewsletterUnsubscriptionTemplate { get; set; } = null!; + + [InverseProperty("UnsubscriptionNewsletter")] + public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); + + [ForeignKey("NewsletterId")] + [InverseProperty("Newsletters")] + public virtual ICollection Templates { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/NewsletterNewsletterIssue.cs b/Migration.Tool.KX13/Models/NewsletterNewsletterIssue.cs new file mode 100644 index 00000000..21ef240a --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterNewsletterIssue.cs @@ -0,0 +1,127 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_NewsletterIssue")] +[Index("IssueNewsletterId", Name = "IX_Newsletter_NewsletterIssue_IssueNewsletterID")] +[Index("IssueScheduledTaskId", Name = "IX_Newsletter_NewsletterIssue_IssueScheduledTaskID")] +[Index("IssueSiteId", Name = "IX_Newsletter_NewsletterIssue_IssueSiteID")] +[Index("IssueTemplateId", Name = "IX_Newsletter_NewsletterIssue_IssueTemplateID")] +[Index("IssueVariantOfIssueId", Name = "IX_Newsletter_NewsletterIssue_IssueVariantOfIssueID")] +public class NewsletterNewsletterIssue +{ + [Key] + [Column("IssueID")] + public int IssueId { get; set; } + + [StringLength(450)] + public string IssueSubject { get; set; } = null!; + + public string IssueText { get; set; } = null!; + + public int IssueUnsubscribed { get; set; } + + [Column("IssueNewsletterID")] + public int IssueNewsletterId { get; set; } + + [Column("IssueTemplateID")] + public int? IssueTemplateId { get; set; } + + public int IssueSentEmails { get; set; } + + public DateTime? IssueMailoutTime { get; set; } + + [Column("IssueGUID")] + public Guid IssueGuid { get; set; } + + public DateTime IssueLastModified { get; set; } + + [Column("IssueSiteID")] + public int IssueSiteId { get; set; } + + public int? IssueOpenedEmails { get; set; } + + public int? IssueBounces { get; set; } + + public int? IssueStatus { get; set; } + + [Column("IssueIsABTest")] + public bool? IssueIsAbtest { get; set; } + + [Column("IssueVariantOfIssueID")] + public int? IssueVariantOfIssueId { get; set; } + + [StringLength(200)] + public string? IssueVariantName { get; set; } + + [StringLength(200)] + public string? IssueSenderName { get; set; } + + [StringLength(254)] + public string? IssueSenderEmail { get; set; } + + [Column("IssueScheduledTaskID")] + public int? IssueScheduledTaskId { get; set; } + + [Column("IssueUTMSource")] + [StringLength(200)] + public string? IssueUtmsource { get; set; } + + [Column("IssueUseUTM")] + public bool IssueUseUtm { get; set; } + + [Column("IssueUTMCampaign")] + [StringLength(200)] + public string? IssueUtmcampaign { get; set; } + + [StringLength(200)] + public string IssueDisplayName { get; set; } = null!; + + public string? IssueWidgets { get; set; } + + public string? IssuePreheader { get; set; } + + public string? IssuePlainText { get; set; } + + public bool IssueForAutomation { get; set; } + + [InverseProperty("IssueVariantOfIssue")] + public virtual ICollection InverseIssueVariantOfIssue { get; set; } = new List(); + + [ForeignKey("IssueNewsletterId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual NewsletterNewsletter IssueNewsletter { get; set; } = null!; + + [ForeignKey("IssueSiteId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual CmsSite IssueSite { get; set; } = null!; + + [ForeignKey("IssueTemplateId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual NewsletterEmailTemplate? IssueTemplate { get; set; } + + [ForeignKey("IssueVariantOfIssueId")] + [InverseProperty("InverseIssueVariantOfIssue")] + public virtual NewsletterNewsletterIssue? IssueVariantOfIssue { get; set; } + + [InverseProperty("TestIssue")] + public virtual NewsletterAbtest? NewsletterAbtestTestIssue { get; set; } + + [InverseProperty("TestWinnerIssue")] + public virtual ICollection NewsletterAbtestTestWinnerIssues { get; set; } = new List(); + + [InverseProperty("EmailNewsletterIssue")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("LinkIssue")] + public virtual ICollection NewsletterLinks { get; set; } = new List(); + + [InverseProperty("OpenedEmailIssue")] + public virtual ICollection NewsletterOpenedEmails { get; set; } = new List(); + + [InverseProperty("UnsubscriptionFromIssue")] + public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/NewsletterOpenedEmail.cs b/Migration.Tool.KX13/Models/NewsletterOpenedEmail.cs new file mode 100644 index 00000000..2e0e2ec3 --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterOpenedEmail.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_OpenedEmail")] +[Index("OpenedEmailIssueId", Name = "IX_Newsletter_OpenedEmail_OpenedEmailIssueID")] +public class NewsletterOpenedEmail +{ + [Key] + [Column("OpenedEmailID")] + public int OpenedEmailId { get; set; } + + [StringLength(254)] + public string OpenedEmailEmail { get; set; } = null!; + + public Guid OpenedEmailGuid { get; set; } + + public DateTime? OpenedEmailTime { get; set; } + + [Column("OpenedEmailIssueID")] + public int OpenedEmailIssueId { get; set; } + + [ForeignKey("OpenedEmailIssueId")] + [InverseProperty("NewsletterOpenedEmails")] + public virtual NewsletterNewsletterIssue OpenedEmailIssue { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/NewsletterSubscriber.cs b/Migration.Tool.KX13/Models/NewsletterSubscriber.cs new file mode 100644 index 00000000..ad9a7338 --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterSubscriber.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_Subscriber")] +[Index("SubscriberEmail", Name = "IX_Newsletter_Subscriber_SubscriberEmail")] +[Index("SubscriberType", "SubscriberRelatedId", Name = "IX_Newsletter_Subscriber_SubscriberType_SubscriberRelatedID")] +public class NewsletterSubscriber +{ + [Key] + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [StringLength(254)] + public string? SubscriberEmail { get; set; } + + [StringLength(200)] + public string? SubscriberFirstName { get; set; } + + [StringLength(200)] + public string? SubscriberLastName { get; set; } + + [Column("SubscriberSiteID")] + public int SubscriberSiteId { get; set; } + + [Column("SubscriberGUID")] + public Guid SubscriberGuid { get; set; } + + public string? SubscriberCustomData { get; set; } + + [StringLength(100)] + public string? SubscriberType { get; set; } + + [Column("SubscriberRelatedID")] + public int SubscriberRelatedId { get; set; } + + public DateTime SubscriberLastModified { get; set; } + + [StringLength(440)] + public string? SubscriberFullName { get; set; } + + public int? SubscriberBounces { get; set; } + + [InverseProperty("EmailSubscriber")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("Subscriber")] + public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); + + [ForeignKey("SubscriberSiteId")] + [InverseProperty("NewsletterSubscribers")] + public virtual CmsSite SubscriberSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/NewsletterSubscriberNewsletter.cs b/Migration.Tool.KX13/Models/NewsletterSubscriberNewsletter.cs new file mode 100644 index 00000000..42487ebc --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterSubscriberNewsletter.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_SubscriberNewsletter")] +[Index("NewsletterId", "SubscriptionApproved", Name = "IX_Newsletter_SubscriberNewsletter_NewsletterID_SubscriptionApproved")] +[Index("SubscriberId", "NewsletterId", Name = "UQ_Newsletter_SubscriberNewsletter", IsUnique = true)] +public class NewsletterSubscriberNewsletter +{ + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + public DateTime SubscribedWhen { get; set; } + + public bool? SubscriptionApproved { get; set; } + + public DateTime? SubscriptionApprovedWhen { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [Key] + [Column("SubscriberNewsletterID")] + public int SubscriberNewsletterId { get; set; } + + [ForeignKey("NewsletterId")] + [InverseProperty("NewsletterSubscriberNewsletters")] + public virtual NewsletterNewsletter Newsletter { get; set; } = null!; + + [ForeignKey("SubscriberId")] + [InverseProperty("NewsletterSubscriberNewsletters")] + public virtual NewsletterSubscriber Subscriber { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/NewsletterUnsubscription.cs b/Migration.Tool.KX13/Models/NewsletterUnsubscription.cs new file mode 100644 index 00000000..1e941534 --- /dev/null +++ b/Migration.Tool.KX13/Models/NewsletterUnsubscription.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Newsletter_Unsubscription")] +[Index("UnsubscriptionEmail", "UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_Email_NewsletterID")] +[Index("UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_NewsletterID")] +[Index("UnsubscriptionFromIssueId", Name = "IX_Newsletter_Unsubscription_UnsubscriptionFromIssueID")] +public class NewsletterUnsubscription +{ + [Key] + [Column("UnsubscriptionID")] + public int UnsubscriptionId { get; set; } + + [StringLength(254)] + public string UnsubscriptionEmail { get; set; } = null!; + + public DateTime UnsubscriptionCreated { get; set; } + + [Column("UnsubscriptionNewsletterID")] + public int? UnsubscriptionNewsletterId { get; set; } + + [Column("UnsubscriptionFromIssueID")] + public int? UnsubscriptionFromIssueId { get; set; } + + [Column("UnsubscriptionGUID")] + public Guid UnsubscriptionGuid { get; set; } + + [ForeignKey("UnsubscriptionFromIssueId")] + [InverseProperty("NewsletterUnsubscriptions")] + public virtual NewsletterNewsletterIssue? UnsubscriptionFromIssue { get; set; } + + [ForeignKey("UnsubscriptionNewsletterId")] + [InverseProperty("NewsletterUnsubscriptions")] + public virtual NewsletterNewsletter? UnsubscriptionNewsletter { get; set; } +} diff --git a/Migration.Tool.KX13/Models/OmAbtest.cs b/Migration.Tool.KX13/Models/OmAbtest.cs new file mode 100644 index 00000000..3a00798d --- /dev/null +++ b/Migration.Tool.KX13/Models/OmAbtest.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_ABTest")] +[Index("AbtestSiteId", Name = "IX_OM_ABTest_SiteID")] +public class OmAbtest +{ + [Key] + [Column("ABTestID")] + public int AbtestId { get; set; } + + [Column("ABTestName")] + [StringLength(50)] + public string AbtestName { get; set; } = null!; + + [Column("ABTestDescription")] + public string? AbtestDescription { get; set; } + + [Column("ABTestCulture")] + [StringLength(50)] + public string? AbtestCulture { get; set; } + + [Column("ABTestOriginalPage")] + [StringLength(450)] + public string AbtestOriginalPage { get; set; } = null!; + + [Column("ABTestOpenFrom")] + public DateTime? AbtestOpenFrom { get; set; } + + [Column("ABTestOpenTo")] + public DateTime? AbtestOpenTo { get; set; } + + [Column("ABTestSiteID")] + public int AbtestSiteId { get; set; } + + [Column("ABTestGUID")] + public Guid AbtestGuid { get; set; } + + [Column("ABTestLastModified")] + public DateTime AbtestLastModified { get; set; } + + [Column("ABTestDisplayName")] + [StringLength(100)] + public string AbtestDisplayName { get; set; } = null!; + + [Column("ABTestIncludedTraffic")] + public int AbtestIncludedTraffic { get; set; } + + [Column("ABTestVisitorTargeting")] + public string? AbtestVisitorTargeting { get; set; } + + [Column("ABTestConversions")] + public string? AbtestConversions { get; set; } + + [Column("ABTestWinnerGUID")] + public Guid? AbtestWinnerGuid { get; set; } + + [ForeignKey("AbtestSiteId")] + [InverseProperty("OmAbtests")] + public virtual CmsSite AbtestSite { get; set; } = null!; + + [InverseProperty("AbvariantTest")] + public virtual ICollection OmAbvariantData { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/OmAbvariantDatum.cs b/Migration.Tool.KX13/Models/OmAbvariantDatum.cs new file mode 100644 index 00000000..254701ef --- /dev/null +++ b/Migration.Tool.KX13/Models/OmAbvariantDatum.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_ABVariantData")] +[Index("AbvariantTestId", "AbvariantGuid", Name = "IX_OM_ABVariantData_ABVariantTestID_ABVariantGUID")] +public class OmAbvariantDatum +{ + [Key] + [Column("ABVariantID")] + public int AbvariantId { get; set; } + + [Column("ABVariantDisplayName")] + [StringLength(100)] + public string AbvariantDisplayName { get; set; } = null!; + + [Column("ABVariantGUID")] + public Guid AbvariantGuid { get; set; } + + [Column("ABVariantTestID")] + public int AbvariantTestId { get; set; } + + [Column("ABVariantIsOriginal")] + public bool AbvariantIsOriginal { get; set; } + + [ForeignKey("AbvariantTestId")] + [InverseProperty("OmAbvariantData")] + public virtual OmAbtest AbvariantTest { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/OmAccount.cs b/Migration.Tool.KX13/Models/OmAccount.cs new file mode 100644 index 00000000..073f9fe9 --- /dev/null +++ b/Migration.Tool.KX13/Models/OmAccount.cs @@ -0,0 +1,113 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_Account")] +[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] +[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] +[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] +[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] +[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] +[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] +[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] +public class OmAccount +{ + [Key] + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [ForeignKey("AccountCountryId")] + [InverseProperty("OmAccounts")] + public virtual CmsCountry? AccountCountry { get; set; } + + [ForeignKey("AccountOwnerUserId")] + [InverseProperty("OmAccounts")] + public virtual CmsUser? AccountOwnerUser { get; set; } + + [ForeignKey("AccountPrimaryContactId")] + [InverseProperty("OmAccountAccountPrimaryContacts")] + public virtual OmContact? AccountPrimaryContact { get; set; } + + [ForeignKey("AccountSecondaryContactId")] + [InverseProperty("OmAccountAccountSecondaryContacts")] + public virtual OmContact? AccountSecondaryContact { get; set; } + + [ForeignKey("AccountStateId")] + [InverseProperty("OmAccounts")] + public virtual CmsState? AccountState { get; set; } + + [ForeignKey("AccountStatusId")] + [InverseProperty("OmAccounts")] + public virtual OmAccountStatus? AccountStatus { get; set; } + + [ForeignKey("AccountSubsidiaryOfId")] + [InverseProperty("InverseAccountSubsidiaryOf")] + public virtual OmAccount? AccountSubsidiaryOf { get; set; } + + [InverseProperty("AccountSubsidiaryOf")] + public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); + + [InverseProperty("Account")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/OmAccountContact.cs b/Migration.Tool.KX13/Models/OmAccountContact.cs new file mode 100644 index 00000000..37511b0b --- /dev/null +++ b/Migration.Tool.KX13/Models/OmAccountContact.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_AccountContact")] +[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] +[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] +[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] +public class OmAccountContact +{ + [Key] + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("AccountId")] + [InverseProperty("OmAccountContacts")] + public virtual OmAccount Account { get; set; } = null!; + + [ForeignKey("ContactId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("ContactRoleId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContactRole? ContactRole { get; set; } +} diff --git a/Migration.Tool.KX13/Models/OmAccountStatus.cs b/Migration.Tool.KX13/Models/OmAccountStatus.cs new file mode 100644 index 00000000..31c589dc --- /dev/null +++ b/Migration.Tool.KX13/Models/OmAccountStatus.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_AccountStatus")] +public class OmAccountStatus +{ + [Key] + [Column("AccountStatusID")] + public int AccountStatusId { get; set; } + + [StringLength(200)] + public string AccountStatusName { get; set; } = null!; + + [StringLength(200)] + public string AccountStatusDisplayName { get; set; } = null!; + + public string? AccountStatusDescription { get; set; } + + [InverseProperty("AccountStatus")] + public virtual ICollection OmAccounts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/OmActivity.cs b/Migration.Tool.KX13/Models/OmActivity.cs new file mode 100644 index 00000000..e4531722 --- /dev/null +++ b/Migration.Tool.KX13/Models/OmActivity.cs @@ -0,0 +1,74 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_Activity")] +[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] +[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] +[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] +[Index("ActivitySiteId", Name = "IX_OM_Activity_ActivitySiteID")] +[Index("ActivityType", "ActivityItemId", "ActivityNodeId", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityNodeID_ActivityUTMSource_ActivityUTMContent_ActivityCampaign")] +public class OmActivity +{ + [Key] + [Column("ActivityID")] + public int ActivityId { get; set; } + + [Column("ActivityContactID")] + public int ActivityContactId { get; set; } + + public DateTime? ActivityCreated { get; set; } + + [StringLength(250)] + public string ActivityType { get; set; } = null!; + + [Column("ActivityItemID")] + public int? ActivityItemId { get; set; } + + [Column("ActivityItemDetailID")] + public int? ActivityItemDetailId { get; set; } + + [StringLength(250)] + public string? ActivityValue { get; set; } + + [Column("ActivityURL")] + public string? ActivityUrl { get; set; } + + [StringLength(250)] + public string? ActivityTitle { get; set; } + + [Column("ActivitySiteID")] + public int ActivitySiteId { get; set; } + + public string? ActivityComment { get; set; } + + [StringLength(200)] + public string? ActivityCampaign { get; set; } + + [Column("ActivityURLReferrer")] + public string? ActivityUrlreferrer { get; set; } + + [StringLength(50)] + public string? ActivityCulture { get; set; } + + [Column("ActivityNodeID")] + public int? ActivityNodeId { get; set; } + + [Column("ActivityUTMSource")] + [StringLength(200)] + public string? ActivityUtmsource { get; set; } + + [Column("ActivityABVariantName")] + [StringLength(200)] + public string? ActivityAbvariantName { get; set; } + + [Column("ActivityURLHash")] + public long ActivityUrlhash { get; set; } + + [Column("ActivityUTMContent")] + [StringLength(200)] + public string? ActivityUtmcontent { get; set; } +} diff --git a/Migration.Tool.KX13/Models/OmActivityRecalculationQueue.cs b/Migration.Tool.KX13/Models/OmActivityRecalculationQueue.cs new file mode 100644 index 00000000..a4da498e --- /dev/null +++ b/Migration.Tool.KX13/Models/OmActivityRecalculationQueue.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_ActivityRecalculationQueue")] +public class OmActivityRecalculationQueue +{ + [Key] + [Column("ActivityRecalculationQueueID")] + public int ActivityRecalculationQueueId { get; set; } + + [Column("ActivityRecalculationQueueActivityID")] + public int ActivityRecalculationQueueActivityId { get; set; } +} diff --git a/Migration.Tool.KX13/Models/OmActivityType.cs b/Migration.Tool.KX13/Models/OmActivityType.cs new file mode 100644 index 00000000..7f6380f9 --- /dev/null +++ b/Migration.Tool.KX13/Models/OmActivityType.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_ActivityType")] +public class OmActivityType +{ + [Key] + [Column("ActivityTypeID")] + public int ActivityTypeId { get; set; } + + [StringLength(250)] + public string ActivityTypeDisplayName { get; set; } = null!; + + [StringLength(250)] + public string ActivityTypeName { get; set; } = null!; + + public bool? ActivityTypeEnabled { get; set; } + + public bool? ActivityTypeIsCustom { get; set; } + + public string? ActivityTypeDescription { get; set; } + + public bool? ActivityTypeManualCreationAllowed { get; set; } + + [StringLength(200)] + public string? ActivityTypeMainFormControl { get; set; } + + [StringLength(200)] + public string? ActivityTypeDetailFormControl { get; set; } + + [StringLength(7)] + public string? ActivityTypeColor { get; set; } + + [StringLength(200)] + public string? ActivityTypeItemObjectType { get; set; } + + [StringLength(200)] + public string? ActivityTypeItemDetailObjectType { get; set; } +} diff --git a/Migration.Tool.KX13/Models/OmContact.cs b/Migration.Tool.KX13/Models/OmContact.cs new file mode 100644 index 00000000..4aaf151f --- /dev/null +++ b/Migration.Tool.KX13/Models/OmContact.cs @@ -0,0 +1,140 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_Contact")] +[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] +[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] +[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] +[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] +[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] +[Index("ContactPersonaId", "ContactLastName", Name = "IX_OM_Contact_ContactPersonaID_ContactLastName")] +[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] +[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] +public class OmContact +{ + [Key] + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(50)] + public string? ContactJobTitle { get; set; } + + [StringLength(100)] + public string? ContactAddress1 { get; set; } + + [StringLength(100)] + public string? ContactCity { get; set; } + + [Column("ContactZIP")] + [StringLength(100)] + public string? ContactZip { get; set; } + + [Column("ContactStateID")] + public int? ContactStateId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [StringLength(26)] + public string? ContactMobilePhone { get; set; } + + [StringLength(26)] + public string? ContactBusinessPhone { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + public DateTime? ContactBirthday { get; set; } + + public int? ContactGender { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + public string? ContactNotes { get; set; } + + [Column("ContactOwnerUserID")] + public int? ContactOwnerUserId { get; set; } + + public bool? ContactMonitored { get; set; } + + [Column("ContactGUID")] + public Guid ContactGuid { get; set; } + + public DateTime ContactLastModified { get; set; } + + public DateTime ContactCreated { get; set; } + + public int? ContactBounces { get; set; } + + [StringLength(200)] + public string? ContactCampaign { get; set; } + + [Column("ContactSalesForceLeadID")] + [StringLength(18)] + public string? ContactSalesForceLeadId { get; set; } + + public bool? ContactSalesForceLeadReplicationDisabled { get; set; } + + public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } + + public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } + + [StringLength(100)] + public string? ContactCompanyName { get; set; } + + public bool? ContactSalesForceLeadReplicationRequired { get; set; } + + [Column("ContactPersonaID")] + public int? ContactPersonaId { get; set; } + + [InverseProperty("ConsentAgreementContact")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [ForeignKey("ContactCountryId")] + [InverseProperty("OmContacts")] + public virtual CmsCountry? ContactCountry { get; set; } + + [ForeignKey("ContactOwnerUserId")] + [InverseProperty("OmContacts")] + public virtual CmsUser? ContactOwnerUser { get; set; } + + [ForeignKey("ContactStateId")] + [InverseProperty("OmContacts")] + public virtual CmsState? ContactState { get; set; } + + [ForeignKey("ContactStatusId")] + [InverseProperty("OmContacts")] + public virtual OmContactStatus? ContactStatus { get; set; } + + [InverseProperty("AccountPrimaryContact")] + public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); + + [InverseProperty("AccountSecondaryContact")] + public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmMemberships { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [InverseProperty("VisitorToContactContact")] + public virtual ICollection OmVisitorToContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/OmContactChangeRecalculationQueue.cs b/Migration.Tool.KX13/Models/OmContactChangeRecalculationQueue.cs new file mode 100644 index 00000000..09a7a2cb --- /dev/null +++ b/Migration.Tool.KX13/Models/OmContactChangeRecalculationQueue.cs @@ -0,0 +1,21 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_ContactChangeRecalculationQueue")] +public class OmContactChangeRecalculationQueue +{ + [Key] + [Column("ContactChangeRecalculationQueueID")] + public int ContactChangeRecalculationQueueId { get; set; } + + [Column("ContactChangeRecalculationQueueContactID")] + public int ContactChangeRecalculationQueueContactId { get; set; } + + public string? ContactChangeRecalculationQueueChangedColumns { get; set; } + + public bool ContactChangeRecalculationQueueContactIsNew { get; set; } + + public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } +} diff --git a/Migration.Tool.KX13/Models/OmContactGroup.cs b/Migration.Tool.KX13/Models/OmContactGroup.cs new file mode 100644 index 00000000..853dacb3 --- /dev/null +++ b/Migration.Tool.KX13/Models/OmContactGroup.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_ContactGroup")] +public class OmContactGroup +{ + [Key] + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [StringLength(200)] + public string ContactGroupName { get; set; } = null!; + + [StringLength(200)] + public string ContactGroupDisplayName { get; set; } = null!; + + public string? ContactGroupDescription { get; set; } + + public string? ContactGroupDynamicCondition { get; set; } + + public bool? ContactGroupEnabled { get; set; } + + public DateTime? ContactGroupLastModified { get; set; } + + [Column("ContactGroupGUID")] + public Guid? ContactGroupGuid { get; set; } + + public int? ContactGroupStatus { get; set; } + + [InverseProperty("ContactGroup")] + public virtual ICollection NewsletterIssueContactGroups { get; set; } = new List(); + + [InverseProperty("ContactGroupMemberContactGroup")] + public virtual ICollection OmContactGroupMembers { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/OmContactGroupMember.cs b/Migration.Tool.KX13/Models/OmContactGroupMember.cs new file mode 100644 index 00000000..27d65fe5 --- /dev/null +++ b/Migration.Tool.KX13/Models/OmContactGroupMember.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_ContactGroupMember")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] +[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] +public class OmContactGroupMember +{ + [Key] + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + public int ContactGroupMemberType { get; set; } + + [Column("ContactGroupMemberRelatedID")] + public int ContactGroupMemberRelatedId { get; set; } + + public bool? ContactGroupMemberFromCondition { get; set; } + + public bool? ContactGroupMemberFromAccount { get; set; } + + public bool? ContactGroupMemberFromManual { get; set; } + + [ForeignKey("ContactGroupMemberContactGroupId")] + [InverseProperty("OmContactGroupMembers")] + public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/OmContactRole.cs b/Migration.Tool.KX13/Models/OmContactRole.cs new file mode 100644 index 00000000..0f16d36b --- /dev/null +++ b/Migration.Tool.KX13/Models/OmContactRole.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_ContactRole")] +public class OmContactRole +{ + [Key] + [Column("ContactRoleID")] + public int ContactRoleId { get; set; } + + [StringLength(200)] + public string ContactRoleName { get; set; } = null!; + + [StringLength(200)] + public string ContactRoleDisplayName { get; set; } = null!; + + public string? ContactRoleDescription { get; set; } + + [InverseProperty("ContactRole")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/OmContactStatus.cs b/Migration.Tool.KX13/Models/OmContactStatus.cs new file mode 100644 index 00000000..7a1d9615 --- /dev/null +++ b/Migration.Tool.KX13/Models/OmContactStatus.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_ContactStatus")] +public class OmContactStatus +{ + [Key] + [Column("ContactStatusID")] + public int ContactStatusId { get; set; } + + [StringLength(200)] + public string ContactStatusName { get; set; } = null!; + + [StringLength(200)] + public string ContactStatusDisplayName { get; set; } = null!; + + public string? ContactStatusDescription { get; set; } + + [InverseProperty("ContactStatus")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/OmMembership.cs b/Migration.Tool.KX13/Models/OmMembership.cs new file mode 100644 index 00000000..413355f6 --- /dev/null +++ b/Migration.Tool.KX13/Models/OmMembership.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_Membership")] +[Index("ContactId", Name = "IX_OM_Membership_ContactID")] +[Index("RelatedId", Name = "IX_OM_Membership_RelatedID")] +public class OmMembership +{ + [Key] + [Column("MembershipID")] + public int MembershipId { get; set; } + + [Column("RelatedID")] + public int RelatedId { get; set; } + + public int MemberType { get; set; } + + [Column("MembershipGUID")] + public Guid MembershipGuid { get; set; } + + public DateTime MembershipCreated { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("ContactId")] + [InverseProperty("OmMemberships")] + public virtual OmContact Contact { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/OmRule.cs b/Migration.Tool.KX13/Models/OmRule.cs new file mode 100644 index 00000000..3f69be99 --- /dev/null +++ b/Migration.Tool.KX13/Models/OmRule.cs @@ -0,0 +1,70 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_Rule")] +[Index("RuleScoreId", Name = "IX_OM_Rule_RuleScoreID")] +public class OmRule +{ + [Key] + [Column("RuleID")] + public int RuleId { get; set; } + + [Column("RuleScoreID")] + public int RuleScoreId { get; set; } + + [StringLength(200)] + public string RuleDisplayName { get; set; } = null!; + + [StringLength(200)] + public string RuleName { get; set; } = null!; + + public int RuleValue { get; set; } + + public bool? RuleIsRecurring { get; set; } + + public int? RuleMaxPoints { get; set; } + + public DateTime? RuleValidUntil { get; set; } + + [StringLength(50)] + public string? RuleValidity { get; set; } + + public int? RuleValidFor { get; set; } + + public int RuleType { get; set; } + + [StringLength(250)] + public string? RuleParameter { get; set; } + + public string RuleCondition { get; set; } = null!; + + public DateTime RuleLastModified { get; set; } + + [Column("RuleGUID")] + public Guid RuleGuid { get; set; } + + public bool RuleBelongsToPersona { get; set; } + + [Column("RuleActivityItemID")] + public int? RuleActivityItemId { get; set; } + + [StringLength(200)] + public string? RuleActivityItemObjectType { get; set; } + + [Column("RuleActivityItemDetailID")] + public int? RuleActivityItemDetailId { get; set; } + + [StringLength(200)] + public string? RuleActivityItemDetailObjectType { get; set; } + + [InverseProperty("Rule")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [ForeignKey("RuleScoreId")] + [InverseProperty("OmRules")] + public virtual OmScore RuleScore { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/OmScore.cs b/Migration.Tool.KX13/Models/OmScore.cs new file mode 100644 index 00000000..124796ce --- /dev/null +++ b/Migration.Tool.KX13/Models/OmScore.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_Score")] +public class OmScore +{ + [Key] + [Column("ScoreID")] + public int ScoreId { get; set; } + + [StringLength(200)] + public string ScoreName { get; set; } = null!; + + [StringLength(200)] + public string ScoreDisplayName { get; set; } = null!; + + public string? ScoreDescription { get; set; } + + public bool ScoreEnabled { get; set; } + + public int? ScoreEmailAtScore { get; set; } + + [StringLength(998)] + public string? ScoreNotificationEmail { get; set; } + + public DateTime ScoreLastModified { get; set; } + + [Column("ScoreGUID")] + public Guid ScoreGuid { get; set; } + + public int? ScoreStatus { get; set; } + + [Column("ScoreScheduledTaskID")] + public int? ScoreScheduledTaskId { get; set; } + + [Column("ScorePersonaID")] + public int? ScorePersonaId { get; set; } + + [InverseProperty("RuleScore")] + public virtual ICollection OmRules { get; set; } = new List(); + + [InverseProperty("Score")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [ForeignKey("ScorePersonaId")] + [InverseProperty("OmScore")] + public virtual PersonasPersona? ScorePersona { get; set; } +} diff --git a/Migration.Tool.KX13/Models/OmScoreContactRule.cs b/Migration.Tool.KX13/Models/OmScoreContactRule.cs new file mode 100644 index 00000000..38b24ad6 --- /dev/null +++ b/Migration.Tool.KX13/Models/OmScoreContactRule.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_ScoreContactRule")] +[Index("ContactId", Name = "IX_OM_ScoreContactRule_ContactID")] +[Index("RuleId", Name = "IX_OM_ScoreContactRule_RuleID")] +[Index("ScoreId", Name = "IX_OM_ScoreContactRule_ScoreID_ContactID_Value_Expiration")] +[Index("ScoreId", "ContactId", "RuleId", Name = "UQ_OM_ScoreContactRule", IsUnique = true)] +public class OmScoreContactRule +{ + [Column("ScoreID")] + public int ScoreId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("RuleID")] + public int RuleId { get; set; } + + public int Value { get; set; } + + public DateTime? Expiration { get; set; } + + [Key] + [Column("ScoreContactRuleID")] + public int ScoreContactRuleId { get; set; } + + [ForeignKey("ContactId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("RuleId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmRule Rule { get; set; } = null!; + + [ForeignKey("ScoreId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmScore Score { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/OmVisitorToContact.cs b/Migration.Tool.KX13/Models/OmVisitorToContact.cs new file mode 100644 index 00000000..7b531a55 --- /dev/null +++ b/Migration.Tool.KX13/Models/OmVisitorToContact.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("OM_VisitorToContact")] +[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] +[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] +public class OmVisitorToContact +{ + [Key] + [Column("VisitorToContactID")] + public int VisitorToContactId { get; set; } + + [Column("VisitorToContactVisitorGUID")] + public Guid VisitorToContactVisitorGuid { get; set; } + + [Column("VisitorToContactContactID")] + public int VisitorToContactContactId { get; set; } + + [ForeignKey("VisitorToContactContactId")] + [InverseProperty("OmVisitorToContacts")] + public virtual OmContact VisitorToContactContact { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/PersonasPersona.cs b/Migration.Tool.KX13/Models/PersonasPersona.cs new file mode 100644 index 00000000..fe6ba035 --- /dev/null +++ b/Migration.Tool.KX13/Models/PersonasPersona.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("Personas_Persona")] +public class PersonasPersona +{ + [Key] + [Column("PersonaID")] + public int PersonaId { get; set; } + + [StringLength(200)] + public string PersonaDisplayName { get; set; } = null!; + + [StringLength(200)] + public string PersonaName { get; set; } = null!; + + public string? PersonaDescription { get; set; } + + [Required] + public bool? PersonaEnabled { get; set; } + + [Column("PersonaGUID")] + public Guid PersonaGuid { get; set; } + + [Column("PersonaPictureMetafileGUID")] + public Guid? PersonaPictureMetafileGuid { get; set; } + + public int PersonaPointsThreshold { get; set; } + + [InverseProperty("ScorePersona")] + public virtual OmScore? OmScore { get; set; } + + [InverseProperty("PersonaContactHistoryPersona")] + public virtual ICollection PersonasPersonaContactHistories { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/PersonasPersonaContactHistory.cs b/Migration.Tool.KX13/Models/PersonasPersonaContactHistory.cs new file mode 100644 index 00000000..e73a7274 --- /dev/null +++ b/Migration.Tool.KX13/Models/PersonasPersonaContactHistory.cs @@ -0,0 +1,27 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Personas_PersonaContactHistory")] +[Index("PersonaContactHistoryPersonaId", Name = "IX_Personas_PersonaContactHistoryPersonaID")] +public class PersonasPersonaContactHistory +{ + [Key] + [Column("PersonaContactHistoryID")] + public int PersonaContactHistoryId { get; set; } + + [Column("PersonaContactHistoryPersonaID")] + public int? PersonaContactHistoryPersonaId { get; set; } + + [Column(TypeName = "date")] + public DateTime PersonaContactHistoryDate { get; set; } + + public int PersonaContactHistoryContacts { get; set; } + + [ForeignKey("PersonaContactHistoryPersonaId")] + [InverseProperty("PersonasPersonaContactHistories")] + public virtual PersonasPersona? PersonaContactHistoryPersona { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ReportingReport.cs b/Migration.Tool.KX13/Models/ReportingReport.cs new file mode 100644 index 00000000..d32c5d81 --- /dev/null +++ b/Migration.Tool.KX13/Models/ReportingReport.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Reporting_Report")] +[Index("ReportCategoryId", Name = "IX_Reporting_Report_ReportCategoryID")] +[Index("ReportGuid", "ReportName", Name = "IX_Reporting_Report_ReportGUID_ReportName")] +[Index("ReportName", Name = "IX_Reporting_Report_ReportName", IsUnique = true)] +public class ReportingReport +{ + [Key] + [Column("ReportID")] + public int ReportId { get; set; } + + [StringLength(200)] + public string ReportName { get; set; } = null!; + + [StringLength(440)] + public string ReportDisplayName { get; set; } = null!; + + public string? ReportLayout { get; set; } + + public string? ReportParameters { get; set; } + + [Column("ReportCategoryID")] + public int ReportCategoryId { get; set; } + + public int ReportAccess { get; set; } + + [Column("ReportGUID")] + public Guid ReportGuid { get; set; } + + public DateTime ReportLastModified { get; set; } + + public bool? ReportEnableSubscription { get; set; } + + [StringLength(100)] + public string? ReportConnectionString { get; set; } + + [ForeignKey("ReportCategoryId")] + [InverseProperty("ReportingReports")] + public virtual ReportingReportCategory ReportCategory { get; set; } = null!; + + [InverseProperty("GraphReport")] + public virtual ICollection ReportingReportGraphs { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionReport")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("TableReport")] + public virtual ICollection ReportingReportTables { get; set; } = new List(); + + [InverseProperty("ValueReport")] + public virtual ICollection ReportingReportValues { get; set; } = new List(); + + [InverseProperty("SavedReportReport")] + public virtual ICollection ReportingSavedReports { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/ReportingReportCategory.cs b/Migration.Tool.KX13/Models/ReportingReportCategory.cs new file mode 100644 index 00000000..f9e145f2 --- /dev/null +++ b/Migration.Tool.KX13/Models/ReportingReportCategory.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Reporting_ReportCategory")] +[Index("CategoryParentId", Name = "IX_Reporting_ReportCategory_CategoryParentID")] +public class ReportingReportCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryCodeName { get; set; } = null!; + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public string CategoryPath { get; set; } = null!; + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryReportChildCount { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual ReportingReportCategory? CategoryParent { get; set; } + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); + + [InverseProperty("ReportCategory")] + public virtual ICollection ReportingReports { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/ReportingReportGraph.cs b/Migration.Tool.KX13/Models/ReportingReportGraph.cs new file mode 100644 index 00000000..4d4b185f --- /dev/null +++ b/Migration.Tool.KX13/Models/ReportingReportGraph.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Reporting_ReportGraph")] +[Index("GraphGuid", Name = "IX_Reporting_ReportGraph_GraphGUID", IsUnique = true)] +[Index("GraphReportId", "GraphName", Name = "IX_Reporting_ReportGraph_GraphReportID_GraphName", IsUnique = true)] +public class ReportingReportGraph +{ + [Key] + [Column("GraphID")] + public int GraphId { get; set; } + + [StringLength(100)] + public string GraphName { get; set; } = null!; + + [StringLength(450)] + public string GraphDisplayName { get; set; } = null!; + + public string GraphQuery { get; set; } = null!; + + public bool GraphQueryIsStoredProcedure { get; set; } + + [StringLength(50)] + public string GraphType { get; set; } = null!; + + [Column("GraphReportID")] + public int GraphReportId { get; set; } + + [StringLength(200)] + public string? GraphTitle { get; set; } + + [Column("GraphXAxisTitle")] + [StringLength(200)] + public string? GraphXaxisTitle { get; set; } + + [Column("GraphYAxisTitle")] + [StringLength(200)] + public string? GraphYaxisTitle { get; set; } + + public int? GraphWidth { get; set; } + + public int? GraphHeight { get; set; } + + public int? GraphLegendPosition { get; set; } + + public string? GraphSettings { get; set; } + + [Column("GraphGUID")] + public Guid GraphGuid { get; set; } + + public DateTime GraphLastModified { get; set; } + + public bool? GraphIsHtml { get; set; } + + [StringLength(100)] + public string? GraphConnectionString { get; set; } + + [ForeignKey("GraphReportId")] + [InverseProperty("ReportingReportGraphs")] + public virtual ReportingReport GraphReport { get; set; } = null!; + + [InverseProperty("ReportSubscriptionGraph")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/ReportingReportSubscription.cs b/Migration.Tool.KX13/Models/ReportingReportSubscription.cs new file mode 100644 index 00000000..c6e48202 --- /dev/null +++ b/Migration.Tool.KX13/Models/ReportingReportSubscription.cs @@ -0,0 +1,92 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Reporting_ReportSubscription")] +[Index("ReportSubscriptionGraphId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionGraphID")] +[Index("ReportSubscriptionReportId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionReportID")] +[Index("ReportSubscriptionSiteId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionSiteID")] +[Index("ReportSubscriptionTableId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionTableID")] +[Index("ReportSubscriptionUserId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionUserID")] +[Index("ReportSubscriptionValueId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionValueID")] +public class ReportingReportSubscription +{ + [Key] + [Column("ReportSubscriptionID")] + public int ReportSubscriptionId { get; set; } + + [Column("ReportSubscriptionReportID")] + public int ReportSubscriptionReportId { get; set; } + + [StringLength(1000)] + public string ReportSubscriptionInterval { get; set; } = null!; + + public string? ReportSubscriptionCondition { get; set; } + + [Required] + public bool? ReportSubscriptionEnabled { get; set; } + + public string? ReportSubscriptionParameters { get; set; } + + [Column("ReportSubscriptionGUID")] + public Guid ReportSubscriptionGuid { get; set; } + + public DateTime ReportSubscriptionLastModified { get; set; } + + [StringLength(200)] + public string? ReportSubscriptionSubject { get; set; } + + [Column("ReportSubscriptionGraphID")] + public int? ReportSubscriptionGraphId { get; set; } + + [Column("ReportSubscriptionTableID")] + public int? ReportSubscriptionTableId { get; set; } + + [Column("ReportSubscriptionValueID")] + public int? ReportSubscriptionValueId { get; set; } + + [Column("ReportSubscriptionUserID")] + public int ReportSubscriptionUserId { get; set; } + + [StringLength(400)] + public string ReportSubscriptionEmail { get; set; } = null!; + + [Required] + public bool? ReportSubscriptionOnlyNonEmpty { get; set; } + + public DateTime? ReportSubscriptionLastPostDate { get; set; } + + public DateTime? ReportSubscriptionNextPostDate { get; set; } + + [Column("ReportSubscriptionSiteID")] + public int ReportSubscriptionSiteId { get; set; } + + public string? ReportSubscriptionSettings { get; set; } + + [ForeignKey("ReportSubscriptionGraphId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportGraph? ReportSubscriptionGraph { get; set; } + + [ForeignKey("ReportSubscriptionReportId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReport ReportSubscriptionReport { get; set; } = null!; + + [ForeignKey("ReportSubscriptionSiteId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual CmsSite ReportSubscriptionSite { get; set; } = null!; + + [ForeignKey("ReportSubscriptionTableId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportTable? ReportSubscriptionTable { get; set; } + + [ForeignKey("ReportSubscriptionUserId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual CmsUser ReportSubscriptionUser { get; set; } = null!; + + [ForeignKey("ReportSubscriptionValueId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportValue? ReportSubscriptionValue { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ReportingReportTable.cs b/Migration.Tool.KX13/Models/ReportingReportTable.cs new file mode 100644 index 00000000..25791032 --- /dev/null +++ b/Migration.Tool.KX13/Models/ReportingReportTable.cs @@ -0,0 +1,46 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Reporting_ReportTable")] +[Index("TableReportId", Name = "IX_Reporting_ReportTable_TableReportID")] +[Index("TableName", "TableReportId", Name = "IX_Reporting_ReportTable_TableReportID_TableName", IsUnique = true)] +public class ReportingReportTable +{ + [Key] + [Column("TableID")] + public int TableId { get; set; } + + [StringLength(100)] + public string TableName { get; set; } = null!; + + [StringLength(450)] + public string TableDisplayName { get; set; } = null!; + + public string TableQuery { get; set; } = null!; + + public bool TableQueryIsStoredProcedure { get; set; } + + [Column("TableReportID")] + public int TableReportId { get; set; } + + public string? TableSettings { get; set; } + + [Column("TableGUID")] + public Guid TableGuid { get; set; } + + public DateTime TableLastModified { get; set; } + + [StringLength(100)] + public string? TableConnectionString { get; set; } + + [InverseProperty("ReportSubscriptionTable")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [ForeignKey("TableReportId")] + [InverseProperty("ReportingReportTables")] + public virtual ReportingReport TableReport { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ReportingReportValue.cs b/Migration.Tool.KX13/Models/ReportingReportValue.cs new file mode 100644 index 00000000..19f221c3 --- /dev/null +++ b/Migration.Tool.KX13/Models/ReportingReportValue.cs @@ -0,0 +1,49 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Reporting_ReportValue")] +[Index("ValueName", "ValueReportId", Name = "IX_Reporting_ReportValue_ValueName_ValueReportID")] +[Index("ValueReportId", Name = "IX_Reporting_ReportValue_ValueReportID")] +public class ReportingReportValue +{ + [Key] + [Column("ValueID")] + public int ValueId { get; set; } + + [StringLength(100)] + public string ValueName { get; set; } = null!; + + [StringLength(450)] + public string ValueDisplayName { get; set; } = null!; + + public string ValueQuery { get; set; } = null!; + + public bool ValueQueryIsStoredProcedure { get; set; } + + [StringLength(200)] + public string? ValueFormatString { get; set; } + + [Column("ValueReportID")] + public int ValueReportId { get; set; } + + [Column("ValueGUID")] + public Guid ValueGuid { get; set; } + + public DateTime ValueLastModified { get; set; } + + public string? ValueSettings { get; set; } + + [StringLength(100)] + public string? ValueConnectionString { get; set; } + + [InverseProperty("ReportSubscriptionValue")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [ForeignKey("ValueReportId")] + [InverseProperty("ReportingReportValues")] + public virtual ReportingReport ValueReport { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ReportingSavedGraph.cs b/Migration.Tool.KX13/Models/ReportingSavedGraph.cs new file mode 100644 index 00000000..599a8c63 --- /dev/null +++ b/Migration.Tool.KX13/Models/ReportingSavedGraph.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Reporting_SavedGraph")] +[Index("SavedGraphGuid", Name = "IX_Reporting_SavedGraph_SavedGraphGUID")] +[Index("SavedGraphSavedReportId", Name = "IX_Reporting_SavedGraph_SavedGraphSavedReportID")] +public class ReportingSavedGraph +{ + [Key] + [Column("SavedGraphID")] + public int SavedGraphId { get; set; } + + [Column("SavedGraphSavedReportID")] + public int SavedGraphSavedReportId { get; set; } + + [Column("SavedGraphGUID")] + public Guid SavedGraphGuid { get; set; } + + public byte[] SavedGraphBinary { get; set; } = null!; + + [StringLength(100)] + public string SavedGraphMimeType { get; set; } = null!; + + public DateTime SavedGraphLastModified { get; set; } + + [ForeignKey("SavedGraphSavedReportId")] + [InverseProperty("ReportingSavedGraphs")] + public virtual ReportingSavedReport SavedGraphSavedReport { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ReportingSavedReport.cs b/Migration.Tool.KX13/Models/ReportingSavedReport.cs new file mode 100644 index 00000000..3f41ad72 --- /dev/null +++ b/Migration.Tool.KX13/Models/ReportingSavedReport.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Reporting_SavedReport")] +[Index("SavedReportCreatedByUserId", Name = "IX_Reporting_SavedReport_SavedReportCreatedByUserID")] +public class ReportingSavedReport +{ + [Key] + [Column("SavedReportID")] + public int SavedReportId { get; set; } + + [Column("SavedReportReportID")] + public int SavedReportReportId { get; set; } + + [Column("SavedReportGUID")] + public Guid SavedReportGuid { get; set; } + + [StringLength(200)] + public string? SavedReportTitle { get; set; } + + public DateTime SavedReportDate { get; set; } + + [Column("SavedReportHTML")] + public string SavedReportHtml { get; set; } = null!; + + public string SavedReportParameters { get; set; } = null!; + + [Column("SavedReportCreatedByUserID")] + public int? SavedReportCreatedByUserId { get; set; } + + public DateTime SavedReportLastModified { get; set; } + + [InverseProperty("SavedGraphSavedReport")] + public virtual ICollection ReportingSavedGraphs { get; set; } = new List(); + + [ForeignKey("SavedReportCreatedByUserId")] + [InverseProperty("ReportingSavedReports")] + public virtual CmsUser? SavedReportCreatedByUser { get; set; } + + [ForeignKey("SavedReportReportId")] + [InverseProperty("ReportingSavedReports")] + public virtual ReportingReport SavedReportReport { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/SharePointSharePointConnection.cs b/Migration.Tool.KX13/Models/SharePointSharePointConnection.cs new file mode 100644 index 00000000..28ea9059 --- /dev/null +++ b/Migration.Tool.KX13/Models/SharePointSharePointConnection.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SharePoint_SharePointConnection")] +[Index("SharePointConnectionSiteId", Name = "IX_SharePoint_SharePointConnection_SharePointConnectionSiteID")] +public class SharePointSharePointConnection +{ + [Key] + [Column("SharePointConnectionID")] + public int SharePointConnectionId { get; set; } + + [Column("SharePointConnectionGUID")] + public Guid SharePointConnectionGuid { get; set; } + + [Column("SharePointConnectionSiteID")] + public int SharePointConnectionSiteId { get; set; } + + [StringLength(512)] + public string SharePointConnectionSiteUrl { get; set; } = null!; + + [StringLength(100)] + public string SharePointConnectionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string SharePointConnectionName { get; set; } = null!; + + [StringLength(100)] + public string? SharePointConnectionUserName { get; set; } + + [StringLength(100)] + public string? SharePointConnectionPassword { get; set; } + + public DateTime SharePointConnectionLastModified { get; set; } + + [ForeignKey("SharePointConnectionSiteId")] + [InverseProperty("SharePointSharePointConnections")] + public virtual CmsSite SharePointConnectionSite { get; set; } = null!; + + [InverseProperty("SharePointLibrarySharePointConnection")] + public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/SharePointSharePointFile.cs b/Migration.Tool.KX13/Models/SharePointSharePointFile.cs new file mode 100644 index 00000000..2ea2e33e --- /dev/null +++ b/Migration.Tool.KX13/Models/SharePointSharePointFile.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SharePoint_SharePointFile")] +[Index("SharePointFileSiteId", Name = "IX_SharePoint_SharePointFile_SharePointFileSiteID")] +[Index("SharePointFileSharePointLibraryId", "SharePointFileServerRelativeUrl", Name = "UQ_SharePoint_SharePointFile_LibraryID_ServerRelativeURL", IsUnique = true)] +public class SharePointSharePointFile +{ + [Key] + [Column("SharePointFileID")] + public int SharePointFileId { get; set; } + + [Column("SharePointFileGUID")] + public Guid SharePointFileGuid { get; set; } + + [Column("SharePointFileSiteID")] + public int SharePointFileSiteId { get; set; } + + [StringLength(150)] + public string SharePointFileName { get; set; } = null!; + + [StringLength(150)] + public string? SharePointFileExtension { get; set; } + + [StringLength(255)] + public string? SharePointFileMimeType { get; set; } + + [Column("SharePointFileETag")] + [StringLength(255)] + public string? SharePointFileEtag { get; set; } + + public long SharePointFileSize { get; set; } + + public DateTime SharePointFileServerLastModified { get; set; } + + [Column("SharePointFileServerRelativeURL")] + [StringLength(300)] + public string SharePointFileServerRelativeUrl { get; set; } = null!; + + [Column("SharePointFileSharePointLibraryID")] + public int SharePointFileSharePointLibraryId { get; set; } + + public byte[]? SharePointFileBinary { get; set; } + + [ForeignKey("SharePointFileSharePointLibraryId")] + [InverseProperty("SharePointSharePointFiles")] + public virtual SharePointSharePointLibrary SharePointFileSharePointLibrary { get; set; } = null!; + + [ForeignKey("SharePointFileSiteId")] + [InverseProperty("SharePointSharePointFiles")] + public virtual CmsSite SharePointFileSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/SharePointSharePointLibrary.cs b/Migration.Tool.KX13/Models/SharePointSharePointLibrary.cs new file mode 100644 index 00000000..6d80dce8 --- /dev/null +++ b/Migration.Tool.KX13/Models/SharePointSharePointLibrary.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SharePoint_SharePointLibrary")] +[Index("SharePointLibrarySharePointConnectionId", Name = "IX_SharePoint_SharePointLibrary_SharePointLibrarySharepointConnectionID")] +[Index("SharePointLibrarySiteId", Name = "IX_SharePoint_SharePointLibrary_SharePointlibrarySiteID")] +public class SharePointSharePointLibrary +{ + [Key] + [Column("SharePointLibraryID")] + public int SharePointLibraryId { get; set; } + + [StringLength(100)] + public string SharePointLibraryName { get; set; } = null!; + + [Column("SharePointLibrarySharePointConnectionID")] + public int? SharePointLibrarySharePointConnectionId { get; set; } + + [StringLength(100)] + public string SharePointLibraryListTitle { get; set; } = null!; + + public int SharePointLibrarySynchronizationPeriod { get; set; } + + [Column("SharePointLibraryGUID")] + public Guid SharePointLibraryGuid { get; set; } + + [Column("SharePointLibrarySiteID")] + public int SharePointLibrarySiteId { get; set; } + + [StringLength(100)] + public string SharePointLibraryDisplayName { get; set; } = null!; + + public DateTime SharePointLibraryLastModified { get; set; } + + public int SharePointLibraryListType { get; set; } + + [ForeignKey("SharePointLibrarySharePointConnectionId")] + [InverseProperty("SharePointSharePointLibraries")] + public virtual SharePointSharePointConnection? SharePointLibrarySharePointConnection { get; set; } + + [ForeignKey("SharePointLibrarySiteId")] + [InverseProperty("SharePointSharePointLibraries")] + public virtual CmsSite SharePointLibrarySite { get; set; } = null!; + + [InverseProperty("SharePointFileSharePointLibrary")] + public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/SmFacebookAccount.cs b/Migration.Tool.KX13/Models/SmFacebookAccount.cs new file mode 100644 index 00000000..b7ffe47a --- /dev/null +++ b/Migration.Tool.KX13/Models/SmFacebookAccount.cs @@ -0,0 +1,54 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_FacebookAccount")] +[Index("FacebookAccountFacebookApplicationId", Name = "IX_SM_FacebookAccount_FacebookAccountFacebookApplicationID")] +[Index("FacebookAccountSiteId", Name = "IX_SM_FacebookAccount_FacebookAccountSiteID")] +public class SmFacebookAccount +{ + [Key] + [Column("FacebookAccountID")] + public int FacebookAccountId { get; set; } + + [Column("FacebookAccountGUID")] + public Guid FacebookAccountGuid { get; set; } + + public DateTime FacebookAccountLastModified { get; set; } + + [Column("FacebookAccountSiteID")] + public int FacebookAccountSiteId { get; set; } + + [StringLength(200)] + public string FacebookAccountName { get; set; } = null!; + + [StringLength(200)] + public string FacebookAccountDisplayName { get; set; } = null!; + + [Column("FacebookAccountPageID")] + [StringLength(500)] + public string FacebookAccountPageId { get; set; } = null!; + + public string FacebookAccountPageAccessToken { get; set; } = null!; + + [Column("FacebookAccountFacebookApplicationID")] + public int FacebookAccountFacebookApplicationId { get; set; } + + public DateTime? FacebookAccountPageAccessTokenExpiration { get; set; } + + public bool? FacebookAccountIsDefault { get; set; } + + [ForeignKey("FacebookAccountFacebookApplicationId")] + [InverseProperty("SmFacebookAccounts")] + public virtual SmFacebookApplication FacebookAccountFacebookApplication { get; set; } = null!; + + [ForeignKey("FacebookAccountSiteId")] + [InverseProperty("SmFacebookAccounts")] + public virtual CmsSite FacebookAccountSite { get; set; } = null!; + + [InverseProperty("FacebookPostFacebookAccount")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/SmFacebookApplication.cs b/Migration.Tool.KX13/Models/SmFacebookApplication.cs new file mode 100644 index 00000000..00d4b794 --- /dev/null +++ b/Migration.Tool.KX13/Models/SmFacebookApplication.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_FacebookApplication")] +[Index("FacebookApplicationSiteId", Name = "IX_SM_FacebookApplication_FacebookApplicationSiteID")] +public class SmFacebookApplication +{ + [Key] + [Column("FacebookApplicationID")] + public int FacebookApplicationId { get; set; } + + [StringLength(500)] + public string FacebookApplicationConsumerKey { get; set; } = null!; + + [StringLength(500)] + public string FacebookApplicationConsumerSecret { get; set; } = null!; + + [StringLength(200)] + public string FacebookApplicationName { get; set; } = null!; + + [StringLength(200)] + public string FacebookApplicationDisplayName { get; set; } = null!; + + [Column("FacebookApplicationGUID")] + public Guid FacebookApplicationGuid { get; set; } + + public DateTime FacebookApplicationLastModified { get; set; } + + [Column("FacebookApplicationSiteID")] + public int FacebookApplicationSiteId { get; set; } + + [ForeignKey("FacebookApplicationSiteId")] + [InverseProperty("SmFacebookApplications")] + public virtual CmsSite FacebookApplicationSite { get; set; } = null!; + + [InverseProperty("FacebookAccountFacebookApplication")] + public virtual ICollection SmFacebookAccounts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/SmFacebookPost.cs b/Migration.Tool.KX13/Models/SmFacebookPost.cs new file mode 100644 index 00000000..c6184053 --- /dev/null +++ b/Migration.Tool.KX13/Models/SmFacebookPost.cs @@ -0,0 +1,88 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_FacebookPost")] +[Index("FacebookPostCampaignId", Name = "IX_SM_FacebookPost_FacebookPostCampaignID")] +[Index("FacebookPostFacebookAccountId", Name = "IX_SM_FacebookPost_FacebookPostFacebookAccountID")] +[Index("FacebookPostSiteId", Name = "IX_SM_FacebookPost_FacebookPostSiteID")] +public class SmFacebookPost +{ + [Key] + [Column("FacebookPostID")] + public int FacebookPostId { get; set; } + + [Column("FacebookPostGUID")] + public Guid FacebookPostGuid { get; set; } + + public DateTime FacebookPostLastModified { get; set; } + + [Column("FacebookPostSiteID")] + public int FacebookPostSiteId { get; set; } + + [Column("FacebookPostFacebookAccountID")] + public int FacebookPostFacebookAccountId { get; set; } + + public string FacebookPostText { get; set; } = null!; + + [Column("FacebookPostURLShortenerType")] + public int? FacebookPostUrlshortenerType { get; set; } + + public int? FacebookPostErrorCode { get; set; } + + public int? FacebookPostErrorSubcode { get; set; } + + [Column("FacebookPostExternalID")] + public string? FacebookPostExternalId { get; set; } + + public DateTime? FacebookPostPublishedDateTime { get; set; } + + public DateTime? FacebookPostScheduledPublishDateTime { get; set; } + + [Column("FacebookPostCampaignID")] + public int? FacebookPostCampaignId { get; set; } + + public bool? FacebookPostPostAfterDocumentPublish { get; set; } + + public int? FacebookPostInsightPeopleReached { get; set; } + + public int? FacebookPostInsightLikesFromPage { get; set; } + + public int? FacebookPostInsightCommentsFromPage { get; set; } + + public int? FacebookPostInsightSharesFromPage { get; set; } + + public int? FacebookPostInsightLikesTotal { get; set; } + + public int? FacebookPostInsightCommentsTotal { get; set; } + + public int? FacebookPostInsightNegativeHidePost { get; set; } + + public int? FacebookPostInsightNegativeHideAllPosts { get; set; } + + public int? FacebookPostInsightNegativeReportSpam { get; set; } + + public int? FacebookPostInsightNegativeUnlikePage { get; set; } + + public DateTime? FacebookPostInsightsLastUpdated { get; set; } + + [Column("FacebookPostDocumentGUID")] + public Guid? FacebookPostDocumentGuid { get; set; } + + public bool? FacebookPostIsCreatedByUser { get; set; } + + [ForeignKey("FacebookPostCampaignId")] + [InverseProperty("SmFacebookPosts")] + public virtual AnalyticsCampaign? FacebookPostCampaign { get; set; } + + [ForeignKey("FacebookPostFacebookAccountId")] + [InverseProperty("SmFacebookPosts")] + public virtual SmFacebookAccount FacebookPostFacebookAccount { get; set; } = null!; + + [ForeignKey("FacebookPostSiteId")] + [InverseProperty("SmFacebookPosts")] + public virtual CmsSite FacebookPostSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/SmInsight.cs b/Migration.Tool.KX13/Models/SmInsight.cs new file mode 100644 index 00000000..766f4727 --- /dev/null +++ b/Migration.Tool.KX13/Models/SmInsight.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_Insight")] +[Index("InsightCodeName", "InsightPeriodType", Name = "IX_SM_Insight_InsightCodeName_InsightPeriodType")] +public class SmInsight +{ + [Key] + [Column("InsightID")] + public int InsightId { get; set; } + + [StringLength(200)] + public string InsightCodeName { get; set; } = null!; + + [Column("InsightExternalID")] + public string InsightExternalId { get; set; } = null!; + + [StringLength(20)] + public string InsightPeriodType { get; set; } = null!; + + public string? InsightValueName { get; set; } + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitDays { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitMonths { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitWeeks { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitYears { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/SmInsightHitDay.cs b/Migration.Tool.KX13/Models/SmInsightHitDay.cs new file mode 100644 index 00000000..73129b4e --- /dev/null +++ b/Migration.Tool.KX13/Models/SmInsightHitDay.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_InsightHit_Day")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Day_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitDay +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitDays")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/SmInsightHitMonth.cs b/Migration.Tool.KX13/Models/SmInsightHitMonth.cs new file mode 100644 index 00000000..fa390df0 --- /dev/null +++ b/Migration.Tool.KX13/Models/SmInsightHitMonth.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_InsightHit_Month")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Month_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitMonth +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitMonths")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/SmInsightHitWeek.cs b/Migration.Tool.KX13/Models/SmInsightHitWeek.cs new file mode 100644 index 00000000..51ef6808 --- /dev/null +++ b/Migration.Tool.KX13/Models/SmInsightHitWeek.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_InsightHit_Week")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Week_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitWeek +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitWeeks")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/SmInsightHitYear.cs b/Migration.Tool.KX13/Models/SmInsightHitYear.cs new file mode 100644 index 00000000..a6225951 --- /dev/null +++ b/Migration.Tool.KX13/Models/SmInsightHitYear.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_InsightHit_Year")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Year_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitYear +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitYears")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/SmLinkedInAccount.cs b/Migration.Tool.KX13/Models/SmLinkedInAccount.cs new file mode 100644 index 00000000..012b384e --- /dev/null +++ b/Migration.Tool.KX13/Models/SmLinkedInAccount.cs @@ -0,0 +1,46 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_LinkedInAccount")] +public class SmLinkedInAccount +{ + [Key] + [Column("LinkedInAccountID")] + public int LinkedInAccountId { get; set; } + + [StringLength(200)] + public string LinkedInAccountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string LinkedInAccountName { get; set; } = null!; + + public bool? LinkedInAccountIsDefault { get; set; } + + [StringLength(500)] + public string LinkedInAccountAccessToken { get; set; } = null!; + + public DateTime LinkedInAccountLastModified { get; set; } + + [Column("LinkedInAccountGUID")] + public Guid LinkedInAccountGuid { get; set; } + + [Column("LinkedInAccountSiteID")] + public int LinkedInAccountSiteId { get; set; } + + [Column("LinkedInAccountProfileID")] + [StringLength(50)] + public string LinkedInAccountProfileId { get; set; } = null!; + + [Column("LinkedInAccountLinkedInApplicationID")] + public int LinkedInAccountLinkedInApplicationId { get; set; } + + [StringLength(200)] + public string? LinkedInAccountProfileName { get; set; } + + public DateTime? LinkedInAccountAccessTokenExpiration { get; set; } + + [InverseProperty("LinkedInPostLinkedInAccount")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/SmLinkedInApplication.cs b/Migration.Tool.KX13/Models/SmLinkedInApplication.cs new file mode 100644 index 00000000..08d86b5b --- /dev/null +++ b/Migration.Tool.KX13/Models/SmLinkedInApplication.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_LinkedInApplication")] +[Index("LinkedInApplicationSiteId", Name = "IX_SM_LinkedInApplication_LinkedInApplicationSiteID")] +public class SmLinkedInApplication +{ + [Key] + [Column("LinkedInApplicationID")] + public int LinkedInApplicationId { get; set; } + + [StringLength(200)] + public string LinkedInApplicationDisplayName { get; set; } = null!; + + [StringLength(200)] + public string LinkedInApplicationName { get; set; } = null!; + + [StringLength(500)] + public string LinkedInApplicationConsumerSecret { get; set; } = null!; + + [StringLength(500)] + public string LinkedInApplicationConsumerKey { get; set; } = null!; + + public DateTime LinkedInApplicationLastModified { get; set; } + + [Column("LinkedInApplicationGUID")] + public Guid LinkedInApplicationGuid { get; set; } + + [Column("LinkedInApplicationSiteID")] + public int LinkedInApplicationSiteId { get; set; } + + [ForeignKey("LinkedInApplicationSiteId")] + [InverseProperty("SmLinkedInApplications")] + public virtual CmsSite LinkedInApplicationSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/SmLinkedInPost.cs b/Migration.Tool.KX13/Models/SmLinkedInPost.cs new file mode 100644 index 00000000..f437ab1b --- /dev/null +++ b/Migration.Tool.KX13/Models/SmLinkedInPost.cs @@ -0,0 +1,84 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_LinkedInPost")] +[Index("LinkedInPostCampaignId", Name = "IX_SM_LinkedInPost_LinkedInPostCampaignID")] +[Index("LinkedInPostLinkedInAccountId", Name = "IX_SM_LinkedInPost_LinkedInPostLinkedInAccountID")] +[Index("LinkedInPostSiteId", Name = "IX_SM_LinkedInPost_LinkedInPostSiteID")] +public class SmLinkedInPost +{ + [Key] + [Column("LinkedInPostID")] + public int LinkedInPostId { get; set; } + + [Column("LinkedInPostLinkedInAccountID")] + public int LinkedInPostLinkedInAccountId { get; set; } + + [StringLength(700)] + public string LinkedInPostComment { get; set; } = null!; + + [Column("LinkedInPostSiteID")] + public int LinkedInPostSiteId { get; set; } + + [Column("LinkedInPostGUID")] + public Guid LinkedInPostGuid { get; set; } + + public DateTime? LinkedInPostLastModified { get; set; } + + [StringLength(200)] + public string? LinkedInPostUpdateKey { get; set; } + + [Column("LinkedInPostURLShortenerType")] + public int? LinkedInPostUrlshortenerType { get; set; } + + public DateTime? LinkedInPostScheduledPublishDateTime { get; set; } + + [Column("LinkedInPostCampaignID")] + public int? LinkedInPostCampaignId { get; set; } + + public DateTime? LinkedInPostPublishedDateTime { get; set; } + + [Column("LinkedInPostHTTPStatusCode")] + public int? LinkedInPostHttpstatusCode { get; set; } + + public int? LinkedInPostErrorCode { get; set; } + + public string? LinkedInPostErrorMessage { get; set; } + + [Column("LinkedInPostDocumentGUID")] + public Guid? LinkedInPostDocumentGuid { get; set; } + + public bool? LinkedInPostIsCreatedByUser { get; set; } + + public bool? LinkedInPostPostAfterDocumentPublish { get; set; } + + public DateTime? LinkedInPostInsightsLastUpdated { get; set; } + + public int? LinkedInPostCommentCount { get; set; } + + public int? LinkedInPostImpressionCount { get; set; } + + public int? LinkedInPostLikeCount { get; set; } + + public int? LinkedInPostShareCount { get; set; } + + public int? LinkedInPostClickCount { get; set; } + + public double? LinkedInPostEngagement { get; set; } + + [ForeignKey("LinkedInPostCampaignId")] + [InverseProperty("SmLinkedInPosts")] + public virtual AnalyticsCampaign? LinkedInPostCampaign { get; set; } + + [ForeignKey("LinkedInPostLinkedInAccountId")] + [InverseProperty("SmLinkedInPosts")] + public virtual SmLinkedInAccount LinkedInPostLinkedInAccount { get; set; } = null!; + + [ForeignKey("LinkedInPostSiteId")] + [InverseProperty("SmLinkedInPosts")] + public virtual CmsSite LinkedInPostSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/SmTwitterAccount.cs b/Migration.Tool.KX13/Models/SmTwitterAccount.cs new file mode 100644 index 00000000..ef1da7a8 --- /dev/null +++ b/Migration.Tool.KX13/Models/SmTwitterAccount.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_TwitterAccount")] +[Index("TwitterAccountSiteId", Name = "IX_SM_TwitterAccount_TwitterAccountSiteID")] +[Index("TwitterAccountTwitterApplicationId", Name = "IX_SM_TwitterAccount_TwitterAccountTwitterApplicationID")] +public class SmTwitterAccount +{ + [Key] + [Column("TwitterAccountID")] + public int TwitterAccountId { get; set; } + + [StringLength(200)] + public string TwitterAccountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TwitterAccountName { get; set; } = null!; + + public DateTime TwitterAccountLastModified { get; set; } + + [Column("TwitterAccountGUID")] + public Guid TwitterAccountGuid { get; set; } + + [Column("TwitterAccountSiteID")] + public int TwitterAccountSiteId { get; set; } + + [StringLength(500)] + public string TwitterAccountAccessToken { get; set; } = null!; + + [StringLength(500)] + public string TwitterAccountAccessTokenSecret { get; set; } = null!; + + [Column("TwitterAccountTwitterApplicationID")] + public int TwitterAccountTwitterApplicationId { get; set; } + + public int? TwitterAccountFollowers { get; set; } + + public int? TwitterAccountMentions { get; set; } + + [StringLength(40)] + public string? TwitterAccountMentionsRange { get; set; } + + [Column("TwitterAccountUserID")] + [StringLength(20)] + public string? TwitterAccountUserId { get; set; } + + public bool? TwitterAccountIsDefault { get; set; } + + [InverseProperty("TwitterPostTwitterAccount")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); + + [ForeignKey("TwitterAccountSiteId")] + [InverseProperty("SmTwitterAccounts")] + public virtual CmsSite TwitterAccountSite { get; set; } = null!; + + [ForeignKey("TwitterAccountTwitterApplicationId")] + [InverseProperty("SmTwitterAccounts")] + public virtual SmTwitterApplication TwitterAccountTwitterApplication { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/SmTwitterApplication.cs b/Migration.Tool.KX13/Models/SmTwitterApplication.cs new file mode 100644 index 00000000..2cfde9de --- /dev/null +++ b/Migration.Tool.KX13/Models/SmTwitterApplication.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_TwitterApplication")] +[Index("TwitterApplicationSiteId", Name = "IX_SM_TwitterApplication_TwitterApplicationSiteID")] +public class SmTwitterApplication +{ + [Key] + [Column("TwitterApplicationID")] + public int TwitterApplicationId { get; set; } + + [StringLength(200)] + public string TwitterApplicationDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TwitterApplicationName { get; set; } = null!; + + public DateTime TwitterApplicationLastModified { get; set; } + + [Column("TwitterApplicationGUID")] + public Guid TwitterApplicationGuid { get; set; } + + [Column("TwitterApplicationSiteID")] + public int TwitterApplicationSiteId { get; set; } + + [StringLength(500)] + public string TwitterApplicationConsumerKey { get; set; } = null!; + + [StringLength(500)] + public string TwitterApplicationConsumerSecret { get; set; } = null!; + + [InverseProperty("TwitterAccountTwitterApplication")] + public virtual ICollection SmTwitterAccounts { get; set; } = new List(); + + [ForeignKey("TwitterApplicationSiteId")] + [InverseProperty("SmTwitterApplications")] + public virtual CmsSite TwitterApplicationSite { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/SmTwitterPost.cs b/Migration.Tool.KX13/Models/SmTwitterPost.cs new file mode 100644 index 00000000..acd47a0f --- /dev/null +++ b/Migration.Tool.KX13/Models/SmTwitterPost.cs @@ -0,0 +1,70 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("SM_TwitterPost")] +[Index("TwitterPostCampaignId", Name = "IX_SM_TwitterPost_TwitterPostCampaignID")] +[Index("TwitterPostSiteId", Name = "IX_SM_TwitterPost_TwitterPostSiteID")] +[Index("TwitterPostTwitterAccountId", Name = "IX_SM_TwitterPost_TwitterPostTwitterAccountID")] +public class SmTwitterPost +{ + [Key] + [Column("TwitterPostID")] + public int TwitterPostId { get; set; } + + [Column("TwitterPostGUID")] + public Guid TwitterPostGuid { get; set; } + + public DateTime TwitterPostLastModified { get; set; } + + [Column("TwitterPostSiteID")] + public int TwitterPostSiteId { get; set; } + + [Column("TwitterPostTwitterAccountID")] + public int TwitterPostTwitterAccountId { get; set; } + + public string TwitterPostText { get; set; } = null!; + + [Column("TwitterPostURLShortenerType")] + public int? TwitterPostUrlshortenerType { get; set; } + + [Column("TwitterPostExternalID")] + public string? TwitterPostExternalId { get; set; } + + public int? TwitterPostErrorCode { get; set; } + + public DateTime? TwitterPostPublishedDateTime { get; set; } + + public DateTime? TwitterPostScheduledPublishDateTime { get; set; } + + [Column("TwitterPostCampaignID")] + public int? TwitterPostCampaignId { get; set; } + + public int? TwitterPostFavorites { get; set; } + + public int? TwitterPostRetweets { get; set; } + + public bool? TwitterPostPostAfterDocumentPublish { get; set; } + + public DateTime? TwitterPostInsightsUpdateDateTime { get; set; } + + [Column("TwitterPostDocumentGUID")] + public Guid? TwitterPostDocumentGuid { get; set; } + + public bool? TwitterPostIsCreatedByUser { get; set; } + + [ForeignKey("TwitterPostCampaignId")] + [InverseProperty("SmTwitterPosts")] + public virtual AnalyticsCampaign? TwitterPostCampaign { get; set; } + + [ForeignKey("TwitterPostSiteId")] + [InverseProperty("SmTwitterPosts")] + public virtual CmsSite TwitterPostSite { get; set; } = null!; + + [ForeignKey("TwitterPostTwitterAccountId")] + [InverseProperty("SmTwitterPosts")] + public virtual SmTwitterAccount TwitterPostTwitterAccount { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/StagingServer.cs b/Migration.Tool.KX13/Models/StagingServer.cs new file mode 100644 index 00000000..729f60fc --- /dev/null +++ b/Migration.Tool.KX13/Models/StagingServer.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Staging_Server")] +[Index("ServerEnabled", Name = "IX_Staging_Server_ServerEnabled")] +[Index("ServerSiteId", Name = "IX_Staging_Server_ServerSiteID")] +public class StagingServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(100)] + public string ServerName { get; set; } = null!; + + [StringLength(440)] + public string ServerDisplayName { get; set; } = null!; + + [Column("ServerSiteID")] + public int ServerSiteId { get; set; } + + [Column("ServerURL")] + [StringLength(450)] + public string ServerUrl { get; set; } = null!; + + [Required] + public bool? ServerEnabled { get; set; } + + [StringLength(20)] + public string ServerAuthentication { get; set; } = null!; + + [StringLength(100)] + public string? ServerUsername { get; set; } + + [StringLength(100)] + public string? ServerPassword { get; set; } + + [Column("ServerX509ClientKeyID")] + [StringLength(200)] + public string? ServerX509clientKeyId { get; set; } + + [Column("ServerX509ServerKeyID")] + [StringLength(200)] + public string? ServerX509serverKeyId { get; set; } + + [Column("ServerGUID")] + public Guid ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + [ForeignKey("ServerSiteId")] + [InverseProperty("StagingServers")] + public virtual CmsSite ServerSite { get; set; } = null!; + + [InverseProperty("SynchronizationServer")] + public virtual ICollection StagingSynchronizations { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/StagingSynchronization.cs b/Migration.Tool.KX13/Models/StagingSynchronization.cs new file mode 100644 index 00000000..a7ed563c --- /dev/null +++ b/Migration.Tool.KX13/Models/StagingSynchronization.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Staging_Synchronization")] +[Index("SynchronizationServerId", Name = "IX_Staging_Synchronization_SynchronizationServerID")] +[Index("SynchronizationTaskId", Name = "IX_Staging_Synchronization_SynchronizationTaskID")] +public class StagingSynchronization +{ + [Key] + [Column("SynchronizationID")] + public int SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int SynchronizationTaskId { get; set; } + + [Column("SynchronizationServerID")] + public int SynchronizationServerId { get; set; } + + public DateTime? SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + [ForeignKey("SynchronizationServerId")] + [InverseProperty("StagingSynchronizations")] + public virtual StagingServer SynchronizationServer { get; set; } = null!; + + [ForeignKey("SynchronizationTaskId")] + [InverseProperty("StagingSynchronizations")] + public virtual StagingTask SynchronizationTask { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/StagingTask.cs b/Migration.Tool.KX13/Models/StagingTask.cs new file mode 100644 index 00000000..4d33a537 --- /dev/null +++ b/Migration.Tool.KX13/Models/StagingTask.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Staging_Task")] +[Index("TaskDocumentId", "TaskNodeId", "TaskRunning", Name = "IX_Staging_Task_TaskDocumentID_TaskNodeID_TaskRunning")] +[Index("TaskObjectType", "TaskObjectId", "TaskRunning", Name = "IX_Staging_Task_TaskObjectType_TaskObjectID_TaskRunning")] +[Index("TaskSiteId", Name = "IX_Staging_Task_TaskSiteID")] +[Index("TaskType", Name = "IX_Staging_Task_TaskType")] +public class StagingTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + [StringLength(450)] + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool? TaskRunning { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + public string? TaskServers { get; set; } + + [InverseProperty("SynchronizationTask")] + public virtual ICollection StagingSynchronizations { get; set; } = new List(); + + [InverseProperty("Task")] + public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); + + [InverseProperty("Task")] + public virtual ICollection StagingTaskUsers { get; set; } = new List(); + + [ForeignKey("TaskSiteId")] + [InverseProperty("StagingTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Tool.KX13/Models/StagingTaskGroup.cs b/Migration.Tool.KX13/Models/StagingTaskGroup.cs new file mode 100644 index 00000000..788a2bea --- /dev/null +++ b/Migration.Tool.KX13/Models/StagingTaskGroup.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("staging_TaskGroup")] +public class StagingTaskGroup +{ + [Key] + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [StringLength(50)] + public string TaskGroupCodeName { get; set; } = null!; + + public Guid TaskGroupGuid { get; set; } + + public string? TaskGroupDescription { get; set; } + + [InverseProperty("TaskGroup")] + public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); + + [InverseProperty("TaskGroup")] + public virtual ICollection StagingTaskGroupUsers { get; set; } = new List(); +} diff --git a/Migration.Tool.KX13/Models/StagingTaskGroupTask.cs b/Migration.Tool.KX13/Models/StagingTaskGroupTask.cs new file mode 100644 index 00000000..2e37eba3 --- /dev/null +++ b/Migration.Tool.KX13/Models/StagingTaskGroupTask.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("staging_TaskGroupTask")] +[Index("TaskGroupId", Name = "IX_Staging_TaskGroupTask_TaskGroupID")] +[Index("TaskId", Name = "IX_Staging_TaskGroupTask_TaskID")] +public class StagingTaskGroupTask +{ + [Key] + [Column("TaskGroupTaskID")] + public int TaskGroupTaskId { get; set; } + + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [ForeignKey("TaskId")] + [InverseProperty("StagingTaskGroupTasks")] + public virtual StagingTask Task { get; set; } = null!; + + [ForeignKey("TaskGroupId")] + [InverseProperty("StagingTaskGroupTasks")] + public virtual StagingTaskGroup TaskGroup { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/StagingTaskGroupUser.cs b/Migration.Tool.KX13/Models/StagingTaskGroupUser.cs new file mode 100644 index 00000000..d85a5706 --- /dev/null +++ b/Migration.Tool.KX13/Models/StagingTaskGroupUser.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("staging_TaskGroupUser")] +[Index("TaskGroupId", Name = "IX_Staging_TaskGroupUser_TaskGroup_ID")] +[Index("UserId", Name = "IX_Staging_TaskGroupUser_UserID", IsUnique = true)] +public class StagingTaskGroupUser +{ + [Key] + [Column("TaskGroupUserID")] + public int TaskGroupUserId { get; set; } + + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("TaskGroupId")] + [InverseProperty("StagingTaskGroupUsers")] + public virtual StagingTaskGroup TaskGroup { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("StagingTaskGroupUser")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/StagingTaskUser.cs b/Migration.Tool.KX13/Models/StagingTaskUser.cs new file mode 100644 index 00000000..30a85d40 --- /dev/null +++ b/Migration.Tool.KX13/Models/StagingTaskUser.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Table("Staging_TaskUser")] +[Index("TaskId", Name = "IX_Staging_TaskUser_TaskID")] +[Index("UserId", Name = "IX_Staging_TaskUser_UserID")] +public class StagingTaskUser +{ + [Key] + [Column("TaskUserID")] + public int TaskUserId { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("TaskId")] + [InverseProperty("StagingTaskUsers")] + public virtual StagingTask Task { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("StagingTaskUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/TempFile.cs b/Migration.Tool.KX13/Models/TempFile.cs new file mode 100644 index 00000000..c53fe703 --- /dev/null +++ b/Migration.Tool.KX13/Models/TempFile.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("Temp_File")] +public class TempFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileParentGUID")] + public Guid FileParentGuid { get; set; } + + public int FileNumber { get; set; } + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + public long FileSize { get; set; } + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + public byte[]? FileBinary { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + public DateTime FileLastModified { get; set; } + + [StringLength(200)] + public string FileDirectory { get; set; } = null!; + + [StringLength(200)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string? FileTitle { get; set; } + + public string? FileDescription { get; set; } +} diff --git a/Migration.Tool.KX13/Models/TempPageBuilderWidget.cs b/Migration.Tool.KX13/Models/TempPageBuilderWidget.cs new file mode 100644 index 00000000..5c425375 --- /dev/null +++ b/Migration.Tool.KX13/Models/TempPageBuilderWidget.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KX13.Models; + +[Table("Temp_PageBuilderWidgets")] +public class TempPageBuilderWidget +{ + [Key] + [Column("PageBuilderWidgetsID")] + public int PageBuilderWidgetsId { get; set; } + + public string? PageBuilderWidgetsConfiguration { get; set; } + + public Guid PageBuilderWidgetsGuid { get; set; } + + public DateTime PageBuilderWidgetsLastModified { get; set; } + + public string? PageBuilderTemplateConfiguration { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsAclitemItemsAndOperator.cs b/Migration.Tool.KX13/Models/ViewCmsAclitemItemsAndOperator.cs new file mode 100644 index 00000000..62bc9ce2 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsAclitemItemsAndOperator.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsAclitemItemsAndOperator +{ + [Column("ACLOwnerNodeID")] + public int AclownerNodeId { get; set; } + + [Column("ACLItemID")] + public int AclitemId { get; set; } + + public int Allowed { get; set; } + + public int Denied { get; set; } + + [StringLength(51)] + public string? Operator { get; set; } + + [StringLength(100)] + public string? OperatorName { get; set; } + + [Column("ACLID")] + public int Aclid { get; set; } + + [StringLength(450)] + public string? OperatorFullName { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [Column("RoleID")] + public int? RoleId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs b/Migration.Tool.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs new file mode 100644 index 00000000..34a87c1c --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs @@ -0,0 +1,121 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsObjectVersionHistoryUserJoined +{ + [Column("VersionID")] + public int VersionId { get; set; } + + [Column("VersionObjectID")] + public int? VersionObjectId { get; set; } + + [StringLength(100)] + public string VersionObjectType { get; set; } = null!; + + [Column("VersionObjectSiteID")] + public int? VersionObjectSiteId { get; set; } + + [StringLength(450)] + public string VersionObjectDisplayName { get; set; } = null!; + + [Column("VersionXML")] + public string VersionXml { get; set; } = null!; + + [Column("VersionBinaryDataXML")] + public string? VersionBinaryDataXml { get; set; } + + [Column("VersionModifiedByUserID")] + public int? VersionModifiedByUserId { get; set; } + + public DateTime VersionModifiedWhen { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [StringLength(50)] + public string VersionNumber { get; set; } = null!; + + [Column("VersionSiteBindingIDs")] + public string? VersionSiteBindingIds { get; set; } + + public string? VersionComment { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(100)] + public string? UserName { get; set; } + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string? UserPassword { get; set; } + + [StringLength(50)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(50)] + public string? PreferredUicultureCode { get; set; } + + public bool? UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid? UserGuid { get; set; } + + public DateTime? UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int? UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs b/Migration.Tool.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs new file mode 100644 index 00000000..936cb59c --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsPageTemplateCategoryPageTemplateJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(200)] + public string? CodeName { get; set; } + + [StringLength(200)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryTemplateChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [StringLength(20)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; + + [StringLength(10)] + public string? PageTemplateType { get; set; } + + [StringLength(200)] + public string? PageTemplateIconClass { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsRelationshipJoined.cs b/Migration.Tool.KX13/Models/ViewCmsRelationshipJoined.cs new file mode 100644 index 00000000..0876244d --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsRelationshipJoined.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsRelationshipJoined +{ + [Column("LeftNodeID")] + public int LeftNodeId { get; set; } + + [Column("LeftNodeGUID")] + public Guid LeftNodeGuid { get; set; } + + [StringLength(100)] + public string LeftNodeName { get; set; } = null!; + + [Column("LeftNodeSiteID")] + public int LeftNodeSiteId { get; set; } + + [StringLength(200)] + public string RelationshipName { get; set; } = null!; + + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + [Column("RightNodeID")] + public int RightNodeId { get; set; } + + [Column("RightNodeGUID")] + public Guid RightNodeGuid { get; set; } + + [StringLength(100)] + public string RightNodeName { get; set; } = null!; + + [Column("RightNodeSiteID")] + public int RightNodeSiteId { get; set; } + + [StringLength(200)] + public string RelationshipDisplayName { get; set; } = null!; + + public string? RelationshipCustomData { get; set; } + + [Column("LeftClassID")] + public int LeftClassId { get; set; } + + [Column("RightClassID")] + public int RightClassId { get; set; } + + [Column("RelationshipID")] + public int RelationshipId { get; set; } + + public int? RelationshipOrder { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsResourceStringJoined.cs b/Migration.Tool.KX13/Models/ViewCmsResourceStringJoined.cs new file mode 100644 index 00000000..b1b49116 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsResourceStringJoined.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsResourceStringJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("TranslationID")] + public int? TranslationId { get; set; } + + [Column("TranslationStringID")] + public int? TranslationStringId { get; set; } + + [Column("TranslationCultureID")] + public int? TranslationCultureId { get; set; } + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int? CultureId { get; set; } + + [StringLength(200)] + public string? CultureName { get; set; } + + [StringLength(50)] + public string? CultureCode { get; set; } + + [Column("CultureGUID")] + public Guid? CultureGuid { get; set; } + + public DateTime? CultureLastModified { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Tool.KX13/Models/ViewCmsResourceTranslatedJoined.cs new file mode 100644 index 00000000..bfafc7dd --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsResourceTranslatedJoined.cs @@ -0,0 +1,27 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsResourceTranslatedJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs b/Migration.Tool.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs new file mode 100644 index 00000000..6ceda7bf --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsRoleResourcePermissionJoined +{ + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + [StringLength(100)] + public string PermissionName { get; set; } = null!; + + [Column("PermissionID")] + public int PermissionId { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsSiteDocumentCount.cs b/Migration.Tool.KX13/Models/ViewCmsSiteDocumentCount.cs new file mode 100644 index 00000000..ceffe312 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsSiteDocumentCount.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsSiteDocumentCount +{ + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + [StringLength(200)] + public string SiteDisplayName { get; set; } = null!; + + public string? SiteDescription { get; set; } + + [StringLength(20)] + public string SiteStatus { get; set; } = null!; + + [StringLength(400)] + public string SiteDomainName { get; set; } = null!; + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + [Column("SiteGUID")] + public Guid SiteGuid { get; set; } + + public DateTime SiteLastModified { get; set; } + + [StringLength(400)] + public string SitePresentationUrl { get; set; } = null!; + + public int? Documents { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs b/Migration.Tool.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs new file mode 100644 index 00000000..9e82ee17 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsSiteRoleResourceUielementJoined +{ + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(200)] + public string ElementName { get; set; } = null!; + + [StringLength(100)] + public string? SiteName { get; set; } + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + [Column("RoleSiteID")] + public int? RoleSiteId { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsTreeJoined.cs b/Migration.Tool.KX13/Models/ViewCmsTreeJoined.cs new file mode 100644 index 00000000..6c74002f --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsTreeJoined.cs @@ -0,0 +1,170 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsTreeJoined +{ + [StringLength(100)] + public string ClassName { get; set; } = null!; + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [Column("NodeID")] + public int NodeId { get; set; } + + [StringLength(450)] + public string NodeAliasPath { get; set; } = null!; + + [StringLength(100)] + public string NodeName { get; set; } = null!; + + [StringLength(50)] + public string NodeAlias { get; set; } = null!; + + [Column("NodeClassID")] + public int NodeClassId { get; set; } + + [Column("NodeParentID")] + public int? NodeParentId { get; set; } + + public int NodeLevel { get; set; } + + [Column("NodeACLID")] + public int? NodeAclid { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeGUID")] + public Guid NodeGuid { get; set; } + + public int? NodeOrder { get; set; } + + public bool? IsSecuredNode { get; set; } + + [Column("NodeSKUID")] + public int? NodeSkuid { get; set; } + + [Column("NodeLinkedNodeID")] + public int? NodeLinkedNodeId { get; set; } + + public int? NodeOwner { get; set; } + + public string? NodeCustomData { get; set; } + + [Column("NodeLinkedNodeSiteID")] + public int? NodeLinkedNodeSiteId { get; set; } + + public bool? NodeHasChildren { get; set; } + + public bool? NodeHasLinks { get; set; } + + [Column("NodeOriginalNodeID")] + public int? NodeOriginalNodeId { get; set; } + + [Column("NodeIsACLOwner")] + public bool NodeIsAclowner { get; set; } + + [Column("DocumentID")] + public int DocumentId { get; set; } + + [StringLength(100)] + public string DocumentName { get; set; } = null!; + + public DateTime? DocumentModifiedWhen { get; set; } + + [Column("DocumentModifiedByUserID")] + public int? DocumentModifiedByUserId { get; set; } + + public int? DocumentForeignKeyValue { get; set; } + + [Column("DocumentCreatedByUserID")] + public int? DocumentCreatedByUserId { get; set; } + + public DateTime? DocumentCreatedWhen { get; set; } + + [Column("DocumentCheckedOutByUserID")] + public int? DocumentCheckedOutByUserId { get; set; } + + public DateTime? DocumentCheckedOutWhen { get; set; } + + [Column("DocumentCheckedOutVersionHistoryID")] + public int? DocumentCheckedOutVersionHistoryId { get; set; } + + [Column("DocumentPublishedVersionHistoryID")] + public int? DocumentPublishedVersionHistoryId { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + public DateTime? DocumentPublishFrom { get; set; } + + public DateTime? DocumentPublishTo { get; set; } + + [StringLength(50)] + public string DocumentCulture { get; set; } = null!; + + [Column("DocumentNodeID")] + public int DocumentNodeId { get; set; } + + public string? DocumentPageTitle { get; set; } + + public string? DocumentPageKeyWords { get; set; } + + public string? DocumentPageDescription { get; set; } + + public string? DocumentContent { get; set; } + + public string? DocumentCustomData { get; set; } + + public string? DocumentTags { get; set; } + + [Column("DocumentTagGroupID")] + public int? DocumentTagGroupId { get; set; } + + public DateTime? DocumentLastPublished { get; set; } + + public bool? DocumentSearchExcluded { get; set; } + + [StringLength(50)] + public string? DocumentLastVersionNumber { get; set; } + + public bool? DocumentIsArchived { get; set; } + + [Column("DocumentGUID")] + public Guid? DocumentGuid { get; set; } + + [Column("DocumentWorkflowCycleGUID")] + public Guid? DocumentWorkflowCycleGuid { get; set; } + + public bool? DocumentIsWaitingForTranslation { get; set; } + + [Column("DocumentSKUName")] + [StringLength(440)] + public string? DocumentSkuname { get; set; } + + [Column("DocumentSKUDescription")] + public string? DocumentSkudescription { get; set; } + + [Column("DocumentSKUShortDescription")] + public string? DocumentSkushortDescription { get; set; } + + [StringLength(450)] + public string? DocumentWorkflowActionStatus { get; set; } + + public bool DocumentCanBePublished { get; set; } + + public string? DocumentPageBuilderWidgets { get; set; } + + public string? DocumentPageTemplateConfiguration { get; set; } + + [Column("DocumentABTestConfiguration")] + public string? DocumentAbtestConfiguration { get; set; } + + public bool DocumentShowInMenu { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsUser.cs b/Migration.Tool.KX13/Models/ViewCmsUser.cs new file mode 100644 index 00000000..c41d75c8 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsUser.cs @@ -0,0 +1,173 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsUser +{ + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(50)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(50)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [Column("UserSettingsID")] + public int? UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid? UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int? UserSettingsUserId { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarFileName { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsUserDocument.cs b/Migration.Tool.KX13/Models/ViewCmsUserDocument.cs new file mode 100644 index 00000000..1559ca84 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsUserDocument.cs @@ -0,0 +1,52 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsUserDocument +{ + [StringLength(100)] + public string? DocumentName { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeID")] + public int NodeId { get; set; } + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + public DateTime? DocumentModifiedWhen { get; set; } + + [StringLength(50)] + public string DocumentCulture { get; set; } = null!; + + [StringLength(200)] + public string? CultureName { get; set; } + + [Column("UserID1")] + public int? UserId1 { get; set; } + + [Column("UserID2")] + public int? UserId2 { get; set; } + + [Column("UserID3")] + public int? UserId3 { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + [StringLength(450)] + public string NodeAliasPath { get; set; } = null!; + + [StringLength(12)] + [Unicode(false)] + public string Type { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ViewCmsUserRoleJoined.cs b/Migration.Tool.KX13/Models/ViewCmsUserRoleJoined.cs new file mode 100644 index 00000000..f979c61a --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsUserRoleJoined.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsUserRoleJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(450)] + public string? FullName { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [StringLength(100)] + public string? SiteName { get; set; } + + [Column("SiteGUID")] + public Guid? SiteGuid { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsUserRoleMembershipRole.cs b/Migration.Tool.KX13/Models/ViewCmsUserRoleMembershipRole.cs new file mode 100644 index 00000000..de888f34 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsUserRoleMembershipRole.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsUserRoleMembershipRole +{ + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + public DateTime? ValidTo { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs b/Migration.Tool.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs new file mode 100644 index 00000000..d10d9a3d --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsUserRoleMembershipRoleValidOnlyJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsUserSettingsRoleJoined.cs b/Migration.Tool.KX13/Models/ViewCmsUserSettingsRoleJoined.cs new file mode 100644 index 00000000..ba082f7b --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsUserSettingsRoleJoined.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsUserSettingsRoleJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + public bool UserEnabled { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs b/Migration.Tool.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs new file mode 100644 index 00000000..29fe7547 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs @@ -0,0 +1,67 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsWebPartCategoryWebpartJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(100)] + public string CodeName { get; set; } = null!; + + [StringLength(100)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryWebPartChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [Column("WebPartParentID")] + public int? WebPartParentId { get; set; } + + [StringLength(100)] + public string? WebPartFileName { get; set; } + + [Column("WebPartGUID")] + public Guid? WebPartGuid { get; set; } + + public int? WebPartType { get; set; } + + [StringLength(1000)] + public string? WebPartDescription { get; set; } + + [StringLength(15)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; + + [Column("ThumbnailGUID")] + public Guid? ThumbnailGuid { get; set; } + + [StringLength(200)] + public string? IconClass { get; set; } + + public bool? WebPartSkipInsertProperties { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs b/Migration.Tool.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs new file mode 100644 index 00000000..3cbedaa1 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs @@ -0,0 +1,53 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewCmsWidgetCategoryWidgetJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(100)] + public string CodeName { get; set; } = null!; + + [StringLength(100)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? WidgetCategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? WidgetCategoryChildCount { get; set; } + + public int? WidgetCategoryWidgetChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [Column("WidgetWebPartID")] + public int? WidgetWebPartId { get; set; } + + public int WidgetSecurity { get; set; } + + [Column("WidgetGUID")] + public Guid? WidgetGuid { get; set; } + + [StringLength(14)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs b/Migration.Tool.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs new file mode 100644 index 00000000..b9b08aec --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewComSkuoptionCategoryOptionCategoryJoined +{ + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("CategoryID")] + public int CategoryId { get; set; } + + public bool? AllowAllOptions { get; set; } + + [Column("SKUCategoryID")] + public int SkucategoryId { get; set; } + + [Column("SKUCategoryOrder")] + public int? SkucategoryOrder { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryName { get; set; } = null!; + + [StringLength(200)] + public string CategorySelectionType { get; set; } = null!; + + [StringLength(200)] + public string? CategoryDefaultOptions { get; set; } + + public string? CategoryDescription { get; set; } + + [StringLength(200)] + public string? CategoryDefaultRecord { get; set; } + + public bool CategoryEnabled { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + public bool? CategoryDisplayPrice { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + public int? CategoryTextMaxLength { get; set; } + + [StringLength(20)] + public string? CategoryType { get; set; } + + public int? CategoryTextMinLength { get; set; } + + [StringLength(200)] + public string? CategoryLiveSiteDisplayName { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewIntegrationTaskJoined.cs b/Migration.Tool.KX13/Models/ViewIntegrationTaskJoined.cs new file mode 100644 index 00000000..ecb3bc5e --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewIntegrationTaskJoined.cs @@ -0,0 +1,64 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewIntegrationTaskJoined +{ + [Column("SynchronizationID")] + public int? SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int? SynchronizationTaskId { get; set; } + + [Column("SynchronizationConnectorID")] + public int? SynchronizationConnectorId { get; set; } + + public DateTime? SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + public bool? SynchronizationIsRunning { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + [StringLength(450)] + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool TaskIsInbound { get; set; } + + [StringLength(50)] + public string? TaskProcessType { get; set; } + + public string TaskData { get; set; } = null!; + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(50)] + public string? TaskDataType { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewMembershipMembershipUserJoined.cs b/Migration.Tool.KX13/Models/ViewMembershipMembershipUserJoined.cs new file mode 100644 index 00000000..c5fed0fb --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewMembershipMembershipUserJoined.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewMembershipMembershipUserJoined +{ + [StringLength(200)] + public string MembershipDisplayName { get; set; } = null!; + + [Column("MembershipID")] + public int MembershipId { get; set; } + + public DateTime? ValidTo { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [Column("MembershipSiteID")] + public int? MembershipSiteId { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewNewsletterSubscriptionsJoined.cs b/Migration.Tool.KX13/Models/ViewNewsletterSubscriptionsJoined.cs new file mode 100644 index 00000000..8a71258c --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewNewsletterSubscriptionsJoined.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewNewsletterSubscriptionsJoined +{ + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [StringLength(440)] + public string? SubscriberFullName { get; set; } + + [StringLength(254)] + public string? SubscriberEmail { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + [StringLength(100)] + public string? SubscriberType { get; set; } + + public int? SubscriberBounces { get; set; } + + [StringLength(250)] + public string NewsletterDisplayName { get; set; } = null!; + + [Column("SubscriberRelatedID")] + public int SubscriberRelatedId { get; set; } + + [Column("SubscriberNewsletterID")] + public int SubscriberNewsletterId { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Tool.KX13/Models/ViewOmAccountContactAccountJoined.cs new file mode 100644 index 00000000..fc2ee242 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewOmAccountContactAccountJoined.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewOmAccountContactAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewOmAccountContactContactJoined.cs b/Migration.Tool.KX13/Models/ViewOmAccountContactContactJoined.cs new file mode 100644 index 00000000..5cf7aad1 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewOmAccountContactContactJoined.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewOmAccountContactContactJoined +{ + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewOmAccountJoined.cs b/Migration.Tool.KX13/Models/ViewOmAccountJoined.cs new file mode 100644 index 00000000..da669ef5 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewOmAccountJoined.cs @@ -0,0 +1,101 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewOmAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [StringLength(100)] + public string? PrimaryContactFirstName { get; set; } + + [StringLength(100)] + public string? PrimaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? PrimaryContactLastName { get; set; } + + [StringLength(100)] + public string? SecondaryContactFirstName { get; set; } + + [StringLength(100)] + public string? SecondaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? SecondaryContactLastName { get; set; } + + [StringLength(200)] + public string? SubsidiaryOfName { get; set; } + + [StringLength(302)] + public string PrimaryContactFullName { get; set; } = null!; + + [StringLength(302)] + public string SecondaryContactFullName { get; set; } = null!; + + [StringLength(201)] + public string AccountFullAddress { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Tool.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs new file mode 100644 index 00000000..504d17f8 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs @@ -0,0 +1,77 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewOmContactGroupMemberAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } +} diff --git a/Migration.Tool.KX13/Models/ViewReportingCategoryReportJoined.cs b/Migration.Tool.KX13/Models/ViewReportingCategoryReportJoined.cs new file mode 100644 index 00000000..fcec8508 --- /dev/null +++ b/Migration.Tool.KX13/Models/ViewReportingCategoryReportJoined.cs @@ -0,0 +1,51 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KX13.Models; + +[Keyless] +public class ViewReportingCategoryReportJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(200)] + public string CodeName { get; set; } = null!; + + [StringLength(440)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(651)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryReportChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + public string? ReportLayout { get; set; } + + public string? ReportParameters { get; set; } + + public int? ReportAccess { get; set; } + + [StringLength(14)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; +} diff --git a/Migration.Tool.KX13/SettingsKeys.cs b/Migration.Tool.KX13/SettingsKeys.cs new file mode 100644 index 00000000..6e9becbc --- /dev/null +++ b/Migration.Tool.KX13/SettingsKeys.cs @@ -0,0 +1,479 @@ +// ReSharper disable InconsistentNaming +// ReSharper disable IdentifierTypo +namespace Migration.Tool.KX13; + +public static class SettingsKeys +{ + public const string CMSABTestingEnabled = "CMSABTestingEnabled"; + public const string CMSAdminEmailAddress = "CMSAdminEmailAddress"; + public const string CMSAllowAttachmentTranslation = "CMSAllowAttachmentTranslation"; + public const string CMSAllowDynamicNewsletters = "CMSAllowDynamicNewsletters"; + public const string CMSAllowedURLCharacters = "CMSAllowedURLCharacters"; + public const string CMSAllowGlobalCategories = "CMSAllowGlobalCategories"; + public const string CMSAllowPermanentPreviewLink = "CMSAllowPermanentPreviewLink"; + public const string CMSAlternativeURLsConstraint = "CMSAlternativeURLsConstraint"; + public const string CMSAlternativeURLsErrorMessage = "CMSAlternativeURLsErrorMessage"; + public const string CMSAlternativeURLsExcludedURLs = "CMSAlternativeURLsExcludedURLs"; + public const string CMSAlternativeURLsMode = "CMSAlternativeURLsMode"; + public const string CMSAlternativeUrlUIEnabled = "CMSAlternativeUrlUIEnabled"; + public const string CMSAnalyticsEnabled = "CMSAnalyticsEnabled"; + public const string CMSAnalyticsExcludedIPs = "CMSAnalyticsExcludedIPs"; + public const string CMSAnalyticsExcludedURLs = "CMSAnalyticsExcludedURLs"; + public const string CMSAnalyticsExcludeSearchEngines = "CMSAnalyticsExcludeSearchEngines"; + public const string CMSAnalyticsTrackBrowserTypes = "CMSAnalyticsTrackBrowserTypes"; + public const string CMSAnalyticsTrackCountries = "CMSAnalyticsTrackCountries"; + public const string CMSAnalyticsTrackInvalidPages = "CMSAnalyticsTrackInvalidPages"; + public const string CMSAnalyticsTrackPageViews = "CMSAnalyticsTrackPageViews"; + public const string CMSAnalyticsTrackReferrals = "CMSAnalyticsTrackReferrals"; + public const string CMSAnalyticsTrackVisits = "CMSAnalyticsTrackVisits"; + public const string CMSApplicationState = "CMSApplicationState"; + public const string CMSArchiveEmails = "CMSArchiveEmails"; + public const string CMSAuthorizeNETAPILogin = "CMSAuthorizeNETAPILogin"; + public const string CMSAuthorizeNETTransactionKey = "CMSAuthorizeNETTransactionKey"; + public const string CMSAuthorizeNETTransactionType = "CMSAuthorizeNETTransactionType"; + public const string CMSAutocompleteEnableForLogin = "CMSAutocompleteEnableForLogin"; + public const string CMSAutomaticallySignInUser = "CMSAutomaticallySignInUser"; + public const string CMSAutoResizeImageHeight = "CMSAutoResizeImageHeight"; + public const string CMSAutoResizeImageMaxSideSize = "CMSAutoResizeImageMaxSideSize"; + public const string CMSAutoResizeImageWidth = "CMSAutoResizeImageWidth"; + public const string CMSAvatarHeight = "CMSAvatarHeight"; + public const string CMSAvatarMaxSideSize = "CMSAvatarMaxSideSize"; + public const string CMSAvatarWidth = "CMSAvatarWidth"; + public const string CMSAzureComputerVisionAPIEndpoint = "CMSAzureComputerVisionAPIEndpoint"; + public const string CMSAzureComputerVisionAPIKey = "CMSAzureComputerVisionAPIKey"; + public const string CMSAzureComputerVisionConfidence = "CMSAzureComputerVisionConfidence"; + public const string CMSAzureTextAnalyticsAPIEndpoint = "CMSAzureTextAnalyticsAPIEndpoint"; + public const string CMSAzureTextAnalyticsAPIKey = "CMSAzureTextAnalyticsAPIKey"; + public const string CMSBitlyAPIKey = "CMSBitlyAPIKey"; + public const string CMSBitlyLogin = "CMSBitlyLogin"; + public const string CMSBizFormFilesFolder = "CMSBizFormFilesFolder"; + public const string CMSBlockSubscribersGlobally = "CMSBlockSubscribersGlobally"; + public const string CMSBouncedEmailAddress = "CMSBouncedEmailAddress"; + public const string CMSBouncedEmailsLimit = "CMSBouncedEmailsLimit"; + public const string CMSCacheImages = "CMSCacheImages"; + public const string CMSCacheMinutes = "CMSCacheMinutes"; + public const string CMSCheapestVariantAdvertising = "CMSCheapestVariantAdvertising"; + public const string CMSCheckDocumentPermissions = "CMSCheckDocumentPermissions"; + public const string CMSCheckFilesPermissions = "CMSCheckFilesPermissions"; + public const string CMSCheckMediaFilePermissions = "CMSCheckMediaFilePermissions"; + public const string CMSCheckPagePermissions = "CMSCheckPagePermissions"; + public const string CMSCheckPublishedFiles = "CMSCheckPublishedFiles"; + public const string CMSClientCacheMinutes = "CMSClientCacheMinutes"; + public const string CMSCMActivitiesEnabled = "CMSCMActivitiesEnabled"; + public const string CMSCMAddingProductToSC = "CMSCMAddingProductToSC"; + public const string CMSCMAddingProductToWL = "CMSCMAddingProductToWL"; + public const string CMSCMBizFormSubmission = "CMSCMBizFormSubmission"; + public const string CMSCMClickthroughTracking = "CMSCMClickthroughTracking"; + public const string CMSCMCustomActivities = "CMSCMCustomActivities"; + public const string CMSCMCustomTableForm = "CMSCMCustomTableForm"; + public const string CMSCMEmailOpening = "CMSCMEmailOpening"; + public const string CMSCMEnableGeolocation = "CMSCMEnableGeolocation"; + public const string CMSCMExternalSearch = "CMSCMExternalSearch"; + public const string CMSCMGeoCity = "CMSCMGeoCity"; + public const string CMSCMGeoCountry = "CMSCMGeoCountry"; + public const string CMSCMGeoLatitude = "CMSCMGeoLatitude"; + public const string CMSCMGeoLongitude = "CMSCMGeoLongitude"; + public const string CMSCMGeoMetro = "CMSCMGeoMetro"; + public const string CMSCMGeoNewDB = "CMSCMGeoNewDB"; + public const string CMSCMGeoOrganization = "CMSCMGeoOrganization"; + public const string CMSCMGeoPostal = "CMSCMGeoPostal"; + public const string CMSCMGeoState = "CMSCMGeoState"; + public const string CMSCMGeoSuffix = "CMSCMGeoSuffix"; + public const string CMSCMLandingPage = "CMSCMLandingPage"; + public const string CMSCMLegitimateInterestActivitiesEnabled = "CMSCMLegitimateInterestActivitiesEnabled"; + public const string CMSCMNewsletterSubscribe = "CMSCMNewsletterSubscribe"; + public const string CMSCMNewsletterUnsubscribe = "CMSCMNewsletterUnsubscribe"; + public const string CMSCMNewsletterUnsubscribedFromAll = "CMSCMNewsletterUnsubscribedFromAll"; + public const string CMSCMPageVisits = "CMSCMPageVisits"; + public const string CMSCMPurchase = "CMSCMPurchase"; + public const string CMSCMPurchasedProduct = "CMSCMPurchasedProduct"; + public const string CMSCMRemovingProductFromSC = "CMSCMRemovingProductFromSC"; + public const string CMSCMSearch = "CMSCMSearch"; + public const string CMSCMStamp = "CMSCMStamp"; + public const string CMSCMUserLogin = "CMSCMUserLogin"; + public const string CMSCMUserRegistration = "CMSCMUserRegistration"; + public const string CMSCodeNamePrefix = "CMSCodeNamePrefix"; + public const string CMSCombineWithDefaultCulture = "CMSCombineWithDefaultCulture"; + public const string CMSConfirmChanges = "CMSConfirmChanges"; + public const string CMSContentPersonalizationEnabled = "CMSContentPersonalizationEnabled"; + public const string CMSDataVersion = "CMSDataVersion"; + public const string CMSDBSeparationStartedByServer = "CMSDBSeparationStartedByServer"; + public const string CMSDBVersion = "CMSDBVersion"; + public const string CMSDebugAllCache = "CMSDebugAllCache"; + public const string CMSDebugAllFiles = "CMSDebugAllFiles"; + public const string CMSDebugAllForEverything = "CMSDebugAllForEverything"; + public const string CMSDebugAllHandlers = "CMSDebugAllHandlers"; + public const string CMSDebugAllMacros = "CMSDebugAllMacros"; + public const string CMSDebugAllSecurity = "CMSDebugAllSecurity"; + public const string CMSDebugAllSQLQueries = "CMSDebugAllSQLQueries"; + public const string CMSDebugAllWebFarm = "CMSDebugAllWebFarm"; + public const string CMSDebugCache = "CMSDebugCache"; + public const string CMSDebugCacheLogLength = "CMSDebugCacheLogLength"; + public const string CMSDebugCacheStack = "CMSDebugCacheStack"; + public const string CMSDebugEverything = "CMSDebugEverything"; + public const string CMSDebugEverythingEverywhere = "CMSDebugEverythingEverywhere"; + public const string CMSDebugEverythingLogLength = "CMSDebugEverythingLogLength"; + public const string CMSDebugFiles = "CMSDebugFiles"; + public const string CMSDebugFilesLogLength = "CMSDebugFilesLogLength"; + public const string CMSDebugFilesStack = "CMSDebugFilesStack"; + public const string CMSDebugHandlers = "CMSDebugHandlers"; + public const string CMSDebugHandlersLogLength = "CMSDebugHandlersLogLength"; + public const string CMSDebugHandlersStack = "CMSDebugHandlersStack"; + public const string CMSDebugImportExport = "CMSDebugImportExport"; + public const string CMSDebugMacros = "CMSDebugMacros"; + public const string CMSDebugMacrosDetailed = "CMSDebugMacrosDetailed"; + public const string CMSDebugMacrosLogLength = "CMSDebugMacrosLogLength"; + public const string CMSDebugMacrosStack = "CMSDebugMacrosStack"; + public const string CMSDebugResources = "CMSDebugResources"; + public const string CMSDebugScheduler = "CMSDebugScheduler"; + public const string CMSDebugSecurity = "CMSDebugSecurity"; + public const string CMSDebugSecurityLogLength = "CMSDebugSecurityLogLength"; + public const string CMSDebugSecurityStack = "CMSDebugSecurityStack"; + public const string CMSDebugSQLConnections = "CMSDebugSQLConnections"; + public const string CMSDebugSQLQueries = "CMSDebugSQLQueries"; + public const string CMSDebugSQLQueriesLogLength = "CMSDebugSQLQueriesLogLength"; + public const string CMSDebugSQLQueriesStack = "CMSDebugSQLQueriesStack"; + public const string CMSDebugStackForEverything = "CMSDebugStackForEverything"; + public const string CMSDebugWebFarm = "CMSDebugWebFarm"; + public const string CMSDebugWebFarmLogLength = "CMSDebugWebFarmLogLength"; + public const string CMSDebugWebFarmStack = "CMSDebugWebFarmStack"; + public const string CMSDefaultControlForBoolean = "CMSDefaultControlForBoolean"; + public const string CMSDefaultControlForDateTime = "CMSDefaultControlForDateTime"; + public const string CMSDefaultControlForDecimal = "CMSDefaultControlForDecimal"; + public const string CMSDefaultControlForDocAttachments = "CMSDefaultControlForDocAttachments"; + public const string CMSDefaultControlForDocRelationships = "CMSDefaultControlForDocRelationships"; + public const string CMSDefaultControlForFile = "CMSDefaultControlForFile"; + public const string CMSDefaultControlForGUID = "CMSDefaultControlForGUID"; + public const string CMSDefaultControlForInteger = "CMSDefaultControlForInteger"; + public const string CMSDefaultControlForLongText = "CMSDefaultControlForLongText"; + public const string CMSDefaultControlForText = "CMSDefaultControlForText"; + public const string CMSDefaultCookieLevel = "CMSDefaultCookieLevel"; + public const string CMSDefaultCultureCode = "CMSDefaultCultureCode"; + public const string CMSDefaultProductImageUrl = "CMSDefaultProductImageUrl"; + public const string CMSDefaultReportConnectionString = "CMSDefaultReportConnectionString"; + public const string CMSDefaultUserID = "CMSDefaultUserID"; + public const string CMSDeleteInactiveContactsLastXDays = "CMSDeleteInactiveContactsLastXDays"; + public const string CMSDeleteInactiveContactsMethod = "CMSDeleteInactiveContactsMethod"; + public const string CMSDeleteNonActivatedUserAfter = "CMSDeleteNonActivatedUserAfter"; + public const string CMSDeploymentMode = "CMSDeploymentMode"; + public const string CMSDisableDebug = "CMSDisableDebug"; + public const string CMSDisplayAccountLockInformation = "CMSDisplayAccountLockInformation"; + public const string CMSDisplayArchivedIcon = "CMSDisplayArchivedIcon"; + public const string CMSDisplayCheckedOutIcon = "CMSDisplayCheckedOutIcon"; + public const string CMSDisplayLinkedIcon = "CMSDisplayLinkedIcon"; + public const string CMSDisplayNotPublishedIcon = "CMSDisplayNotPublishedIcon"; + public const string CMSDisplayNotTranslatedIcon = "CMSDisplayNotTranslatedIcon"; + public const string CMSDisplayPublishedIcon = "CMSDisplayPublishedIcon"; + public const string CMSDisplayVersionNotPublishedIcon = "CMSDisplayVersionNotPublishedIcon"; + public const string CMSEmailBatchSize = "CMSEmailBatchSize"; + public const string CMSEmailEncoding = "CMSEmailEncoding"; + public const string CMSEmailFormat = "CMSEmailFormat"; + public const string CMSEmailQueueEnabled = "CMSEmailQueueEnabled"; + public const string CMSEmailsEnabled = "CMSEmailsEnabled"; + public const string CMSEmailTranslationFrom = "CMSEmailTranslationFrom"; + public const string CMSEmailTranslationRecipients = "CMSEmailTranslationRecipients"; + public const string CMSEnableCI = "CMSEnableCI"; + public const string CMSEnableCodeEditSiteAdministrators = "CMSEnableCodeEditSiteAdministrators"; + public const string CMSEnableImageRecognition = "CMSEnableImageRecognition"; + public const string CMSEnableObjectsVersioning = "CMSEnableObjectsVersioning"; + public const string CMSEnableOnlineMarketing = "CMSEnableOnlineMarketing"; + public const string CMSEnableSentimentAnalysis = "CMSEnableSentimentAnalysis"; + public const string CMSEnableTranlsationRESTService = "CMSEnableTranlsationRESTService"; + public const string CMSEnableTranslations = "CMSEnableTranslations"; + public const string CMSEnableVersioningCMSAlternativeForm = "CMSEnableVersioningCMSAlternativeForm"; + public const string CMSEnableVersioningCMSCustomTable = "CMSEnableVersioningCMSCustomTable"; + public const string CMSEnableVersioningCMSDocumentType = "CMSEnableVersioningCMSDocumentType"; + public const string CMSEnableVersioningCMSEmailTemplate = "CMSEnableVersioningCMSEmailTemplate"; + public const string CMSEnableVersioningCMSForm = "CMSEnableVersioningCMSForm"; + public const string CMSEnableVersioningCMSLayout = "CMSEnableVersioningCMSLayout"; + public const string CMSEnableVersioningCMSPageTemplate = "CMSEnableVersioningCMSPageTemplate"; + public const string CMSEnableVersioningCMSQuery = "CMSEnableVersioningCMSQuery"; + public const string CMSEnableVersioningCMSTransformation = "CMSEnableVersioningCMSTransformation"; + public const string CMSEnableVersioningCMSUIElement = "CMSEnableVersioningCMSUIElement"; + public const string CMSEnableVersioningCMSWebPartLayout = "CMSEnableVersioningCMSWebPartLayout"; + public const string CMSEnableVersioningCMSWorkflow = "CMSEnableVersioningCMSWorkflow"; + public const string CMSEnableVersioningMAAutomationProcess = "CMSEnableVersioningMAAutomationProcess"; + public const string CMSEnableVersioningMediaFile = "CMSEnableVersioningMediaFile"; + public const string CMSEnableVersioningNewsletterEmailTemplate = "CMSEnableVersioningNewsletterEmailTemplate"; + public const string CMSEnableVersioningNewsletterEmailWidget = "CMSEnableVersioningNewsletterEmailWidget"; + public const string CMSEnableVersioningNewsletterIssue = "CMSEnableVersioningNewsletterIssue"; + public const string CMSEnableVersioningReportingReport = "CMSEnableVersioningReportingReport"; + public const string CMSEnableVersioningReportingReportGraph = "CMSEnableVersioningReportingReportGraph"; + public const string CMSEnableVersioningReportingReportTable = "CMSEnableVersioningReportingReportTable"; + public const string CMSEnableVersioningReportingReportValue = "CMSEnableVersioningReportingReportValue"; + public const string CMSExcludeDocumentsFromSearch = "CMSExcludeDocumentsFromSearch"; + public const string CMSExcludeDocumentTypesFromSearch = "CMSExcludeDocumentTypesFromSearch"; + public const string CMSExportLogObjectChanges = "CMSExportLogObjectChanges"; + public const string CMSFilesFolder = "CMSFilesFolder"; + public const string CMSFilesLocationType = "CMSFilesLocationType"; + public const string CMSForbiddenCharactersReplacement = "CMSForbiddenCharactersReplacement"; + public const string CMSForbiddenURLCharacters = "CMSForbiddenURLCharacters"; + public const string CMSGenerateNewsletters = "CMSGenerateNewsletters"; + public const string CMSGenerateThumbnails = "CMSGenerateThumbnails"; + public const string CMSGoogleTranslateAPIKey = "CMSGoogleTranslateAPIKey"; + public const string CMSHideLanguagePrefixForDefaultCultureURL = "CMSHideLanguagePrefixForDefaultCultureURL"; + public const string CMSHideUnavailableUserInterface = "CMSHideUnavailableUserInterface"; + public const string CMSHomePagePath = "CMSHomePagePath"; + public const string CMSHomePageURLBehavior = "CMSHomePageURLBehavior"; + public const string CMSHotfixDataVersion = "CMSHotfixDataVersion"; + public const string CMSHotfixProcedureInProgress = "CMSHotfixProcedureInProgress"; + public const string CMSHotfixVersion = "CMSHotfixVersion"; + public const string CMSIncludeTaxInPrices = "CMSIncludeTaxInPrices"; + public const string CMSIntegrationEnabled = "CMSIntegrationEnabled"; + public const string CMSIntegrationLogExternal = "CMSIntegrationLogExternal"; + public const string CMSIntegrationLogInternal = "CMSIntegrationLogInternal"; + public const string CMSIntegrationProcessExternal = "CMSIntegrationProcessExternal"; + public const string CMSIntegrationProcessInternal = "CMSIntegrationProcessInternal"; + public const string CMSJwtTokenEncryptionKey = "CMSJwtTokenEncryptionKey"; + public const string CMSKeepNewCheckedOut = "CMSKeepNewCheckedOut"; + public const string CMSLogCache = "CMSLogCache"; + public const string CMSLogEverythingToFile = "CMSLogEverythingToFile"; + public const string CMSLogFiles = "CMSLogFiles"; + public const string CMSLogHandlers = "CMSLogHandlers"; + public const string CMSLogMacros = "CMSLogMacros"; + public const string CMSLogMetadata = "CMSLogMetadata"; + public const string CMSLogSecurity = "CMSLogSecurity"; + public const string CMSLogSize = "CMSLogSize"; + public const string CMSLogSQLQueries = "CMSLogSQLQueries"; + public const string CMSLogToDatabase = "CMSLogToDatabase"; + public const string CMSLogToFileSystem = "CMSLogToFileSystem"; + public const string CMSLogToTrace = "CMSLogToTrace"; + public const string CMSLogWebFarm = "CMSLogWebFarm"; + public const string CMSLowercaseURLs = "CMSLowercaseURLs"; + public const string CMSManualTranslationDeleteSuccessfulSubmissions = "CMSManualTranslationDeleteSuccessfulSubmissions"; + public const string CMSManualTranslationExportFolder = "CMSManualTranslationExportFolder"; + public const string CMSManualTranslationImportFolder = "CMSManualTranslationImportFolder"; + public const string CMSMarkShoppingCartAsAbandonedPeriod = "CMSMarkShoppingCartAsAbandonedPeriod"; + public const string CMSMaxCacheFileSize = "CMSMaxCacheFileSize"; + public const string CMSMaximumInvalidLogonAttempts = "CMSMaximumInvalidLogonAttempts"; + public const string CMSMaxTreeNodes = "CMSMaxTreeNodes"; + public const string CMSMaxUITreeNodes = "CMSMaxUITreeNodes"; + public const string CMSMediaFileAllowedExtensions = "CMSMediaFileAllowedExtensions"; + public const string CMSMediaFileHiddenFolder = "CMSMediaFileHiddenFolder"; + public const string CMSMediaFilePreviewSuffix = "CMSMediaFilePreviewSuffix"; + public const string CMSMediaLibrariesFolder = "CMSMediaLibrariesFolder"; + public const string CMSMediaLibraryMaxSubFolders = "CMSMediaLibraryMaxSubFolders"; + public const string CMSMembershipReminder = "CMSMembershipReminder"; + public const string CMSMFDisplayInitToken = "CMSMFDisplayInitToken"; + public const string CMSMFEnabled = "CMSMFEnabled"; + public const string CMSMFRequired = "CMSMFRequired"; + public const string CMSModuleUsageTrackingEnabled = "CMSModuleUsageTrackingEnabled"; + public const string CMSModuleUsageTrackingIdentity = "CMSModuleUsageTrackingIdentity"; + public const string CMSMonitorBouncedEmails = "CMSMonitorBouncedEmails"; + public const string CMSMSTranslatorTextAPISubscriptionKey = "CMSMSTranslatorTextAPISubscriptionKey"; + public const string CMSNewDocumentOrder = "CMSNewDocumentOrder"; + public const string CMSNewsletterUnsubscriptionURL = "CMSNewsletterUnsubscriptionURL"; + public const string CMSNewsletterUseExternalService = "CMSNewsletterUseExternalService"; + public const string CMSNoreplyEmailAddress = "CMSNoreplyEmailAddress"; + public const string CMSObjectVersionHistoryLength = "CMSObjectVersionHistoryLength"; + public const string CMSObjectVersionHistoryMajorVersionsLength = "CMSObjectVersionHistoryMajorVersionsLength"; + public const string CMSObjectVersionHistoryPromoteToMajorTimeInterval = "CMSObjectVersionHistoryPromoteToMajorTimeInterval"; + public const string CMSObjectVersionHistoryUseLastVersionInterval = "CMSObjectVersionHistoryUseLastVersionInterval"; + public const string CMSOptInApprovalURL = "CMSOptInApprovalURL"; + public const string CMSOptInInterval = "CMSOptInInterval"; + public const string CMSPageDescriptionPrefix = "CMSPageDescriptionPrefix"; + public const string CMSPageKeyWordsPrefix = "CMSPageKeyWordsPrefix"; + public const string CMSPageTitleFormat = "CMSPageTitleFormat"; + public const string CMSPageTitlePrefix = "CMSPageTitlePrefix"; + public const string CMSPasswordExpiration = "CMSPasswordExpiration"; + public const string CMSPasswordExpirationBehaviour = "CMSPasswordExpirationBehaviour"; + public const string CMSPasswordExpirationEmail = "CMSPasswordExpirationEmail"; + public const string CMSPasswordExpirationPeriod = "CMSPasswordExpirationPeriod"; + public const string CMSPasswordExpirationWarningPeriod = "CMSPasswordExpirationWarningPeriod"; + public const string CMSPasswordFormat = "CMSPasswordFormat"; + public const string CMSPaypalCancelReturnUrl = "CMSPaypalCancelReturnUrl"; + public const string CMSPayPalCredentialsAccountType = "CMSPayPalCredentialsAccountType"; + public const string CMSPayPalCredentialsClientId = "CMSPayPalCredentialsClientId"; + public const string CMSPayPalCredentialsClientSecret = "CMSPayPalCredentialsClientSecret"; + public const string CMSPayPalReturnUrl = "CMSPayPalReturnUrl"; + public const string CMSPayPalTransactionType = "CMSPayPalTransactionType"; + public const string CMSPersonalizeUserInterface = "CMSPersonalizeUserInterface"; + public const string CMSPolicyForcePolicyOnLogon = "CMSPolicyForcePolicyOnLogon"; + public const string CMSPolicyMinimalLength = "CMSPolicyMinimalLength"; + public const string CMSPolicyNumberOfNonAlphaNumChars = "CMSPolicyNumberOfNonAlphaNumChars"; + public const string CMSPolicyRegularExpression = "CMSPolicyRegularExpression"; + public const string CMSPolicyViolationMessage = "CMSPolicyViolationMessage"; + public const string CMSPOP3AuthenticationMethod = "CMSPOP3AuthenticationMethod"; + public const string CMSPOP3Password = "CMSPOP3Password"; + public const string CMSPOP3ServerName = "CMSPOP3ServerName"; + public const string CMSPOP3ServerPort = "CMSPOP3ServerPort"; + public const string CMSPOP3UserName = "CMSPOP3UserName"; + public const string CMSPOP3UseSSL = "CMSPOP3UseSSL"; + public const string CMSPriceRounding = "CMSPriceRounding"; + public const string CMSReCaptchaPrivateKey = "CMSReCaptchaPrivateKey"; + public const string CMSReCaptchaPublicKey = "CMSReCaptchaPublicKey"; + public const string CMSRedirectFilesToDisk = "CMSRedirectFilesToDisk"; + public const string CMSRegistrationAdministratorApproval = "CMSRegistrationAdministratorApproval"; + public const string CMSRememberUniGridState = "CMSRememberUniGridState"; + public const string CMSResetPasswordInterval = "CMSResetPasswordInterval"; + public const string CMSRESTAllowedDocTypes = "CMSRESTAllowedDocTypes"; + public const string CMSRESTAllowedObjectTypes = "CMSRESTAllowedObjectTypes"; + public const string CMSRESTAllowSensitiveFields = "CMSRESTAllowSensitiveFields"; + public const string CMSRESTDefaultEncoding = "CMSRESTDefaultEncoding"; + public const string CMSRESTDocumentsReadOnly = "CMSRESTDocumentsReadOnly"; + public const string CMSRESTDocumentsSecurityCheck = "CMSRESTDocumentsSecurityCheck"; + public const string CMSRESTGenerateHash = "CMSRESTGenerateHash"; + public const string CMSRESTObjectsReadOnly = "CMSRESTObjectsReadOnly"; + public const string CMSRestoreObjects = "CMSRestoreObjects"; + public const string CMSRESTServiceEnabled = "CMSRESTServiceEnabled"; + public const string CMSRESTServiceTypeEnabled = "CMSRESTServiceTypeEnabled"; + public const string CMSRESTUrlHashSalt = "CMSRESTUrlHashSalt"; + public const string CMSRevalidateClientCache = "CMSRevalidateClientCache"; + public const string CMSRichTextEditorLicense = "CMSRichTextEditorLicense"; + public const string CMSRichTextEditorStylesheetURL = "CMSRichTextEditorStylesheetURL"; + public const string CMSRoutingMode = "CMSRoutingMode"; + public const string CMSRoutingURLCultureFormat = "CMSRoutingURLCultureFormat"; + public const string CMSSalesForceCredentials = "CMSSalesForceCredentials"; + public const string CMSSalesForceLeadReplicationBatchSize = "CMSSalesForceLeadReplicationBatchSize"; + public const string CMSSalesForceLeadReplicationDefaultCompanyName = "CMSSalesForceLeadReplicationDefaultCompanyName"; + public const string CMSSalesForceLeadReplicationEnabled = "CMSSalesForceLeadReplicationEnabled"; + public const string CMSSalesForceLeadReplicationLeadDescription = "CMSSalesForceLeadReplicationLeadDescription"; + public const string CMSSalesForceLeadReplicationMapping = "CMSSalesForceLeadReplicationMapping"; + public const string CMSSalesForceLeadReplicationMappingDateTime = "CMSSalesForceLeadReplicationMappingDateTime"; + public const string CMSSalesForceLeadReplicationMinScoreValue = "CMSSalesForceLeadReplicationMinScoreValue"; + public const string CMSSalesForceLeadReplicationScoreID = "CMSSalesForceLeadReplicationScoreID"; + public const string CMSSalesForceLeadReplicationUpdateEnabled = "CMSSalesForceLeadReplicationUpdateEnabled"; + public const string CMSSchedulerInterval = "CMSSchedulerInterval"; + public const string CMSSchedulerServiceInterval = "CMSSchedulerServiceInterval"; + public const string CMSSchedulerTasksEnabled = "CMSSchedulerTasksEnabled"; + public const string CMSSchedulerUseExternalService = "CMSSchedulerUseExternalService"; + public const string CMSScreenLockEnabled = "CMSScreenLockEnabled"; + public const string CMSScreenLockInterval = "CMSScreenLockInterval"; + public const string CMSScreenLockWarningInterval = "CMSScreenLockWarningInterval"; + public const string CMSSearchAllowedFileTypes = "CMSSearchAllowedFileTypes"; + public const string CMSSearchIndexingEnabled = "CMSSearchIndexingEnabled"; + public const string CMSSendAccountUnlockEmail = "CMSSendAccountUnlockEmail"; + public const string CMSSendEmailNotificationsFrom = "CMSSendEmailNotificationsFrom"; + public const string CMSSendErrorNotificationTo = "CMSSendErrorNotificationTo"; + public const string CMSSendPasswordEmailsFrom = "CMSSendPasswordEmailsFrom"; + public const string CMSSendWorkflowEmails = "CMSSendWorkflowEmails"; + public const string CMSSendWorkflowEmailsFrom = "CMSSendWorkflowEmailsFrom"; + public const string CMSServerTimeZone = "CMSServerTimeZone"; + public const string CMSSharePointCache = "CMSSharePointCache"; + public const string CMSSharePointCacheSizeLimit = "CMSSharePointCacheSizeLimit"; + public const string CMSShoppingCartExpirationPeriod = "CMSShoppingCartExpirationPeriod"; + public const string CMSShoppingCartURL = "CMSShoppingCartURL"; + public const string CMSSiteSharedAccounts = "CMSSiteSharedAccounts"; + public const string CMSSiteTimeZone = "CMSSiteTimeZone"; + public const string CMSSMTPServer = "CMSSMTPServer"; + public const string CMSSMTPServerPassword = "CMSSMTPServerPassword"; + public const string CMSSMTPServerTip = "CMSSMTPServerTip"; + public const string CMSSMTPServerUser = "CMSSMTPServerUser"; + public const string CMSSocialMarketingURLShorteningFacebook = "CMSSocialMarketingURLShorteningFacebook"; + public const string CMSSocialMarketingURLShorteningLinkedIn = "CMSSocialMarketingURLShorteningLinkedIn"; + public const string CMSSocialMarketingURLShorteningTwitter = "CMSSocialMarketingURLShorteningTwitter"; + public const string CMSStagingLogChanges = "CMSStagingLogChanges"; + public const string CMSStagingLogDataChanges = "CMSStagingLogDataChanges"; + public const string CMSStagingLogObjectChanges = "CMSStagingLogObjectChanges"; + public const string CMSStagingLogStagingChanges = "CMSStagingLogStagingChanges"; + public const string CMSStagingServiceAuthentication = "CMSStagingServiceAuthentication"; + public const string CMSStagingServiceEnabled = "CMSStagingServiceEnabled"; + public const string CMSStagingServicePassword = "CMSStagingServicePassword"; + public const string CMSStagingServiceUsername = "CMSStagingServiceUsername"; + public const string CMSStagingServiceX509ClientBase64KeyId = "CMSStagingServiceX509ClientBase64KeyId"; + public const string CMSStagingServiceX509ServerBase64KeyId = "CMSStagingServiceX509ServerBase64KeyId"; + public const string CMSStoreAllowAnonymousCustomers = "CMSStoreAllowAnonymousCustomers"; + public const string CMSStoreAllowGlobalDepartments = "CMSStoreAllowGlobalDepartments"; + public const string CMSStoreAllowGlobalManufacturers = "CMSStoreAllowGlobalManufacturers"; + public const string CMSStoreAllowGlobalPaymentMethods = "CMSStoreAllowGlobalPaymentMethods"; + public const string CMSStoreAllowGlobalProductOptions = "CMSStoreAllowGlobalProductOptions"; + public const string CMSStoreAllowGlobalProducts = "CMSStoreAllowGlobalProducts"; + public const string CMSStoreAllowGlobalSuppliers = "CMSStoreAllowGlobalSuppliers"; + public const string CMSStoreAllowProductsWithoutDocuments = "CMSStoreAllowProductsWithoutDocuments"; + public const string CMSStoreAltFormLayoutsInFS = "CMSStoreAltFormLayoutsInFS"; + public const string CMSStoreApplyTaxesBasedOn = "CMSStoreApplyTaxesBasedOn"; + public const string CMSStoreAutoRegisterCustomer = "CMSStoreAutoRegisterCustomer"; + public const string CMSStoreAutoRegistrationEmailTemplate = "CMSStoreAutoRegistrationEmailTemplate"; + public const string CMSStoreCheckoutProcess = "CMSStoreCheckoutProcess"; + public const string CMSStoreDefaultCountryName = "CMSStoreDefaultCountryName"; + public const string CMSStoreDisplayProductsInSectionsTree = "CMSStoreDisplayProductsInSectionsTree"; + public const string CMSStoreEProductsReminder = "CMSStoreEProductsReminder"; + public const string CMSStoreFormerUrls = "CMSStoreFormerUrls"; + public const string CMSStoreFormLayoutsInFS = "CMSStoreFormLayoutsInFS"; + public const string CMSStoreInvoiceNumberPattern = "CMSStoreInvoiceNumberPattern"; + public const string CMSStoreInvoiceTemplate = "CMSStoreInvoiceTemplate"; + public const string CMSStoreLayoutsInFS = "CMSStoreLayoutsInFS"; + public const string CMSStoreMassUnit = "CMSStoreMassUnit"; + public const string CMSStoreNewProductStatus = "CMSStoreNewProductStatus"; + public const string CMSStorePageTemplatesInFS = "CMSStorePageTemplatesInFS"; + public const string CMSStoreProductsAreNewFor = "CMSStoreProductsAreNewFor"; + public const string CMSStoreProductsStartingPath = "CMSStoreProductsStartingPath"; + public const string CMSStoreProductsTree = "CMSStoreProductsTree"; + public const string CMSStoreRedirectToShoppingCart = "CMSStoreRedirectToShoppingCart"; + public const string CMSStoreRelatedProductsRelationshipName = "CMSStoreRelatedProductsRelationshipName"; + public const string CMSStoreRequireCompanyInfo = "CMSStoreRequireCompanyInfo"; + public const string CMSStoreSendEmailsFrom = "CMSStoreSendEmailsFrom"; + public const string CMSStoreSendEmailsTo = "CMSStoreSendEmailsTo"; + public const string CMSStoreSendOrderNotification = "CMSStoreSendOrderNotification"; + public const string CMSStoreSendPaymentNotification = "CMSStoreSendPaymentNotification"; + public const string CMSStoreShowOrganizationID = "CMSStoreShowOrganizationID"; + public const string CMSStoreShowTaxRegistrationID = "CMSStoreShowTaxRegistrationID"; + public const string CMSStoreTransformationsInFS = "CMSStoreTransformationsInFS"; + public const string CMSStoreUseCustomerCultureForEmails = "CMSStoreUseCustomerCultureForEmails"; + public const string CMSStoreUseExtraCompanyAddress = "CMSStoreUseExtraCompanyAddress"; + public const string CMSStoreUseGlobalCredit = "CMSStoreUseGlobalCredit"; + public const string CMSStoreUseGlobalCurrencies = "CMSStoreUseGlobalCurrencies"; + public const string CMSStoreUseGlobalExchangeRates = "CMSStoreUseGlobalExchangeRates"; + public const string CMSStoreUseGlobalInternalStatus = "CMSStoreUseGlobalInternalStatus"; + public const string CMSStoreUseGlobalInvoice = "CMSStoreUseGlobalInvoice"; + public const string CMSStoreUseGlobalOrderStatus = "CMSStoreUseGlobalOrderStatus"; + public const string CMSStoreUseGlobalPublicStatus = "CMSStoreUseGlobalPublicStatus"; + public const string CMSStoreUseGlobalTaxClasses = "CMSStoreUseGlobalTaxClasses"; + public const string CMSStoreWebpartContainersInFS = "CMSStoreWebpartContainersInFS"; + public const string CMSStoreWebPartLayoutsInFS = "CMSStoreWebPartLayoutsInFS"; + public const string CMSStoreWeightFormattingString = "CMSStoreWeightFormattingString"; + public const string CMSTimeZonesEnable = "CMSTimeZonesEnable"; + public const string CMSTrackAverageTimeOnPage = "CMSTrackAverageTimeOnPage"; + public const string CMSTrackExitPages = "CMSTrackExitPages"; + public const string CMSTrackLandingPages = "CMSTrackLandingPages"; + public const string CMSTrackMobileDevices = "CMSTrackMobileDevices"; + public const string CMSTrackOnSiteKeywords = "CMSTrackOnSiteKeywords"; + public const string CMSTrackReferringSitesDirect = "CMSTrackReferringSitesDirect"; + public const string CMSTrackReferringSitesLocal = "CMSTrackReferringSitesLocal"; + public const string CMSTrackReferringSitesReferring = "CMSTrackReferringSitesReferring"; + public const string CMSTrackSearchCrawlers = "CMSTrackSearchCrawlers"; + public const string CMSTrackSearchEngines = "CMSTrackSearchEngines"; + public const string CMSTrackSearchKeywords = "CMSTrackSearchKeywords"; + public const string CMSTranslateFileTypes = "CMSTranslateFileTypes"; + public const string CMSTranslationsAutoImport = "CMSTranslationsAutoImport"; + public const string CMSTranslationsEncoding = "CMSTranslationsEncoding"; + public const string CMSTranslationsLastStatusCheck = "CMSTranslationsLastStatusCheck"; + public const string CMSUpdateDocumentAlias = "CMSUpdateDocumentAlias"; + public const string CMSUploadExtensions = "CMSUploadExtensions"; + public const string CMSUseAutomaticVersionNumbering = "CMSUseAutomaticVersionNumbering"; + public const string CMSUseBizFormsSiteFolder = "CMSUseBizFormsSiteFolder"; + public const string CMSUseCheckinCheckout = "CMSUseCheckinCheckout"; + public const string CMSUseCultureAliasAsLanguagePrefixInUrl = "CMSUseCultureAliasAsLanguagePrefixInUrl"; + public const string CMSUseEventLogListener = "CMSUseEventLogListener"; + public const string CMSUseFilesSiteFolder = "CMSUseFilesSiteFolder"; + public const string CMSUseMediaLibrariesSiteFolder = "CMSUseMediaLibrariesSiteFolder"; + public const string CMSUseObjectCheckinCheckout = "CMSUseObjectCheckinCheckout"; + public const string CMSUsePasswordPolicy = "CMSUsePasswordPolicy"; + public const string CMSUserAccountUnlockPath = "CMSUserAccountUnlockPath"; + public const string CMSUserUniqueEmail = "CMSUserUniqueEmail"; + public const string CMSUseSSL = "CMSUseSSL"; + public const string CMSUseURLsWithTrailingSlash = "CMSUseURLsWithTrailingSlash"; + public const string CMSVersionHistoryLength = "CMSVersionHistoryLength"; + public const string CMSVersioningExtensionsMediaFile = "CMSVersioningExtensionsMediaFile"; + public const string CMSVisitorStatusIdle = "CMSVisitorStatusIdle"; + public const string CMSWebFarmMaxFileSize = "CMSWebFarmMaxFileSize"; + public const string CMSWebFarmMode = "CMSWebFarmMode"; + public const string CMSWebFarmSynchronizeAttachments = "CMSWebFarmSynchronizeAttachments"; + public const string CMSWebFarmSynchronizeAvatars = "CMSWebFarmSynchronizeAvatars"; + public const string CMSWebFarmSynchronizeBizFormFiles = "CMSWebFarmSynchronizeBizFormFiles"; + public const string CMSWebFarmSynchronizeCache = "CMSWebFarmSynchronizeCache"; + public const string CMSWebFarmSynchronizeDeleteFiles = "CMSWebFarmSynchronizeDeleteFiles"; + public const string CMSWebFarmSynchronizeFiles = "CMSWebFarmSynchronizeFiles"; + public const string CMSWebFarmSynchronizeMediaFiles = "CMSWebFarmSynchronizeMediaFiles"; + public const string CMSWebFarmSynchronizeMetaFiles = "CMSWebFarmSynchronizeMetaFiles"; + public const string CMSWebFarmSynchronizePhysicalFiles = "CMSWebFarmSynchronizePhysicalFiles"; + public const string CMSWebFarmSynchronizeSmartSearch = "CMSWebFarmSynchronizeSmartSearch"; + public const string CMSWebFarmSyncInterval = "CMSWebFarmSyncInterval"; + public const string CMSWIFAllowedAudienceUris = "CMSWIFAllowedAudienceUris"; + public const string CMSWIFCertificateValidator = "CMSWIFCertificateValidator"; + public const string CMSWIFEnabled = "CMSWIFEnabled"; + public const string CMSWIFIdentityProviderURL = "CMSWIFIdentityProviderURL"; + public const string CMSWIFRealm = "CMSWIFRealm"; + public const string CMSWIFTrustedCertificateThumbprint = "CMSWIFTrustedCertificateThumbprint"; + public const string CMSWishlistURL = "CMSWishlistURL"; +} diff --git a/Migration.Tool.KX13/SettingsKeys.tt b/Migration.Tool.KX13/SettingsKeys.tt new file mode 100644 index 00000000..91c6e654 --- /dev/null +++ b/Migration.Tool.KX13/SettingsKeys.tt @@ -0,0 +1,29 @@ +<#@ template language="C#" #> +<#@ assembly name="System.Data" #> +<#@ import namespace="System.Data.SqlClient" #> +// ReSharper disable InconsistentNaming +// ReSharper disable IdentifierTypo +namespace Migration.Tool.KX13; + +public static class SettingsKeys { +<# + var connectionString = Environment.GetEnvironmentVariable("KENTICO_MT_DEV_KX13_CONNECTION_STRING"); + using var connection = new SqlConnection(connectionString); + using var cmd = connection.CreateCommand(); + cmd.CommandText = """ + SELECT KeyName + FROM CMS_SettingsKey + WHERE KeyName LIKE 'CMS%' + GROUP BY KeyName + ORDER BY KeyName + """; + connection.Open(); + using var reader = cmd.ExecuteReader(); + while (reader.Read()) + { + WriteLine($""" + public const string {reader[0]} = "{reader[0]}"; + """); + } +#> +} \ No newline at end of file diff --git a/Migration.Toolkit.KX13/genModel.ps1 b/Migration.Tool.KX13/genModel.ps1 similarity index 100% rename from Migration.Toolkit.KX13/genModel.ps1 rename to Migration.Tool.KX13/genModel.ps1 diff --git a/Migration.Toolkit.KXP.Api/Auxiliary/DummyFormFile.cs b/Migration.Tool.KXP.Api/Auxiliary/DummyFormFile.cs similarity index 95% rename from Migration.Toolkit.KXP.Api/Auxiliary/DummyFormFile.cs rename to Migration.Tool.KXP.Api/Auxiliary/DummyFormFile.cs index ed40a649..c9a7ff94 100644 --- a/Migration.Toolkit.KXP.Api/Auxiliary/DummyFormFile.cs +++ b/Migration.Tool.KXP.Api/Auxiliary/DummyFormFile.cs @@ -1,6 +1,6 @@ using CMS.Base; -namespace Migration.Toolkit.KXP.Api.Auxiliary; +namespace Migration.Tool.KXP.Api.Auxiliary; public class DummyUploadedFile : IUploadedFile { diff --git a/Migration.Toolkit.KXP.Api/Auxiliary/FormComponents.cs b/Migration.Tool.KXP.Api/Auxiliary/FormComponents.cs similarity index 99% rename from Migration.Toolkit.KXP.Api/Auxiliary/FormComponents.cs rename to Migration.Tool.KXP.Api/Auxiliary/FormComponents.cs index 60bf3681..ba53773f 100644 --- a/Migration.Toolkit.KXP.Api/Auxiliary/FormComponents.cs +++ b/Migration.Tool.KXP.Api/Auxiliary/FormComponents.cs @@ -1,6 +1,6 @@ // ReSharper disable InconsistentNaming -namespace Migration.Toolkit.KXP.Api.Auxiliary; +namespace Migration.Tool.KXP.Api.Auxiliary; public class FormComponents { diff --git a/Migration.Toolkit.KXP.Api/Auxiliary/UserHelper.cs b/Migration.Tool.KXP.Api/Auxiliary/UserHelper.cs similarity index 78% rename from Migration.Toolkit.KXP.Api/Auxiliary/UserHelper.cs rename to Migration.Tool.KXP.Api/Auxiliary/UserHelper.cs index 9ccc1cbd..d20d67da 100644 --- a/Migration.Toolkit.KXP.Api/Auxiliary/UserHelper.cs +++ b/Migration.Tool.KXP.Api/Auxiliary/UserHelper.cs @@ -1,6 +1,6 @@ -using Migration.Toolkit.KXP.Api.Enums; +using Migration.Tool.KXP.Api.Enums; -namespace Migration.Toolkit.KXP.Api.Auxiliary; +namespace Migration.Tool.KXP.Api.Auxiliary; public class UserHelper { diff --git a/Migration.Tool.KXP.Api/DependencyInjectionExtensions.cs b/Migration.Tool.KXP.Api/DependencyInjectionExtensions.cs new file mode 100644 index 00000000..fb036018 --- /dev/null +++ b/Migration.Tool.KXP.Api/DependencyInjectionExtensions.cs @@ -0,0 +1,31 @@ +using CMS.Base; +using CMS.Core; + +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; + +using Migration.Tool.KXP.Api.Services.CmsClass; + +namespace Migration.Tool.KXP.Api; + +public static class DependencyInjectionExtensions +{ + public static IServiceCollection UseKxpApi(this IServiceCollection services, IConfiguration configuration, string? applicationPhysicalPath = null) + { + Service.Use(configuration); + if (applicationPhysicalPath != null && Directory.Exists(applicationPhysicalPath)) + { + SystemContext.WebApplicationPhysicalPath = applicationPhysicalPath; + } + + + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(s => (s.GetService() as FieldMigrationService)!); + + services.AddSingleton(); + services.AddSingleton(); + + return services; + } +} diff --git a/Migration.Toolkit.KXP.Api/Enums/UserPrivilegeLevelEnum.cs b/Migration.Tool.KXP.Api/Enums/UserPrivilegeLevelEnum.cs similarity index 92% rename from Migration.Toolkit.KXP.Api/Enums/UserPrivilegeLevelEnum.cs rename to Migration.Tool.KXP.Api/Enums/UserPrivilegeLevelEnum.cs index ceefe219..f55e45cc 100644 --- a/Migration.Toolkit.KXP.Api/Enums/UserPrivilegeLevelEnum.cs +++ b/Migration.Tool.KXP.Api/Enums/UserPrivilegeLevelEnum.cs @@ -1,4 +1,4 @@ -namespace Migration.Toolkit.KXP.Api.Enums; +namespace Migration.Tool.KXP.Api.Enums; /// /// copy from Kentico Xperience 13 diff --git a/Migration.Toolkit.KXP.Api/KxpApiInitializer.cs b/Migration.Tool.KXP.Api/KxpApiInitializer.cs similarity index 95% rename from Migration.Toolkit.KXP.Api/KxpApiInitializer.cs rename to Migration.Tool.KXP.Api/KxpApiInitializer.cs index 782d1f53..1b458ee8 100644 --- a/Migration.Toolkit.KXP.Api/KxpApiInitializer.cs +++ b/Migration.Tool.KXP.Api/KxpApiInitializer.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Logging; -namespace Migration.Toolkit.KXP.Api; +namespace Migration.Tool.KXP.Api; public class KxpApiInitializer(ILogger logger) { diff --git a/Migration.Toolkit.KXP.Api/KxpClassFacade.cs b/Migration.Tool.KXP.Api/KxpClassFacade.cs similarity index 98% rename from Migration.Toolkit.KXP.Api/KxpClassFacade.cs rename to Migration.Tool.KXP.Api/KxpClassFacade.cs index d68c1f74..f4ed9575 100644 --- a/Migration.Toolkit.KXP.Api/KxpClassFacade.cs +++ b/Migration.Tool.KXP.Api/KxpClassFacade.cs @@ -3,7 +3,7 @@ using CMS.DataEngine; using CMS.FormEngine; -namespace Migration.Toolkit.KXP.Api; +namespace Migration.Tool.KXP.Api; public record CustomizedFieldInfo(string FieldName); diff --git a/Migration.Toolkit.KXP.Api/KxpMediaFileFacade.cs b/Migration.Tool.KXP.Api/KxpMediaFileFacade.cs similarity index 98% rename from Migration.Toolkit.KXP.Api/KxpMediaFileFacade.cs rename to Migration.Tool.KXP.Api/KxpMediaFileFacade.cs index e85a50be..02464149 100644 --- a/Migration.Toolkit.KXP.Api/KxpMediaFileFacade.cs +++ b/Migration.Tool.KXP.Api/KxpMediaFileFacade.cs @@ -3,7 +3,7 @@ using CMS.MediaLibrary; using Microsoft.Extensions.Logging; -namespace Migration.Toolkit.KXP.Api; +namespace Migration.Tool.KXP.Api; public class KxpMediaFileFacade { diff --git a/Migration.Tool.KXP.Api/Migration.Tool.KXP.Api.csproj b/Migration.Tool.KXP.Api/Migration.Tool.KXP.Api.csproj new file mode 100644 index 00000000..2d3bc8b8 --- /dev/null +++ b/Migration.Tool.KXP.Api/Migration.Tool.KXP.Api.csproj @@ -0,0 +1,21 @@ + + + + Migration.Tool.KXP.Api + Migration.Tool.KXP.Api + + + + + + + + + + + + + + + + diff --git a/Migration.Toolkit.KXP.Api/Services/CmsClass/FieldMigrationService.cs b/Migration.Tool.KXP.Api/Services/CmsClass/FieldMigrationService.cs similarity index 79% rename from Migration.Toolkit.KXP.Api/Services/CmsClass/FieldMigrationService.cs rename to Migration.Tool.KXP.Api/Services/CmsClass/FieldMigrationService.cs index 0cb65327..2df4e0c6 100644 --- a/Migration.Toolkit.KXP.Api/Services/CmsClass/FieldMigrationService.cs +++ b/Migration.Tool.KXP.Api/Services/CmsClass/FieldMigrationService.cs @@ -2,18 +2,21 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; +using Migration.Tool.Common; -namespace Migration.Toolkit.KXP.Api.Services.CmsClass; +namespace Migration.Tool.KXP.Api.Services.CmsClass; public class FieldMigrationService // shall be singleton to cache necessary data + : IFieldMigrationService { private readonly ILogger logger; + private readonly IList fieldMigrations; private readonly FieldMigration[] userDefinedMigrations; - public FieldMigrationService(ToolkitConfiguration configuration, ILogger logger) + public FieldMigrationService(ToolConfiguration configuration, ILogger logger, IEnumerable fieldMigrations) { this.logger = logger; + this.fieldMigrations = fieldMigrations.OrderBy(x => x.Rank).ToList(); var allUserDefinedMigrations = configuration.OptInFeatures?.CustomMigration?.FieldMigrations?.Select(fm => new FieldMigration( @@ -24,12 +27,21 @@ public FieldMigrationService(ToolkitConfiguration configuration, ILogger(); + ).ToArray() ?? []; userDefinedMigrations = allUserDefinedMigrations; } - public FieldMigration? GetFieldMigration(string sourceDataType, string? sourceFormControl, string? fieldName) + public IFieldMigration? GetFieldMigration(FieldMigrationContext fieldMigrationContext) { + foreach (var fieldMigrator in fieldMigrations) + { + if (fieldMigrator.ShallMigrate(fieldMigrationContext)) + { + return fieldMigrator; + } + } + + (string? sourceDataType, string? sourceFormControl, string? fieldName, _) = fieldMigrationContext; if (sourceFormControl == null) { logger.LogDebug("Source field has no control defined '{SourceDataType}', field '{FieldName}'", sourceDataType, fieldName); diff --git a/Migration.Toolkit.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs b/Migration.Tool.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs similarity index 77% rename from Migration.Toolkit.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs rename to Migration.Tool.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs index aeb6e738..903d9b72 100644 --- a/Migration.Toolkit.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs +++ b/Migration.Tool.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs @@ -3,35 +3,35 @@ using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; +using Migration.Tool.Common; -namespace Migration.Toolkit.KXP.Api.Services.CmsClass; +namespace Migration.Tool.KXP.Api.Services.CmsClass; public class FormDefinitionPatcher { - private const string CategoryElem = "category"; - private const string CategoryAttrName = FieldAttrName; - private const string FieldAttrColumn = "column"; - private const string FieldAttrColumntype = "columntype"; - private const string FieldAttrEnabled = "enabled"; - private const string FieldAttrGuid = "guid"; - private const string FieldAttrIspk = "isPK"; - private const string FieldAttrName = "name"; - private const string FieldAttrSize = "size"; - private const int FieldAttrSizeZero = 0; - private const string FieldAttrSystem = "system"; - private const string FieldAttrVisible = "visible"; - private const string FieldElem = "field"; - private const string FieldElemProperties = "properties"; - private const string FieldElemSettings = "settings"; - private const string PropertiesElemDefaultvalue = "defaultvalue"; - private const string SettingsElemControlname = "controlname"; - private const string SettingsMaximumassets = "MaximumAssets"; - private const string SettingsMaximumassetsFallback = "99"; - private const string SettingsMaximumpages = "MaximumPages"; - private const string SettingsMaximumpagesFallback = "99"; - private const string SettingsRootpath = "RootPath"; - private const string SettingsRootpathFallback = "/"; + public const string CategoryElem = "category"; + public const string CategoryAttrName = FieldAttrName; + public const string FieldAttrColumn = "column"; + public const string FieldAttrColumntype = "columntype"; + public const string FieldAttrEnabled = "enabled"; + public const string FieldAttrGuid = "guid"; + public const string FieldAttrIspk = "isPK"; + public const string FieldAttrName = "name"; + public const string FieldAttrSize = "size"; + public const int FieldAttrSizeZero = 0; + public const string FieldAttrSystem = "system"; + public const string FieldAttrVisible = "visible"; + public const string FieldElem = "field"; + public const string FieldElemProperties = "properties"; + public const string FieldElemSettings = "settings"; + public const string PropertiesElemDefaultvalue = "defaultvalue"; + public const string SettingsElemControlname = "controlname"; + public const string SettingsMaximumassets = "MaximumAssets"; + public const string SettingsMaximumassetsFallback = "99"; + public const string SettingsMaximumpages = "MaximumPages"; + public const string SettingsMaximumpagesFallback = "99"; + public const string SettingsRootpath = "RootPath"; + public const string SettingsRootpathFallback = "/"; private readonly IReadOnlySet allowedFieldAttributes = new HashSet([ // taken from FormFieldInfo.GetAttributes() method @@ -60,7 +60,7 @@ public class FormDefinitionPatcher private readonly bool classIsDocumentType; private readonly bool classIsForm; private readonly bool discardSysFields; - private readonly FieldMigrationService fieldMigrationService; + private readonly IFieldMigrationService fieldMigrationService; private readonly string formDefinitionXml; private readonly ILogger logger; @@ -68,7 +68,7 @@ public class FormDefinitionPatcher public FormDefinitionPatcher(ILogger logger, string formDefinitionXml, - FieldMigrationService fieldMigrationService, + IFieldMigrationService fieldMigrationService, bool classIsForm, bool classIsDocumentType, bool discardSysFields, @@ -162,7 +162,7 @@ public void PatchFields() public string? GetPatched() => xDoc.Root?.ToString(); - private void PatchField(XElement field) + public void PatchField(XElement field) { var columnAttr = field.Attribute(FieldAttrColumn); var systemAttr = field.Attribute(FieldAttrSystem); @@ -211,36 +211,48 @@ private void PatchField(XElement field) var controlNameElem = field.XPathSelectElement($"{FieldElemSettings}/{SettingsElemControlname}"); string? controlName = controlNameElem?.Value; - if (fieldMigrationService.GetFieldMigration(columnType, controlName, columnAttr?.Value) is var (_, targetDataType, _, targetFormComponent, actions, _)) + var fieldMigrationContext = new FieldMigrationContext(columnType, controlName, columnAttr?.Value, new EmptySourceObjectContext()); + switch (fieldMigrationService.GetFieldMigration(fieldMigrationContext)) { - logger.LogDebug("Field {FieldDescriptor} DataType: {SourceDataType} => {TargetDataType}", fieldDescriptor, columnType, targetDataType); - columnTypeAttr?.SetValue(targetDataType); - switch (targetFormComponent) + case FieldMigration(_, var targetDataType, _, var targetFormComponent, var actions, _): { - case TfcDirective.DoNothing: - logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:{TcaDirective}", fieldDescriptor, targetFormComponent); - PerformActionsOnField(field, fieldDescriptor, actions); - break; - case TfcDirective.Clear: - logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:{TcaDirective}", fieldDescriptor, targetFormComponent); - field.RemoveNodes(); - visibleAttr?.SetValue(false); - break; - case TfcDirective.CopySourceControl: - logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:{TcaDirective} => {ControlName}", fieldDescriptor, targetFormComponent, controlName); - controlNameElem?.SetValue(controlName); - PerformActionsOnField(field, fieldDescriptor, actions); - break; - default: + logger.LogDebug("Field {FieldDescriptor} DataType: {SourceDataType} => {TargetDataType}", fieldDescriptor, columnType, targetDataType); + columnTypeAttr?.SetValue(targetDataType); + switch (targetFormComponent) { - logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:NONE => from control '{ControlName}' => {TargetFormComponent}", fieldDescriptor, controlName, targetFormComponent); - controlNameElem?.SetValue(targetFormComponent); - PerformActionsOnField(field, fieldDescriptor, actions); - break; + case TfcDirective.DoNothing: + logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:{TcaDirective}", fieldDescriptor, targetFormComponent); + PerformActionsOnField(field, fieldDescriptor, actions); + break; + case TfcDirective.Clear: + logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:{TcaDirective}", fieldDescriptor, targetFormComponent); + field.RemoveNodes(); + visibleAttr?.SetValue(false); + break; + case TfcDirective.CopySourceControl: + logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:{TcaDirective} => {ControlName}", fieldDescriptor, targetFormComponent, controlName); + controlNameElem?.SetValue(controlName); + PerformActionsOnField(field, fieldDescriptor, actions); + break; + default: + { + logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:NONE => from control '{ControlName}' => {TargetFormComponent}", fieldDescriptor, controlName, targetFormComponent); + controlNameElem?.SetValue(targetFormComponent); + PerformActionsOnField(field, fieldDescriptor, actions); + break; + } } + break; + } + case { } fieldMigration when fieldMigration.ShallMigrate(fieldMigrationContext): + { + fieldMigration.MigrateFieldDefinition(this, field, columnTypeAttr, fieldDescriptor); + break; } - } + default: + break; + } if (!classIsForm && !classIsDocumentType) { @@ -308,7 +320,7 @@ private void PatchField(XElement field) if (classIsForm || classIsDocumentType) { - if (field.Attribute(FieldAttrVisible) is { } visible) + if (field.Attribute(FieldAttrVisible) is { } visible && field.Attribute(FieldAttrEnabled) is null) { field.Add(new XAttribute(FieldAttrEnabled, visible.Value)); logger.LogDebug("Set field '{Field}' attribute '{Attribute}' to value '{Value}' from attribute '{SourceAttribute}'", fieldDescriptor, FieldAttrEnabled, visible, FieldAttrVisible); diff --git a/Migration.Tool.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs b/Migration.Tool.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs new file mode 100644 index 00000000..74c2b01f --- /dev/null +++ b/Migration.Tool.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs @@ -0,0 +1,162 @@ +using System.Text.RegularExpressions; +using System.Xml.Linq; +using CMS.DataEngine; +using CMS.OnlineForms; +using Migration.Tool.Common; +using Migration.Tool.Common.Enumerations; +using Migration.Tool.KXP.Api.Auxiliary; +using FcLongText = Migration.Tool.Common.Enumerations.Kx13FormControls.UserControlForLongText; +using FcText = Migration.Tool.Common.Enumerations.Kx13FormControls.UserControlForText; + +namespace Migration.Tool.KXP.Api.Services.CmsClass; + +public record FormComponentReplacement(string OldFormComponent, string NewFormComponent); + +public record DataTypeMigrationModel( + FieldMigration[] FieldMigrations, + FormComponentReplacement[] NotSupportedInKxpLegacyMode, + [property: Obsolete("Legacy mode is no longer supported")] string[] SupportedInKxpLegacyMode +); + +public interface ISourceObjectContext; + +public record EmptySourceObjectContext : ISourceObjectContext; +public record FieldMigrationContext(string SourceDataType, string? SourceFormControl, string? FieldName, ISourceObjectContext SourceObjectContext); +public record FieldMigrationResult(bool Success, object? MigratedValue); +public interface IFieldMigration +{ + /// + /// custom migrations are sorted by this number, first encountered migration wins. Values higher than 100 000 are set to default migrations, set number bellow 100 000 for custom migrations + /// + int Rank { get; } + + /// + /// Methods determines if this migration is usable in context + /// + /// Expect multiple context types: for pages, for data class + /// + bool ShallMigrate(FieldMigrationContext context); + + /// + /// Performs migration of FormField, result is mutated property field + /// + /// Helper class for execution of common functionalities + /// Field for migration + /// field type - in xml "columntype" + /// field name or field GUID if field name is not specified + void MigrateFieldDefinition(FormDefinitionPatcher formDefinitionPatcher, XElement field, XAttribute? columnTypeAttr, string fieldDescriptor); + /// + /// Performs migration of field value + /// + /// Value from source instance for migration directly from database reader (DBNull may be encountered) + /// Context for pages + /// If migration of field succeeds, returns success and migrated value. If not, returns false as success and null reference as value + Task MigrateValue(object? sourceValue, FieldMigrationContext context); +} + +public record FieldMigration(string SourceDataType, string TargetDataType, string SourceFormControl, string? TargetFormComponent, string[]? Actions = null, Regex? FieldNameRegex = null) : IFieldMigration +{ + public int Rank => 100_000; + public bool ShallMigrate(FieldMigrationContext context) => throw new NotImplementedException(); + public Task MigrateValue(object? sourceValue, FieldMigrationContext context) => throw new NotImplementedException(); + public void MigrateFieldDefinition(FormDefinitionPatcher formDefinitionPatcher, XElement field, XAttribute? columnTypeAttr, string fieldDescriptor) => throw new NotImplementedException(); +} + +/// +/// Tca = target control action +/// +public static class TcaDirective +{ + public const string ClearSettings = "clear settings"; + public const string ClearMacroTable = "clear hashtable"; + public const string ConvertToAsset = "convert to asset"; + public const string ConvertToPages = "convert to pages"; + public const string ConvertToRichText = "convert to richtext"; +} + +/// +/// Tfc = Target form component +/// +public static class TfcDirective +{ + public const string CopySourceControl = "#copy-source-control#"; + public const string DoNothing = "#nothing#"; + public const string Clear = "#clear#"; +} + +/// +/// Sfc = source form control +/// +public static class SfcDirective +{ + public const string CatchAnyNonMatching = "#any#"; +} + +public static class FieldMappingInstance +{ + public static void PrepareFieldMigrations(ToolConfiguration configuration) + { + var m = new List(); + m.AddRange([ + new FieldMigration(KsFieldDataType.ALL, FieldDataType.ALL, SfcDirective.CatchAnyNonMatching, null, [TfcDirective.Clear]), + new FieldMigration(KsFieldDataType.Unknown, FieldDataType.Unknown, SfcDirective.CatchAnyNonMatching, null, [TfcDirective.Clear]), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.TextBoxControl, FormComponents.AdminTextInputComponent), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.DropDownListControl, FormComponents.AdminDropDownComponent), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.IconSelector, FormComponents.AdminIconSelectorComponent), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.Password, FormComponents.AdminPasswordComponent), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.RadioButtonsControl, FormComponents.AdminRadioGroupComponent), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.TextAreaControl, FormComponents.AdminTextAreaComponent), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextInputComponent), + new FieldMigration(KsFieldDataType.LongText, FieldDataType.RichTextHTML, FcLongText.HtmlAreaControl, FormComponents.AdminRichTextEditorComponent, [TcaDirective.ConvertToRichText]), + new FieldMigration(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.TextBoxControl, FormComponents.AdminTextInputComponent), + new FieldMigration(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.DropDownListControl, FormComponents.AdminDropDownComponent), + new FieldMigration(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.TextAreaControl, FormComponents.AdminTextAreaComponent), + new FieldMigration(KsFieldDataType.LongText, FieldDataType.LongText, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextAreaComponent), + new FieldMigration(KsFieldDataType.Integer, FieldDataType.Integer, SfcDirective.CatchAnyNonMatching, FormComponents.AdminNumberInputComponent), + new FieldMigration(KsFieldDataType.LongInteger, FieldDataType.LongInteger, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear, [TfcDirective.Clear]), //FormComponents.AdminNumberInputComponent), + new FieldMigration(KsFieldDataType.Double, FieldDataType.Double, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear, [TfcDirective.Clear]), // FormComponents.AdminNumberInputComponent), + new FieldMigration(KsFieldDataType.Decimal, FieldDataType.Decimal, SfcDirective.CatchAnyNonMatching, FormComponents.AdminDecimalNumberInputComponent), + new FieldMigration(KsFieldDataType.DateTime, FieldDataType.DateTime, SfcDirective.CatchAnyNonMatching, FormComponents.AdminDateTimeInputComponent), + new FieldMigration(KsFieldDataType.Date, FieldDataType.Date, SfcDirective.CatchAnyNonMatching, FormComponents.AdminDateInputComponent), + new FieldMigration(KsFieldDataType.TimeSpan, FieldDataType.TimeSpan, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextInputComponent), + new FieldMigration(KsFieldDataType.Boolean, FieldDataType.Boolean, SfcDirective.CatchAnyNonMatching, FormComponents.AdminCheckBoxComponent), + new FieldMigration(KsFieldDataType.Guid, FieldDataType.LongText, "RelatedDocuments", FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent, [TcaDirective.ConvertToPages]), + new FieldMigration(KsFieldDataType.Guid, FieldDataType.Guid, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear), + new FieldMigration(KsFieldDataType.Binary, FieldDataType.Binary, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear), + new FieldMigration(KsFieldDataType.Xml, FieldDataType.Xml, SfcDirective.CatchAnyNonMatching, FormComponents.AdminNumberWithLabelComponent), + new FieldMigration(KsFieldDataType.DocRelationships, FieldDataType.WebPages, SfcDirective.CatchAnyNonMatching, FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent, [TcaDirective.ConvertToPages]), + + new FieldMigration(KsFieldDataType.TimeSpan, FieldDataType.TimeSpan, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextInputComponent, []), + new FieldMigration(KsFieldDataType.BizFormFile, BizFormUploadFile.DATATYPE_FORMFILE, SfcDirective.CatchAnyNonMatching, FormComponents.MvcFileUploaderComponent, []) + ]); + + if (configuration.MigrateMediaToMediaLibrary) + { + m.AddRange([ + new FieldMigration(KsFieldDataType.DocAttachments, FieldDataType.Assets, SfcDirective.CatchAnyNonMatching, FormComponents.AdminAssetSelectorComponent, [TcaDirective.ConvertToAsset]), + new FieldMigration(KsFieldDataType.File, FieldDataType.Assets, SfcDirective.CatchAnyNonMatching, FormComponents.AdminAssetSelectorComponent, [TcaDirective.ConvertToAsset]), + ]); + } + else + { + m.AddRange([ + new FieldMigration(KsFieldDataType.DocAttachments, FieldDataType.ContentItemReference, SfcDirective.CatchAnyNonMatching, FormComponents.AdminContentItemSelectorComponent, [TcaDirective.ConvertToAsset]), + new FieldMigration(KsFieldDataType.File, FieldDataType.ContentItemReference, SfcDirective.CatchAnyNonMatching, FormComponents.AdminContentItemSelectorComponent, [TcaDirective.ConvertToAsset]), + ]); + } + + BuiltInFieldMigrations = [.. m]; + } + + public static FieldMigration[] BuiltInFieldMigrations { get; private set; } = null!; + + public static DataTypeMigrationModel BuiltInModel => new( + BuiltInFieldMigrations, + [ + new FormComponentReplacement(Kx13FormComponents.Kentico_AttachmentSelector, FormComponents.AdminAssetSelectorComponent), + new FormComponentReplacement(Kx13FormComponents.Kentico_PageSelector, FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent), + new FormComponentReplacement(Kx13FormComponents.Kentico_PathSelector, FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent) + ], + [] // legacy mode is no more + ); +} diff --git a/Migration.Tool.KXP.Api/Services/CmsClass/IFieldMigrationService.cs b/Migration.Tool.KXP.Api/Services/CmsClass/IFieldMigrationService.cs new file mode 100644 index 00000000..4682c054 --- /dev/null +++ b/Migration.Tool.KXP.Api/Services/CmsClass/IFieldMigrationService.cs @@ -0,0 +1,6 @@ +namespace Migration.Tool.KXP.Api.Services.CmsClass; + +public interface IFieldMigrationService +{ + IFieldMigration? GetFieldMigration(FieldMigrationContext fieldMigrationContext); +} diff --git a/Migration.Toolkit.KXP.Extensions/LegacyAttachmentHandler.cs b/Migration.Tool.KXP.Extensions/LegacyAttachmentHandler.cs similarity index 100% rename from Migration.Toolkit.KXP.Extensions/LegacyAttachmentHandler.cs rename to Migration.Tool.KXP.Extensions/LegacyAttachmentHandler.cs diff --git a/Migration.Toolkit.KXP.Extensions/Migration.Toolkit.KXP.Extensions.csproj b/Migration.Tool.KXP.Extensions/Migration.Tool.KXP.Extensions.csproj similarity index 100% rename from Migration.Toolkit.KXP.Extensions/Migration.Toolkit.KXP.Extensions.csproj rename to Migration.Tool.KXP.Extensions/Migration.Tool.KXP.Extensions.csproj diff --git a/Migration.Toolkit.KXP.Extensions/README.MD b/Migration.Tool.KXP.Extensions/README.MD similarity index 87% rename from Migration.Toolkit.KXP.Extensions/README.MD rename to Migration.Tool.KXP.Extensions/README.MD index 16e29a8b..b21b8e62 100644 --- a/Migration.Toolkit.KXP.Extensions/README.MD +++ b/Migration.Tool.KXP.Extensions/README.MD @@ -1,6 +1,6 @@ ## Handler for legacy attachment URLs -Page attachments are not supported in Xperience by Kentico. Instead, the [Migration toolkit](/README.md) transfers +Page attachments are not supported in Xperience by Kentico. Instead, the [Migration tool](/README.md) transfers attachment files into [media libraries](https://docs.xperience.io/x/agKiCQ). Any attachment files in the content of pages migrated from the source instance (KX13/K12) still use the old attachment @@ -28,9 +28,9 @@ The `LegacyAttachmentHandler.cs` handler can serve the following legacy attachme 1. Open your Xperience by Kentico solution in Visual Studio. 2. Add a custom assembly (_Class Library_ project) to your solution or re-use an existing one. See the [Integrate custom code](https://docs.xperience.io/x/QoXWCQ) documentation for details. -3. Copy the `[Migration toolkit repository]\Migration.Toolkit.KXP.Extensions\LegacyAttachmentHandler.cs` file into your +3. Copy the `[Migration tool repository]\Migration.Tool.KXP.Extensions\LegacyAttachmentHandler.cs` file into your custom class library. -4. Change the default `Migration.Toolkit.KXP.Extensions` namespace in the class's code to fit your project and company. +4. Change the default `Migration.Tool.KXP.Extensions` namespace in the class's code to fit your project and company. 5. Rebuild your Xperience by Kentico solution. The handler now processes legacy attachment URLs in your website's migrated content and returns matching media library diff --git a/Migration.Toolkit.KXP/Context/KxpContext.cs b/Migration.Tool.KXP/Context/KxpContext.cs similarity index 99% rename from Migration.Toolkit.KXP/Context/KxpContext.cs rename to Migration.Tool.KXP/Context/KxpContext.cs index ff85bc8e..5659995c 100644 --- a/Migration.Toolkit.KXP/Context/KxpContext.cs +++ b/Migration.Tool.KXP/Context/KxpContext.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; -using Migration.Toolkit.KXP.Models; +using Migration.Tool.KXP.Models; -namespace Migration.Toolkit.KXP.Context; +namespace Migration.Tool.KXP.Context; public partial class KxpContext : DbContext { diff --git a/Migration.Tool.KXP/DependencyInjectionExtensions.cs b/Migration.Tool.KXP/DependencyInjectionExtensions.cs new file mode 100644 index 00000000..7ac86e2f --- /dev/null +++ b/Migration.Tool.KXP/DependencyInjectionExtensions.cs @@ -0,0 +1,22 @@ +using System.Diagnostics; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; + +using Migration.Tool.Common; +using Migration.Tool.KXP.Context; + +namespace Migration.Tool.KXP; + +public static class DependencyInjectionExtensions +{ + public static IServiceCollection UseKxpDbContext(this IServiceCollection services, ToolConfiguration toolConfiguration) + { + services.AddDbContextFactory(options => + { + Debug.Assert(toolConfiguration.XbKConnectionString != null, "toolConfiguration.XbKConnectionString != null"); + options.UseSqlServer(toolConfiguration.XbKConnectionString); + }); + return services; + } +} diff --git a/Migration.Tool.KXP/Migration.Tool.KXP.csproj b/Migration.Tool.KXP/Migration.Tool.KXP.csproj new file mode 100644 index 00000000..e6c080c4 --- /dev/null +++ b/Migration.Tool.KXP/Migration.Tool.KXP.csproj @@ -0,0 +1,30 @@ + + + + Migration.Tool.KXP + Migration.Tool.KXP + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + diff --git a/Migration.Toolkit.KXP/Models/CdMigration.cs b/Migration.Tool.KXP/Models/CdMigration.cs similarity index 93% rename from Migration.Toolkit.KXP/Models/CdMigration.cs rename to Migration.Tool.KXP/Models/CdMigration.cs index c7c31273..1d8db573 100644 --- a/Migration.Toolkit.KXP/Models/CdMigration.cs +++ b/Migration.Tool.KXP/Models/CdMigration.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CD_Migration")] [Index("MigrationName", Name = "IX_CD_Migration_MigrationName", IsUnique = true)] diff --git a/Migration.Tool.KXP/Models/CiFileMetadatum.cs b/Migration.Tool.KXP/Models/CiFileMetadatum.cs new file mode 100644 index 00000000..967066d3 --- /dev/null +++ b/Migration.Tool.KXP/Models/CiFileMetadatum.cs @@ -0,0 +1,21 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CI_FileMetadata")] +[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] +public class CiFileMetadatum +{ + [Key] + [Column("FileMetadataID")] + public int FileMetadataId { get; set; } + + [StringLength(260)] + public string FileLocation { get; set; } = null!; + + [StringLength(32)] + public string FileHash { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/CiMigration.cs b/Migration.Tool.KXP/Models/CiMigration.cs new file mode 100644 index 00000000..12bbe9fe --- /dev/null +++ b/Migration.Tool.KXP/Models/CiMigration.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CI_Migration")] +[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] +public class CiMigration +{ + [Key] + [Column("MigrationID")] + public int MigrationId { get; set; } + + [StringLength(255)] + public string MigrationName { get; set; } = null!; + + [Precision(3)] + public DateTime DateApplied { get; set; } + + public int? RowsAffected { get; set; } +} diff --git a/Migration.Tool.KXP/Models/CmsAlternativeForm.cs b/Migration.Tool.KXP/Models/CmsAlternativeForm.cs new file mode 100644 index 00000000..67bd7f05 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsAlternativeForm.cs @@ -0,0 +1,48 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_AlternativeForm")] +[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] +[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] +public class CmsAlternativeForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(50)] + public string FormName { get; set; } = null!; + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public string? FormDefinition { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + [Column("FormCoupledClassID")] + public int? FormCoupledClassId { get; set; } + + [StringLength(400)] + public string? FormCustomizedColumns { get; set; } + + public bool? FormIsCustom { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsAlternativeFormFormClasses")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormCoupledClassId")] + [InverseProperty("CmsAlternativeFormFormCoupledClasses")] + public virtual CmsClass? FormCoupledClass { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsApplicationPermission.cs b/Migration.Tool.KXP/Models/CmsApplicationPermission.cs similarity index 95% rename from Migration.Toolkit.KXP/Models/CmsApplicationPermission.cs rename to Migration.Tool.KXP/Models/CmsApplicationPermission.cs index cf81af8f..7f27fda8 100644 --- a/Migration.Toolkit.KXP/Models/CmsApplicationPermission.cs +++ b/Migration.Tool.KXP/Models/CmsApplicationPermission.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_ApplicationPermission")] [Index("RoleId", Name = "IX_CMS_ApplicationPermission_RoleID")] diff --git a/Migration.Tool.KXP/Models/CmsAutomationHistory.cs b/Migration.Tool.KXP/Models/CmsAutomationHistory.cs new file mode 100644 index 00000000..dae21c8f --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsAutomationHistory.cs @@ -0,0 +1,81 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_AutomationHistory")] +[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] +[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] +[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] +[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] +[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] +[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] +public class CmsAutomationHistory +{ + [Key] + [Column("HistoryID")] + public int HistoryId { get; set; } + + [Column("HistoryStepID")] + public int? HistoryStepId { get; set; } + + [StringLength(440)] + public string? HistoryStepName { get; set; } + + [StringLength(450)] + public string HistoryStepDisplayName { get; set; } = null!; + + public int? HistoryStepType { get; set; } + + [Column("HistoryTargetStepID")] + public int? HistoryTargetStepId { get; set; } + + [StringLength(440)] + public string? HistoryTargetStepName { get; set; } + + [StringLength(450)] + public string? HistoryTargetStepDisplayName { get; set; } + + public int? HistoryTargetStepType { get; set; } + + [Column("HistoryApprovedByUserID")] + public int? HistoryApprovedByUserId { get; set; } + + public DateTime? HistoryApprovedWhen { get; set; } + + public string? HistoryComment { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + public bool HistoryWasRejected { get; set; } + + [Column("HistoryStateID")] + public int HistoryStateId { get; set; } + + [ForeignKey("HistoryApprovedByUserId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsUser? HistoryApprovedByUser { get; set; } + + [ForeignKey("HistoryStateId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsAutomationState HistoryState { get; set; } = null!; + + [ForeignKey("HistoryStepId")] + [InverseProperty("CmsAutomationHistoryHistorySteps")] + public virtual CmsWorkflowStep? HistoryStep { get; set; } + + [ForeignKey("HistoryTargetStepId")] + [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] + public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/CmsAutomationState.cs b/Migration.Tool.KXP/Models/CmsAutomationState.cs new file mode 100644 index 00000000..c8c3f434 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsAutomationState.cs @@ -0,0 +1,62 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_AutomationState")] +[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] +[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] +[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] +[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] +public class CmsAutomationState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [Column("StateStepID")] + public int StateStepId { get; set; } + + [Column("StateObjectID")] + public int StateObjectId { get; set; } + + [StringLength(100)] + public string StateObjectType { get; set; } = null!; + + [StringLength(450)] + public string? StateActionStatus { get; set; } + + public DateTime? StateCreated { get; set; } + + public DateTime? StateLastModified { get; set; } + + [Column("StateWorkflowID")] + public int StateWorkflowId { get; set; } + + public int? StateStatus { get; set; } + + [Column("StateUserID")] + public int? StateUserId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public string? StateCustomData { get; set; } + + [InverseProperty("HistoryState")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [ForeignKey("StateStepId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflowStep StateStep { get; set; } = null!; + + [ForeignKey("StateUserId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsUser? StateUser { get; set; } + + [ForeignKey("StateWorkflowId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflow StateWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/CmsAutomationTemplate.cs b/Migration.Tool.KXP/Models/CmsAutomationTemplate.cs new file mode 100644 index 00000000..298e5264 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsAutomationTemplate.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_AutomationTemplate")] +[Index("TemplateDisplayName", Name = "IX_CMS_AutomationTemplate_TemplateDisplayName")] +public class CmsAutomationTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(250)] + public string TemplateDisplayName { get; set; } = null!; + + public string? TemplateDescription { get; set; } + + [StringLength(200)] + public string? TemplateIconClass { get; set; } + + public string? TemplateConfiguration { get; set; } + + public Guid TemplateGuid { get; set; } + + public DateTime TemplateLastModified { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsChannel.cs b/Migration.Tool.KXP/Models/CmsChannel.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/CmsChannel.cs rename to Migration.Tool.KXP/Models/CmsChannel.cs index 4fd418a4..722ee3bc 100644 --- a/Migration.Toolkit.KXP/Models/CmsChannel.cs +++ b/Migration.Tool.KXP/Models/CmsChannel.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_Channel")] public class CmsChannel diff --git a/Migration.Tool.KXP/Models/CmsClass.cs b/Migration.Tool.KXP/Models/CmsClass.cs new file mode 100644 index 00000000..eea78805 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsClass.cs @@ -0,0 +1,96 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_Class")] +[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] +[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] +[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] +public class CmsClass +{ + [Key] + [Column("ClassID")] + public int ClassId { get; set; } + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + public string ClassXmlSchema { get; set; } = null!; + + public string ClassFormDefinition { get; set; } = null!; + + [StringLength(100)] + public string? ClassTableName { get; set; } + + public bool? ClassShowTemplateSelection { get; set; } + + public DateTime ClassLastModified { get; set; } + + [Column("ClassGUID")] + public Guid ClassGuid { get; set; } + + public string? ClassContactMapping { get; set; } + + public bool? ClassContactOverwriteEnabled { get; set; } + + [StringLength(100)] + public string? ClassConnectionString { get; set; } + + [StringLength(100)] + public string? ClassDefaultObjectType { get; set; } + + [Column("ClassResourceID")] + public int? ClassResourceId { get; set; } + + public string? ClassCodeGenerationSettings { get; set; } + + [StringLength(200)] + public string? ClassIconClass { get; set; } + + public bool ClassHasUnmanagedDbSchema { get; set; } + + [StringLength(10)] + public string ClassType { get; set; } = null!; + + [StringLength(10)] + public string? ClassContentTypeType { get; set; } + + public bool? ClassWebPageHasUrl { get; set; } + + [StringLength(100)] + public string? ClassShortName { get; set; } + + [ForeignKey("ClassResourceId")] + [InverseProperty("CmsClasses")] + public virtual CmsResource? ClassResource { get; set; } + + [InverseProperty("FormClass")] + public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); + + [InverseProperty("FormCoupledClass")] + public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); + + [InverseProperty("ContentItemContentType")] + public virtual ICollection CmsContentItems { get; set; } = new List(); + + [InverseProperty("ContentTypeChannelContentType")] + public virtual ICollection CmsContentTypeChannels { get; set; } = new List(); + + [InverseProperty("ContentWorkflowContentTypeContentType")] + public virtual ICollection CmsContentWorkflowContentTypes { get; set; } = new List(); + + [InverseProperty("FormClass")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsQueries { get; set; } = new List(); + + [InverseProperty("EmailTemplateContentTypeContentType")] + public virtual ICollection EmailLibraryEmailTemplateContentTypes { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsConsent.cs b/Migration.Tool.KXP/Models/CmsConsent.cs new file mode 100644 index 00000000..e07b785d --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsConsent.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_Consent")] +public class CmsConsent +{ + [Key] + [Column("ConsentID")] + public int ConsentId { get; set; } + + [StringLength(200)] + public string ConsentDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ConsentName { get; set; } = null!; + + public string ConsentContent { get; set; } = null!; + + public Guid ConsentGuid { get; set; } + + public DateTime ConsentLastModified { get; set; } + + [StringLength(100)] + public string ConsentHash { get; set; } = null!; + + [InverseProperty("ConsentAgreementConsent")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [InverseProperty("ConsentArchiveConsent")] + public virtual ICollection CmsConsentArchives { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsConsentAgreement.cs b/Migration.Tool.KXP/Models/CmsConsentAgreement.cs new file mode 100644 index 00000000..d16a24fc --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsConsentAgreement.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_ConsentAgreement")] +[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] +public class CmsConsentAgreement +{ + [Key] + [Column("ConsentAgreementID")] + public int ConsentAgreementId { get; set; } + + public Guid ConsentAgreementGuid { get; set; } + + public bool ConsentAgreementRevoked { get; set; } + + [Column("ConsentAgreementContactID")] + public int ConsentAgreementContactId { get; set; } + + [Column("ConsentAgreementConsentID")] + public int ConsentAgreementConsentId { get; set; } + + [StringLength(100)] + public string? ConsentAgreementConsentHash { get; set; } + + public DateTime ConsentAgreementTime { get; set; } + + [ForeignKey("ConsentAgreementConsentId")] + [InverseProperty("CmsConsentAgreements")] + public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; + + [ForeignKey("ConsentAgreementContactId")] + [InverseProperty("CmsConsentAgreements")] + public virtual OmContact ConsentAgreementContact { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/CmsConsentArchive.cs b/Migration.Tool.KXP/Models/CmsConsentArchive.cs new file mode 100644 index 00000000..3b82071f --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsConsentArchive.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_ConsentArchive")] +[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] +public class CmsConsentArchive +{ + [Key] + [Column("ConsentArchiveID")] + public int ConsentArchiveId { get; set; } + + public Guid ConsentArchiveGuid { get; set; } + + public DateTime ConsentArchiveLastModified { get; set; } + + [Column("ConsentArchiveConsentID")] + public int ConsentArchiveConsentId { get; set; } + + [StringLength(100)] + public string ConsentArchiveHash { get; set; } = null!; + + public string ConsentArchiveContent { get; set; } = null!; + + [ForeignKey("ConsentArchiveConsentId")] + [InverseProperty("CmsConsentArchives")] + public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsContentFolder.cs b/Migration.Tool.KXP/Models/CmsContentFolder.cs similarity index 98% rename from Migration.Toolkit.KXP/Models/CmsContentFolder.cs rename to Migration.Tool.KXP/Models/CmsContentFolder.cs index e5541ece..5563d8f5 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentFolder.cs +++ b/Migration.Tool.KXP/Models/CmsContentFolder.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_ContentFolder")] [Index("ContentFolderCreatedByUserId", Name = "IX_CMS_ContentFolder_ContentFolderCreatedByUserID")] diff --git a/Migration.Toolkit.KXP/Models/CmsContentItem.cs b/Migration.Tool.KXP/Models/CmsContentItem.cs similarity index 98% rename from Migration.Toolkit.KXP/Models/CmsContentItem.cs rename to Migration.Tool.KXP/Models/CmsContentItem.cs index 2121b16b..d40cf160 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItem.cs +++ b/Migration.Tool.KXP/Models/CmsContentItem.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_ContentItem")] [Index("ContentItemContentFolderId", Name = "IX_CMS_ContentItem_ContentItemContentFolderID")] diff --git a/Migration.Toolkit.KXP/Models/CmsContentItemCommonDatum.cs b/Migration.Tool.KXP/Models/CmsContentItemCommonDatum.cs similarity index 98% rename from Migration.Toolkit.KXP/Models/CmsContentItemCommonDatum.cs rename to Migration.Tool.KXP/Models/CmsContentItemCommonDatum.cs index 6f6daefe..386ce8a5 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItemCommonDatum.cs +++ b/Migration.Tool.KXP/Models/CmsContentItemCommonDatum.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_ContentItemCommonData")] [Index("ContentItemCommonDataContentItemId", "ContentItemCommonDataContentLanguageId", "ContentItemCommonDataIsLatest", Name = "IX_CMS_ContentItemCommonData_ContentItemID_ContentLanguageID_IsLatest", IsUnique = true)] diff --git a/Migration.Toolkit.KXP/Models/CmsContentItemLanguageMetadatum.cs b/Migration.Tool.KXP/Models/CmsContentItemLanguageMetadatum.cs similarity index 98% rename from Migration.Toolkit.KXP/Models/CmsContentItemLanguageMetadatum.cs rename to Migration.Tool.KXP/Models/CmsContentItemLanguageMetadatum.cs index ab1c3682..fe3ce252 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItemLanguageMetadatum.cs +++ b/Migration.Tool.KXP/Models/CmsContentItemLanguageMetadatum.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_ContentItemLanguageMetadata")] [Index("ContentItemLanguageMetadataContentItemId", "ContentItemLanguageMetadataContentLanguageId", "ContentItemLanguageMetadataLatestVersionStatus", Name = "IX_CMS_ContentItemLanguageMetadata_ContentItemID_ContentLanguageID_LatestVersionStatus", diff --git a/Migration.Toolkit.KXP/Models/CmsContentItemReference.cs b/Migration.Tool.KXP/Models/CmsContentItemReference.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/CmsContentItemReference.cs rename to Migration.Tool.KXP/Models/CmsContentItemReference.cs index e9562e8d..42981230 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItemReference.cs +++ b/Migration.Tool.KXP/Models/CmsContentItemReference.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_ContentItemReference")] [Index("ContentItemReferenceSourceCommonDataId", Name = "IX_CMS_ContentItemReference_ContentItemReferenceSourceCommonDataID")] diff --git a/Migration.Toolkit.KXP/Models/CmsContentItemTag.cs b/Migration.Tool.KXP/Models/CmsContentItemTag.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/CmsContentItemTag.cs rename to Migration.Tool.KXP/Models/CmsContentItemTag.cs index 65d85459..0babd808 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItemTag.cs +++ b/Migration.Tool.KXP/Models/CmsContentItemTag.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_ContentItemTag")] [Index("ContentItemTagContentItemLanguageMetadataId", Name = "IX_CMS_ContentItemTag_ContentItemTagContentItemLanguageMetadataID")] diff --git a/Migration.Toolkit.KXP/Models/CmsContentLanguage.cs b/Migration.Tool.KXP/Models/CmsContentLanguage.cs similarity index 98% rename from Migration.Toolkit.KXP/Models/CmsContentLanguage.cs rename to Migration.Tool.KXP/Models/CmsContentLanguage.cs index ec38b1dc..efc6da67 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentLanguage.cs +++ b/Migration.Tool.KXP/Models/CmsContentLanguage.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_ContentLanguage")] public class CmsContentLanguage diff --git a/Migration.Toolkit.KXP/Models/CmsContentTypeChannel.cs b/Migration.Tool.KXP/Models/CmsContentTypeChannel.cs similarity index 96% rename from Migration.Toolkit.KXP/Models/CmsContentTypeChannel.cs rename to Migration.Tool.KXP/Models/CmsContentTypeChannel.cs index f7dc1314..b7031cce 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentTypeChannel.cs +++ b/Migration.Tool.KXP/Models/CmsContentTypeChannel.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_ContentTypeChannel")] [Index("ContentTypeChannelChannelId", "ContentTypeChannelContentTypeId", Name = "IX_CMS_ContentTypeChannel_ContentTypeChannelChannelID_ContentTypeChannelContentTypeID", IsUnique = true)] diff --git a/Migration.Toolkit.KXP/Models/CmsContentWorkflow.cs b/Migration.Tool.KXP/Models/CmsContentWorkflow.cs similarity index 96% rename from Migration.Toolkit.KXP/Models/CmsContentWorkflow.cs rename to Migration.Tool.KXP/Models/CmsContentWorkflow.cs index d51546fc..540e7120 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentWorkflow.cs +++ b/Migration.Tool.KXP/Models/CmsContentWorkflow.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_ContentWorkflow")] public class CmsContentWorkflow diff --git a/Migration.Toolkit.KXP/Models/CmsContentWorkflowContentType.cs b/Migration.Tool.KXP/Models/CmsContentWorkflowContentType.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/CmsContentWorkflowContentType.cs rename to Migration.Tool.KXP/Models/CmsContentWorkflowContentType.cs index 9aeaea2a..55c1a752 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentWorkflowContentType.cs +++ b/Migration.Tool.KXP/Models/CmsContentWorkflowContentType.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_ContentWorkflowContentType")] [Index("ContentWorkflowContentTypeContentTypeId", Name = "IX_CMS_ContentWorkflowContentType_ContentWorkflowContentTypeContentTypeID")] diff --git a/Migration.Toolkit.KXP/Models/CmsContentWorkflowStep.cs b/Migration.Tool.KXP/Models/CmsContentWorkflowStep.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/CmsContentWorkflowStep.cs rename to Migration.Tool.KXP/Models/CmsContentWorkflowStep.cs index c75e012a..b7c8a041 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentWorkflowStep.cs +++ b/Migration.Tool.KXP/Models/CmsContentWorkflowStep.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_ContentWorkflowStep")] [Index("ContentWorkflowStepName", Name = "IX_CMS_ContentWorkflowStep_ContentWorkflowStepName", IsUnique = true)] diff --git a/Migration.Toolkit.KXP/Models/CmsContentWorkflowStepRole.cs b/Migration.Tool.KXP/Models/CmsContentWorkflowStepRole.cs similarity index 96% rename from Migration.Toolkit.KXP/Models/CmsContentWorkflowStepRole.cs rename to Migration.Tool.KXP/Models/CmsContentWorkflowStepRole.cs index 1861251c..d6859783 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentWorkflowStepRole.cs +++ b/Migration.Tool.KXP/Models/CmsContentWorkflowStepRole.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_ContentWorkflowStepRole")] [Index("ContentWorkflowStepRoleContentWorkflowStepId", Name = "IX_CMS_ContentWorkflowStepRole_ContentWorkflowStepRoleContentWorkflowStepID")] diff --git a/Migration.Tool.KXP/Models/CmsCountry.cs b/Migration.Tool.KXP/Models/CmsCountry.cs new file mode 100644 index 00000000..c403e352 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsCountry.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_Country")] +public class CmsCountry +{ + [Key] + [Column("CountryID")] + public int CountryId { get; set; } + + [StringLength(200)] + public string CountryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CountryName { get; set; } = null!; + + [Column("CountryGUID")] + public Guid CountryGuid { get; set; } + + public DateTime CountryLastModified { get; set; } + + [StringLength(2)] + public string? CountryTwoLetterCode { get; set; } + + [StringLength(3)] + public string? CountryThreeLetterCode { get; set; } + + [InverseProperty("Country")] + public virtual ICollection CmsStates { get; set; } = new List(); + + [InverseProperty("AccountCountry")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactCountry")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsCulture.cs b/Migration.Tool.KXP/Models/CmsCulture.cs new file mode 100644 index 00000000..3799434e --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsCulture.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_Culture")] +[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] +[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] +public class CmsCulture +{ + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; + + [StringLength(200)] + public string CultureShortName { get; set; } = null!; + + [Column("CultureGUID")] + public Guid CultureGuid { get; set; } + + public DateTime CultureLastModified { get; set; } + + [StringLength(100)] + public string? CultureAlias { get; set; } + + [Column("CultureIsUICulture")] + public bool? CultureIsUiculture { get; set; } + + [InverseProperty("TranslationCulture")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsEmail.cs b/Migration.Tool.KXP/Models/CmsEmail.cs new file mode 100644 index 00000000..e43c93fa --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsEmail.cs @@ -0,0 +1,68 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_Email")] +[Index("EmailEmailConfigurationId", Name = "IX_CMS_Email_EmailEmailConfigurationID")] +[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] +public class CmsEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [StringLength(254)] + public string EmailFrom { get; set; } = null!; + + [StringLength(998)] + public string? EmailTo { get; set; } + + [StringLength(998)] + public string? EmailCc { get; set; } + + [StringLength(998)] + public string? EmailBcc { get; set; } + + [StringLength(450)] + public string EmailSubject { get; set; } = null!; + + public string? EmailBody { get; set; } + + public string? EmailPlainTextBody { get; set; } + + public int EmailFormat { get; set; } + + public int EmailPriority { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + public int? EmailStatus { get; set; } + + [StringLength(254)] + public string? EmailReplyTo { get; set; } + + public string? EmailHeaders { get; set; } + + public DateTime? EmailCreated { get; set; } + + [Column("EmailEmailConfigurationID")] + public int? EmailEmailConfigurationId { get; set; } + + public Guid? EmailMailoutGuid { get; set; } + + [ForeignKey("EmailEmailConfigurationId")] + [InverseProperty("CmsEmails")] + public virtual EmailLibraryEmailConfiguration? EmailEmailConfiguration { get; set; } + + [ForeignKey("EmailId")] + [InverseProperty("Emails")] + public virtual ICollection Attachments { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsEmailAttachment.cs b/Migration.Tool.KXP/Models/CmsEmailAttachment.cs new file mode 100644 index 00000000..17362696 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsEmailAttachment.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_EmailAttachment")] +public class CmsEmailAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[] AttachmentBinary { get; set; } = null!; + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + [Column("AttachmentContentID")] + [StringLength(255)] + public string? AttachmentContentId { get; set; } + + [ForeignKey("AttachmentId")] + [InverseProperty("Attachments")] + public virtual ICollection Emails { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsEventLog.cs b/Migration.Tool.KXP/Models/CmsEventLog.cs new file mode 100644 index 00000000..9e7eeb45 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsEventLog.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_EventLog")] +public class CmsEventLog +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(5)] + public string EventType { get; set; } = null!; + + public DateTime EventTime { get; set; } + + [StringLength(100)] + public string Source { get; set; } = null!; + + [StringLength(100)] + public string EventCode { get; set; } = null!; + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(250)] + public string? UserName { get; set; } + + [Column("IPAddress")] + [StringLength(100)] + public string? Ipaddress { get; set; } + + public string? EventDescription { get; set; } + + public string? EventUrl { get; set; } + + [StringLength(100)] + public string? EventMachineName { get; set; } + + public string? EventUserAgent { get; set; } + + public string? EventUrlReferrer { get; set; } +} diff --git a/Migration.Tool.KXP/Models/CmsExternalLogin.cs b/Migration.Tool.KXP/Models/CmsExternalLogin.cs new file mode 100644 index 00000000..812f4aab --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsExternalLogin.cs @@ -0,0 +1,28 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_ExternalLogin")] +[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] +public class CmsExternalLogin +{ + [Key] + [Column("ExternalLoginID")] + public int ExternalLoginId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string LoginProvider { get; set; } = null!; + + [StringLength(100)] + public string IdentityKey { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsExternalLogins")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/CmsForm.cs b/Migration.Tool.KXP/Models/CmsForm.cs new file mode 100644 index 00000000..8762bc76 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsForm.cs @@ -0,0 +1,53 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_Form")] +[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] +public class CmsForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(100)] + public string FormName { get; set; } = null!; + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public int FormItems { get; set; } + + public string? FormReportFields { get; set; } + + [StringLength(400)] + public string? FormSubmitButtonText { get; set; } + + public int? FormAccess { get; set; } + + [StringLength(255)] + public string? FormSubmitButtonImage { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + public bool FormLogActivity { get; set; } + + public string? FormBuilderLayout { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsForms")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormId")] + [InverseProperty("Forms")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsFormFeaturedField.cs b/Migration.Tool.KXP/Models/CmsFormFeaturedField.cs similarity index 96% rename from Migration.Toolkit.KXP/Models/CmsFormFeaturedField.cs rename to Migration.Tool.KXP/Models/CmsFormFeaturedField.cs index 717be636..3953633f 100644 --- a/Migration.Toolkit.KXP/Models/CmsFormFeaturedField.cs +++ b/Migration.Tool.KXP/Models/CmsFormFeaturedField.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_FormFeaturedField")] public class CmsFormFeaturedField diff --git a/Migration.Toolkit.KXP/Models/CmsHeadlessChannel.cs b/Migration.Tool.KXP/Models/CmsHeadlessChannel.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/CmsHeadlessChannel.cs rename to Migration.Tool.KXP/Models/CmsHeadlessChannel.cs index 32056386..56568663 100644 --- a/Migration.Toolkit.KXP/Models/CmsHeadlessChannel.cs +++ b/Migration.Tool.KXP/Models/CmsHeadlessChannel.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_HeadlessChannel")] [Index("HeadlessChannelChannelId", Name = "IX_CMS_HeadlessChannel_HeadlessChannelChannelID")] diff --git a/Migration.Toolkit.KXP/Models/CmsHeadlessItem.cs b/Migration.Tool.KXP/Models/CmsHeadlessItem.cs similarity index 96% rename from Migration.Toolkit.KXP/Models/CmsHeadlessItem.cs rename to Migration.Tool.KXP/Models/CmsHeadlessItem.cs index 6c66a1a5..d2f093c9 100644 --- a/Migration.Toolkit.KXP/Models/CmsHeadlessItem.cs +++ b/Migration.Tool.KXP/Models/CmsHeadlessItem.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_HeadlessItem")] [Index("HeadlessItemContentItemId", Name = "IX_CMS_HeadlessItem_HeadlessItemContentItemID")] diff --git a/Migration.Toolkit.KXP/Models/CmsHeadlessToken.cs b/Migration.Tool.KXP/Models/CmsHeadlessToken.cs similarity index 98% rename from Migration.Toolkit.KXP/Models/CmsHeadlessToken.cs rename to Migration.Tool.KXP/Models/CmsHeadlessToken.cs index bbefd6cf..adfb4005 100644 --- a/Migration.Toolkit.KXP/Models/CmsHeadlessToken.cs +++ b/Migration.Tool.KXP/Models/CmsHeadlessToken.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_HeadlessToken")] [Index("HeadlessTokenCreatedByUserId", Name = "IX_CMS_HeadlessToken_HeadlessTokenCreatedByUserID")] diff --git a/Migration.Tool.KXP/Models/CmsLicenseKey.cs b/Migration.Tool.KXP/Models/CmsLicenseKey.cs new file mode 100644 index 00000000..c90db95e --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsLicenseKey.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_LicenseKey")] +public class CmsLicenseKey +{ + [Key] + [Column("LicenseKeyID")] + public int LicenseKeyId { get; set; } + + [StringLength(255)] + public string? LicenseDomain { get; set; } + + public string? LicenseKey { get; set; } + + [StringLength(200)] + public string? LicenseEdition { get; set; } + + [StringLength(200)] + public string? LicenseExpiration { get; set; } + + public int? LicenseServers { get; set; } +} diff --git a/Migration.Tool.KXP/Models/CmsMacroIdentity.cs b/Migration.Tool.KXP/Models/CmsMacroIdentity.cs new file mode 100644 index 00000000..3aad20f5 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsMacroIdentity.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_MacroIdentity")] +[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] +public class CmsMacroIdentity +{ + [Key] + [Column("MacroIdentityID")] + public int MacroIdentityId { get; set; } + + public Guid MacroIdentityGuid { get; set; } + + public DateTime MacroIdentityLastModified { get; set; } + + [StringLength(200)] + public string MacroIdentityName { get; set; } = null!; + + [Column("MacroIdentityEffectiveUserID")] + public int? MacroIdentityEffectiveUserId { get; set; } + + [InverseProperty("UserMacroIdentityMacroIdentity")] + public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); + + [ForeignKey("MacroIdentityEffectiveUserId")] + [InverseProperty("CmsMacroIdentities")] + public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } +} diff --git a/Migration.Tool.KXP/Models/CmsMacroRule.cs b/Migration.Tool.KXP/Models/CmsMacroRule.cs new file mode 100644 index 00000000..f7320ab1 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsMacroRule.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_MacroRule")] +public class CmsMacroRule +{ + [Key] + [Column("MacroRuleID")] + public int MacroRuleId { get; set; } + + [StringLength(200)] + public string MacroRuleName { get; set; } = null!; + + [StringLength(1000)] + public string MacroRuleText { get; set; } = null!; + + public string? MacroRuleParameters { get; set; } + + public DateTime MacroRuleLastModified { get; set; } + + [Column("MacroRuleGUID")] + public Guid MacroRuleGuid { get; set; } + + public string MacroRuleCondition { get; set; } = null!; + + [StringLength(500)] + public string MacroRuleDisplayName { get; set; } = null!; + + public bool? MacroRuleIsCustom { get; set; } + + [StringLength(450)] + public string? MacroRuleDescription { get; set; } + + public bool? MacroRuleEnabled { get; set; } + + [InverseProperty("MacroRule")] + public virtual ICollection CmsMacroRuleMacroRuleCategories { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsMacroRuleCategory.cs b/Migration.Tool.KXP/Models/CmsMacroRuleCategory.cs similarity index 95% rename from Migration.Toolkit.KXP/Models/CmsMacroRuleCategory.cs rename to Migration.Tool.KXP/Models/CmsMacroRuleCategory.cs index 0dff1624..9d754829 100644 --- a/Migration.Toolkit.KXP/Models/CmsMacroRuleCategory.cs +++ b/Migration.Tool.KXP/Models/CmsMacroRuleCategory.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_MacroRuleCategory")] public class CmsMacroRuleCategory diff --git a/Migration.Toolkit.KXP/Models/CmsMacroRuleMacroRuleCategory.cs b/Migration.Tool.KXP/Models/CmsMacroRuleMacroRuleCategory.cs similarity index 96% rename from Migration.Toolkit.KXP/Models/CmsMacroRuleMacroRuleCategory.cs rename to Migration.Tool.KXP/Models/CmsMacroRuleMacroRuleCategory.cs index 085ed09b..3e4364fa 100644 --- a/Migration.Toolkit.KXP/Models/CmsMacroRuleMacroRuleCategory.cs +++ b/Migration.Tool.KXP/Models/CmsMacroRuleMacroRuleCategory.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_MacroRuleMacroRuleCategory")] [Index("MacroRuleCategoryId", Name = "IX_CMS_MacroRuleMacroRuleCategory_MacroRuleCategoryID")] diff --git a/Migration.Toolkit.KXP/Models/CmsMember.cs b/Migration.Tool.KXP/Models/CmsMember.cs similarity index 94% rename from Migration.Toolkit.KXP/Models/CmsMember.cs rename to Migration.Tool.KXP/Models/CmsMember.cs index f64dc462..4d52ba53 100644 --- a/Migration.Toolkit.KXP/Models/CmsMember.cs +++ b/Migration.Tool.KXP/Models/CmsMember.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_Member")] public class CmsMember diff --git a/Migration.Toolkit.KXP/Models/CmsMemberExternalLogin.cs b/Migration.Tool.KXP/Models/CmsMemberExternalLogin.cs similarity index 95% rename from Migration.Toolkit.KXP/Models/CmsMemberExternalLogin.cs rename to Migration.Tool.KXP/Models/CmsMemberExternalLogin.cs index 3921e726..51788888 100644 --- a/Migration.Toolkit.KXP/Models/CmsMemberExternalLogin.cs +++ b/Migration.Tool.KXP/Models/CmsMemberExternalLogin.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_MemberExternalLogin")] [Index("MemberExternalLoginLoginProvider", "MemberExternalLoginIdentityKey", Name = "IX_CMS_MemberExternalLogin_MemberExternalLoginLoginProvider_MemberExternalLoginIdentityKey", IsUnique = true)] diff --git a/Migration.Tool.KXP/Models/CmsObjectWorkflowTrigger.cs b/Migration.Tool.KXP/Models/CmsObjectWorkflowTrigger.cs new file mode 100644 index 00000000..c81c1ef4 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsObjectWorkflowTrigger.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_ObjectWorkflowTrigger")] +[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] +public class CmsObjectWorkflowTrigger +{ + [Key] + [Column("TriggerID")] + public int TriggerId { get; set; } + + [Column("TriggerGUID")] + public Guid TriggerGuid { get; set; } + + public DateTime TriggerLastModified { get; set; } + + public int TriggerType { get; set; } + + public string? TriggerMacroCondition { get; set; } + + [Column("TriggerWorkflowID")] + public int TriggerWorkflowId { get; set; } + + [StringLength(450)] + public string TriggerDisplayName { get; set; } = null!; + + [StringLength(100)] + public string TriggerObjectType { get; set; } = null!; + + public string? TriggerParameters { get; set; } + + [StringLength(100)] + public string? TriggerTargetObjectType { get; set; } + + [Column("TriggerTargetObjectID")] + public int? TriggerTargetObjectId { get; set; } + + [ForeignKey("TriggerWorkflowId")] + [InverseProperty("CmsObjectWorkflowTriggers")] + public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/CmsPageTemplateConfiguration.cs b/Migration.Tool.KXP/Models/CmsPageTemplateConfiguration.cs new file mode 100644 index 00000000..93334366 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsPageTemplateConfiguration.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_PageTemplateConfiguration")] +public class CmsPageTemplateConfiguration +{ + [Key] + [Column("PageTemplateConfigurationID")] + public int PageTemplateConfigurationId { get; set; } + + [Column("PageTemplateConfigurationGUID")] + public Guid PageTemplateConfigurationGuid { get; set; } + + public DateTime PageTemplateConfigurationLastModified { get; set; } + + [StringLength(200)] + public string PageTemplateConfigurationName { get; set; } = null!; + + public string? PageTemplateConfigurationDescription { get; set; } + + public string PageTemplateConfigurationTemplate { get; set; } = null!; + + public string? PageTemplateConfigurationWidgets { get; set; } + + [StringLength(200)] + public string PageTemplateConfigurationIcon { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/CmsQuery.cs b/Migration.Tool.KXP/Models/CmsQuery.cs new file mode 100644 index 00000000..7a5cca7a --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsQuery.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_Query")] +[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] +public class CmsQuery +{ + [Key] + [Column("QueryID")] + public int QueryId { get; set; } + + [StringLength(100)] + public string QueryName { get; set; } = null!; + + [Column("QueryTypeID")] + public int QueryTypeId { get; set; } + + public string QueryText { get; set; } = null!; + + public bool QueryRequiresTransaction { get; set; } + + [Column("ClassID")] + public int? ClassId { get; set; } + + public DateTime QueryLastModified { get; set; } + + [Column("QueryGUID")] + public Guid QueryGuid { get; set; } + + public bool? QueryIsCustom { get; set; } + + [StringLength(100)] + public string? QueryConnectionString { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsQueries")] + public virtual CmsClass? Class { get; set; } +} diff --git a/Migration.Tool.KXP/Models/CmsResource.cs b/Migration.Tool.KXP/Models/CmsResource.cs new file mode 100644 index 00000000..5bdc17a2 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsResource.cs @@ -0,0 +1,39 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_Resource")] +[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] +public class CmsResource +{ + [Key] + [Column("ResourceID")] + public int ResourceId { get; set; } + + [StringLength(100)] + public string ResourceDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + public string? ResourceDescription { get; set; } + + [Column("ResourceGUID")] + public Guid ResourceGuid { get; set; } + + public DateTime ResourceLastModified { get; set; } + + public bool? ResourceIsInDevelopment { get; set; } + + [InverseProperty("ClassResource")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("CategoryResource")] + public virtual ICollection CmsSettingsCategories { get; set; } = new List(); + + [InverseProperty("ActionResource")] + public virtual ICollection CmsWorkflowActions { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsResourceString.cs b/Migration.Tool.KXP/Models/CmsResourceString.cs new file mode 100644 index 00000000..e978d763 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsResourceString.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_ResourceString")] +[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] +public class CmsResourceString +{ + [Key] + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("StringGUID")] + public Guid StringGuid { get; set; } + + [InverseProperty("TranslationString")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsResourceTranslation.cs b/Migration.Tool.KXP/Models/CmsResourceTranslation.cs new file mode 100644 index 00000000..2fe34576 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsResourceTranslation.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_ResourceTranslation")] +[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] +[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] +public class CmsResourceTranslation +{ + [Key] + [Column("TranslationID")] + public int TranslationId { get; set; } + + [Column("TranslationStringID")] + public int TranslationStringId { get; set; } + + public string? TranslationText { get; set; } + + [Column("TranslationCultureID")] + public int TranslationCultureId { get; set; } + + [ForeignKey("TranslationCultureId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsCulture TranslationCulture { get; set; } = null!; + + [ForeignKey("TranslationStringId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsResourceString TranslationString { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/CmsRole.cs b/Migration.Tool.KXP/Models/CmsRole.cs new file mode 100644 index 00000000..2b6a816a --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsRole.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_Role")] +public class CmsRole +{ + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + public DateTime RoleLastModified { get; set; } + + [InverseProperty("Role")] + public virtual ICollection CmsApplicationPermissions { get; set; } = new List(); + + [InverseProperty("ContentWorkflowStepRoleRole")] + public virtual ICollection CmsContentWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Forms { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsScheduledTask.cs b/Migration.Tool.KXP/Models/CmsScheduledTask.cs new file mode 100644 index 00000000..efa2d6b1 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsScheduledTask.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_ScheduledTask")] +[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] +[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] +public class CmsScheduledTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(200)] + public string TaskName { get; set; } = null!; + + [StringLength(200)] + public string TaskDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TaskAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string? TaskClass { get; set; } + + [StringLength(1000)] + public string TaskInterval { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime? TaskLastRunTime { get; set; } + + public DateTime? TaskNextRunTime { get; set; } + + public string? TaskLastResult { get; set; } + + public bool? TaskDeleteAfterLastRun { get; set; } + + [StringLength(100)] + public string? TaskServerName { get; set; } + + [Column("TaskGUID")] + public Guid TaskGuid { get; set; } + + public DateTime TaskLastModified { get; set; } + + public int? TaskExecutions { get; set; } + + [Column("TaskUserID")] + public int? TaskUserId { get; set; } + + public int? TaskType { get; set; } + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [StringLength(200)] + public string? TaskExecutingServerName { get; set; } + + public bool TaskEnabled { get; set; } + + public bool TaskIsRunning { get; set; } + + [ForeignKey("TaskUserId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsUser? TaskUser { get; set; } +} diff --git a/Migration.Tool.KXP/Models/CmsSettingsCategory.cs b/Migration.Tool.KXP/Models/CmsSettingsCategory.cs new file mode 100644 index 00000000..048bd133 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsSettingsCategory.cs @@ -0,0 +1,59 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_SettingsCategory")] +[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] +[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] +public class CmsSettingsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + public int? CategoryOrder { get; set; } + + [StringLength(100)] + public string? CategoryName { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + [StringLength(200)] + public string? CategoryIconPath { get; set; } + + public bool? CategoryIsGroup { get; set; } + + public bool? CategoryIsCustom { get; set; } + + [Column("CategoryResourceID")] + public int? CategoryResourceId { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsSettingsCategory? CategoryParent { get; set; } + + [ForeignKey("CategoryResourceId")] + [InverseProperty("CmsSettingsCategories")] + public virtual CmsResource? CategoryResource { get; set; } + + [InverseProperty("KeyCategory")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsSettingsKey.cs b/Migration.Tool.KXP/Models/CmsSettingsKey.cs new file mode 100644 index 00000000..674dd5a8 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsSettingsKey.cs @@ -0,0 +1,57 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_SettingsKey")] +[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] +[Index("KeyName", Name = "IX_CMS_SettingsKey_KeyName")] +public class CmsSettingsKey +{ + [Key] + [Column("KeyID")] + public int KeyId { get; set; } + + [StringLength(100)] + public string KeyName { get; set; } = null!; + + [StringLength(200)] + public string KeyDisplayName { get; set; } = null!; + + public string? KeyDescription { get; set; } + + public string? KeyValue { get; set; } + + [StringLength(50)] + public string KeyType { get; set; } = null!; + + [Column("KeyCategoryID")] + public int? KeyCategoryId { get; set; } + + [Column("KeyGUID")] + public Guid KeyGuid { get; set; } + + public DateTime KeyLastModified { get; set; } + + public int? KeyOrder { get; set; } + + [StringLength(255)] + public string? KeyValidation { get; set; } + + [StringLength(200)] + public string? KeyEditingControlPath { get; set; } + + public bool? KeyIsCustom { get; set; } + + public bool? KeyIsHidden { get; set; } + + public string? KeyFormControlSettings { get; set; } + + public string? KeyExplanationText { get; set; } + + [ForeignKey("KeyCategoryId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSettingsCategory? KeyCategory { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsSmartFolder.cs b/Migration.Tool.KXP/Models/CmsSmartFolder.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/CmsSmartFolder.cs rename to Migration.Tool.KXP/Models/CmsSmartFolder.cs index 98f28ae2..f3eac959 100644 --- a/Migration.Toolkit.KXP/Models/CmsSmartFolder.cs +++ b/Migration.Tool.KXP/Models/CmsSmartFolder.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_SmartFolder")] [Index("SmartFolderCreatedByUserId", Name = "IX_CMS_SmartFolder_SmartFolderCreatedByUserID")] diff --git a/Migration.Tool.KXP/Models/CmsState.cs b/Migration.Tool.KXP/Models/CmsState.cs new file mode 100644 index 00000000..86a9ddd3 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsState.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_State")] +[Index("CountryId", Name = "IX_CMS_State_CountryID")] +[Index("StateCode", Name = "IX_CMS_State_StateCode")] +public class CmsState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [StringLength(200)] + public string StateDisplayName { get; set; } = null!; + + [StringLength(200)] + public string StateName { get; set; } = null!; + + [StringLength(100)] + public string? StateCode { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public DateTime StateLastModified { get; set; } + + [ForeignKey("CountryId")] + [InverseProperty("CmsStates")] + public virtual CmsCountry Country { get; set; } = null!; + + [InverseProperty("AccountState")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactState")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsTag.cs b/Migration.Tool.KXP/Models/CmsTag.cs new file mode 100644 index 00000000..c8dda9a0 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsTag.cs @@ -0,0 +1,50 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_Tag")] +[Index("TagParentId", Name = "IX_CMS_Tag_TagParentID")] +[Index("TagTaxonomyId", Name = "IX_CMS_Tag_TagTaxonomyID")] +public class CmsTag +{ + [Key] + [Column("TagID")] + public int TagId { get; set; } + + [StringLength(200)] + public string TagName { get; set; } = null!; + + [Column("TagGUID")] + public Guid TagGuid { get; set; } + + [Column("TagTaxonomyID")] + public int TagTaxonomyId { get; set; } + + [Column("TagParentID")] + public int? TagParentId { get; set; } + + public int? TagOrder { get; set; } + + public string? TagMetadata { get; set; } + + public DateTime TagLastModified { get; set; } + + [StringLength(200)] + public string TagTitle { get; set; } = null!; + + public string? TagDescription { get; set; } + + [InverseProperty("TagParent")] + public virtual ICollection InverseTagParent { get; set; } = new List(); + + [ForeignKey("TagParentId")] + [InverseProperty("InverseTagParent")] + public virtual CmsTag? TagParent { get; set; } + + [ForeignKey("TagTaxonomyId")] + [InverseProperty("CmsTags")] + public virtual CmsTaxonomy TagTaxonomy { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsTaxonomy.cs b/Migration.Tool.KXP/Models/CmsTaxonomy.cs similarity index 94% rename from Migration.Toolkit.KXP/Models/CmsTaxonomy.cs rename to Migration.Tool.KXP/Models/CmsTaxonomy.cs index 7a472a08..afeecf95 100644 --- a/Migration.Toolkit.KXP/Models/CmsTaxonomy.cs +++ b/Migration.Tool.KXP/Models/CmsTaxonomy.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_Taxonomy")] public class CmsTaxonomy diff --git a/Migration.Tool.KXP/Models/CmsUser.cs b/Migration.Tool.KXP/Models/CmsUser.cs new file mode 100644 index 00000000..e00eecc5 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsUser.cs @@ -0,0 +1,112 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_User")] +[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] +[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] +public class CmsUser +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(254)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + public bool UserEnabled { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool UserIsPendingRegistration { get; set; } + + public DateTime? UserRegistrationLinkExpiration { get; set; } + + public bool UserAdministrationAccess { get; set; } + + public bool UserIsExternal { get; set; } + + [InverseProperty("HistoryApprovedByUser")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateUser")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("ContentFolderCreatedByUser")] + public virtual ICollection CmsContentFolderContentFolderCreatedByUsers { get; set; } = new List(); + + [InverseProperty("ContentFolderModifiedByUser")] + public virtual ICollection CmsContentFolderContentFolderModifiedByUsers { get; set; } = new List(); + + [InverseProperty("ContentItemLanguageMetadataCreatedByUser")] + public virtual ICollection CmsContentItemLanguageMetadatumContentItemLanguageMetadataCreatedByUsers { get; set; } = new List(); + + [InverseProperty("ContentItemLanguageMetadataModifiedByUser")] + public virtual ICollection CmsContentItemLanguageMetadatumContentItemLanguageMetadataModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsExternalLogins { get; set; } = new List(); + + [InverseProperty("HeadlessTokenCreatedByUser")] + public virtual ICollection CmsHeadlessTokenHeadlessTokenCreatedByUsers { get; set; } = new List(); + + [InverseProperty("HeadlessTokenModifiedByUser")] + public virtual ICollection CmsHeadlessTokenHeadlessTokenModifiedByUsers { get; set; } = new List(); + + [InverseProperty("MacroIdentityEffectiveUser")] + public virtual ICollection CmsMacroIdentities { get; set; } = new List(); + + [InverseProperty("TaskUser")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("SmartFolderCreatedByUser")] + public virtual ICollection CmsSmartFolderSmartFolderCreatedByUsers { get; set; } = new List(); + + [InverseProperty("SmartFolderModifiedByUser")] + public virtual ICollection CmsSmartFolderSmartFolderModifiedByUsers { get; set; } = new List(); + + [InverseProperty("UserMacroIdentityUser")] + public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } + + [InverseProperty("User")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("FileCreatedByUser")] + public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); + + [InverseProperty("FileModifiedByUser")] + public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); + + [InverseProperty("AccountOwnerUser")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactOwnerUser")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsUserMacroIdentity.cs b/Migration.Tool.KXP/Models/CmsUserMacroIdentity.cs new file mode 100644 index 00000000..b2058809 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsUserMacroIdentity.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_UserMacroIdentity")] +[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] +[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] +public class CmsUserMacroIdentity +{ + [Key] + [Column("UserMacroIdentityID")] + public int UserMacroIdentityId { get; set; } + + public DateTime UserMacroIdentityLastModified { get; set; } + + [Column("UserMacroIdentityUserID")] + public int UserMacroIdentityUserId { get; set; } + + [Column("UserMacroIdentityMacroIdentityID")] + public int? UserMacroIdentityMacroIdentityId { get; set; } + + public Guid UserMacroIdentityUserGuid { get; set; } + + [ForeignKey("UserMacroIdentityMacroIdentityId")] + [InverseProperty("CmsUserMacroIdentities")] + public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } + + [ForeignKey("UserMacroIdentityUserId")] + [InverseProperty("CmsUserMacroIdentity")] + public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/CmsUserRole.cs b/Migration.Tool.KXP/Models/CmsUserRole.cs new file mode 100644 index 00000000..50602000 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsUserRole.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_UserRole")] +[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] +[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] +public class CmsUserRole +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("UserRoleID")] + public int UserRoleId { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/CmsWebFarmServer.cs b/Migration.Tool.KXP/Models/CmsWebFarmServer.cs new file mode 100644 index 00000000..2ec50e31 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsWebFarmServer.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_WebFarmServer")] +[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] +public class CmsWebFarmServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(300)] + public string ServerDisplayName { get; set; } = null!; + + [StringLength(300)] + public string ServerName { get; set; } = null!; + + [Column("ServerGUID")] + public Guid? ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public bool ServerEnabled { get; set; } + + [InverseProperty("Server")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsWebFarmServerLog.cs b/Migration.Tool.KXP/Models/CmsWebFarmServerLog.cs new file mode 100644 index 00000000..42760bce --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsWebFarmServerLog.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_WebFarmServerLog")] +public class CmsWebFarmServerLog +{ + [Key] + [Column("WebFarmServerLogID")] + public int WebFarmServerLogId { get; set; } + + public DateTime LogTime { get; set; } + + [StringLength(200)] + public string LogCode { get; set; } = null!; + + [Column("ServerID")] + public int ServerId { get; set; } +} diff --git a/Migration.Tool.KXP/Models/CmsWebFarmServerMonitoring.cs b/Migration.Tool.KXP/Models/CmsWebFarmServerMonitoring.cs new file mode 100644 index 00000000..e4635683 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsWebFarmServerMonitoring.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_WebFarmServerMonitoring")] +public class CmsWebFarmServerMonitoring +{ + [Key] + [Column("WebFarmServerMonitoringID")] + public int WebFarmServerMonitoringId { get; set; } + + [Column("ServerID")] + public int ServerId { get; set; } + + public DateTime? ServerPing { get; set; } +} diff --git a/Migration.Tool.KXP/Models/CmsWebFarmServerTask.cs b/Migration.Tool.KXP/Models/CmsWebFarmServerTask.cs new file mode 100644 index 00000000..48224a2d --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsWebFarmServerTask.cs @@ -0,0 +1,30 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[PrimaryKey("ServerId", "TaskId")] +[Table("CMS_WebFarmServerTask")] +[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] +public class CmsWebFarmServerTask +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + public string? ErrorMessage { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmServer Server { get; set; } = null!; + + [ForeignKey("TaskId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmTask Task { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/CmsWebFarmTask.cs b/Migration.Tool.KXP/Models/CmsWebFarmTask.cs new file mode 100644 index 00000000..a283f826 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsWebFarmTask.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_WebFarmTask")] +[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] +public class CmsWebFarmTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(100)] + public string TaskType { get; set; } = null!; + + public string? TaskTextData { get; set; } + + public byte[]? TaskBinaryData { get; set; } + + public DateTime? TaskCreated { get; set; } + + public string? TaskTarget { get; set; } + + [StringLength(450)] + public string? TaskMachineName { get; set; } + + [Column("TaskGUID")] + public Guid? TaskGuid { get; set; } + + public bool? TaskIsAnonymous { get; set; } + + public string? TaskErrorMessage { get; set; } + + public bool? TaskIsMemory { get; set; } + + [InverseProperty("Task")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsWebPageFormerUrlPath.cs b/Migration.Tool.KXP/Models/CmsWebPageFormerUrlPath.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/CmsWebPageFormerUrlPath.cs rename to Migration.Tool.KXP/Models/CmsWebPageFormerUrlPath.cs index 240d2345..d287300f 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebPageFormerUrlPath.cs +++ b/Migration.Tool.KXP/Models/CmsWebPageFormerUrlPath.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_WebPageFormerUrlPath")] [Index("WebPageFormerUrlPathContentLanguageId", Name = "IX_CMS_WebPageFormerUrlPath_WebPageFormerUrlPathContentLanguageID")] diff --git a/Migration.Toolkit.KXP/Models/CmsWebPageItem.cs b/Migration.Tool.KXP/Models/CmsWebPageItem.cs similarity index 98% rename from Migration.Toolkit.KXP/Models/CmsWebPageItem.cs rename to Migration.Tool.KXP/Models/CmsWebPageItem.cs index 278cc90e..08e69962 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebPageItem.cs +++ b/Migration.Tool.KXP/Models/CmsWebPageItem.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_WebPageItem")] [Index("WebPageItemContentItemId", Name = "IX_CMS_WebPageItem_WebPageItemContentItemID")] diff --git a/Migration.Toolkit.KXP/Models/CmsWebPageUrlPath.cs b/Migration.Tool.KXP/Models/CmsWebPageUrlPath.cs similarity index 98% rename from Migration.Toolkit.KXP/Models/CmsWebPageUrlPath.cs rename to Migration.Tool.KXP/Models/CmsWebPageUrlPath.cs index c75523ec..5726f1f7 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebPageUrlPath.cs +++ b/Migration.Tool.KXP/Models/CmsWebPageUrlPath.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_WebPageUrlPath")] [Index("WebPageUrlPathContentLanguageId", Name = "IX_CMS_WebPageUrlPath_WebPageUrlPathContentLanguageID")] diff --git a/Migration.Toolkit.KXP/Models/CmsWebsiteCaptchaSetting.cs b/Migration.Tool.KXP/Models/CmsWebsiteCaptchaSetting.cs similarity index 95% rename from Migration.Toolkit.KXP/Models/CmsWebsiteCaptchaSetting.cs rename to Migration.Tool.KXP/Models/CmsWebsiteCaptchaSetting.cs index afd48ad6..141d8823 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebsiteCaptchaSetting.cs +++ b/Migration.Tool.KXP/Models/CmsWebsiteCaptchaSetting.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_WebsiteCaptchaSettings")] public class CmsWebsiteCaptchaSetting diff --git a/Migration.Toolkit.KXP/Models/CmsWebsiteChannel.cs b/Migration.Tool.KXP/Models/CmsWebsiteChannel.cs similarity index 98% rename from Migration.Toolkit.KXP/Models/CmsWebsiteChannel.cs rename to Migration.Tool.KXP/Models/CmsWebsiteChannel.cs index fa7be83e..1f67501b 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebsiteChannel.cs +++ b/Migration.Tool.KXP/Models/CmsWebsiteChannel.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("CMS_WebsiteChannel")] [Index("WebsiteChannelChannelId", Name = "IX_CMS_WebsiteChannel_WebsiteChannelChannelID")] diff --git a/Migration.Tool.KXP/Models/CmsWorkflow.cs b/Migration.Tool.KXP/Models/CmsWorkflow.cs new file mode 100644 index 00000000..f56f8aee --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsWorkflow.cs @@ -0,0 +1,79 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_Workflow")] +public class CmsWorkflow +{ + [Key] + [Column("WorkflowID")] + public int WorkflowId { get; set; } + + public string WorkflowDisplayName { get; set; } = null!; + + [StringLength(450)] + public string WorkflowName { get; set; } = null!; + + [Column("WorkflowGUID")] + public Guid WorkflowGuid { get; set; } + + public DateTime WorkflowLastModified { get; set; } + + public bool? WorkflowAutoPublishChanges { get; set; } + + public bool? WorkflowUseCheckinCheckout { get; set; } + + public int? WorkflowType { get; set; } + + public bool? WorkflowSendEmails { get; set; } + + public bool? WorkflowSendApproveEmails { get; set; } + + public bool? WorkflowSendRejectEmails { get; set; } + + public bool? WorkflowSendPublishEmails { get; set; } + + public bool? WorkflowSendArchiveEmails { get; set; } + + [StringLength(200)] + public string? WorkflowApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowPublishedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowArchivedTemplateName { get; set; } + + public bool? WorkflowSendReadyForApprovalEmails { get; set; } + + [StringLength(200)] + public string? WorkflowReadyForApprovalTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowNotificationTemplateName { get; set; } + + public string? WorkflowAllowedObjects { get; set; } + + public int? WorkflowRecurrenceType { get; set; } + + public bool WorkflowEnabled { get; set; } + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateWorkflow")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("TriggerWorkflow")] + public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); + + [InverseProperty("StepWorkflow")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); + + [InverseProperty("TransitionWorkflow")] + public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsWorkflowAction.cs b/Migration.Tool.KXP/Models/CmsWorkflowAction.cs new file mode 100644 index 00000000..71aa7c29 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsWorkflowAction.cs @@ -0,0 +1,64 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_WorkflowAction")] +[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] +public class CmsWorkflowAction +{ + [Key] + [Column("ActionID")] + public int ActionId { get; set; } + + [StringLength(200)] + public string ActionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ActionName { get; set; } = null!; + + public string? ActionParameters { get; set; } + + public string? ActionDescription { get; set; } + + [StringLength(200)] + public string ActionAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string ActionClass { get; set; } = null!; + + [Column("ActionResourceID")] + public int? ActionResourceId { get; set; } + + [Column("ActionGUID")] + public Guid ActionGuid { get; set; } + + public DateTime ActionLastModified { get; set; } + + public bool ActionEnabled { get; set; } + + public string? ActionAllowedObjects { get; set; } + + public int? ActionWorkflowType { get; set; } + + [StringLength(200)] + public string? ActionIconClass { get; set; } + + [StringLength(200)] + public string? ActionThumbnailClass { get; set; } + + [StringLength(200)] + public string? ActionDataProviderClass { get; set; } + + [StringLength(200)] + public string? ActionDataProviderAssemblyName { get; set; } + + [ForeignKey("ActionResourceId")] + [InverseProperty("CmsWorkflowActions")] + public virtual CmsResource? ActionResource { get; set; } + + [InverseProperty("StepAction")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/CmsWorkflowStep.cs b/Migration.Tool.KXP/Models/CmsWorkflowStep.cs new file mode 100644 index 00000000..2f47dbb0 --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsWorkflowStep.cs @@ -0,0 +1,93 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_WorkflowStep")] +[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] +[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] +[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] +[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] +public class CmsWorkflowStep +{ + [Key] + [Column("StepID")] + public int StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [StringLength(440)] + public string? StepName { get; set; } + + public int? StepOrder { get; set; } + + [Column("StepWorkflowID")] + public int StepWorkflowId { get; set; } + + [Column("StepGUID")] + public Guid StepGuid { get; set; } + + public DateTime StepLastModified { get; set; } + + public int? StepType { get; set; } + + public bool? StepAllowReject { get; set; } + + public string? StepDefinition { get; set; } + + public int? StepRolesSecurity { get; set; } + + public int? StepUsersSecurity { get; set; } + + [StringLength(200)] + public string? StepApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? StepRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? StepReadyforApprovalTemplateName { get; set; } + + public bool? StepSendApproveEmails { get; set; } + + public bool? StepSendRejectEmails { get; set; } + + public bool? StepSendReadyForApprovalEmails { get; set; } + + public bool? StepSendEmails { get; set; } + + public bool? StepAllowPublish { get; set; } + + [Column("StepActionID")] + public int? StepActionId { get; set; } + + public string? StepActionParameters { get; set; } + + public int? StepWorkflowType { get; set; } + + [InverseProperty("HistoryStep")] + public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); + + [InverseProperty("HistoryTargetStep")] + public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("StateStep")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("TransitionEndStep")] + public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); + + [InverseProperty("TransitionStartStep")] + public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); + + [ForeignKey("StepActionId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflowAction? StepAction { get; set; } + + [ForeignKey("StepWorkflowId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflow StepWorkflow { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/CmsWorkflowTransition.cs b/Migration.Tool.KXP/Models/CmsWorkflowTransition.cs new file mode 100644 index 00000000..e29af40e --- /dev/null +++ b/Migration.Tool.KXP/Models/CmsWorkflowTransition.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("CMS_WorkflowTransition")] +[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] +[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] +[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] +public class CmsWorkflowTransition +{ + [Key] + [Column("TransitionID")] + public int TransitionId { get; set; } + + [Column("TransitionStartStepID")] + public int TransitionStartStepId { get; set; } + + [Column("TransitionEndStepID")] + public int TransitionEndStepId { get; set; } + + public int TransitionType { get; set; } + + public DateTime TransitionLastModified { get; set; } + + [Column("TransitionSourcePointGUID")] + public Guid? TransitionSourcePointGuid { get; set; } + + [Column("TransitionWorkflowID")] + public int TransitionWorkflowId { get; set; } + + [ForeignKey("TransitionEndStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] + public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; + + [ForeignKey("TransitionStartStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] + public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; + + [ForeignKey("TransitionWorkflowId")] + [InverseProperty("CmsWorkflowTransitions")] + public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailBounce.cs b/Migration.Tool.KXP/Models/EmailLibraryEmailBounce.cs similarity index 93% rename from Migration.Toolkit.KXP/Models/EmailLibraryEmailBounce.cs rename to Migration.Tool.KXP/Models/EmailLibraryEmailBounce.cs index 00efcfd0..8140c567 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailBounce.cs +++ b/Migration.Tool.KXP/Models/EmailLibraryEmailBounce.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("EmailLibrary_EmailBounce")] [Index("EmailBounceEmailAddress", Name = "IX_EmailLibrary_EmailBounce_EmailBounceEmailAddress", IsUnique = true)] diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannel.cs b/Migration.Tool.KXP/Models/EmailLibraryEmailChannel.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/EmailLibraryEmailChannel.cs rename to Migration.Tool.KXP/Models/EmailLibraryEmailChannel.cs index 6ffdc15a..824fa9b2 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannel.cs +++ b/Migration.Tool.KXP/Models/EmailLibraryEmailChannel.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("EmailLibrary_EmailChannel")] [Index("EmailChannelChannelId", Name = "IX_EmailLibrary_EmailChannel_EmailChannelChannelID")] diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannelSender.cs b/Migration.Tool.KXP/Models/EmailLibraryEmailChannelSender.cs similarity index 96% rename from Migration.Toolkit.KXP/Models/EmailLibraryEmailChannelSender.cs rename to Migration.Tool.KXP/Models/EmailLibraryEmailChannelSender.cs index c8519526..1b14eca7 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannelSender.cs +++ b/Migration.Tool.KXP/Models/EmailLibraryEmailChannelSender.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("EmailLibrary_EmailChannelSender")] [Index("EmailChannelSenderEmailChannelId", Name = "IX_EmailLibrary_EmailChannelSender_EmailChannelSenderEmailChannelID")] diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailConfiguration.cs b/Migration.Tool.KXP/Models/EmailLibraryEmailConfiguration.cs similarity index 98% rename from Migration.Toolkit.KXP/Models/EmailLibraryEmailConfiguration.cs rename to Migration.Tool.KXP/Models/EmailLibraryEmailConfiguration.cs index 47d08ec5..05b27f79 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailConfiguration.cs +++ b/Migration.Tool.KXP/Models/EmailLibraryEmailConfiguration.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("EmailLibrary_EmailConfiguration")] [Index("EmailConfigurationContentItemId", Name = "IX_EmailLibrary_EmailConfiguration_EmailConfigurationContentItemID")] diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailLink.cs b/Migration.Tool.KXP/Models/EmailLibraryEmailLink.cs similarity index 96% rename from Migration.Toolkit.KXP/Models/EmailLibraryEmailLink.cs rename to Migration.Tool.KXP/Models/EmailLibraryEmailLink.cs index 8dd593b2..5ae85c71 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailLink.cs +++ b/Migration.Tool.KXP/Models/EmailLibraryEmailLink.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("EmailLibrary_EmailLink")] [Index("EmailLinkEmailConfigurationId", Name = "IX_EmailLibrary_EmailLink_EmailLinkEmailConfigurationID")] diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailMarketingRecipient.cs b/Migration.Tool.KXP/Models/EmailLibraryEmailMarketingRecipient.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/EmailLibraryEmailMarketingRecipient.cs rename to Migration.Tool.KXP/Models/EmailLibraryEmailMarketingRecipient.cs index 18e5b4b8..2bf61e92 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailMarketingRecipient.cs +++ b/Migration.Tool.KXP/Models/EmailLibraryEmailMarketingRecipient.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("EmailLibrary_EmailMarketingRecipient")] [Index("EmailMarketingRecipientContactId", Name = "IX_EmailLibrary_EmailMarketingRecipient_EmailMarketingRecipientContactID")] diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatistic.cs b/Migration.Tool.KXP/Models/EmailLibraryEmailStatistic.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/EmailLibraryEmailStatistic.cs rename to Migration.Tool.KXP/Models/EmailLibraryEmailStatistic.cs index 916a6933..a246811e 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatistic.cs +++ b/Migration.Tool.KXP/Models/EmailLibraryEmailStatistic.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("EmailLibrary_EmailStatistics")] [Index("EmailStatisticsEmailConfigurationId", Name = "IX_EmailLibrary_EmailStatistics_EmailStatisticsEmailConfigurationID")] diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatisticsHit.cs b/Migration.Tool.KXP/Models/EmailLibraryEmailStatisticsHit.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/EmailLibraryEmailStatisticsHit.cs rename to Migration.Tool.KXP/Models/EmailLibraryEmailStatisticsHit.cs index b9a7ff99..b616bb99 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatisticsHit.cs +++ b/Migration.Tool.KXP/Models/EmailLibraryEmailStatisticsHit.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("EmailLibrary_EmailStatisticsHits")] [Index("EmailStatisticsHitsEmailConfigurationId", Name = "IX_EmailLibrary_EmailStatisticsHits_EmailStatisticsHitsEmailConfigurationID")] diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs b/Migration.Tool.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs rename to Migration.Tool.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs index 28218f02..14a65d45 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs +++ b/Migration.Tool.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("EmailLibrary_EmailSubscriptionConfirmation")] [Index("EmailSubscriptionConfirmationContactId", Name = "IX_EmailLibrary_EmailSubscriptionConfirmation_EmailSubscriptionConfirmationContactID")] diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplate.cs b/Migration.Tool.KXP/Models/EmailLibraryEmailTemplate.cs similarity index 95% rename from Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplate.cs rename to Migration.Tool.KXP/Models/EmailLibraryEmailTemplate.cs index 029f3739..c60f06be 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplate.cs +++ b/Migration.Tool.KXP/Models/EmailLibraryEmailTemplate.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("EmailLibrary_EmailTemplate")] public class EmailLibraryEmailTemplate diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplateContentType.cs b/Migration.Tool.KXP/Models/EmailLibraryEmailTemplateContentType.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplateContentType.cs rename to Migration.Tool.KXP/Models/EmailLibraryEmailTemplateContentType.cs index 33a431f4..b391486d 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplateContentType.cs +++ b/Migration.Tool.KXP/Models/EmailLibraryEmailTemplateContentType.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("EmailLibrary_EmailTemplateContentType")] [Index("EmailTemplateContentTypeContentTypeId", Name = "IX_EmailLibrary_EmailTemplateContentType_EmailTemplateContentTypeContentTypeID")] diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryRecipientListSetting.cs b/Migration.Tool.KXP/Models/EmailLibraryRecipientListSetting.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/EmailLibraryRecipientListSetting.cs rename to Migration.Tool.KXP/Models/EmailLibraryRecipientListSetting.cs index 32e2217a..f4662fad 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryRecipientListSetting.cs +++ b/Migration.Tool.KXP/Models/EmailLibraryRecipientListSetting.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("EmailLibrary_RecipientListSettings")] [Index("RecipientListSettingsRecipientListId", Name = "IX_EmailLibrary_RecipientListSettings_RecipientListSettingsRecipientListID")] diff --git a/Migration.Toolkit.KXP/Models/EmailLibrarySendConfiguration.cs b/Migration.Tool.KXP/Models/EmailLibrarySendConfiguration.cs similarity index 97% rename from Migration.Toolkit.KXP/Models/EmailLibrarySendConfiguration.cs rename to Migration.Tool.KXP/Models/EmailLibrarySendConfiguration.cs index 32a2caba..ebbd1335 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibrarySendConfiguration.cs +++ b/Migration.Tool.KXP/Models/EmailLibrarySendConfiguration.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("EmailLibrary_SendConfiguration")] [Index("SendConfigurationEmailConfigurationId", Name = "IX_EmailLibrary_SendConfiguration_SendConfigurationEmailConfigurationID")] diff --git a/Migration.Tool.KXP/Models/MediaFile.cs b/Migration.Tool.KXP/Models/MediaFile.cs new file mode 100644 index 00000000..55619c35 --- /dev/null +++ b/Migration.Tool.KXP/Models/MediaFile.cs @@ -0,0 +1,70 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("Media_File")] +[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] +[Index("FileGuid", Name = "IX_Media_File_FileGUID")] +[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] +[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] +public class MediaFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string FileTitle { get; set; } = null!; + + public string FileDescription { get; set; } = null!; + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public string FilePath { get; set; } = null!; + + public long FileSize { get; set; } + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileLibraryID")] + public int FileLibraryId { get; set; } + + [Column("FileCreatedByUserID")] + public int? FileCreatedByUserId { get; set; } + + public DateTime FileCreatedWhen { get; set; } + + [Column("FileModifiedByUserID")] + public int? FileModifiedByUserId { get; set; } + + public DateTime FileModifiedWhen { get; set; } + + public string? FileCustomData { get; set; } + + [ForeignKey("FileCreatedByUserId")] + [InverseProperty("MediaFileFileCreatedByUsers")] + public virtual CmsUser? FileCreatedByUser { get; set; } + + [ForeignKey("FileLibraryId")] + [InverseProperty("MediaFiles")] + public virtual MediaLibrary FileLibrary { get; set; } = null!; + + [ForeignKey("FileModifiedByUserId")] + [InverseProperty("MediaFileFileModifiedByUsers")] + public virtual CmsUser? FileModifiedByUser { get; set; } +} diff --git a/Migration.Tool.KXP/Models/MediaLibrary.cs b/Migration.Tool.KXP/Models/MediaLibrary.cs new file mode 100644 index 00000000..1a2bb178 --- /dev/null +++ b/Migration.Tool.KXP/Models/MediaLibrary.cs @@ -0,0 +1,36 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("Media_Library")] +[Index("LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] +public class MediaLibrary +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [StringLength(250)] + public string LibraryName { get; set; } = null!; + + [StringLength(250)] + public string LibraryDisplayName { get; set; } = null!; + + public string? LibraryDescription { get; set; } + + [StringLength(250)] + public string LibraryFolder { get; set; } = null!; + + public int? LibraryAccess { get; set; } + + [Column("LibraryGUID")] + public Guid? LibraryGuid { get; set; } + + public DateTime? LibraryLastModified { get; set; } + + [InverseProperty("FileLibrary")] + public virtual ICollection MediaFiles { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/OmAccount.cs b/Migration.Tool.KXP/Models/OmAccount.cs new file mode 100644 index 00000000..119e3783 --- /dev/null +++ b/Migration.Tool.KXP/Models/OmAccount.cs @@ -0,0 +1,113 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("OM_Account")] +[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] +[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] +[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] +[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] +[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] +[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] +[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] +public class OmAccount +{ + [Key] + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [ForeignKey("AccountCountryId")] + [InverseProperty("OmAccounts")] + public virtual CmsCountry? AccountCountry { get; set; } + + [ForeignKey("AccountOwnerUserId")] + [InverseProperty("OmAccounts")] + public virtual CmsUser? AccountOwnerUser { get; set; } + + [ForeignKey("AccountPrimaryContactId")] + [InverseProperty("OmAccountAccountPrimaryContacts")] + public virtual OmContact? AccountPrimaryContact { get; set; } + + [ForeignKey("AccountSecondaryContactId")] + [InverseProperty("OmAccountAccountSecondaryContacts")] + public virtual OmContact? AccountSecondaryContact { get; set; } + + [ForeignKey("AccountStateId")] + [InverseProperty("OmAccounts")] + public virtual CmsState? AccountState { get; set; } + + [ForeignKey("AccountStatusId")] + [InverseProperty("OmAccounts")] + public virtual OmAccountStatus? AccountStatus { get; set; } + + [ForeignKey("AccountSubsidiaryOfId")] + [InverseProperty("InverseAccountSubsidiaryOf")] + public virtual OmAccount? AccountSubsidiaryOf { get; set; } + + [InverseProperty("AccountSubsidiaryOf")] + public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); + + [InverseProperty("Account")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/OmAccountContact.cs b/Migration.Tool.KXP/Models/OmAccountContact.cs new file mode 100644 index 00000000..ede60fe6 --- /dev/null +++ b/Migration.Tool.KXP/Models/OmAccountContact.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("OM_AccountContact")] +[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] +[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] +[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] +public class OmAccountContact +{ + [Key] + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("AccountId")] + [InverseProperty("OmAccountContacts")] + public virtual OmAccount Account { get; set; } = null!; + + [ForeignKey("ContactId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("ContactRoleId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContactRole? ContactRole { get; set; } +} diff --git a/Migration.Tool.KXP/Models/OmAccountStatus.cs b/Migration.Tool.KXP/Models/OmAccountStatus.cs new file mode 100644 index 00000000..3e4ca490 --- /dev/null +++ b/Migration.Tool.KXP/Models/OmAccountStatus.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("OM_AccountStatus")] +public class OmAccountStatus +{ + [Key] + [Column("AccountStatusID")] + public int AccountStatusId { get; set; } + + [StringLength(200)] + public string AccountStatusName { get; set; } = null!; + + [StringLength(200)] + public string AccountStatusDisplayName { get; set; } = null!; + + public string? AccountStatusDescription { get; set; } + + [InverseProperty("AccountStatus")] + public virtual ICollection OmAccounts { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/OmActivity.cs b/Migration.Tool.KXP/Models/OmActivity.cs new file mode 100644 index 00000000..098b39e0 --- /dev/null +++ b/Migration.Tool.KXP/Models/OmActivity.cs @@ -0,0 +1,76 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("OM_Activity")] +[Index("ActivityChannelId", Name = "IX_OM_Activity_ActivityChannelID")] +[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] +[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] +[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] +[Index("ActivityLanguageId", Name = "IX_OM_Activity_ActivityLanguageID")] +[Index("ActivityType", "ActivityItemId", "ActivityWebPageItemGuid", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityWebPageItemGUID_ActivityUTMSource_ActivityUTMContent")] +public class OmActivity +{ + [Key] + [Column("ActivityID")] + public int ActivityId { get; set; } + + [Column("ActivityContactID")] + public int ActivityContactId { get; set; } + + public DateTime? ActivityCreated { get; set; } + + [StringLength(250)] + public string ActivityType { get; set; } = null!; + + [Column("ActivityItemID")] + public int? ActivityItemId { get; set; } + + [Column("ActivityItemDetailID")] + public int? ActivityItemDetailId { get; set; } + + [StringLength(250)] + public string? ActivityValue { get; set; } + + [Column("ActivityURL")] + public string? ActivityUrl { get; set; } + + [StringLength(250)] + public string? ActivityTitle { get; set; } + + public string? ActivityComment { get; set; } + + [Column("ActivityURLReferrer")] + public string? ActivityUrlreferrer { get; set; } + + [Column("ActivityUTMSource")] + [StringLength(200)] + public string? ActivityUtmsource { get; set; } + + [Column("ActivityUTMContent")] + [StringLength(200)] + public string? ActivityUtmcontent { get; set; } + + [Column("ActivityTrackedWebsiteID")] + public int? ActivityTrackedWebsiteId { get; set; } + + [Column("ActivityWebPageItemGUID")] + public Guid? ActivityWebPageItemGuid { get; set; } + + [Column("ActivityLanguageID")] + public int? ActivityLanguageId { get; set; } + + [Column("ActivityChannelID")] + public int? ActivityChannelId { get; set; } + + [ForeignKey("ActivityChannelId")] + [InverseProperty("OmActivities")] + public virtual CmsChannel? ActivityChannel { get; set; } + + [ForeignKey("ActivityLanguageId")] + [InverseProperty("OmActivities")] + public virtual CmsContentLanguage? ActivityLanguage { get; set; } +} diff --git a/Migration.Tool.KXP/Models/OmActivityRecalculationQueue.cs b/Migration.Tool.KXP/Models/OmActivityRecalculationQueue.cs new file mode 100644 index 00000000..69e35fcb --- /dev/null +++ b/Migration.Tool.KXP/Models/OmActivityRecalculationQueue.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("OM_ActivityRecalculationQueue")] +public class OmActivityRecalculationQueue +{ + [Key] + [Column("ActivityRecalculationQueueID")] + public int ActivityRecalculationQueueId { get; set; } + + [Column("ActivityRecalculationQueueActivityID")] + public int ActivityRecalculationQueueActivityId { get; set; } +} diff --git a/Migration.Tool.KXP/Models/OmActivityType.cs b/Migration.Tool.KXP/Models/OmActivityType.cs new file mode 100644 index 00000000..ce2538a7 --- /dev/null +++ b/Migration.Tool.KXP/Models/OmActivityType.cs @@ -0,0 +1,41 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("OM_ActivityType")] +public class OmActivityType +{ + [Key] + [Column("ActivityTypeID")] + public int ActivityTypeId { get; set; } + + [StringLength(250)] + public string ActivityTypeDisplayName { get; set; } = null!; + + [StringLength(250)] + public string ActivityTypeName { get; set; } = null!; + + public bool? ActivityTypeEnabled { get; set; } + + public bool? ActivityTypeIsCustom { get; set; } + + public string? ActivityTypeDescription { get; set; } + + public bool? ActivityTypeManualCreationAllowed { get; set; } + + [StringLength(200)] + public string? ActivityTypeMainFormControl { get; set; } + + [StringLength(200)] + public string? ActivityTypeDetailFormControl { get; set; } + + [StringLength(7)] + public string? ActivityTypeColor { get; set; } + + [StringLength(200)] + public string? ActivityTypeItemObjectType { get; set; } + + [StringLength(200)] + public string? ActivityTypeItemDetailObjectType { get; set; } +} diff --git a/Migration.Tool.KXP/Models/OmContact.cs b/Migration.Tool.KXP/Models/OmContact.cs new file mode 100644 index 00000000..c859b081 --- /dev/null +++ b/Migration.Tool.KXP/Models/OmContact.cs @@ -0,0 +1,136 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("OM_Contact")] +[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] +[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] +[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] +[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] +[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] +[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] +[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] +public class OmContact +{ + [Key] + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(50)] + public string? ContactJobTitle { get; set; } + + [StringLength(100)] + public string? ContactAddress1 { get; set; } + + [StringLength(100)] + public string? ContactCity { get; set; } + + [Column("ContactZIP")] + [StringLength(100)] + public string? ContactZip { get; set; } + + [Column("ContactStateID")] + public int? ContactStateId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [StringLength(26)] + public string? ContactMobilePhone { get; set; } + + [StringLength(26)] + public string? ContactBusinessPhone { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + public DateTime? ContactBirthday { get; set; } + + public int? ContactGender { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + public string? ContactNotes { get; set; } + + [Column("ContactOwnerUserID")] + public int? ContactOwnerUserId { get; set; } + + public bool? ContactMonitored { get; set; } + + [Column("ContactGUID")] + public Guid ContactGuid { get; set; } + + public DateTime ContactLastModified { get; set; } + + public DateTime ContactCreated { get; set; } + + public int? ContactBounces { get; set; } + + [StringLength(200)] + public string? ContactCampaign { get; set; } + + [Column("ContactSalesForceLeadID")] + [StringLength(18)] + public string? ContactSalesForceLeadId { get; set; } + + public bool? ContactSalesForceLeadReplicationDisabled { get; set; } + + public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } + + public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } + + [StringLength(100)] + public string? ContactCompanyName { get; set; } + + public bool? ContactSalesForceLeadReplicationRequired { get; set; } + + [InverseProperty("ConsentAgreementContact")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [ForeignKey("ContactCountryId")] + [InverseProperty("OmContacts")] + public virtual CmsCountry? ContactCountry { get; set; } + + [ForeignKey("ContactOwnerUserId")] + [InverseProperty("OmContacts")] + public virtual CmsUser? ContactOwnerUser { get; set; } + + [ForeignKey("ContactStateId")] + [InverseProperty("OmContacts")] + public virtual CmsState? ContactState { get; set; } + + [ForeignKey("ContactStatusId")] + [InverseProperty("OmContacts")] + public virtual OmContactStatus? ContactStatus { get; set; } + + [InverseProperty("EmailMarketingRecipientContact")] + public virtual ICollection EmailLibraryEmailMarketingRecipients { get; set; } = new List(); + + [InverseProperty("EmailSubscriptionConfirmationContact")] + public virtual ICollection EmailLibraryEmailSubscriptionConfirmations { get; set; } = new List(); + + [InverseProperty("AccountPrimaryContact")] + public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); + + [InverseProperty("AccountSecondaryContact")] + public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); + + [InverseProperty("VisitorToContactContact")] + public virtual ICollection OmVisitorToContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/OmContactChangeRecalculationQueue.cs b/Migration.Tool.KXP/Models/OmContactChangeRecalculationQueue.cs new file mode 100644 index 00000000..17fd7886 --- /dev/null +++ b/Migration.Tool.KXP/Models/OmContactChangeRecalculationQueue.cs @@ -0,0 +1,21 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("OM_ContactChangeRecalculationQueue")] +public class OmContactChangeRecalculationQueue +{ + [Key] + [Column("ContactChangeRecalculationQueueID")] + public int ContactChangeRecalculationQueueId { get; set; } + + [Column("ContactChangeRecalculationQueueContactID")] + public int ContactChangeRecalculationQueueContactId { get; set; } + + public string? ContactChangeRecalculationQueueChangedColumns { get; set; } + + public bool ContactChangeRecalculationQueueContactIsNew { get; set; } + + public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } +} diff --git a/Migration.Tool.KXP/Models/OmContactGroup.cs b/Migration.Tool.KXP/Models/OmContactGroup.cs new file mode 100644 index 00000000..28ac7fd9 --- /dev/null +++ b/Migration.Tool.KXP/Models/OmContactGroup.cs @@ -0,0 +1,45 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("OM_ContactGroup")] +public class OmContactGroup +{ + [Key] + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [StringLength(200)] + public string ContactGroupName { get; set; } = null!; + + [StringLength(200)] + public string ContactGroupDisplayName { get; set; } = null!; + + public string? ContactGroupDescription { get; set; } + + public string? ContactGroupDynamicCondition { get; set; } + + public bool? ContactGroupEnabled { get; set; } + + public DateTime? ContactGroupLastModified { get; set; } + + [Column("ContactGroupGUID")] + public Guid? ContactGroupGuid { get; set; } + + public int? ContactGroupStatus { get; set; } + + public bool? ContactGroupIsRecipientList { get; set; } + + [InverseProperty("EmailSubscriptionConfirmationRecipientList")] + public virtual ICollection EmailLibraryEmailSubscriptionConfirmations { get; set; } = new List(); + + [InverseProperty("RecipientListSettingsRecipientList")] + public virtual ICollection EmailLibraryRecipientListSettings { get; set; } = new List(); + + [InverseProperty("SendConfigurationRecipientList")] + public virtual ICollection EmailLibrarySendConfigurations { get; set; } = new List(); + + [InverseProperty("ContactGroupMemberContactGroup")] + public virtual ICollection OmContactGroupMembers { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/OmContactGroupMember.cs b/Migration.Tool.KXP/Models/OmContactGroupMember.cs new file mode 100644 index 00000000..d1699133 --- /dev/null +++ b/Migration.Tool.KXP/Models/OmContactGroupMember.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("OM_ContactGroupMember")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] +[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] +public class OmContactGroupMember +{ + [Key] + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + public int ContactGroupMemberType { get; set; } + + [Column("ContactGroupMemberRelatedID")] + public int ContactGroupMemberRelatedId { get; set; } + + public bool? ContactGroupMemberFromCondition { get; set; } + + public bool? ContactGroupMemberFromAccount { get; set; } + + public bool? ContactGroupMemberFromManual { get; set; } + + [ForeignKey("ContactGroupMemberContactGroupId")] + [InverseProperty("OmContactGroupMembers")] + public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/OmContactRole.cs b/Migration.Tool.KXP/Models/OmContactRole.cs new file mode 100644 index 00000000..af2f9a80 --- /dev/null +++ b/Migration.Tool.KXP/Models/OmContactRole.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("OM_ContactRole")] +public class OmContactRole +{ + [Key] + [Column("ContactRoleID")] + public int ContactRoleId { get; set; } + + [StringLength(200)] + public string ContactRoleName { get; set; } = null!; + + [StringLength(200)] + public string ContactRoleDisplayName { get; set; } = null!; + + public string? ContactRoleDescription { get; set; } + + [InverseProperty("ContactRole")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Tool.KXP/Models/OmContactStatus.cs b/Migration.Tool.KXP/Models/OmContactStatus.cs new file mode 100644 index 00000000..81e7f9bb --- /dev/null +++ b/Migration.Tool.KXP/Models/OmContactStatus.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("OM_ContactStatus")] +public class OmContactStatus +{ + [Key] + [Column("ContactStatusID")] + public int ContactStatusId { get; set; } + + [StringLength(200)] + public string ContactStatusName { get; set; } = null!; + + [StringLength(200)] + public string ContactStatusDisplayName { get; set; } = null!; + + public string? ContactStatusDescription { get; set; } + + [InverseProperty("ContactStatus")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/OmTrackedWebsite.cs b/Migration.Tool.KXP/Models/OmTrackedWebsite.cs similarity index 95% rename from Migration.Toolkit.KXP/Models/OmTrackedWebsite.cs rename to Migration.Tool.KXP/Models/OmTrackedWebsite.cs index f2d51329..7b8f1836 100644 --- a/Migration.Toolkit.KXP/Models/OmTrackedWebsite.cs +++ b/Migration.Tool.KXP/Models/OmTrackedWebsite.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Migration.Toolkit.KXP.Models; +namespace Migration.Tool.KXP.Models; [Table("OM_TrackedWebsite")] public class OmTrackedWebsite diff --git a/Migration.Tool.KXP/Models/OmVisitorToContact.cs b/Migration.Tool.KXP/Models/OmVisitorToContact.cs new file mode 100644 index 00000000..43ef7d00 --- /dev/null +++ b/Migration.Tool.KXP/Models/OmVisitorToContact.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Table("OM_VisitorToContact")] +[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] +[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] +public class OmVisitorToContact +{ + [Key] + [Column("VisitorToContactID")] + public int VisitorToContactId { get; set; } + + [Column("VisitorToContactVisitorGUID")] + public Guid VisitorToContactVisitorGuid { get; set; } + + [Column("VisitorToContactContactID")] + public int VisitorToContactContactId { get; set; } + + [ForeignKey("VisitorToContactContactId")] + [InverseProperty("OmVisitorToContacts")] + public virtual OmContact VisitorToContactContact { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/TempFile.cs b/Migration.Tool.KXP/Models/TempFile.cs new file mode 100644 index 00000000..95e23cf4 --- /dev/null +++ b/Migration.Tool.KXP/Models/TempFile.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("Temp_File")] +public class TempFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileParentGUID")] + public Guid FileParentGuid { get; set; } + + public int FileNumber { get; set; } + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + public long FileSize { get; set; } + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + public byte[]? FileBinary { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + public DateTime FileLastModified { get; set; } + + [StringLength(200)] + public string FileDirectory { get; set; } = null!; + + [StringLength(200)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string? FileTitle { get; set; } + + public string? FileDescription { get; set; } +} diff --git a/Migration.Tool.KXP/Models/TempPageBuilderWidget.cs b/Migration.Tool.KXP/Models/TempPageBuilderWidget.cs new file mode 100644 index 00000000..d18dd1a4 --- /dev/null +++ b/Migration.Tool.KXP/Models/TempPageBuilderWidget.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Tool.KXP.Models; + +[Table("Temp_PageBuilderWidgets")] +public class TempPageBuilderWidget +{ + [Key] + [Column("PageBuilderWidgetsID")] + public int PageBuilderWidgetsId { get; set; } + + public string? PageBuilderWidgetsConfiguration { get; set; } + + public Guid PageBuilderWidgetsGuid { get; set; } + + public DateTime PageBuilderWidgetsLastModified { get; set; } + + public string? PageBuilderTemplateConfiguration { get; set; } +} diff --git a/Migration.Tool.KXP/Models/ViewCmsResourceStringJoined.cs b/Migration.Tool.KXP/Models/ViewCmsResourceStringJoined.cs new file mode 100644 index 00000000..e6dd8dc7 --- /dev/null +++ b/Migration.Tool.KXP/Models/ViewCmsResourceStringJoined.cs @@ -0,0 +1,43 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Keyless] +public class ViewCmsResourceStringJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("TranslationID")] + public int? TranslationId { get; set; } + + [Column("TranslationStringID")] + public int? TranslationStringId { get; set; } + + [Column("TranslationCultureID")] + public int? TranslationCultureId { get; set; } + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int? CultureId { get; set; } + + [StringLength(200)] + public string? CultureName { get; set; } + + [StringLength(50)] + public string? CultureCode { get; set; } + + [Column("CultureGUID")] + public Guid? CultureGuid { get; set; } + + public DateTime? CultureLastModified { get; set; } +} diff --git a/Migration.Tool.KXP/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Tool.KXP/Models/ViewCmsResourceTranslatedJoined.cs new file mode 100644 index 00000000..0d8380a1 --- /dev/null +++ b/Migration.Tool.KXP/Models/ViewCmsResourceTranslatedJoined.cs @@ -0,0 +1,27 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Keyless] +public class ViewCmsResourceTranslatedJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Tool.KXP/Models/ViewOmAccountContactAccountJoined.cs new file mode 100644 index 00000000..9757aa01 --- /dev/null +++ b/Migration.Tool.KXP/Models/ViewOmAccountContactAccountJoined.cs @@ -0,0 +1,31 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Keyless] +public class ViewOmAccountContactAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } +} diff --git a/Migration.Tool.KXP/Models/ViewOmAccountContactContactJoined.cs b/Migration.Tool.KXP/Models/ViewOmAccountContactContactJoined.cs new file mode 100644 index 00000000..89f476d4 --- /dev/null +++ b/Migration.Tool.KXP/Models/ViewOmAccountContactContactJoined.cs @@ -0,0 +1,40 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Keyless] +public class ViewOmAccountContactContactJoined +{ + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } +} diff --git a/Migration.Tool.KXP/Models/ViewOmAccountJoined.cs b/Migration.Tool.KXP/Models/ViewOmAccountJoined.cs new file mode 100644 index 00000000..1341085f --- /dev/null +++ b/Migration.Tool.KXP/Models/ViewOmAccountJoined.cs @@ -0,0 +1,101 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Keyless] +public class ViewOmAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [StringLength(100)] + public string? PrimaryContactFirstName { get; set; } + + [StringLength(100)] + public string? PrimaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? PrimaryContactLastName { get; set; } + + [StringLength(100)] + public string? SecondaryContactFirstName { get; set; } + + [StringLength(100)] + public string? SecondaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? SecondaryContactLastName { get; set; } + + [StringLength(200)] + public string? SubsidiaryOfName { get; set; } + + [StringLength(302)] + public string PrimaryContactFullName { get; set; } = null!; + + [StringLength(302)] + public string SecondaryContactFullName { get; set; } = null!; + + [StringLength(201)] + public string AccountFullAddress { get; set; } = null!; +} diff --git a/Migration.Tool.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Tool.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs new file mode 100644 index 00000000..30c32657 --- /dev/null +++ b/Migration.Tool.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs @@ -0,0 +1,77 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Tool.KXP.Models; + +[Keyless] +public class ViewOmContactGroupMemberAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } +} diff --git a/Migration.Toolkit.KXP/genModel.ps1 b/Migration.Tool.KXP/genModel.ps1 similarity index 100% rename from Migration.Toolkit.KXP/genModel.ps1 rename to Migration.Tool.KXP/genModel.ps1 diff --git a/Migration.Tool.Model/DataClassModel.cs b/Migration.Tool.Model/DataClassModel.cs new file mode 100644 index 00000000..f4509231 --- /dev/null +++ b/Migration.Tool.Model/DataClassModel.cs @@ -0,0 +1,12 @@ +namespace Migration.Tool.Model; + +public class DataClassModel +{ + public virtual int ClassID { get; set; } + public virtual string ClassDisplayName { get; set; } + + public string ClassXmlSchema { get; set; } + public string ClassSearchSettings { get; set; } + public string ClassCodeGenerationSettings { get; set; } + public int ClassFormLayoutType { get; set; } +} \ No newline at end of file diff --git a/Migration.Toolkit.Model/Migration.Toolkit.Model.csproj b/Migration.Tool.Model/Migration.Tool.Model.csproj similarity index 100% rename from Migration.Toolkit.Model/Migration.Toolkit.Model.csproj rename to Migration.Tool.Model/Migration.Tool.Model.csproj diff --git a/Migration.Toolkit.Tests/HtmlProcessorTests.cs b/Migration.Tool.Tests/HtmlProcessorTests.cs similarity index 98% rename from Migration.Toolkit.Tests/HtmlProcessorTests.cs rename to Migration.Tool.Tests/HtmlProcessorTests.cs index e7c9977a..d18a55a7 100644 --- a/Migration.Toolkit.Tests/HtmlProcessorTests.cs +++ b/Migration.Tool.Tests/HtmlProcessorTests.cs @@ -1,6 +1,6 @@ -using Migration.Toolkit.Common.Helpers; +using Migration.Tool.Common.Helpers; -namespace Migration.Toolkit.Tests; +namespace Migration.Tool.Tests; public class HtmlProcessorTests { diff --git a/Migration.Toolkit.Tests/MediaHelperTest.cs b/Migration.Tool.Tests/MediaHelperTest.cs similarity index 99% rename from Migration.Toolkit.Tests/MediaHelperTest.cs rename to Migration.Tool.Tests/MediaHelperTest.cs index e09e4af0..1c74cd12 100644 --- a/Migration.Toolkit.Tests/MediaHelperTest.cs +++ b/Migration.Tool.Tests/MediaHelperTest.cs @@ -1,6 +1,6 @@ -using Migration.Toolkit.Common.Helpers; +using Migration.Tool.Common.Helpers; -namespace Migration.Toolkit.Tests; +namespace Migration.Tool.Tests; public class MediaHelperTest { diff --git a/Migration.Tool.Tests/Migration.Tool.Tests.csproj b/Migration.Tool.Tests/Migration.Tool.Tests.csproj new file mode 100644 index 00000000..d39eabf9 --- /dev/null +++ b/Migration.Tool.Tests/Migration.Tool.Tests.csproj @@ -0,0 +1,24 @@ + + + + false + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/Migration.Toolkit.Tests/Usings.cs b/Migration.Tool.Tests/Usings.cs similarity index 100% rename from Migration.Toolkit.Tests/Usings.cs rename to Migration.Tool.Tests/Usings.cs diff --git a/Migration.Tool.sln b/Migration.Tool.sln new file mode 100644 index 00000000..658e8b74 --- /dev/null +++ b/Migration.Tool.sln @@ -0,0 +1,122 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34728.123 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.CLI", "Migration.Tool.CLI\Migration.Tool.CLI.csproj", "{EA5BB39B-9871-4C3B-ADCD-987D0C985E21}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.KX13", "Migration.Tool.KX13\Migration.Tool.KX13.csproj", "{C834C407-683B-4251-A4CD-52C135DCA518}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.KXP", "Migration.Tool.KXP\Migration.Tool.KXP.csproj", "{5F3DCE58-E1ED-4190-B3DA-610AA4F166A0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.Common", "Migration.Tool.Common\Migration.Tool.Common.csproj", "{CE8ED7D2-DA7B-4106-BADA-A70E2DFCCAAF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.Core.KX13", "Migration.Tool.Core.KX13\Migration.Tool.Core.KX13.csproj", "{1F7DC18B-CF87-4AB2-A5CC-094125246954}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.KXP.Api", "Migration.Tool.KXP.Api\Migration.Tool.KXP.Api.csproj", "{8E806DDF-6405-4386-B69E-B6FAA672A188}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.KXP.Extensions", "Migration.Tool.KXP.Extensions\Migration.Tool.KXP.Extensions.csproj", "{B601194D-192B-4539-8AB0-9813130EFAD7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Instance.Extensions", "Instance.Extensions", "{D06721D3-6E2D-4235-B146-2BB80DF2DBA9}" + ProjectSection(SolutionItems) = preProject + KX13.Extensions\ToolApiController.cs = KX13.Extensions\ToolApiController.cs + KX13.NET48.Extensions\ToolApiController.NET48.cs = KX13.NET48.Extensions\ToolApiController.NET48.cs + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.Tests", "Migration.Tool.Tests\Migration.Tool.Tests.csproj", "{FEA68426-F772-419D-989D-C6ADDA757344}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.KX12", "Migration.Tool.KX12\Migration.Tool.KX12.csproj", "{CAC43720-697A-43C2-8F75-2D029AD2ABFD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.Core.KX12", "Migration.Tool.Core.KX12\Migration.Tool.Core.KX12.csproj", "{8094319D-85E5-430C-BBC0-345C9AA8CBF2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KX13", "KX13", "{5695AAC9-FF68-4AC2-ABFC-0FD5A512D3C3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KX12", "KX12", "{F823E280-75D2-4C82-825E-CB6FB00E7067}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "K11", "K11", "{1EA44136-F86A-4545-9B77-E480EAB649A3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.Core.K11", "Migration.Tool.Core.K11\Migration.Tool.Core.K11.csproj", "{361EF54F-8043-467A-87AC-1F3E0461F1F5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.K11", "Migration.Tool.K11\Migration.Tool.K11.csproj", "{1829633A-CEF8-47F0-8588-1BE5E9307218}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KVA", "KVA", "{296DCE8F-D009-4DE5-997D-6BD51611C546}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.Source", "KVA\Migration.Tool.Source\Migration.Tool.Source.csproj", "{C565B800-032C-44E4-A913-659C24E9A3EC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migration.Tool.Extensions", "Migration.Tool.Extensions\Migration.Tool.Extensions.csproj", "{2D2E8533-2C17-471F-BB9F-04DEEDE7F80B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EA5BB39B-9871-4C3B-ADCD-987D0C985E21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EA5BB39B-9871-4C3B-ADCD-987D0C985E21}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EA5BB39B-9871-4C3B-ADCD-987D0C985E21}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EA5BB39B-9871-4C3B-ADCD-987D0C985E21}.Release|Any CPU.Build.0 = Release|Any CPU + {C834C407-683B-4251-A4CD-52C135DCA518}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C834C407-683B-4251-A4CD-52C135DCA518}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C834C407-683B-4251-A4CD-52C135DCA518}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C834C407-683B-4251-A4CD-52C135DCA518}.Release|Any CPU.Build.0 = Release|Any CPU + {5F3DCE58-E1ED-4190-B3DA-610AA4F166A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5F3DCE58-E1ED-4190-B3DA-610AA4F166A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5F3DCE58-E1ED-4190-B3DA-610AA4F166A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5F3DCE58-E1ED-4190-B3DA-610AA4F166A0}.Release|Any CPU.Build.0 = Release|Any CPU + {CE8ED7D2-DA7B-4106-BADA-A70E2DFCCAAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE8ED7D2-DA7B-4106-BADA-A70E2DFCCAAF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE8ED7D2-DA7B-4106-BADA-A70E2DFCCAAF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE8ED7D2-DA7B-4106-BADA-A70E2DFCCAAF}.Release|Any CPU.Build.0 = Release|Any CPU + {1F7DC18B-CF87-4AB2-A5CC-094125246954}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F7DC18B-CF87-4AB2-A5CC-094125246954}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F7DC18B-CF87-4AB2-A5CC-094125246954}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F7DC18B-CF87-4AB2-A5CC-094125246954}.Release|Any CPU.Build.0 = Release|Any CPU + {8E806DDF-6405-4386-B69E-B6FAA672A188}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E806DDF-6405-4386-B69E-B6FAA672A188}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E806DDF-6405-4386-B69E-B6FAA672A188}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E806DDF-6405-4386-B69E-B6FAA672A188}.Release|Any CPU.Build.0 = Release|Any CPU + {B601194D-192B-4539-8AB0-9813130EFAD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B601194D-192B-4539-8AB0-9813130EFAD7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B601194D-192B-4539-8AB0-9813130EFAD7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B601194D-192B-4539-8AB0-9813130EFAD7}.Release|Any CPU.Build.0 = Release|Any CPU + {FEA68426-F772-419D-989D-C6ADDA757344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FEA68426-F772-419D-989D-C6ADDA757344}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FEA68426-F772-419D-989D-C6ADDA757344}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FEA68426-F772-419D-989D-C6ADDA757344}.Release|Any CPU.Build.0 = Release|Any CPU + {CAC43720-697A-43C2-8F75-2D029AD2ABFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CAC43720-697A-43C2-8F75-2D029AD2ABFD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CAC43720-697A-43C2-8F75-2D029AD2ABFD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CAC43720-697A-43C2-8F75-2D029AD2ABFD}.Release|Any CPU.Build.0 = Release|Any CPU + {8094319D-85E5-430C-BBC0-345C9AA8CBF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8094319D-85E5-430C-BBC0-345C9AA8CBF2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8094319D-85E5-430C-BBC0-345C9AA8CBF2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8094319D-85E5-430C-BBC0-345C9AA8CBF2}.Release|Any CPU.Build.0 = Release|Any CPU + {361EF54F-8043-467A-87AC-1F3E0461F1F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {361EF54F-8043-467A-87AC-1F3E0461F1F5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {361EF54F-8043-467A-87AC-1F3E0461F1F5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {361EF54F-8043-467A-87AC-1F3E0461F1F5}.Release|Any CPU.Build.0 = Release|Any CPU + {1829633A-CEF8-47F0-8588-1BE5E9307218}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1829633A-CEF8-47F0-8588-1BE5E9307218}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1829633A-CEF8-47F0-8588-1BE5E9307218}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1829633A-CEF8-47F0-8588-1BE5E9307218}.Release|Any CPU.Build.0 = Release|Any CPU + {C565B800-032C-44E4-A913-659C24E9A3EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C565B800-032C-44E4-A913-659C24E9A3EC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C565B800-032C-44E4-A913-659C24E9A3EC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C565B800-032C-44E4-A913-659C24E9A3EC}.Release|Any CPU.Build.0 = Release|Any CPU + {2D2E8533-2C17-471F-BB9F-04DEEDE7F80B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D2E8533-2C17-471F-BB9F-04DEEDE7F80B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D2E8533-2C17-471F-BB9F-04DEEDE7F80B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D2E8533-2C17-471F-BB9F-04DEEDE7F80B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {C834C407-683B-4251-A4CD-52C135DCA518} = {5695AAC9-FF68-4AC2-ABFC-0FD5A512D3C3} + {1F7DC18B-CF87-4AB2-A5CC-094125246954} = {5695AAC9-FF68-4AC2-ABFC-0FD5A512D3C3} + {CAC43720-697A-43C2-8F75-2D029AD2ABFD} = {F823E280-75D2-4C82-825E-CB6FB00E7067} + {8094319D-85E5-430C-BBC0-345C9AA8CBF2} = {F823E280-75D2-4C82-825E-CB6FB00E7067} + {361EF54F-8043-467A-87AC-1F3E0461F1F5} = {1EA44136-F86A-4545-9B77-E480EAB649A3} + {1829633A-CEF8-47F0-8588-1BE5E9307218} = {1EA44136-F86A-4545-9B77-E480EAB649A3} + {C565B800-032C-44E4-A913-659C24E9A3EC} = {296DCE8F-D009-4DE5-997D-6BD51611C546} + EndGlobalSection +EndGlobal diff --git a/Migration.Toolkit.CLI/Migration.Toolkit.CLI.csproj b/Migration.Toolkit.CLI/Migration.Toolkit.CLI.csproj deleted file mode 100644 index a25da82e..00000000 --- a/Migration.Toolkit.CLI/Migration.Toolkit.CLI.csproj +++ /dev/null @@ -1,37 +0,0 @@ - - - - Exe - - - - - - - - - - - - - - - - - - - - - - - - - - Always - - - Always - - - - diff --git a/Migration.Toolkit.CLI/README.md b/Migration.Toolkit.CLI/README.md deleted file mode 100644 index 94ead392..00000000 --- a/Migration.Toolkit.CLI/README.md +++ /dev/null @@ -1,736 +0,0 @@ -# Migration CLI - -The [Xperience by Kentico: Kentico Migration Tool](/README.md) transfers content and other data from **Kentico Xperience -13**, **Kentico 12** or **Kentico 11** to **Xperience by Kentico**. - -The migration is performed by running a command for the .NET CLI. - -## Set up the source instance - -The source instance of Kentico must **not** use a [separated contact management database](https://docs.kentico.com/x/4giRBg), it is recommended that you [rejoin the contact management database](https://docs.kentico.com/x/5giRBg) before proceeding with the migration. - -## Set up the target instance - -The target of the migration must be an Xperience by Kentico instance that fulfills the following requirements: - -* The instance's database and file system must be accessible from the environment where you run the migration. -* The target application *must not be running* when you start the migration. -* The target instance must be empty except for data from the source instance created by previous runs of this tool. -* For performance optimization, the migration transfers certain objects using bulk SQL queries. As a result, you always - need to delete all objects of the following types before running repeated migrations: - * **Contacts**, including their **Activities** (when using the `migrate --contact-management` parameter) - * **Consent agreements** (when using the `migrate --data-protection` parameter) - * **Form submissions** (when using the `migrate --forms` parameter) - * **Custom module class data** (when using the `--custom-modules` parameter) - -To create a suitable target instance, [install a new Xperience by Kentico project](https://docs.xperience.io/x/DQKQC) -using the **Boilerplate** project template. - -## Migrate data - -To perform the migration: - -1. Make sure the [target instance is set up correctly](#set-up-the-target-instance). -2. [Configure](#configuration) the options in the `Migration.Toolkit.CLI` project's `appsettings.json` file. -3. Compile the `Migration.Toolkit.CLI` project. -4. Open the command line prompt. -5. Navigate to the project's output directory. -6. Run the `Migration.Toolkit.CLI.exe migrate` command with parameters according to your requirements. -7. Observe the command line output and review the [migration protocol](./MIGRATION_PROTOCOL_REFERENCE.md), which - provides information about the result of the migration, lists required manual steps, etc. -8. On SaaS projects, you need to manually move content item asset files. See [Content items](#content-items) for more information. - -### Migrate command parameters - -Command usage: - -```powershell -Migration.Toolkit.CLI.exe migrate --sites --custom-modules --users --members --forms --media-libraries --attachments --page-types --pages --settings-keys --contact-management --data-protection -``` - -| Parameter | Description | Dependencies | -|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------| -| `--sites` | Enables migration of sites to [website channels](https://docs.xperience.io/x/34HFC). The site's basic properties and settings are transferred to the target instance. | | -| `--custom-modules` | Enables migration of custom modules, [custom module classes and their data](https://docs.xperience.io/x/AKDWCQ), and [custom fields in supported system classes](https://docs.xperience.io/x/V6rWCQ).

See: [Migration details for specific object types - Custom modules and classes](#custom-modules-and-classes) | `--sites` | -| `--custom-tables` | Enables migration of [custom tables](https://docs.kentico.com/x/eQ2RBg).

See: [Migration details for specific object types - Custom tables](#custom-tables) | | -| `--users` | Enables migration of [users](https://docs.xperience.io/x/8ILWCQ) and [roles](https://docs.xperience.io/x/7IVwCg).

See: [Migration details for specific object types - Users](#users) | `--sites`, `--custom-modules` | -| `--members` | Enables migration of live site user accounts to [members](https://docs.xperience.io/x/BIsuCw).

See: [Migration details for specific object types - Members](#members) | `--sites`, `--custom-modules` | -| `--settings-keys` | Enables migration of values for [settings](https://docs.xperience.io/x/7YjFC) that are available in Xperience by Kentico. | `--sites` | -| `--page-types` | Enables migration of [content types](https://docs.xperience.io/x/gYHWCQ) (originally *page types* in Kentico Xperience 13) and [preset page templates](https://docs.xperience.io/x/KZnWCQ) (originally *custom page templates*). Required to migrate Pages.

See: [Migration details for specific object types - Content types](#content-types) | `--sites` | -| `--pages` | Enables migration of [pages](https://docs.xperience.io/x/bxzfBw).

The target instance must not contain pages other than those created by previous runs of the Kentico Migration Tool.

See: [Migration details for specific object types - Pages](#pages) | `--sites`, `--users`, `--page-types` | -| `--categories` | Enables migration of categories to taxonomies. Xperience by Kentico uses a different approach to categorization. Categories are migrated to [taxonomies](https://docs.kentico.com/x/taxonomies_xp) and selected categories for each page are assigned to pages in the target instance via a [reusable field schema](https://docs.kentico.com/x/D4_OD). See [`Categories`](#categories). | `--sites`, `--users`, `--pagetypes`, `--pages` | -| `--attachments` | Enables migration of page attachments to [content hub](https://docs.kentico.com/x/barWCQ) as content item assets (page attachments are not supported in Xperience by Kentico).

See: [Migration details for specific object types - Attachments](#attachments) | `--sites`, `--custom-modules` | -| `--contact-management` | Enables migration of [contacts](https://docs.xperience.io/x/nYPWCQ) and [activities](https://docs.xperience.io/x/oYPWCQ). The target instance must not contain any contacts or activities. May run for a long time depending on the number of contacts in the source database. | `--users`, `--custom-modules` | -| `--data-protection` | Enables migration of [consents](https://docs.xperience.io/x/zoB1CQ) and consent agreements. | `--sites`, `--users`, `--contact management` | -| `--forms` | Enables migration of [forms](https://docs.xperience.io/x/WAKiCQ) and submitted form data.

See: [Migration details for specific object types - Forms](#forms) | `--sites`, `--custom-modules`, `--users` | -| `--media-libraries` | Enables migration of [media libraries](https://docs.xperience.io/x/agKiCQ) to [content hub](https://docs.kentico.com/x/barWCQ) as content item assets. This behavior can be adjusted by `MigrateOnlyMediaFileInfo` and `MigrateMediaToMediaLibrary` [configuration options](#configuration). | `--sites`, `--custom-modules`, `--users` | -| `--countries` | Enables migration of countries and states. Xperience by Kentico currently uses countries and states to fill selectors when editing contacts and contact group conditions. | | -| `--bypass-dependency-check` | Skips the migrate command's dependency check. Use for repeated runs of the migration if you know that dependencies were already migrated successfully (for example `--page types` when migrating pages). | | - -### Examples - -* `Migration.Toolkit.CLI.exe migrate --sites --custom-modules --users --settings-keys --media-libraries --page-types --pages` - * First migration that includes the site object, custom modules and classes, users, setting key values, media - libraries, page types and pages -* `Migration.Toolkit.CLI.exe migrate --page-types --pages --bypass-dependency-check` - * Repeated migration only for page types and pages, if you know that sites and users were already migrated - successfully. -* `Migration.Toolkit.CLI.exe migrate --pages --bypass-dependency-check` - * Repeated migration only for pages, if you know that page types, sites, and users were already migrated - successfully. - -### Migration details for specific object types - -#### Content types - -Content types are named **Page types** in earlier Kentico products. - -Xperience by Kentico currently does not support: - -* Macro expressions in page type field default values or other settings. Content type fields containing macros will not - work correctly after the migration. -* Page type inheritance. You cannot migrate page types that inherit fields from other types. -* Categories for page type fields. Field categories are not migrated with page types. - -The Kentico Migration Tool attempts to map the *Data type* and *Form control* of page type fields to an appropriate -equivalent in Xperience by Kentico. This is not always possible, and cannot be done for custom data types or form -controls. We recommend that you check your content type fields after the migration and adjust them if necessary. - -The following table describes how the Kentico Migration Tool maps the data types and form controls/components of page -type fields: - -| KX13/12/11 Data type | XbK Data type | KX13/12/11 Form control | XbK Form component | -|--------------------------|--------------------------|-------------------------|-----------------------------------------------------------------------------------------| -| Text | Text | Text box | Text input | -| Text | Text | Drop-down list | Dropdown selector | -| Text | Text | Radio buttons | Radio button group | -| Text | Text | Text area | Text area | -| Text | Text | *other* | Text input | -| Long text | Long text | Rich text editor | Rich text editor | -| Long text | Long text | Text box | Text input | -| Long text | Long text | Drop-down list | Dropdown selector | -| Long text | Long text | Text area | Text area | -| Long text | Long text | *other* | Rich text editor | -| Integer number | Integer number | *any* | Number input | -| Long integer number | Long integer number | *any* | Number input | -| Floating-point number | Floating-point number | *any* | Number input | -| Decimal number | Decimal number | *any* | Decimal number input | -| Date and time | Date and time | *any* | Datetime input | -| Date | Date | *any* | Date input | -| Time interval | Time interval | *any* | None (not supported) | -| Boolean (Yes/No) | Boolean (Yes/No) | *any* | Checkbox | -| Attachments | Media files | *any* (Attachments) | Media file selector
(the [attachments](#attachments) are converted to media files) | -| File | Media files | *any* (Direct uploader) | Media file selector
(the [attachments](#attachments) are converted to media files) | -| Unique identifier (Guid) | Unique identifier (Guid) | *any* | None (not supported) | -| Pages | Pages | *any* (Pages) | Page selector | - -Additionally, you can enable the Conversion of text fields with media links (*Media selection* form control) to content item assets or media -library files by setting -the `OptInFeatures.CustomMigration.FieldMigrations` [configuration option](#convert-text-fields-with-media-links). - -Some [Form components](https://docs.xperience.io/x/5ASiCQ) used by content type fields in Xperience by Kentico store -data differently than their equivalent Form control in Xperience 13. To ensure that content is displayed correctly on -pages, you must manually adjust your website's implementation to match the new data format. -See [Editing components in Xperience by Kentico](https://docs.xperience.io/x/wIfWCQ) to learn more about some of the -most common components and selectors. - -#### Reusable field schemas - -You can create [reusable field schemas](https://docs.kentico.com/x/D4_OD) from page types from which other page types -inherit, by setting -the `Settings.CreateReusableFieldSchemaForClasses` [configuration option](#convert-page-types-to-reusable-field-schemas). - -#### Content items - -If the target instance is a [SaaS project](https://docs.kentico.com/x/saas_xp) ([installed](https://docs.kentico.com/x/DQKQC) with the `--cloud` option) you need to manually move any content item asset binary files from the default location (`~/assets`) to the location specified in the `StorageInitializationModule.cs` file, which is `~/$StorageAssets/default/assets` by default. This is necessary to enable the system to map the asset binary files to the [Azure Blob storage](https://docs.kentico.com/x/5IfWCQ). - -#### Pages - -* The migration includes the following versions of pages: - * _Published_ - * _Latest draft version_ - for published pages, the version is migrated to the - _Draft_ [workflow step](https://docs.xperience.io/x/JwKQC#Pages-Pageworkflow); for pages that do not have a - published version, the version is migrated to the _Draft (initial)_ workflow step. - * _Archived_ -* URLs are migrated depending on the source instance version: - * For Kentico Xperience 13, the migration: - * includes the URL paths of pages and Former URLs - * does not include Alternative URLs - * For Kentico 12 and Kentico 11, URL paths are not migrated. Instead, a default URL path is created from - the `DocumentUrlPath` or `NodeAliasPath`. -* Linked pages are currently not supported in Xperience by Kentico. The migration creates standard page copies for any - linked pages on the source instance. -* Page permissions (ACLs) are currently not migrated into Xperience by Kentico. -* Migration of Page Builder content is only available for Kentico Xperience 13. - -#### Page Builder content - -> :warning: Page Builder content migration is only available when migrating from Kentico Xperience 13. - -By default, JSON data storing the Page Builder content of pages and custom page templates is migrated directly without -modifications. On the target Xperience by Kentico instance, the migrated data can work in the Page Builder's legacy -compatibility mode. However, we strongly recommend updating your codebase to the new Xperience by Kentico components. - -The Kentico Migration Tool provides an advanced migration mode for Page Builder content that utilizes API discovery on -the source instance. To learn more details and how to configure this feature, -see [Source instance API discovery](#source-instance-api-discovery). - -#### Categories - -Xperience by Kentico uses a different approach to categorization than older Kentico -versions. [Categories](https://docs.kentico.com/13/configuring-xperience/configuring-the-environment-for-content-editors/configuring-categories) -were replaced by [taxonomies](https://docs.kentico.com/developers-and-admins/configuration/taxonomies) and selected -categories for each page are assigned to pages in the target instance via -a [reusable field schema](https://docs.kentico.com/x/D4_OD). The key differences are: - -* Categories in older versions can be added to any page via the *Properties -> Categories* tab. Taxonomies can only be - used for content items (pages, emails...) that have a field with the *Taxonomy* data type. -* Categories can be global or site-specific. Taxonomies are always global, as there are no sites in Xperience by - Kentico. -* Categories are assigned to pages regardless of their workflow step. Taxonomies are stored as a field and are covered - by workflow. As a result, assigned tags can be different in each workflow step. -* [Categories stored as a field](https://docs.kentico.com/x/wA_RBg) - and [personal categories](https://docs.kentico.com/x/IgqRBg) are not supported by the migration. - -The migration process for categories performs the following steps: - -1. A new [taxonomy](https://docs.kentico.com/developers-and-admins/configuration/taxonomies) named **Categories** (code - name `categories`) is created to house all categories from the source instance. -2. A new [reusable field schema](https://docs.kentico.com/x/D4_OD) named **Categories container** (code - name `categories_container`) is created to allow linking tags to pages. - -* The schema contains one field, **Categories_Legacy** (data type **Taxonomy**, configured to enable selection from the - *Categories* taxonomy). - -3. On the target instance, the *Categories container* reusable field schema is added to all content types where at least - one page had a category assigned in the source instance. -4. Supported categories from the source instance are migrated as tags to the *Categories* taxonomy in the target - instance. The category hierarchy from the source instance is maintained in the target instance. -5. On the target instance, tags are assigned to pages according to the source instance. - -* Each [language variant](https://docs.kentico.com/business-users/website-content/translate-pages) of a page is treated - individually and receives its corresponding group of tags based on the source instance. -* Tags from the source page are added to all - available [workflow steps](https://docs.kentico.com/developers-and-admins/configuration/workflows) of the target page. - -#### Custom modules and classes - -The migration includes the following: - -* Custom modules - * Note: The `CMS.` prefix/namespace is reserved for system modules and not allowed in custom module code names. If - present, this code name prefix is removed during the migration. -* All classes belonging under custom modules -* All data stored within custom module classes -* The following customizable system classes and their custom fields: - * *Membership > User* - * *Media libraries > Media file* - * *Contact management > Contact management - Account* (however, accounts are currently not supported in Xperience by - Kentico) - * *Contact management > Contact management - Contact* - -Module and class migration does NOT include: - -* UI elements and all related user interface settings. The administration of Xperience by Kentico uses a different - technology stack than Kentico Xperience 13 and is incompatible. To learn how to build the administration UI, - see [Extend the administration interface](https://docs.xperience.io/x/GwKQC) - and [Example - Offices management application](https://docs.xperience.io/x/hIFwCg). -* Alternative forms under classes and UI-related configuration of class fields (field labels, Form controls, etc.). You - need to manually create appropriate [UI forms](https://docs.xperience.io/x/V6rWCQ) in Xperience by Kentico after the - migration. -* Custom settings under modules, which are currently not supported in Xperience by Kentico -* Module permissions (permissions work differently in Xperience by Kentico, - see [Role management](https://docs.xperience.io/x/7IVwCg) - and [UI page permission checks](https://docs.xperience.io/x/8IKyCg)) - -As with all object types, the Kentico Migration Tool does not transfer code files to the target project. You need to -manually move all code files generated for your custom classes (*Info*, *InfoProvider*, etc.). - -To learn more about custom modules and classes in Xperience by Kentico, see -the [Object types](https://docs.xperience.io/x/AKDWCQ) documentation. - -#### Custom tables - -The migration includes the following: - -* Basic information about custom tables (from the `CMS_Class` table) is migrated to the custom module - table (`CMS_Resource`) as a special `customtables` resource. -* Content of individual custom tables is migrated as module classes. - -Custom table migration does NOT include: - -* Any other data related to custom tables (queries, alternative forms) are discarded by the migration. -* UI elements related to custom tables such as listings and filters are not migrated and need to be implemented. The - administration of Xperience by Kentico uses a different technology stack than Kentico Xperience 13 and is - incompatible. To learn how to build the administration UI, - see [Extend the administration interface](https://docs.xperience.io/x/GwKQC) - and [Example - Offices management application](https://docs.xperience.io/x/hIFwCg). - -#### Media libraries - -Media library files are migrated as content item assets to the [content hub](https://docs.kentico.com/x/barWCQ) into a content folder `/`. All assets are created in the default language of the respective site. Migrated assets are created as content items of a *Legacy media file* content type (code name `Legacy.Mediafile`) created by the tool. - -If required, you can [configure the tool](#convert-attachments-and-media-library-files-to-media-libraries-instead-of-content-item-assets) to instead migrate media libraries as media libraries on the target instance. - -#### Attachments - -Attachment files are migrated as content item assets to the [content hub](https://docs.kentico.com/x/barWCQ) into a content folder `/__Attachments`. Assets are created in the specified language if the language is available (e.g., attachments of pages). Migrated assets are created as content items of a *Legacy attachment* content type (code name `Legacy.Attachment`) created by the tool. - -If required, you can [configure the tool](#convert-attachments-and-media-library-files-to-media-libraries-instead-of-content-item-assets) to instead migrate attachments as media libraries on the target instance. - -#### Forms - -The migration does not include the content of form autoresponder and notification emails. - -You can migrate form autoresponders to Xperience by Kentico manually by copying your HTML code and content into Email -templates and Emails. See [Emails](https://docs.xperience.io/x/IaDWCQ). - -#### Users - -**Note**: Xperience by Kentico uses separate entities for users with access to the administration interface (*CMS_User* -table) and live site visitor accounts (*CMS_Member* table). Consequently, only users whose *Privilege level* is set to -*Editor* and above are migrated (*Users* -> edit a user -> *General* tab) via the `--users` command. To migrate live -site accounts as well, use [`--members`](#migrate-command-parameters). - -The command migrates all users with access to the administration interface. Note the following expected behavior: - -* The 'administrator' user account is only transferred from the source if it does not exist on the target instance. -* The 'public' system user is updated, and all bindings (e.g., the site binding) are mapped automatically on the target - instance. -* Site bindings are updated automatically for all migrated users. -* Users in Xperience by Kentico must have an email address. Migration is only supported for users with a **unique** - email address on the source instance. - * If you encounter issues related to email validation, you can change the default validation behavior via - the `CMSEmailValidationRegex` [application key](https://docs.xperience.io/x/yA6RBg). -* Custom user fields can be migrated together with *module classes*. - -Additionally, the command migrates all roles and user-role bindings for users whose *Privilege level* is *Editor* or -higher. - -Because Xperience by Kentico uses a different [permission model](https://docs.xperience.io/x/7IVwCg), no existing role -permissions or UI personalization settings are migrated. After the migration, the permissions for each role must be -configured again. - -#### Members - -In Xperience by Kentico, live site users are represented using a separate **Member** entity and stored in the -*CMS_Member* table. - -The migration identifies live site users as those without access to the administration interface. That is, only those -accounts whose *Privilege level* is set to *None* (Users -> edit a user -> General tab) are migrated. - -The migration includes: - -* All system fields from the *CMS_User* and *CMS_UserSettings* tables. You can customize which fields are migrated via - the `MemberIncludeUserSystemFields` configuration option. See [configuration](#configuration). -* All custom fields added to the *CMS_User* and *CMS_UserSettings* tables are migrated under `CMS_Member`. - > If you are migrating custom fields, the `--custom-modules` migration command must be run before the `--members` - command. For example: - - ```powershell - Migration.Toolkit.CLI.exe migrate --sites --custom-modules --users --members - ``` - -The migration ***DOES NOT*** include: - -* External login information associated with each account (e.g., Google or Facebook logins). -* User password hashes from the `CMS_User.UserPassword` column. - - After the migration, the corresponding `CMS_Member.MemberPassword` in the target Xperience by Kentico instance - is `NULL`. This means that the migrated accounts **CANNOT** be used to sign in to the system under any circumstances. - The account owners must first reset their password via ASP.NET Identity. - - See [Forms authentication](https://docs.xperience.io/x/t4ouCw) for a sample password reset process that can be adapted - for this scenario. The general flow consists of these steps: - - 1. Select the migrated member accounts. - - ```csharp - // Selects members whose password is null and who don't use external providers to sign in - var migratedMembers = - MemberInfo.Provider - .Get() - .WhereNull("MemberPassword") - .WhereEquals("MemberIsExternal", 0); - ``` - - 2. Generate password reset tokens for each account using `UserManager.GeneratePasswordResetTokenAsync(member)`. - 3. Send the password reset email to each account using `IEmailService`. - - ```csharp - await emailService - .SendEmail(new EmailMessage() - { - Recipients = member.Email, - Subject = "Password reset request", - // {resetURL} targets a controller action with the password reset form - Body = $"To reset your account's password, click here." - }); - ``` - -#### Contacts - -* Custom contact fields can be migrated together with *module classes*. -* For performance reasons, contacts and related objects are migrated using bulk SQL queries. As a result, you always - need to delete all Contacts, Activities and Consent agreements before running the migration (when using - the `migrate --contact-management` parameter). - -## Configuration - -Before you run the migration, configure options in the `Migration.Toolkit.CLI/appsettings.json` file. - -Add the options under the `Settings` section in the configuration file. - -| Configuration | Description | -|-------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| KxConnectionString | The connection string to the source Kentico Xperience 13 database. | -| KxCmsDirPath | The absolute file system path of the **CMS** folder in the source Kentico Xperience 13 administration project. Required to migrate media library files. | -| XbKDirPath | The absolute file system path of the root of the target Xperience by Kentico project. Required to migrate media library and page attachment files. | -| XbKApiSettings | Configuration options set for the API when creating migrated objects in the target application.

The `ConnectionStrings.CMSConnectionString`option is required - set the connection string to the target Xperience by Kentico database (the same value as `XbKConnectionString`). | -| MigrationProtocolPath | The absolute file system path of the location where the [migration protocol file](./MIGRATION_PROTOCOL_REFERENCE.md) is generated.

For example: `"C:\\Logs\\Migration.Toolkit.Protocol.log"` | -| MigrateOnlyMediaFileInfo | If set to `true`, only the database representations of media files are migrated, without the files in the media folder in the project's file system. For example, enable this option if your media library files are mapped to a shared directory or Cloud storage.

If `false`, media files are migrated based on the `KxCmsDirPath` location. | -| MigrateMediaToMediaLibrary | Determines whether media library files and attachments from the source instance are migrated to the target instance as media libraries or as [content item assets](https://docs.kentico.com/x/barWCQ) in the content hub. The default value is `false` – media files and attachments are migrated as content item assets.

See [Convert attachments and media library files to media libraries instad of content item assets](#convert-attachments-and-media-library-files-to-media-libraries-instead-of-content-item-assets) | -| MemberIncludeUserSystemFields | Determines which system fields from the *CMS_User* and *CMS_UserSettings* tables are migrated to *CMS_Member* in Xperience by Kentico. Fields that do not exist in *CMS_Member* are automatically created.

The sample `appsettings.json` file included with the tool by default includes all user fields that can be migrated from Kentico Xperience 13. Exclude specific fields from the migration by removing them from this configuration option. | -| UseOmActivityNodeRelationAutofix | Determines how the migration handles references from Contact management activities to non-existing pages.

Possible options:
`DiscardData` - faulty references are removed,
`AttemptFix` - references are updated to the IDs of corresponding pages created by the migration,
`Error` - an error is reported and the reference can be translated or otherwise handled manually | -| UseOmActivitySiteRelationAutofix | Determines how the migration handles site references from Contact management activities.

Possible options: `DiscardData`,`AttemptFix`,`Error` | -| EntityConfigurations | Contains options that allow you to fine-tune the migration of specific object types. | -| EntityConfigurations.*<object table name>*.ExcludeCodeNames | Excludes objects with the specified code names from the migration. | -| CreateReusableFieldSchemaForClasses | Specifies which page types are also converted to [reusable field schemas](#convert-page-types-to-reusable-field-schemas). | -| OptInFeatures.QuerySourceInstanceApi.Enabled | If `true`, [source instance API discovery](#source-instance-api-discovery) is enabled to allow advanced migration of Page Builder content for pages and page templates. | -| OptInFeatures.QuerySourceInstanceApi.Connections | To use [source instance API discovery](#source-instance-api-discovery), you need to add a connection JSON object containing the following values:
`SourceInstanceUri` - the base URI where the source instance's live site application is running.
`Secret` - the secret that you set in the *ToolkitApiController.cs* file on the source instance. | -| OptInFeatures.CustomMigration.FieldMigrations | Enables conversion of media selection text fields to content item assets or media library files. See [Convert text fields with media links](#convert-text-fields-with-media-links) for more information. | - -### Example - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "System": "Warning", - "Microsoft": "Warning" - }, - "MinimumLevel": { - "Default": "Information", - "System": "Warning", - "Microsoft": "Warning" - }, - "pathFormat": "logs/log.txt" - }, - "Settings": { - "KxConnectionString": "Data Source=myserver;Initial Catalog=Xperience13;Integrated Security=True;Persist Security Info=False;Connect Timeout=120;Encrypt=False;Current Language=English;", - "KxCmsDirPath": "C:\\inetpub\\wwwroot\\Xperience13\\CMS", - "XbKDirPath": "C:\\inetpub\\wwwroot\\XP_Target", - "XbKApiSettings": { - "ConnectionStrings": { - "CMSConnectionString": "Data Source=myserver;Initial Catalog=XperienceByKentico;Integrated Security=True;Persist Security Info=False;Connect Timeout=120;Encrypt=False;Current Language=English;" - } - }, - "MigrationProtocolPath": "C:\\_Development\\xperience-migration-toolkit-master\\Migration.Toolkit.Protocol.log", - "MemberIncludeUserSystemFields": "FirstName|MiddleName|LastName|FullName|UserPrivilegeLevel|UserIsExternal|LastLogon|UserLastModified|UserGender|UserDateOfBirth", - "MigrateOnlyMediaFileInfo": false, - "MigrateMediaToMediaLibrary": false, - "UseOmActivityNodeRelationAutofix": "AttemptFix", - "UseOmActivitySiteRelationAutofix": "AttemptFix", - "EntityConfigurations": { - "CMS_Site": { - "ExplicitPrimaryKeyMapping": { - "SiteID": { - "1": 1 - } - } - }, - "CMS_Class": { - "ExcludeCodeNames": [ - "CMS.File", - "CMS.MenuItem", - "ACME.News", - "ACME.Office", - "CMS.Blog", - "CMS.BlogPost" - ] - }, - "CMS_SettingsKey": { - "ExcludeCodeNames": [ - "CMSHomePagePath" - ] - } - }, - "OptInFeatures":{ - "QuerySourceInstanceApi": { - "Enabled": true, - "Connections": [ - { "SourceInstanceUri": "http://localhost:60527", "Secret": "__your secret string__" } - ] - }, - "FieldMigrations": { - "SourceDataType": "text", - "TargetDataType": "assets", - "SourceFormControl": "MediaSelectionControl", - "TargetFormComponent": "Kentico.Administration.AssetSelector", - "Actions": [ "convert to asset" ], - "FieldNameRegex": ".*" - } - } - } -} -``` - -## Source instance API discovery - -> :warning: **Warning** – source instance API discovery is only available when migrating from Kentico Xperience 13. - -By default, JSON data storing the Page Builder content of pages and custom page templates is migrated directly without -modifications. Within this content, Page Builder components (widgets, sections, etc.) with properties have their -configuration based on Kentico Xperience 13 form components, which are assigned to the properties on the source -instance. On the target Xperience by Kentico instance, the migrated data can work in the Page Builder's legacy -compatibility mode. - -However, we strongly recommend updating your codebase to the new Xperience by Kentico components. -See [Editing components in Xperience by Kentico](https://docs.xperience.io/x/wIfWCQ) to learn more. - -To convert Page Builder data to a format suitable for the Xperience by Kentico components, the Kentico Migration Tool -provides an advanced migration mode that utilizes API discovery on the source instance. The advanced mode currently -provides the following data conversion: - -* **Attachment selector** properties - converted to a format suitable for the Xperience by Kentico **Media selector** - component, with `IEnumerable` values. -* **Page selector** properties - converted to a format suitable for the Xperience by Kentico Page selector component, - with `IEnumerable` values. - -### Prerequisites and Limitations - -* To use source instance API discovery, the live site application of your source instance must be running and available - during the migration. -* Using the advanced Page Builder data migration **prevents the data from being used in the Page Builder's legacy - compatibility mode**. With this approach, you need to update all Page Builder component code files to - the [Xperience by Kentico format](https://docs.xperience.io/x/wIfWCQ). -* The source instance API discovery feature only processes component properties defined using `[EditingComponent]` - attribute notation. Other implementations, such as properties edited via custom view components in the Razer view, are - not supported. - -```csharp -public class MyWidgetProperties : IWidgetProperties -{ - // Supported - [EditingComponent(PageSelector.IDENTIFIER, Label = "Selected products", Order = 1)] - public IEnumerable SelectedProducts { get; set; } = new List(); - - // NOT supported - public IEnumerable Images { get; set; } = new List(); -} -``` - -### API discovery setup - -1. Copy the `ToolkitApiController.cs` file to the `Controllers` folder in the **live site project** of your Kentico - Xperience 13 source instance. Get the file from the following location in the Kentico Migration Tool repository: - - * For .NET Core projects: `KX13.Extensions\ToolkitApiController.cs` - * For MVC 5 (.NET Framework 4.8) projects: `KX13.NET48.Extensions\ToolkitApiController.NET48.cs` - -2. Register routes for the `ToolkitApi` controller's actions into the source instance's live site application. - - * For .NET Core projects, add endpoints in the project's `Startup.cs` or `Program.cs` file: - - ```csharp - app.UseEndpoints(endpoints => - { - endpoints.MapControllerRoute( - name: "ToolkitExtendedFeatures", - pattern: "{controller}/{action}", - constraints: new - { - controller = "ToolkitApi" - } - ); - - // other routes ... - }); - ``` - - * For MVC 5 projects, map the routes in your application's `RouteCollection` (e.g., in - the `/App_Start/RouteConfig.cs` file): - - ```csharp - public static void RegisterRoutes(RouteCollection routes) - { - // Maps routes for Xperience handlers and enabled features - routes.Kentico().MapRoutes() - - routes.MapRoute( - name: "ToolkitExtendedFeatures", - url: "{controller}/{action}", - defaults: new { }, - constraints: new - { - controller = "ToolkitApi" - } - ); - - // other routes ... - } - ``` - -3. Edit `ToolkitApiController.cs` and set a value for the `Secret` constant: - - ```csharp - private const string Secret = "__your secret string__"; - ``` - -4. Configure the `Settings.OptInFeatures.QuerySourceInstanceApi` [configuration options](#configuration) for the - Migration Tool: - - ```json - "OptInFeatures":{ - "QuerySourceInstanceApi": { - "Enabled": true, - "Connections": [ - { "SourceInstanceUri": "http://localhost:60527", "Secret": "__your secret string__" } - ] - } - }, - ``` - -You can test the source instance API discovery by making a POST request -to `/ToolkitApi/Test` with `{ "secret":"__your secret string__" }` in the body. If your -setup is correct, the response should be: `{ "pong": true }` - -When you now [migrate data](#migrate-data), the tool performs API discovery of Page Builder component code on the source -instance and advanced migration of Page Builder data. - -## Convert page types to reusable field schemas - -It is not possible to migrate any page types that inherit fields from other page types. However, to make the manual -migration of such page types easier, you can create [reusable field schemas](https://docs.kentico.com/x/D4_OD) from -specified parent page types. Specify a list of page types to be converted to reusable field schemas (separated with -either `;` or `,`) in the `Settings.CreateReusableFieldSchemaForClasses` [configuration option](#configuration). - -The following example specifies two page types from which reusable schemas are created: - -```json -"Settings":{ - ... - - "CreateReusableFieldSchemaForClasses": "Acme.SeoFields;Acme.ArticleFields" -}, -``` - -> :warning: **Notes** -> -> * Conversion of page types to reusable field schemas works best when all field names of page types are unique (i.e., - prefixed with the page type name). If multiple page types converted to reusable field schemas have fields with the - same code name, the code name is prefixed with the content type name in the converted reusable field schemas. -> * Page types specified by this configuration option are also migrated as content types into to the target instance. - -## Convert text fields with media links - -By default, page type and module class fields with the _Text_ data type and the _Media -selection_ [form control](https://docs.xperience.io/x/0A_RBg) from the source instance are converted to plain _Text_ -fields in the target instance. You can instead configure the Kentico Migration Tool to convert these fields to the -_Content items_ data type and use the _Content item selector_ form component, or _Media files_ data type and use the _Media file selector_ form component if you choose to [convert attachments and media library files to media libraries instead of content item assets](#convert-attachments-and-media-library-files-to-media-libraries-instead-of-content-item-assets). - -> :warning: **Notes** -> -> * Only media libraries using the **Permanent** [file URL format](https://docs.xperience.io/x/xQ_RBg) are supported. - Content from media libraries with enabled **Use direct path for files in content** setting will not be converted. -> * If you enable this feature, you also need to change retrieval and handling of affected files in your code, as the - structure of the stored data changes from a text path ( - e.g.,`~/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100`) to a _Media files_ data - type (internally stored as - e.g., `[{"Identifier":"CCEAD0F0-E2BF-459B-814A-36699E5C773E","Some file":"somefile.jpeg","Size":11803,"Dimensions":{"Width":300,"Height":100}}]`). - The value of the field now needs to be [retrieved as a media library file](https://docs.xperience.io/x/LA2RBg). -> * If the target instance is a [SaaS project](https://docs.kentico.com/x/saas_xp), you need to manually move content - item asset files. See [Content items](#content-items) for more information. - -### Convert to content item assets - -To enable this feature, configure the `OptInFeatures.CustomMigration.FieldMigrations` [options](#configuration) for this -tool. Use the values in the code snippet below: - -```json -"OptInFeatures": { - "CustomMigration": { - "FieldMigrations": [ - { - "SourceDataType": "text", - "TargetDataType": "contentitemreference", - "SourceFormControl": "MediaSelectionControl", - "TargetFormComponent": "Kentico.Administration.ContentItemSelector", - "Actions": [ - "convert to asset" - ], - "FieldNameRegex": ".*" - } - ] - } -} -``` - -`FieldNameRegex` - a regular expression used to filter what fields are converted. Only fields with field names that -match the regular expressions are converted. Use `.*` to match all fields. - -### Convert to media libraries - -* Attachment links (containing a `getattachment` handler) are migrated as [attachments](#attachments) and changed to the - _Media files_ data type. -* Media file links (containing a `getmedia` handler) are changed to the _Media files_ data type. It is expected that the - media library containing the targeted file has been migrated. - -To enable this feature, configure the `OptInFeatures.CustomMigration.FieldMigrations` [options](#configuration) for this -tool. Use the values in the code snippet below: - -```json -"OptInFeatures":{ - "CustomMigration":{ - "FieldMigrations": [ - { - "SourceDataType": "text", - "TargetDataType": "assets", - "SourceFormControl": "MediaSelectionControl", - "TargetFormComponent": "Kentico.Administration.AssetSelector", - "Actions": [ "convert to asset" ], - "FieldNameRegex": ".*" - } - ] - } -} -``` - -`FieldNameRegex` - a regular expression used to filter what fields are converted. Only fields with field names that -match the regular expressions are converted. Use `.*` to match all fields. - -## Convert attachments and media library files to media libraries instead of content item assets - -By default, media libraries and attachments are migrated as content item assets in the target instance, which is the recommended approach to ensure future-proofing of project and improve the [content model](https://docs.kentico.com/x/f4HWCQ). You can modify this behavior by configuring the value of the `MigrateMediaToMediaLibrary` setting to `true` and convert media library files and attachments to media libraries if you want to continue using media libraries. When set to `false`, media libraries and attachments are migrated as content item assets in the target instance. - -### Media libraries - -* In Xperience by Kentico, Media libraries are global instead of site-specific. -* The code name of each media library on the target instance is `{SiteName}_{LibraryCodeName}`. -* Media library permissions are currently not supported in Xperience by Kentico and are not migrated. - -### Attachments - -* Page attachments are migrated into a media library named: *"Attachments for site \"* -* The media library contains folders matching the content tree structure for all pages with attachments (including empty folders for parent pages without attachments). The folders are named after the *node alias* of the source pages. -* Each page's folder directly contains all unsorted attachments (files added on the *Attachments* tab in the source's *Pages* application). -* Attachments stored in specific page fields are placed into subfolders, named in format: *"__fieldname"*. These subfolders can include multiple files for fields of the *Attachments* type, or a single file for *File* type fields. -* Any "floating" attachments without an associated page are migrated into the media library root folder. -* The migration does not include temporary attachments (created when a file upload is not finished correctly). If any are present on the source instance, a warning is logged in the [migration protocol](./MIGRATION_PROTOCOL_REFERENCE.md). - -The following is an example of a media library created by the Kentico Migration Tool for page attachments: - -* **Articles** (empty parent folder) - * **Coffee-processing-techniques** (contains any unsorted attachments of the '/Articles/Coffee-processing-techniques' page) - * **__Teaser** (contains attachments stored in the page's 'Teaser' field) - * **Which-brewing-fits-you** - * **__Teaser** - * ... - -Additionally, any attachments placed into the content of migrated pages **will no longer work** in Xperience by Kentico. -This includes images and file download links that use **/getattachment** and **/getimage** URLs. - -If you wish to continue using these legacy attachment URLs from earlier Kentico versions, you need to add a custom -handler to your Xperience by Kentico project. -See [`Migration.Toolkit.KXP.Extensions/README.MD`](/Migration.Toolkit.KXP.Extensions/README.MD) for instructions. diff --git a/Migration.Toolkit.Common/Abstractions/IModuleLoader.cs b/Migration.Toolkit.Common/Abstractions/IModuleLoader.cs deleted file mode 100644 index 18870f9b..00000000 --- a/Migration.Toolkit.Common/Abstractions/IModuleLoader.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Migration.Toolkit.Common.Abstractions; - -public interface IModuleLoader -{ - Task LoadAsync(); -} diff --git a/Migration.Toolkit.Common/CommonDiExtensions.cs b/Migration.Toolkit.Common/CommonDiExtensions.cs deleted file mode 100644 index 1ad522a3..00000000 --- a/Migration.Toolkit.Common/CommonDiExtensions.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; - -using Migration.Toolkit.Common.MigrationProtocol; - -namespace Migration.Toolkit.Common; - -public static class CommonDiExtensions -{ - public static IServiceCollection UseToolkitCommon(this IServiceCollection services) - { - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - return services; - } -} diff --git a/Migration.Toolkit.Common/Enumerations/Kx13FormControls.cs b/Migration.Toolkit.Common/Enumerations/Kx13FormControls.cs deleted file mode 100644 index 434f8551..00000000 --- a/Migration.Toolkit.Common/Enumerations/Kx13FormControls.cs +++ /dev/null @@ -1,267 +0,0 @@ -// ReSharper disable InconsistentNaming - -namespace Migration.Toolkit.Common.Enumerations; -#pragma warning disable IDE1006 -public class Kx13FormControls -{ - public class UserControlForText - { - public const string AbTestConversionTypeSelector = "ABTestConversionTypeSelector"; - public const string ActivityTypeSelector = "ActivityTypeSelector"; - public const string AllowedExtensionsSelector = "AllowedExtensionsSelector"; - public const string Selectalternativeform = "selectalternativeform"; - public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; - public const string AssemblyClassSelector = "AssemblyClassSelector"; - public const string Fieldselector = "fieldselector"; - public const string BizFormSelector = "BizFormSelector"; - public const string BundleInventoryTypeSelector = "BundleInventoryTypeSelector"; - public const string CampaignSelector = "CampaignSelector"; - public const string CategorySelector = "CategorySelector"; - public const string ClassFieldSelector = "ClassFieldSelector"; - public const string ClassFields = "Class_fields"; - public const string CodeName = "CodeName"; - public const string CodeNameWithPrefix = "CodeNameWithPrefix"; - public const string Selectcolor = "selectcolor"; - public const string Columns = "Columns"; - public const string ConnectionStringSelector = "Connection_string_selector"; - public const string ContactClassFields = "Contact_class_fields"; - public const string CountrySelector = "countrySelector"; - public const string CssStylesEditor = "CSS_Styles_Editor"; - public const string Selectculture = "selectculture"; - public const string CultureSelectorForSettings = "CultureSelectorForSettings"; - public const string CurrencySelector = "currencySelector"; - public const string CustomTableItemSelector = "CustomTableItemSelector"; - public const string CustomTableSelector = "CustomTableSelector"; - public const string Selectcolumns = "selectcolumns"; - public const string DepartmentSelector = "DepartmentSelector"; - public const string DropDownListControl = "DropDownListControl"; - public const string DueDateSelector = "Due_date_selector"; - public const string Emailinput = "emailinput"; - public const string EmailTemplateSelector = "Email_template_selector"; - public const string EmailTemplateTypeSelector = "Email_template_type_selector"; - public const string EncodingTextBox = "EncodingTextBox"; - public const string EncryptedPassword = "EncryptedPassword"; - public const string EnumSelector = "EnumSelector"; - public const string EventLogTypeSelector = "EventLogTypeSelector"; - public const string FacebookAutoPost = "Facebook_auto_post"; - public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; - public const string FileSystemSelector = "FileSystemSelector"; - public const string FontIconSelector = "FontIconSelector"; - public const string FormFieldSelector = "FormFieldSelector"; - public const string FormPassword = "FormPassword"; - public const string FullMediaLibrarySelector = "FullMediaLibrarySelector"; - public const string GetGoogleTranslatorApiKey = "Get_Google_Translator_API_key"; - public const string GetMsTranslatorTextApiKey = "GetMSTranslatorTextAPIKey"; - public const string GoToExternalUrl = "Go_to_external_URL"; - public const string GoogleAnalyticsParameterSelector = "Google_Analytics_parameter_selector"; - public const string Html5Input = "HTML5Input"; - public const string IconSelector = "IconSelector"; - public const string InternalStatusSelector = "InternalStatusSelector"; - public const string Internationalphone = "internationalphone"; - public const string LabelControl = "LabelControl"; - public const string LargeTextArea = "LargeTextArea"; - public const string LicenseSelector = "LicenseSelector"; - public const string LinkedInAutoPost = "LinkedInAutoPost"; - public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; - public const string ListBoxControl = "ListBoxControl"; - public const string LocalizableTextArea = "LocalizableTextArea"; - public const string LocalizableTextBox = "LocalizableTextBox"; - public const string MacroAnyAllBoolSelector = "Macro_any-all_bool_selector"; - public const string MacroAnyAllSelector = "MacroAnyAllSelector"; - public const string MacroDateOperator = "Macro_date_operator"; - public const string MacroEditor = "MacroEditor"; - public const string MacroEqualityOperator = "MacroEqualityOperator"; - public const string MacroNegationOperator = "MacroNegationOperator"; - public const string MacroNumericOperator = "Macro_numeric_operator"; - public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; - public const string MacroTextOperator = "Macro_text_operator"; - public const string MacroType = "MacroType"; - public const string ManufacturerSelector = "ManufacturerSelector"; - public const string MediaLibrarySelector = "MediaLibrarySelector"; - public const string MediaSelectionControl = "MediaSelectionControl"; - public const string MembershipSelector = "MembershipSelector"; - public const string MetafileUploaderControl = "MetafileUploaderControl"; - public const string ModuleSelector = "ModuleSelector"; - public const string MultipleCategoriesSelector = "MultipleCategoriesSelector"; - public const string MultipleChoiceControl = "MultipleChoiceControl"; - public const string RoleCheckboxSelector = "RoleCheckboxSelector"; - public const string SimpleCheckboxRoleSelector = "SimpleCheckboxRoleSelector"; - public const string SimpleCheckboxSiteSelector = "SimpleCheckboxSiteSelector"; - public const string MultipleUserSelector = "MultipleUserSelector"; - public const string NewsletterSelector = "NewsletterSelector"; - public const string NewsletterSelectorSimple = "NewsletterSelectorSimple"; - public const string NumericUpDown = "NumericUpDown"; - public const string ObjectColumnSelector = "ObjectColumnSelector"; - public const string ObjectSelector = "ObjectSelector"; - public const string ObjectTransformation = "ObjectTransformation"; - public const string ObjectTypeBinSelector = "ObjectTypeBinSelector"; - public const string ObjectTypeSelector = "ObjectTypeSelector"; - public const string OptionCategoryProductOptionSelector = "OptionCategoryProductOptionSelector"; - public const string OptionCategorySelectionTypeSelector = "OptionCategorySelectionTypeSelector"; - public const string OrderBy = "OrderBy"; - public const string OrderStatusSelector = "OrderStatusSelector"; - public const string DocumentCultureFilter = "DocumentCultureFilter"; - public const string PageLayoutCode = "Page_layout_code"; - public const string Selectdocument = "selectdocument"; - public const string PageTemplateLevels = "PageTemplateLevels"; - public const string Selectpagetemplate = "selectpagetemplate"; - public const string DocumentTypeIconSelector = "DocumentTypeIconSelector"; - public const string Selectclassnames = "selectclassnames"; - public const string Password = "Password"; - public const string PasswordStrength = "PasswordStrength"; - public const string PasswordConfirmator = "PasswordConfirmator"; - public const string Selectpath = "selectpath"; - public const string PaymentSelector = "paymentSelector"; - public const string ProductImageSelector = "ProductImageSelector"; - public const string ProductRelationshipNameSelector = "ProductRelationshipNameSelector"; - public const string ProductSectionsSelector = "ProductSectionsSelector"; - public const string ProductTypeSelector = "ProductTypeSelector"; - public const string PublicStatusSelector = "PublicStatusSelector"; - public const string Selectquery = "selectquery"; - public const string RadioButtonsControl = "RadioButtonsControl"; - public const string AgeRangeSelector = "AgeRangeSelector"; - public const string RelatedDocuments = "RelatedDocuments"; - public const string Relationshipconfiguration = "relationshipconfiguration"; - public const string SelectRelationshipName = "SelectRelationshipName"; - public const string ReportSelectorDropDown = "ReportSelectorDropDown"; - public const string RoleSelector = "RoleSelector"; - public const string SearchClassNameSelector = "SearchClassNameSelector"; - public const string SearchIndexSelector = "SearchIndexSelector"; - public const string SearchIndexTypeSelector = "SearchIndexTypeSelector"; - public const string SelectCmsVersion = "SelectCMSVersion"; - public const string SettingsKeyControlSelector = "SettingsKeyControlSelector"; - public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; - public const string SharePointListSelector = "SharePointListSelector"; - public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; - public const string ShippingSelector = "shippingSelector"; - public const string ShippingServiceSelector = "ShippingServiceSelector"; - public const string Selectsinglepath = "selectsinglepath"; - public const string SinglePathSelectorWithPermissions = "SinglePathSelectorWithPermissions"; - public const string SiteContentCulture = "SiteContentCulture"; - public const string SiteCultureSelector = "SiteCultureSelector"; - public const string SiteCultureSelectorAll = "SiteCultureSelectorAll"; - public const string Selectsite = "selectsite"; - public const string SiteSelectorWithAllFieldForGlobalAdmin = "SiteSelectorWithAllFieldForGlobalAdmin"; - public const string SkuSelector = "SKUSelector"; - public const string StopWordsSelector = "StopWordsSelector"; - public const string SupplierSelector = "SupplierSelector"; - public const string SupportedCultureSelector = "SupportedCultureSelector"; - public const string TableConversionSettings = "TableConversionSettings"; - public const string TagGroupSelector = "TagGroupSelector"; - public const string TagSelector = "TagSelector"; - public const string TaxAddressTypeSelector = "TaxAddressTypeSelector"; - public const string TextAreaControl = "TextAreaControl"; - public const string TextBoxControl = "TextBoxControl"; - public const string TextFilter = "TextFilter"; - public const string TextboxDefaultValueFromSetting = "Textbox_default_value_from_setting"; - public const string TextboxDoubleValidator = "Textbox_double_validator"; - public const string TimeZoneSelector = "TimeZoneSelector"; - public const string TimeZoneTypeSelector = "TimeZoneTypeSelector"; - public const string ToggleButton = "ToggleButton"; - public const string Selecttransformation = "selecttransformation"; - public const string TranslationServiceSelector = "Translation_service_selector"; - public const string TwitterAutoPost = "Twitter_auto_post"; - public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; - public const string Usphone = "usphone"; - public const string Uszipcode = "uszipcode"; - public const string UiCultureSelector = "UICultureSelector"; - public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; - public const string UniSelector = "Uni_selector"; - public const string UrlChecker = "UrlChecker"; - public const string UrlSelector = "URLSelector"; - public const string SmurlShortenerSelector = "SMURLShortenerSelector"; - public const string UserName = "UserName"; - public const string UserNameSelector = "UserNameSelector"; - public const string UserSelector = "UserSelector"; - public const string ValiditySelector = "ValiditySelector"; - public const string ViewSecureText = "ViewSecureText"; - public const string WhereCondition = "WhereCondition"; - public const string WorkflowScopeDefinition = "WorkflowScopeDefinition"; - } - - public class UserControlForLongText - { - public const string AbTestConversionSelector = "ABTestConversionSelector"; - public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; - public const string BbEditorControl = "BBEditorControl"; - public const string CacheDependencies = "CacheDependencies"; - public const string ClassFields = "Class_fields"; - public const string Columns = "Columns"; - public const string ConditionBuilder = "ConditionBuilder"; - public const string ContactClassFields = "Contact_class_fields"; - public const string CssStylesEditor = "CSS_Styles_Editor"; - public const string Selectcolumns = "selectcolumns"; - public const string DropDownListControl = "DropDownListControl"; - public const string FacebookAutoPost = "Facebook_auto_post"; - public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; - public const string FileSystemSelector = "FileSystemSelector"; - public const string Html5Input = "HTML5Input"; - public const string AutoResizeConfiguration = "AutoResizeConfiguration"; - public const string LabelControl = "LabelControl"; - public const string LargeTextArea = "LargeTextArea"; - public const string LinkedInAutoPost = "LinkedInAutoPost"; - public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; - public const string LocalizableTextArea = "LocalizableTextArea"; - public const string LocalizableTextBox = "LocalizableTextBox"; - public const string MacroEditor = "MacroEditor"; - public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; - public const string MultipleObjectBindingControl = "MultipleObjectBindingControl"; - public const string ObjectTypeSelector = "ObjectTypeSelector"; - public const string OptionsSelector = "OptionsSelector"; - public const string OrderBy = "OrderBy"; - public const string PageLayoutCode = "Page_layout_code"; - public const string ProductSectionsSelector = "ProductSectionsSelector"; - public const string RelatedDocuments = "RelatedDocuments"; - public const string ReportGraphSelector = "ReportGraphSelector"; - public const string ReportTableSelector = "ReportTableSelector"; - public const string ReportValueSelector = "ReportValueSelector"; - public const string HtmlAreaControl = "HtmlAreaControl"; - public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; - public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; - public const string TagSelector = "TagSelector"; - public const string TextAreaControl = "TextAreaControl"; - public const string TextBoxControl = "TextBoxControl"; - public const string TextFilter = "TextFilter"; - public const string TranslationServiceSelector = "Translation_service_selector"; - public const string TwitterAutoPost = "Twitter_auto_post"; - public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; - public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; - public const string UniSelector = "Uni_selector"; - public const string SmurlShortenerSelector = "SMURLShortenerSelector"; - public const string ViewSecureText = "ViewSecureText"; - public const string WhereCondition = "WhereCondition"; - } -} - -public class Kx13FormComponents -{ - public const string Kentico_BoolFieldValueTypeSelector = "Kentico.BoolFieldValueTypeSelector"; - public const string Kentico_CheckBox = "Kentico.CheckBox"; - public const string Kentico_CompareToFieldSelector = "Kentico.CompareToFieldSelector"; - public const string Kentico_ConsentAgreement = "Kentico.ConsentAgreement"; - public const string Kentico_ConsentSelector = "Kentico.ConsentSelector"; - public const string Kentico_DropDown = "Kentico.DropDown"; - public const string Kentico_EmailInput = "Kentico.EmailInput"; - public const string Kentico_FileUploader = "Kentico.FileUploader"; - public const string Kentico_HiddenGuidInput = "Kentico.HiddenGuidInput"; - public const string Kentico_IntInput = "Kentico.IntInput"; - public const string Kentico_MultipleChoice = "Kentico.MultipleChoice"; - public const string Kentico_Name = "Kentico.Name"; - public const string Kentico_NumericFieldComparisonTypeSelector = "Kentico.NumericFieldComparisonTypeSelector"; - public const string Kentico_RadioButtons = "Kentico.RadioButtons"; - public const string Kentico_Recaptcha = "Kentico.Recaptcha"; - public const string Kentico_StringFieldComparisonTypeSelector = "Kentico.StringFieldComparisonTypeSelector"; - public const string Kentico_TextArea = "Kentico.TextArea"; - public const string Kentico_TextInput = "Kentico.TextInput"; - public const string Kentico_USPhone = "Kentico.USPhone"; - public const string Kentico_Invalid = "Kentico.Invalid"; - public const string Kentico_RichText = "Kentico.RichText"; - public const string Kentico_AttachmentSelector = "Kentico.AttachmentSelector"; - public const string Kentico_MediaFilesSelector = "Kentico.MediaFilesSelector"; - public const string Kentico_GeneralSelector = "Kentico.GeneralSelector"; - public const string Kentico_ObjectSelector = "Kentico.ObjectSelector"; - public const string Kentico_PageSelector = "Kentico.PageSelector"; - public const string Kentico_PathSelector = "Kentico.PathSelector"; - public const string Kentico_UrlSelector = "Kentico.UrlSelector"; -} -#pragma warning enable IDE1006 diff --git a/Migration.Toolkit.Common/Extensions.cs b/Migration.Toolkit.Common/Extensions.cs deleted file mode 100644 index 5051847f..00000000 --- a/Migration.Toolkit.Common/Extensions.cs +++ /dev/null @@ -1,210 +0,0 @@ -using System.Data; -using System.Data.Common; -using System.Linq.Expressions; -using System.Xml.Linq; - -using CMS.Base; -using CMS.Helpers; - -using Newtonsoft.Json; - -namespace Migration.Toolkit.Common; - -public static class Extensions -{ - public static T Unbox(this IDataReader reader, string propertyName) - { - if (reader.GetOrdinal(propertyName) < 0) - { - throw new InvalidOperationException($"Property '{propertyName}' not exists"); - } - - return reader[propertyName] switch - { - T r => r, - DBNull => default!, - _ => throw new InvalidCastException($"Unboxing property '{propertyName}' of type '{reader[propertyName].GetType().FullName}' to type '{typeof(T).FullName}' failed") - }; - } - - public static bool IsIn(this T value, params T[] values) => values.Contains(value); - - public static string GetMemberName(this Expression> expr) - { - var stack = new Stack(); - - var me = expr.Body.NodeType switch - { - ExpressionType.Convert => (expr.Body is UnaryExpression ue ? ue.Operand : null) as MemberExpression, - ExpressionType.ConvertChecked => (expr.Body is UnaryExpression ue ? ue.Operand : null) as MemberExpression, - ExpressionType.Add => throw new NotImplementedException(), - ExpressionType.AddChecked => throw new NotImplementedException(), - ExpressionType.And => throw new NotImplementedException(), - ExpressionType.AndAlso => throw new NotImplementedException(), - ExpressionType.ArrayLength => throw new NotImplementedException(), - ExpressionType.ArrayIndex => throw new NotImplementedException(), - ExpressionType.Call => throw new NotImplementedException(), - ExpressionType.Coalesce => throw new NotImplementedException(), - ExpressionType.Conditional => throw new NotImplementedException(), - ExpressionType.Constant => throw new NotImplementedException(), - ExpressionType.Divide => throw new NotImplementedException(), - ExpressionType.Equal => throw new NotImplementedException(), - ExpressionType.ExclusiveOr => throw new NotImplementedException(), - ExpressionType.GreaterThan => throw new NotImplementedException(), - ExpressionType.GreaterThanOrEqual => throw new NotImplementedException(), - ExpressionType.Invoke => throw new NotImplementedException(), - ExpressionType.Lambda => throw new NotImplementedException(), - ExpressionType.LeftShift => throw new NotImplementedException(), - ExpressionType.LessThan => throw new NotImplementedException(), - ExpressionType.LessThanOrEqual => throw new NotImplementedException(), - ExpressionType.ListInit => throw new NotImplementedException(), - ExpressionType.MemberAccess => throw new NotImplementedException(), - ExpressionType.MemberInit => throw new NotImplementedException(), - ExpressionType.Modulo => throw new NotImplementedException(), - ExpressionType.Multiply => throw new NotImplementedException(), - ExpressionType.MultiplyChecked => throw new NotImplementedException(), - ExpressionType.Negate => throw new NotImplementedException(), - ExpressionType.UnaryPlus => throw new NotImplementedException(), - ExpressionType.NegateChecked => throw new NotImplementedException(), - ExpressionType.New => throw new NotImplementedException(), - ExpressionType.NewArrayInit => throw new NotImplementedException(), - ExpressionType.NewArrayBounds => throw new NotImplementedException(), - ExpressionType.Not => throw new NotImplementedException(), - ExpressionType.NotEqual => throw new NotImplementedException(), - ExpressionType.Or => throw new NotImplementedException(), - ExpressionType.OrElse => throw new NotImplementedException(), - ExpressionType.Parameter => throw new NotImplementedException(), - ExpressionType.Power => throw new NotImplementedException(), - ExpressionType.Quote => throw new NotImplementedException(), - ExpressionType.RightShift => throw new NotImplementedException(), - ExpressionType.Subtract => throw new NotImplementedException(), - ExpressionType.SubtractChecked => throw new NotImplementedException(), - ExpressionType.TypeAs => throw new NotImplementedException(), - ExpressionType.TypeIs => throw new NotImplementedException(), - ExpressionType.Assign => throw new NotImplementedException(), - ExpressionType.Block => throw new NotImplementedException(), - ExpressionType.DebugInfo => throw new NotImplementedException(), - ExpressionType.Decrement => throw new NotImplementedException(), - ExpressionType.Dynamic => throw new NotImplementedException(), - ExpressionType.Default => throw new NotImplementedException(), - ExpressionType.Extension => throw new NotImplementedException(), - ExpressionType.Goto => throw new NotImplementedException(), - ExpressionType.Increment => throw new NotImplementedException(), - ExpressionType.Index => throw new NotImplementedException(), - ExpressionType.Label => throw new NotImplementedException(), - ExpressionType.RuntimeVariables => throw new NotImplementedException(), - ExpressionType.Loop => throw new NotImplementedException(), - ExpressionType.Switch => throw new NotImplementedException(), - ExpressionType.Throw => throw new NotImplementedException(), - ExpressionType.Try => throw new NotImplementedException(), - ExpressionType.Unbox => throw new NotImplementedException(), - ExpressionType.AddAssign => throw new NotImplementedException(), - ExpressionType.AndAssign => throw new NotImplementedException(), - ExpressionType.DivideAssign => throw new NotImplementedException(), - ExpressionType.ExclusiveOrAssign => throw new NotImplementedException(), - ExpressionType.LeftShiftAssign => throw new NotImplementedException(), - ExpressionType.ModuloAssign => throw new NotImplementedException(), - ExpressionType.MultiplyAssign => throw new NotImplementedException(), - ExpressionType.OrAssign => throw new NotImplementedException(), - ExpressionType.PowerAssign => throw new NotImplementedException(), - ExpressionType.RightShiftAssign => throw new NotImplementedException(), - ExpressionType.SubtractAssign => throw new NotImplementedException(), - ExpressionType.AddAssignChecked => throw new NotImplementedException(), - ExpressionType.MultiplyAssignChecked => throw new NotImplementedException(), - ExpressionType.SubtractAssignChecked => throw new NotImplementedException(), - ExpressionType.PreIncrementAssign => throw new NotImplementedException(), - ExpressionType.PreDecrementAssign => throw new NotImplementedException(), - ExpressionType.PostIncrementAssign => throw new NotImplementedException(), - ExpressionType.PostDecrementAssign => throw new NotImplementedException(), - ExpressionType.TypeEqual => throw new NotImplementedException(), - ExpressionType.OnesComplement => throw new NotImplementedException(), - ExpressionType.IsTrue => throw new NotImplementedException(), - ExpressionType.IsFalse => throw new NotImplementedException(), - _ => expr.Body as MemberExpression - }; - - while (me != null) - { - stack.Push(me.Member.Name); - me = me.Expression as MemberExpression; - } - - return string.Join(".", stack.ToArray()); - } - - public static bool UseKenticoDefault(this bool? value) => value ?? false; - public static int UseKenticoDefault(this int? value) => value ?? 0; - - public static TEnum AsEnum(this int? value) where TEnum : Enum - => (TEnum)Enum.ToObject(typeof(TEnum), value ?? 0); - - public static TEnum AsEnum(this string? value) where TEnum : struct, Enum - => Enum.TryParse(value, out var val) ? val : default; - - public static int? NullIfZero(this int? value) => value == 0 ? null : value; - public static int? NullIfZero(this int value) => value == 0 ? null : value; - - public static string? NullIf(this string? s, string value) => s == value ? null : s; - - public static void SetValueAsJson(this ISimpleDataContainer container, string column, TValue value) => container.SetValue(column, !value?.Equals(default) ?? false ? JsonConvert.SerializeObject(value) : null); - - public static void SetValueAsJson(this ISimpleDataContainer container, string column, IEnumerable values) => container.SetValue(column, values.Any() ? JsonConvert.SerializeObject(values) : null); - - public static void SetValueAsJson(this Dictionary container, string column, TValue value) => container[column] = value?.Equals(default) ?? true ? null : JsonConvert.SerializeObject(value); - - public static void SetValueAsJson(this Dictionary container, string column, IEnumerable values) => container[column] = values.Any() ? JsonConvert.SerializeObject(values) : null; - - #region System.Xml.Linq extensions - - /// - /// - /// - /// - /// - /// Returns ensured XElement - public static XElement EnsureElement(this XElement element, XName name, Action? elementUpdate = null) - { - if (element.Element(name) is { } result) - { - elementUpdate?.Invoke(result); - return result; - } - - var newElement = new XElement(name); - elementUpdate?.Invoke(newElement); - element.Add(newElement); - return newElement; - } - - #endregion - - public static T Unbox(this DbDataReader reader, string propertyName) - { - if (reader.GetOrdinal(propertyName) < 0) - { - throw new InvalidOperationException($"Property '{propertyName}' not exists"); - } - - return reader[propertyName] switch - { - T r => r, - DBNull => default, - _ => throw new InvalidCastException($"Unboxing property '{propertyName}' of type '{reader[propertyName].GetType().FullName}' to type '{typeof(T).FullName}' failed") - }; - } - - public static T Value(this XElement element) => element?.Value == default - ? default - : ValidationHelper.GetValue(element.Value); - - - public static bool? ValueAsBool(this XElement element) - { - if (element != null && bool.TryParse(element.Value, out bool value)) - { - return value; - } - - return default; - } -} diff --git a/Migration.Toolkit.Common/MigrationProtocol/IProtocol.cs b/Migration.Toolkit.Common/MigrationProtocol/IProtocol.cs deleted file mode 100644 index 97181710..00000000 --- a/Migration.Toolkit.Common/MigrationProtocol/IProtocol.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Migration.Toolkit.Common.MigrationProtocol; - -public interface IProtocol : IMigrationProtocol -{ -} diff --git a/Migration.Toolkit.Common/Services/ICommandParser.cs b/Migration.Toolkit.Common/Services/ICommandParser.cs deleted file mode 100644 index d6b421dd..00000000 --- a/Migration.Toolkit.Common/Services/ICommandParser.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Migration.Toolkit.Common.Abstractions; - -namespace Migration.Toolkit.Common.Services; - -public interface ICommandParser -{ - List Parse(Queue args, ref bool bypassDependencyCheck, bool firstHaveToBeMigrate = true); -} diff --git a/Migration.Toolkit.Common/ToolkitConfiguration.cs b/Migration.Toolkit.Common/ToolkitConfiguration.cs deleted file mode 100644 index 3f9a0923..00000000 --- a/Migration.Toolkit.Common/ToolkitConfiguration.cs +++ /dev/null @@ -1,109 +0,0 @@ -using Microsoft.Extensions.Configuration; - -namespace Migration.Toolkit.Common; - -/// -/// Autofix enum -/// -/// do not update value names, they are used in json configuration -public enum AutofixEnum -{ - DiscardData, - AttemptFix, - Error -} - -public class ToolkitConfiguration -{ - #region Path to CMS dir of source instance - - [ConfigurationKeyName(ConfigurationNames.KxCmsDirPath)] - public string? KxCmsDirPath { get; set; } - - #endregion - - [ConfigurationKeyName(ConfigurationNames.EntityConfigurations)] - public EntityConfigurations EntityConfigurations { get; set; } = []; - - [ConfigurationKeyName(ConfigurationNames.MigrateOnlyMediaFileInfo)] - public bool? MigrateOnlyMediaFileInfo { get; set; } = false; - - [ConfigurationKeyName(ConfigurationNames.UseOmActivityNodeRelationAutofix)] - public AutofixEnum? UseOmActivityNodeRelationAutofix { get; set; } = AutofixEnum.Error; - - [ConfigurationKeyName(ConfigurationNames.UseOmActivitySiteRelationAutofix)] - public AutofixEnum? UseOmActivitySiteRelationAutofix { get; set; } = AutofixEnum.Error; - - [ConfigurationKeyName(ConfigurationNames.MigrationProtocolPath)] - public string? MigrationProtocolPath { get; set; } - - [ConfigurationKeyName(ConfigurationNames.MemberIncludeUserSystemFields)] - public string? MemberIncludeUserSystemFields { get; set; } - - [ConfigurationKeyName(ConfigurationNames.MigrateMediaToMediaLibrary)] - public bool MigrateMediaToMediaLibrary { get; set; } - - [ConfigurationKeyName(ConfigurationNames.UseDeprecatedFolderPageType)] - public bool? UseDeprecatedFolderPageType { get; set; } - - [ConfigurationKeyName(ConfigurationNames.CreateReusableFieldSchemaForClasses)] - public string? CreateReusableFieldSchemaForClasses { get; set; } - - - public IReadOnlySet ClassNamesCreateReusableSchema => classNamesCreateReusableSchema ??= new HashSet( - (CreateReusableFieldSchemaForClasses?.Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries) ?? []).Select(x => x.Trim()), - StringComparer.InvariantCultureIgnoreCase - ); - - #region Opt-in features - - [ConfigurationKeyName(ConfigurationNames.OptInFeatures)] - public OptInFeatures? OptInFeatures { get; set; } - - #endregion - - #region Connection string of source instance - - private string? kxConnectionString; - - [ConfigurationKeyName(ConfigurationNames.KxConnectionString)] - public string KxConnectionString - { - get => kxConnectionString!; - set => kxConnectionString = value; - } - - #endregion - - #region Connection string of target instance - - [ConfigurationKeyName(ConfigurationNames.XbKConnectionString)] - public string XbKConnectionString - { - get => xbKConnectionString!; - set => xbKConnectionString = value; - } - - public void SetXbKConnectionStringIfNotEmpty(string? connectionString) - { - if (!string.IsNullOrWhiteSpace(connectionString)) - { - xbKConnectionString = connectionString; - } - } - - #endregion - - #region Path to root directory of target instance - - private HashSet? classNamesCreateReusableSchema; - private string? xbKConnectionString; - - [ConfigurationKeyName(ConfigurationNames.XbKDirPath)] - public string? XbKDirPath { get; set; } = null; - - #endregion - - [ConfigurationKeyName(ConfigurationNames.UrlProtocol)] - public string? UrlProtocol { get; set; } -} diff --git a/Migration.Toolkit.Core.K11/Behaviors/CommandConstraintBehavior.cs b/Migration.Toolkit.Core.K11/Behaviors/CommandConstraintBehavior.cs deleted file mode 100644 index 6b035ae6..00000000 --- a/Migration.Toolkit.Core.K11/Behaviors/CommandConstraintBehavior.cs +++ /dev/null @@ -1,109 +0,0 @@ -using MediatR; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Behaviors; - -public class CommandConstraintBehavior( - ILogger> logger, - IMigrationProtocol protocol, - IDbContextFactory k11ContextFactory -) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) - { - try - { - var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - - bool criticalCheckPassed = PerformChecks(request, k11Context); - if (!criticalCheckPassed) - { - return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); - } - } - catch (Exception ex) - { - protocol.CommandError(ex, request); - logger.LogCritical(ex, "Error occured while checking command constraints"); - return (TResponse)(CommandResult)new CommandCheckFailedResult(false); - } - - return await next(); - } - - private bool PerformChecks(TRequest request, K11Context k11Context) - { - bool criticalCheckPassed = true; - var sourceSites = k11Context.CmsSites - .Include(s => s.Cultures) - .ToList(); - - foreach (var site in sourceSites) - { - criticalCheckPassed &= CheckSite(sourceSites, site.SiteId); - } - - if (request is ICultureReliantCommand cultureReliantCommand) - { - criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites); - } - - return criticalCheckPassed; - } - - private bool CheckSite(List sourceSites, int sourceSiteId) - { - bool criticalCheckPassed = true; - if (sourceSites.All(s => s.SiteId != sourceSiteId)) - { - var supportedSites = sourceSites.Select(x => new { x.SiteName, x.SiteId }).ToArray(); - string supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); - logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, - supportedSitesStr); - protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") - .WithMessage("Check program argument '--siteId'") - .WithData(new { sourceSiteId, AvailableSites = supportedSites })); - criticalCheckPassed = false; - } - - return criticalCheckPassed; - } - - private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites) - { - bool criticalCheckPassed = true; - string cultureCode = cultureReliantCommand.CultureCode; - var siteCultureLookup = sourceSites - .ToDictionary(x => x.SiteId, x => x.Cultures.Select(s => s.CultureCode.ToLowerInvariant())); - - foreach (var site in sourceSites) - { - if (siteCultureLookup.TryGetValue(site.SiteId, out var value)) - { - string[] siteCultures = value.ToArray(); - if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) - { - string supportedCultures = string.Join(", ", siteCultures); - logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, - site.SiteId, supportedCultures); - protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") - .WithMessage("Check program argument '--culture'") - .WithData(new { cultureCode, site.SiteId, SiteCultures = supportedCultures })); - criticalCheckPassed = false; - } - } - } - - return criticalCheckPassed; - } -} diff --git a/Migration.Toolkit.Core.K11/Behaviors/RequestHandlingBehavior.cs b/Migration.Toolkit.Core.K11/Behaviors/RequestHandlingBehavior.cs deleted file mode 100644 index 59ee489c..00000000 --- a/Migration.Toolkit.Core.K11/Behaviors/RequestHandlingBehavior.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Diagnostics; - -using MediatR; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; - -namespace Migration.Toolkit.Core.K11.Behaviors; - -public class RequestHandlingBehavior(ILogger> logger, IMigrationProtocol protocol) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) - { - var sw = Stopwatch.StartNew(); - logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); - try - { - protocol.CommandRequest(request); - var response = await next(); - protocol.CommandFinished(request, response); - return response; - } - catch (Exception ex) - { - protocol.CommandError(ex, request); - logger.LogError(ex, "Error occured"); - throw; - } - finally - { - logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); - } - } -} diff --git a/Migration.Toolkit.Core.K11/Behaviors/XbKApiContextBehavior.cs b/Migration.Toolkit.Core.K11/Behaviors/XbKApiContextBehavior.cs deleted file mode 100644 index a9c17fc3..00000000 --- a/Migration.Toolkit.Core.K11/Behaviors/XbKApiContextBehavior.cs +++ /dev/null @@ -1,45 +0,0 @@ -using CMS.Base; -using CMS.Membership; - -using MediatR; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; - -namespace Migration.Toolkit.Core.K11.Behaviors; - -public class XbKApiContextBehavior( - ILogger> logger, - IMigrationProtocol protocol, - KxpApiInitializer initializer) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) - { - initializer.EnsureApiIsInitialized(); - - var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); - if (defaultAdmin == null) - { - protocol.Append(HandbookReferences - .MissingRequiredDependency() - .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") - ); - throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); - } - - using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) - { - // TODO tk: 2022-11-25 revise in future - // MembershipContext.AuthenticatedUser = defaultAdmin; - - logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); - return await next(); - } - } -} diff --git a/Migration.Toolkit.Core.K11/Contexts/KeyMappingContext.cs b/Migration.Toolkit.Core.K11/Contexts/KeyMappingContext.cs deleted file mode 100644 index ec7d1bde..00000000 --- a/Migration.Toolkit.Core.K11/Contexts/KeyMappingContext.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Linq.Expressions; - -using Migration.Toolkit.Core.K11.Services; - -namespace Migration.Toolkit.Core.K11.Contexts; - -public record MapSourceKeyResult(bool Success, TMapped? Mapped); - -public class KeyMappingContext(PrimaryKeyMappingContext primaryKeyMappingContext, KeyLocatorService keyLocatorService) -{ - public MapSourceKeyResult MapSourceKey(Expression> sourceKeySelector, - Expression> sourceGuidSelector, - object? sourceKey, - Expression> targetKeySelector, - Expression> targetGuidSelector) where TSource : class where TTarget : class - { - if (sourceKey is int id && primaryKeyMappingContext.MapSourceId(sourceKeySelector, id) is { Success: true, MappedId: TTargetKey targetKey }) - { - return new MapSourceKeyResult(true, targetKey); - } - - if (keyLocatorService.TryLocate(sourceKeySelector, targetKeySelector, sourceGuidSelector, targetGuidSelector, sourceKey, out var located)) - { - return new MapSourceKeyResult(true, located); - } - - return new MapSourceKeyResult(false, default); - } - - public MapSourceKeyResult GetGuid(Expression> keySelector, Expression> guidSelector, object? key) where T : class => - keyLocatorService.TryGetSourceGuid(keySelector, guidSelector, key, out var located) - ? new MapSourceKeyResult(true, located) - : new MapSourceKeyResult(false, null); -} diff --git a/Migration.Toolkit.Core.K11/Contexts/PrimaryKeyMappingContext.cs b/Migration.Toolkit.Core.K11/Contexts/PrimaryKeyMappingContext.cs deleted file mode 100644 index 978ffd5e..00000000 --- a/Migration.Toolkit.Core.K11/Contexts/PrimaryKeyMappingContext.cs +++ /dev/null @@ -1,287 +0,0 @@ -using System.Diagnostics; -using System.Linq.Expressions; -using System.Reflection; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Core.K11.Services; - -namespace Migration.Toolkit.Core.K11.Contexts; - -public class PrimaryKeyMappingContext( - ILogger logger, - IPrimaryKeyLocatorService primaryKeyLocatorService, - ToolkitConfiguration toolkitConfiguration) - : IPrimaryKeyMappingContext -{ - private readonly Dictionary mappingCache = new(StringComparer.OrdinalIgnoreCase); - - public void SetMapping(Type type, string keyName, int sourceId, int targetId) - { - Debug.Assert(sourceId > 0, "sourceId > 0"); - Debug.Assert(targetId > 0, "targetId > 0"); - - var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) - .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); - - Debug.Assert(foundProp != null, "foundProp != null"); - - string fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; - - mappingCache[fullKeyName] = targetId; - logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); - } - - public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) - { - string fullKeyName = CreateKey(keyNameSelector, sourceId); - mappingCache[fullKeyName] = targetId; - logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); - } - - public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) - { - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sourceId); - if (sourceId == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (mappingCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out int targetId)) - { - SetMapping(keyNameSelector, sourceId, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, "Target entity is missing"); - } - - public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) - { - targetIdResult = -1; - if (sourceId is not int sid) - { - return false; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - targetIdResult = explicitlyMappedId; - return true; - } - - if (mappingCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - targetIdResult = resultId; - return true; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - targetIdResult = targetId; - return true; - } - - return false; - } - - public int? MapFromSource(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (mappingCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, "Target entity is missing"); - } - - public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (mappingCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - return null; - } - - public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return new MapSourceIdResult(true, null); - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return new MapSourceIdResult(true, null); - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return new MapSourceIdResult(true, explicitlyMappedId); - } - - if (mappingCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return new MapSourceIdResult(true, resultId); - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return new MapSourceIdResult(true, targetId); - } - - return new MapSourceIdResult(false, null); - } - - public void PreloadDependencies(Expression> keyNameSelector) - { - foreach ((int sourceId, int targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) - { - SetMapping(keyNameSelector, sourceId, targetId); - } - } - - public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return true; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - return true; - } - - if (GetExplicitMappingOrNull(memberName, sid) is not null) - { - return true; - } - - if (mappingCache.TryGetValue(fullKeyName, out _)) - { - return true; - } - - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) - { - return true; - } - - return false; - } - - private int? GetExplicitMappingOrNull(string memberName, int? sourceId) - { - if (sourceId == null) - { - return null; - } - - var mappings = toolkitConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; - if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) - { - return memberMappings.TryGetValue($"{sourceId}", out int? mappedId) ? mappedId : null; - } - - return null; - } - - private static string CreateKey(Expression> keyNameSelector, int sourceId) => $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; -} diff --git a/Migration.Toolkit.Core.K11/Exceptions.cs b/Migration.Toolkit.Core.K11/Exceptions.cs deleted file mode 100644 index a111bc02..00000000 --- a/Migration.Toolkit.Core.K11/Exceptions.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Migration.Toolkit.Core.K11; - -public class MappingFailureException(string keyName, string reason) : InvalidOperationException($"Key '{keyName}' mapping failed: {reason}") -{ - public string KeyName { get; } = keyName; - public string Reason { get; } = reason; -} diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs deleted file mode 100644 index 57444e3b..00000000 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs +++ /dev/null @@ -1,388 +0,0 @@ -using CMS.Activities; -using CMS.ContactManagement; -using CMS.ContentEngine; - -using MediatR; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.Core.K11.Helpers; -using Migration.Toolkit.Core.K11.Services; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.K11.Handlers; - -public class MigrateContactManagementCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - BulkDataCopyService bulkDataCopyService, - ToolkitConfiguration toolkitConfiguration, - PrimaryKeyMappingContext primaryKeyMappingContext, - KeyMappingContext keyMappingContext, - CountryMigrator countryMigrator, - KxpClassFacade kxpClassFacade, - ISpoiledGuidContext spoiledGuidContext, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private readonly KxpContext kxpContext = kxpContextFactory.CreateDbContext(); - - public void Dispose() => kxpContext.Dispose(); - - public Task Handle(MigrateContactManagementCommand request, CancellationToken cancellationToken) - { - countryMigrator.MigrateCountriesAndStates(); - - if (MigrateContacts() is { } ccr) - { - return Task.FromResult(ccr); - } - - if (MigrateContactActivities() is { } acr) - { - return Task.FromResult(acr); - } - - return Task.FromResult(new GenericCommandResult()); - } - - #region "Migrate contacts" - - private CommandResult? MigrateContacts() - { - var requiredColumnsForContactMigration = new Dictionary - { - { nameof(Toolkit.K11.Models.OmContact.ContactId), nameof(KXP.Models.OmContact.ContactId) }, - { nameof(Toolkit.K11.Models.OmContact.ContactFirstName), nameof(KXP.Models.OmContact.ContactFirstName) }, - { nameof(Toolkit.K11.Models.OmContact.ContactMiddleName), nameof(KXP.Models.OmContact.ContactMiddleName) }, - { nameof(Toolkit.K11.Models.OmContact.ContactLastName), nameof(KXP.Models.OmContact.ContactLastName) }, - { nameof(Toolkit.K11.Models.OmContact.ContactJobTitle), nameof(KXP.Models.OmContact.ContactJobTitle) }, - { nameof(Toolkit.K11.Models.OmContact.ContactAddress1), nameof(KXP.Models.OmContact.ContactAddress1) }, - { nameof(Toolkit.K11.Models.OmContact.ContactCity), nameof(KXP.Models.OmContact.ContactCity) }, - { nameof(Toolkit.K11.Models.OmContact.ContactZip), nameof(KXP.Models.OmContact.ContactZip) }, - { nameof(Toolkit.K11.Models.OmContact.ContactStateId), nameof(KXP.Models.OmContact.ContactStateId) }, - { nameof(Toolkit.K11.Models.OmContact.ContactCountryId), nameof(KXP.Models.OmContact.ContactCountryId) }, - { nameof(Toolkit.K11.Models.OmContact.ContactMobilePhone), nameof(KXP.Models.OmContact.ContactMobilePhone) }, - { nameof(Toolkit.K11.Models.OmContact.ContactBusinessPhone), nameof(KXP.Models.OmContact.ContactBusinessPhone) }, - { nameof(Toolkit.K11.Models.OmContact.ContactEmail), nameof(KXP.Models.OmContact.ContactEmail) }, - // No support 2022-07-07 { nameof(OmContact.ContactBirthday), nameof(KXO.Models.OmContact.ContactBirthday) }, - { nameof(Toolkit.K11.Models.OmContact.ContactGender), nameof(KXP.Models.OmContact.ContactGender) }, - // { nameof(OmContact.ContactStatusId), nameof(KXO.Models.OmContact.ContactStatusId) }, // No support 2022-07-07 but needs to be mapped because of constraint - { nameof(Toolkit.K11.Models.OmContact.ContactNotes), nameof(KXP.Models.OmContact.ContactNotes) }, - { nameof(Toolkit.K11.Models.OmContact.ContactOwnerUserId), nameof(KXP.Models.OmContact.ContactOwnerUserId) }, - // No support 2022-07-07 { nameof(OmContact.ContactMonitored), nameof(KXO.Models.OmContact.ContactMonitored) }, - { nameof(Toolkit.K11.Models.OmContact.ContactGuid), nameof(KXP.Models.OmContact.ContactGuid) }, - { nameof(Toolkit.K11.Models.OmContact.ContactLastModified), nameof(KXP.Models.OmContact.ContactLastModified) }, - { nameof(Toolkit.K11.Models.OmContact.ContactCreated), nameof(KXP.Models.OmContact.ContactCreated) }, - // No support 2022-07-07 { nameof(OmContact.ContactBounces), nameof(KXO.Models.OmContact.ContactBounces) }, - { nameof(Toolkit.K11.Models.OmContact.ContactCampaign), nameof(KXP.Models.OmContact.ContactCampaign) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadId), nameof(KXO.Models.OmContact.ContactSalesForceLeadId) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDisabled), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDisabled) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDateTime) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationSuspensionDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationSuspensionDateTime) }, - { nameof(Toolkit.K11.Models.OmContact.ContactCompanyName), nameof(KXP.Models.OmContact.ContactCompanyName) } - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationRequired), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationRequired) }, - }; - - foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ContactInfo.TYPEINFO.ObjectClassName)) - { - requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); - } - - if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Contact")) - { - protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Contact")); - logger.LogError("Data must not exist in target instance table, remove data before proceeding"); - return new CommandFailureResult(); - } - - if (bulkDataCopyService.CheckForTableColumnsDifferences("OM_Contact", requiredColumnsForContactMigration, out var differences)) - { - protocol.Append(HandbookReferences - .BulkCopyColumnMismatch("OM_Contact") - .NeedsManualAction() - .WithData(differences) - ); - logger.LogError("Table {TableName} columns do not match, fix columns before proceeding", "OM_Contact"); - { - return new CommandFailureResult(); - } - } - - primaryKeyMappingContext.PreloadDependencies(u => u.UserId); - primaryKeyMappingContext.PreloadDependencies(u => u.StateId); - primaryKeyMappingContext.PreloadDependencies(u => u.CountryId); - - var bulkCopyRequest = new BulkCopyRequest("OM_Contact", - s => true, // s => s != "ContactID", - _ => true, - 50000, - requiredColumnsForContactMigration.Keys.ToList(), - ContactValueInterceptor, - current => logger.LogError("Contact skipped due error, contact: {Contact}", PrintHelper.PrintDictionary(current)), - "ContactID" - ); - - logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - try - { - bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to migrate contacts"); - return new CommandFailureResult(); - } - - return null; - } - - private ValueInterceptorResult ContactValueInterceptor(int ordinal, string columnName, object value, Dictionary currentRow) - { - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactCompanyName), StringComparison.InvariantCultureIgnoreCase)) - { - // autofix removed in favor of error report and data consistency - // var truncatedValue = SqlDataTypeHelper.TruncateString(value, 100); - // return new ValueInterceptorResult(truncatedValue, true, false); - - if (value is string { Length: > 100 } s) - { - protocol.Append(HandbookReferences.ValueTruncationSkip("OM_Contact") - .WithData(new - { - value, - maxLength = 100, - s.Length, - columnName, - contact = PrintHelper.PrintDictionary(currentRow) - }) - ); - return ValueInterceptorResult.SkipRow; - } - } - - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactOwnerUserId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceUserId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.UserId, sourceUserId)) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - // try search member - if (keyMappingContext.MapSourceKey( - s => s.UserId, - s => s.UserGuid, - sourceUserId, - t => t.MemberId, - t => t.MemberGuid - ) is { Success: true, Mapped: { } memberId }) - { - return ValueInterceptorResult.ReplaceValue(memberId); - } - - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - - default: - break; - } - } - - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactStateId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceStateId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.StateId, sourceStateId.NullIfZero())) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - - default: - break; - } - } - - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactCountryId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceCountryId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.CountryId, sourceCountryId.NullIfZero())) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - - default: - break; - } - } - - - return ValueInterceptorResult.DoNothing; - } - - #endregion - - #region "Migrate contact activities" - - private CommandResult? MigrateContactActivities() - { - var requiredColumnsForContactMigration = new Dictionary - { - { nameof(Toolkit.K11.Models.OmActivity.ActivityId), nameof(KXP.Models.OmActivity.ActivityId) }, - { nameof(Toolkit.K11.Models.OmActivity.ActivityContactId), nameof(KXP.Models.OmActivity.ActivityContactId) }, - { nameof(Toolkit.K11.Models.OmActivity.ActivityCreated), nameof(KXP.Models.OmActivity.ActivityCreated) }, - { nameof(Toolkit.K11.Models.OmActivity.ActivityType), nameof(KXP.Models.OmActivity.ActivityType) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityItemId), nameof(KXO.Models.OmActivity.ActivityItemId) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityItemDetailId), nameof(KXO.Models.OmActivity.ActivityItemDetailId) }, - { nameof(Toolkit.K11.Models.OmActivity.ActivityValue), nameof(KXP.Models.OmActivity.ActivityValue) }, - { nameof(Toolkit.K11.Models.OmActivity.ActivityUrl), nameof(KXP.Models.OmActivity.ActivityUrl) }, - { nameof(Toolkit.K11.Models.OmActivity.ActivityTitle), nameof(KXP.Models.OmActivity.ActivityTitle) }, - { nameof(Toolkit.K11.Models.OmActivity.ActivitySiteId), nameof(KXP.Models.OmActivity.ActivityChannelId) }, - { nameof(Toolkit.K11.Models.OmActivity.ActivityComment), nameof(KXP.Models.OmActivity.ActivityComment) }, - // { nameof(OmActivity.ActivityCampaign), nameof(KXP.Models.OmActivity.ActivityCampaign) }, // deprecated without replacement in v27 - { nameof(Toolkit.K11.Models.OmActivity.ActivityUrlreferrer), nameof(KXP.Models.OmActivity.ActivityUrlreferrer) }, - { nameof(Toolkit.K11.Models.OmActivity.ActivityCulture), nameof(KXP.Models.OmActivity.ActivityLanguageId) }, - { nameof(Toolkit.K11.Models.OmActivity.ActivityNodeId), nameof(KXP.Models.OmActivity.ActivityWebPageItemGuid) }, - { nameof(Toolkit.K11.Models.OmActivity.ActivityUtmsource), nameof(KXP.Models.OmActivity.ActivityUtmsource) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityAbvariantName), nameof(KXO.Models.OmActivity.ActivityAbvariantName) }, - // OBSOLETE 26.0.0: { nameof(OmActivity.ActivityUrlhash), nameof(KXP.Models.OmActivity.ActivityUrlhash) }, - { nameof(Toolkit.K11.Models.OmActivity.ActivityUtmcontent), nameof(KXP.Models.OmActivity.ActivityUtmcontent) } - }; - - foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ActivityInfo.TYPEINFO.ObjectClassName)) - { - requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); - } - - if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Activity")) - { - protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Activity")); - logger.LogError("Data must not exist in target instance table, remove data before proceeding"); - return new CommandFailureResult(); - } - - var bulkCopyRequest = new BulkCopyRequestExtended("OM_Activity", - s => true, // s => s != "ActivityID", - reader => true, - 50000, - requiredColumnsForContactMigration, - ActivityValueInterceptor, - current => logger.LogError("Contact activity skipped due error, activity: {Activity}", PrintHelper.PrintDictionary(current)), - "ActivityID" - ); - - logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - - try - { - bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to migrate activities"); - return new CommandFailureResult(); - } - - return null; - } - - private ValueInterceptorResult ActivityValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow) - { - if (columnName.Equals(nameof(Toolkit.K11.Models.OmActivity.ActivitySiteId), StringComparison.InvariantCultureIgnoreCase) && - value is int sourceActivitySiteId) - { - var result = keyMappingContext.MapSourceKey( - s => s.SiteId, - s => s.SiteGuid, - sourceActivitySiteId.NullIfZero(), - t => t.ChannelId, - t => t.ChannelGuid - ); - switch (result) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id ?? 0); - case { Success: false }: - { - switch (toolkitConfiguration.UseOmActivitySiteRelationAutofix ?? AutofixEnum.Error) - { - case AutofixEnum.DiscardData: - logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => discard data", sourceActivitySiteId); - return ValueInterceptorResult.SkipRow; - case AutofixEnum.AttemptFix: - logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => ActivityNodeId=0", sourceActivitySiteId); - return ValueInterceptorResult.ReplaceValue(0); - case AutofixEnum.Error: - default: //error - protocol.Append(HandbookReferences - .MissingRequiredDependency(columnName, value) - .WithData(currentRow) - ); - return ValueInterceptorResult.SkipRow; - } - } - - default: - break; - } - } - - if (columnName.Equals(nameof(Toolkit.K11.Models.OmActivity.ActivityNodeId), StringComparison.InvariantCultureIgnoreCase) && value is int activityNodeId) - { - if (currentRow.TryGetValue(nameof(Toolkit.K11.Models.OmActivity.ActivitySiteId), out object? mSiteId) && mSiteId is int siteId) - { - if (spoiledGuidContext.GetNodeGuid(siteId, activityNodeId) is { } nodeGuid) - { - return ValueInterceptorResult.ReplaceValue(nodeGuid); - } - } - - switch (toolkitConfiguration.UseOmActivityNodeRelationAutofix ?? AutofixEnum.Error) - { - case AutofixEnum.DiscardData: - logger.LogTrace("Autofix (ActivitySiteId={NodeId} not exists) => discard data", activityNodeId); - return ValueInterceptorResult.SkipRow; - case AutofixEnum.AttemptFix: - logger.LogTrace("Autofix (ActivityNodeId={NodeId} not exists) => ActivityNodeId=0", activityNodeId); - return ValueInterceptorResult.ReplaceValue(null); - case AutofixEnum.Error: - default: //error - protocol.Append(HandbookReferences - .MissingRequiredDependency(columnName, value) - .WithData(currentRow) - ); - return ValueInterceptorResult.SkipRow; - } - } - - if (columnName.Equals(nameof(KXP.Models.OmActivity.ActivityLanguageId), StringComparison.InvariantCultureIgnoreCase) && value is string cultureCode) - { - return ValueInterceptorResult.ReplaceValue(ContentLanguageInfoProvider.ProviderObject.Get(cultureCode)?.ContentLanguageID); - } - - return ValueInterceptorResult.DoNothing; - } - - #endregion -} diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs deleted file mode 100644 index b0f2cef1..00000000 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs +++ /dev/null @@ -1,281 +0,0 @@ -using CMS.DataProtection; - -using MediatR; - -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Context; - -namespace Migration.Toolkit.Core.K11.Handlers; - -public class MigrateDataProtectionCommandHandler : IRequestHandler, IDisposable -{ - private static readonly int batchSize = 1000; - private readonly IEntityMapper consentAgreementMapper; - private readonly IEntityMapper consentArchiveMapper; - private readonly IEntityMapper consentMapper; - private readonly IDbContextFactory k11ContextFactory; - private readonly IDbContextFactory kxpContextFactory; - private readonly ILogger logger; - private readonly PrimaryKeyMappingContext primaryKeyMappingContext; - private readonly IProtocol protocol; - - private KxpContext kxpContext; - - public MigrateDataProtectionCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory k11ContextFactory, - IEntityMapper consentMapper, - IEntityMapper consentArchiveMapper, - IEntityMapper consentAgreementMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) - { - this.logger = logger; - this.kxpContextFactory = kxpContextFactory; - this.k11ContextFactory = k11ContextFactory; - this.consentMapper = consentMapper; - this.consentArchiveMapper = consentArchiveMapper; - this.consentAgreementMapper = consentAgreementMapper; - this.primaryKeyMappingContext = primaryKeyMappingContext; - this.protocol = protocol; - kxpContext = this.kxpContextFactory.CreateDbContext(); - } - - public void Dispose() => kxpContext.Dispose(); - - public async Task Handle(MigrateDataProtectionCommand request, CancellationToken cancellationToken) - { - await MigrateConsent(cancellationToken); - await MigrateConsentArchive(cancellationToken); - await MigrateConsentAgreement(cancellationToken, batchSize); - - return new GenericCommandResult(); - } - - private async Task MigrateConsent(CancellationToken cancellationToken) - { - await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - - foreach (var k11Consent in k11Context.CmsConsents) - { - protocol.FetchedSource(k11Consent); - logger.LogTrace("Migrating consent {ConsentName} with ConsentGuid {ConsentGuid}", k11Consent.ConsentName, k11Consent.ConsentGuid); - - var kxoConsent = await kxpContext.CmsConsents.FirstOrDefaultAsync(consent => consent.ConsentGuid == k11Consent.ConsentGuid, cancellationToken); - protocol.FetchedTarget(kxoConsent); - - var mapped = consentMapper.Map(k11Consent, kxoConsent); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - (var cmsConsent, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsent, nameof(cmsConsent)); - - if (newInstance) - { - kxpContext.CmsConsents.Add(cmsConsent); - } - else - { - kxpContext.CmsConsents.Update(cmsConsent); - } - - try - { - await kxpContext.SaveChangesAsync(cancellationToken); - - protocol.Success(k11Consent, cmsConsent, mapped); - logger.LogEntitySetAction(newInstance, cmsConsent); - primaryKeyMappingContext.SetMapping(r => r.ConsentId, k11Consent.ConsentId, cmsConsent.ConsentId); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, k11Consent); - protocol.Append(HandbookReferences - .DbConstraintBroken(sqlException, k11Consent) - .WithMessage("Failed to migrate consent, target database constraint broken.") - ); - - await kxpContext.DisposeAsync(); - kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - } - } - - return new GenericCommandResult(); - } - - private async Task MigrateConsentArchive(CancellationToken cancellationToken) - { - await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - - foreach (var k11ArchiveConsent in k11Context.CmsConsentArchives) - { - protocol.FetchedSource(k11ArchiveConsent); - logger.LogTrace("Migrating consent archive with ConsentArchiveGuid {ConsentGuid}", k11ArchiveConsent.ConsentArchiveGuid); - - var kxoConsentArchive = await kxpContext.CmsConsentArchives.FirstOrDefaultAsync(consentArchive => consentArchive.ConsentArchiveGuid == k11ArchiveConsent.ConsentArchiveGuid, cancellationToken); - protocol.FetchedTarget(kxoConsentArchive); - - var mapped = consentArchiveMapper.Map(k11ArchiveConsent, kxoConsentArchive); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - (var cmsConsentArchive, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsentArchive, nameof(cmsConsentArchive)); - - if (newInstance) - { - kxpContext.CmsConsentArchives.Add(cmsConsentArchive); - } - else - { - kxpContext.CmsConsentArchives.Update(cmsConsentArchive); - } - - try - { - await kxpContext.SaveChangesAsync(cancellationToken); - - protocol.Success(k11ArchiveConsent, cmsConsentArchive, mapped); - logger.LogEntitySetAction(newInstance, cmsConsentArchive); - primaryKeyMappingContext.SetMapping(r => r.ConsentArchiveGuid, - k11ArchiveConsent.ConsentArchiveId, cmsConsentArchive.ConsentArchiveId); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, k11ArchiveConsent); - protocol.Append(HandbookReferences - .DbConstraintBroken(sqlException, k11ArchiveConsent) - .WithMessage("Failed to migrate consent archive, target database constraint broken.") - ); - - await kxpContext.DisposeAsync(); - kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - } - } - - return new GenericCommandResult(); - } - - private async Task MigrateConsentAgreement(CancellationToken cancellationToken, int batchSize) - { - await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - int index = 0; - int indexFull = 0; - var consentAgreementUpdates = new List(); - var consentAgreementNews = new List(); - int itemsCount = k11Context.CmsConsentAgreements.Count(); - - foreach (var k11ConsentAgreement in k11Context.CmsConsentAgreements) - { - protocol.FetchedSource(k11ConsentAgreement); - logger.LogTrace("Migrating consent agreement with ConsentAgreementGuid {ConsentAgreementGuid}", k11ConsentAgreement.ConsentAgreementGuid); - - var kxoConsentAgreement = await kxpContext.CmsConsentAgreements.FirstOrDefaultAsync(consentAgreement => consentAgreement.ConsentAgreementGuid == k11ConsentAgreement.ConsentAgreementGuid, cancellationToken); - protocol.FetchedTarget(kxoConsentAgreement); - - var mapped = consentAgreementMapper.Map(k11ConsentAgreement, kxoConsentAgreement); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - (var cmsConsentAgreement, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsentAgreement, nameof(cmsConsentAgreement)); - - if (newInstance) - { - consentAgreementNews.Add(cmsConsentAgreement); - } - else - { - consentAgreementUpdates.Add(cmsConsentAgreement); - } - } - - index++; - indexFull++; - - if (index == batchSize || indexFull == itemsCount) - { - kxpContext.CmsConsentAgreements.AddRange(consentAgreementNews); - kxpContext.CmsConsentAgreements.UpdateRange(consentAgreementUpdates); - - try - { - await kxpContext.SaveChangesAsync(cancellationToken); - - foreach (var newK11ConsentAgreement in consentAgreementNews) - { - protocol.Success(k11ConsentAgreement, newK11ConsentAgreement, mapped); - logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was inserted", - newK11ConsentAgreement.ConsentAgreementGuid); - } - - foreach (var updateK11ConsentAgreement in consentAgreementUpdates) - { - protocol.Success(k11ConsentAgreement, updateK11ConsentAgreement, mapped); - logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was updated", - updateK11ConsentAgreement.ConsentAgreementGuid); - } - } - catch (DbUpdateException dbUpdateException) when ( - dbUpdateException.InnerException is SqlException sqlException && - sqlException.Message.Contains("Cannot insert duplicate key row in object") - ) - { - await kxpContext.DisposeAsync(); - - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrints(consentAgreementNews) - ); - logger.LogEntitiesSetError(dbUpdateException, true, consentAgreementNews); - - - protocol.Append(HandbookReferences - .ErrorUpdatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrints(consentAgreementUpdates) - ); - - var cai = ConsentAgreementInfo.New(); - protocol.Append(HandbookReferences - .ErrorUpdatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrint(cai) - ); - - logger.LogEntitiesSetError(dbUpdateException, false, consentAgreementUpdates); - - kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - finally - { - index = 0; - consentAgreementUpdates = []; - consentAgreementNews = []; - } - } - } - - return new GenericCommandResult(); - } -} diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateMembersCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateMembersCommandHandler.cs deleted file mode 100644 index 4992bdcf..00000000 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateMembersCommandHandler.cs +++ /dev/null @@ -1,104 +0,0 @@ -using CMS.Membership; - -using MediatR; - -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.Core.K11.Mappers; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api.Enums; - -namespace Migration.Toolkit.Core.K11.Handlers; - -public class MigrateMembersCommandHandler( - ILogger logger, - IDbContextFactory k11ContextFactory, - IEntityMapper memberInfoMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private const string USER_PUBLIC = "public"; - - public void Dispose() - { - } - - public async Task Handle(MigrateMembersCommand request, CancellationToken cancellationToken) - { - await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - - var k11CmsUsers = k11Context.CmsUsers - .Include(u => u.CmsUserSettingUserSettingsUserNavigation) - .Where(u => u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.None) - ; - - foreach (var k11User in k11CmsUsers) - { - protocol.FetchedSource(k11User); - logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid} to member", k11User.UserName, k11User.UserGuid); - - var xbkMemberInfo = MemberInfoProvider.ProviderObject.Get(k11User.UserGuid); - - protocol.FetchedTarget(xbkMemberInfo); - - - if (xbkMemberInfo?.MemberName == USER_PUBLIC || k11User.UserName == USER_PUBLIC) - { - continue; - } - - var mapped = memberInfoMapper.Map(new MemberInfoMapperSource(k11User, k11User.CmsUserSettingUserSettingsUserNavigation), xbkMemberInfo); - protocol.MappedTarget(mapped); - - SaveUserUsingKenticoApi(mapped, k11User); - } - - return new GenericCommandResult(); - } - - private void SaveUserUsingKenticoApi(IModelMappingResult mapped, CmsUser k11User) - { - if (mapped is { Success: true } result) - { - (var memberInfo, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(memberInfo); - - try - { - MemberInfoProvider.ProviderObject.Set(memberInfo); - - protocol.Success(k11User, memberInfo, mapped); - logger.LogEntitySetAction(newInstance, memberInfo); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, memberInfo); - protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k11User) - .WithData(new { k11User.UserName, k11User.UserGuid, k11User.UserId }) - .WithMessage("Failed to migrate user, target database broken.") - ); - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, memberInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(memberInfo) - ); - } - - // left for OM_Activity - primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, memberInfo.MemberID); - } - } -} diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs deleted file mode 100644 index 4186d84f..00000000 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs +++ /dev/null @@ -1,85 +0,0 @@ -using CMS.DataEngine; - -using MediatR; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Handlers; - -public class MigrateSettingKeysCommandHandler( - ILogger logger, - IEntityMapper mapper, - IDbContextFactory k11ContextFactory, - ToolkitConfiguration toolkitConfiguration, - IProtocol protocol) - : IRequestHandler -{ - public async Task Handle(MigrateSettingKeysCommand request, CancellationToken cancellationToken) - { - var entityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); - - await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - - logger.LogInformation("CmsSettingsKey synchronization starting"); - var cmsSettingsKeys = k11Context.CmsSettingsKeys - .Where(csk => csk.SiteId == null) - .AsNoTrackingWithIdentityResolution() - ; - - foreach (var k11CmsSettingsKey in cmsSettingsKeys) - { - protocol.FetchedSource(k11CmsSettingsKey); - - var kxoGlobalSettingsKey = GetKxoSettingsKey(k11CmsSettingsKey); - - bool canBeMigrated = !kxoGlobalSettingsKey?.KeyIsHidden ?? false; - var kxoCmsSettingsKey = k11CmsSettingsKey.SiteId is null ? kxoGlobalSettingsKey : GetKxoSettingsKey(k11CmsSettingsKey); - - if (!canBeMigrated) - { - logger.LogInformation("Setting with key '{KeyName}' is currently not supported for migration", k11CmsSettingsKey.KeyName); - protocol.Append( - HandbookReferences - .NotCurrentlySupportedSkip() - .WithId(nameof(k11CmsSettingsKey.KeyId), k11CmsSettingsKey.KeyId) - .WithMessage("Settings key is not supported in target instance") - .WithData(new { k11CmsSettingsKey.KeyName, k11CmsSettingsKey.SiteId, k11CmsSettingsKey.KeyGuid }) - ); - continue; - } - - protocol.FetchedTarget(kxoCmsSettingsKey); - - if (entityConfiguration.ExcludeCodeNames.Contains(k11CmsSettingsKey.KeyName)) - { - protocol.Warning(HandbookReferences.CmsSettingsKeyExclusionListSkip, k11CmsSettingsKey); - logger.LogWarning("KeyName {KeyName} is excluded => skipping", k11CmsSettingsKey.KeyName); - continue; - } - - var mapped = mapper.Map(k11CmsSettingsKey, kxoCmsSettingsKey); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - ArgumentNullException.ThrowIfNull(result.Item, nameof(result.Item)); - - SettingsKeyInfoProvider.ProviderObject.Set(result.Item); - - protocol.Success(k11CmsSettingsKey, kxoCmsSettingsKey, mapped); - logger.LogEntitySetAction(result.NewInstance, result.Item); - } - } - - return new GenericCommandResult(); - } - - private SettingsKeyInfo? GetKxoSettingsKey(CmsSettingsKey k11CmsSettingsKey) => SettingsKeyInfoProvider.ProviderObject.Get(k11CmsSettingsKey.KeyName); -} diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateSitesCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateSitesCommandHandler.cs deleted file mode 100644 index a21884f7..00000000 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateSitesCommandHandler.cs +++ /dev/null @@ -1,239 +0,0 @@ -using CMS.ContentEngine; -using CMS.Websites; - -using Kentico.Xperience.UMT.Model; -using Kentico.Xperience.UMT.Services; - -using MediatR; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Helpers; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Handlers; - -// ReSharper disable once UnusedType.Global -public class MigrateSitesCommandHandler( - ILogger logger, - IDbContextFactory k11ContextFactory, - IProtocol protocol, - IImporter importer) - : IRequestHandler -{ - public async Task Handle(MigrateSitesCommand request, CancellationToken cancellationToken) - { - await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - var migratedCultureCodes = new Dictionary(StringComparer.CurrentCultureIgnoreCase); - int fallbackDomainPort = 5000; - var migratedDomains = new HashSet(StringComparer.CurrentCultureIgnoreCase); - - foreach (var k11CmsSite in k11Context.CmsSites.Include(s => s.Cultures).Include(cmsSite => cmsSite.CmsSiteDomainAliases)) - { - protocol.FetchedSource(k11CmsSite); - logger.LogTrace("Migrating site {SiteName} with SiteGuid {SiteGuid}", k11CmsSite.SiteName, k11CmsSite.SiteGuid); - - string defaultCultureCode = GetSiteCulture(k11CmsSite); - var migratedSiteCultures = k11CmsSite.Cultures.ToList(); - if (!migratedSiteCultures.Any(x => x.CultureCode.Equals(defaultCultureCode, StringComparison.InvariantCultureIgnoreCase))) - { - await using var ctx = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - if (ctx.CmsCultures.FirstOrDefault(c => c.CultureCode == defaultCultureCode) is { } defaultCulture) - { - migratedSiteCultures.Add(defaultCulture); - } - } - - foreach (var cmsCulture in migratedSiteCultures) - { - var existing = ContentLanguageInfoProvider.ProviderObject.Get() - .WhereEquals(nameof(ContentLanguageInfo.ContentLanguageCultureFormat), cmsCulture.CultureCode) - .FirstOrDefault(); - - if (existing != null && existing.ContentLanguageGUID != cmsCulture.CultureGuid) - { - existing.ContentLanguageGUID = cmsCulture.CultureGuid; - existing.Update(); - } - - if (migratedCultureCodes.ContainsKey(cmsCulture.CultureCode)) - { - continue; - } - - var langResult = await importer.ImportAsync(new ContentLanguageModel - { - ContentLanguageGUID = cmsCulture.CultureGuid, - ContentLanguageDisplayName = cmsCulture.CultureName, - ContentLanguageName = cmsCulture.CultureCode, - ContentLanguageIsDefault = true, - ContentLanguageFallbackContentLanguageGuid = null, - ContentLanguageCultureFormat = cmsCulture.CultureCode - }); - - if (langResult is { Success: true, Imported: ContentLanguageInfo importedLanguage }) - { - migratedCultureCodes.TryAdd(cmsCulture.CultureCode, importedLanguage); - logger.LogTrace("Imported language {Language} from {Culture}", importedLanguage.ContentLanguageName, cmsCulture.CultureCode); - } - } - - // TODO tomas.krch 2024-02-23: treepath migration when upgrade to recent XbyK occurs - string? homePageNodeAliasPath = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, SettingsKeys.CMSDefaultAliasPath); - int? cookieLevel = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, SettingsKeys.CMSDefaultCookieLevel) switch - { - "all" => CookieLevelConstants.ALL, - "visitor" => CookieLevelConstants.VISITOR, - "editor" => CookieLevelConstants.EDITOR, - "system" => CookieLevelConstants.SYSTEM, - "essential" => CookieLevelConstants.ESSENTIAL, - _ => null - }; - bool? storeFormerUrls = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSStoreFormerUrls") is { } storeFormerUrlsStr - ? bool.TryParse(storeFormerUrlsStr, out bool sfu) ? sfu : null - : true; - - var result = UriHelper.GetUniqueDomainCandidate( - k11CmsSite.SiteDomainName, - ref fallbackDomainPort, - candidate => !migratedDomains.Contains(candidate) - ); - - string webSiteChannelDomain; - switch (result) - { - case (true, false, var candidate, null): - { - webSiteChannelDomain = candidate; - break; - } - case (true, true, var candidate, null): - { - webSiteChannelDomain = candidate; - logger.LogWarning("Domain '{Domain}' of site '{SiteName}' is not unique. '{Fallback}' is used instead", k11CmsSite.SiteDomainName, k11CmsSite.SiteName, candidate); - protocol.Warning(HandbookReferences - .InvalidSourceData() - .WithMessage($"Domain '{k11CmsSite.SiteDomainName}' of site '{k11CmsSite.SiteName}' is not unique. '{candidate}' is used instead"), k11CmsSite); - break; - } - case { Success: false, Fallback: { } fallback }: - { - webSiteChannelDomain = fallback; - logger.LogWarning("Unable to use domain '{Domain}' of site '{SiteName}' as channel domain. Fallback '{Fallback}' is used", k11CmsSite.SiteDomainName, k11CmsSite.SiteName, fallback); - protocol.Warning(HandbookReferences - .InvalidSourceData() - .WithMessage($"Non-unique domain name '{k11CmsSite.SiteDomainName}', fallback '{fallback}' used"), k11CmsSite); - break; - } - default: - { - logger.LogError("Unable to use domain '{Domain}' of site '{SiteName}' as channel domain. No fallback available, skipping site", k11CmsSite.SiteDomainName, k11CmsSite.SiteName); - protocol.Warning(HandbookReferences - .InvalidSourceData() - .WithMessage($"Invalid domain name for migration '{k11CmsSite.SiteDomainName}'"), k11CmsSite); - continue; - } - } - - await importer.ImportAsync(new ChannelModel { ChannelDisplayName = k11CmsSite.SiteDisplayName, ChannelName = k11CmsSite.SiteName, ChannelGUID = k11CmsSite.SiteGuid, ChannelType = ChannelType.Website }); - - var webSiteChannelResult = await importer.ImportAsync(new WebsiteChannelModel - { - WebsiteChannelGUID = k11CmsSite.SiteGuid, - WebsiteChannelChannelGuid = k11CmsSite.SiteGuid, - WebsiteChannelDomain = webSiteChannelDomain, - WebsiteChannelHomePage = homePageNodeAliasPath ?? "/", - WebsiteChannelPrimaryContentLanguageGuid = migratedCultureCodes[defaultCultureCode].ContentLanguageGUID, - WebsiteChannelDefaultCookieLevel = cookieLevel, - WebsiteChannelStoreFormerUrls = storeFormerUrls - }); - - if (!webSiteChannelResult.Success) - { - if (webSiteChannelResult.ModelValidationResults != null) - { - foreach (var mvr in webSiteChannelResult.ModelValidationResults) - { - logger.LogError("Invalid channel properties {Members}: {ErrorMessage}", string.Join(", ", mvr.MemberNames), mvr.ErrorMessage); - } - } - else - { - logger.LogError(webSiteChannelResult.Exception, "Failed to migrate site"); - } - - return new CommandFailureResult(); - } - - if (webSiteChannelResult.Imported is WebsiteChannelInfo webSiteChannel) - { - migratedDomains.Add(webSiteChannelDomain); - - string? cmsReCaptchaPublicKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSReCaptchaPublicKey"); - string? cmsReCaptchaPrivateKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSReCaptchaPrivateKey"); - - WebsiteCaptchaSettingsInfo? reCaptchaSettings = null; - string? cmsReCaptchaV3PrivateKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSReCaptchaV3PrivateKey"); - string? cmsRecaptchaV3PublicKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSRecaptchaV3PublicKey"); - double? cmsRecaptchaV3Threshold = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSRecaptchaV3Threshold"); - - if (!string.IsNullOrWhiteSpace(cmsReCaptchaV3PrivateKey) || !string.IsNullOrWhiteSpace(cmsRecaptchaV3PublicKey)) - { - reCaptchaSettings = new WebsiteCaptchaSettingsInfo - { - WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, - WebsiteCaptchaSettingsReCaptchaSiteKey = cmsRecaptchaV3PublicKey, - WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaV3PrivateKey, - WebsiteCaptchaSettingsReCaptchaThreshold = cmsRecaptchaV3Threshold ?? 0.5d, - WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV3 - }; - } - - if (!string.IsNullOrWhiteSpace(cmsReCaptchaPublicKey) || !string.IsNullOrWhiteSpace(cmsReCaptchaPrivateKey)) - { - if (reCaptchaSettings is not null) - { - logger.LogError(""" - Conflicting settings found, ReCaptchaV2 and ReCaptchaV3 is set simultaneously. - Remove setting keys 'CMSReCaptchaPublicKey', 'CMSReCaptchaPrivateKey' - or remove setting keys 'CMSReCaptchaV3PrivateKey', 'CMSRecaptchaV3PublicKey', 'CMSRecaptchaV3Threshold'. - """); - throw new InvalidOperationException("Invalid ReCaptcha settings"); - } - - reCaptchaSettings = new WebsiteCaptchaSettingsInfo - { - WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, - WebsiteCaptchaSettingsReCaptchaSiteKey = cmsReCaptchaPublicKey, - WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaPrivateKey, - WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV2 - }; - } - - if (reCaptchaSettings != null) - { - WebsiteCaptchaSettingsInfo.Provider.Set(reCaptchaSettings); - } - } - } - - return new GenericCommandResult(); - } - - private string GetSiteCulture(CmsSite site) - { - // simplified logic from CMS.DocumentEngine.DefaultPreferredCultureEvaluator.Evaluate() - // domain alias skipped, HttpContext logic skipped - string? siteCulture = site.SiteDefaultVisitorCulture.NullIf(string.Empty) - ?? KenticoHelper.GetSettingsKey(k11ContextFactory, site.SiteId, SettingsKeys.CMSDefaultCultureCode); - - return siteCulture - ?? throw new InvalidOperationException("Unknown site culture"); - } -} diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateUsersCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateUsersCommandHandler.cs deleted file mode 100644 index a3496412..00000000 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateUsersCommandHandler.cs +++ /dev/null @@ -1,272 +0,0 @@ -using CMS.Membership; - -using MediatR; - -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api.Enums; - -namespace Migration.Toolkit.Core.K11.Handlers; - -public class MigrateUsersCommandHandler( - ILogger logger, - IDbContextFactory k11ContextFactory, - IEntityMapper userInfoMapper, - IEntityMapper roleMapper, - IEntityMapper userRoleMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private const string USER_PUBLIC = "public"; - - public void Dispose() - { - } - - public async Task Handle(MigrateUsersCommand request, CancellationToken cancellationToken) - { - await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - - var k11CmsUsers = k11Context.CmsUsers - .Where(u => u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) - ; - - foreach (var k11User in k11CmsUsers) - { - protocol.FetchedSource(k11User); - logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid}", k11User.UserName, k11User.UserGuid); - - var xbkUserInfo = UserInfoProvider.ProviderObject.Get(k11User.UserGuid); - - protocol.FetchedTarget(xbkUserInfo); - - if (k11User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin && xbkUserInfo != null) - { - protocol.Append(HandbookReferences.CmsUserAdminUserSkip.WithIdentityPrint(xbkUserInfo)); - logger.LogInformation("User with guid {UserGuid} is administrator, you need to update administrators manually => skipping", k11User.UserGuid); - primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, xbkUserInfo.UserID); - continue; - } - - if (xbkUserInfo?.UserName == USER_PUBLIC || k11User.UserName == USER_PUBLIC) - { - protocol.Append(HandbookReferences.CmsUserPublicUserSkip.WithIdentityPrint(xbkUserInfo)); - logger.LogInformation("User with guid {UserGuid} is public user, special case that can't be migrated => skipping", xbkUserInfo?.UserGUID ?? k11User.UserGuid); - if (xbkUserInfo != null) - { - primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, xbkUserInfo.UserID); - } - - continue; - } - - var mapped = userInfoMapper.Map(k11User, xbkUserInfo); - protocol.MappedTarget(mapped); - - SaveUserUsingKenticoApi(mapped, k11User); - } - - await MigrateUserCmsRoles(k11Context, cancellationToken); - - return new GenericCommandResult(); - } - - private bool SaveUserUsingKenticoApi(IModelMappingResult mapped, CmsUser k11User) - { - if (mapped is { Success: true } result) - { - (var userInfo, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(userInfo); - - try - { - UserInfoProvider.ProviderObject.Set(userInfo); - - protocol.Success(k11User, userInfo, mapped); - logger.LogEntitySetAction(newInstance, userInfo); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, userInfo); - protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k11User) - .WithData(new { k11User.UserName, k11User.UserGuid, k11User.UserId }) - .WithMessage("Failed to migrate user, target database broken.") - ); - return false; - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, userInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(userInfo) - ); - return false; - } - - primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, userInfo.UserID); - return true; - } - - return false; - } - - private async Task MigrateUserCmsRoles(K11Context k11Context, CancellationToken cancellationToken) - { - var groupedRoles = k11Context.CmsRoles - .Where(r => - r.CmsUserRoles.Any(ur => ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) - ) - .GroupBy(x => x.RoleName) - .AsNoTracking(); - - var skippedRoles = new HashSet(); - foreach (var groupedRole in groupedRoles) - { - if (groupedRole.Count() <= 1) - { - continue; - } - - logger.LogError(""" - Roles with RoleGuid ({RoleGuids}) have same RoleName '{RoleName}', due to removal of sites and role globalization it is required to set unique RoleName - """, string.Join(",", groupedRole.Select(l => l.RoleGuid)), groupedRole.Key); - - foreach (var r in groupedRole) - { - skippedRoles.Add(r.RoleGuid); - protocol.Append(HandbookReferences.NotCurrentlySupportedSkip() - .WithMessage($"Role '{r.RoleName}' with RoleGUID '{r.RoleGuid}' doesn't satisfy unique RoleName condition for migration") - .WithIdentityPrint(r) - .WithData(new { r.RoleGuid, r.RoleName, r.SiteId }) - ); - } - } - - var k11CmsRoles = k11Context.CmsRoles - .Where(r => - r.CmsUserRoles.Any(ur => ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) - ) - .AsNoTracking() - .AsAsyncEnumerable(); - - await foreach (var k11CmsRole in k11CmsRoles.WithCancellation(cancellationToken)) - { - if (skippedRoles.Contains(k11CmsRole.RoleGuid)) - { - continue; - } - - protocol.FetchedSource(k11CmsRole); - - var xbkRoleInfo = RoleInfoProvider.ProviderObject.Get(k11CmsRole.RoleGuid); - protocol.FetchedTarget(xbkRoleInfo); - var mapped = roleMapper.Map(k11CmsRole, xbkRoleInfo); - protocol.MappedTarget(mapped); - - if (mapped is not (var roleInfo, var newInstance) { Success: true }) - { - continue; - } - - ArgumentNullException.ThrowIfNull(roleInfo, nameof(roleInfo)); - try - { - RoleInfoProvider.ProviderObject.Set(roleInfo); - - protocol.Success(k11CmsRole, roleInfo, mapped); - logger.LogEntitySetAction(newInstance, roleInfo); - - primaryKeyMappingContext.SetMapping( - r => r.RoleId, - k11CmsRole.RoleId, - roleInfo.RoleID - ); - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, roleInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(roleInfo) - ); - continue; - } - - await MigrateUserRole(k11CmsRole.RoleId); - } - } - - private async Task MigrateUserRole(int k11RoleId) - { - var k11Context = await k11ContextFactory.CreateDbContextAsync(); - var k11UserRoles = k11Context.CmsUserRoles - .Where(ur => - ur.RoleId == k11RoleId && ( - ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin - ) - ) - .AsNoTracking() - .AsAsyncEnumerable(); - - await foreach (var k11UserRole in k11UserRoles) - { - protocol.FetchedSource(k11UserRole); - if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.RoleId, k11RoleId, out int xbkRoleId)) - { - var handbookRef = HandbookReferences - .MissingRequiredDependency(nameof(UserRoleInfo.RoleID), k11UserRole.RoleId) - .NeedsManualAction(); - - protocol.Append(handbookRef); - logger.LogWarning("Unable to locate role in target instance with source RoleID '{RoleID}'", k11UserRole.RoleId); - continue; - } - - if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.UserId, k11UserRole.UserId, out int xbkUserId)) - { - continue; - } - - var xbkUserRole = UserRoleInfoProvider.ProviderObject.Get(xbkUserId, xbkRoleId); - protocol.FetchedTarget(xbkUserRole); - - var mapped = userRoleMapper.Map(k11UserRole, xbkUserRole); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true }) - { - (var userRoleInfo, bool newInstance) = mapped; - ArgumentNullException.ThrowIfNull(userRoleInfo); - - try - { - UserRoleInfoProvider.ProviderObject.Set(userRoleInfo); - - protocol.Success(k11UserRole, userRoleInfo, mapped); - logger.LogEntitySetAction(newInstance, userRoleInfo); - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, userRoleInfo); - protocol.Append(HandbookReferences.ErrorSavingTargetInstance(ex) - .WithData(new { k11UserRole.UserRoleId, k11UserRole.UserId, k11UserRole.RoleId }) - .WithMessage("Failed to migrate user role") - ); - } - } - } - } -} diff --git a/Migration.Toolkit.Core.K11/Helpers/KenticoHelper.cs b/Migration.Toolkit.Core.K11/Helpers/KenticoHelper.cs deleted file mode 100644 index d1efa48a..00000000 --- a/Migration.Toolkit.Core.K11/Helpers/KenticoHelper.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Globalization; - -using CMS.Helpers; - -using Microsoft.EntityFrameworkCore; - -using Migration.Toolkit.K11; - -namespace Migration.Toolkit.Core.K11.Helpers; - -public static class KenticoHelper -{ - public static void CopyCustomData(ContainerCustomData target, string? sourceXml) - { - var customNodeData = new ContainerCustomData(); - customNodeData.LoadData(sourceXml); - foreach (string? columnName in customNodeData.ColumnNames) - { - target.SetValue(columnName, customNodeData.GetValue(columnName)); - } - } - - public static string? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) - { - using var k11Context = ctxf.CreateDbContext(); - var keys = k11Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); - - return (keys.FirstOrDefault(x => x.SiteId == siteId) - ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; - } - - public static T? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) where T : struct, IParsable - { - using var k11Context = ctxf.CreateDbContext(); - var keys = k11Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); - string? value = (keys.FirstOrDefault(x => x.SiteId == siteId) - ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; - - - return T.TryParse(value, CultureInfo.InvariantCulture, out var result) - ? result - : null; - } - - public static bool? TryGetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName, out T? result) where T : IParsable => T.TryParse(GetSettingsKey(ctxf, siteId, keyName), CultureInfo.InvariantCulture, out result); -} diff --git a/Migration.Toolkit.Core.K11/Helpers/PrintHelper.cs b/Migration.Toolkit.Core.K11/Helpers/PrintHelper.cs deleted file mode 100644 index 8956050d..00000000 --- a/Migration.Toolkit.Core.K11/Helpers/PrintHelper.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Migration.Toolkit.Core.K11.Helpers; - -public static class PrintHelper -{ - public static string PrintDictionary(Dictionary dictionary) => - string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); -} diff --git a/Migration.Toolkit.Core.K11/Helpers/Printer.cs b/Migration.Toolkit.Core.K11/Helpers/Printer.cs deleted file mode 100644 index cf7d4929..00000000 --- a/Migration.Toolkit.Core.K11/Helpers/Printer.cs +++ /dev/null @@ -1,102 +0,0 @@ -using CMS.DataEngine; -using CMS.FormEngine; -using CMS.Globalization; -using CMS.MediaLibrary; -using CMS.Membership; -using CMS.Modules; - -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Helpers; - -public class Printer -{ - public static string PrintKxpModelInfo(T model) - { - string currentTypeName = ReflectionHelper.CurrentType.Name; - - return model switch - { - KXP.Models.MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", - KXP.Models.MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", - KXP.Models.CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", - KXP.Models.CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", - KXP.Models.CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", - KXP.Models.CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", - KXP.Models.CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", - KXP.Models.CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", - KXP.Models.OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", - - null => $"{currentTypeName}: ", - _ => $"TODO: {typeof(T).FullName}" - }; - } - - public static string GetEntityIdentityPrint(T model, bool printType = true) - { - string currentTypeName = ReflectionHelper.CurrentType.Name; - - string Fallback(object obj) => printType - ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" - : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}"; - - string FormatModel(string inner) => printType - ? $"{currentTypeName}({inner})" - : $"{inner}"; - - return model switch - { - MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), - MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), - DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), - - CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), - StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), - - ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), - AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), - UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), - RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), - MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), - - KXP.Models.CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), - KXP.Models.CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), - KXP.Models.CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - KXP.Models.CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - KXP.Models.CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - KXP.Models.CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), - - CmsRole item => FormatModel($"ID={item.RoleId}, GUID={item.RoleGuid}, Name={item.RoleName}, SiteId={item.SiteId}"), - CmsAttachment item => FormatModel($"ID={item.AttachmentId}, GUID={item.AttachmentGuid}, Name={item.AttachmentName}"), - CmsClass item => FormatModel($"ID={item.ClassId}, GUID={item.ClassGuid}, Name={item.ClassName}"), - CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - CmsCountry item => FormatModel($"ID={item.CountryId}, GUID={item.CountryGuid}, Name={item.CountryName}"), - CmsState item => FormatModel($"ID={item.StateId}, GUID={item.StateGuid}, Name={item.StateName}"), - CmsTree item => FormatModel($"NodeID={item.NodeId}, NodeGUID={item.NodeGuid}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), - CmsDocument item => FormatModel($"NodeID={item.DocumentNodeId}, DocumentID={item.DocumentId}, DocumentGUID={item.DocumentGuid}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), - CmsResource item => FormatModel($"ID={item.ResourceId}, GUID={item.ResourceGuid}, Name={item.ResourceName}"), - - null => $" ref of {currentTypeName}", - _ => Fallback(model) - }; - } - - public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); - - public static string PrintEnumValues(string separator) where TEnum : struct, Enum => string.Join(separator, Enum.GetValues()); -} - -public class PrintService : IPrintService -{ - public string PrintKxpModelInfo(T model) => Printer.PrintKxpModelInfo(model); - - public string GetEntityIdentityPrint(T model, bool printType = true) => Printer.GetEntityIdentityPrint(model, printType); - - public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => Printer.GetEntityIdentityPrints(models, separator); - - public string PrintEnumValues(string separator) where TEnum : struct, Enum => Printer.PrintEnumValues(separator); -} diff --git a/Migration.Toolkit.Core.K11/Mappers/AlternativeFormMapper.cs b/Migration.Toolkit.Core.K11/Mappers/AlternativeFormMapper.cs deleted file mode 100644 index f2c1830e..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/AlternativeFormMapper.cs +++ /dev/null @@ -1,91 +0,0 @@ -using CMS.DataEngine; -using CMS.FormEngine; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api.Services.CmsClass; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public record AlternativeFormMapperSource(CmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); - -public class AlternativeFormMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, FieldMigrationService fieldMigrationService) - : EntityMapperBase(logger, pkContext, protocol) -{ - protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - => AlternativeFormInfo.New(); - - protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (source, xbkFormClass) = sourceObj; - - target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormClassId, out int? classId) - ? classId ?? 0 - : 0; - target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormCoupledClassId, out int? coupledClassId) - ? coupledClassId ?? 0 - : 0; - - bool coupledClassIsDeprecated = - source.FormCoupledClass?.ClassName is { } coupledClassName && - K12SystemClass.NoLongerSupported.Contains(coupledClassName); - - bool classIsSysInternal = K12SystemClass.All.Contains(source.FormClass.ClassName); - - string mergedDefinition = source.FormClass.ClassFormDefinition; - if (source.FormCoupledClass != null) - { - logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", source.FormCoupledClass.ClassName, source.FormClass.ClassName); - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormCoupledClass.ClassFormDefinition); - } - - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); - - var patcher = new FormDefinitionPatcher( - logger, - mergedDefinition, - fieldMigrationService, - source.FormClass.ClassIsForm.GetValueOrDefault(false), - source.FormClass.ClassIsDocumentType, - false, - !classIsSysInternal, - true - ); - - var fieldNames = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); - - patcher.PatchFields(); - - var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); - - if (coupledClassIsDeprecated && source.FormCoupledClass != null) - { - logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", source.FormCoupledClass.ClassName); - patcher.RemoveFields(source.FormCoupledClass.ClassFormDefinition); - - var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); - } - - string result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); - - string formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); - - target.FormDefinition = formDefinitionDifference; - - target.FormDisplayName = source.FormDisplayName; - target.FormGUID = source.FormGuid; - target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); - target.FormLastModified = source.FormLastModified; - target.FormName = source.FormName; - - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsAttachmentMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsAttachmentMapper.cs deleted file mode 100644 index cd671afb..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/CmsAttachmentMapper.cs +++ /dev/null @@ -1,59 +0,0 @@ -using CMS.Base; -using CMS.MediaLibrary; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.Core.K11.Helpers; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public record CmsAttachmentMapperSource( - CmsAttachment Attachment, - int TargetLibraryId, - IUploadedFile File, - string LibrarySubFolder, - CmsDocument? AttachmentDocument); - -public class CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; - - protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => - // library name is generated with site name in it - new(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); - - protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - (var cmsAttachment, int targetLibraryId, _, _, var attachmentDocument) = args; - - target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); - target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; - target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; - target.FileExtension = cmsAttachment.AttachmentExtension; - target.FileMimeType = cmsAttachment.AttachmentMimeType; - target.FileSize = cmsAttachment.AttachmentSize; - target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; - target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; - target.FileGUID = cmsAttachment.AttachmentGuid; - target.FileLibraryID = targetLibraryId; - - // target.FileCreatedByUserID = cmsAttachment.?; - // target.FileModifiedByUserID = cmsAttachment.?; - // target.FileCreatedWhen = cmsAttachment.?; - - target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; - - KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); - - if (attachmentDocument != null) - { - target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentDocument.DocumentNode.NodeAliasPath); - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsConsentAgreementMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsConsentAgreementMapper.cs deleted file mode 100644 index ed40187e..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/CmsConsentAgreementMapper.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class CmsConsentAgreementMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override KXP.Models.CmsConsentAgreement? CreateNewInstance(CmsConsentAgreement source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override KXP.Models.CmsConsentAgreement MapInternal(CmsConsentAgreement source, KXP.Models.CmsConsentAgreement target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentAgreementGuid = source.ConsentAgreementGuid; - target.ConsentAgreementRevoked = source.ConsentAgreementRevoked; - target.ConsentAgreementConsentHash = source.ConsentAgreementConsentHash; - target.ConsentAgreementTime = source.ConsentAgreementTime; - - if (mappingHelper.TranslateRequiredId(c => c.ContactId, source.ConsentAgreementContactId, out int contactId)) - { - target.ConsentAgreementContactId = contactId; - } - - if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentAgreementConsentId, out int consentId)) - { - target.ConsentAgreementConsentId = consentId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsConsentArchiveMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsConsentArchiveMapper.cs deleted file mode 100644 index e3687c80..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/CmsConsentArchiveMapper.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class CmsConsentArchiveMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override KXP.Models.CmsConsentArchive? CreateNewInstance(CmsConsentArchive source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override KXP.Models.CmsConsentArchive MapInternal(CmsConsentArchive source, KXP.Models.CmsConsentArchive target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentArchiveContent = source.ConsentArchiveContent; - target.ConsentArchiveGuid = source.ConsentArchiveGuid; - target.ConsentArchiveLastModified = source.ConsentArchiveLastModified; - target.ConsentArchiveHash = source.ConsentArchiveHash; - - if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentArchiveConsentId, out int consentId)) - { - target.ConsentArchiveConsentId = consentId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsConsentMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsConsentMapper.cs deleted file mode 100644 index 181b74d6..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/CmsConsentMapper.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System.Text; -using System.Xml.Linq; -using System.Xml.XPath; - -using CMS.ContentEngine; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class CmsConsentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - protected override KXP.Models.CmsConsent? CreateNewInstance(CmsConsent source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override KXP.Models.CmsConsent MapInternal(CmsConsent source, KXP.Models.CmsConsent target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentDisplayName = source.ConsentDisplayName; - var defaultContentLanguageInfo = ContentLanguageInfo.Provider.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageIsDefault), true).FirstOrDefault() ?? throw new InvalidCastException("Missing default content language"); - target.ConsentName = source.ConsentName; - target.ConsentContent = ConsentContentPatcher.PatchConsentContent(source.ConsentContent, defaultContentLanguageInfo); - target.ConsentGuid = source.ConsentGuid; - target.ConsentLastModified = source.ConsentLastModified; - target.ConsentHash = source.ConsentHash; - - return target; - } -} - -static file class ConsentContentPatcher -{ - public static string PatchConsentContent(string content, ContentLanguageInfo defaultContentLanguage) - { - if (string.IsNullOrWhiteSpace(content)) - { - return content; - } - - XDocument doc; - try - { - doc = XDocument.Parse(content); - } - catch (Exception) - { - // cannot patch xml that cannot be parsed - return content; - } - - foreach (var cultureCodeElement in doc.XPathSelectElements("//CultureCode")) - { - cultureCodeElement.Name = "LanguageName"; - if (!string.Equals(defaultContentLanguage.ContentLanguageName, cultureCodeElement.Value, StringComparison.InvariantCultureIgnoreCase)) - { - // mLogger.LogWarning($"Consent '{consentInfo.ConsentName}' has unknown content language set '{cultureCodeElement.Value}'"); - } - - // if elements are not swapped, FULLTEXT is not shown in UI - var p = cultureCodeElement.NextNode; - if (p is XElement e && e.Name == "FullText") - { - p.ReplaceWith(cultureCodeElement); - cultureCodeElement.ReplaceWith(p); - } - } - - var builder = new StringBuilder(); - using (var writer = new CMS.IO.StringWriter(builder)) - { - doc.Save(writer); - } - - return builder.ToString(); - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsFormMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsFormMapper.cs deleted file mode 100644 index 565bfa83..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/CmsFormMapper.cs +++ /dev/null @@ -1,83 +0,0 @@ -using CMS.FormEngine; -using CMS.OnlineForms; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class CmsFormMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override BizFormInfo? CreateNewInstance(CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) - { - var newBizFormInfo = BizFormInfo.New(); - newBizFormInfo.FormGUID = source.FormGuid; - return newBizFormInfo; - } - - protected override BizFormInfo MapInternal(CmsForm source, BizFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.FormDisplayName = source.FormDisplayName; - target.FormName = source.FormName; - target.FormItems = source.FormItems; - target.FormReportFields = source.FormReportFields; - target.FormSubmitButtonText = source.FormSubmitButtonText; - target.FormAccess = source.FormAccess.AsEnum(); - target.FormSubmitButtonImage = source.FormSubmitButtonImage; - target.FormLastModified = source.FormLastModified; - target.FormLogActivity = source.FormLogActivity.UseKenticoDefault(); - // target.FormBuilderLayout = source.FormBuilderLayout; - - if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out int formClassId)) - { - target.FormClassID = formClassId; - } - - return target; - } -} - -public class CmsFormMapperEf(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - protected override KXP.Models.CmsForm? CreateNewInstance(CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override KXP.Models.CmsForm MapInternal(CmsForm source, KXP.Models.CmsForm target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.FormDisplayName = source.FormDisplayName; - target.FormName = source.FormName; - // target.FormSendToEmail = source.FormSendToEmail; - // target.FormSendFromEmail = source.FormSendFromEmail; - // target.FormEmailSubject = source.FormEmailSubject; - // target.FormEmailTemplate = source.FormEmailTemplate; - // target.FormEmailAttachUploadedDocs = source.FormEmailAttachUploadedDocs; - target.FormItems = source.FormItems; - target.FormReportFields = source.FormReportFields; - target.FormSubmitButtonText = source.FormSubmitButtonText; - // target.FormConfirmationEmailField = source.FormConfirmationEmailField; - // target.FormConfirmationTemplate = source.FormConfirmationTemplate; - // target.FormConfirmationSendFromEmail = source.FormConfirmationSendFromEmail; - // target.FormConfirmationEmailSubject = source.FormConfirmationEmailSubject; - target.FormAccess = source.FormAccess; - target.FormSubmitButtonImage = source.FormSubmitButtonImage; - target.FormGuid = source.FormGuid; - target.FormLastModified = source.FormLastModified; - target.FormLogActivity = source.FormLogActivity ?? false; - // target.FormBuilderLayout = source.FormBuilderLayout; - - if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out int classId)) - { - target.FormClassId = classId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsSettingsCategoryMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsSettingsCategoryMapper.cs deleted file mode 100644 index 0e17b6be..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/CmsSettingsCategoryMapper.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class CmsSettingsCategoryMapper( - ILogger logger, - PrimaryKeyMappingContext pkContext, - IProtocol protocol, - IEntityMapper cmsResourceMapper) - : EntityMapperBase(logger, pkContext, protocol) -{ - protected override KXP.Models.CmsSettingsCategory? CreateNewInstance(CmsSettingsCategory source, MappingHelper mappingHelper, - AddFailure addFailure) => new(); - - - protected override KXP.Models.CmsSettingsCategory MapInternal(CmsSettingsCategory source, KXP.Models.CmsSettingsCategory target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - // no category guid to match on... - if (newInstance) - { - target.CategoryOrder = source.CategoryOrder; - target.CategoryName = source.CategoryName; - target.CategoryDisplayName = source.CategoryDisplayName; - target.CategoryIdpath = source.CategoryIdpath; - target.CategoryLevel = source.CategoryLevel; - target.CategoryChildCount = source.CategoryChildCount; - target.CategoryIconPath = source.CategoryIconPath; - target.CategoryIsGroup = source.CategoryIsGroup; - target.CategoryIsCustom = source.CategoryIsCustom; - } - - if (source.CategoryResource != null) - { - if (target.CategoryResource != null && source.CategoryResourceId != null && target.CategoryResourceId != null) - { - // skip if target is present - logger.LogTrace("Skipping category resource '{ResourceGuid}', already present in target instance", target.CategoryResource.ResourceGuid); - pkContext.SetMapping(r => r.ResourceId, source.CategoryResourceId.Value, target.CategoryResourceId.Value); - } - else - { - switch (cmsResourceMapper.Map(source.CategoryResource, target.CategoryResource)) - { - case { Success: true } result: - { - target.CategoryResource = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result.HandbookReference)); - break; - } - - default: - break; - } - } - } - else if (mappingHelper.TranslateIdAllowNulls(r => r.ResourceId, source.CategoryResourceId, out int? categoryResourceId)) - { - target.CategoryResourceId = categoryResourceId; - } - - if (source.CategoryParent != null) - { - switch (Map(source.CategoryParent, target.CategoryParent)) - { - case { Success: true } result: - { - target.CategoryParent = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result.HandbookReference)); - break; - } - - default: - break; - } - } - else if (mappingHelper.TranslateIdAllowNulls(c => c.CategoryId, source.CategoryParentId, out int? categoryParentId)) - { - target.CategoryParentId = categoryParentId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsSettingsKeyMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsSettingsKeyMapper.cs deleted file mode 100644 index 728e8945..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/CmsSettingsKeyMapper.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System.Diagnostics; - -using CMS.DataEngine; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class CmsSettingsKeyMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - private const string SOURCE_KEY_NAME = "CMSDefaultUserID"; - - protected override SettingsKeyInfo CreateNewInstance(CmsSettingsKey source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override SettingsKeyInfo MapInternal(CmsSettingsKey source, SettingsKeyInfo target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - if (newInstance) - { - target.KeyName = source.KeyName; - target.KeyDisplayName = source.KeyDisplayName; - target.KeyDescription = source.KeyDescription; - target.KeyType = source.KeyType; - target.KeyGUID = source.KeyGuid; - target.KeyValidation = source.KeyValidation; - target.KeyEditingControlPath = source.KeyEditingControlPath; - target.KeyFormControlSettings = source.KeyFormControlSettings; - target.KeyExplanationText = source.KeyExplanationText; - } - else - { - target.KeyName = source.KeyName; - target.KeyDescription = source.KeyDescription; - target.KeyType = source.KeyType; - target.KeyValidation = source.KeyValidation; - target.KeyEditingControlPath = source.KeyEditingControlPath; - target.KeyFormControlSettings = source.KeyFormControlSettings; - target.KeyExplanationText = source.KeyExplanationText; - } - - // special migrations for keys - switch (source.KeyName) - { - case SOURCE_KEY_NAME: - { - target.KeyValue = int.TryParse(source.KeyValue, out int cmsDefaultUserId) - ? mappingHelper.TranslateRequiredId(u => u.UserId, cmsDefaultUserId, out int targetCmsDefaultUserId) - ? targetCmsDefaultUserId.ToString() - : source.KeyValue - : source.KeyValue; - break; - } - default: - target.KeyValue = source.KeyValue; - break; - } - - Debug.Assert(!source.SiteId.HasValue, "!source.SiteId.HasValue"); - target.KeyLastModified = source.KeyLastModified; - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsUserMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsUserMapper.cs deleted file mode 100644 index 5d5a5013..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/CmsUserMapper.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class CmsUserMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override KXP.Models.CmsUser CreateNewInstance(CmsUser tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override KXP.Models.CmsUser MapInternal(CmsUser source, KXP.Models.CmsUser target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.UserGuid != target.UserGuid) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.UserName = source.UserName; - target.FirstName = source.FirstName; - target.LastName = source.LastName; - target.Email = source.Email; - target.UserPassword = source.UserPassword; - target.UserEnabled = source.UserEnabled; - target.UserCreated = source.UserCreated; - target.LastLogon = source.LastLogon; - target.UserGuid = source.UserGuid; - target.UserLastModified = source.UserLastModified; - target.UserSecurityStamp = source.UserSecurityStamp; - target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - target.UserIsPendingRegistration = false; - target.UserPasswordLastChanged = null; - target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - foreach (var sourceCmsUserRole in source.CmsUserRoles) - { - if (mappingHelper.TranslateRequiredId(r => r.RoleId, sourceCmsUserRole.RoleId, out int targetRoleId)) - { - if (target.CmsUserRoles.All(x => x.RoleId != targetRoleId)) - { - target.CmsUserRoles.Add(new KXP.Models.CmsUserRole { RoleId = targetRoleId, User = target }); - } - } - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/CountryInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CountryInfoMapper.cs deleted file mode 100644 index f0dc3e6a..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/CountryInfoMapper.cs +++ /dev/null @@ -1,27 +0,0 @@ -using CMS.Globalization; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class CountryInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - protected override CountryInfo? CreateNewInstance(CmsCountry source, MappingHelper mappingHelper, AddFailure addFailure) - => CountryInfo.New(); - - protected override CountryInfo MapInternal(CmsCountry source, CountryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.CountryName = source.CountryName; - target.CountryDisplayName = source.CountryDisplayName; - target.CountryGUID = source.CountryGuid; - target.CountryLastModified = source.CountryLastModified; - target.CountryThreeLetterCode = source.CountryThreeLetterCode; - target.CountryTwoLetterCode = source.CountryTwoLetterCode; - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/MemberInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/MemberInfoMapper.cs deleted file mode 100644 index 5088982b..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/MemberInfoMapper.cs +++ /dev/null @@ -1,184 +0,0 @@ -using System.Data; - -using CMS.FormEngine; -using CMS.Membership; - -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public record MemberInfoMapperSource(CmsUser User, CmsUserSetting UserSetting); - -public class MemberInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration, - IDbContextFactory k11DbContextFactory) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - public static IReadOnlyList MigratedUserFields = new List - { - nameof(CmsUser.UserGuid), - nameof(CmsUser.UserName), - nameof(CmsUser.Email), - // nameof(KX12M.CmsUser.UserPassword), - nameof(CmsUser.UserEnabled), - nameof(CmsUser.UserCreated), - nameof(CmsUser.UserSecurityStamp) - }; - - protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (user, userSetting) = source; - - if (!newInstance && user.UserGuid != target.MemberGuid) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - // target.UserName = source.UserName; - target.MemberName = user.UserName; - - // target.Email = source.Email; - target.MemberEmail = user.Email; - - // target.SetValue("UserPassword", source.UserPassword); - target.MemberPassword = null; // source.UserPassword; // not migrated - - // target.UserEnabled = source.UserEnabled; - target.MemberEnabled = user.UserEnabled; - - target.SetValue("UserCreated", user.UserCreated); - target.MemberCreated = user.UserCreated.GetValueOrDefault(); - - // target.UserGUID = source.UserGuid; - target.MemberGuid = user.UserGuid; - - target.MemberSecurityStamp = user.UserSecurityStamp; - - // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - // OBSOLETE: target.UserIsPendingRegistration = false; - // OBSOLETE: target.UserPasswordLastChanged = null; - // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); - foreach (var customizedFieldInfo in customized) - { - string fieldName = customizedFieldInfo.FieldName; - - if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out object? value) || - ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) - { - target.SetValue(fieldName, value); - } - } - - using var k11Context = k11DbContextFactory.CreateDbContext(); - var uDci = k11Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_user); - if (uDci != null) - { - var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(uDci?.ClassFormDefinition)).ToList(); - if (userCustomizedFields.Count > 0) - { - try - { - string query = - $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.User.UserId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - } - - var usDci = k11Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); - if (usDci != null) - { - var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); - if (userSettingsCustomizedFields.Count > 0) - { - try - { - string query = - $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userSettingsCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserSettingsInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); - } - } - } - - - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/OmContactGroupMapper.cs b/Migration.Toolkit.Core.K11/Mappers/OmContactGroupMapper.cs deleted file mode 100644 index 8abca943..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/OmContactGroupMapper.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class OmContactGroupMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override KXP.Models.OmContactGroup? CreateNewInstance(OmContactGroup tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override KXP.Models.OmContactGroup MapInternal(OmContactGroup source, KXP.Models.OmContactGroup target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ContactGroupName = source.ContactGroupName; - target.ContactGroupDisplayName = source.ContactGroupDisplayName; - target.ContactGroupDescription = source.ContactGroupDescription; - target.ContactGroupDynamicCondition = source.ContactGroupDynamicCondition; - target.ContactGroupEnabled = source.ContactGroupEnabled; - target.ContactGroupLastModified = source.ContactGroupLastModified; - target.ContactGroupGuid = source.ContactGroupGuid; - target.ContactGroupStatus = source.ContactGroupStatus; - - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/OmContactStatusMapper.cs b/Migration.Toolkit.Core.K11/Mappers/OmContactStatusMapper.cs deleted file mode 100644 index 25de76fe..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/OmContactStatusMapper.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class OmContactStatusMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override KXP.Models.OmContactStatus? CreateNewInstance(OmContactStatus tSourceEntity, MappingHelper mappingHelper, - AddFailure addFailure) => new(); - - protected override KXP.Models.OmContactStatus MapInternal(OmContactStatus source, KXP.Models.OmContactStatus target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ContactStatusName = source.ContactStatusName; - target.ContactStatusDisplayName = source.ContactStatusDisplayName; - target.ContactStatusDescription = source.ContactStatusDescription; - - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/RoleInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/RoleInfoMapper.cs deleted file mode 100644 index 66e962ff..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/RoleInfoMapper.cs +++ /dev/null @@ -1,29 +0,0 @@ -using CMS.Membership; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class RoleInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override RoleInfo? CreateNewInstance(CmsRole source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override RoleInfo MapInternal(CmsRole source, RoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.RoleDisplayName = source.RoleDisplayName; - target.RoleName = source.RoleName; - target.RoleDescription = source.RoleDescription; - target.RoleGUID = source.RoleGuid; - target.RoleLastModified = source.RoleLastModified; - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/StateInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/StateInfoMapper.cs deleted file mode 100644 index 94f3a655..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/StateInfoMapper.cs +++ /dev/null @@ -1,32 +0,0 @@ -using CMS.Globalization; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class StateInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - protected override StateInfo? CreateNewInstance(CmsState source, MappingHelper mappingHelper, AddFailure addFailure) - => StateInfo.New(); - - protected override StateInfo MapInternal(CmsState source, StateInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.StateName = source.StateName; - target.StateDisplayName = source.StateDisplayName; - target.StateLastModified = source.StateLastModified; - target.StateGUID = source.StateGuid; - target.StateCode = source.StateCode; - - if (mappingHelper.TranslateRequiredId(k => k.CountryId, source.CountryId, out int countryId)) - { - target.CountryID = countryId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/UserInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/UserInfoMapper.cs deleted file mode 100644 index b45952eb..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/UserInfoMapper.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System.Data; - -using CMS.Membership; - -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class UserInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override UserInfo CreateNewInstance(CmsUser source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override UserInfo MapInternal(CmsUser source, UserInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.UserGuid != target.UserGUID) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.UserName = source.UserName; - target.FirstName = source.FirstName; - target.LastName = source.LastName; - target.Email = source.Email; - // target.UserPassword = source.UserPassword; - target.SetValue("UserPassword", source.UserPassword); - target.UserEnabled = source.UserEnabled; - target.SetValue("UserCreated", source.UserCreated); - // target.UserCreated = source.UserCreated; - target.SetValue("LastLogon", source.LastLogon); - // target.LastLogon = source.LastLogon; - target.UserGUID = source.UserGuid; - target.UserLastModified = source.UserLastModified; - target.UserSecurityStamp = source.UserSecurityStamp; - target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - target.UserIsPendingRegistration = false; - target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - var customizedFields = kxpClassFacade.GetCustomizedFieldInfos(UserInfo.TYPEINFO.ObjectClassName).ToList(); - if (customizedFields.Count > 0) - { - try - { - string query = - $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in customizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - - - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Mappers/UserRoleInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/UserRoleInfoMapper.cs deleted file mode 100644 index 6d8b6c9c..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/UserRoleInfoMapper.cs +++ /dev/null @@ -1,31 +0,0 @@ -using CMS.Membership; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.Core.K11.Mappers; - -public class UserRoleInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - protected override UserRoleInfo? CreateNewInstance(CmsUserRole source, MappingHelper mappingHelper, AddFailure addFailure) - => UserRoleInfo.New(); - - protected override UserRoleInfo MapInternal(CmsUserRole source, UserRoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (mappingHelper.TranslateRequiredId(r => r.RoleId, source.RoleId, out int xbkRoleId)) - { - target.RoleID = xbkRoleId; - } - - if (mappingHelper.TranslateRequiredId(r => r.UserId, source.UserId, out int xbkUserId)) - { - target.UserID = xbkUserId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.K11/Migration.Toolkit.Core.K11.csproj b/Migration.Toolkit.Core.K11/Migration.Toolkit.Core.K11.csproj deleted file mode 100644 index 4b46f4e6..00000000 --- a/Migration.Toolkit.Core.K11/Migration.Toolkit.Core.K11.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/Migration.Toolkit.Core.K11/Providers/ContentItemNameProvider.cs b/Migration.Toolkit.Core.K11/Providers/ContentItemNameProvider.cs deleted file mode 100644 index 6a7be8ba..00000000 --- a/Migration.Toolkit.Core.K11/Providers/ContentItemNameProvider.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CMS.Base; -using CMS.ContentEngine.Internal; -using CMS.Helpers; - -namespace Migration.Toolkit.Core.K11.Providers; - -internal class ContentItemNameProvider -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) => this.codeNameValidator = codeNameValidator; - - public Task Get(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); - } - - async Task Get(string name) - { - string codeName = ValidationHelper.GetCodeName(name, useUnicode: false); - - bool isCodeNameValid = ValidationHelper.IsCodeName(codeName); - - if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) - { - codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); - } - - var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); - - return await uniqueCodeNameProvider.GetUniqueValue(codeName); - } - - return Get(name); - } -} diff --git a/Migration.Toolkit.Core.K11/Providers/ContentItemNameValidator.cs b/Migration.Toolkit.Core.K11/Providers/ContentItemNameValidator.cs deleted file mode 100644 index 7145f071..00000000 --- a/Migration.Toolkit.Core.K11/Providers/ContentItemNameValidator.cs +++ /dev/null @@ -1,18 +0,0 @@ -using CMS.ContentEngine.Internal; - -namespace Migration.Toolkit.Core.K11.Providers; - -internal class ContentItemNameValidator : IContentItemNameValidator -{ - /// - public bool IsUnique(string name) => IsUnique(0, name); - - - /// - public bool IsUnique(int id, string name) - { - var contentItemInfo = new ContentItemInfo { ContentItemID = id, ContentItemName = name }; - - return contentItemInfo.CheckUniqueCodeName(); - } -} diff --git a/Migration.Toolkit.Core.K11/Providers/UniqueContentItemNameProvider.cs b/Migration.Toolkit.Core.K11/Providers/UniqueContentItemNameProvider.cs deleted file mode 100644 index 6a8fc262..00000000 --- a/Migration.Toolkit.Core.K11/Providers/UniqueContentItemNameProvider.cs +++ /dev/null @@ -1,38 +0,0 @@ -using CMS.Base; -using CMS.ContentEngine.Internal; - -namespace Migration.Toolkit.Core.K11.Providers; - -internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) - : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) => this.codeNameValidator = codeNameValidator; - - public override Task GetUniqueValue(string inputValue) => base.GetUniqueValue(AddSuffix(inputValue)); - - - private string AddSuffix(string codeName) - { - string randomSuffix = GetRandomSuffix(); - string codeNameWithSuffix = codeName += randomSuffix; - - if (codeNameWithSuffix.Length > MaxLength) - { - int availableLength = MaxLength - randomSuffix.Length; - - codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; - } - - return codeNameWithSuffix; - } - - - /// - protected override Task IsValueUnique(string value) => Task.FromResult(codeNameValidator.IsUnique(value)); -} diff --git a/Migration.Toolkit.Core.K11/Services/CmsClass/AttachmentSelectorItem.cs b/Migration.Toolkit.Core.K11/Services/CmsClass/AttachmentSelectorItem.cs deleted file mode 100644 index b00b477e..00000000 --- a/Migration.Toolkit.Core.K11/Services/CmsClass/AttachmentSelectorItem.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Newtonsoft.Json; - -namespace Migration.Toolkit.Core.K11.Services.CmsClass; - -/// Represents an item for the attachment selector. -public class AttachmentSelectorItem -{ - /// Attachment GUID. - [JsonProperty("fileGuid")] - public Guid FileGuid { get; set; } -} diff --git a/Migration.Toolkit.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs b/Migration.Toolkit.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs deleted file mode 100644 index cd561d5c..00000000 --- a/Migration.Toolkit.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs +++ /dev/null @@ -1,189 +0,0 @@ -// namespace Migration.Toolkit.Core.K11.Services.CmsClass; -// -// using System.Runtime.Serialization; -// using Newtonsoft.Json; -// using Newtonsoft.Json.Linq; -// -// #region Copied from Kentico assembly -// -// [DataContract(Name = "Configuration", Namespace = "")] -// public sealed class EditableAreasConfiguration -// { -// /// Editable areas within the page. -// [DataMember] -// [JsonProperty("editableAreas")] -// public List EditableAreas { get; private set; } -// -// /// -// /// Creates an instance of class. -// /// -// public EditableAreasConfiguration() => this.EditableAreas = new List(); -// } -// -// /// -// /// Represents configuration of editable area within the instance. -// /// -// [DataContract(Name = "EditableArea", Namespace = "")] -// public sealed class EditableAreaConfiguration -// { -// /// Identifier of the editable area. -// [DataMember] -// [JsonProperty("identifier")] -// public string Identifier { get; set; } -// -// /// Sections within editable area. -// [DataMember] -// [JsonProperty("sections")] -// public List Sections { get; private set; } -// -// /// -// /// A flag indicating whether the output of the individual widgets within the editable area can be cached. The default value is false. -// /// -// public bool AllowWidgetOutputCache { get; set; } -// -// /// -// /// An absolute expiration date for the cached output of the individual widgets. -// /// -// public DateTimeOffset? WidgetOutputCacheExpiresOn { get; set; } -// -// /// -// /// The length of time from the first request to cache the output of the individual widgets. -// /// -// public TimeSpan? WidgetOutputCacheExpiresAfter { get; set; } -// -// /// -// /// The time after which the cached output of the individual widgets should be evicted if it has not been accessed. -// /// -// public TimeSpan? WidgetOutputCacheExpiresSliding { get; set; } -// -// /// -// /// Creates an instance of class. -// /// -// public EditableAreaConfiguration() => this.Sections = new List(); -// } -// -// /// -// /// Represents configuration of section within the instance. -// /// -// [DataContract(Name = "Section", Namespace = "")] -// public sealed class SectionConfiguration -// { -// /// Identifier of the section. -// [DataMember] -// [JsonProperty("identifier")] -// public Guid Identifier { get; set; } -// -// /// Type section identifier. -// [DataMember] -// [JsonProperty("type")] -// public string TypeIdentifier { get; set; } -// -// /// Section properties. -// [DataMember] -// [JsonProperty("properties")] -// // public ISectionProperties Properties { get; set; } -// public JObject Properties { get; set; } -// -// /// Zones within the section. -// [DataMember] -// [JsonProperty("zones")] -// public List Zones { get; private set; } -// -// /// -// /// Creates an instance of class. -// /// -// public SectionConfiguration() => this.Zones = new List(); -// } -// -// /// -// /// Represents the zone within the configuration class. -// /// -// [DataContract(Name = "Zone", Namespace = "")] -// public sealed class ZoneConfiguration -// { -// /// Identifier of the widget zone. -// [DataMember] -// [JsonProperty("identifier")] -// public Guid Identifier { get; set; } -// -// /// Name of the widget zone. -// [DataMember] -// [JsonProperty("name")] -// public string Name { get; set; } -// -// /// List of widgets within the zone. -// [DataMember] -// [JsonProperty("widgets")] -// public List Widgets { get; private set; } -// -// /// -// /// Creates an instance of class. -// /// -// public ZoneConfiguration() => this.Widgets = new List(); -// } -// -// /// -// /// Represents the configuration of a widget within the list. -// /// -// [DataContract(Name = "Widget", Namespace = "")] -// public sealed class WidgetConfiguration -// { -// /// Identifier of the widget instance. -// [DataMember] -// [JsonProperty("identifier")] -// public Guid Identifier { get; set; } -// -// /// Type widget identifier. -// [DataMember] -// [JsonProperty("type")] -// public string TypeIdentifier { get; set; } -// -// /// Personalization condition type identifier. -// [DataMember] -// [JsonProperty("conditionType")] -// public string PersonalizationConditionTypeIdentifier { get; set; } -// -// /// List of widget variants. -// [DataMember] -// [JsonProperty("variants")] -// public List Variants { get; set; } -// -// /// -// /// Creates an instance of class. -// /// -// public WidgetConfiguration() => this.Variants = new List(); -// } -// -// /// -// /// Represents the configuration variant of a widget within the list. -// /// -// [DataContract(Name = "Variant", Namespace = "")] -// public sealed class WidgetVariantConfiguration -// { -// /// Identifier of the variant instance. -// [DataMember] -// [JsonProperty("identifier")] -// public Guid Identifier { get; set; } -// -// /// Widget variant name. -// [DataMember] -// [JsonProperty("name")] -// public string Name { get; set; } -// -// /// Widget variant properties. -// [DataMember] -// [JsonProperty("properties")] -// // public IWidgetProperties Properties { get; set; } -// public JObject Properties { get; set; } -// -// /// Widget variant personalization condition type. -// /// Only personalization condition type parameters are serialized to JSON. -// [DataMember] -// [JsonProperty("conditionTypeParameters")] -// public JObject PersonalizationConditionType { get; set; } -// } -// -// #endregion -// - - diff --git a/Migration.Toolkit.Core.K11/Services/CmsClass/PageSelectorItem.cs b/Migration.Toolkit.Core.K11/Services/CmsClass/PageSelectorItem.cs deleted file mode 100644 index e4a31280..00000000 --- a/Migration.Toolkit.Core.K11/Services/CmsClass/PageSelectorItem.cs +++ /dev/null @@ -1,13 +0,0 @@ -// namespace Migration.Toolkit.Core.K11.Services.CmsClass; -// -// using Newtonsoft.Json; -// -// /// Represents an item for a page selector. -// public class PageSelectorItem -// { -// /// Node Guid of a page. -// [JsonProperty("nodeGuid")] -// public Guid NodeGuid { get; set; } -// } - - diff --git a/Migration.Toolkit.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs b/Migration.Toolkit.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs deleted file mode 100644 index e10908f6..00000000 --- a/Migration.Toolkit.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs +++ /dev/null @@ -1,31 +0,0 @@ -// namespace Migration.Toolkit.Core.K11.Services.CmsClass; -// -// using System.Runtime.Serialization; -// using Newtonsoft.Json; -// using Newtonsoft.Json.Linq; -// -// /// -// /// Page template configuration for the instance. -// /// -// [DataContract(Name = "PageTemplate", Namespace = "")] -// public class PageTemplateConfiguration -// { -// /// Identifier of the page template. -// [DataMember] -// [JsonProperty("identifier")] -// public string Identifier { get; set; } -// -// /// -// /// Identifier of the page template configuration based on which the page was created. -// /// -// [DataMember] -// [JsonProperty("configurationIdentifier")] -// public Guid ConfigurationIdentifier { get; set; } -// -// /// Page template properties. -// [DataMember] -// [JsonProperty("properties")] -// public JObject Properties { get; set; } -// } - - diff --git a/Migration.Toolkit.Core.K11/Services/CountryMigrator.cs b/Migration.Toolkit.Core.K11/Services/CountryMigrator.cs deleted file mode 100644 index b0562a57..00000000 --- a/Migration.Toolkit.Core.K11/Services/CountryMigrator.cs +++ /dev/null @@ -1,105 +0,0 @@ -using CMS.Globalization; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api; - -namespace Migration.Toolkit.Core.K11.Services; - -public class CountryMigrator( - ILogger logger, - IDbContextFactory k11ContextFactory, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - IEntityMapper countryMapper, - IEntityMapper stateMapper, - KxpApiInitializer kxpApiInitializer) -{ - public void MigrateCountriesAndStates() - { - if (!kxpApiInitializer.EnsureApiIsInitialized()) - { - throw new InvalidOperationException("Falied to initialize kentico API. Please check configuration."); - } - - var k11Context = k11ContextFactory.CreateDbContext(); - - var k11Countries = k11Context.CmsCountries.AsNoTracking(); - foreach (var k11CmsCountry in k11Countries) - { - var kxpCountryInfo = CountryInfoProvider.ProviderObject.Get(k11CmsCountry.CountryName); - - if (kxpCountryInfo != null) // do not update when exists - { - continue; - } - - var mapped = countryMapper.Map(k11CmsCountry, null); - protocol.MappedTarget(mapped); - - if (mapped is (var countryInfo, var newInstance) { Success: true }) - { - try - { - CountryInfoProvider.ProviderObject.Set(countryInfo); - - protocol.Success(k11CmsCountry, countryInfo, mapped); - logger.LogEntitySetAction(newInstance, countryInfo); - - primaryKeyMappingContext.SetMapping(r => r.CountryId, k11CmsCountry.CountryId, countryInfo.CountryID); - } - catch (Exception exception) - { - logger.LogEntitySetError(exception, newInstance, countryInfo); - protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithIdentityPrint(countryInfo) - ); - } - } - } - - - var k11States = k11Context.CmsStates.AsNoTracking(); - foreach (var k11CmsState in k11States) - { - var kxpStateInfo = StateInfoProvider.ProviderObject.Get(k11CmsState.StateName); - - if (kxpStateInfo != null) // do not update when exists - { - continue; - } - - var mapped = stateMapper.Map(k11CmsState, null); - protocol.MappedTarget(mapped); - - if (mapped is (var stateInfo, var newInstance) { Success: true }) - { - try - { - StateInfoProvider.ProviderObject.Set(stateInfo); - - protocol.Success(k11CmsState, stateInfo, mapped); - logger.LogEntitySetAction(newInstance, stateInfo); - - primaryKeyMappingContext.SetMapping(r => r.StateId, k11CmsState.StateId, stateInfo.StateID); - } - catch (Exception exception) - { - logger.LogEntitySetError(exception, newInstance, stateInfo); - protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithIdentityPrint(stateInfo) - ); - } - } - } - } -} diff --git a/Migration.Toolkit.Core.K11/Services/IPrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.K11/Services/IPrimaryKeyLocatorService.cs deleted file mode 100644 index fc5b664e..00000000 --- a/Migration.Toolkit.Core.K11/Services/IPrimaryKeyLocatorService.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Linq.Expressions; - -namespace Migration.Toolkit.Core.K11.Services; - -public record SourceTargetKeyMapping(int SourceId, int TargetId); - -public interface IPrimaryKeyLocatorService -{ - bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); - IEnumerable SelectAll(Expression> keyNameSelector); -} diff --git a/Migration.Toolkit.Core.K11/Services/KeyLocatorService.cs b/Migration.Toolkit.Core.K11/Services/KeyLocatorService.cs deleted file mode 100644 index 78eb544e..00000000 --- a/Migration.Toolkit.Core.K11/Services/KeyLocatorService.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System.Linq.Expressions; -using System.Runtime.CompilerServices; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.K11; -using Migration.Toolkit.KXP.Context; - -namespace Migration.Toolkit.Core.K11.Services; - -public class KeyLocatorService( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory k11ContextFactory) -{ - public bool TryLocate( - Expression> sourceKeySelector, - Expression> targetKeySelector, - Expression> sourceGuidSelector, - Expression> targetGuidSelector, - object? sourceKey, out TTargetKey targetId - ) where TSource : class where TTarget : class - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - using var k11Context = k11ContextFactory.CreateDbContext(); - - var sourceType = typeof(TSource); - Unsafe.SkipInit(out targetId); - - try - { - if (sourceKey is null) - { - return false; - } - - var sourceEquals = Expression.Equal( - sourceKeySelector.Body, - Expression.Convert(Expression.Constant(sourceKey, sourceKey.GetType()), typeof(object)) - ); - var sourcePredicate = Expression.Lambda>(sourceEquals, sourceKeySelector.Parameters[0]); - var k11Guid = k11Context.Set().Where(sourcePredicate).Select(sourceGuidSelector).Single(); - - var param = Expression.Parameter(typeof(TTarget), "t"); - var member = targetGuidSelector.Body as MemberExpression ?? throw new InvalidOperationException($"Expression SHALL NOT be other than member expression, expression: {targetGuidSelector}"); - var targetEquals = Expression.Equal( - Expression.MakeMemberAccess(param, member.Member), - Expression.Constant(k11Guid, typeof(Guid)) - ); - var targetPredicate = Expression.Lambda>(targetEquals, param); - - var query = kxpContext.Set().Where(targetPredicate); - var selector = Expression.Lambda>(targetKeySelector.Body, targetKeySelector.Parameters[0]); - targetId = query.Select(selector).Single(); - return true; - } - catch (InvalidOperationException ioex) - { - logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceKey, ioex.Message); - return false; - } - finally - { - if (!targetId?.Equals(default) ?? false) - { - logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceKey, targetId); - } - } - } - - public bool TryGetSourceGuid(Expression> keySelector, Expression> guidSelector, object? key, out Guid? guid) - where T : class - { - using var KX12Context = k11ContextFactory.CreateDbContext(); - - var type = typeof(T); - Unsafe.SkipInit(out guid); - - try - { - if (key is null) - { - return false; - } - - var sourceEquals = Expression.Equal( - keySelector.Body, - Expression.Convert(Expression.Constant(key, key.GetType()), typeof(object)) - ); - var sourcePredicate = Expression.Lambda>(sourceEquals, keySelector.Parameters[0]); - guid = KX12Context.Set().Where(sourcePredicate).Select(guidSelector).Single(); - return true; - } - catch (InvalidOperationException ioex) - { - logger.LogWarning("Guid locator {SourceFullType} primary key: {Key} failed, {Message}", type.FullName, key, ioex.Message); - return false; - } - finally - { - if (!guid?.Equals(default) ?? false) - { - logger.LogTrace("Guid locator {SourceFullType} primary key: {Key} located {Guid}", type.FullName, key, guid); - } - } - } -} diff --git a/Migration.Toolkit.Core.K11/Services/PrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.K11/Services/PrimaryKeyLocatorService.cs deleted file mode 100644 index be16f844..00000000 --- a/Migration.Toolkit.Core.K11/Services/PrimaryKeyLocatorService.cs +++ /dev/null @@ -1,220 +0,0 @@ -using System.Linq.Expressions; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Context; - -namespace Migration.Toolkit.Core.K11.Services; - -public class PrimaryKeyLocatorService( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory k11ContextFactory) - : IPrimaryKeyLocatorService -{ - public IEnumerable SelectAll(Expression> keyNameSelector) - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - using var k11Context = k11ContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - string memberName = keyNameSelector.GetMemberName(); - - logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); - - if (sourceType == typeof(CmsUser) && memberName == nameof(CmsUser.UserId)) - { - var sourceUsers = k11Context.CmsUsers.Select(x => new { x.UserId, x.UserGuid, x.UserName }).ToList(); - var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); - - var result = sourceUsers.Join(targetUsers, - a => new CmsUserKey(a.UserGuid, a.UserName), - b => new CmsUserKey(b.UserGuid, b.UserName), - (a, b) => new SourceTargetKeyMapping(a.UserId, b.UserId), - new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(OmContact) && memberName == nameof(OmContact.ContactId)) - { - var source = k11Context.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - var target = kxpContext.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - - var result = source.Join(target, - a => a.ContactGuid, - b => b.ContactGuid, - (a, b) => new SourceTargetKeyMapping(a.ContactId, b.ContactId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(CmsState) && memberName == nameof(CmsState.StateId)) - { - var source = k11Context.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - - var result = source.Join(target, - a => a.StateName, - b => b.StateName, - (a, b) => new SourceTargetKeyMapping(a.StateId, b.StateId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(CmsCountry) && memberName == nameof(CmsCountry.CountryId)) - { - var source = k11Context.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - - var result = source.Join(target, - a => a.CountryName, - b => b.CountryName, - (a, b) => new SourceTargetKeyMapping(a.CountryId, b.CountryId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - - throw new NotImplementedException(); - } - - public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - using var KX12Context = k11ContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - targetId = -1; - try - { - if (sourceType == typeof(CmsResource)) - { - var k11Guid = KX12Context.CmsResources.Where(c => c.ResourceId == sourceId).Select(x => x.ResourceGuid).Single(); - targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == k11Guid).Select(x => x.ResourceId).Single(); - return true; - } - - if (sourceType == typeof(Toolkit.K11.Models.CmsClass)) - { - var k11Guid = KX12Context.CmsClasses.Where(c => c.ClassId == sourceId).Select(x => x.ClassGuid).Single(); - targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == k11Guid).Select(x => x.ClassId).Single(); - return true; - } - - if (sourceType == typeof(CmsUser)) - { - var k11User = KX12Context.CmsUsers.Where(c => c.UserId == sourceId).Select(x => new { x.UserGuid, x.UserName }).Single(); - targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == k11User.UserGuid || x.UserName == k11User.UserName).Select(x => x.UserId).Single(); - return true; - } - - if (sourceType == typeof(CmsRole)) - { - var k11Role = KX12Context.CmsRoles.Where(c => c.RoleId == sourceId).Select(x => new { x.RoleGuid }).Single(); - targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == k11Role.RoleGuid).Select(x => x.RoleId).Single(); - return true; - } - - if (sourceType == typeof(CmsSite)) - { - var k11Guid = KX12Context.CmsSites.Where(c => c.SiteId == sourceId).Select(x => x.SiteGuid).Single(); - targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == k11Guid).Select(x => x.ChannelId).Single(); - return true; - } - - if (sourceType == typeof(CmsState)) - { - string k11CodeName = KX12Context.CmsStates.Where(c => c.StateId == sourceId).Select(x => x.StateName).Single(); - targetId = kxpContext.CmsStates.Where(x => x.StateName == k11CodeName).Select(x => x.StateId).Single(); - return true; - } - - if (sourceType == typeof(CmsCountry)) - { - string k11CodeName = KX12Context.CmsCountries.Where(c => c.CountryId == sourceId).Select(x => x.CountryName).Single(); - targetId = kxpContext.CmsCountries.Where(x => x.CountryName == k11CodeName).Select(x => x.CountryId).Single(); - return true; - } - - if (sourceType == typeof(OmContactStatus)) - { - string k11Guid = KX12Context.OmContactStatuses.Where(c => c.ContactStatusId == sourceId).Select(x => x.ContactStatusName).Single(); - targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == k11Guid).Select(x => x.ContactStatusId).Single(); - return true; - } - - if (sourceType == typeof(OmContact)) - { - var k11Guid = KX12Context.OmContacts.Where(c => c.ContactId == sourceId).Select(x => x.ContactGuid).Single(); - targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == k11Guid).Select(x => x.ContactId).Single(); - return true; - } - } - catch (InvalidOperationException ioex) - { - if (ioex.Message.StartsWith("Sequence contains no elements")) - { - logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - else - { - logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - - return false; - } - finally - { - if (targetId != -1) - { - logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); - } - } - - logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); - targetId = -1; - return false; - } - - private class KeyEqualityComparerWithLambda(Func equalityComparer) : IEqualityComparer - { - public bool Equals(T? x, T? y) => equalityComparer.Invoke(x, y); - - public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; - } - - private record CmsUserKey(Guid UserGuid, string UserName); -} diff --git a/Migration.Toolkit.Core.KX12/Behaviors/CommandConstraintBehavior.cs b/Migration.Toolkit.Core.KX12/Behaviors/CommandConstraintBehavior.cs deleted file mode 100644 index c095439f..00000000 --- a/Migration.Toolkit.Core.KX12/Behaviors/CommandConstraintBehavior.cs +++ /dev/null @@ -1,229 +0,0 @@ -using MediatR; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KX12; -using Migration.Toolkit.KX12.Context; - -namespace Migration.Toolkit.Core.KX12.Behaviors; - -public class CommandConstraintBehavior( - ILogger> logger, - IMigrationProtocol protocol, - IDbContextFactory kx12ContextFactory) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) - { - try - { - var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); - - bool criticalCheckPassed = PerformChecks(request, kx12Context); - if (!criticalCheckPassed) - { - return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); - } - } - catch (Exception ex) - { - protocol.CommandError(ex, request); - logger.LogCritical(ex, "Error occured while checking command constraints"); - return (TResponse)(CommandResult)new CommandCheckFailedResult(false); - } - - return await next(); - } - - private bool PerformChecks(TRequest request, KX12Context kx12Context) - { - bool criticalCheckPassed = true; - const string supportedVersion = "12.0.20"; - if (SemanticVersion.TryParse(supportedVersion, out var minimalVersion)) - { - criticalCheckPassed &= CheckVersion(kx12Context, minimalVersion); - } - - var sourceSites = kx12Context.CmsSites - .Include(s => s.Cultures) - .ToList(); - - foreach (var site in sourceSites) - { - criticalCheckPassed &= CheckSite(sourceSites, site.SiteId); - } - - if (request is ICultureReliantCommand cultureReliantCommand) - { - criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites); - } - - return criticalCheckPassed; - } - - private bool CheckVersion(KX12Context kx12Context, SemanticVersion minimalVersion) - { - bool criticalCheckPassed = true; - - #region Check conclusion methods - - void UnableToReadVersionKey(string keyName) - { - logger.LogCritical("Unable to read CMS version (incorrect format) - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); - protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { ErrorKind = "Settings key value incorrect format", SettingsKeyName = keyName, SupportedVersion = minimalVersion.ToString() })); - criticalCheckPassed = false; - } - - void VersionKeyNotFound(string keyName) - { - logger.LogCritical("CMS version not found - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); - protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { ErrorKind = "Settings key not found", SettingsKeyName = keyName, SupportedVersion = minimalVersion.ToString() })); - criticalCheckPassed = false; - } - - void UpgradeNeeded(string keyName, string currentVersion) - { - logger.LogCritical("{Key} '{CurrentVersion}' is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentVersion, minimalVersion.ToString()); - protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { CurrentVersion = currentVersion, SupportedVersion = minimalVersion.ToString() })); - criticalCheckPassed = false; - } - - void LowHotfix(string keyName, int currentHotfix) - { - logger.LogCritical("{Key} '{CurrentVersion}' hotfix is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentHotfix, minimalVersion.ToString()); - protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { CurrentHotfix = currentHotfix.ToString(), SupportedVersion = minimalVersion.ToString() })); - criticalCheckPassed = false; - } - - #endregion - - if (kx12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDataVersion) is { } cmsDataVersion) - { - if (SemanticVersion.TryParse(cmsDataVersion.KeyValue, out var cmsDataVer)) - { - if (cmsDataVer.IsLesserThan(minimalVersion)) - { - UpgradeNeeded(SettingsKeys.CMSDataVersion, cmsDataVer.ToString()); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSDataVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSDataVersion); - } - - if (kx12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDBVersion) is { } cmsDbVersion) - { - if (SemanticVersion.TryParse(cmsDbVersion.KeyValue, out var cmsDataVer)) - { - if (cmsDataVer.IsLesserThan(minimalVersion)) - { - UpgradeNeeded(SettingsKeys.CMSDBVersion, cmsDataVer.ToString()); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSDBVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSDBVersion); - } - - if (kx12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixDataVersion) is { } cmsHotfixDataVersion) - { - if (int.TryParse(cmsHotfixDataVersion.KeyValue, out int version)) - { - if (version < minimalVersion.Hotfix) - { - LowHotfix(SettingsKeys.CMSHotfixDataVersion, version); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSHotfixDataVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSHotfixDataVersion); - } - - if (kx12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixVersion) is { } cmsHotfixVersion) - { - if (int.TryParse(cmsHotfixVersion.KeyValue, out int version)) - { - if (version < minimalVersion.Hotfix) - { - LowHotfix(SettingsKeys.CMSHotfixVersion, version); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSHotfixVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSHotfixVersion); - } - - return criticalCheckPassed; - } - - private bool CheckSite(List sourceSites, int sourceSiteId) - { - bool criticalCheckPassed = true; - if (sourceSites.All(s => s.SiteId != sourceSiteId)) - { - var supportedSites = sourceSites.Select(x => new { x.SiteName, x.SiteId }).ToArray(); - string supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); - logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, - supportedSitesStr); - protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") - .WithMessage("Check program argument '--siteId'") - .WithData(new { sourceSiteId, AvailableSites = supportedSites })); - criticalCheckPassed = false; - } - - return criticalCheckPassed; - } - - private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites) - { - bool criticalCheckPassed = true; - string cultureCode = cultureReliantCommand.CultureCode; - var siteCultureLookup = sourceSites - .ToDictionary(x => x.SiteId, x => x.Cultures.Select(s => s.CultureCode.ToLowerInvariant())); - - foreach (var site in sourceSites) - { - if (siteCultureLookup.TryGetValue(site.SiteId, out var value)) - { - string[] siteCultures = value.ToArray(); - if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) - { - string supportedCultures = string.Join(", ", siteCultures); - logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, site.SiteId, supportedCultures); - protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") - .WithMessage("Check program argument '--culture'") - .WithData(new { cultureCode, site.SiteId, SiteCultures = supportedCultures })); - criticalCheckPassed = false; - } - } - } - - return criticalCheckPassed; - } -} diff --git a/Migration.Toolkit.Core.KX12/Behaviors/RequestHandlingBehavior.cs b/Migration.Toolkit.Core.KX12/Behaviors/RequestHandlingBehavior.cs deleted file mode 100644 index 5307143d..00000000 --- a/Migration.Toolkit.Core.KX12/Behaviors/RequestHandlingBehavior.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Diagnostics; - -using MediatR; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; - -namespace Migration.Toolkit.Core.KX12.Behaviors; - -public class RequestHandlingBehavior(ILogger> logger, IMigrationProtocol protocol) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) - { - var sw = Stopwatch.StartNew(); - logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); - try - { - protocol.CommandRequest(request); - var response = await next(); - protocol.CommandFinished(request, response); - return response; - } - catch (Exception ex) - { - protocol.CommandError(ex, request); - logger.LogError(ex, "Error occured"); - throw; - } - finally - { - logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); - } - } -} diff --git a/Migration.Toolkit.Core.KX12/Behaviors/XbKApiContextBehavior.cs b/Migration.Toolkit.Core.KX12/Behaviors/XbKApiContextBehavior.cs deleted file mode 100644 index 41f6d648..00000000 --- a/Migration.Toolkit.Core.KX12/Behaviors/XbKApiContextBehavior.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CMS.Base; -using CMS.Membership; - -using MediatR; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; - -namespace Migration.Toolkit.Core.KX12.Behaviors; - -public class XbKApiContextBehavior( - ILogger> logger, - IMigrationProtocol protocol, - KxpApiInitializer initializer) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) - { - initializer.EnsureApiIsInitialized(); - - var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); - if (defaultAdmin == null) - { - protocol.Append(HandbookReferences - .MissingRequiredDependency() - .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") - ); - throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); - } - - using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) - { - logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); - return await next(); - } - } -} diff --git a/Migration.Toolkit.Core.KX12/Contexts/KeyMappingContext.cs b/Migration.Toolkit.Core.KX12/Contexts/KeyMappingContext.cs deleted file mode 100644 index 7a20a5d3..00000000 --- a/Migration.Toolkit.Core.KX12/Contexts/KeyMappingContext.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Linq.Expressions; - -using Migration.Toolkit.Core.KX12.Services; - -namespace Migration.Toolkit.Core.KX12.Contexts; - -public record MapSourceKeyResult(bool Success, TMapped? Mapped); - -public class KeyMappingContext(PrimaryKeyMappingContext primaryKeyMappingContext, KeyLocatorService keyLocatorService) -{ - public MapSourceKeyResult MapSourceKey(Expression> sourceKeySelector, - Expression> sourceGuidSelector, - object? sourceKey, - Expression> targetKeySelector, - Expression> targetGuidSelector) where TSource : class where TTarget : class - { - if (sourceKey is int id && primaryKeyMappingContext.MapSourceId(sourceKeySelector, id) is { Success: true, MappedId: TTargetKey targetKey }) - { - return new MapSourceKeyResult(true, targetKey); - } - - if (keyLocatorService.TryLocate(sourceKeySelector, targetKeySelector, sourceGuidSelector, targetGuidSelector, sourceKey, out var located)) - { - return new MapSourceKeyResult(true, located); - } - - return new MapSourceKeyResult(false, default); - } - - public MapSourceKeyResult GetGuid(Expression> keySelector, Expression> guidSelector, object? key) where T : class => - keyLocatorService.TryGetSourceGuid(keySelector, guidSelector, key, out var located) - ? new MapSourceKeyResult(true, located) - : new MapSourceKeyResult(false, null); -} diff --git a/Migration.Toolkit.Core.KX12/Contexts/PrimaryKeyMappingContext.cs b/Migration.Toolkit.Core.KX12/Contexts/PrimaryKeyMappingContext.cs deleted file mode 100644 index 0790c3a1..00000000 --- a/Migration.Toolkit.Core.KX12/Contexts/PrimaryKeyMappingContext.cs +++ /dev/null @@ -1,287 +0,0 @@ -using System.Diagnostics; -using System.Linq.Expressions; -using System.Reflection; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Core.KX12.Services; - -namespace Migration.Toolkit.Core.KX12.Contexts; - -public class PrimaryKeyMappingContext( - ILogger logger, - IPrimaryKeyLocatorService primaryKeyLocatorService, - ToolkitConfiguration toolkitConfiguration) - : IPrimaryKeyMappingContext -{ - private readonly Dictionary mappingsCache = new(StringComparer.OrdinalIgnoreCase); - - public void SetMapping(Type type, string keyName, int sourceId, int targetId) - { - Debug.Assert(sourceId > 0, "sourceId > 0"); - Debug.Assert(targetId > 0, "targetId > 0"); - - var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) - .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); - - Debug.Assert(foundProp != null, "foundProp != null"); - - string fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; - - mappingsCache[fullKeyName] = targetId; - logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); - } - - public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) - { - string fullKeyName = CreateKey(keyNameSelector, sourceId); - mappingsCache[fullKeyName] = targetId; - logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); - } - - public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) - { - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sourceId); - if (sourceId == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out int targetId)) - { - SetMapping(keyNameSelector, sourceId, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, "Target entity is missing"); - } - - public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) - { - targetIdResult = -1; - if (sourceId is not int sid) - { - return false; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - targetIdResult = explicitlyMappedId; - return true; - } - - if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - targetIdResult = resultId; - return true; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - targetIdResult = targetId; - return true; - } - - return false; - } - - public int? MapFromSource(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, "Target entity is missing"); - } - - public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - return null; - } - - public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return new MapSourceIdResult(true, null); - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return new MapSourceIdResult(true, null); - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return new MapSourceIdResult(true, explicitlyMappedId); - } - - if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return new MapSourceIdResult(true, resultId); - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return new MapSourceIdResult(true, targetId); - } - - return new MapSourceIdResult(false, null); - } - - public void PreloadDependencies(Expression> keyNameSelector) - { - foreach ((int sourceId, int targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) - { - SetMapping(keyNameSelector, sourceId, targetId); - } - } - - public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return true; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - return true; - } - - if (GetExplicitMappingOrNull(memberName, sid) is not null) - { - return true; - } - - if (mappingsCache.TryGetValue(fullKeyName, out _)) - { - return true; - } - - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) - { - return true; - } - - return false; - } - - private int? GetExplicitMappingOrNull(string memberName, int? sourceId) - { - if (sourceId == null) - { - return null; - } - - var mappings = toolkitConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; - if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) - { - return memberMappings.TryGetValue($"{sourceId}", out int? mappedId) ? mappedId : null; - } - - return null; - } - - private static string CreateKey(Expression> keyNameSelector, int sourceId) => $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; -} diff --git a/Migration.Toolkit.Core.KX12/Exceptions.cs b/Migration.Toolkit.Core.KX12/Exceptions.cs deleted file mode 100644 index b7ba75fc..00000000 --- a/Migration.Toolkit.Core.KX12/Exceptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Migration.Toolkit.Core.KX12; - -public class MappingFailureException : InvalidOperationException -{ - public MappingFailureException(string keyName, string reason) : base($"Key '{keyName}' mapping failed: {reason}") - { - KeyName = keyName; - Reason = reason; - } - - public string KeyName { get; } - public string Reason { get; } -} diff --git a/Migration.Toolkit.Core.KX12/GlobalUsings.cs b/Migration.Toolkit.Core.KX12/GlobalUsings.cs deleted file mode 100644 index d87d0f35..00000000 --- a/Migration.Toolkit.Core.KX12/GlobalUsings.cs +++ /dev/null @@ -1,3 +0,0 @@ -global using System; - -global using KX12M = Migration.Toolkit.KX12.Models; diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs deleted file mode 100644 index ab71c6e3..00000000 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs +++ /dev/null @@ -1,392 +0,0 @@ -using CMS.Activities; -using CMS.ContactManagement; -using CMS.ContentEngine; - -using MediatR; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.Core.KX12.Helpers; -using Migration.Toolkit.Core.KX12.Services; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX12.Handlers; - -public class MigrateContactManagementCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - BulkDataCopyService bulkDataCopyService, - ToolkitConfiguration toolkitConfiguration, - PrimaryKeyMappingContext primaryKeyMappingContext, - KeyMappingContext keyMappingContext, - CountryMigrator countryMigrator, - KxpClassFacade kxpClassFacade, - ISpoiledGuidContext spoiledGuidContext, - IProtocol protocol -) - : IRequestHandler, IDisposable -{ - private readonly KxpContext kxpContext = kxpContextFactory.CreateDbContext(); - - public void Dispose() => kxpContext.Dispose(); - - public Task Handle(MigrateContactManagementCommand request, CancellationToken cancellationToken) - { - countryMigrator.MigrateCountriesAndStates(); - - if (MigrateContacts() is { } ccr) - { - return Task.FromResult(ccr); - } - - if (MigrateContactActivities() is { } acr) - { - return Task.FromResult(acr); - } - - return Task.FromResult(new GenericCommandResult()); - } - - #region "Migrate contacts" - - private CommandResult? MigrateContacts() - { - var requiredColumnsForContactMigration = new Dictionary - { - { nameof(KX12M.OmContact.ContactId), nameof(OmContact.ContactId) }, - { nameof(KX12M.OmContact.ContactFirstName), nameof(OmContact.ContactFirstName) }, - { nameof(KX12M.OmContact.ContactMiddleName), nameof(OmContact.ContactMiddleName) }, - { nameof(KX12M.OmContact.ContactLastName), nameof(OmContact.ContactLastName) }, - { nameof(KX12M.OmContact.ContactJobTitle), nameof(OmContact.ContactJobTitle) }, - { nameof(KX12M.OmContact.ContactAddress1), nameof(OmContact.ContactAddress1) }, - { nameof(KX12M.OmContact.ContactCity), nameof(OmContact.ContactCity) }, - { nameof(KX12M.OmContact.ContactZip), nameof(OmContact.ContactZip) }, - { nameof(KX12M.OmContact.ContactStateId), nameof(OmContact.ContactStateId) }, - { nameof(KX12M.OmContact.ContactCountryId), nameof(OmContact.ContactCountryId) }, - { nameof(KX12M.OmContact.ContactMobilePhone), nameof(OmContact.ContactMobilePhone) }, - { nameof(KX12M.OmContact.ContactBusinessPhone), nameof(OmContact.ContactBusinessPhone) }, - { nameof(KX12M.OmContact.ContactEmail), nameof(OmContact.ContactEmail) }, - // No support 2022-07-07 { nameof(OmContact.ContactBirthday), nameof(KXO.Models.OmContact.ContactBirthday) }, - { nameof(KX12M.OmContact.ContactGender), nameof(OmContact.ContactGender) }, - // { nameof(OmContact.ContactStatusId), nameof(KXO.Models.OmContact.ContactStatusId) }, // No support 2022-07-07 but needs to be mapped because of constraint - { nameof(KX12M.OmContact.ContactNotes), nameof(OmContact.ContactNotes) }, - { nameof(KX12M.OmContact.ContactOwnerUserId), nameof(OmContact.ContactOwnerUserId) }, - // No support 2022-07-07 { nameof(OmContact.ContactMonitored), nameof(KXO.Models.OmContact.ContactMonitored) }, - { nameof(KX12M.OmContact.ContactGuid), nameof(OmContact.ContactGuid) }, - { nameof(KX12M.OmContact.ContactLastModified), nameof(OmContact.ContactLastModified) }, - { nameof(KX12M.OmContact.ContactCreated), nameof(OmContact.ContactCreated) }, - // No support 2022-07-07 { nameof(OmContact.ContactBounces), nameof(KXO.Models.OmContact.ContactBounces) }, - { nameof(KX12M.OmContact.ContactCampaign), nameof(OmContact.ContactCampaign) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadId), nameof(KXO.Models.OmContact.ContactSalesForceLeadId) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDisabled), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDisabled) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDateTime) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationSuspensionDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationSuspensionDateTime) }, - { nameof(KX12M.OmContact.ContactCompanyName), nameof(OmContact.ContactCompanyName) } - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationRequired), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationRequired) }, - }; - - foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ContactInfo.TYPEINFO.ObjectClassName)) - { - requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); - } - - if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Contact")) - { - protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Contact")); - logger.LogError("Data must not exist in target instance table, remove data before proceeding"); - return new CommandFailureResult(); - } - - if (bulkDataCopyService.CheckForTableColumnsDifferences("OM_Contact", requiredColumnsForContactMigration, out var differences)) - { - protocol.Append(HandbookReferences - .BulkCopyColumnMismatch("OM_Contact") - .NeedsManualAction() - .WithData(differences) - ); - logger.LogError("Table {TableName} columns do not match, fix columns before proceeding", "OM_Contact"); - { - return new CommandFailureResult(); - } - } - - primaryKeyMappingContext.PreloadDependencies(u => u.UserId); - primaryKeyMappingContext.PreloadDependencies(u => u.StateId); - primaryKeyMappingContext.PreloadDependencies(u => u.CountryId); - - var bulkCopyRequest = new BulkCopyRequest("OM_Contact", - s => true, // s => s != "ContactID", - _ => true, - 50000, - requiredColumnsForContactMigration.Keys.ToList(), - ContactValueInterceptor, - current => logger.LogError("Contact skipped due error, contact: {Contact}", PrintHelper.PrintDictionary(current)), - "ContactID" - ); - - logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - try - { - bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to migrate contacts"); - return new CommandFailureResult(); - } - - return null; - } - - private ValueInterceptorResult ContactValueInterceptor(int ordinal, string columnName, object value, Dictionary currentRow) - { - if (columnName.Equals(nameof(OmContact.ContactCompanyName), StringComparison.InvariantCultureIgnoreCase)) - { - // autofix removed in favor of error report and data consistency - // var truncatedValue = SqlDataTypeHelper.TruncateString(value, 100); - // return new ValueInterceptorResult(truncatedValue, true, false); - - if (value is string { Length: > 100 } s) - { - protocol.Append(HandbookReferences.ValueTruncationSkip("OM_Contact") - .WithData(new - { - value, - maxLength = 100, - s.Length, - columnName, - contact = PrintHelper.PrintDictionary(currentRow) - }) - ); - return ValueInterceptorResult.SkipRow; - } - } - - if (columnName.Equals(nameof(OmContact.ContactOwnerUserId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceUserId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.UserId, sourceUserId)) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - // try search member - if (keyMappingContext.MapSourceKey( - s => s.UserId, - s => s.UserGuid, - sourceUserId, - t => t.MemberId, - t => t.MemberGuid - ) is { Success: true, Mapped: { } memberId }) - { - return ValueInterceptorResult.ReplaceValue(memberId); - } - - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - - default: - break; - } - } - - if (columnName.Equals(nameof(OmContact.ContactStateId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceStateId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.StateId, sourceStateId.NullIfZero())) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - - default: - break; - } - } - - if (columnName.Equals(nameof(OmContact.ContactCountryId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceCountryId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.CountryId, sourceCountryId.NullIfZero())) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - - default: - break; - } - } - - - return ValueInterceptorResult.DoNothing; - } - - #endregion - - #region "Migrate contact activities" - - private CommandResult? MigrateContactActivities() - { - var requiredColumnsForContactMigration = new Dictionary - { - { nameof(KX12M.OmActivity.ActivityId), nameof(OmActivity.ActivityId) }, - { nameof(KX12M.OmActivity.ActivityContactId), nameof(OmActivity.ActivityContactId) }, - { nameof(KX12M.OmActivity.ActivityCreated), nameof(OmActivity.ActivityCreated) }, - { nameof(KX12M.OmActivity.ActivityType), nameof(OmActivity.ActivityType) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityItemId), nameof(KXO.Models.OmActivity.ActivityItemId) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityItemDetailId), nameof(KXO.Models.OmActivity.ActivityItemDetailId) }, - { nameof(KX12M.OmActivity.ActivityValue), nameof(OmActivity.ActivityValue) }, - { nameof(KX12M.OmActivity.ActivityUrl), nameof(OmActivity.ActivityUrl) }, - { nameof(KX12M.OmActivity.ActivityTitle), nameof(OmActivity.ActivityTitle) }, - { nameof(KX12M.OmActivity.ActivitySiteId), nameof(OmActivity.ActivityChannelId) }, - { nameof(KX12M.OmActivity.ActivityComment), nameof(OmActivity.ActivityComment) }, - // { nameof(OmActivity.ActivityCampaign), nameof(KXP.Models.OmActivity.ActivityCampaign) }, // deprecated without replacement in v27 - { nameof(KX12M.OmActivity.ActivityUrlreferrer), nameof(OmActivity.ActivityUrlreferrer) }, - { nameof(KX12M.OmActivity.ActivityCulture), nameof(OmActivity.ActivityLanguageId) }, - { nameof(KX12M.OmActivity.ActivityNodeId), nameof(OmActivity.ActivityWebPageItemGuid) }, - { nameof(KX12M.OmActivity.ActivityUtmsource), nameof(OmActivity.ActivityUtmsource) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityAbvariantName), nameof(KXO.Models.OmActivity.ActivityAbvariantName) }, - // OBSOLETE 26.0.0: { nameof(OmActivity.ActivityUrlhash), nameof(KXP.Models.OmActivity.ActivityUrlhash) }, - { nameof(KX12M.OmActivity.ActivityUtmcontent), nameof(OmActivity.ActivityUtmcontent) } - }; - - foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ActivityInfo.TYPEINFO.ObjectClassName)) - { - requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); - } - - if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Activity")) - { - protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Activity")); - logger.LogError("Data must not exist in target instance table, remove data before proceeding"); - return new CommandFailureResult(); - } - - // _primaryKeyMappingContext.PreloadDependencies(u => u.NodeId); - // no need to preload contact, ID should stay same - // _primaryKeyMappingContext.PreloadDependencies(u => u.ContactId); - - var bulkCopyRequest = new BulkCopyRequestExtended("OM_Activity", - s => true, - reader => true, - 50000, - requiredColumnsForContactMigration, - ActivityValueInterceptor, - current => logger.LogError("Contact activity skipped due error, activity: {Activity}", PrintHelper.PrintDictionary(current)), - "ActivityID" - ); - - logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - - try - { - bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to migrate activities"); - return new CommandFailureResult(); - } - - return null; - } - - private ValueInterceptorResult ActivityValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow) - { - if (columnName.Equals(nameof(KX12M.OmActivity.ActivitySiteId), StringComparison.InvariantCultureIgnoreCase) && - value is int sourceActivitySiteId) - { - var result = keyMappingContext.MapSourceKey( - s => s.SiteId, - s => s.SiteGuid, - sourceActivitySiteId.NullIfZero(), - t => t.ChannelId, - t => t.ChannelGuid - ); - switch (result) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id ?? 0); - case { Success: false }: - { - switch (toolkitConfiguration.UseOmActivitySiteRelationAutofix ?? AutofixEnum.Error) - { - case AutofixEnum.DiscardData: - logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => discard data", sourceActivitySiteId); - return ValueInterceptorResult.SkipRow; - case AutofixEnum.AttemptFix: - logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => ActivityNodeId=0", sourceActivitySiteId); - return ValueInterceptorResult.ReplaceValue(0); - case AutofixEnum.Error: - default: //error - protocol.Append(HandbookReferences - .MissingRequiredDependency(columnName, value) - .WithData(currentRow) - ); - return ValueInterceptorResult.SkipRow; - } - } - - default: - break; - } - } - - if (columnName.Equals(nameof(KX12M.OmActivity.ActivityNodeId), StringComparison.InvariantCultureIgnoreCase) && value is int activityNodeId) - { - if (currentRow.TryGetValue(nameof(KX12M.OmActivity.ActivitySiteId), out object? mSiteId) && mSiteId is int siteId) - { - if (spoiledGuidContext.GetNodeGuid(siteId, activityNodeId) is { } nodeGuid) - { - return ValueInterceptorResult.ReplaceValue(nodeGuid); - } - } - - switch (toolkitConfiguration.UseOmActivityNodeRelationAutofix ?? AutofixEnum.Error) - { - case AutofixEnum.DiscardData: - logger.LogTrace("Autofix (ActivitySiteId={NodeId} not exists) => discard data", activityNodeId); - return ValueInterceptorResult.SkipRow; - case AutofixEnum.AttemptFix: - logger.LogTrace("Autofix (ActivityNodeId={NodeId} not exists) => ActivityNodeId=0", activityNodeId); - return ValueInterceptorResult.ReplaceValue(null); - case AutofixEnum.Error: - default: //error - protocol.Append(HandbookReferences - .MissingRequiredDependency(columnName, value) - .WithData(currentRow) - ); - return ValueInterceptorResult.SkipRow; - } - } - - if (columnName.Equals(nameof(OmActivity.ActivityLanguageId), StringComparison.InvariantCultureIgnoreCase) && value is string cultureCode) - { - return ValueInterceptorResult.ReplaceValue(ContentLanguageInfoProvider.ProviderObject.Get(cultureCode)?.ContentLanguageID); - } - - return ValueInterceptorResult.DoNothing; - } - - #endregion -} diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs deleted file mode 100644 index 746320b2..00000000 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs +++ /dev/null @@ -1,281 +0,0 @@ -using CMS.DataProtection; - -using MediatR; - -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX12.Handlers; - -public class MigrateDataProtectionCommandHandler : IRequestHandler, IDisposable -{ - private static readonly int batchSize = 1000; - private readonly IEntityMapper consentAgreementMapper; - private readonly IEntityMapper consentArchiveMapper; - private readonly IEntityMapper consentMapper; - private readonly IDbContextFactory kx12ContextFactory; - private readonly IDbContextFactory kxpContextFactory; - private readonly ILogger logger; - private readonly PrimaryKeyMappingContext primaryKeyMappingContext; - private readonly IProtocol protocol; - - private KxpContext kxpContext; - - public MigrateDataProtectionCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx12ContextFactory, - IEntityMapper consentMapper, - IEntityMapper consentArchiveMapper, - IEntityMapper consentAgreementMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) - { - this.logger = logger; - this.kxpContextFactory = kxpContextFactory; - this.kx12ContextFactory = kx12ContextFactory; - this.consentMapper = consentMapper; - this.consentArchiveMapper = consentArchiveMapper; - this.consentAgreementMapper = consentAgreementMapper; - this.primaryKeyMappingContext = primaryKeyMappingContext; - this.protocol = protocol; - kxpContext = this.kxpContextFactory.CreateDbContext(); - } - - public void Dispose() => kxpContext.Dispose(); - - public async Task Handle(MigrateDataProtectionCommand request, CancellationToken cancellationToken) - { - await MigrateConsent(cancellationToken); - await MigrateConsentArchive(cancellationToken); - await MigrateConsentAgreement(cancellationToken, batchSize); - - return new GenericCommandResult(); - } - - private async Task MigrateConsent(CancellationToken cancellationToken) - { - await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); - - foreach (var k12Consent in kx12Context.CmsConsents) - { - protocol.FetchedSource(k12Consent); - logger.LogTrace("Migrating consent {ConsentName} with ConsentGuid {ConsentGuid}", k12Consent.ConsentName, k12Consent.ConsentGuid); - - var kxoConsent = await kxpContext.CmsConsents.FirstOrDefaultAsync(consent => consent.ConsentGuid == k12Consent.ConsentGuid, cancellationToken); - protocol.FetchedTarget(kxoConsent); - - var mapped = consentMapper.Map(k12Consent, kxoConsent); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - (var cmsConsent, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsent, nameof(cmsConsent)); - - if (newInstance) - { - kxpContext.CmsConsents.Add(cmsConsent); - } - else - { - kxpContext.CmsConsents.Update(cmsConsent); - } - - try - { - await kxpContext.SaveChangesAsync(cancellationToken); - - protocol.Success(k12Consent, cmsConsent, mapped); - logger.LogEntitySetAction(newInstance, cmsConsent); - primaryKeyMappingContext.SetMapping(r => r.ConsentId, k12Consent.ConsentId, cmsConsent.ConsentId); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, k12Consent); - protocol.Append(HandbookReferences - .DbConstraintBroken(sqlException, k12Consent) - .WithMessage("Failed to migrate consent, target database constraint broken.") - ); - - await kxpContext.DisposeAsync(); - kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - } - } - - return new GenericCommandResult(); - } - - private async Task MigrateConsentArchive(CancellationToken cancellationToken) - { - await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); - - foreach (var k12ArchiveConsent in kx12Context.CmsConsentArchives) - { - protocol.FetchedSource(k12ArchiveConsent); - logger.LogTrace("Migrating consent archive with ConsentArchiveGuid {ConsentGuid}", k12ArchiveConsent.ConsentArchiveGuid); - - var kxoConsentArchive = await kxpContext.CmsConsentArchives.FirstOrDefaultAsync(consentArchive => consentArchive.ConsentArchiveGuid == k12ArchiveConsent.ConsentArchiveGuid, cancellationToken); - protocol.FetchedTarget(kxoConsentArchive); - - var mapped = consentArchiveMapper.Map(k12ArchiveConsent, kxoConsentArchive); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - (var cmsConsentArchive, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsentArchive, nameof(cmsConsentArchive)); - - if (newInstance) - { - kxpContext.CmsConsentArchives.Add(cmsConsentArchive); - } - else - { - kxpContext.CmsConsentArchives.Update(cmsConsentArchive); - } - - try - { - await kxpContext.SaveChangesAsync(cancellationToken); - - protocol.Success(k12ArchiveConsent, cmsConsentArchive, mapped); - logger.LogEntitySetAction(newInstance, cmsConsentArchive); - primaryKeyMappingContext.SetMapping(r => r.ConsentArchiveGuid, - k12ArchiveConsent.ConsentArchiveId, cmsConsentArchive.ConsentArchiveId); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, k12ArchiveConsent); - protocol.Append(HandbookReferences - .DbConstraintBroken(sqlException, k12ArchiveConsent) - .WithMessage("Failed to migrate consent archive, target database constraint broken.") - ); - - await kxpContext.DisposeAsync(); - kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - } - } - - return new GenericCommandResult(); - } - - private async Task MigrateConsentAgreement(CancellationToken cancellationToken, int batchSize) - { - await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); - int index = 0; - int indexFull = 0; - var consentAgreementUpdates = new List(); - var consentAgreementNews = new List(); - int itemsCount = kx12Context.CmsConsentAgreements.Count(); - - foreach (var k12ConsentAgreement in kx12Context.CmsConsentAgreements) - { - protocol.FetchedSource(k12ConsentAgreement); - logger.LogTrace("Migrating consent agreement with ConsentAgreementGuid {ConsentAgreementGuid}", k12ConsentAgreement.ConsentAgreementGuid); - - var kxoConsentAgreement = await kxpContext.CmsConsentAgreements.FirstOrDefaultAsync(consentAgreement => consentAgreement.ConsentAgreementGuid == k12ConsentAgreement.ConsentAgreementGuid, cancellationToken); - protocol.FetchedTarget(kxoConsentAgreement); - - var mapped = consentAgreementMapper.Map(k12ConsentAgreement, kxoConsentAgreement); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - (var cmsConsentAgreement, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsentAgreement, nameof(cmsConsentAgreement)); - - if (newInstance) - { - consentAgreementNews.Add(cmsConsentAgreement); - } - else - { - consentAgreementUpdates.Add(cmsConsentAgreement); - } - } - - index++; - indexFull++; - - if (index == batchSize || indexFull == itemsCount) - { - kxpContext.CmsConsentAgreements.AddRange(consentAgreementNews); - kxpContext.CmsConsentAgreements.UpdateRange(consentAgreementUpdates); - - try - { - await kxpContext.SaveChangesAsync(cancellationToken); - - foreach (var newK12ConsentAgreement in consentAgreementNews) - { - protocol.Success(k12ConsentAgreement, newK12ConsentAgreement, mapped); - logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was inserted", - newK12ConsentAgreement.ConsentAgreementGuid); - } - - foreach (var updateK12ConsentAgreement in consentAgreementUpdates) - { - protocol.Success(k12ConsentAgreement, updateK12ConsentAgreement, mapped); - logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was updated", - updateK12ConsentAgreement.ConsentAgreementGuid); - } - } - catch (DbUpdateException dbUpdateException) when ( - dbUpdateException.InnerException is SqlException sqlException && - sqlException.Message.Contains("Cannot insert duplicate key row in object") - ) - { - await kxpContext.DisposeAsync(); - - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrints(consentAgreementNews) - ); - logger.LogEntitiesSetError(dbUpdateException, true, consentAgreementNews); - - - protocol.Append(HandbookReferences - .ErrorUpdatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrints(consentAgreementUpdates) - ); - - var cai = ConsentAgreementInfo.New(); - protocol.Append(HandbookReferences - .ErrorUpdatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrint(cai) - ); - - logger.LogEntitiesSetError(dbUpdateException, false, consentAgreementUpdates); - - kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - finally - { - index = 0; - consentAgreementUpdates = []; - consentAgreementNews = []; - } - } - } - - return new GenericCommandResult(); - } -} diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateMembersCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateMembersCommandHandler.cs deleted file mode 100644 index ae977144..00000000 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateMembersCommandHandler.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System.Diagnostics; - -using CMS.Membership; - -using MediatR; - -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.Core.KX12.Mappers; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KXP.Api.Enums; - -namespace Migration.Toolkit.Core.KX12.Handlers; - -public class MigrateMembersCommandHandler( - ILogger logger, - IDbContextFactory kx12ContextFactory, - IEntityMapper memberInfoMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private const string USER_PUBLIC = "public"; - - public void Dispose() - { - } - - public async Task Handle(MigrateMembersCommand request, CancellationToken cancellationToken) - { - await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); - - var k12CmsUsers = kx12Context.CmsUsers - .Include(u => u.CmsUserSettingUserSettingsUserNavigation) - .Where(u => u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.None) - ; - - foreach (var k12User in k12CmsUsers) - { - protocol.FetchedSource(k12User); - logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid} to member", k12User.UserName, k12User.UserGuid); - - var xbkMemberInfo = MemberInfoProvider.ProviderObject.Get(k12User.UserGuid); - - protocol.FetchedTarget(xbkMemberInfo); - - // no member shall be admin, editor - Debug.Assert(k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin, "k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin"); - Debug.Assert(k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin, "k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin"); - Debug.Assert(k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor, "k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor"); - - if (xbkMemberInfo?.MemberName == USER_PUBLIC || k12User.UserName == USER_PUBLIC) - { - continue; - } - - var mapped = memberInfoMapper.Map(new MemberInfoMapperSource(k12User, k12User.CmsUserSettingUserSettingsUserNavigation), xbkMemberInfo); - protocol.MappedTarget(mapped); - - SaveUserUsingKenticoApi(mapped, k12User); - } - - return new GenericCommandResult(); - } - - private void SaveUserUsingKenticoApi(IModelMappingResult mapped, KX12M.CmsUser k12User) - { - if (mapped is { Success: true } result) - { - (var memberInfo, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(memberInfo); - - try - { - MemberInfoProvider.ProviderObject.Set(memberInfo); - - protocol.Success(k12User, memberInfo, mapped); - logger.LogEntitySetAction(newInstance, memberInfo); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, memberInfo); - protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k12User) - .WithData(new { k12User.UserName, k12User.UserGuid, k12User.UserId }) - .WithMessage("Failed to migrate user, target database broken.") - ); - return; - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, memberInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(memberInfo) - ); - return; - } - - // left for OM_Activity - primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, memberInfo.MemberID); - } - } -} diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs deleted file mode 100644 index 12e365b1..00000000 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs +++ /dev/null @@ -1,84 +0,0 @@ -using CMS.DataEngine; - -using MediatR; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KX12.Context; - -namespace Migration.Toolkit.Core.KX12.Handlers; - -public class MigrateSettingKeysCommandHandler( - ILogger logger, - IEntityMapper mapper, - IDbContextFactory kx12ContextFactory, - ToolkitConfiguration toolkitConfiguration, - IProtocol protocol) - : IRequestHandler -{ - public async Task Handle(MigrateSettingKeysCommand request, CancellationToken cancellationToken) - { - var entityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); - - await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); - - logger.LogInformation("CmsSettingsKey synchronization starting"); - var cmsSettingsKeys = kx12Context.CmsSettingsKeys - .Where(csk => csk.SiteId == null) - .AsNoTrackingWithIdentityResolution() - ; - - foreach (var k12CmsSettingsKey in cmsSettingsKeys) - { - protocol.FetchedSource(k12CmsSettingsKey); - - var kxoGlobalSettingsKey = GetKxoSettingsKey(k12CmsSettingsKey); - - bool canBeMigrated = !kxoGlobalSettingsKey?.KeyIsHidden ?? false; - var kxoCmsSettingsKey = k12CmsSettingsKey.SiteId is null ? kxoGlobalSettingsKey : GetKxoSettingsKey(k12CmsSettingsKey); - - if (!canBeMigrated) - { - logger.LogInformation("Setting with key '{KeyName}' is currently not supported for migration", k12CmsSettingsKey.KeyName); - protocol.Append( - HandbookReferences - .NotCurrentlySupportedSkip() - .WithId(nameof(k12CmsSettingsKey.KeyId), k12CmsSettingsKey.KeyId) - .WithMessage("Settings key is not supported in target instance") - .WithData(new { k12CmsSettingsKey.KeyName, k12CmsSettingsKey.SiteId, k12CmsSettingsKey.KeyGuid }) - ); - continue; - } - - protocol.FetchedTarget(kxoCmsSettingsKey); - - if (entityConfiguration.ExcludeCodeNames.Contains(k12CmsSettingsKey.KeyName)) - { - protocol.Warning(HandbookReferences.CmsSettingsKeyExclusionListSkip, k12CmsSettingsKey); - logger.LogWarning("KeyName {KeyName} is excluded => skipping", k12CmsSettingsKey.KeyName); - continue; - } - - var mapped = mapper.Map(k12CmsSettingsKey, kxoCmsSettingsKey); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - ArgumentNullException.ThrowIfNull(result.Item, nameof(result.Item)); - - SettingsKeyInfoProvider.ProviderObject.Set(result.Item); - - protocol.Success(k12CmsSettingsKey, kxoCmsSettingsKey, mapped); - logger.LogEntitySetAction(result.NewInstance, result.Item); - } - } - - return new GenericCommandResult(); - } - - private SettingsKeyInfo? GetKxoSettingsKey(KX12M.CmsSettingsKey k12CmsSettingsKey) => SettingsKeyInfoProvider.ProviderObject.Get(k12CmsSettingsKey.KeyName); -} diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateSitesCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateSitesCommandHandler.cs deleted file mode 100644 index ff88afc7..00000000 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateSitesCommandHandler.cs +++ /dev/null @@ -1,190 +0,0 @@ -using CMS.ContentEngine; -using CMS.Websites; - -using Kentico.Xperience.UMT.Model; -using Kentico.Xperience.UMT.Services; - -using MediatR; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Helpers; -using Migration.Toolkit.KX12; -using Migration.Toolkit.KX12.Context; - -namespace Migration.Toolkit.Core.KX12.Handlers; - -// ReSharper disable once UnusedType.Global -public class MigrateSitesCommandHandler( - ILogger logger, - IDbContextFactory kx12ContextFactory, - IProtocol protocol, - IImporter importer) - : IRequestHandler -{ - public async Task Handle(MigrateSitesCommand request, CancellationToken cancellationToken) - { - await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); - var migratedCultureCodes = new Dictionary(StringComparer.CurrentCultureIgnoreCase); - foreach (var kx12CmsSite in kx12Context.CmsSites.Include(s => s.Cultures)) - { - protocol.FetchedSource(kx12CmsSite); - logger.LogTrace("Migrating site {SiteName} with SiteGuid {SiteGuid}", kx12CmsSite.SiteName, kx12CmsSite.SiteGuid); - - string defaultCultureCode = GetSiteCulture(kx12CmsSite); - var migratedSiteCultures = kx12CmsSite.Cultures.ToList(); - if (!migratedSiteCultures.Any(x => x.CultureCode.Equals(defaultCultureCode, StringComparison.InvariantCultureIgnoreCase))) - { - await using var ctx = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); - if (ctx.CmsCultures.FirstOrDefault(c => c.CultureCode == defaultCultureCode) is { } defaultCulture) - { - migratedSiteCultures.Add(defaultCulture); - } - } - - foreach (var cmsCulture in migratedSiteCultures) - { - var existing = ContentLanguageInfoProvider.ProviderObject.Get() - .WhereEquals(nameof(ContentLanguageInfo.ContentLanguageCultureFormat), cmsCulture.CultureCode) - .FirstOrDefault(); - - if (existing != null && existing.ContentLanguageGUID != cmsCulture.CultureGuid) - { - existing.ContentLanguageGUID = cmsCulture.CultureGuid; - existing.Update(); - } - - if (migratedCultureCodes.ContainsKey(cmsCulture.CultureCode)) - { - continue; - } - - var langResult = await importer.ImportAsync(new ContentLanguageModel - { - ContentLanguageGUID = cmsCulture.CultureGuid, - ContentLanguageDisplayName = cmsCulture.CultureName, - ContentLanguageName = cmsCulture.CultureCode, - ContentLanguageIsDefault = true, - ContentLanguageFallbackContentLanguageGuid = null, - ContentLanguageCultureFormat = cmsCulture.CultureCode - }); - - if (langResult is { Success: true, Imported: ContentLanguageInfo importedLanguage }) - { - migratedCultureCodes.TryAdd(cmsCulture.CultureCode, importedLanguage); - logger.LogTrace("Imported language {Language} from {Culture}", importedLanguage.ContentLanguageName, cmsCulture.CultureCode); - } - } - - // var homePageNodeAliasPath = KenticoHelper.GetSettingsKey(_kx12ContextFactory, kx12CmsSite.SiteId, SettingsKeys.CMSDefaultAliasPath); - int? cookieLevel = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, SettingsKeys.CMSDefaultCookieLevel) switch - { - "all" => CookieLevelConstants.ALL, - "visitor" => CookieLevelConstants.VISITOR, - "editor" => CookieLevelConstants.EDITOR, - "system" => CookieLevelConstants.SYSTEM, - "essential" => CookieLevelConstants.ESSENTIAL, - _ => null - }; - bool? storeFormerUrls = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSStoreFormerUrls") is string storeFormerUrlsStr - ? bool.TryParse(storeFormerUrlsStr, out bool sfu) ? sfu : null - : true; - - var channelResult = await importer.ImportAsync(new ChannelModel { ChannelDisplayName = kx12CmsSite.SiteDisplayName, ChannelName = kx12CmsSite.SiteName, ChannelGUID = kx12CmsSite.SiteGuid, ChannelType = ChannelType.Website }); - - var webSiteChannelResult = await importer.ImportAsync(new WebsiteChannelModel - { - WebsiteChannelGUID = kx12CmsSite.SiteGuid, - WebsiteChannelChannelGuid = kx12CmsSite.SiteGuid, - WebsiteChannelDomain = kx12CmsSite.SiteDomainName, - // WebsiteChannelHomePage = homePageNodeAliasPath, - WebsiteChannelPrimaryContentLanguageGuid = migratedCultureCodes[defaultCultureCode].ContentLanguageGUID, - WebsiteChannelDefaultCookieLevel = cookieLevel, - WebsiteChannelStoreFormerUrls = storeFormerUrls - }); - - if (!webSiteChannelResult.Success) - { - if (webSiteChannelResult.ModelValidationResults != null) - { - foreach (var mvr in webSiteChannelResult.ModelValidationResults) - { - logger.LogError("Invalid channel properties {Members}: {ErrorMessage}", string.Join(", ", mvr.MemberNames), mvr.ErrorMessage); - } - } - else - { - logger.LogError(webSiteChannelResult.Exception, "Failed to migrate site"); - } - - return new CommandFailureResult(); - } - - if (webSiteChannelResult.Imported is WebsiteChannelInfo webSiteChannel) - { - string? cmsReCaptchaPublicKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSReCaptchaPublicKey"); - string? cmsReCaptchaPrivateKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSReCaptchaPrivateKey"); - - WebsiteCaptchaSettingsInfo? reCaptchaSettings = null; - string? cmsReCaptchaV3PrivateKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSReCaptchaV3PrivateKey"); - string? cmsRecaptchaV3PublicKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSRecaptchaV3PublicKey"); - double? cmsRecaptchaV3Threshold = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSRecaptchaV3Threshold"); - - if (!string.IsNullOrWhiteSpace(cmsReCaptchaV3PrivateKey) || !string.IsNullOrWhiteSpace(cmsRecaptchaV3PublicKey)) - { - reCaptchaSettings = new WebsiteCaptchaSettingsInfo - { - WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, - WebsiteCaptchaSettingsReCaptchaSiteKey = cmsRecaptchaV3PublicKey, - WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaV3PrivateKey, - WebsiteCaptchaSettingsReCaptchaThreshold = cmsRecaptchaV3Threshold ?? 0.5d, - WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV3 - }; - } - - if (!string.IsNullOrWhiteSpace(cmsReCaptchaPublicKey) || !string.IsNullOrWhiteSpace(cmsReCaptchaPrivateKey)) - { - if (reCaptchaSettings is not null) - { - logger.LogError(""" - Conflicting settings found, ReCaptchaV2 and ReCaptchaV3 is set simultaneously. - Remove setting keys 'CMSReCaptchaPublicKey', 'CMSReCaptchaPrivateKey' - or remove setting keys 'CMSReCaptchaV3PrivateKey', 'CMSRecaptchaV3PublicKey', 'CMSRecaptchaV3Threshold'. - """); - throw new InvalidOperationException("Invalid ReCaptcha settings"); - } - - reCaptchaSettings = new WebsiteCaptchaSettingsInfo - { - WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, - WebsiteCaptchaSettingsReCaptchaSiteKey = cmsReCaptchaPublicKey, - WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaPrivateKey, - WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV2 - }; - } - - if (reCaptchaSettings != null) - { - WebsiteCaptchaSettingsInfo.Provider.Set(reCaptchaSettings); - } - } - } - - return new GenericCommandResult(); - } - - private string GetSiteCulture(KX12M.CmsSite site) - { - // simplified logic from CMS.DocumentEngine.DefaultPreferredCultureEvaluator.Evaluate() - // domain alias skipped, HttpContext logic skipped - string? siteCulture = site.SiteDefaultVisitorCulture.NullIf(string.Empty) - ?? KenticoHelper.GetSettingsKey(kx12ContextFactory, site.SiteId, SettingsKeys.CMSDefaultCultureCode); - - return siteCulture - ?? throw new InvalidOperationException("Unknown site culture"); - } -} diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateUsersCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateUsersCommandHandler.cs deleted file mode 100644 index 2783eaea..00000000 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateUsersCommandHandler.cs +++ /dev/null @@ -1,234 +0,0 @@ -using CMS.Membership; - -using MediatR; - -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KXP.Api.Enums; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX12.Handlers; - -public class MigrateUsersCommandHandler( - ILogger logger, - IDbContextFactory kx12ContextFactory, - IEntityMapper userInfoMapper, - IEntityMapper roleMapper, - IEntityMapper userRoleMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private const string USER_PUBLIC = "public"; - - public void Dispose() - { - } - - public async Task Handle(MigrateUsersCommand request, CancellationToken cancellationToken) - { - await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); - - var k12CmsUsers = kx12Context.CmsUsers - .Where(u => u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) - ; - - foreach (var k12User in k12CmsUsers) - { - protocol.FetchedSource(k12User); - logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid}", k12User.UserName, k12User.UserGuid); - - var xbkUserInfo = UserInfoProvider.ProviderObject.Get(k12User.UserGuid); - - protocol.FetchedTarget(xbkUserInfo); - - if (k12User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin && xbkUserInfo != null) - { - protocol.Append(HandbookReferences.CmsUserAdminUserSkip.WithIdentityPrint(xbkUserInfo)); - logger.LogInformation("User with guid {UserGuid} is administrator, you need to update administrators manually => skipping", k12User.UserGuid); - primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, xbkUserInfo.UserID); - continue; - } - - if (xbkUserInfo?.UserName == USER_PUBLIC || k12User.UserName == USER_PUBLIC) - { - protocol.Append(HandbookReferences.CmsUserPublicUserSkip.WithIdentityPrint(xbkUserInfo)); - logger.LogInformation("User with guid {UserGuid} is public user, special case that can't be migrated => skipping", xbkUserInfo?.UserGUID ?? k12User.UserGuid); - if (xbkUserInfo != null) - { - primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, xbkUserInfo.UserID); - } - - continue; - } - - var mapped = userInfoMapper.Map(k12User, xbkUserInfo); - protocol.MappedTarget(mapped); - - SaveUserUsingKenticoApi(mapped, k12User); - } - - await MigrateUserCmsRoles(kx12Context, cancellationToken); - - return new GenericCommandResult(); - } - - private void SaveUserUsingKenticoApi(IModelMappingResult mapped, KX12M.CmsUser k12User) - { - if (mapped is { Success: true } result) - { - (var userInfo, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(userInfo); - - try - { - UserInfoProvider.ProviderObject.Set(userInfo); - - protocol.Success(k12User, userInfo, mapped); - logger.LogEntitySetAction(newInstance, userInfo); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, userInfo); - protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k12User) - .WithData(new { k12User.UserName, k12User.UserGuid, k12User.UserId }) - .WithMessage("Failed to migrate user, target database broken.") - ); - return; - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, userInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(userInfo) - ); - return; - } - - primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, userInfo.UserID); - } - } - - private async Task MigrateUserCmsRoles(KX12Context kx12Context, CancellationToken cancellationToken) - { - var k12CmsRoles = kx12Context.CmsRoles - .Where(r => - r.CmsUserRoles.Any(ur => ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) - ) - .AsNoTracking() - .AsAsyncEnumerable(); - - await foreach (var k12CmsRole in k12CmsRoles.WithCancellation(cancellationToken)) - { - protocol.FetchedSource(k12CmsRole); - - var xbkRoleInfo = RoleInfoProvider.ProviderObject.Get(k12CmsRole.RoleGuid); - protocol.FetchedTarget(xbkRoleInfo); - var mapped = roleMapper.Map(k12CmsRole, xbkRoleInfo); - protocol.MappedTarget(mapped); - - if (mapped is not (var roleInfo, var newInstance) { Success: true }) - { - continue; - } - - ArgumentNullException.ThrowIfNull(roleInfo, nameof(roleInfo)); - try - { - RoleInfoProvider.ProviderObject.Set(roleInfo); - - protocol.Success(k12CmsRole, roleInfo, mapped); - logger.LogEntitySetAction(newInstance, roleInfo); - - primaryKeyMappingContext.SetMapping( - r => r.RoleId, - k12CmsRole.RoleId, - roleInfo.RoleID - ); - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, roleInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(roleInfo) - ); - continue; - } - - await MigrateUserRole(k12CmsRole.RoleId); - } - } - - private async Task MigrateUserRole(int k12RoleId) - { - var kx12Context = await kx12ContextFactory.CreateDbContextAsync(); - var k12UserRoles = kx12Context.CmsUserRoles - .Where(ur => - ur.RoleId == k12RoleId && ( - ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin - ) - ) - .AsNoTracking() - .AsAsyncEnumerable(); - - await foreach (var k12UserRole in k12UserRoles) - { - protocol.FetchedSource(k12UserRole); - if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.RoleId, k12RoleId, out int xbkRoleId)) - { - var handbookRef = HandbookReferences - .MissingRequiredDependency(nameof(UserRoleInfo.RoleID), k12UserRole.RoleId) - .NeedsManualAction(); - - protocol.Append(handbookRef); - logger.LogWarning("Unable to locate role in target instance with source RoleID '{RoleID}'", k12UserRole.RoleId); - continue; - } - - if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.UserId, k12UserRole.UserId, out int xbkUserId)) - { - continue; - } - - var xbkUserRole = UserRoleInfoProvider.ProviderObject.Get(xbkUserId, xbkRoleId); - protocol.FetchedTarget(xbkUserRole); - - var mapped = userRoleMapper.Map(k12UserRole, xbkUserRole); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true }) - { - (var userRoleInfo, bool newInstance) = mapped; - ArgumentNullException.ThrowIfNull(userRoleInfo); - - try - { - UserRoleInfoProvider.ProviderObject.Set(userRoleInfo); - - protocol.Success(k12UserRole, userRoleInfo, mapped); - logger.LogEntitySetAction(newInstance, userRoleInfo); - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, userRoleInfo); - protocol.Append(HandbookReferences.ErrorSavingTargetInstance(ex) - .WithData(new { k12UserRole.UserRoleId, k12UserRole.UserId, k12UserRole.RoleId }) - .WithMessage("Failed to migrate user role") - ); - } - } - } - } -} diff --git a/Migration.Toolkit.Core.KX12/Helpers/KenticoHelper.cs b/Migration.Toolkit.Core.KX12/Helpers/KenticoHelper.cs deleted file mode 100644 index 821fc479..00000000 --- a/Migration.Toolkit.Core.KX12/Helpers/KenticoHelper.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Globalization; - -using CMS.Helpers; - -using Microsoft.EntityFrameworkCore; - -using Migration.Toolkit.KX12.Context; - -namespace Migration.Toolkit.Core.KX12.Helpers; - -public static class KenticoHelper -{ - public static void CopyCustomData(ContainerCustomData target, string? sourceXml) - { - var customNodeData = new ContainerCustomData(); - customNodeData.LoadData(sourceXml); - foreach (string? columnName in customNodeData.ColumnNames) - { - target.SetValue(columnName, customNodeData.GetValue(columnName)); - } - } - - public static string? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) - { - using var kx12Context = ctxf.CreateDbContext(); - var keys = kx12Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); - - return (keys.FirstOrDefault(x => x.SiteId == siteId) - ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; - } - - public static T? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) where T : struct, IParsable - { - using var kx12Context = ctxf.CreateDbContext(); - var keys = kx12Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); - string? value = (keys.FirstOrDefault(x => x.SiteId == siteId) - ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; - - - return T.TryParse(value, CultureInfo.InvariantCulture, out var result) - ? result - : null; - } - - public static bool? TryGetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName, out T? result) where T : IParsable => T.TryParse(GetSettingsKey(ctxf, siteId, keyName), CultureInfo.InvariantCulture, out result); -} diff --git a/Migration.Toolkit.Core.KX12/Helpers/PrintHelper.cs b/Migration.Toolkit.Core.KX12/Helpers/PrintHelper.cs deleted file mode 100644 index c136dac6..00000000 --- a/Migration.Toolkit.Core.KX12/Helpers/PrintHelper.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Migration.Toolkit.Core.KX12.Helpers; - -public static class PrintHelper -{ - public static string PrintDictionary(Dictionary dictionary) => - string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); -} diff --git a/Migration.Toolkit.Core.KX12/Helpers/Printer.cs b/Migration.Toolkit.Core.KX12/Helpers/Printer.cs deleted file mode 100644 index aada412c..00000000 --- a/Migration.Toolkit.Core.KX12/Helpers/Printer.cs +++ /dev/null @@ -1,103 +0,0 @@ -using CMS.DataEngine; -using CMS.FormEngine; -using CMS.Globalization; -using CMS.MediaLibrary; -using CMS.Membership; -using CMS.Modules; - -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX12.Helpers; - -public class Printer -{ - public static string PrintKxpModelInfo(T model) - { - string currentTypeName = ReflectionHelper.CurrentType.Name; - - return model switch - { - MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", - MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", - CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", - CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", - CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", - CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", - CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", - CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", - OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", - - null => $"{currentTypeName}: ", - _ => $"TODO: {typeof(T).FullName}" - }; - } - - public static string GetEntityIdentityPrint(T model, bool printType = true) - { - string currentTypeName = ReflectionHelper.CurrentType.Name; - - string Fallback(object obj) => printType - ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" - : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}"; - - string FormatModel(string inner) => printType - ? $"{currentTypeName}({inner})" - : $"{inner}"; - - return model switch - { - MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), - MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), - DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), - - CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), - StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), - - ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), - AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), - UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), - RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), - MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), - - CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), - CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), - CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), - - KX12M.CmsPageTemplateConfiguration item => FormatModel($"ID={item.PageTemplateConfigurationId}, GUID={item.PageTemplateConfigurationGuid}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteId}"), - KX12M.CmsRole item => FormatModel($"ID={item.RoleId}, GUID={item.RoleGuid}, Name={item.RoleName}, SiteId={item.SiteId}"), - KX12M.CmsAttachment item => FormatModel($"ID={item.AttachmentId}, GUID={item.AttachmentGuid}, Name={item.AttachmentName}"), - KX12M.CmsClass item => FormatModel($"ID={item.ClassId}, GUID={item.ClassGuid}, Name={item.ClassName}"), - KX12M.CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - KX12M.CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - KX12M.CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - KX12M.CmsCountry item => FormatModel($"ID={item.CountryId}, GUID={item.CountryGuid}, Name={item.CountryName}"), - KX12M.CmsState item => FormatModel($"ID={item.StateId}, GUID={item.StateGuid}, Name={item.StateName}"), - KX12M.CmsTree item => FormatModel($"NodeID={item.NodeId}, NodeGUID={item.NodeGuid}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), - KX12M.CmsDocument item => FormatModel($"NodeID={item.DocumentNodeId}, DocumentID={item.DocumentId}, DocumentGUID={item.DocumentGuid}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), - KX12M.CmsResource item => FormatModel($"ID={item.ResourceId}, GUID={item.ResourceGuid}, Name={item.ResourceName}"), - - null => $" ref of {currentTypeName}", - _ => Fallback(model) - }; - } - - public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); - - public static string PrintEnumValues(string separator) where TEnum : struct, Enum => string.Join(separator, Enum.GetValues()); -} - -public class PrintService : IPrintService -{ - public string PrintKxpModelInfo(T model) => Printer.PrintKxpModelInfo(model); - - public string GetEntityIdentityPrint(T model, bool printType = true) => Printer.GetEntityIdentityPrint(model, printType); - - public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => Printer.GetEntityIdentityPrints(models, separator); - - public string PrintEnumValues(string separator) where TEnum : struct, Enum => Printer.PrintEnumValues(separator); -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/AlternativeFormMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/AlternativeFormMapper.cs deleted file mode 100644 index 1f41944e..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/AlternativeFormMapper.cs +++ /dev/null @@ -1,90 +0,0 @@ -using CMS.DataEngine; -using CMS.FormEngine; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Api.Services.CmsClass; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public record AlternativeFormMapperSource(KX12M.CmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); - -public class AlternativeFormMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, FieldMigrationService fieldMigrationService) - : EntityMapperBase(logger, pkContext, protocol) -{ - protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - => AlternativeFormInfo.New(); - - protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (source, xbkFormClass) = sourceObj; - - target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormClassId, out int? classId) - ? classId ?? 0 - : 0; - target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormCoupledClassId, out int? coupledClassId) - ? coupledClassId ?? 0 - : 0; - - bool coupledClassIsDeprecated = - source.FormCoupledClass?.ClassName is { } coupledClassName && - K12SystemClass.NoLongerSupported.Contains(coupledClassName); - - bool classIsSysInternal = K12SystemClass.All.Contains(source.FormClass.ClassName); - - string mergedDefinition = source.FormClass.ClassFormDefinition; - if (source.FormCoupledClass != null) - { - logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", source.FormCoupledClass.ClassName, source.FormClass.ClassName); - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormCoupledClass.ClassFormDefinition); - } - - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); - - var patcher = new FormDefinitionPatcher( - logger, - mergedDefinition, - fieldMigrationService, - source.FormClass.ClassIsForm.GetValueOrDefault(false), - source.FormClass.ClassIsDocumentType, - false, - !classIsSysInternal, - true - ); - - var fieldNames = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); - - patcher.PatchFields(); - - var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); - - if (coupledClassIsDeprecated && source.FormCoupledClass != null) - { - logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", source.FormCoupledClass.ClassName); - patcher.RemoveFields(source.FormCoupledClass.ClassFormDefinition); - - var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); - } - - string result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); - - string formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); - - target.FormDefinition = formDefinitionDifference; - - target.FormDisplayName = source.FormDisplayName; - target.FormGUID = source.FormGuid; - target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); - target.FormLastModified = source.FormLastModified; - target.FormName = source.FormName; - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsAttachmentMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsAttachmentMapper.cs deleted file mode 100644 index d02efc5f..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsAttachmentMapper.cs +++ /dev/null @@ -1,62 +0,0 @@ -using CMS.Base; -using CMS.MediaLibrary; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.Core.KX12.Helpers; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public record CmsAttachmentMapperSource( - KX12M.CmsAttachment Attachment, - int TargetLibraryId, - IUploadedFile File, - string LibrarySubFolder, - KX12M.CmsDocument? AttachmentDocument); - -public class CmsAttachmentMapper : EntityMapperBase -{ - private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; - - public CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => - // library name is generated with site name in it - new(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); - - protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - (var cmsAttachment, int targetLibraryId, _, _, var attachmentDocument) = args; - - target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); - target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; - target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; - target.FileExtension = cmsAttachment.AttachmentExtension; - target.FileMimeType = cmsAttachment.AttachmentMimeType; - target.FileSize = cmsAttachment.AttachmentSize; - target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; - target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; - target.FileGUID = cmsAttachment.AttachmentGuid; - target.FileLibraryID = targetLibraryId; - - // target.FileCreatedByUserID = cmsAttachment.?; - // target.FileModifiedByUserID = cmsAttachment.?; - // target.FileCreatedWhen = cmsAttachment.?; - - target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; - - KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); - - if (attachmentDocument != null) - { - target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentDocument.DocumentNode.NodeAliasPath); - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentAgreementMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentAgreementMapper.cs deleted file mode 100644 index a4b6a30d..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentAgreementMapper.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class CmsConsentAgreementMapper : EntityMapperBase -{ - public CmsConsentAgreementMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override CmsConsentAgreement? CreateNewInstance(KX12M.CmsConsentAgreement source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsentAgreement MapInternal(KX12M.CmsConsentAgreement source, CmsConsentAgreement target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentAgreementGuid = source.ConsentAgreementGuid; - target.ConsentAgreementRevoked = source.ConsentAgreementRevoked; - target.ConsentAgreementConsentHash = source.ConsentAgreementConsentHash; - target.ConsentAgreementTime = source.ConsentAgreementTime; - - if (mappingHelper.TranslateRequiredId(c => c.ContactId, source.ConsentAgreementContactId, out int contactId)) - { - target.ConsentAgreementContactId = contactId; - } - - if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentAgreementConsentId, out int consentId)) - { - target.ConsentAgreementConsentId = consentId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentArchiveMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentArchiveMapper.cs deleted file mode 100644 index 24141470..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentArchiveMapper.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class CmsConsentArchiveMapper : EntityMapperBase -{ - public CmsConsentArchiveMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override CmsConsentArchive? CreateNewInstance(KX12M.CmsConsentArchive source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsentArchive MapInternal(KX12M.CmsConsentArchive source, CmsConsentArchive target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentArchiveContent = source.ConsentArchiveContent; - target.ConsentArchiveGuid = source.ConsentArchiveGuid; - target.ConsentArchiveLastModified = source.ConsentArchiveLastModified; - target.ConsentArchiveHash = source.ConsentArchiveHash; - - if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentArchiveConsentId, out int consentId)) - { - target.ConsentArchiveConsentId = consentId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentMapper.cs deleted file mode 100644 index af83c93e..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentMapper.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System.Text; -using System.Xml.Linq; -using System.Xml.XPath; - -using CMS.ContentEngine; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class CmsConsentMapper : EntityMapperBase -{ - public CmsConsentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override CmsConsent? CreateNewInstance(KX12M.CmsConsent source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsent MapInternal(KX12M.CmsConsent source, CmsConsent target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentDisplayName = source.ConsentDisplayName; - var defaultContentLanguageInfo = ContentLanguageInfo.Provider.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageIsDefault), true).FirstOrDefault() ?? throw new InvalidCastException("Missing default content language"); - target.ConsentName = source.ConsentName; - target.ConsentContent = ConsentContentPatcher.PatchConsentContent(source.ConsentContent, defaultContentLanguageInfo); - target.ConsentGuid = source.ConsentGuid; - target.ConsentLastModified = source.ConsentLastModified; - target.ConsentHash = source.ConsentHash; - - return target; - } -} - -static file class ConsentContentPatcher -{ - public static string PatchConsentContent(string content, ContentLanguageInfo defaultContentLanguage) - { - if (string.IsNullOrWhiteSpace(content)) - { - return content; - } - - XDocument doc; - try - { - doc = XDocument.Parse(content); - } - catch (Exception) - { - // cannot patch xml that cannot be parsed - return content; - } - - foreach (var cultureCodeElement in doc.XPathSelectElements("//CultureCode")) - { - cultureCodeElement.Name = "LanguageName"; - if (!string.Equals(defaultContentLanguage.ContentLanguageName, cultureCodeElement.Value, StringComparison.InvariantCultureIgnoreCase)) - { - // mLogger.LogWarning($"Consent '{consentInfo.ConsentName}' has unknown content language set '{cultureCodeElement.Value}'"); - } - - // if elements are not swapped, FULLTEXT is not shown in UI - var p = cultureCodeElement.NextNode; - if (p is XElement e && e.Name == "FullText") - { - p.ReplaceWith(cultureCodeElement); - cultureCodeElement.ReplaceWith(p); - } - } - - var builder = new StringBuilder(); - using (var writer = new CMS.IO.StringWriter(builder)) - { - doc.Save(writer); - } - - return builder.ToString(); - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsFormMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsFormMapper.cs deleted file mode 100644 index 5e892771..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsFormMapper.cs +++ /dev/null @@ -1,91 +0,0 @@ -using CMS.FormEngine; -using CMS.OnlineForms; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class CmsFormMapper : EntityMapperBase -{ - public CmsFormMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override BizFormInfo? CreateNewInstance(KX12M.CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) - { - var newBizFormInfo = BizFormInfo.New(); - newBizFormInfo.FormGUID = source.FormGuid; - return newBizFormInfo; - } - - protected override BizFormInfo MapInternal(KX12M.CmsForm source, BizFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.FormDisplayName = source.FormDisplayName; - target.FormName = source.FormName; - target.FormItems = source.FormItems; - target.FormReportFields = source.FormReportFields; - target.FormSubmitButtonText = source.FormSubmitButtonText; - target.FormAccess = source.FormAccess.AsEnum(); - target.FormSubmitButtonImage = source.FormSubmitButtonImage; - target.FormLastModified = source.FormLastModified; - target.FormLogActivity = source.FormLogActivity.UseKenticoDefault(); - target.FormBuilderLayout = source.FormBuilderLayout; - - if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out int formClassId)) - { - target.FormClassID = formClassId; - } - - return target; - } -} - -public class CmsFormMapperEf : EntityMapperBase -{ - public CmsFormMapperEf(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override CmsForm? CreateNewInstance(KX12M.CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsForm MapInternal(KX12M.CmsForm source, CmsForm target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.FormDisplayName = source.FormDisplayName; - target.FormName = source.FormName; - // target.FormSendToEmail = source.FormSendToEmail; - // target.FormSendFromEmail = source.FormSendFromEmail; - // target.FormEmailSubject = source.FormEmailSubject; - // target.FormEmailTemplate = source.FormEmailTemplate; - // target.FormEmailAttachUploadedDocs = source.FormEmailAttachUploadedDocs; - target.FormItems = source.FormItems; - target.FormReportFields = source.FormReportFields; - target.FormSubmitButtonText = source.FormSubmitButtonText; - // target.FormConfirmationEmailField = source.FormConfirmationEmailField; - // target.FormConfirmationTemplate = source.FormConfirmationTemplate; - // target.FormConfirmationSendFromEmail = source.FormConfirmationSendFromEmail; - // target.FormConfirmationEmailSubject = source.FormConfirmationEmailSubject; - target.FormAccess = source.FormAccess; - target.FormSubmitButtonImage = source.FormSubmitButtonImage; - target.FormGuid = source.FormGuid; - target.FormLastModified = source.FormLastModified; - target.FormLogActivity = source.FormLogActivity ?? false; - target.FormBuilderLayout = source.FormBuilderLayout; - - if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out int classId)) - { - target.FormClassId = classId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsCategoryMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsCategoryMapper.cs deleted file mode 100644 index e5e0c167..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsCategoryMapper.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class CmsSettingsCategoryMapper( - ILogger logger, - PrimaryKeyMappingContext pkContext, - IProtocol protocol, - IEntityMapper cmsResourceMapper) - : EntityMapperBase(logger, pkContext, protocol) -{ - protected override CmsSettingsCategory? CreateNewInstance(KX12M.CmsSettingsCategory source, MappingHelper mappingHelper, - AddFailure addFailure) => new(); - - - protected override CmsSettingsCategory MapInternal(KX12M.CmsSettingsCategory source, CmsSettingsCategory target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - // no category guid to match on... - if (newInstance) - { - target.CategoryOrder = source.CategoryOrder; - target.CategoryName = source.CategoryName; - target.CategoryDisplayName = source.CategoryDisplayName; - target.CategoryIdpath = source.CategoryIdpath; - target.CategoryLevel = source.CategoryLevel; - target.CategoryChildCount = source.CategoryChildCount; - target.CategoryIconPath = source.CategoryIconPath; - target.CategoryIsGroup = source.CategoryIsGroup; - target.CategoryIsCustom = source.CategoryIsCustom; - } - - if (source.CategoryResource != null) - { - if (target.CategoryResource != null && source.CategoryResourceId != null && target.CategoryResourceId != null) - { - // skip if target is present - logger.LogTrace("Skipping category resource '{ResourceGuid}', already present in target instance", target.CategoryResource.ResourceGuid); - pkContext.SetMapping(r => r.ResourceId, source.CategoryResourceId.Value, target.CategoryResourceId.Value); - } - else - { - switch (cmsResourceMapper.Map(source.CategoryResource, target.CategoryResource)) - { - case { Success: true } result: - { - target.CategoryResource = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result.HandbookReference)); - break; - } - - default: - break; - } - } - } - else if (mappingHelper.TranslateIdAllowNulls(r => r.ResourceId, source.CategoryResourceId, out int? categoryResourceId)) - { - target.CategoryResourceId = categoryResourceId; - } - - if (source.CategoryParent != null) - { - switch (Map(source.CategoryParent, target.CategoryParent)) - { - case { Success: true } result: - { - target.CategoryParent = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result.HandbookReference)); - break; - } - - default: - break; - } - } - else if (mappingHelper.TranslateIdAllowNulls(c => c.CategoryId, source.CategoryParentId, out int? categoryParentId)) - { - target.CategoryParentId = categoryParentId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsKeyMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsKeyMapper.cs deleted file mode 100644 index 4bbffb22..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsKeyMapper.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.Diagnostics; - -using CMS.DataEngine; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class CmsSettingsKeyMapper : EntityMapperBase -{ - private const string SOURCE_KEY_NAME = "CMSDefaultUserID"; - - public CmsSettingsKeyMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override SettingsKeyInfo CreateNewInstance(KX12M.CmsSettingsKey source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override SettingsKeyInfo MapInternal(KX12M.CmsSettingsKey source, SettingsKeyInfo target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - if (newInstance) - { - target.KeyName = source.KeyName; - target.KeyDisplayName = source.KeyDisplayName; - target.KeyDescription = source.KeyDescription; - target.KeyType = source.KeyType; - target.KeyGUID = source.KeyGuid; - target.KeyValidation = source.KeyValidation; - target.KeyEditingControlPath = source.KeyEditingControlPath; - target.KeyFormControlSettings = source.KeyFormControlSettings; - target.KeyExplanationText = source.KeyExplanationText; - } - else - { - target.KeyName = source.KeyName; - target.KeyDescription = source.KeyDescription; - target.KeyType = source.KeyType; - target.KeyValidation = source.KeyValidation; - target.KeyEditingControlPath = source.KeyEditingControlPath; - target.KeyFormControlSettings = source.KeyFormControlSettings; - target.KeyExplanationText = source.KeyExplanationText; - } - - // special migrations for keys - switch (source.KeyName) - { - case SOURCE_KEY_NAME: - { - target.KeyValue = int.TryParse(source.KeyValue, out int cmsDefaultUserId) - ? mappingHelper.TranslateRequiredId(u => u.UserId, cmsDefaultUserId, out int targetCmsDefaultUserId) - ? targetCmsDefaultUserId.ToString() - : source.KeyValue - : source.KeyValue; - break; - } - default: - target.KeyValue = source.KeyValue; - break; - } - - Debug.Assert(!source.SiteId.HasValue, "!source.SiteId.HasValue"); - target.KeyLastModified = source.KeyLastModified; - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsUserMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsUserMapper.cs deleted file mode 100644 index 21430f7d..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsUserMapper.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class CmsUserMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override CmsUser CreateNewInstance(KX12M.CmsUser tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsUser MapInternal(KX12M.CmsUser source, CmsUser target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.UserGuid != target.UserGuid) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.UserName = source.UserName; - target.FirstName = source.FirstName; - target.LastName = source.LastName; - target.Email = source.Email; - target.UserPassword = source.UserPassword; - target.UserEnabled = source.UserEnabled; - target.UserCreated = source.UserCreated; - target.LastLogon = source.LastLogon; - target.UserGuid = source.UserGuid; - target.UserLastModified = source.UserLastModified; - target.UserSecurityStamp = source.UserSecurityStamp; - target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - target.UserIsPendingRegistration = false; - target.UserPasswordLastChanged = null; - target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - foreach (var sourceCmsUserRole in source.CmsUserRoles) - { - if (mappingHelper.TranslateRequiredId(r => r.RoleId, sourceCmsUserRole.RoleId, out int targetRoleId)) - { - if (target.CmsUserRoles.All(x => x.RoleId != targetRoleId)) - { - target.CmsUserRoles.Add(new CmsUserRole { RoleId = targetRoleId, User = target }); - } - } - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CountryInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CountryInfoMapper.cs deleted file mode 100644 index 6b9cb88b..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/CountryInfoMapper.cs +++ /dev/null @@ -1,30 +0,0 @@ -using CMS.Globalization; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class CountryInfoMapper : EntityMapperBase -{ - public CountryInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override CountryInfo? CreateNewInstance(KX12M.CmsCountry source, MappingHelper mappingHelper, AddFailure addFailure) - => CountryInfo.New(); - - protected override CountryInfo MapInternal(KX12M.CmsCountry source, CountryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.CountryName = source.CountryName; - target.CountryDisplayName = source.CountryDisplayName; - target.CountryGUID = source.CountryGuid; - target.CountryLastModified = source.CountryLastModified; - target.CountryThreeLetterCode = source.CountryThreeLetterCode; - target.CountryTwoLetterCode = source.CountryTwoLetterCode; - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/MemberInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/MemberInfoMapper.cs deleted file mode 100644 index 12fc1954..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/MemberInfoMapper.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System.Data; - -using CMS.FormEngine; -using CMS.Membership; - -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KXP.Api; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public record MemberInfoMapperSource(KX12M.CmsUser User, KX12M.CmsUserSetting UserSetting); - -public class MemberInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration, - IDbContextFactory k12DbContextFactory) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (user, userSetting) = source; - - if (!newInstance && user.UserGuid != target.MemberGuid) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - // target.UserName = source.UserName; - target.MemberName = user.UserName; - - // target.FirstName = source.FirstName; // TODO tomas.krch: 2023-04-11 configurable autocreate - // target.LastName = source.LastName; // TODO tomas.krch: 2023-04-11 configurable autocreate - - // target.Email = source.Email; - target.MemberEmail = user.Email; - - // target.SetValue("UserPassword", source.UserPassword); - target.MemberPassword = null; // source.UserPassword; // not migrated - - // target.UserEnabled = source.UserEnabled; - target.MemberEnabled = user.UserEnabled; - - target.SetValue("UserCreated", user.UserCreated); - target.MemberCreated = user.UserCreated.GetValueOrDefault(); - - // target.SetValue("LastLogon", source.LastLogon); // TODO tomas.krch: 2023-04-11 configurable autocreate - - // target.UserGUID = source.UserGuid; - target.MemberGuid = user.UserGuid; - - // target.UserLastModified = source.UserLastModified; // TODO tomas.krch: 2023-04-11 configurable autocreate - target.MemberSecurityStamp = user.UserSecurityStamp; // TODO tomas.krch: 2023-04-11 still relevant? - - // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - // OBSOLETE: target.UserIsPendingRegistration = false; - // OBSOLETE: target.UserPasswordLastChanged = null; - // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - // TODO tomas.krch: 2023-04-11 migrate customized fields - var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); - foreach (var customizedFieldInfo in customized) - { - string fieldName = customizedFieldInfo.FieldName; - - if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out object? value) || - ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) - { - target.SetValue(fieldName, value); - } - } - - using var kx12Context = k12DbContextFactory.CreateDbContext(); - var uDci = kx12Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_user); - if (uDci != null) - { - var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(uDci?.ClassFormDefinition)).ToList(); - if (userCustomizedFields.Count > 0) - { - try - { - string query = - $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.User.UserId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - } - - var usDci = kx12Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); - if (usDci != null) - { - var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); - if (userSettingsCustomizedFields.Count > 0) - { - try - { - string query = - $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userSettingsCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserSettingsInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); - } - } - } - - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/OmContactGroupMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/OmContactGroupMapper.cs deleted file mode 100644 index 0749a0e9..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/OmContactGroupMapper.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class OmContactGroupMapper : EntityMapperBase -{ - public OmContactGroupMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override OmContactGroup? CreateNewInstance(KX12M.OmContactGroup tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override OmContactGroup MapInternal(KX12M.OmContactGroup source, OmContactGroup target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ContactGroupName = source.ContactGroupName; - target.ContactGroupDisplayName = source.ContactGroupDisplayName; - target.ContactGroupDescription = source.ContactGroupDescription; - target.ContactGroupDynamicCondition = source.ContactGroupDynamicCondition; - target.ContactGroupEnabled = source.ContactGroupEnabled; - target.ContactGroupLastModified = source.ContactGroupLastModified; - target.ContactGroupGuid = source.ContactGroupGuid; - target.ContactGroupStatus = source.ContactGroupStatus; - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/OmContactStatusMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/OmContactStatusMapper.cs deleted file mode 100644 index c2f74537..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/OmContactStatusMapper.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class OmContactStatusMapper : EntityMapperBase -{ - public OmContactStatusMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override OmContactStatus? CreateNewInstance(KX12M.OmContactStatus tSourceEntity, MappingHelper mappingHelper, - AddFailure addFailure) => new(); - - protected override OmContactStatus MapInternal(KX12M.OmContactStatus source, OmContactStatus target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ContactStatusName = source.ContactStatusName; - target.ContactStatusDisplayName = source.ContactStatusDisplayName; - target.ContactStatusDescription = source.ContactStatusDescription; - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/RoleInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/RoleInfoMapper.cs deleted file mode 100644 index 9de63db4..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/RoleInfoMapper.cs +++ /dev/null @@ -1,32 +0,0 @@ -using CMS.Membership; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class RoleInfoMapper : EntityMapperBase -{ - public RoleInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override RoleInfo? CreateNewInstance(KX12M.CmsRole source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override RoleInfo MapInternal(KX12M.CmsRole source, RoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.RoleDisplayName = source.RoleDisplayName; - target.RoleName = source.RoleName; - target.RoleDescription = source.RoleDescription; - target.RoleGUID = source.RoleGuid; - target.RoleLastModified = source.RoleLastModified; - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/StateInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/StateInfoMapper.cs deleted file mode 100644 index 94145e18..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/StateInfoMapper.cs +++ /dev/null @@ -1,35 +0,0 @@ -using CMS.Globalization; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class StateInfoMapper : EntityMapperBase -{ - public StateInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override StateInfo? CreateNewInstance(KX12M.CmsState source, MappingHelper mappingHelper, AddFailure addFailure) - => StateInfo.New(); - - protected override StateInfo MapInternal(KX12M.CmsState source, StateInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.StateName = source.StateName; - target.StateDisplayName = source.StateDisplayName; - target.StateLastModified = source.StateLastModified; - target.StateGUID = source.StateGuid; - target.StateCode = source.StateCode; - - if (mappingHelper.TranslateRequiredId(k => k.CountryId, source.CountryId, out int countryId)) - { - target.CountryID = countryId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/UserInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/UserInfoMapper.cs deleted file mode 100644 index 57363de4..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/UserInfoMapper.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System.Data; - -using CMS.Membership; - -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Api; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class UserInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override UserInfo CreateNewInstance(KX12M.CmsUser source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override UserInfo MapInternal(KX12M.CmsUser source, UserInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.UserGuid != target.UserGUID) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.UserName = source.UserName; - target.FirstName = source.FirstName; - target.LastName = source.LastName; - target.Email = source.Email; - // target.UserPassword = source.UserPassword; - target.SetValue("UserPassword", source.UserPassword); - target.UserEnabled = source.UserEnabled; - target.SetValue("UserCreated", source.UserCreated); - // target.UserCreated = source.UserCreated; - target.SetValue("LastLogon", source.LastLogon); - // target.LastLogon = source.LastLogon; - target.UserGUID = source.UserGuid; - target.UserLastModified = source.UserLastModified; - target.UserSecurityStamp = source.UserSecurityStamp; - - // TODO tk: 2022-05-18 deduced - check - target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - // TODO tk: 2022-05-18 deduce info - target.UserIsPendingRegistration = false; - // TODO tk: 2022-05-18 deduce info - // target.UserPasswordLastChanged = null; - // TODO tk: 2022-05-18 deduce info - target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - var customizedFields = kxpClassFacade.GetCustomizedFieldInfos(UserInfo.TYPEINFO.ObjectClassName).ToList(); - if (customizedFields.Count > 0) - { - try - { - string query = - $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in customizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Mappers/UserRoleInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/UserRoleInfoMapper.cs deleted file mode 100644 index 7e302d3e..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/UserRoleInfoMapper.cs +++ /dev/null @@ -1,34 +0,0 @@ -using CMS.Membership; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; - -namespace Migration.Toolkit.Core.KX12.Mappers; - -public class UserRoleInfoMapper : EntityMapperBase -{ - public UserRoleInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override UserRoleInfo? CreateNewInstance(KX12M.CmsUserRole source, MappingHelper mappingHelper, AddFailure addFailure) - => UserRoleInfo.New(); - - protected override UserRoleInfo MapInternal(KX12M.CmsUserRole source, UserRoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (mappingHelper.TranslateRequiredId(r => r.RoleId, source.RoleId, out int xbkRoleId)) - { - target.RoleID = xbkRoleId; - } - - if (mappingHelper.TranslateRequiredId(r => r.UserId, source.UserId, out int xbkUserId)) - { - target.UserID = xbkUserId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX12/Migration.Toolkit.Core.KX12.csproj b/Migration.Toolkit.Core.KX12/Migration.Toolkit.Core.KX12.csproj deleted file mode 100644 index db3feadb..00000000 --- a/Migration.Toolkit.Core.KX12/Migration.Toolkit.Core.KX12.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/Migration.Toolkit.Core.KX12/Providers/ContentItemNameProvider.cs b/Migration.Toolkit.Core.KX12/Providers/ContentItemNameProvider.cs deleted file mode 100644 index c573a121..00000000 --- a/Migration.Toolkit.Core.KX12/Providers/ContentItemNameProvider.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CMS.Base; -using CMS.ContentEngine.Internal; -using CMS.Helpers; - -namespace Migration.Toolkit.Core.KX12.Providers; - -internal class ContentItemNameProvider -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) => this.codeNameValidator = codeNameValidator; - - public Task Get(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); - } - - async Task Get(string name) - { - string codeName = ValidationHelper.GetCodeName(name, useUnicode: false); - - bool isCodeNameValid = ValidationHelper.IsCodeName(codeName); - - if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) - { - codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); - } - - var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); - - return await uniqueCodeNameProvider.GetUniqueValue(codeName); - } - - return Get(name); - } -} diff --git a/Migration.Toolkit.Core.KX12/Providers/ContentItemNameValidator.cs b/Migration.Toolkit.Core.KX12/Providers/ContentItemNameValidator.cs deleted file mode 100644 index 696674c6..00000000 --- a/Migration.Toolkit.Core.KX12/Providers/ContentItemNameValidator.cs +++ /dev/null @@ -1,18 +0,0 @@ -using CMS.ContentEngine.Internal; - -namespace Migration.Toolkit.Core.KX12.Providers; - -internal class ContentItemNameValidator : IContentItemNameValidator -{ - /// - public bool IsUnique(string name) => IsUnique(0, name); - - - /// - public bool IsUnique(int id, string name) - { - var contentItemInfo = new ContentItemInfo { ContentItemID = id, ContentItemName = name }; - - return contentItemInfo.CheckUniqueCodeName(); - } -} diff --git a/Migration.Toolkit.Core.KX12/Providers/UniqueContentItemNameProvider.cs b/Migration.Toolkit.Core.KX12/Providers/UniqueContentItemNameProvider.cs deleted file mode 100644 index 99062b83..00000000 --- a/Migration.Toolkit.Core.KX12/Providers/UniqueContentItemNameProvider.cs +++ /dev/null @@ -1,38 +0,0 @@ -using CMS.Base; -using CMS.ContentEngine.Internal; - -namespace Migration.Toolkit.Core.KX12.Providers; - -internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) - : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) => this.codeNameValidator = codeNameValidator; - - public override Task GetUniqueValue(string inputValue) => base.GetUniqueValue(AddSuffix(inputValue)); - - - private string AddSuffix(string codeName) - { - string randomSuffix = GetRandomSuffix(); - string codeNameWithSuffix = codeName += randomSuffix; - - if (codeNameWithSuffix.Length > MaxLength) - { - int availableLength = MaxLength - randomSuffix.Length; - - codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; - } - - return codeNameWithSuffix; - } - - - /// - protected override Task IsValueUnique(string value) => Task.FromResult(codeNameValidator.IsUnique(value)); -} diff --git a/Migration.Toolkit.Core.KX12/Services/CmsClass/AttachmentSelectorItem.cs b/Migration.Toolkit.Core.KX12/Services/CmsClass/AttachmentSelectorItem.cs deleted file mode 100644 index 61991ae4..00000000 --- a/Migration.Toolkit.Core.KX12/Services/CmsClass/AttachmentSelectorItem.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Newtonsoft.Json; - -namespace Migration.Toolkit.Core.KX12.Services.CmsClass; - -/// Represents an item for the attachment selector. -public class AttachmentSelectorItem -{ - /// Attachment GUID. - [JsonProperty("fileGuid")] - public Guid FileGuid { get; set; } -} diff --git a/Migration.Toolkit.Core.KX12/Services/CountryMigrator.cs b/Migration.Toolkit.Core.KX12/Services/CountryMigrator.cs deleted file mode 100644 index 8fb5024a..00000000 --- a/Migration.Toolkit.Core.KX12/Services/CountryMigrator.cs +++ /dev/null @@ -1,104 +0,0 @@ -using CMS.Globalization; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KXP.Api; - -namespace Migration.Toolkit.Core.KX12.Services; - -public class CountryMigrator( - ILogger logger, - IDbContextFactory kx12ContextFactory, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - IEntityMapper countryMapper, - IEntityMapper stateMapper, - KxpApiInitializer kxpApiInitializer) -{ - public void MigrateCountriesAndStates() - { - if (!kxpApiInitializer.EnsureApiIsInitialized()) - { - throw new InvalidOperationException("Falied to initialize kentico API. Please check configuration."); - } - - var kx12Context = kx12ContextFactory.CreateDbContext(); - - var k12Countries = kx12Context.CmsCountries.AsNoTracking(); - foreach (var k12CmsCountry in k12Countries) - { - var kxpCountryInfo = CountryInfoProvider.ProviderObject.Get(k12CmsCountry.CountryName); - - if (kxpCountryInfo != null) // do not update when exists - { - continue; - } - - var mapped = countryMapper.Map(k12CmsCountry, null); - protocol.MappedTarget(mapped); - - if (mapped is (var countryInfo, var newInstance) { Success: true }) - { - try - { - CountryInfoProvider.ProviderObject.Set(countryInfo); - - protocol.Success(k12CmsCountry, countryInfo, mapped); - logger.LogEntitySetAction(newInstance, countryInfo); - - primaryKeyMappingContext.SetMapping(r => r.CountryId, k12CmsCountry.CountryId, countryInfo.CountryID); - } - catch (Exception exception) - { - logger.LogEntitySetError(exception, newInstance, countryInfo); - protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithIdentityPrint(countryInfo) - ); - } - } - } - - - var k12States = kx12Context.CmsStates.AsNoTracking(); - foreach (var k12CmsState in k12States) - { - var kxpStateInfo = StateInfoProvider.ProviderObject.Get(k12CmsState.StateName); - - if (kxpStateInfo != null) // do not update when exists - { - continue; - } - - var mapped = stateMapper.Map(k12CmsState, null); - protocol.MappedTarget(mapped); - - if (mapped is (var stateInfo, var newInstance) { Success: true }) - { - try - { - StateInfoProvider.ProviderObject.Set(stateInfo); - - protocol.Success(k12CmsState, stateInfo, mapped); - logger.LogEntitySetAction(newInstance, stateInfo); - - primaryKeyMappingContext.SetMapping(r => r.StateId, k12CmsState.StateId, stateInfo.StateID); - } - catch (Exception exception) - { - logger.LogEntitySetError(exception, newInstance, stateInfo); - protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithIdentityPrint(stateInfo) - ); - } - } - } - } -} diff --git a/Migration.Toolkit.Core.KX12/Services/IPrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.KX12/Services/IPrimaryKeyLocatorService.cs deleted file mode 100644 index d48f28b3..00000000 --- a/Migration.Toolkit.Core.KX12/Services/IPrimaryKeyLocatorService.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Linq.Expressions; - -namespace Migration.Toolkit.Core.KX12.Services; - -public record SourceTargetKeyMapping(int SourceId, int TargetId); - -public interface IPrimaryKeyLocatorService -{ - bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); - IEnumerable SelectAll(Expression> keyNameSelector); -} diff --git a/Migration.Toolkit.Core.KX12/Services/KeyLocatorService.cs b/Migration.Toolkit.Core.KX12/Services/KeyLocatorService.cs deleted file mode 100644 index b5f59e8e..00000000 --- a/Migration.Toolkit.Core.KX12/Services/KeyLocatorService.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System.Linq.Expressions; -using System.Runtime.CompilerServices; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KXP.Context; - -namespace Migration.Toolkit.Core.KX12.Services; - -public class KeyLocatorService( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx12ContextFactory) -{ - public bool TryLocate( - Expression> sourceKeySelector, - Expression> targetKeySelector, - Expression> sourceGuidSelector, - Expression> targetGuidSelector, - object? sourceKey, out TTargetKey targetId - ) where TSource : class where TTarget : class - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - using var kx12Context = kx12ContextFactory.CreateDbContext(); - - var sourceType = typeof(TSource); - Unsafe.SkipInit(out targetId); - - try - { - if (sourceKey is null) - { - return false; - } - - var sourceEquals = Expression.Equal( - sourceKeySelector.Body, - Expression.Convert(Expression.Constant(sourceKey, sourceKey.GetType()), typeof(object)) - ); - var sourcePredicate = Expression.Lambda>(sourceEquals, sourceKeySelector.Parameters[0]); - var k12Guid = kx12Context.Set().Where(sourcePredicate).Select(sourceGuidSelector).Single(); - - var param = Expression.Parameter(typeof(TTarget), "t"); - var member = targetGuidSelector.Body as MemberExpression ?? throw new InvalidOperationException($"Expression SHALL NOT be other than member expression, expression: {targetGuidSelector}"); - var targetEquals = Expression.Equal( - Expression.MakeMemberAccess(param, member.Member), - Expression.Constant(k12Guid, typeof(Guid)) - ); - var targetPredicate = Expression.Lambda>(targetEquals, param); - - var query = kxpContext.Set().Where(targetPredicate); - var selector = Expression.Lambda>(targetKeySelector.Body, targetKeySelector.Parameters[0]); - targetId = query.Select(selector).Single(); - return true; - } - catch (InvalidOperationException ioex) - { - logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceKey, ioex.Message); - return false; - } - finally - { - if (!targetId?.Equals(default) ?? false) - { - logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceKey, targetId); - } - } - } - - public bool TryGetSourceGuid(Expression> keySelector, Expression> guidSelector, object? key, out Guid? guid) - where T : class - { - using var kx12Context = kx12ContextFactory.CreateDbContext(); - - var type = typeof(T); - Unsafe.SkipInit(out guid); - - try - { - if (key is null) - { - return false; - } - - var sourceEquals = Expression.Equal( - keySelector.Body, - Expression.Convert(Expression.Constant(key, key.GetType()), typeof(object)) - ); - var sourcePredicate = Expression.Lambda>(sourceEquals, keySelector.Parameters[0]); - guid = kx12Context.Set().Where(sourcePredicate).Select(guidSelector).Single(); - return true; - } - catch (InvalidOperationException ioex) - { - logger.LogWarning("Guid locator {SourceFullType} primary key: {Key} failed, {Message}", type.FullName, key, ioex.Message); - return false; - } - finally - { - if (!guid?.Equals(default) ?? false) - { - logger.LogTrace("Guid locator {SourceFullType} primary key: {Key} located {Guid}", type.FullName, key, guid); - } - } - } -} diff --git a/Migration.Toolkit.Core.KX12/Services/PrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.KX12/Services/PrimaryKeyLocatorService.cs deleted file mode 100644 index 68b02aba..00000000 --- a/Migration.Toolkit.Core.KX12/Services/PrimaryKeyLocatorService.cs +++ /dev/null @@ -1,219 +0,0 @@ -using System.Linq.Expressions; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KXP.Context; - -namespace Migration.Toolkit.Core.KX12.Services; - -public class PrimaryKeyLocatorService( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx12ContextFactory) - : IPrimaryKeyLocatorService -{ - public IEnumerable SelectAll(Expression> keyNameSelector) - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - using var kx12Context = kx12ContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - string memberName = keyNameSelector.GetMemberName(); - - logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); - - if (sourceType == typeof(KX12M.CmsUser) && memberName == nameof(KX12M.CmsUser.UserId)) - { - var sourceUsers = kx12Context.CmsUsers.Select(x => new { x.UserId, x.UserGuid, x.UserName }).ToList(); - var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); - - var result = sourceUsers.Join(targetUsers, - a => new CmsUserKey(a.UserGuid, a.UserName), - b => new CmsUserKey(b.UserGuid, b.UserName), - (a, b) => new SourceTargetKeyMapping(a.UserId, b.UserId), - new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(KX12M.OmContact) && memberName == nameof(KX12M.OmContact.ContactId)) - { - var source = kx12Context.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - var target = kxpContext.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - - var result = source.Join(target, - a => a.ContactGuid, - b => b.ContactGuid, - (a, b) => new SourceTargetKeyMapping(a.ContactId, b.ContactId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(KX12M.CmsState) && memberName == nameof(KX12M.CmsState.StateId)) - { - var source = kx12Context.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - - var result = source.Join(target, - a => a.StateName, - b => b.StateName, - (a, b) => new SourceTargetKeyMapping(a.StateId, b.StateId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(KX12M.CmsCountry) && memberName == nameof(KX12M.CmsCountry.CountryId)) - { - var source = kx12Context.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - - var result = source.Join(target, - a => a.CountryName, - b => b.CountryName, - (a, b) => new SourceTargetKeyMapping(a.CountryId, b.CountryId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - - throw new NotImplementedException(); - } - - public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - using var KX12Context = kx12ContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - targetId = -1; - try - { - if (sourceType == typeof(KX12M.CmsResource)) - { - var k12Guid = KX12Context.CmsResources.Where(c => c.ResourceId == sourceId).Select(x => x.ResourceGuid).Single(); - targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == k12Guid).Select(x => x.ResourceId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.CmsClass)) - { - var k12Guid = KX12Context.CmsClasses.Where(c => c.ClassId == sourceId).Select(x => x.ClassGuid).Single(); - targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == k12Guid).Select(x => x.ClassId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.CmsUser)) - { - var k12User = KX12Context.CmsUsers.Where(c => c.UserId == sourceId).Select(x => new { x.UserGuid, x.UserName }).Single(); - targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == k12User.UserGuid || x.UserName == k12User.UserName).Select(x => x.UserId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.CmsRole)) - { - var k12User = KX12Context.CmsRoles.Where(c => c.RoleId == sourceId).Select(x => new { x.RoleGuid }).Single(); - targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == k12User.RoleGuid).Select(x => x.RoleId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.CmsSite)) - { - var k12Guid = KX12Context.CmsSites.Where(c => c.SiteId == sourceId).Select(x => x.SiteGuid).Single(); - targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == k12Guid).Select(x => x.ChannelId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.CmsState)) - { - string k12CodeName = KX12Context.CmsStates.Where(c => c.StateId == sourceId).Select(x => x.StateName).Single(); - targetId = kxpContext.CmsStates.Where(x => x.StateName == k12CodeName).Select(x => x.StateId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.CmsCountry)) - { - string k12CodeName = KX12Context.CmsCountries.Where(c => c.CountryId == sourceId).Select(x => x.CountryName).Single(); - targetId = kxpContext.CmsCountries.Where(x => x.CountryName == k12CodeName).Select(x => x.CountryId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.OmContactStatus)) - { - string k12Guid = KX12Context.OmContactStatuses.Where(c => c.ContactStatusId == sourceId).Select(x => x.ContactStatusName).Single(); - targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == k12Guid).Select(x => x.ContactStatusId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.OmContact)) - { - var k12Guid = KX12Context.OmContacts.Where(c => c.ContactId == sourceId).Select(x => x.ContactGuid).Single(); - targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == k12Guid).Select(x => x.ContactId).Single(); - return true; - } - } - catch (InvalidOperationException ioex) - { - if (ioex.Message.StartsWith("Sequence contains no elements")) - { - logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - else - { - logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - - return false; - } - finally - { - if (targetId != -1) - { - logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); - } - } - - logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); - targetId = -1; - return false; - } - - private class KeyEqualityComparerWithLambda(Func equalityComparer) : IEqualityComparer - { - public bool Equals(T? x, T? y) => equalityComparer.Invoke(x, y); - - public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; - } - - private record CmsUserKey(Guid UserGuid, string UserName); -} diff --git a/Migration.Toolkit.Core.KX13/Behaviors/CommandConstraintBehavior.cs b/Migration.Toolkit.Core.KX13/Behaviors/CommandConstraintBehavior.cs deleted file mode 100644 index 1691c1a4..00000000 --- a/Migration.Toolkit.Core.KX13/Behaviors/CommandConstraintBehavior.cs +++ /dev/null @@ -1,232 +0,0 @@ -using MediatR; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KX13; -using Migration.Toolkit.KX13.Context; - -namespace Migration.Toolkit.Core.KX13.Behaviors; - -public class CommandConstraintBehavior( - ILogger> logger, - IMigrationProtocol protocol, - IDbContextFactory kx13ContextFactory, - ToolkitConfiguration toolkitConfiguration) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) - { - try - { - var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); - - bool criticalCheckPassed = PerformChecks(request, kx13Context); - if (!criticalCheckPassed) - { - return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); - } - } - catch (Exception ex) - { - protocol.CommandError(ex, request); - logger.LogCritical(ex, "Error occured while checking command constraints"); - return (TResponse)(CommandResult)new CommandCheckFailedResult(false); - } - - return await next(); - } - - private bool PerformChecks(TRequest request, KX13Context kx13Context) - { - bool criticalCheckPassed = true; - // const string supportedVersion = "13.0.64"; - const string supportedVersion = "13.0.0"; - if (SemanticVersion.TryParse(supportedVersion, out var minimalVersion)) - { - criticalCheckPassed &= CheckVersion(kx13Context, minimalVersion); - } - - var sourceSites = kx13Context.CmsSites - .Include(s => s.Cultures) - .ToList(); - - foreach (var site in sourceSites) - { - criticalCheckPassed &= CheckSite(sourceSites, site.SiteId); - } - - if (request is ICultureReliantCommand cultureReliantCommand) - { - criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites); - } - - // criticalCheckPassed &= CheckDbCollations(); - - return criticalCheckPassed; - } - - private bool CheckVersion(KX13Context kx13Context, SemanticVersion minimalVersion) - { - bool criticalCheckPassed = true; - - #region Check conclusion methods - - void UnableToReadVersionKey(string keyName) - { - logger.LogCritical("Unable to read CMS version (incorrect format) - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); - protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { ErrorKind = "Settings key value incorrect format", SettingsKeyName = keyName, SupportedVersion = minimalVersion.ToString() })); - criticalCheckPassed = false; - } - - void VersionKeyNotFound(string keyName) - { - logger.LogCritical("CMS version not found - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); - protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { ErrorKind = "Settings key not found", SettingsKeyName = keyName, SupportedVersion = minimalVersion.ToString() })); - criticalCheckPassed = false; - } - - void UpgradeNeeded(string keyName, string currentVersion) - { - logger.LogCritical("{Key} '{CurrentVersion}' is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentVersion, minimalVersion.ToString()); - protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { CurrentVersion = currentVersion, SupportedVersion = minimalVersion.ToString() })); - criticalCheckPassed = false; - } - - void LowHotfix(string keyName, int currentHotfix) - { - logger.LogCritical("{Key} '{CurrentVersion}' hotfix is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentHotfix, minimalVersion.ToString()); - protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { CurrentHotfix = currentHotfix.ToString(), SupportedVersion = minimalVersion.ToString() })); - criticalCheckPassed = false; - } - - #endregion - - if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDataVersion) is { } cmsDataVersion) - { - if (SemanticVersion.TryParse(cmsDataVersion.KeyValue, out var cmsDataVer)) - { - if (cmsDataVer.IsLesserThan(minimalVersion)) - { - UpgradeNeeded(SettingsKeys.CMSDataVersion, cmsDataVer.ToString()); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSDataVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSDataVersion); - } - - if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDBVersion) is { } cmsDbVersion) - { - if (SemanticVersion.TryParse(cmsDbVersion.KeyValue, out var cmsDataVer)) - { - if (cmsDataVer.IsLesserThan(minimalVersion)) - { - UpgradeNeeded(SettingsKeys.CMSDBVersion, cmsDataVer.ToString()); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSDBVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSDBVersion); - } - - if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixDataVersion) is { } cmsHotfixDataVersion) - { - if (int.TryParse(cmsHotfixDataVersion.KeyValue, out int version)) - { - if (version < minimalVersion.Hotfix) - { - LowHotfix(SettingsKeys.CMSHotfixDataVersion, version); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSHotfixDataVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSHotfixDataVersion); - } - - if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixVersion) is { } cmsHotfixVersion) - { - if (int.TryParse(cmsHotfixVersion.KeyValue, out int version)) - { - if (version < minimalVersion.Hotfix) - { - LowHotfix(SettingsKeys.CMSHotfixVersion, version); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSHotfixVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSHotfixVersion); - } - - return criticalCheckPassed; - } - - private bool CheckSite(List sourceSites, int sourceSiteId) - { - bool criticalCheckPassed = true; - if (sourceSites.All(s => s.SiteId != sourceSiteId)) - { - var supportedSites = sourceSites.Select(x => new { x.SiteName, x.SiteId }).ToArray(); - string supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); - logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, - supportedSitesStr); - protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") - .WithMessage("Check program argument '--siteId'") - .WithData(new { sourceSiteId, AvailableSites = supportedSites })); - criticalCheckPassed = false; - } - - return criticalCheckPassed; - } - - private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites) - { - bool criticalCheckPassed = true; - string cultureCode = cultureReliantCommand.CultureCode; - var siteCultureLookup = sourceSites - .ToDictionary(x => x.SiteId, x => x.Cultures.Select(s => s.CultureCode.ToLowerInvariant())); - - foreach (var site in sourceSites) - { - if (siteCultureLookup.TryGetValue(site.SiteId, out var value)) - { - string[] siteCultures = value.ToArray(); - if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) - { - string supportedCultures = string.Join(", ", siteCultures); - logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, site.SiteId, supportedCultures); - protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") - .WithMessage("Check program argument '--culture'") - .WithData(new { cultureCode, site.SiteId, SiteCultures = supportedCultures })); - criticalCheckPassed = false; - } - } - } - - return criticalCheckPassed; - } -} diff --git a/Migration.Toolkit.Core.KX13/Behaviors/RequestHandlingBehavior.cs b/Migration.Toolkit.Core.KX13/Behaviors/RequestHandlingBehavior.cs deleted file mode 100644 index c88c280a..00000000 --- a/Migration.Toolkit.Core.KX13/Behaviors/RequestHandlingBehavior.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Diagnostics; - -using MediatR; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; - -namespace Migration.Toolkit.Core.KX13.Behaviors; - -public class RequestHandlingBehavior( - ILogger> logger, - IMigrationProtocol protocol) : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) - { - var sw = Stopwatch.StartNew(); - logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); - try - { - protocol.CommandRequest(request); - var response = await next(); - protocol.CommandFinished(request, response); - return response; - } - catch (Exception ex) - { - protocol.CommandError(ex, request); - logger.LogError(ex, "Error occured"); - throw; - } - finally - { - logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); - } - } -} diff --git a/Migration.Toolkit.Core.KX13/Behaviors/XbKApiContextBehavior.cs b/Migration.Toolkit.Core.KX13/Behaviors/XbKApiContextBehavior.cs deleted file mode 100644 index e56f4ee4..00000000 --- a/Migration.Toolkit.Core.KX13/Behaviors/XbKApiContextBehavior.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CMS.Base; -using CMS.Membership; - -using MediatR; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; - -namespace Migration.Toolkit.Core.KX13.Behaviors; - -public class XbKApiContextBehavior( - ILogger> logger, - IMigrationProtocol protocol, - KxpApiInitializer initializer) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) - { - initializer.EnsureApiIsInitialized(); - - var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); - if (defaultAdmin == null) - { - protocol.Append(HandbookReferences - .MissingRequiredDependency() - .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") - ); - throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); - } - - using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) - { - logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); - return await next(); - } - } -} diff --git a/Migration.Toolkit.Core.KX13/Contexts/KeyMappingContext.cs b/Migration.Toolkit.Core.KX13/Contexts/KeyMappingContext.cs deleted file mode 100644 index 8945684d..00000000 --- a/Migration.Toolkit.Core.KX13/Contexts/KeyMappingContext.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Linq.Expressions; - -using Migration.Toolkit.Core.KX13.Services; - -namespace Migration.Toolkit.Core.KX13.Contexts; - -public record MapSourceKeyResult(bool Success, TMapped? Mapped); - -public class KeyMappingContext(PrimaryKeyMappingContext primaryKeyMappingContext, KeyLocatorService keyLocatorService) -{ - public MapSourceKeyResult MapSourceKey(Expression> sourceKeySelector, - Expression> sourceGuidSelector, - object? sourceKey, - Expression> targetKeySelector, - Expression> targetGuidSelector) where TSource : class where TTarget : class - { - if (sourceKey is int id && primaryKeyMappingContext.MapSourceId(sourceKeySelector, id) is { Success: true, MappedId: TTargetKey targetKey }) - { - return new MapSourceKeyResult(true, targetKey); - } - - if (keyLocatorService.TryLocate(sourceKeySelector, targetKeySelector, sourceGuidSelector, targetGuidSelector, sourceKey, out var located)) - { - return new MapSourceKeyResult(true, located); - } - - return new MapSourceKeyResult(false, default); - } - - public MapSourceKeyResult GetGuid(Expression> keySelector, Expression> guidSelector, object? key) where T : class => - keyLocatorService.TryGetSourceGuid(keySelector, guidSelector, key, out var located) - ? new MapSourceKeyResult(true, located) - : new MapSourceKeyResult(false, null); -} diff --git a/Migration.Toolkit.Core.KX13/Contexts/PrimaryKeyMappingContext.cs b/Migration.Toolkit.Core.KX13/Contexts/PrimaryKeyMappingContext.cs deleted file mode 100644 index ae0d268d..00000000 --- a/Migration.Toolkit.Core.KX13/Contexts/PrimaryKeyMappingContext.cs +++ /dev/null @@ -1,287 +0,0 @@ -using System.Diagnostics; -using System.Linq.Expressions; -using System.Reflection; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Core.KX13.Services; - -namespace Migration.Toolkit.Core.KX13.Contexts; - -public class PrimaryKeyMappingContext( - ILogger logger, - IPrimaryKeyLocatorService primaryKeyLocatorService, - ToolkitConfiguration toolkitConfiguration) - : IPrimaryKeyMappingContext -{ - private readonly Dictionary mappingsCache = new(StringComparer.OrdinalIgnoreCase); - - public void SetMapping(Type type, string keyName, int sourceId, int targetId) - { - Debug.Assert(sourceId > 0, "sourceId > 0"); - Debug.Assert(targetId > 0, "targetId > 0"); - - var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) - .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); - - Debug.Assert(foundProp != null, "foundProp != null"); - - string fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; - - mappingsCache[fullKeyName] = targetId; - logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); - } - - public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) - { - string fullKeyName = CreateKey(keyNameSelector, sourceId); - mappingsCache[fullKeyName] = targetId; - logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); - } - - public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) - { - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sourceId); - if (sourceId == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out int targetId)) - { - SetMapping(keyNameSelector, sourceId, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, "Target entity is missing"); - } - - public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) - { - targetIdResult = -1; - if (sourceId is not int sid) - { - return false; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - targetIdResult = explicitlyMappedId; - return true; - } - - if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - targetIdResult = resultId; - return true; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - targetIdResult = targetId; - return true; - } - - return false; - } - - public int? MapFromSource(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, "Target entity is missing"); - } - - public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - return null; - } - - public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return new MapSourceIdResult(true, null); - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return new MapSourceIdResult(true, null); - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return new MapSourceIdResult(true, explicitlyMappedId); - } - - if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return new MapSourceIdResult(true, resultId); - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return new MapSourceIdResult(true, targetId); - } - - return new MapSourceIdResult(false, null); - } - - public void PreloadDependencies(Expression> keyNameSelector) - { - foreach ((int sourceId, int targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) - { - SetMapping(keyNameSelector, sourceId, targetId); - } - } - - public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return true; - } - - string memberName = keyNameSelector.GetMemberName(); - string fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - return true; - } - - if (GetExplicitMappingOrNull(memberName, sid) is not null) - { - return true; - } - - if (mappingsCache.TryGetValue(fullKeyName, out _)) - { - return true; - } - - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) - { - return true; - } - - return false; - } - - private int? GetExplicitMappingOrNull(string memberName, int? sourceId) - { - if (sourceId == null) - { - return null; - } - - var mappings = toolkitConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; - if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) - { - return memberMappings.TryGetValue($"{sourceId}", out int? mappedId) ? mappedId : null; - } - - return null; - } - - private static string CreateKey(Expression> keyNameSelector, int sourceId) => $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; -} diff --git a/Migration.Toolkit.Core.KX13/DependencyInjectionExtensions.cs b/Migration.Toolkit.Core.KX13/DependencyInjectionExtensions.cs deleted file mode 100644 index a3c2ce82..00000000 --- a/Migration.Toolkit.Core.KX13/DependencyInjectionExtensions.cs +++ /dev/null @@ -1,69 +0,0 @@ -using CMS.DataEngine; -using CMS.FormEngine; -using CMS.Globalization; -using CMS.MediaLibrary; -using CMS.Membership; -using Kentico.Xperience.UMT; - -using MediatR; - -using Microsoft.Extensions.DependencyInjection; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Core.KX13.Behaviors; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.Core.KX13.Helpers; -using Migration.Toolkit.Core.KX13.Mappers; -using Migration.Toolkit.Core.KX13.Services; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX13; - -public static class DependencyInjectionExtensions -{ - public static IServiceCollection UseKx13ToolkitCore(this IServiceCollection services) - { - var printService = new PrintService(); - services.AddSingleton(printService); - HandbookReference.PrintService = printService; - LogExtensions.PrintService = printService; - - services.AddTransient(); - services.AddTransient(); - services.AddScoped(); - - services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(DependencyInjectionExtensions).Assembly)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestHandlingBehavior<,>)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(CommandConstraintBehavior<,>)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(XbKApiContextBehavior<,>)); - - services.AddScoped(); - services.AddSingleton(); - services.AddScoped(); - services.AddSingleton(); - - // mappers - services.AddTransient, CmsAttachmentMapper>(); - services.AddTransient, CmsConsentMapper>(); - services.AddTransient, CmsConsentAgreementMapper>(); - services.AddTransient, CmsConsentArchiveMapper>(); - services.AddTransient, AlternativeFormMapper>(); - services.AddTransient, RoleInfoMapper>(); - services.AddTransient, CmsSettingsCategoryMapper>(); - services.AddTransient, CmsSettingsKeyMapper>(); - services.AddTransient, UserInfoMapper>(); - services.AddTransient, MemberInfoMapper>(); - services.AddTransient, UserRoleInfoMapper>(); - services.AddTransient, OmContactGroupMapper>(); - services.AddTransient, OmContactStatusMapper>(); - services.AddTransient, CountryInfoMapper>(); - services.AddTransient, StateInfoMapper>(); - - services.AddUniversalMigrationToolkit(); - - return services; - } -} diff --git a/Migration.Toolkit.Core.KX13/Exceptions.cs b/Migration.Toolkit.Core.KX13/Exceptions.cs deleted file mode 100644 index c726f2e5..00000000 --- a/Migration.Toolkit.Core.KX13/Exceptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Migration.Toolkit.Core.KX13; - -public class MappingFailureException : InvalidOperationException -{ - public MappingFailureException(string keyName, string reason) : base($"Key '{keyName}' mapping failed: {reason}") - { - KeyName = keyName; - Reason = reason; - } - - public string KeyName { get; } - public string Reason { get; } -} diff --git a/Migration.Toolkit.Core.KX13/GlobalUsings.cs b/Migration.Toolkit.Core.KX13/GlobalUsings.cs deleted file mode 100644 index ab26e503..00000000 --- a/Migration.Toolkit.Core.KX13/GlobalUsings.cs +++ /dev/null @@ -1,3 +0,0 @@ -global using System; - -global using KX13M = Migration.Toolkit.KX13.Models; diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs deleted file mode 100644 index 52e6ea3a..00000000 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs +++ /dev/null @@ -1,387 +0,0 @@ -using CMS.Activities; -using CMS.ContactManagement; -using CMS.ContentEngine; - -using MediatR; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.Core.KX13.Helpers; -using Migration.Toolkit.Core.KX13.Services; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX13.Handlers; - -public class MigrateContactManagementCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - BulkDataCopyService bulkDataCopyService, - ToolkitConfiguration toolkitConfiguration, - PrimaryKeyMappingContext primaryKeyMappingContext, - KeyMappingContext keyMappingContext, - CountryMigrator countryMigrator, - KxpClassFacade kxpClassFacade, - ISpoiledGuidContext spoiledGuidContext, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private readonly KxpContext kxpContext = kxpContextFactory.CreateDbContext(); - - public void Dispose() => kxpContext.Dispose(); - - public Task Handle(MigrateContactManagementCommand request, CancellationToken cancellationToken) - { - countryMigrator.MigrateCountriesAndStates(); - - if (MigrateContacts() is { } ccr) - { - return Task.FromResult(ccr); - } - - if (MigrateContactActivities() is { } acr) - { - return Task.FromResult(acr); - } - - return Task.FromResult(new GenericCommandResult()); - } - - #region "Migrate contacts" - - private CommandResult? MigrateContacts() - { - var requiredColumnsForContactMigration = new Dictionary - { - { nameof(KX13M.OmContact.ContactId), nameof(OmContact.ContactId) }, - { nameof(KX13M.OmContact.ContactFirstName), nameof(OmContact.ContactFirstName) }, - { nameof(KX13M.OmContact.ContactMiddleName), nameof(OmContact.ContactMiddleName) }, - { nameof(KX13M.OmContact.ContactLastName), nameof(OmContact.ContactLastName) }, - { nameof(KX13M.OmContact.ContactJobTitle), nameof(OmContact.ContactJobTitle) }, - { nameof(KX13M.OmContact.ContactAddress1), nameof(OmContact.ContactAddress1) }, - { nameof(KX13M.OmContact.ContactCity), nameof(OmContact.ContactCity) }, - { nameof(KX13M.OmContact.ContactZip), nameof(OmContact.ContactZip) }, - { nameof(KX13M.OmContact.ContactStateId), nameof(OmContact.ContactStateId) }, - { nameof(KX13M.OmContact.ContactCountryId), nameof(OmContact.ContactCountryId) }, - { nameof(KX13M.OmContact.ContactMobilePhone), nameof(OmContact.ContactMobilePhone) }, - { nameof(KX13M.OmContact.ContactBusinessPhone), nameof(OmContact.ContactBusinessPhone) }, - { nameof(KX13M.OmContact.ContactEmail), nameof(OmContact.ContactEmail) }, - // No support 2022-07-07 { nameof(OmContact.ContactBirthday), nameof(KXO.Models.OmContact.ContactBirthday) }, - { nameof(KX13M.OmContact.ContactGender), nameof(OmContact.ContactGender) }, - // { nameof(OmContact.ContactStatusId), nameof(KXO.Models.OmContact.ContactStatusId) }, // No support 2022-07-07 but needs to be mapped because of constraint - { nameof(KX13M.OmContact.ContactNotes), nameof(OmContact.ContactNotes) }, - { nameof(KX13M.OmContact.ContactOwnerUserId), nameof(OmContact.ContactOwnerUserId) }, - // No support 2022-07-07 { nameof(OmContact.ContactMonitored), nameof(KXO.Models.OmContact.ContactMonitored) }, - { nameof(KX13M.OmContact.ContactGuid), nameof(OmContact.ContactGuid) }, - { nameof(KX13M.OmContact.ContactLastModified), nameof(OmContact.ContactLastModified) }, - { nameof(KX13M.OmContact.ContactCreated), nameof(OmContact.ContactCreated) }, - // No support 2022-07-07 { nameof(OmContact.ContactBounces), nameof(KXO.Models.OmContact.ContactBounces) }, - { nameof(KX13M.OmContact.ContactCampaign), nameof(OmContact.ContactCampaign) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadId), nameof(KXO.Models.OmContact.ContactSalesForceLeadId) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDisabled), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDisabled) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDateTime) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationSuspensionDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationSuspensionDateTime) }, - { nameof(KX13M.OmContact.ContactCompanyName), nameof(OmContact.ContactCompanyName) } - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationRequired), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationRequired) }, - }; - - foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ContactInfo.TYPEINFO.ObjectClassName)) - { - requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); - } - - if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Contact")) - { - protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Contact")); - logger.LogError("Data must not exist in target instance table, remove data before proceeding"); - return new CommandFailureResult(); - } - - if (bulkDataCopyService.CheckForTableColumnsDifferences("OM_Contact", requiredColumnsForContactMigration, out var differences)) - { - protocol.Append(HandbookReferences - .BulkCopyColumnMismatch("OM_Contact") - .NeedsManualAction() - .WithData(differences) - ); - logger.LogError("Table {TableName} columns do not match, fix columns before proceeding", "OM_Contact"); - { - return new CommandFailureResult(); - } - } - - primaryKeyMappingContext.PreloadDependencies(u => u.UserId); - primaryKeyMappingContext.PreloadDependencies(u => u.StateId); - primaryKeyMappingContext.PreloadDependencies(u => u.CountryId); - - var bulkCopyRequest = new BulkCopyRequest("OM_Contact", - s => true, // s => s != "ContactID", - _ => true, - 50000, - requiredColumnsForContactMigration.Keys.ToList(), - ContactValueInterceptor, - current => logger.LogError("Contact skipped due error, contact: {Contact}", PrintHelper.PrintDictionary(current)), - "ContactID" - ); - - logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - try - { - bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to migrate contacts"); - return new CommandFailureResult(); - } - - return null; - } - - private ValueInterceptorResult ContactValueInterceptor(int ordinal, string columnName, object value, Dictionary currentRow) - { - if (columnName.Equals(nameof(OmContact.ContactCompanyName), StringComparison.InvariantCultureIgnoreCase)) - { - // autofix removed in favor of error report and data consistency - // var truncatedValue = SqlDataTypeHelper.TruncateString(value, 100); - // return new ValueInterceptorResult(truncatedValue, true, false); - - if (value is string { Length: > 100 } s) - { - protocol.Append(HandbookReferences.ValueTruncationSkip("OM_Contact") - .WithData(new - { - value, - maxLength = 100, - s.Length, - columnName, - contact = PrintHelper.PrintDictionary(currentRow) - }) - ); - return ValueInterceptorResult.SkipRow; - } - } - - if (columnName.Equals(nameof(OmContact.ContactOwnerUserId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceUserId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.UserId, sourceUserId)) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - // try search member - if (keyMappingContext.MapSourceKey( - s => s.UserId, - s => s.UserGuid, - sourceUserId, - t => t.MemberId, - t => t.MemberGuid - ) is { Success: true, Mapped: { } memberId }) - { - return ValueInterceptorResult.ReplaceValue(memberId); - } - - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - - default: - break; - } - } - - if (columnName.Equals(nameof(OmContact.ContactStateId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceStateId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.StateId, sourceStateId.NullIfZero())) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - - default: - break; - } - } - - if (columnName.Equals(nameof(OmContact.ContactCountryId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceCountryId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.CountryId, sourceCountryId.NullIfZero())) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - - default: - break; - } - } - - - return ValueInterceptorResult.DoNothing; - } - - #endregion - - #region "Migrate contact activities" - - private CommandResult? MigrateContactActivities() //(List migratedSiteIds) - { - var requiredColumnsForContactMigration = new Dictionary - { - { nameof(KX13M.OmActivity.ActivityId), nameof(OmActivity.ActivityId) }, - { nameof(KX13M.OmActivity.ActivityContactId), nameof(OmActivity.ActivityContactId) }, - { nameof(KX13M.OmActivity.ActivityCreated), nameof(OmActivity.ActivityCreated) }, - { nameof(KX13M.OmActivity.ActivityType), nameof(OmActivity.ActivityType) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityItemId), nameof(KXO.Models.OmActivity.ActivityItemId) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityItemDetailId), nameof(KXO.Models.OmActivity.ActivityItemDetailId) }, - { nameof(KX13M.OmActivity.ActivityValue), nameof(OmActivity.ActivityValue) }, - { nameof(KX13M.OmActivity.ActivityUrl), nameof(OmActivity.ActivityUrl) }, - { nameof(KX13M.OmActivity.ActivityTitle), nameof(OmActivity.ActivityTitle) }, - { nameof(KX13M.OmActivity.ActivitySiteId), nameof(OmActivity.ActivityChannelId) }, - { nameof(KX13M.OmActivity.ActivityComment), nameof(OmActivity.ActivityComment) }, - // { nameof(OmActivity.ActivityCampaign), nameof(KXP.Models.OmActivity.ActivityCampaign) }, // deprecated without replacement in v27 - { nameof(KX13M.OmActivity.ActivityUrlreferrer), nameof(OmActivity.ActivityUrlreferrer) }, - { nameof(KX13M.OmActivity.ActivityCulture), nameof(OmActivity.ActivityLanguageId) }, - { nameof(KX13M.OmActivity.ActivityNodeId), nameof(OmActivity.ActivityWebPageItemGuid) }, - { nameof(KX13M.OmActivity.ActivityUtmsource), nameof(OmActivity.ActivityUtmsource) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityAbvariantName), nameof(KXO.Models.OmActivity.ActivityAbvariantName) }, - // OBSOLETE 26.0.0: { nameof(OmActivity.ActivityUrlhash), nameof(KXP.Models.OmActivity.ActivityUrlhash) }, - { nameof(KX13M.OmActivity.ActivityUtmcontent), nameof(OmActivity.ActivityUtmcontent) } - }; - - foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ActivityInfo.TYPEINFO.ObjectClassName)) - { - requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); - } - - if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Activity")) - { - protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Activity")); - logger.LogError("Data must not exist in target instance table, remove data before proceeding"); - return new CommandFailureResult(); - } - - var bulkCopyRequest = new BulkCopyRequestExtended("OM_Activity", - s => true, - reader => true, - 50000, - requiredColumnsForContactMigration, - ActivityValueInterceptor, - current => logger.LogError("Contact activity skipped due error, activity: {Activity}", PrintHelper.PrintDictionary(current)), - "ActivityID" - ); - - logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - - try - { - bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to migrate activities"); - return new CommandFailureResult(); - } - - return null; - } - - private ValueInterceptorResult ActivityValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow) - { - if (columnName.Equals(nameof(KX13M.OmActivity.ActivitySiteId), StringComparison.InvariantCultureIgnoreCase) && - value is int sourceActivitySiteId) - { - var result = keyMappingContext.MapSourceKey( - s => s.SiteId, - s => s.SiteGuid, - sourceActivitySiteId.NullIfZero(), - t => t.ChannelId, - t => t.ChannelGuid - ); - switch (result) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id ?? 0); - case { Success: false }: - { - switch (toolkitConfiguration.UseOmActivitySiteRelationAutofix ?? AutofixEnum.Error) - { - case AutofixEnum.DiscardData: - logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => discard data", sourceActivitySiteId); - return ValueInterceptorResult.SkipRow; - case AutofixEnum.AttemptFix: - logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => ActivityNodeId=0", sourceActivitySiteId); - return ValueInterceptorResult.ReplaceValue(0); - case AutofixEnum.Error: - default: //error - protocol.Append(HandbookReferences - .MissingRequiredDependency(columnName, value) - .WithData(currentRow) - ); - return ValueInterceptorResult.SkipRow; - } - } - - default: - break; - } - } - - if (columnName.Equals(nameof(KX13M.OmActivity.ActivityNodeId), StringComparison.InvariantCultureIgnoreCase) && value is int activityNodeId) - { - if (currentRow.TryGetValue(nameof(KX13M.OmActivity.ActivitySiteId), out object? mSiteId) && mSiteId is int siteId) - { - if (spoiledGuidContext.GetNodeGuid(siteId, activityNodeId) is { } nodeGuid) - { - return ValueInterceptorResult.ReplaceValue(nodeGuid); - } - } - - switch (toolkitConfiguration.UseOmActivityNodeRelationAutofix ?? AutofixEnum.Error) - { - case AutofixEnum.DiscardData: - logger.LogTrace("Autofix (ActivitySiteId={NodeId} not exists) => discard data", activityNodeId); - return ValueInterceptorResult.SkipRow; - case AutofixEnum.AttemptFix: - logger.LogTrace("Autofix (ActivityNodeId={NodeId} not exists) => ActivityNodeId=0", activityNodeId); - return ValueInterceptorResult.ReplaceValue(null); - case AutofixEnum.Error: - default: //error - protocol.Append(HandbookReferences - .MissingRequiredDependency(columnName, value) - .WithData(currentRow) - ); - return ValueInterceptorResult.SkipRow; - } - } - - if (columnName.Equals(nameof(KX13M.OmActivity.ActivityCulture), StringComparison.InvariantCultureIgnoreCase) && value is string cultureCode) - { - return ValueInterceptorResult.ReplaceValue(ContentLanguageInfoProvider.ProviderObject.Get(cultureCode)?.ContentLanguageID); - } - - return ValueInterceptorResult.DoNothing; - } - - #endregion -} diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs deleted file mode 100644 index 225b7154..00000000 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs +++ /dev/null @@ -1,281 +0,0 @@ -using CMS.DataProtection; - -using MediatR; - -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX13.Handlers; - -public class MigrateDataProtectionCommandHandler : IRequestHandler, IDisposable -{ - private static readonly int batchSize = 1000; - private readonly IEntityMapper consentAgreementMapper; - private readonly IEntityMapper consentArchiveMapper; - private readonly IEntityMapper consentMapper; - private readonly IDbContextFactory kx13ContextFactory; - private readonly IDbContextFactory kxpContextFactory; - private readonly ILogger logger; - private readonly PrimaryKeyMappingContext primaryKeyMappingContext; - private readonly IProtocol protocol; - - private KxpContext kxpContext; - - public MigrateDataProtectionCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx13ContextFactory, - IEntityMapper consentMapper, - IEntityMapper consentArchiveMapper, - IEntityMapper consentAgreementMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) - { - this.logger = logger; - this.kxpContextFactory = kxpContextFactory; - this.kx13ContextFactory = kx13ContextFactory; - this.consentMapper = consentMapper; - this.consentArchiveMapper = consentArchiveMapper; - this.consentAgreementMapper = consentAgreementMapper; - this.primaryKeyMappingContext = primaryKeyMappingContext; - this.protocol = protocol; - kxpContext = this.kxpContextFactory.CreateDbContext(); - } - - public void Dispose() => kxpContext.Dispose(); - - public async Task Handle(MigrateDataProtectionCommand request, CancellationToken cancellationToken) - { - await MigrateConsent(cancellationToken); - await MigrateConsentArchive(cancellationToken); - await MigrateConsentAgreement(cancellationToken, batchSize); - - return new GenericCommandResult(); - } - - private async Task MigrateConsent(CancellationToken cancellationToken) - { - await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); - - foreach (var kx13Consent in kx13Context.CmsConsents) - { - protocol.FetchedSource(kx13Consent); - logger.LogTrace("Migrating consent {ConsentName} with ConsentGuid {ConsentGuid}", kx13Consent.ConsentName, kx13Consent.ConsentGuid); - - var kxoConsent = await kxpContext.CmsConsents.FirstOrDefaultAsync(consent => consent.ConsentGuid == kx13Consent.ConsentGuid, cancellationToken); - protocol.FetchedTarget(kxoConsent); - - var mapped = consentMapper.Map(kx13Consent, kxoConsent); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - (var cmsConsent, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsent, nameof(cmsConsent)); - - if (newInstance) - { - kxpContext.CmsConsents.Add(cmsConsent); - } - else - { - kxpContext.CmsConsents.Update(cmsConsent); - } - - try - { - await kxpContext.SaveChangesAsync(cancellationToken); - - protocol.Success(kx13Consent, cmsConsent, mapped); - logger.LogEntitySetAction(newInstance, cmsConsent); - primaryKeyMappingContext.SetMapping(r => r.ConsentId, kx13Consent.ConsentId, cmsConsent.ConsentId); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, kx13Consent); - protocol.Append(HandbookReferences - .DbConstraintBroken(sqlException, kx13Consent) - .WithMessage("Failed to migrate consent, target database constraint broken.") - ); - - await kxpContext.DisposeAsync(); - kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - } - } - - return new GenericCommandResult(); - } - - private async Task MigrateConsentArchive(CancellationToken cancellationToken) - { - await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); - - foreach (var kx13ArchiveConsent in kx13Context.CmsConsentArchives) - { - protocol.FetchedSource(kx13ArchiveConsent); - logger.LogTrace("Migrating consent archive with ConsentArchiveGuid {ConsentGuid}", kx13ArchiveConsent.ConsentArchiveGuid); - - var kxoConsentArchive = await kxpContext.CmsConsentArchives.FirstOrDefaultAsync(consentArchive => consentArchive.ConsentArchiveGuid == kx13ArchiveConsent.ConsentArchiveGuid, cancellationToken); - protocol.FetchedTarget(kxoConsentArchive); - - var mapped = consentArchiveMapper.Map(kx13ArchiveConsent, kxoConsentArchive); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - (var cmsConsentArchive, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsentArchive, nameof(cmsConsentArchive)); - - if (newInstance) - { - kxpContext.CmsConsentArchives.Add(cmsConsentArchive); - } - else - { - kxpContext.CmsConsentArchives.Update(cmsConsentArchive); - } - - try - { - await kxpContext.SaveChangesAsync(cancellationToken); - - protocol.Success(kx13ArchiveConsent, cmsConsentArchive, mapped); - logger.LogEntitySetAction(newInstance, cmsConsentArchive); - primaryKeyMappingContext.SetMapping(r => r.ConsentArchiveGuid, - kx13ArchiveConsent.ConsentArchiveId, cmsConsentArchive.ConsentArchiveId); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, kx13ArchiveConsent); - protocol.Append(HandbookReferences - .DbConstraintBroken(sqlException, kx13ArchiveConsent) - .WithMessage("Failed to migrate consent archive, target database constraint broken.") - ); - - await kxpContext.DisposeAsync(); - kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - } - } - - return new GenericCommandResult(); - } - - private async Task MigrateConsentAgreement(CancellationToken cancellationToken, int batchSize) - { - await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); - int index = 0; - int indexFull = 0; - var consentAgreementUpdates = new List(); - var consentAgreementNews = new List(); - int itemsCount = kx13Context.CmsConsentAgreements.Count(); - - foreach (var kx13ConsentAgreement in kx13Context.CmsConsentAgreements) - { - protocol.FetchedSource(kx13ConsentAgreement); - logger.LogTrace("Migrating consent agreement with ConsentAgreementGuid {ConsentAgreementGuid}", kx13ConsentAgreement.ConsentAgreementGuid); - - var kxoConsentAgreement = await kxpContext.CmsConsentAgreements.FirstOrDefaultAsync(consentAgreement => consentAgreement.ConsentAgreementGuid == kx13ConsentAgreement.ConsentAgreementGuid, cancellationToken); - protocol.FetchedTarget(kxoConsentAgreement); - - var mapped = consentAgreementMapper.Map(kx13ConsentAgreement, kxoConsentAgreement); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - (var cmsConsentAgreement, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsentAgreement, nameof(cmsConsentAgreement)); - - if (newInstance) - { - consentAgreementNews.Add(cmsConsentAgreement); - } - else - { - consentAgreementUpdates.Add(cmsConsentAgreement); - } - } - - index++; - indexFull++; - - if (index == batchSize || indexFull == itemsCount) - { - kxpContext.CmsConsentAgreements.AddRange(consentAgreementNews); - kxpContext.CmsConsentAgreements.UpdateRange(consentAgreementUpdates); - - try - { - await kxpContext.SaveChangesAsync(cancellationToken); - - foreach (var newKx13ConsentAgreement in consentAgreementNews) - { - protocol.Success(kx13ConsentAgreement, newKx13ConsentAgreement, mapped); - logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was inserted", - newKx13ConsentAgreement.ConsentAgreementGuid); - } - - foreach (var updateKx13ConsentAgreement in consentAgreementUpdates) - { - protocol.Success(kx13ConsentAgreement, updateKx13ConsentAgreement, mapped); - logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was updated", - updateKx13ConsentAgreement.ConsentAgreementGuid); - } - } - catch (DbUpdateException dbUpdateException) when ( - dbUpdateException.InnerException is SqlException sqlException && - sqlException.Message.Contains("Cannot insert duplicate key row in object") - ) - { - await kxpContext.DisposeAsync(); - - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrints(consentAgreementNews) - ); - logger.LogEntitiesSetError(dbUpdateException, true, consentAgreementNews); - - - protocol.Append(HandbookReferences - .ErrorUpdatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrints(consentAgreementUpdates) - ); - - var cai = ConsentAgreementInfo.New(); - protocol.Append(HandbookReferences - .ErrorUpdatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrint(cai) - ); - - logger.LogEntitiesSetError(dbUpdateException, false, consentAgreementUpdates); - - kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - finally - { - index = 0; - consentAgreementUpdates = []; - consentAgreementNews = []; - } - } - } - - return new GenericCommandResult(); - } -} diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateMembersCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateMembersCommandHandler.cs deleted file mode 100644 index f64a4c63..00000000 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateMembersCommandHandler.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System.Diagnostics; - -using CMS.Membership; - -using MediatR; - -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.Core.KX13.Mappers; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KXP.Api.Enums; - -namespace Migration.Toolkit.Core.KX13.Handlers; - -public class MigrateMembersCommandHandler( - ILogger logger, - IDbContextFactory kx13ContextFactory, - IEntityMapper memberInfoMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private const string USER_PUBLIC = "public"; - - public void Dispose() - { - } - - public async Task Handle(MigrateMembersCommand request, CancellationToken cancellationToken) - { - await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); - - var kx13CmsUsers = kx13Context.CmsUsers - .Include(u => u.CmsUserSettingUserSettingsUserNavigation) - .Where(u => u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.None) - ; - - foreach (var kx13User in kx13CmsUsers) - { - protocol.FetchedSource(kx13User); - logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid} to member", kx13User.UserName, kx13User.UserGuid); - - var xbkMemberInfo = MemberInfoProvider.ProviderObject.Get(kx13User.UserGuid); - - protocol.FetchedTarget(xbkMemberInfo); - - // no member shall be admin, editor - Debug.Assert(kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin, "kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin"); - Debug.Assert(kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin, "kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin"); - Debug.Assert(kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor, "kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor"); - - if (xbkMemberInfo?.MemberName == USER_PUBLIC || kx13User.UserName == USER_PUBLIC) - { - continue; - } - - var mapped = memberInfoMapper.Map(new MemberInfoMapperSource(kx13User, kx13User.CmsUserSettingUserSettingsUserNavigation), xbkMemberInfo); - protocol.MappedTarget(mapped); - - SaveUserUsingKenticoApi(mapped, kx13User); - } - - return new GenericCommandResult(); - } - - private void SaveUserUsingKenticoApi(IModelMappingResult mapped, KX13M.CmsUser kx13User) - { - if (mapped is { Success: true } result) - { - (var memberInfo, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(memberInfo); - - try - { - MemberInfoProvider.ProviderObject.Set(memberInfo); - - protocol.Success(kx13User, memberInfo, mapped); - logger.LogEntitySetAction(newInstance, memberInfo); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, memberInfo); - protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, kx13User) - .WithData(new { kx13User.UserName, kx13User.UserGuid, kx13User.UserId }) - .WithMessage("Failed to migrate user, target database broken.") - ); - return; - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, memberInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(memberInfo) - ); - return; - } - - // left for OM_Activity - primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, memberInfo.MemberID); - } - } -} diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs deleted file mode 100644 index ecb616b3..00000000 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs +++ /dev/null @@ -1,84 +0,0 @@ -using CMS.DataEngine; - -using MediatR; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KX13.Context; - -namespace Migration.Toolkit.Core.KX13.Handlers; - -public class MigrateSettingKeysCommandHandler( - ILogger logger, - IEntityMapper mapper, - IDbContextFactory kx13ContextFactory, - ToolkitConfiguration toolkitConfiguration, - IProtocol protocol) - : IRequestHandler -{ - public async Task Handle(MigrateSettingKeysCommand request, CancellationToken cancellationToken) - { - var entityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); - - await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); - - logger.LogInformation("CmsSettingsKey synchronization starting"); - var cmsSettingsKeys = kx13Context.CmsSettingsKeys - .Where(csk => csk.SiteId == null) - .AsNoTrackingWithIdentityResolution() - ; - - foreach (var kx13CmsSettingsKey in cmsSettingsKeys) - { - protocol.FetchedSource(kx13CmsSettingsKey); - - var kxoGlobalSettingsKey = GetKxoSettingsKey(kx13CmsSettingsKey); - - bool canBeMigrated = !kxoGlobalSettingsKey?.KeyIsHidden ?? false; - var kxoCmsSettingsKey = kx13CmsSettingsKey.SiteId is null ? kxoGlobalSettingsKey : GetKxoSettingsKey(kx13CmsSettingsKey); - - if (!canBeMigrated) - { - logger.LogInformation("Setting with key '{KeyName}' is currently not supported for migration", kx13CmsSettingsKey.KeyName); - protocol.Append( - HandbookReferences - .NotCurrentlySupportedSkip() - .WithId(nameof(kx13CmsSettingsKey.KeyId), kx13CmsSettingsKey.KeyId) - .WithMessage("Settings key is not supported in target instance") - .WithData(new { kx13CmsSettingsKey.KeyName, kx13CmsSettingsKey.SiteId, kx13CmsSettingsKey.KeyGuid }) - ); - continue; - } - - protocol.FetchedTarget(kxoCmsSettingsKey); - - if (entityConfiguration.ExcludeCodeNames.Contains(kx13CmsSettingsKey.KeyName)) - { - protocol.Warning(HandbookReferences.CmsSettingsKeyExclusionListSkip, kx13CmsSettingsKey); - logger.LogWarning("KeyName {KeyName} is excluded => skipping", kx13CmsSettingsKey.KeyName); - continue; - } - - var mapped = mapper.Map(kx13CmsSettingsKey, kxoCmsSettingsKey); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - ArgumentNullException.ThrowIfNull(result.Item, nameof(result.Item)); - - SettingsKeyInfoProvider.ProviderObject.Set(result.Item); - - protocol.Success(kx13CmsSettingsKey, kxoCmsSettingsKey, mapped); - logger.LogEntitySetAction(result.NewInstance, result.Item); - } - } - - return new GenericCommandResult(); - } - - private SettingsKeyInfo? GetKxoSettingsKey(KX13M.CmsSettingsKey kx13CmsSettingsKey) => SettingsKeyInfoProvider.ProviderObject.Get(kx13CmsSettingsKey.KeyName); -} diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateSitesCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateSitesCommandHandler.cs deleted file mode 100644 index 6e3c0b25..00000000 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateSitesCommandHandler.cs +++ /dev/null @@ -1,191 +0,0 @@ -using CMS.ContentEngine; -using CMS.Websites; - -using Kentico.Xperience.UMT.Model; -using Kentico.Xperience.UMT.Services; - -using MediatR; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Helpers; -using Migration.Toolkit.KX13; -using Migration.Toolkit.KX13.Context; - -namespace Migration.Toolkit.Core.KX13.Handlers; - -// ReSharper disable once UnusedType.Global -public class MigrateSitesCommandHandler( - ILogger logger, - IDbContextFactory kx13ContextFactory, - IProtocol protocol, - IImporter importer) - : IRequestHandler -{ - public async Task Handle(MigrateSitesCommand request, CancellationToken cancellationToken) - { - await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); - var migratedCultureCodes = new Dictionary(StringComparer.CurrentCultureIgnoreCase); - foreach (var kx13CmsSite in kx13Context.CmsSites.Include(s => s.Cultures)) - { - protocol.FetchedSource(kx13CmsSite); - logger.LogTrace("Migrating site {SiteName} with SiteGuid {SiteGuid}", kx13CmsSite.SiteName, kx13CmsSite.SiteGuid); - - string defaultCultureCode = GetSiteCulture(kx13CmsSite); - var migratedSiteCultures = kx13CmsSite.Cultures.ToList(); - if (!migratedSiteCultures.Any(x => x.CultureCode.Equals(defaultCultureCode, StringComparison.InvariantCultureIgnoreCase))) - { - await using var ctx = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); - if (ctx.CmsCultures.FirstOrDefault(c => c.CultureCode == defaultCultureCode) is { } defaultCulture) - { - migratedSiteCultures.Add(defaultCulture); - } - } - - foreach (var cmsCulture in migratedSiteCultures) - { - var existing = ContentLanguageInfoProvider.ProviderObject.Get() - .WhereEquals(nameof(ContentLanguageInfo.ContentLanguageCultureFormat), cmsCulture.CultureCode) - .FirstOrDefault(); - - if (existing != null && existing.ContentLanguageGUID != cmsCulture.CultureGuid) - { - existing.ContentLanguageGUID = cmsCulture.CultureGuid; - existing.Update(); - } - - if (migratedCultureCodes.ContainsKey(cmsCulture.CultureCode)) - { - continue; - } - - var langResult = await importer.ImportAsync(new ContentLanguageModel - { - ContentLanguageGUID = cmsCulture.CultureGuid, - ContentLanguageDisplayName = cmsCulture.CultureName, - ContentLanguageName = cmsCulture.CultureCode, - ContentLanguageIsDefault = true, - ContentLanguageFallbackContentLanguageGuid = null, - ContentLanguageCultureFormat = cmsCulture.CultureCode - }); - - if (langResult is { Success: true, Imported: ContentLanguageInfo importedLanguage }) - { - migratedCultureCodes.TryAdd(cmsCulture.CultureCode, importedLanguage); - logger.LogTrace("Imported language {Language} from {Culture}", importedLanguage.ContentLanguageName, cmsCulture.CultureCode); - } - } - - - string? homePagePath = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, SettingsKeys.CMSHomePagePath); - int? cookieLevel = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, SettingsKeys.CMSDefaultCookieLevel) switch - { - "all" => CookieLevelConstants.ALL, - "visitor" => CookieLevelConstants.VISITOR, - "editor" => CookieLevelConstants.EDITOR, - "system" => CookieLevelConstants.SYSTEM, - "essential" => CookieLevelConstants.ESSENTIAL, - _ => null - }; - bool? storeFormerUrls = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSStoreFormerUrls") is string storeFormerUrlsStr - ? bool.TryParse(storeFormerUrlsStr, out bool sfu) ? sfu : null - : null; - - var channelResult = await importer.ImportAsync(new ChannelModel { ChannelDisplayName = kx13CmsSite.SiteDisplayName, ChannelName = kx13CmsSite.SiteName, ChannelGUID = kx13CmsSite.SiteGuid, ChannelType = ChannelType.Website }); - - var webSiteChannelResult = await importer.ImportAsync(new WebsiteChannelModel - { - WebsiteChannelGUID = kx13CmsSite.SiteGuid, - WebsiteChannelChannelGuid = kx13CmsSite.SiteGuid, - WebsiteChannelDomain = kx13CmsSite.SiteDomainName, - WebsiteChannelHomePage = homePagePath, - WebsiteChannelPrimaryContentLanguageGuid = migratedCultureCodes[defaultCultureCode].ContentLanguageGUID, - WebsiteChannelDefaultCookieLevel = cookieLevel, - WebsiteChannelStoreFormerUrls = storeFormerUrls - }); - - if (!webSiteChannelResult.Success) - { - if (webSiteChannelResult.ModelValidationResults != null) - { - foreach (var mvr in webSiteChannelResult.ModelValidationResults) - { - logger.LogError("Invalid channel properties {Members}: {ErrorMessage}", string.Join(", ", mvr.MemberNames), mvr.ErrorMessage); - } - } - else - { - logger.LogError(webSiteChannelResult.Exception, "Failed to migrate site"); - } - - return new CommandFailureResult(); - } - - if (webSiteChannelResult.Imported is WebsiteChannelInfo webSiteChannel) - { - string? cmsReCaptchaPublicKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSReCaptchaPublicKey"); - string? cmsReCaptchaPrivateKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSReCaptchaPrivateKey"); - - WebsiteCaptchaSettingsInfo? reCaptchaSettings = null; - string? cmsReCaptchaV3PrivateKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSReCaptchaV3PrivateKey"); - string? cmsRecaptchaV3PublicKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSRecaptchaV3PublicKey"); - double? cmsRecaptchaV3Threshold = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSRecaptchaV3Threshold"); - - if (!string.IsNullOrWhiteSpace(cmsReCaptchaV3PrivateKey) || !string.IsNullOrWhiteSpace(cmsRecaptchaV3PublicKey)) - { - reCaptchaSettings = new WebsiteCaptchaSettingsInfo - { - WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, - WebsiteCaptchaSettingsReCaptchaSiteKey = cmsRecaptchaV3PublicKey, - WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaV3PrivateKey, - WebsiteCaptchaSettingsReCaptchaThreshold = cmsRecaptchaV3Threshold ?? 0.5d, - WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV3 - }; - } - - if (!string.IsNullOrWhiteSpace(cmsReCaptchaPublicKey) || !string.IsNullOrWhiteSpace(cmsReCaptchaPrivateKey)) - { - if (reCaptchaSettings is not null) - { - logger.LogError(""" - Conflicting settings found, ReCaptchaV2 and ReCaptchaV3 is set simultaneously. - Remove setting keys 'CMSReCaptchaPublicKey', 'CMSReCaptchaPrivateKey' - or remove setting keys 'CMSReCaptchaV3PrivateKey', 'CMSRecaptchaV3PublicKey', 'CMSRecaptchaV3Threshold'. - """); - throw new InvalidOperationException("Invalid ReCaptcha settings"); - } - - reCaptchaSettings = new WebsiteCaptchaSettingsInfo - { - WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, - WebsiteCaptchaSettingsReCaptchaSiteKey = cmsReCaptchaPublicKey, - WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaPrivateKey, - WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV2 - }; - } - - if (reCaptchaSettings != null) - { - WebsiteCaptchaSettingsInfo.Provider.Set(reCaptchaSettings); - } - } - } - - return new GenericCommandResult(); - } - - private string GetSiteCulture(KX13M.CmsSite site) - { - // simplified logic from CMS.DocumentEngine.DefaultPreferredCultureEvaluator.Evaluate() - // domain alias skipped, HttpContext logic skipped - string? siteCulture = site.SiteDefaultVisitorCulture - ?? KenticoHelper.GetSettingsKey(kx13ContextFactory, site.SiteId, SettingsKeys.CMSDefaultCultureCode); - - return siteCulture - ?? throw new InvalidOperationException("Unknown site culture"); - } -} diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateUsersCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateUsersCommandHandler.cs deleted file mode 100644 index 01e1937f..00000000 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateUsersCommandHandler.cs +++ /dev/null @@ -1,236 +0,0 @@ -using CMS.Membership; - -using MediatR; - -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KXP.Api.Enums; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX13.Handlers; - -public class MigrateUsersCommandHandler( - ILogger logger, - IDbContextFactory kx13ContextFactory, - IEntityMapper userInfoMapper, - IEntityMapper roleMapper, - IEntityMapper userRoleMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private const string USER_PUBLIC = "public"; - - public void Dispose() - { - } - - public async Task Handle(MigrateUsersCommand request, CancellationToken cancellationToken) - { - await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); - - var kx13CmsUsers = kx13Context.CmsUsers - .Where(u => u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || u.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) - ; - - foreach (var kx13User in kx13CmsUsers) - { - protocol.FetchedSource(kx13User); - logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid}", kx13User.UserName, kx13User.UserGuid); - - var xbkUserInfo = UserInfoProvider.ProviderObject.Get(kx13User.UserGuid); - - protocol.FetchedTarget(xbkUserInfo); - - if (kx13User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin && xbkUserInfo != null) - { - protocol.Append(HandbookReferences.CmsUserAdminUserSkip.WithIdentityPrint(xbkUserInfo)); - logger.LogInformation("User with guid {UserGuid} is administrator, you need to update administrators manually => skipping", kx13User.UserGuid); - primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, xbkUserInfo.UserID); - continue; - } - - if (xbkUserInfo?.UserName == USER_PUBLIC || kx13User.UserName == USER_PUBLIC) - { - protocol.Append(HandbookReferences.CmsUserPublicUserSkip.WithIdentityPrint(xbkUserInfo)); - logger.LogInformation("User with guid {UserGuid} is public user, special case that can't be migrated => skipping", xbkUserInfo?.UserGUID ?? kx13User.UserGuid); - if (xbkUserInfo != null) - { - primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, xbkUserInfo.UserID); - } - - continue; - } - - var mapped = userInfoMapper.Map(kx13User, xbkUserInfo); - protocol.MappedTarget(mapped); - - await SaveUserUsingKenticoApi(mapped, kx13User); - } - - await MigrateUserCmsRoles(kx13Context, cancellationToken); - - return new GenericCommandResult(); - } - - private Task SaveUserUsingKenticoApi(IModelMappingResult mapped, KX13M.CmsUser kx13User) - { - if (mapped is { Success: true } result) - { - (var userInfo, bool newInstance) = result; - ArgumentNullException.ThrowIfNull(userInfo); - - try - { - UserInfoProvider.ProviderObject.Set(userInfo); - - protocol.Success(kx13User, userInfo, mapped); - logger.LogEntitySetAction(newInstance, userInfo); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, userInfo); - protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, kx13User) - .WithData(new { kx13User.UserName, kx13User.UserGuid, kx13User.UserId }) - .WithMessage("Failed to migrate user, target database broken.") - ); - return Task.CompletedTask; - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, userInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(userInfo) - ); - return Task.CompletedTask; - } - - primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, userInfo.UserID); - return Task.CompletedTask; - } - - return Task.CompletedTask; - } - - private async Task MigrateUserCmsRoles(KX13Context kx13Context, CancellationToken cancellationToken) - { - var kx13CmsRoles = kx13Context.CmsRoles - .Where(r => - r.CmsUserRoles.Any(ur => ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) - ) - .AsNoTracking() - .AsAsyncEnumerable(); - - await foreach (var kx13CmsRole in kx13CmsRoles.WithCancellation(cancellationToken)) - { - protocol.FetchedSource(kx13CmsRole); - - var xbkRoleInfo = RoleInfoProvider.ProviderObject.Get(kx13CmsRole.RoleGuid); - protocol.FetchedTarget(xbkRoleInfo); - var mapped = roleMapper.Map(kx13CmsRole, xbkRoleInfo); - protocol.MappedTarget(mapped); - - if (mapped is not (var roleInfo, var newInstance) { Success: true }) - { - continue; - } - - ArgumentNullException.ThrowIfNull(roleInfo, nameof(roleInfo)); - try - { - RoleInfoProvider.ProviderObject.Set(roleInfo); - - protocol.Success(kx13CmsRole, roleInfo, mapped); - logger.LogEntitySetAction(newInstance, roleInfo); - - primaryKeyMappingContext.SetMapping( - r => r.RoleId, - kx13CmsRole.RoleId, - roleInfo.RoleID - ); - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, roleInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(roleInfo) - ); - continue; - } - - await MigrateUserRole(kx13CmsRole.RoleId); - } - } - - private async Task MigrateUserRole(int kx13RoleId) - { - var kx13Context = await kx13ContextFactory.CreateDbContextAsync(); - var kx13UserRoles = kx13Context.CmsUserRoles - .Where(ur => - ur.RoleId == kx13RoleId && - (ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Editor || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.Admin || ur.User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin) - ) - .AsNoTracking() - .AsAsyncEnumerable(); - - await foreach (var kx13UserRole in kx13UserRoles) - { - protocol.FetchedSource(kx13UserRole); - if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.RoleId, kx13RoleId, out int xbkRoleId)) - { - var handbookRef = HandbookReferences - .MissingRequiredDependency(nameof(UserRoleInfo.RoleID), kx13UserRole.RoleId) - .NeedsManualAction(); - - protocol.Append(handbookRef); - logger.LogWarning("Unable to locate role in target instance with source RoleID '{RoleID}'", kx13UserRole.RoleId); - continue; - } - - if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.UserId, kx13UserRole.UserId, out int xbkUserId)) - { - continue; - } - - var xbkUserRole = UserRoleInfoProvider.ProviderObject.Get(xbkUserId, xbkRoleId); - protocol.FetchedTarget(xbkUserRole); - - var mapped = userRoleMapper.Map(kx13UserRole, xbkUserRole); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true }) - { - (var userRoleInfo, bool newInstance) = mapped; - ArgumentNullException.ThrowIfNull(userRoleInfo); - - try - { - UserRoleInfoProvider.ProviderObject.Set(userRoleInfo); - - protocol.Success(kx13UserRole, userRoleInfo, mapped); - logger.LogEntitySetAction(newInstance, userRoleInfo); - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, userRoleInfo); - protocol.Append(HandbookReferences.ErrorSavingTargetInstance(ex) - .WithData(new { kx13UserRole.UserRoleId, kx13UserRole.UserId, kx13UserRole.RoleId }) - .WithMessage("Failed to migrate user role") - ); - } - } - } - } -} diff --git a/Migration.Toolkit.Core.KX13/Helpers/KenticoHelper.cs b/Migration.Toolkit.Core.KX13/Helpers/KenticoHelper.cs deleted file mode 100644 index 787cadd0..00000000 --- a/Migration.Toolkit.Core.KX13/Helpers/KenticoHelper.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Globalization; - -using CMS.Helpers; - -using Microsoft.EntityFrameworkCore; - -using Migration.Toolkit.KX13.Context; - -namespace Migration.Toolkit.Core.KX13.Helpers; - -public static class KenticoHelper -{ - public static void CopyCustomData(ContainerCustomData target, string? sourceXml) - { - var customNodeData = new ContainerCustomData(); - customNodeData.LoadData(sourceXml); - foreach (string? columnName in customNodeData.ColumnNames) - { - target.SetValue(columnName, customNodeData.GetValue(columnName)); - } - } - - public static string? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) - { - using var kx13Context = ctxf.CreateDbContext(); - var keys = kx13Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); - - return (keys.FirstOrDefault(x => x.SiteId == siteId) - ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; - } - - public static T? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) where T : struct, IParsable - { - using var kx13Context = ctxf.CreateDbContext(); - var keys = kx13Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); - string? value = (keys.FirstOrDefault(x => x.SiteId == siteId) - ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; - - - return T.TryParse(value, CultureInfo.InvariantCulture, out var result) - ? result - : null; - } - - public static bool? TryGetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName, out T? result) where T : IParsable => T.TryParse(GetSettingsKey(ctxf, siteId, keyName), CultureInfo.InvariantCulture, out result); -} diff --git a/Migration.Toolkit.Core.KX13/Helpers/PrintHelper.cs b/Migration.Toolkit.Core.KX13/Helpers/PrintHelper.cs deleted file mode 100644 index 8ee16d2d..00000000 --- a/Migration.Toolkit.Core.KX13/Helpers/PrintHelper.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Migration.Toolkit.Core.KX13.Helpers; - -public static class PrintHelper -{ - public static string PrintDictionary(Dictionary dictionary) => - string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); -} diff --git a/Migration.Toolkit.Core.KX13/Helpers/Printer.cs b/Migration.Toolkit.Core.KX13/Helpers/Printer.cs deleted file mode 100644 index 79563369..00000000 --- a/Migration.Toolkit.Core.KX13/Helpers/Printer.cs +++ /dev/null @@ -1,103 +0,0 @@ -using CMS.DataEngine; -using CMS.FormEngine; -using CMS.Globalization; -using CMS.MediaLibrary; -using CMS.Membership; -using CMS.Modules; - -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX13.Helpers; - -public class Printer -{ - public static string PrintKxpModelInfo(T model) - { - string currentTypeName = ReflectionHelper.CurrentType.Name; - - return model switch - { - MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", - MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", - CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", - CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", - CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", - CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", - CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", - CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", - OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", - - null => $"{currentTypeName}: ", - _ => $"TODO: {typeof(T).FullName}" - }; - } - - public static string GetEntityIdentityPrint(T model, bool printType = true) - { - string currentTypeName = ReflectionHelper.CurrentType.Name; - - string Fallback(object obj) => printType - ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" - : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}"; - - string FormatModel(string inner) => printType - ? $"{currentTypeName}({inner})" - : $"{inner}"; - - return model switch - { - MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), - MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), - DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), - - CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), - StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), - - ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), - AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), - UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), - RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), - MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), - - CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), - CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), - CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), - - KX13M.CmsPageTemplateConfiguration item => FormatModel($"ID={item.PageTemplateConfigurationId}, GUID={item.PageTemplateConfigurationGuid}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteId}"), - KX13M.CmsRole item => FormatModel($"ID={item.RoleId}, GUID={item.RoleGuid}, Name={item.RoleName}, SiteId={item.SiteId}"), - KX13M.CmsAttachment item => FormatModel($"ID={item.AttachmentId}, GUID={item.AttachmentGuid}, Name={item.AttachmentName}"), - KX13M.CmsClass item => FormatModel($"ID={item.ClassId}, GUID={item.ClassGuid}, Name={item.ClassName}"), - KX13M.CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - KX13M.CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - KX13M.CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - KX13M.CmsCountry item => FormatModel($"ID={item.CountryId}, GUID={item.CountryGuid}, Name={item.CountryName}"), - KX13M.CmsState item => FormatModel($"ID={item.StateId}, GUID={item.StateGuid}, Name={item.StateName}"), - KX13M.CmsTree item => FormatModel($"NodeID={item.NodeId}, NodeGUID={item.NodeGuid}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), - KX13M.CmsDocument item => FormatModel($"NodeID={item.DocumentNodeId}, DocumentID={item.DocumentId}, DocumentGUID={item.DocumentGuid}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), - KX13M.CmsResource item => FormatModel($"ID={item.ResourceId}, GUID={item.ResourceGuid}, Name={item.ResourceName}"), - - null => $" ref of {currentTypeName}", - _ => Fallback(model) - }; - } - - public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); - - public static string PrintEnumValues(string separator) where TEnum : struct, Enum => string.Join(separator, Enum.GetValues()); -} - -public class PrintService : IPrintService -{ - public string PrintKxpModelInfo(T model) => Printer.PrintKxpModelInfo(model); - - public string GetEntityIdentityPrint(T model, bool printType = true) => Printer.GetEntityIdentityPrint(model, printType); - - public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => Printer.GetEntityIdentityPrints(models, separator); - - public string PrintEnumValues(string separator) where TEnum : struct, Enum => Printer.PrintEnumValues(separator); -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/AlternativeFormMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/AlternativeFormMapper.cs deleted file mode 100644 index 36a90ff2..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/AlternativeFormMapper.cs +++ /dev/null @@ -1,90 +0,0 @@ -using CMS.DataEngine; -using CMS.FormEngine; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Api.Services.CmsClass; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public record AlternativeFormMapperSource(KX13M.CmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); - -public class AlternativeFormMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, FieldMigrationService fieldMigrationService) - : EntityMapperBase(logger, pkContext, protocol) -{ - protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - => AlternativeFormInfo.New(); - - protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (source, xbkFormClass) = sourceObj; - - target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormClassId, out int? classId) - ? classId ?? 0 - : 0; - target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormCoupledClassId, out int? coupledClassId) - ? coupledClassId ?? 0 - : 0; - - bool coupledClassIsDeprecated = - source.FormCoupledClass?.ClassName is { } coupledClassName && - Kx13SystemClass.NoLongerSupported.Contains(coupledClassName); - - bool classIsSysInternal = Kx13SystemClass.All.Contains(source.FormClass.ClassName); - - string mergedDefinition = source.FormClass.ClassFormDefinition; - if (source.FormCoupledClass != null) - { - logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", source.FormCoupledClass.ClassName, source.FormClass.ClassName); - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormCoupledClass.ClassFormDefinition); - } - - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); - - var patcher = new FormDefinitionPatcher( - logger, - mergedDefinition, - fieldMigrationService, - source.FormClass.ClassIsForm.GetValueOrDefault(false), - source.FormClass.ClassIsDocumentType, - false, - !classIsSysInternal, - true - ); - - var fieldNames = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); - - patcher.PatchFields(); - - var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); - - if (coupledClassIsDeprecated && source.FormCoupledClass != null) - { - logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", source.FormCoupledClass.ClassName); - patcher.RemoveFields(source.FormCoupledClass.ClassFormDefinition); - - var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); - } - - string result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); - - string formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); - - target.FormDefinition = formDefinitionDifference; - - target.FormDisplayName = source.FormDisplayName; - target.FormGUID = source.FormGuid; - target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); - target.FormLastModified = source.FormLastModified; - target.FormName = source.FormName; - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsAttachmentMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsAttachmentMapper.cs deleted file mode 100644 index 3b67ad5e..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsAttachmentMapper.cs +++ /dev/null @@ -1,62 +0,0 @@ -using CMS.Base; -using CMS.MediaLibrary; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.Core.KX13.Helpers; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public record CmsAttachmentMapperSource( - KX13M.CmsAttachment Attachment, - int TargetLibraryId, - IUploadedFile File, - string LibrarySubFolder, - KX13M.CmsDocument? AttachmentDocument); - -public class CmsAttachmentMapper : EntityMapperBase -{ - private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; - - public CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => - // library name is generated with site name in it - new(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); - - protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - (var cmsAttachment, int targetLibraryId, _, _, var attachmentDocument) = args; - - target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); - target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; - target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; - target.FileExtension = cmsAttachment.AttachmentExtension; - target.FileMimeType = cmsAttachment.AttachmentMimeType; - target.FileSize = cmsAttachment.AttachmentSize; - target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; - target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; - target.FileGUID = cmsAttachment.AttachmentGuid; - target.FileLibraryID = targetLibraryId; - - // target.FileCreatedByUserID = cmsAttachment.?; - // target.FileModifiedByUserID = cmsAttachment.?; - // target.FileCreatedWhen = cmsAttachment.?; - - target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; - - KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); - - if (attachmentDocument != null) - { - target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentDocument.DocumentNode.NodeAliasPath); - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentAgreementMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentAgreementMapper.cs deleted file mode 100644 index c564ed84..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentAgreementMapper.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public class CmsConsentAgreementMapper : EntityMapperBase -{ - public CmsConsentAgreementMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override CmsConsentAgreement? CreateNewInstance(KX13M.CmsConsentAgreement source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsentAgreement MapInternal(KX13M.CmsConsentAgreement source, CmsConsentAgreement target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentAgreementGuid = source.ConsentAgreementGuid; - target.ConsentAgreementRevoked = source.ConsentAgreementRevoked; - target.ConsentAgreementConsentHash = source.ConsentAgreementConsentHash; - target.ConsentAgreementTime = source.ConsentAgreementTime; - - if (mappingHelper.TranslateRequiredId(c => c.ContactId, source.ConsentAgreementContactId, out int contactId)) - { - target.ConsentAgreementContactId = contactId; - } - - if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentAgreementConsentId, out int consentId)) - { - target.ConsentAgreementConsentId = consentId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentArchiveMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentArchiveMapper.cs deleted file mode 100644 index 874e3c11..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentArchiveMapper.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public class CmsConsentArchiveMapper : EntityMapperBase -{ - public CmsConsentArchiveMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override CmsConsentArchive? CreateNewInstance(KX13M.CmsConsentArchive source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsentArchive MapInternal(KX13M.CmsConsentArchive source, CmsConsentArchive target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentArchiveContent = source.ConsentArchiveContent; - target.ConsentArchiveGuid = source.ConsentArchiveGuid; - target.ConsentArchiveLastModified = source.ConsentArchiveLastModified; - target.ConsentArchiveHash = source.ConsentArchiveHash; - - if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentArchiveConsentId, out int consentId)) - { - target.ConsentArchiveConsentId = consentId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentMapper.cs deleted file mode 100644 index 52af062b..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentMapper.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System.Text; -using System.Xml.Linq; -using System.Xml.XPath; - -using CMS.ContentEngine; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public class CmsConsentMapper : EntityMapperBase -{ - public CmsConsentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override CmsConsent? CreateNewInstance(KX13M.CmsConsent source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsent MapInternal(KX13M.CmsConsent source, CmsConsent target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentDisplayName = source.ConsentDisplayName; - var defaultContentLanguageInfo = ContentLanguageInfo.Provider.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageIsDefault), true).FirstOrDefault() ?? throw new InvalidCastException("Missing default content language"); - target.ConsentName = source.ConsentName; - target.ConsentContent = ConsentContentPatcher.PatchConsentContent(source.ConsentContent, defaultContentLanguageInfo); - target.ConsentGuid = source.ConsentGuid; - target.ConsentLastModified = source.ConsentLastModified; - target.ConsentHash = source.ConsentHash; - - return target; - } -} - -static file class ConsentContentPatcher -{ - public static string PatchConsentContent(string content, ContentLanguageInfo defaultContentLanguage) - { - if (string.IsNullOrWhiteSpace(content)) - { - return content; - } - - XDocument doc; - try - { - doc = XDocument.Parse(content); - } - catch (Exception) - { - // cannot patch xml that cannot be parsed - return content; - } - - foreach (var cultureCodeElement in doc.XPathSelectElements("//CultureCode")) - { - cultureCodeElement.Name = "LanguageName"; - if (!string.Equals(defaultContentLanguage.ContentLanguageName, cultureCodeElement.Value, StringComparison.InvariantCultureIgnoreCase)) - { - // mLogger.LogWarning($"Consent '{consentInfo.ConsentName}' has unknown content language set '{cultureCodeElement.Value}'"); - } - - // if elements are not swapped, FULLTEXT is not shown in UI - var p = cultureCodeElement.NextNode; - if (p is XElement e && e.Name == "FullText") - { - p.ReplaceWith(cultureCodeElement); - cultureCodeElement.ReplaceWith(p); - } - } - - var builder = new StringBuilder(); - using (var writer = new CMS.IO.StringWriter(builder)) - { - doc.Save(writer); - } - - return builder.ToString(); - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsCategoryMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsCategoryMapper.cs deleted file mode 100644 index 4a86002f..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsCategoryMapper.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public class CmsSettingsCategoryMapper( - ILogger logger, - PrimaryKeyMappingContext pkContext, - IProtocol protocol, - IEntityMapper cmsResourceMapper) - : EntityMapperBase(logger, pkContext, protocol) -{ - protected override CmsSettingsCategory? CreateNewInstance(KX13M.CmsSettingsCategory source, MappingHelper mappingHelper, - AddFailure addFailure) => new(); - - - protected override CmsSettingsCategory MapInternal(KX13M.CmsSettingsCategory source, CmsSettingsCategory target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - // no category guid to match on... - if (newInstance) - { - target.CategoryOrder = source.CategoryOrder; - target.CategoryName = source.CategoryName; - target.CategoryDisplayName = source.CategoryDisplayName; - target.CategoryIdpath = source.CategoryIdpath; - target.CategoryLevel = source.CategoryLevel; - target.CategoryChildCount = source.CategoryChildCount; - target.CategoryIconPath = source.CategoryIconPath; - target.CategoryIsGroup = source.CategoryIsGroup; - target.CategoryIsCustom = source.CategoryIsCustom; - } - - if (source.CategoryResource != null) - { - if (target.CategoryResource != null && source.CategoryResourceId != null && target.CategoryResourceId != null) - { - // skip if target is present - logger.LogTrace("Skipping category resource '{ResourceGuid}', already present in target instance", target.CategoryResource.ResourceGuid); - pkContext.SetMapping(r => r.ResourceId, source.CategoryResourceId.Value, target.CategoryResourceId.Value); - } - else - { - switch (cmsResourceMapper.Map(source.CategoryResource, target.CategoryResource)) - { - case { Success: true } result: - { - target.CategoryResource = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result.HandbookReference)); - break; - } - - default: - break; - } - } - } - else if (mappingHelper.TranslateIdAllowNulls(r => r.ResourceId, source.CategoryResourceId, out int? categoryResourceId)) - { - target.CategoryResourceId = categoryResourceId; - } - - if (source.CategoryParent != null) - { - switch (Map(source.CategoryParent, target.CategoryParent)) - { - case { Success: true } result: - { - target.CategoryParent = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result.HandbookReference)); - break; - } - - default: - break; - } - } - else if (mappingHelper.TranslateIdAllowNulls(c => c.CategoryId, source.CategoryParentId, out int? categoryParentId)) - { - target.CategoryParentId = categoryParentId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsKeyMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsKeyMapper.cs deleted file mode 100644 index f61b965c..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsKeyMapper.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.Diagnostics; - -using CMS.DataEngine; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public class CmsSettingsKeyMapper : EntityMapperBase -{ - private const string SOURCE_KEY_NAME = "CMSDefaultUserID"; - - public CmsSettingsKeyMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override SettingsKeyInfo CreateNewInstance(KX13M.CmsSettingsKey source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override SettingsKeyInfo MapInternal(KX13M.CmsSettingsKey source, SettingsKeyInfo target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - if (newInstance) - { - target.KeyName = source.KeyName; - target.KeyDisplayName = source.KeyDisplayName; - target.KeyDescription = source.KeyDescription; - target.KeyType = source.KeyType; - target.KeyGUID = source.KeyGuid; - target.KeyValidation = source.KeyValidation; - target.KeyEditingControlPath = source.KeyEditingControlPath; - target.KeyFormControlSettings = source.KeyFormControlSettings; - target.KeyExplanationText = source.KeyExplanationText; - } - else - { - target.KeyName = source.KeyName; - target.KeyDescription = source.KeyDescription; - target.KeyType = source.KeyType; - target.KeyValidation = source.KeyValidation; - target.KeyEditingControlPath = source.KeyEditingControlPath; - target.KeyFormControlSettings = source.KeyFormControlSettings; - target.KeyExplanationText = source.KeyExplanationText; - } - - // special migrations for keys - switch (source.KeyName) - { - case SOURCE_KEY_NAME: - { - target.KeyValue = int.TryParse(source.KeyValue, out int cmsDefaultUserId) - ? mappingHelper.TranslateRequiredId(u => u.UserId, cmsDefaultUserId, out int targetCmsDefaultUserId) - ? targetCmsDefaultUserId.ToString() - : source.KeyValue - : source.KeyValue; - break; - } - default: - target.KeyValue = source.KeyValue; - break; - } - - Debug.Assert(!source.SiteId.HasValue, "!source.SiteId.HasValue"); - target.KeyLastModified = source.KeyLastModified; - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsUserMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsUserMapper.cs deleted file mode 100644 index d65321e1..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsUserMapper.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public class CmsUserMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override CmsUser CreateNewInstance(KX13M.CmsUser tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsUser MapInternal(KX13M.CmsUser source, CmsUser target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.UserGuid != target.UserGuid) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.UserName = source.UserName; - target.FirstName = source.FirstName; - target.LastName = source.LastName; - target.Email = source.Email; - target.UserPassword = source.UserPassword; - target.UserEnabled = source.UserEnabled; - target.UserCreated = source.UserCreated; - target.LastLogon = source.LastLogon; - target.UserGuid = source.UserGuid; - target.UserLastModified = source.UserLastModified; - target.UserSecurityStamp = source.UserSecurityStamp; - target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - target.UserIsPendingRegistration = false; - target.UserPasswordLastChanged = null; - target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - foreach (var sourceCmsUserRole in source.CmsUserRoles) - { - if (mappingHelper.TranslateRequiredId(r => r.RoleId, sourceCmsUserRole.RoleId, out int targetRoleId)) - { - if (target.CmsUserRoles.All(x => x.RoleId != targetRoleId)) - { - target.CmsUserRoles.Add(new CmsUserRole { RoleId = targetRoleId, User = target }); - } - } - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CountryInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CountryInfoMapper.cs deleted file mode 100644 index f0eb39da..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/CountryInfoMapper.cs +++ /dev/null @@ -1,30 +0,0 @@ -using CMS.Globalization; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public class CountryInfoMapper : EntityMapperBase -{ - public CountryInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override CountryInfo? CreateNewInstance(KX13M.CmsCountry source, MappingHelper mappingHelper, AddFailure addFailure) - => CountryInfo.New(); - - protected override CountryInfo MapInternal(KX13M.CmsCountry source, CountryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.CountryName = source.CountryName; - target.CountryDisplayName = source.CountryDisplayName; - target.CountryGUID = source.CountryGuid; - target.CountryLastModified = source.CountryLastModified; - target.CountryThreeLetterCode = source.CountryThreeLetterCode; - target.CountryTwoLetterCode = source.CountryTwoLetterCode; - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/MemberInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/MemberInfoMapper.cs deleted file mode 100644 index b59e9cec..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/MemberInfoMapper.cs +++ /dev/null @@ -1,183 +0,0 @@ -using System.Data; - -using CMS.FormEngine; -using CMS.Membership; - -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KXP.Api; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public record MemberInfoMapperSource(KX13M.CmsUser User, KX13M.CmsUserSetting UserSetting); - -public class MemberInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration, - IDbContextFactory kx13DbContextFactory) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - public static IReadOnlyList MigratedUserFields = new List - { - nameof(KX13M.CmsUser.UserGuid), - nameof(KX13M.CmsUser.UserName), - nameof(KX13M.CmsUser.Email), - // nameof(KX13M.CmsUser.UserPassword), - nameof(KX13M.CmsUser.UserEnabled), - nameof(KX13M.CmsUser.UserCreated), - nameof(KX13M.CmsUser.UserSecurityStamp) - }; - - protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (user, userSetting) = source; - - if (!newInstance && user.UserGuid != target.MemberGuid) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - // target.UserName = source.UserName; - target.MemberName = user.UserName; - - // target.Email = source.Email; - target.MemberEmail = user.Email; - - // target.SetValue("UserPassword", source.UserPassword); - target.MemberPassword = null; // source.UserPassword; // not migrated - - // target.UserEnabled = source.UserEnabled; - target.MemberEnabled = user.UserEnabled; - - target.SetValue("UserCreated", user.UserCreated); - target.MemberCreated = user.UserCreated.GetValueOrDefault(); - - // target.UserGUID = source.UserGuid; - target.MemberGuid = user.UserGuid; - - target.MemberSecurityStamp = user.UserSecurityStamp; - - // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - // OBSOLETE: target.UserIsPendingRegistration = false; - // OBSOLETE: target.UserPasswordLastChanged = null; - // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); - foreach (var customizedFieldInfo in customized) - { - string fieldName = customizedFieldInfo.FieldName; - - if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out object? value) || - ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) - { - target.SetValue(fieldName, value); - } - } - - using var kx13Context = kx13DbContextFactory.CreateDbContext(); - var uDci = kx13Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_user); - if (uDci != null) - { - var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(uDci?.ClassFormDefinition)).ToList(); - if (userCustomizedFields.Count > 0) - { - try - { - string query = - $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.User.UserId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - } - - var usDci = kx13Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_usersettings); - if (usDci != null) - { - var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); - if (userSettingsCustomizedFields.Count > 0) - { - try - { - string query = - $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userSettingsCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserSettingsInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); - } - } - } - - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/OmContactGroupMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/OmContactGroupMapper.cs deleted file mode 100644 index 7416c148..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/OmContactGroupMapper.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public class OmContactGroupMapper : EntityMapperBase -{ - public OmContactGroupMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override OmContactGroup? CreateNewInstance(KX13M.OmContactGroup tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override OmContactGroup MapInternal(KX13M.OmContactGroup source, OmContactGroup target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ContactGroupName = source.ContactGroupName; - target.ContactGroupDisplayName = source.ContactGroupDisplayName; - target.ContactGroupDescription = source.ContactGroupDescription; - target.ContactGroupDynamicCondition = source.ContactGroupDynamicCondition; - target.ContactGroupEnabled = source.ContactGroupEnabled; - target.ContactGroupLastModified = source.ContactGroupLastModified; - target.ContactGroupGuid = source.ContactGroupGuid; - target.ContactGroupStatus = source.ContactGroupStatus; - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/OmContactStatusMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/OmContactStatusMapper.cs deleted file mode 100644 index 0ad2916a..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/OmContactStatusMapper.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public class OmContactStatusMapper : EntityMapperBase -{ - public OmContactStatusMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override OmContactStatus? CreateNewInstance(KX13M.OmContactStatus tSourceEntity, MappingHelper mappingHelper, - AddFailure addFailure) => new(); - - protected override OmContactStatus MapInternal(KX13M.OmContactStatus source, OmContactStatus target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ContactStatusName = source.ContactStatusName; - target.ContactStatusDisplayName = source.ContactStatusDisplayName; - target.ContactStatusDescription = source.ContactStatusDescription; - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/RoleInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/RoleInfoMapper.cs deleted file mode 100644 index 87312e87..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/RoleInfoMapper.cs +++ /dev/null @@ -1,32 +0,0 @@ -using CMS.Membership; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public class RoleInfoMapper : EntityMapperBase -{ - public RoleInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override RoleInfo? CreateNewInstance(KX13M.CmsRole source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override RoleInfo MapInternal(KX13M.CmsRole source, RoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.RoleDisplayName = source.RoleDisplayName; - target.RoleName = source.RoleName; - target.RoleDescription = source.RoleDescription; - target.RoleGUID = source.RoleGuid; - target.RoleLastModified = source.RoleLastModified; - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/StateInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/StateInfoMapper.cs deleted file mode 100644 index 26ef9e68..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/StateInfoMapper.cs +++ /dev/null @@ -1,35 +0,0 @@ -using CMS.Globalization; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public class StateInfoMapper : EntityMapperBase -{ - public StateInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override StateInfo? CreateNewInstance(KX13M.CmsState source, MappingHelper mappingHelper, AddFailure addFailure) - => StateInfo.New(); - - protected override StateInfo MapInternal(KX13M.CmsState source, StateInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.StateName = source.StateName; - target.StateDisplayName = source.StateDisplayName; - target.StateLastModified = source.StateLastModified; - target.StateGUID = source.StateGuid; - target.StateCode = source.StateCode; - - if (mappingHelper.TranslateRequiredId(k => k.CountryId, source.CountryId, out int countryId)) - { - target.CountryID = countryId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/UserInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/UserInfoMapper.cs deleted file mode 100644 index 1c503515..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/UserInfoMapper.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System.Data; - -using CMS.Membership; - -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Api; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public class UserInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override UserInfo CreateNewInstance(KX13M.CmsUser source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override UserInfo MapInternal(KX13M.CmsUser source, UserInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.UserGuid != target.UserGUID) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.UserName = source.UserName; - target.FirstName = source.FirstName; - target.LastName = source.LastName; - target.Email = source.Email; - // target.UserPassword = source.UserPassword; - target.SetValue("UserPassword", source.UserPassword); - target.UserEnabled = source.UserEnabled; - target.SetValue("UserCreated", source.UserCreated); - // target.UserCreated = source.UserCreated; - target.SetValue("LastLogon", source.LastLogon); - // target.LastLogon = source.LastLogon; - target.UserGUID = source.UserGuid; - target.UserLastModified = source.UserLastModified; - target.UserSecurityStamp = source.UserSecurityStamp; - - target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - target.UserIsPendingRegistration = false; - target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - var customizedFields = kxpClassFacade.GetCustomizedFieldInfos(UserInfo.TYPEINFO.ObjectClassName).ToList(); - if (customizedFields.Count > 0) - { - try - { - string query = - $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in customizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Mappers/UserRoleInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/UserRoleInfoMapper.cs deleted file mode 100644 index fcb9e05f..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/UserRoleInfoMapper.cs +++ /dev/null @@ -1,34 +0,0 @@ -using CMS.Membership; - -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; - -namespace Migration.Toolkit.Core.KX13.Mappers; - -public class UserRoleInfoMapper : EntityMapperBase -{ - public UserRoleInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override UserRoleInfo? CreateNewInstance(KX13M.CmsUserRole source, MappingHelper mappingHelper, AddFailure addFailure) - => UserRoleInfo.New(); - - protected override UserRoleInfo MapInternal(KX13M.CmsUserRole source, UserRoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (mappingHelper.TranslateRequiredId(r => r.RoleId, source.RoleId, out int xbkRoleId)) - { - target.RoleID = xbkRoleId; - } - - if (mappingHelper.TranslateRequiredId(r => r.UserId, source.UserId, out int xbkUserId)) - { - target.UserID = xbkUserId; - } - - return target; - } -} diff --git a/Migration.Toolkit.Core.KX13/Migration.Toolkit.Core.KX13.csproj b/Migration.Toolkit.Core.KX13/Migration.Toolkit.Core.KX13.csproj deleted file mode 100644 index 97150702..00000000 --- a/Migration.Toolkit.Core.KX13/Migration.Toolkit.Core.KX13.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - Migration.Toolkit.Core.KX13 - - - - - - - - - - - - - - - - diff --git a/Migration.Toolkit.Core.KX13/Providers/ContentItemNameProvider.cs b/Migration.Toolkit.Core.KX13/Providers/ContentItemNameProvider.cs deleted file mode 100644 index 4baa9a43..00000000 --- a/Migration.Toolkit.Core.KX13/Providers/ContentItemNameProvider.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CMS.Base; -using CMS.ContentEngine.Internal; -using CMS.Helpers; - -namespace Migration.Toolkit.Core.KX13.Providers; - -internal class ContentItemNameProvider -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) => this.codeNameValidator = codeNameValidator; - - public Task Get(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); - } - - async Task Get(string name) - { - string codeName = ValidationHelper.GetCodeName(name, useUnicode: false); - - bool isCodeNameValid = ValidationHelper.IsCodeName(codeName); - - if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) - { - codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); - } - - var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); - - return await uniqueCodeNameProvider.GetUniqueValue(codeName); - } - - return Get(name); - } -} diff --git a/Migration.Toolkit.Core.KX13/Providers/ContentItemNameValidator.cs b/Migration.Toolkit.Core.KX13/Providers/ContentItemNameValidator.cs deleted file mode 100644 index f55e5e7d..00000000 --- a/Migration.Toolkit.Core.KX13/Providers/ContentItemNameValidator.cs +++ /dev/null @@ -1,18 +0,0 @@ -using CMS.ContentEngine.Internal; - -namespace Migration.Toolkit.Core.KX13.Providers; - -internal class ContentItemNameValidator : IContentItemNameValidator -{ - /// - public bool IsUnique(string name) => IsUnique(0, name); - - - /// - public bool IsUnique(int id, string name) - { - var contentItemInfo = new ContentItemInfo { ContentItemID = id, ContentItemName = name }; - - return contentItemInfo.CheckUniqueCodeName(); - } -} diff --git a/Migration.Toolkit.Core.KX13/Providers/UniqueContentItemNameProvider.cs b/Migration.Toolkit.Core.KX13/Providers/UniqueContentItemNameProvider.cs deleted file mode 100644 index 6e029e10..00000000 --- a/Migration.Toolkit.Core.KX13/Providers/UniqueContentItemNameProvider.cs +++ /dev/null @@ -1,38 +0,0 @@ -using CMS.Base; -using CMS.ContentEngine.Internal; - -namespace Migration.Toolkit.Core.KX13.Providers; - -internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) - : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) => this.codeNameValidator = codeNameValidator; - - public override Task GetUniqueValue(string inputValue) => base.GetUniqueValue(AddSuffix(inputValue)); - - - private string AddSuffix(string codeName) - { - string randomSuffix = GetRandomSuffix(); - string codeNameWithSuffix = codeName += randomSuffix; - - if (codeNameWithSuffix.Length > MaxLength) - { - int availableLength = MaxLength - randomSuffix.Length; - - codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; - } - - return codeNameWithSuffix; - } - - - /// - protected override Task IsValueUnique(string value) => Task.FromResult(codeNameValidator.IsUnique(value)); -} diff --git a/Migration.Toolkit.Core.KX13/Services/CmsClass/AttachmentSelectorItem.cs b/Migration.Toolkit.Core.KX13/Services/CmsClass/AttachmentSelectorItem.cs deleted file mode 100644 index 9f3e60dc..00000000 --- a/Migration.Toolkit.Core.KX13/Services/CmsClass/AttachmentSelectorItem.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Newtonsoft.Json; - -namespace Migration.Toolkit.Core.KX13.Services.CmsClass; - -/// Represents an item for the attachment selector. -public class AttachmentSelectorItem -{ - /// Attachment GUID. - [JsonProperty("fileGuid")] - public Guid FileGuid { get; set; } -} diff --git a/Migration.Toolkit.Core.KX13/Services/CountryMigrator.cs b/Migration.Toolkit.Core.KX13/Services/CountryMigrator.cs deleted file mode 100644 index f15da902..00000000 --- a/Migration.Toolkit.Core.KX13/Services/CountryMigrator.cs +++ /dev/null @@ -1,104 +0,0 @@ -using CMS.Globalization; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KXP.Api; - -namespace Migration.Toolkit.Core.KX13.Services; - -public class CountryMigrator( - ILogger logger, - IDbContextFactory kx13ContextFactory, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - IEntityMapper countryMapper, - IEntityMapper stateMapper, - KxpApiInitializer kxpApiInitializer) -{ - public void MigrateCountriesAndStates() - { - if (!kxpApiInitializer.EnsureApiIsInitialized()) - { - throw new InvalidOperationException("Falied to initialize kentico API. Please check configuration."); - } - - var kx13Context = kx13ContextFactory.CreateDbContext(); - - var kx13Countries = kx13Context.CmsCountries.AsNoTracking(); - foreach (var kx13CmsCountry in kx13Countries) - { - var kxpCountryInfo = CountryInfoProvider.ProviderObject.Get(kx13CmsCountry.CountryName); - - if (kxpCountryInfo != null) // do not update when exists - { - continue; - } - - var mapped = countryMapper.Map(kx13CmsCountry, null); - protocol.MappedTarget(mapped); - - if (mapped is (var countryInfo, var newInstance) { Success: true }) - { - try - { - CountryInfoProvider.ProviderObject.Set(countryInfo); - - protocol.Success(kx13CmsCountry, countryInfo, mapped); - logger.LogEntitySetAction(newInstance, countryInfo); - - primaryKeyMappingContext.SetMapping(r => r.CountryId, kx13CmsCountry.CountryId, countryInfo.CountryID); - } - catch (Exception exception) - { - logger.LogEntitySetError(exception, newInstance, countryInfo); - protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithIdentityPrint(countryInfo) - ); - } - } - } - - - var kx13States = kx13Context.CmsStates.AsNoTracking(); - foreach (var kx13CmsState in kx13States) - { - var kxpStateInfo = StateInfoProvider.ProviderObject.Get(kx13CmsState.StateName); - - if (kxpStateInfo != null) // do not update when exists - { - continue; - } - - var mapped = stateMapper.Map(kx13CmsState, null); - protocol.MappedTarget(mapped); - - if (mapped is (var stateInfo, var newInstance) { Success: true }) - { - try - { - StateInfoProvider.ProviderObject.Set(stateInfo); - - protocol.Success(kx13CmsState, stateInfo, mapped); - logger.LogEntitySetAction(newInstance, stateInfo); - - primaryKeyMappingContext.SetMapping(r => r.StateId, kx13CmsState.StateId, stateInfo.StateID); - } - catch (Exception exception) - { - logger.LogEntitySetError(exception, newInstance, stateInfo); - protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithIdentityPrint(stateInfo) - ); - } - } - } - } -} diff --git a/Migration.Toolkit.Core.KX13/Services/IPrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.KX13/Services/IPrimaryKeyLocatorService.cs deleted file mode 100644 index 614235e5..00000000 --- a/Migration.Toolkit.Core.KX13/Services/IPrimaryKeyLocatorService.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Linq.Expressions; - -namespace Migration.Toolkit.Core.KX13.Services; - -public record SourceTargetKeyMapping(int SourceId, int TargetId); - -public interface IPrimaryKeyLocatorService -{ - bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); - IEnumerable SelectAll(Expression> keyNameSelector); -} diff --git a/Migration.Toolkit.Core.KX13/Services/KeyLocatorService.cs b/Migration.Toolkit.Core.KX13/Services/KeyLocatorService.cs deleted file mode 100644 index bcf356fa..00000000 --- a/Migration.Toolkit.Core.KX13/Services/KeyLocatorService.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System.Linq.Expressions; -using System.Runtime.CompilerServices; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KXP.Context; - -namespace Migration.Toolkit.Core.KX13.Services; - -public class KeyLocatorService( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx13ContextFactory) -{ - public bool TryLocate( - Expression> sourceKeySelector, - Expression> targetKeySelector, - Expression> sourceGuidSelector, - Expression> targetGuidSelector, - object? sourceKey, out TTargetKey targetId - ) where TSource : class where TTarget : class - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - using var kx13Context = kx13ContextFactory.CreateDbContext(); - - var sourceType = typeof(TSource); - Unsafe.SkipInit(out targetId); - - try - { - if (sourceKey is null) - { - return false; - } - - var sourceEquals = Expression.Equal( - sourceKeySelector.Body, - Expression.Convert(Expression.Constant(sourceKey, sourceKey.GetType()), typeof(object)) - ); - var sourcePredicate = Expression.Lambda>(sourceEquals, sourceKeySelector.Parameters[0]); - var kx13Guid = kx13Context.Set().Where(sourcePredicate).Select(sourceGuidSelector).Single(); - - var param = Expression.Parameter(typeof(TTarget), "t"); - var member = targetGuidSelector.Body as MemberExpression ?? throw new InvalidOperationException($"Expression SHALL NOT be other than member expression, expression: {targetGuidSelector}"); - var targetEquals = Expression.Equal( - Expression.MakeMemberAccess(param, member.Member), - Expression.Constant(kx13Guid, typeof(Guid)) - ); - var targetPredicate = Expression.Lambda>(targetEquals, param); - - var query = kxpContext.Set().Where(targetPredicate); - var selector = Expression.Lambda>(targetKeySelector.Body, targetKeySelector.Parameters[0]); - targetId = query.Select(selector).Single(); - return true; - } - catch (InvalidOperationException ioex) - { - logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceKey, ioex.Message); - return false; - } - finally - { - if (!targetId?.Equals(default) ?? false) - { - logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceKey, targetId); - } - } - } - - public bool TryGetSourceGuid(Expression> keySelector, Expression> guidSelector, object? key, out Guid? guid) - where T : class - { - using var kx13Context = kx13ContextFactory.CreateDbContext(); - - var type = typeof(T); - Unsafe.SkipInit(out guid); - - try - { - if (key is null) - { - return false; - } - - var sourceEquals = Expression.Equal( - keySelector.Body, - Expression.Convert(Expression.Constant(key, key.GetType()), typeof(object)) - ); - var sourcePredicate = Expression.Lambda>(sourceEquals, keySelector.Parameters[0]); - guid = kx13Context.Set().Where(sourcePredicate).Select(guidSelector).Single(); - return true; - } - catch (InvalidOperationException ioex) - { - logger.LogWarning("Guid locator {SourceFullType} primary key: {Key} failed, {Message}", type.FullName, key, ioex.Message); - return false; - } - finally - { - if (!guid?.Equals(default) ?? false) - { - logger.LogTrace("Guid locator {SourceFullType} primary key: {Key} located {Guid}", type.FullName, key, guid); - } - } - } -} diff --git a/Migration.Toolkit.Core.KX13/Services/PrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.KX13/Services/PrimaryKeyLocatorService.cs deleted file mode 100644 index bf93b7eb..00000000 --- a/Migration.Toolkit.Core.KX13/Services/PrimaryKeyLocatorService.cs +++ /dev/null @@ -1,218 +0,0 @@ -using System.Linq.Expressions; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; - -using Migration.Toolkit.Common; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KXP.Context; - -namespace Migration.Toolkit.Core.KX13.Services; - -public class PrimaryKeyLocatorService( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx13ContextFactory) - : IPrimaryKeyLocatorService -{ - public IEnumerable SelectAll(Expression> keyNameSelector) - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - using var kx13Context = kx13ContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - string memberName = keyNameSelector.GetMemberName(); - - logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); - - if (sourceType == typeof(KX13M.CmsUser) && memberName == nameof(KX13M.CmsUser.UserId)) - { - var sourceUsers = kx13Context.CmsUsers.Select(x => new { x.UserId, x.UserGuid, x.UserName }).ToList(); - var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); - - var result = sourceUsers.Join(targetUsers, - a => new CmsUserKey(a.UserGuid, a.UserName), - b => new CmsUserKey(b.UserGuid, b.UserName), - (a, b) => new SourceTargetKeyMapping(a.UserId, b.UserId), - new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(KX13M.OmContact) && memberName == nameof(KX13M.OmContact.ContactId)) - { - var source = kx13Context.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - var target = kxpContext.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - - var result = source.Join(target, - a => a.ContactGuid, - b => b.ContactGuid, - (a, b) => new SourceTargetKeyMapping(a.ContactId, b.ContactId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(KX13M.CmsState) && memberName == nameof(KX13M.CmsState.StateId)) - { - var source = kx13Context.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - - var result = source.Join(target, - a => a.StateName, - b => b.StateName, - (a, b) => new SourceTargetKeyMapping(a.StateId, b.StateId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(KX13M.CmsCountry) && memberName == nameof(KX13M.CmsCountry.CountryId)) - { - var source = kx13Context.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - - var result = source.Join(target, - a => a.CountryName, - b => b.CountryName, - (a, b) => new SourceTargetKeyMapping(a.CountryId, b.CountryId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - throw new NotImplementedException(); - } - - public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - using var kx13Context = kx13ContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - targetId = -1; - try - { - if (sourceType == typeof(KX13M.CmsResource)) - { - var kx13Guid = kx13Context.CmsResources.Where(c => c.ResourceId == sourceId).Select(x => x.ResourceGuid).Single(); - targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == kx13Guid).Select(x => x.ResourceId).Single(); - return true; - } - - if (sourceType == typeof(KX13M.CmsClass)) - { - var kx13Guid = kx13Context.CmsClasses.Where(c => c.ClassId == sourceId).Select(x => x.ClassGuid).Single(); - targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == kx13Guid).Select(x => x.ClassId).Single(); - return true; - } - - if (sourceType == typeof(KX13M.CmsUser)) - { - var kx13User = kx13Context.CmsUsers.Where(c => c.UserId == sourceId).Select(x => new { x.UserGuid, x.UserName }).Single(); - targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == kx13User.UserGuid || x.UserName == kx13User.UserName).Select(x => x.UserId).Single(); - return true; - } - - if (sourceType == typeof(KX13M.CmsRole)) - { - var kx13User = kx13Context.CmsRoles.Where(c => c.RoleId == sourceId).Select(x => new { x.RoleGuid }).Single(); - targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == kx13User.RoleGuid).Select(x => x.RoleId).Single(); - return true; - } - - if (sourceType == typeof(KX13M.CmsSite)) - { - var kx13Guid = kx13Context.CmsSites.Where(c => c.SiteId == sourceId).Select(x => x.SiteGuid).Single(); - targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == kx13Guid).Select(x => x.ChannelId).Single(); - return true; - } - - if (sourceType == typeof(KX13M.CmsState)) - { - string kx13CodeName = kx13Context.CmsStates.Where(c => c.StateId == sourceId).Select(x => x.StateName).Single(); - targetId = kxpContext.CmsStates.Where(x => x.StateName == kx13CodeName).Select(x => x.StateId).Single(); - return true; - } - - if (sourceType == typeof(KX13M.CmsCountry)) - { - string kx13CodeName = kx13Context.CmsCountries.Where(c => c.CountryId == sourceId).Select(x => x.CountryName).Single(); - targetId = kxpContext.CmsCountries.Where(x => x.CountryName == kx13CodeName).Select(x => x.CountryId).Single(); - return true; - } - - if (sourceType == typeof(KX13M.OmContactStatus)) - { - string kx13Guid = kx13Context.OmContactStatuses.Where(c => c.ContactStatusId == sourceId).Select(x => x.ContactStatusName).Single(); - targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == kx13Guid).Select(x => x.ContactStatusId).Single(); - return true; - } - - if (sourceType == typeof(KX13M.OmContact)) - { - var kx13Guid = kx13Context.OmContacts.Where(c => c.ContactId == sourceId).Select(x => x.ContactGuid).Single(); - targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == kx13Guid).Select(x => x.ContactId).Single(); - return true; - } - } - catch (InvalidOperationException ioex) - { - if (ioex.Message.StartsWith("Sequence contains no elements")) - { - logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - else - { - logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - - return false; - } - finally - { - if (targetId != -1) - { - logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); - } - } - - logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); - targetId = -1; - return false; - } - - private class KeyEqualityComparerWithLambda(Func equalityComparer) : IEqualityComparer - { - public bool Equals(T? x, T? y) => equalityComparer.Invoke(x, y); - - public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; - } - - private record CmsUserKey(Guid UserGuid, string UserName); -} diff --git a/Migration.Toolkit.K11/Auxiliary/Kx13FormControls.cs b/Migration.Toolkit.K11/Auxiliary/Kx13FormControls.cs deleted file mode 100644 index dd57923a..00000000 --- a/Migration.Toolkit.K11/Auxiliary/Kx13FormControls.cs +++ /dev/null @@ -1,234 +0,0 @@ -// ReSharper disable InconsistentNaming - -namespace Migration.Toolkit.K11.Auxiliary; - -public class Kx12FormControls -{ - public class UserControlForText - { - public const string AbTestConversionTypeSelector = "ABTestConversionTypeSelector"; - public const string ActivityTypeSelector = "ActivityTypeSelector"; - public const string AllowedExtensionsSelector = "AllowedExtensionsSelector"; - public const string Selectalternativeform = "selectalternativeform"; - public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; - public const string AssemblyClassSelector = "AssemblyClassSelector"; - public const string Fieldselector = "fieldselector"; - public const string BizFormSelector = "BizFormSelector"; - public const string BundleInventoryTypeSelector = "BundleInventoryTypeSelector"; - public const string CampaignSelector = "CampaignSelector"; - public const string CategorySelector = "CategorySelector"; - public const string ClassFieldSelector = "ClassFieldSelector"; - public const string ClassFields = "Class_fields"; - public const string CodeName = "CodeName"; - public const string CodeNameWithPrefix = "CodeNameWithPrefix"; - public const string Selectcolor = "selectcolor"; - public const string Columns = "Columns"; - public const string ConnectionStringSelector = "Connection_string_selector"; - public const string ContactClassFields = "Contact_class_fields"; - public const string CountrySelector = "countrySelector"; - public const string CssStylesEditor = "CSS_Styles_Editor"; - public const string Selectculture = "selectculture"; - public const string CultureSelectorForSettings = "CultureSelectorForSettings"; - public const string CurrencySelector = "currencySelector"; - public const string CustomTableItemSelector = "CustomTableItemSelector"; - public const string CustomTableSelector = "CustomTableSelector"; - public const string Selectcolumns = "selectcolumns"; - public const string DepartmentSelector = "DepartmentSelector"; - public const string DropDownListControl = "DropDownListControl"; - public const string DueDateSelector = "Due_date_selector"; - public const string Emailinput = "emailinput"; - public const string EmailTemplateSelector = "Email_template_selector"; - public const string EmailTemplateTypeSelector = "Email_template_type_selector"; - public const string EncodingTextBox = "EncodingTextBox"; - public const string EncryptedPassword = "EncryptedPassword"; - public const string EnumSelector = "EnumSelector"; - public const string EventLogTypeSelector = "EventLogTypeSelector"; - public const string FacebookAutoPost = "Facebook_auto_post"; - public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; - public const string FileSystemSelector = "FileSystemSelector"; - public const string FontIconSelector = "FontIconSelector"; - public const string FormFieldSelector = "FormFieldSelector"; - public const string FormPassword = "FormPassword"; - public const string FullMediaLibrarySelector = "FullMediaLibrarySelector"; - public const string GetGoogleTranslatorApiKey = "Get_Google_Translator_API_key"; - public const string GetMsTranslatorTextApiKey = "GetMSTranslatorTextAPIKey"; - public const string GoToExternalUrl = "Go_to_external_URL"; - public const string GoogleAnalyticsParameterSelector = "Google_Analytics_parameter_selector"; - public const string Html5Input = "HTML5Input"; - public const string IconSelector = "IconSelector"; - public const string InternalStatusSelector = "InternalStatusSelector"; - public const string Internationalphone = "internationalphone"; - public const string LabelControl = "LabelControl"; - public const string LargeTextArea = "LargeTextArea"; - public const string LicenseSelector = "LicenseSelector"; - public const string LinkedInAutoPost = "LinkedInAutoPost"; - public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; - public const string ListBoxControl = "ListBoxControl"; - public const string LocalizableTextArea = "LocalizableTextArea"; - public const string LocalizableTextBox = "LocalizableTextBox"; - public const string MacroAnyAllBoolSelector = "Macro_any-all_bool_selector"; - public const string MacroAnyAllSelector = "MacroAnyAllSelector"; - public const string MacroDateOperator = "Macro_date_operator"; - public const string MacroEditor = "MacroEditor"; - public const string MacroEqualityOperator = "MacroEqualityOperator"; - public const string MacroNegationOperator = "MacroNegationOperator"; - public const string MacroNumericOperator = "Macro_numeric_operator"; - public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; - public const string MacroTextOperator = "Macro_text_operator"; - public const string MacroType = "MacroType"; - public const string ManufacturerSelector = "ManufacturerSelector"; - public const string MediaLibrarySelector = "MediaLibrarySelector"; - public const string MediaSelectionControl = "MediaSelectionControl"; - public const string MembershipSelector = "MembershipSelector"; - public const string MetafileUploaderControl = "MetafileUploaderControl"; - public const string ModuleSelector = "ModuleSelector"; - public const string MultipleCategoriesSelector = "MultipleCategoriesSelector"; - public const string MultipleChoiceControl = "MultipleChoiceControl"; - public const string RoleCheckboxSelector = "RoleCheckboxSelector"; - public const string SimpleCheckboxRoleSelector = "SimpleCheckboxRoleSelector"; - public const string SimpleCheckboxSiteSelector = "SimpleCheckboxSiteSelector"; - public const string MultipleUserSelector = "MultipleUserSelector"; - public const string NewsletterSelector = "NewsletterSelector"; - public const string NewsletterSelectorSimple = "NewsletterSelectorSimple"; - public const string NumericUpDown = "NumericUpDown"; - public const string ObjectColumnSelector = "ObjectColumnSelector"; - public const string ObjectSelector = "ObjectSelector"; - public const string ObjectTransformation = "ObjectTransformation"; - public const string ObjectTypeBinSelector = "ObjectTypeBinSelector"; - public const string ObjectTypeSelector = "ObjectTypeSelector"; - public const string OptionCategoryProductOptionSelector = "OptionCategoryProductOptionSelector"; - public const string OptionCategorySelectionTypeSelector = "OptionCategorySelectionTypeSelector"; - public const string OrderBy = "OrderBy"; - public const string OrderStatusSelector = "OrderStatusSelector"; - public const string DocumentCultureFilter = "DocumentCultureFilter"; - public const string PageLayoutCode = "Page_layout_code"; - public const string Selectdocument = "selectdocument"; - public const string PageTemplateLevels = "PageTemplateLevels"; - public const string Selectpagetemplate = "selectpagetemplate"; - public const string DocumentTypeIconSelector = "DocumentTypeIconSelector"; - public const string Selectclassnames = "selectclassnames"; - public const string Password = "Password"; - public const string PasswordStrength = "PasswordStrength"; - public const string PasswordConfirmator = "PasswordConfirmator"; - public const string Selectpath = "selectpath"; - public const string PaymentSelector = "paymentSelector"; - public const string ProductImageSelector = "ProductImageSelector"; - public const string ProductRelationshipNameSelector = "ProductRelationshipNameSelector"; - public const string ProductSectionsSelector = "ProductSectionsSelector"; - public const string ProductTypeSelector = "ProductTypeSelector"; - public const string PublicStatusSelector = "PublicStatusSelector"; - public const string Selectquery = "selectquery"; - public const string RadioButtonsControl = "RadioButtonsControl"; - public const string AgeRangeSelector = "AgeRangeSelector"; - public const string RelatedDocuments = "RelatedDocuments"; - public const string Relationshipconfiguration = "relationshipconfiguration"; - public const string SelectRelationshipName = "SelectRelationshipName"; - public const string ReportSelectorDropDown = "ReportSelectorDropDown"; - public const string RoleSelector = "RoleSelector"; - public const string SearchClassNameSelector = "SearchClassNameSelector"; - public const string SearchIndexSelector = "SearchIndexSelector"; - public const string SearchIndexTypeSelector = "SearchIndexTypeSelector"; - public const string SelectCmsVersion = "SelectCMSVersion"; - public const string SettingsKeyControlSelector = "SettingsKeyControlSelector"; - public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; - public const string SharePointListSelector = "SharePointListSelector"; - public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; - public const string ShippingSelector = "shippingSelector"; - public const string ShippingServiceSelector = "ShippingServiceSelector"; - public const string Selectsinglepath = "selectsinglepath"; - public const string SinglePathSelectorWithPermissions = "SinglePathSelectorWithPermissions"; - public const string SiteContentCulture = "SiteContentCulture"; - public const string SiteCultureSelector = "SiteCultureSelector"; - public const string SiteCultureSelectorAll = "SiteCultureSelectorAll"; - public const string Selectsite = "selectsite"; - public const string SiteSelectorWithAllFieldForGlobalAdmin = "SiteSelectorWithAllFieldForGlobalAdmin"; - public const string SkuSelector = "SKUSelector"; - public const string StopWordsSelector = "StopWordsSelector"; - public const string SupplierSelector = "SupplierSelector"; - public const string SupportedCultureSelector = "SupportedCultureSelector"; - public const string TableConversionSettings = "TableConversionSettings"; - public const string TagGroupSelector = "TagGroupSelector"; - public const string TagSelector = "TagSelector"; - public const string TaxAddressTypeSelector = "TaxAddressTypeSelector"; - public const string TextAreaControl = "TextAreaControl"; - public const string TextBoxControl = "TextBoxControl"; - public const string TextFilter = "TextFilter"; - public const string TextboxDefaultValueFromSetting = "Textbox_default_value_from_setting"; - public const string TextboxDoubleValidator = "Textbox_double_validator"; - public const string TimeZoneSelector = "TimeZoneSelector"; - public const string TimeZoneTypeSelector = "TimeZoneTypeSelector"; - public const string ToggleButton = "ToggleButton"; - public const string Selecttransformation = "selecttransformation"; - public const string TranslationServiceSelector = "Translation_service_selector"; - public const string TwitterAutoPost = "Twitter_auto_post"; - public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; - public const string Usphone = "usphone"; - public const string Uszipcode = "uszipcode"; - public const string UiCultureSelector = "UICultureSelector"; - public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; - public const string UniSelector = "Uni_selector"; - public const string UrlChecker = "UrlChecker"; - public const string UrlSelector = "URLSelector"; - public const string SmurlShortenerSelector = "SMURLShortenerSelector"; - public const string UserName = "UserName"; - public const string UserNameSelector = "UserNameSelector"; - public const string UserSelector = "UserSelector"; - public const string ValiditySelector = "ValiditySelector"; - public const string ViewSecureText = "ViewSecureText"; - public const string WhereCondition = "WhereCondition"; - public const string WorkflowScopeDefinition = "WorkflowScopeDefinition"; - } - - public class UserControlForLongText - { - public const string AbTestConversionSelector = "ABTestConversionSelector"; - public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; - public const string BbEditorControl = "BBEditorControl"; - public const string CacheDependencies = "CacheDependencies"; - public const string ClassFields = "Class_fields"; - public const string Columns = "Columns"; - public const string ConditionBuilder = "ConditionBuilder"; - public const string ContactClassFields = "Contact_class_fields"; - public const string CssStylesEditor = "CSS_Styles_Editor"; - public const string Selectcolumns = "selectcolumns"; - public const string DropDownListControl = "DropDownListControl"; - public const string FacebookAutoPost = "Facebook_auto_post"; - public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; - public const string FileSystemSelector = "FileSystemSelector"; - public const string Html5Input = "HTML5Input"; - public const string AutoResizeConfiguration = "AutoResizeConfiguration"; - public const string LabelControl = "LabelControl"; - public const string LargeTextArea = "LargeTextArea"; - public const string LinkedInAutoPost = "LinkedInAutoPost"; - public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; - public const string LocalizableTextArea = "LocalizableTextArea"; - public const string LocalizableTextBox = "LocalizableTextBox"; - public const string MacroEditor = "MacroEditor"; - public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; - public const string MultipleObjectBindingControl = "MultipleObjectBindingControl"; - public const string ObjectTypeSelector = "ObjectTypeSelector"; - public const string OptionsSelector = "OptionsSelector"; - public const string OrderBy = "OrderBy"; - public const string PageLayoutCode = "Page_layout_code"; - public const string ProductSectionsSelector = "ProductSectionsSelector"; - public const string RelatedDocuments = "RelatedDocuments"; - public const string ReportGraphSelector = "ReportGraphSelector"; - public const string ReportTableSelector = "ReportTableSelector"; - public const string ReportValueSelector = "ReportValueSelector"; - public const string HtmlAreaControl = "HtmlAreaControl"; - public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; - public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; - public const string TagSelector = "TagSelector"; - public const string TextAreaControl = "TextAreaControl"; - public const string TextBoxControl = "TextBoxControl"; - public const string TextFilter = "TextFilter"; - public const string TranslationServiceSelector = "Translation_service_selector"; - public const string TwitterAutoPost = "Twitter_auto_post"; - public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; - public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; - public const string UniSelector = "Uni_selector"; - public const string SmurlShortenerSelector = "SMURLShortenerSelector"; - public const string ViewSecureText = "ViewSecureText"; - public const string WhereCondition = "WhereCondition"; - } -} diff --git a/Migration.Toolkit.K11/ContextCustomizations.cs b/Migration.Toolkit.K11/ContextCustomizations.cs deleted file mode 100644 index 25ac319f..00000000 --- a/Migration.Toolkit.K11/ContextCustomizations.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11; - -public partial class K11Context -{ - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - optionsBuilder - .EnableDetailedErrors() - .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); - base.OnConfiguring(optionsBuilder); - } -} diff --git a/Migration.Toolkit.K11/DependencyInjectionExtensions.cs b/Migration.Toolkit.K11/DependencyInjectionExtensions.cs deleted file mode 100644 index 6d084f69..00000000 --- a/Migration.Toolkit.K11/DependencyInjectionExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; - -using Migration.Toolkit.Common; - -namespace Migration.Toolkit.K11; - -public static class DependencyInjectionExtensions -{ - public static IServiceCollection UseK11DbContext(this IServiceCollection services, ToolkitConfiguration toolkitConfiguration) - { - services.AddDbContextFactory(options => options.UseSqlServer(toolkitConfiguration.KxConnectionString)); - return services; - } -} diff --git a/Migration.Toolkit.K11/Migration.Toolkit.K11.csproj b/Migration.Toolkit.K11/Migration.Toolkit.K11.csproj deleted file mode 100644 index 73181b9a..00000000 --- a/Migration.Toolkit.K11/Migration.Toolkit.K11.csproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - TextTemplatingFileGenerator - SettingsKeys.cs - - - - - - True - True - SettingsKeys.tt - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaign.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaign.cs deleted file mode 100644 index 3fba4e53..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaign.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_Campaign")] -[Index("CampaignScheduledTaskId", Name = "IX_Analytics_Campaign_CampaignScheduledTaskID")] -[Index("CampaignSiteId", Name = "IX_Analytics_Campaign_CampaignSiteID")] -public class AnalyticsCampaign -{ - [Key] - [Column("CampaignID")] - public int CampaignId { get; set; } - - [StringLength(200)] - public string CampaignName { get; set; } = null!; - - [StringLength(100)] - public string CampaignDisplayName { get; set; } = null!; - - public string? CampaignDescription { get; set; } - - [Column("CampaignSiteID")] - public int CampaignSiteId { get; set; } - - public DateTime? CampaignOpenFrom { get; set; } - - public DateTime? CampaignOpenTo { get; set; } - - [Column("CampaignGUID")] - public Guid CampaignGuid { get; set; } - - public DateTime CampaignLastModified { get; set; } - - [Column("CampaignUTMCode")] - [StringLength(200)] - public string? CampaignUtmcode { get; set; } - - public DateTime? CampaignCalculatedTo { get; set; } - - [Column("CampaignScheduledTaskID")] - public int? CampaignScheduledTaskId { get; set; } - - public int? CampaignVisitors { get; set; } - - [InverseProperty("CampaignAssetCampaign")] - public virtual ICollection AnalyticsCampaignAssets { get; set; } = new List(); - - [InverseProperty("CampaignConversionCampaign")] - public virtual ICollection AnalyticsCampaignConversions { get; set; } = new List(); - - [InverseProperty("CampaignObjectiveCampaign")] - public virtual AnalyticsCampaignObjective? AnalyticsCampaignObjective { get; set; } - - [ForeignKey("CampaignScheduledTaskId")] - [InverseProperty("AnalyticsCampaigns")] - public virtual CmsScheduledTask? CampaignScheduledTask { get; set; } - - [ForeignKey("CampaignSiteId")] - [InverseProperty("AnalyticsCampaigns")] - public virtual CmsSite CampaignSite { get; set; } = null!; - - [InverseProperty("FacebookPostCampaign")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); - - [InverseProperty("LinkedInPostCampaign")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); - - [InverseProperty("TwitterPostCampaign")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignAsset.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignAsset.cs deleted file mode 100644 index 33864ec2..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignAsset.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_CampaignAsset")] -[Index("CampaignAssetCampaignId", Name = "IX_Analytics_CampaignAsset_CampaignAssetCampaignID")] -public class AnalyticsCampaignAsset -{ - [Key] - [Column("CampaignAssetID")] - public int CampaignAssetId { get; set; } - - public Guid CampaignAssetGuid { get; set; } - - public DateTime CampaignAssetLastModified { get; set; } - - public Guid CampaignAssetAssetGuid { get; set; } - - [Column("CampaignAssetCampaignID")] - public int CampaignAssetCampaignId { get; set; } - - [StringLength(200)] - public string CampaignAssetType { get; set; } = null!; - - [InverseProperty("CampaignAssetUrlCampaignAsset")] - public virtual ICollection AnalyticsCampaignAssetUrls { get; set; } = new List(); - - [ForeignKey("CampaignAssetCampaignId")] - [InverseProperty("AnalyticsCampaignAssets")] - public virtual AnalyticsCampaign CampaignAssetCampaign { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignAssetUrl.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignAssetUrl.cs deleted file mode 100644 index c761d09f..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignAssetUrl.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_CampaignAssetUrl")] -[Index("CampaignAssetUrlCampaignAssetId", Name = "IX_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID")] -public class AnalyticsCampaignAssetUrl -{ - [Key] - [Column("CampaignAssetUrlID")] - public int CampaignAssetUrlId { get; set; } - - public Guid CampaignAssetUrlGuid { get; set; } - - public string CampaignAssetUrlTarget { get; set; } = null!; - - [StringLength(200)] - public string CampaignAssetUrlPageTitle { get; set; } = null!; - - [Column("CampaignAssetUrlCampaignAssetID")] - public int CampaignAssetUrlCampaignAssetId { get; set; } - - [ForeignKey("CampaignAssetUrlCampaignAssetId")] - [InverseProperty("AnalyticsCampaignAssetUrls")] - public virtual AnalyticsCampaignAsset CampaignAssetUrlCampaignAsset { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignConversion.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignConversion.cs deleted file mode 100644 index 20584e86..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignConversion.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_CampaignConversion")] -[Index("CampaignConversionCampaignId", Name = "IX_Analytics_CampaignConversion_CampaignConversionCampaignID")] -public class AnalyticsCampaignConversion -{ - [Key] - [Column("CampaignConversionID")] - public int CampaignConversionId { get; set; } - - public Guid CampaignConversionGuid { get; set; } - - public DateTime CampaignConversionLastModified { get; set; } - - [StringLength(100)] - public string CampaignConversionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string CampaignConversionName { get; set; } = null!; - - [Column("CampaignConversionCampaignID")] - public int CampaignConversionCampaignId { get; set; } - - public int CampaignConversionOrder { get; set; } - - [StringLength(250)] - public string CampaignConversionActivityType { get; set; } = null!; - - public int CampaignConversionHits { get; set; } - - [Column("CampaignConversionItemID")] - public int? CampaignConversionItemId { get; set; } - - public double CampaignConversionValue { get; set; } - - public bool CampaignConversionIsFunnelStep { get; set; } - - [Column("CampaignConversionURL")] - public string? CampaignConversionUrl { get; set; } - - [InverseProperty("CampaignConversionHitsConversion")] - public virtual ICollection AnalyticsCampaignConversionHits { get; set; } = new List(); - - [InverseProperty("CampaignObjectiveCampaignConversion")] - public virtual ICollection AnalyticsCampaignObjectives { get; set; } = new List(); - - [ForeignKey("CampaignConversionCampaignId")] - [InverseProperty("AnalyticsCampaignConversions")] - public virtual AnalyticsCampaign CampaignConversionCampaign { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignConversionHit.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignConversionHit.cs deleted file mode 100644 index 099bf03e..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignConversionHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_CampaignConversionHits")] -[Index("CampaignConversionHitsConversionId", Name = "IX_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID")] -public class AnalyticsCampaignConversionHit -{ - [Key] - [Column("CampaignConversionHitsID")] - public int CampaignConversionHitsId { get; set; } - - [Column("CampaignConversionHitsConversionID")] - public int CampaignConversionHitsConversionId { get; set; } - - public int CampaignConversionHitsCount { get; set; } - - [StringLength(200)] - public string CampaignConversionHitsSourceName { get; set; } = null!; - - [StringLength(200)] - public string? CampaignConversionHitsContentName { get; set; } - - [ForeignKey("CampaignConversionHitsConversionId")] - [InverseProperty("AnalyticsCampaignConversionHits")] - public virtual AnalyticsCampaignConversion CampaignConversionHitsConversion { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignObjective.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignObjective.cs deleted file mode 100644 index 3206023e..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignObjective.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_CampaignObjective")] -[Index("CampaignObjectiveCampaignId", Name = "CK_Analytics_CampaignObjective_CampaignObjectiveCampaignID", IsUnique = true)] -[Index("CampaignObjectiveCampaignConversionId", Name = "IX_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID")] -public class AnalyticsCampaignObjective -{ - [Key] - [Column("CampaignObjectiveID")] - public int CampaignObjectiveId { get; set; } - - public Guid CampaignObjectiveGuid { get; set; } - - public DateTime CampaignObjectiveLastModified { get; set; } - - [Column("CampaignObjectiveCampaignID")] - public int CampaignObjectiveCampaignId { get; set; } - - public int? CampaignObjectiveValue { get; set; } - - [Column("CampaignObjectiveCampaignConversionID")] - public int CampaignObjectiveCampaignConversionId { get; set; } - - [ForeignKey("CampaignObjectiveCampaignId")] - [InverseProperty("AnalyticsCampaignObjective")] - public virtual AnalyticsCampaign CampaignObjectiveCampaign { get; set; } = null!; - - [ForeignKey("CampaignObjectiveCampaignConversionId")] - [InverseProperty("AnalyticsCampaignObjectives")] - public virtual AnalyticsCampaignConversion CampaignObjectiveCampaignConversion { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/AnalyticsConversion.cs b/Migration.Toolkit.K11/Models/AnalyticsConversion.cs deleted file mode 100644 index e2e278ae..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsConversion.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_Conversion")] -[Index("ConversionSiteId", Name = "IX_Analytics_Conversion_ConversionSiteID")] -public class AnalyticsConversion -{ - [Key] - [Column("ConversionID")] - public int ConversionId { get; set; } - - [StringLength(200)] - public string ConversionName { get; set; } = null!; - - [StringLength(200)] - public string ConversionDisplayName { get; set; } = null!; - - public string? ConversionDescription { get; set; } - - [Column("ConversionGUID")] - public Guid ConversionGuid { get; set; } - - public DateTime ConversionLastModified { get; set; } - - [Column("ConversionSiteID")] - public int ConversionSiteId { get; set; } - - [ForeignKey("ConversionSiteId")] - [InverseProperty("AnalyticsConversions")] - public virtual CmsSite ConversionSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/AnalyticsDayHit.cs b/Migration.Toolkit.K11/Models/AnalyticsDayHit.cs deleted file mode 100644 index 9caadb12..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsDayHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_DayHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_DayHits_HitsStatisticsID")] -public class AnalyticsDayHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsDayHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/AnalyticsExitPage.cs b/Migration.Toolkit.K11/Models/AnalyticsExitPage.cs deleted file mode 100644 index 4ab7e995..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsExitPage.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_ExitPages")] -[Index("ExitPageLastModified", Name = "IX_Analytics_ExitPages_ExitPageLastModified")] -public class AnalyticsExitPage -{ - [Key] - [StringLength(200)] - public string SessionIdentificator { get; set; } = null!; - - [Column("ExitPageNodeID")] - public int ExitPageNodeId { get; set; } - - public DateTime ExitPageLastModified { get; set; } - - [Column("ExitPageSiteID")] - public int ExitPageSiteId { get; set; } - - [StringLength(10)] - public string? ExitPageCulture { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/AnalyticsHourHit.cs b/Migration.Toolkit.K11/Models/AnalyticsHourHit.cs deleted file mode 100644 index 59209520..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsHourHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_HourHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_HourHits_HitsStatisticsID")] -public class AnalyticsHourHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsHourHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/AnalyticsMonthHit.cs b/Migration.Toolkit.K11/Models/AnalyticsMonthHit.cs deleted file mode 100644 index 876ac3b0..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsMonthHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_MonthHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_MonthHits_HitsStatisticsID")] -public class AnalyticsMonthHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsMonthHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/AnalyticsStatistic.cs b/Migration.Toolkit.K11/Models/AnalyticsStatistic.cs deleted file mode 100644 index 2f14d45f..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsStatistic.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_Statistics")] -[Index("StatisticsSiteId", Name = "IX_Analytics_Statistics_StatisticsSiteID")] -public class AnalyticsStatistic -{ - [Key] - [Column("StatisticsID")] - public int StatisticsId { get; set; } - - [Column("StatisticsSiteID")] - public int? StatisticsSiteId { get; set; } - - [StringLength(400)] - public string StatisticsCode { get; set; } = null!; - - [StringLength(450)] - public string? StatisticsObjectName { get; set; } - - [Column("StatisticsObjectID")] - public int? StatisticsObjectId { get; set; } - - [StringLength(10)] - public string? StatisticsObjectCulture { get; set; } - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsDayHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsHourHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsMonthHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsWeekHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsYearHits { get; set; } = new List(); - - [ForeignKey("StatisticsSiteId")] - [InverseProperty("AnalyticsStatistics")] - public virtual CmsSite? StatisticsSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/AnalyticsWeekHit.cs b/Migration.Toolkit.K11/Models/AnalyticsWeekHit.cs deleted file mode 100644 index 8bfa3d90..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsWeekHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_WeekHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_WeekHits_HitsStatisticsID")] -public class AnalyticsWeekHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsWeekHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/AnalyticsYearHit.cs b/Migration.Toolkit.K11/Models/AnalyticsYearHit.cs deleted file mode 100644 index 90d2f195..00000000 --- a/Migration.Toolkit.K11/Models/AnalyticsYearHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_YearHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_WeekYearHits_HitsStatisticsID")] -public class AnalyticsYearHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsYearHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/BadWordsWord.cs b/Migration.Toolkit.K11/Models/BadWordsWord.cs deleted file mode 100644 index a0eb4123..00000000 --- a/Migration.Toolkit.K11/Models/BadWordsWord.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("BadWords_Word")] -[Index("WordIsGlobal", Name = "IX_BadWords_Word_WordIsGlobal")] -public class BadWordsWord -{ - [Key] - [Column("WordID")] - public int WordId { get; set; } - - [Column("WordGUID")] - public Guid WordGuid { get; set; } - - public DateTime WordLastModified { get; set; } - - [StringLength(200)] - public string WordExpression { get; set; } = null!; - - [StringLength(200)] - public string? WordReplacement { get; set; } - - public int? WordAction { get; set; } - - public bool WordIsGlobal { get; set; } - - public bool WordIsRegularExpression { get; set; } - - public bool? WordMatchWholeWord { get; set; } - - [ForeignKey("WordId")] - [InverseProperty("Words")] - public virtual ICollection Cultures { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/BlogComment.cs b/Migration.Toolkit.K11/Models/BlogComment.cs deleted file mode 100644 index 34e39327..00000000 --- a/Migration.Toolkit.K11/Models/BlogComment.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Blog_Comment")] -[Index("CommentApprovedByUserId", Name = "IX_Blog_Comment_CommentApprovedByUserID")] -[Index("CommentPostDocumentId", Name = "IX_Blog_Comment_CommentPostDocumentID")] -[Index("CommentUserId", Name = "IX_Blog_Comment_CommentUserID")] -public class BlogComment -{ - [Key] - [Column("CommentID")] - public int CommentId { get; set; } - - [StringLength(200)] - public string CommentUserName { get; set; } = null!; - - [Column("CommentUserID")] - public int? CommentUserId { get; set; } - - [StringLength(450)] - public string? CommentUrl { get; set; } - - public string CommentText { get; set; } = null!; - - [Column("CommentApprovedByUserID")] - public int? CommentApprovedByUserId { get; set; } - - [Column("CommentPostDocumentID")] - public int CommentPostDocumentId { get; set; } - - public DateTime CommentDate { get; set; } - - public bool? CommentIsSpam { get; set; } - - public bool? CommentApproved { get; set; } - - [StringLength(254)] - public string? CommentEmail { get; set; } - - public string? CommentInfo { get; set; } - - [Column("CommentGUID")] - public Guid CommentGuid { get; set; } - - [ForeignKey("CommentApprovedByUserId")] - [InverseProperty("BlogCommentCommentApprovedByUsers")] - public virtual CmsUser? CommentApprovedByUser { get; set; } - - [ForeignKey("CommentPostDocumentId")] - [InverseProperty("BlogComments")] - public virtual CmsDocument CommentPostDocument { get; set; } = null!; - - [ForeignKey("CommentUserId")] - [InverseProperty("BlogCommentCommentUsers")] - public virtual CmsUser? CommentUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/BlogPostSubscription.cs b/Migration.Toolkit.K11/Models/BlogPostSubscription.cs deleted file mode 100644 index 55f91b43..00000000 --- a/Migration.Toolkit.K11/Models/BlogPostSubscription.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Blog_PostSubscription")] -[Index("SubscriptionPostDocumentId", Name = "IX_Blog_PostSubscription_SubscriptionPostDocumentID")] -[Index("SubscriptionUserId", Name = "IX_Blog_PostSubscription_SubscriptionUserID")] -public class BlogPostSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionPostDocumentID")] - public int SubscriptionPostDocumentId { get; set; } - - [Column("SubscriptionUserID")] - public int? SubscriptionUserId { get; set; } - - [StringLength(254)] - public string? SubscriptionEmail { get; set; } - - public DateTime SubscriptionLastModified { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [ForeignKey("SubscriptionPostDocumentId")] - [InverseProperty("BlogPostSubscriptions")] - public virtual CmsDocument SubscriptionPostDocument { get; set; } = null!; - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("BlogPostSubscriptions")] - public virtual CmsUser? SubscriptionUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/BoardBoard.cs b/Migration.Toolkit.K11/Models/BoardBoard.cs deleted file mode 100644 index b503a47a..00000000 --- a/Migration.Toolkit.K11/Models/BoardBoard.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Board_Board")] -[Index("BoardDocumentId", "BoardName", Name = "IX_Board_Board_BoardDocumentID_BoardName", IsUnique = true)] -[Index("BoardGroupId", "BoardName", Name = "IX_Board_Board_BoardGroupID_BoardName")] -[Index("BoardSiteId", Name = "IX_Board_Board_BoardSiteID")] -[Index("BoardUserId", "BoardName", Name = "IX_Board_Board_BoardUserID_BoardName")] -public class BoardBoard -{ - [Key] - [Column("BoardID")] - public int BoardId { get; set; } - - [StringLength(250)] - public string BoardName { get; set; } = null!; - - [StringLength(250)] - public string BoardDisplayName { get; set; } = null!; - - public string BoardDescription { get; set; } = null!; - - public bool BoardOpened { get; set; } - - public DateTime? BoardOpenedFrom { get; set; } - - public DateTime? BoardOpenedTo { get; set; } - - public bool BoardEnabled { get; set; } - - public int BoardAccess { get; set; } - - public bool BoardModerated { get; set; } - - public bool BoardUseCaptcha { get; set; } - - public int BoardMessages { get; set; } - - public DateTime BoardLastModified { get; set; } - - [Column("BoardGUID")] - public Guid BoardGuid { get; set; } - - [Column("BoardDocumentID")] - public int BoardDocumentId { get; set; } - - [Column("BoardUserID")] - public int? BoardUserId { get; set; } - - [Column("BoardGroupID")] - public int? BoardGroupId { get; set; } - - public DateTime? BoardLastMessageTime { get; set; } - - [StringLength(250)] - public string? BoardLastMessageUserName { get; set; } - - [Column("BoardUnsubscriptionURL")] - [StringLength(450)] - public string? BoardUnsubscriptionUrl { get; set; } - - public bool? BoardRequireEmails { get; set; } - - [Column("BoardSiteID")] - public int BoardSiteId { get; set; } - - public bool BoardEnableSubscriptions { get; set; } - - [Column("BoardBaseURL")] - [StringLength(450)] - public string? BoardBaseUrl { get; set; } - - public bool? BoardLogActivity { get; set; } - - public bool? BoardEnableOptIn { get; set; } - - public bool? BoardSendOptInConfirmation { get; set; } - - [Column("BoardOptInApprovalURL")] - [StringLength(450)] - public string? BoardOptInApprovalUrl { get; set; } - - [ForeignKey("BoardDocumentId")] - [InverseProperty("BoardBoards")] - public virtual CmsDocument BoardDocument { get; set; } = null!; - - [ForeignKey("BoardGroupId")] - [InverseProperty("BoardBoards")] - public virtual CommunityGroup? BoardGroup { get; set; } - - [InverseProperty("MessageBoard")] - public virtual ICollection BoardMessagesNavigation { get; set; } = new List(); - - [ForeignKey("BoardSiteId")] - [InverseProperty("BoardBoards")] - public virtual CmsSite BoardSite { get; set; } = null!; - - [InverseProperty("SubscriptionBoard")] - public virtual ICollection BoardSubscriptions { get; set; } = new List(); - - [ForeignKey("BoardUserId")] - [InverseProperty("BoardBoards")] - public virtual CmsUser? BoardUser { get; set; } - - [ForeignKey("BoardId")] - [InverseProperty("Boards")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("BoardId")] - [InverseProperty("Boards")] - public virtual ICollection Users { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/BoardMessage.cs b/Migration.Toolkit.K11/Models/BoardMessage.cs deleted file mode 100644 index fdd15932..00000000 --- a/Migration.Toolkit.K11/Models/BoardMessage.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Board_Message")] -[Index("MessageApprovedByUserId", Name = "IX_Board_Message_MessageApprovedByUserID")] -[Index("MessageApproved", "MessageIsSpam", Name = "IX_Board_Message_MessageApproved_MessageIsSpam")] -[Index("MessageBoardId", "MessageGuid", Name = "IX_Board_Message_MessageBoardID_MessageGUID", IsUnique = true)] -[Index("MessageUserId", Name = "IX_Board_Message_MessageUserID")] -public class BoardMessage -{ - [Key] - [Column("MessageID")] - public int MessageId { get; set; } - - [StringLength(250)] - public string MessageUserName { get; set; } = null!; - - public string MessageText { get; set; } = null!; - - [StringLength(254)] - public string MessageEmail { get; set; } = null!; - - [Column("MessageURL")] - [StringLength(450)] - public string MessageUrl { get; set; } = null!; - - public bool MessageIsSpam { get; set; } - - [Column("MessageBoardID")] - public int MessageBoardId { get; set; } - - public bool MessageApproved { get; set; } - - [Column("MessageApprovedByUserID")] - public int? MessageApprovedByUserId { get; set; } - - [Column("MessageUserID")] - public int? MessageUserId { get; set; } - - public string MessageUserInfo { get; set; } = null!; - - [Column("MessageAvatarGUID")] - public Guid? MessageAvatarGuid { get; set; } - - public DateTime MessageInserted { get; set; } - - public DateTime MessageLastModified { get; set; } - - [Column("MessageGUID")] - public Guid MessageGuid { get; set; } - - public double? MessageRatingValue { get; set; } - - [ForeignKey("MessageApprovedByUserId")] - [InverseProperty("BoardMessageMessageApprovedByUsers")] - public virtual CmsUser? MessageApprovedByUser { get; set; } - - [ForeignKey("MessageBoardId")] - [InverseProperty("BoardMessagesNavigation")] - public virtual BoardBoard MessageBoard { get; set; } = null!; - - [ForeignKey("MessageUserId")] - [InverseProperty("BoardMessageMessageUsers")] - public virtual CmsUser? MessageUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/BoardSubscription.cs b/Migration.Toolkit.K11/Models/BoardSubscription.cs deleted file mode 100644 index 957ac986..00000000 --- a/Migration.Toolkit.K11/Models/BoardSubscription.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Board_Subscription")] -[Index("SubscriptionBoardId", Name = "IX_Board_Subscription_SubscriptionBoardID")] -[Index("SubscriptionUserId", Name = "IX_Board_Subscription_SubscriptionUserID")] -public class BoardSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionBoardID")] - public int SubscriptionBoardId { get; set; } - - [Column("SubscriptionUserID")] - public int? SubscriptionUserId { get; set; } - - [StringLength(254)] - public string SubscriptionEmail { get; set; } = null!; - - public DateTime SubscriptionLastModified { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [ForeignKey("SubscriptionBoardId")] - [InverseProperty("BoardSubscriptions")] - public virtual BoardBoard SubscriptionBoard { get; set; } = null!; - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("BoardSubscriptions")] - public virtual CmsUser? SubscriptionUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ChatInitiatedChatRequest.cs b/Migration.Toolkit.K11/Models/ChatInitiatedChatRequest.cs deleted file mode 100644 index 10cb8084..00000000 --- a/Migration.Toolkit.K11/Models/ChatInitiatedChatRequest.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_InitiatedChatRequest")] -[Index("InitiatedChatRequestInitiatorChatUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestInitiatorChatUserID")] -[Index("InitiatedChatRequestUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestUserID")] -[Index("InitiatedChatRequestRoomId", Name = "UQ_Chat_InitiatedChatRequest_RoomID", IsUnique = true)] -[Index("InitiatedChatRequestUserId", "InitiatedChatRequestContactId", Name = "UQ_Chat_InitiatedChatRequest_UserIDContactID", IsUnique = true)] -public class ChatInitiatedChatRequest -{ - [Key] - [Column("InitiatedChatRequestID")] - public int InitiatedChatRequestId { get; set; } - - [Column("InitiatedChatRequestUserID")] - public int? InitiatedChatRequestUserId { get; set; } - - [Column("InitiatedChatRequestContactID")] - public int? InitiatedChatRequestContactId { get; set; } - - [Column("InitiatedChatRequestRoomID")] - public int InitiatedChatRequestRoomId { get; set; } - - public int InitiatedChatRequestState { get; set; } - - [StringLength(100)] - public string InitiatedChatRequestInitiatorName { get; set; } = null!; - - [Column("InitiatedChatRequestInitiatorChatUserID")] - public int InitiatedChatRequestInitiatorChatUserId { get; set; } - - public DateTime InitiatedChatRequestLastModification { get; set; } - - [ForeignKey("InitiatedChatRequestInitiatorChatUserId")] - [InverseProperty("ChatInitiatedChatRequests")] - public virtual ChatUser InitiatedChatRequestInitiatorChatUser { get; set; } = null!; - - [ForeignKey("InitiatedChatRequestRoomId")] - [InverseProperty("ChatInitiatedChatRequest")] - public virtual ChatRoom InitiatedChatRequestRoom { get; set; } = null!; - - [ForeignKey("InitiatedChatRequestUserId")] - [InverseProperty("ChatInitiatedChatRequests")] - public virtual CmsUser? InitiatedChatRequestUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ChatMessage.cs b/Migration.Toolkit.K11/Models/ChatMessage.cs deleted file mode 100644 index cce343d8..00000000 --- a/Migration.Toolkit.K11/Models/ChatMessage.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_Message")] -[Index("ChatMessageLastModified", Name = "IX_Chat_Message_ChatMessageLastModified")] -[Index("ChatMessageRecipientId", Name = "IX_Chat_Message_ChatMessageRecipientID")] -[Index("ChatMessageRoomId", Name = "IX_Chat_Message_ChatMessageRoomID")] -[Index("ChatMessageSystemMessageType", Name = "IX_Chat_Message_ChatMessageSystemMessageType")] -[Index("ChatMessageUserId", Name = "IX_Chat_Message_ChatMessageUserID")] -public class ChatMessage -{ - [Key] - [Column("ChatMessageID")] - public int ChatMessageId { get; set; } - - public DateTime ChatMessageCreatedWhen { get; set; } - - [Column("ChatMessageIPAddress")] - public string ChatMessageIpaddress { get; set; } = null!; - - [Column("ChatMessageUserID")] - public int? ChatMessageUserId { get; set; } - - [Column("ChatMessageRoomID")] - public int ChatMessageRoomId { get; set; } - - public bool ChatMessageRejected { get; set; } - - public DateTime ChatMessageLastModified { get; set; } - - public string ChatMessageText { get; set; } = null!; - - public int ChatMessageSystemMessageType { get; set; } - - [Column("ChatMessageRecipientID")] - public int? ChatMessageRecipientId { get; set; } - - [ForeignKey("ChatMessageRecipientId")] - [InverseProperty("ChatMessageChatMessageRecipients")] - public virtual ChatUser? ChatMessageRecipient { get; set; } - - [ForeignKey("ChatMessageRoomId")] - [InverseProperty("ChatMessages")] - public virtual ChatRoom ChatMessageRoom { get; set; } = null!; - - [ForeignKey("ChatMessageUserId")] - [InverseProperty("ChatMessageChatMessageUsers")] - public virtual ChatUser? ChatMessageUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ChatNotification.cs b/Migration.Toolkit.K11/Models/ChatNotification.cs deleted file mode 100644 index 41409dc6..00000000 --- a/Migration.Toolkit.K11/Models/ChatNotification.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_Notification")] -[Index("ChatNotificationReceiverId", Name = "IX_Chat_Notification_ChatNotificationReceiverID")] -[Index("ChatNotificationRoomId", Name = "IX_Chat_Notification_ChatNotificationRoomID")] -[Index("ChatNotificationSenderId", Name = "IX_Chat_Notification_ChatNotificationSenderID")] -[Index("ChatNotificationSiteId", Name = "IX_Chat_Notification_ChatNotificationSiteID")] -public class ChatNotification -{ - [Key] - [Column("ChatNotificationID")] - public int ChatNotificationId { get; set; } - - [Column("ChatNotificationSenderID")] - public int ChatNotificationSenderId { get; set; } - - [Column("ChatNotificationReceiverID")] - public int ChatNotificationReceiverId { get; set; } - - public bool ChatNotificationIsRead { get; set; } - - public int ChatNotificationType { get; set; } - - [Column("ChatNotificationRoomID")] - public int? ChatNotificationRoomId { get; set; } - - public DateTime ChatNotificationSendDateTime { get; set; } - - public DateTime? ChatNotificationReadDateTime { get; set; } - - [Column("ChatNotificationSiteID")] - public int? ChatNotificationSiteId { get; set; } - - [ForeignKey("ChatNotificationReceiverId")] - [InverseProperty("ChatNotificationChatNotificationReceivers")] - public virtual ChatUser ChatNotificationReceiver { get; set; } = null!; - - [ForeignKey("ChatNotificationRoomId")] - [InverseProperty("ChatNotifications")] - public virtual ChatRoom? ChatNotificationRoom { get; set; } - - [ForeignKey("ChatNotificationSenderId")] - [InverseProperty("ChatNotificationChatNotificationSenders")] - public virtual ChatUser ChatNotificationSender { get; set; } = null!; - - [ForeignKey("ChatNotificationSiteId")] - [InverseProperty("ChatNotifications")] - public virtual CmsSite? ChatNotificationSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ChatOnlineSupport.cs b/Migration.Toolkit.K11/Models/ChatOnlineSupport.cs deleted file mode 100644 index 854c42d5..00000000 --- a/Migration.Toolkit.K11/Models/ChatOnlineSupport.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_OnlineSupport")] -[Index("ChatOnlineSupportChatUserId", Name = "IX_Chat_OnlineSupport_ChatOnlineSupportChatUserID")] -[Index("ChatOnlineSupportSiteId", Name = "IX_Chat_OnlineSupport_SiteID")] -[Index("ChatOnlineSupportChatUserId", "ChatOnlineSupportSiteId", Name = "UQ_Chat_OnlineSupport_ChatUserID-SiteID", IsUnique = true)] -public class ChatOnlineSupport -{ - [Key] - [Column("ChatOnlineSupportID")] - public int ChatOnlineSupportId { get; set; } - - [Column("ChatOnlineSupportChatUserID")] - public int ChatOnlineSupportChatUserId { get; set; } - - public DateTime ChatOnlineSupportLastChecking { get; set; } - - [Column("ChatOnlineSupportSiteID")] - public int ChatOnlineSupportSiteId { get; set; } - - [StringLength(50)] - public string? ChatOnlineSupportToken { get; set; } - - [ForeignKey("ChatOnlineSupportChatUserId")] - [InverseProperty("ChatOnlineSupports")] - public virtual ChatUser ChatOnlineSupportChatUser { get; set; } = null!; - - [ForeignKey("ChatOnlineSupportSiteId")] - [InverseProperty("ChatOnlineSupports")] - public virtual CmsSite ChatOnlineSupportSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ChatOnlineUser.cs b/Migration.Toolkit.K11/Models/ChatOnlineUser.cs deleted file mode 100644 index 7f576433..00000000 --- a/Migration.Toolkit.K11/Models/ChatOnlineUser.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_OnlineUser")] -[Index("ChatOnlineUserChatUserId", Name = "IX_Chat_OnlineUser_ChatOnlineUserChatUserID")] -[Index("ChatOnlineUserSiteId", Name = "IX_Chat_OnlineUser_SiteID")] -[Index("ChatOnlineUserChatUserId", "ChatOnlineUserSiteId", Name = "UQ_Chat_OnlineUser_SiteID-ChatUserID", IsUnique = true)] -public class ChatOnlineUser -{ - [Key] - [Column("ChatOnlineUserID")] - public int ChatOnlineUserId { get; set; } - - [Column("ChatOnlineUserSiteID")] - public int ChatOnlineUserSiteId { get; set; } - - public DateTime? ChatOnlineUserLastChecking { get; set; } - - [Column("ChatOnlineUserChatUserID")] - public int ChatOnlineUserChatUserId { get; set; } - - public DateTime? ChatOnlineUserJoinTime { get; set; } - - public DateTime? ChatOnlineUserLeaveTime { get; set; } - - [StringLength(50)] - public string? ChatOnlineUserToken { get; set; } - - public bool ChatOnlineUserIsHidden { get; set; } - - [ForeignKey("ChatOnlineUserChatUserId")] - [InverseProperty("ChatOnlineUsers")] - public virtual ChatUser ChatOnlineUserChatUser { get; set; } = null!; - - [ForeignKey("ChatOnlineUserSiteId")] - [InverseProperty("ChatOnlineUsers")] - public virtual CmsSite ChatOnlineUserSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ChatPopupWindowSetting.cs b/Migration.Toolkit.K11/Models/ChatPopupWindowSetting.cs deleted file mode 100644 index 6ac944bd..00000000 --- a/Migration.Toolkit.K11/Models/ChatPopupWindowSetting.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_PopupWindowSettings")] -public class ChatPopupWindowSetting -{ - [Key] - [Column("ChatPopupWindowSettingsID")] - public int ChatPopupWindowSettingsId { get; set; } - - [StringLength(255)] - public string MessageTransformationName { get; set; } = null!; - - [StringLength(255)] - public string ErrorTransformationName { get; set; } = null!; - - [StringLength(255)] - public string ErrorClearTransformationName { get; set; } = null!; - - [StringLength(255)] - public string UserTransformationName { get; set; } = null!; - - public int ChatPopupWindowSettingsHashCode { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ChatRoom.cs b/Migration.Toolkit.K11/Models/ChatRoom.cs deleted file mode 100644 index 0918d696..00000000 --- a/Migration.Toolkit.K11/Models/ChatRoom.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_Room")] -[Index("ChatRoomCreatedByChatUserId", Name = "IX_Chat_Room_ChatRoomCreatedByChatUserID")] -[Index("ChatRoomEnabled", Name = "IX_Chat_Room_Enabled")] -[Index("ChatRoomIsSupport", Name = "IX_Chat_Room_IsSupport")] -[Index("ChatRoomSiteId", Name = "IX_Chat_Room_SiteID")] -public class ChatRoom -{ - [Key] - [Column("ChatRoomID")] - public int ChatRoomId { get; set; } - - [StringLength(100)] - public string ChatRoomName { get; set; } = null!; - - [StringLength(100)] - public string ChatRoomDisplayName { get; set; } = null!; - - [Column("ChatRoomSiteID")] - public int? ChatRoomSiteId { get; set; } - - public bool ChatRoomEnabled { get; set; } - - public bool ChatRoomPrivate { get; set; } - - public bool ChatRoomAllowAnonym { get; set; } - - public DateTime ChatRoomCreatedWhen { get; set; } - - [StringLength(100)] - public string? ChatRoomPassword { get; set; } - - [Column("ChatRoomCreatedByChatUserID")] - public int? ChatRoomCreatedByChatUserId { get; set; } - - public bool ChatRoomIsSupport { get; set; } - - public bool ChatRoomIsOneToOne { get; set; } - - [StringLength(500)] - public string? ChatRoomDescription { get; set; } - - public DateTime ChatRoomLastModification { get; set; } - - public DateTime? ChatRoomScheduledToDelete { get; set; } - - public DateTime ChatRoomPrivateStateLastModification { get; set; } - - [Column("ChatRoomGUID")] - public Guid ChatRoomGuid { get; set; } - - [InverseProperty("InitiatedChatRequestRoom")] - public virtual ChatInitiatedChatRequest? ChatInitiatedChatRequest { get; set; } - - [InverseProperty("ChatMessageRoom")] - public virtual ICollection ChatMessages { get; set; } = new List(); - - [InverseProperty("ChatNotificationRoom")] - public virtual ICollection ChatNotifications { get; set; } = new List(); - - [ForeignKey("ChatRoomCreatedByChatUserId")] - [InverseProperty("ChatRooms")] - public virtual ChatUser? ChatRoomCreatedByChatUser { get; set; } - - [ForeignKey("ChatRoomSiteId")] - [InverseProperty("ChatRooms")] - public virtual CmsSite? ChatRoomSite { get; set; } - - [InverseProperty("ChatRoomUserRoom")] - public virtual ICollection ChatRoomUsers { get; set; } = new List(); - - [InverseProperty("ChatSupportTakenRoomRoom")] - public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ChatRoomUser.cs b/Migration.Toolkit.K11/Models/ChatRoomUser.cs deleted file mode 100644 index 9d07f5eb..00000000 --- a/Migration.Toolkit.K11/Models/ChatRoomUser.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_RoomUser")] -[Index("ChatRoomUserChatUserId", Name = "IX_Chat_RoomUser_ChatRoomUserChatUserID")] -[Index("ChatRoomUserRoomId", Name = "IX_Chat_RoomUser_ChatRoomUserRoomID")] -[Index("ChatRoomUserRoomId", "ChatRoomUserChatUserId", Name = "UQ_Chat_RoomUser_RoomID-ChatUserID", IsUnique = true)] -public class ChatRoomUser -{ - [Key] - [Column("ChatRoomUserID")] - public int ChatRoomUserId { get; set; } - - [Column("ChatRoomUserRoomID")] - public int ChatRoomUserRoomId { get; set; } - - [Column("ChatRoomUserChatUserID")] - public int ChatRoomUserChatUserId { get; set; } - - public DateTime? ChatRoomUserLastChecking { get; set; } - - public DateTime? ChatRoomUserKickExpiration { get; set; } - - public DateTime? ChatRoomUserJoinTime { get; set; } - - public DateTime? ChatRoomUserLeaveTime { get; set; } - - public int ChatRoomUserAdminLevel { get; set; } - - public DateTime ChatRoomUserLastModification { get; set; } - - [ForeignKey("ChatRoomUserChatUserId")] - [InverseProperty("ChatRoomUsers")] - public virtual ChatUser ChatRoomUserChatUser { get; set; } = null!; - - [ForeignKey("ChatRoomUserRoomId")] - [InverseProperty("ChatRoomUsers")] - public virtual ChatRoom ChatRoomUserRoom { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ChatSupportCannedResponse.cs b/Migration.Toolkit.K11/Models/ChatSupportCannedResponse.cs deleted file mode 100644 index 43f665f0..00000000 --- a/Migration.Toolkit.K11/Models/ChatSupportCannedResponse.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_SupportCannedResponse")] -[Index("ChatSupportCannedResponseChatUserId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseChatUserID")] -[Index("ChatSupportCannedResponseSiteId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseSiteID")] -public class ChatSupportCannedResponse -{ - [Key] - [Column("ChatSupportCannedResponseID")] - public int ChatSupportCannedResponseId { get; set; } - - [Column("ChatSupportCannedResponseChatUserID")] - public int? ChatSupportCannedResponseChatUserId { get; set; } - - [StringLength(500)] - public string ChatSupportCannedResponseText { get; set; } = null!; - - [StringLength(50)] - public string ChatSupportCannedResponseTagName { get; set; } = null!; - - [Column("ChatSupportCannedResponseSiteID")] - public int? ChatSupportCannedResponseSiteId { get; set; } - - [StringLength(100)] - public string ChatSupportCannedResponseName { get; set; } = null!; - - [ForeignKey("ChatSupportCannedResponseChatUserId")] - [InverseProperty("ChatSupportCannedResponses")] - public virtual ChatUser? ChatSupportCannedResponseChatUser { get; set; } - - [ForeignKey("ChatSupportCannedResponseSiteId")] - [InverseProperty("ChatSupportCannedResponses")] - public virtual CmsSite? ChatSupportCannedResponseSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ChatSupportTakenRoom.cs b/Migration.Toolkit.K11/Models/ChatSupportTakenRoom.cs deleted file mode 100644 index 835aa29e..00000000 --- a/Migration.Toolkit.K11/Models/ChatSupportTakenRoom.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_SupportTakenRoom")] -[Index("ChatSupportTakenRoomChatUserId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomChatUserID")] -[Index("ChatSupportTakenRoomRoomId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomRoomID")] -public class ChatSupportTakenRoom -{ - [Key] - [Column("ChatSupportTakenRoomID")] - public int ChatSupportTakenRoomId { get; set; } - - [Column("ChatSupportTakenRoomChatUserID")] - public int? ChatSupportTakenRoomChatUserId { get; set; } - - [Column("ChatSupportTakenRoomRoomID")] - public int ChatSupportTakenRoomRoomId { get; set; } - - public DateTime? ChatSupportTakenRoomResolvedDateTime { get; set; } - - public DateTime ChatSupportTakenRoomLastModification { get; set; } - - [ForeignKey("ChatSupportTakenRoomChatUserId")] - [InverseProperty("ChatSupportTakenRooms")] - public virtual ChatUser? ChatSupportTakenRoomChatUser { get; set; } - - [ForeignKey("ChatSupportTakenRoomRoomId")] - [InverseProperty("ChatSupportTakenRooms")] - public virtual ChatRoom ChatSupportTakenRoomRoom { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ChatUser.cs b/Migration.Toolkit.K11/Models/ChatUser.cs deleted file mode 100644 index 9bf37481..00000000 --- a/Migration.Toolkit.K11/Models/ChatUser.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_User")] -[Index("ChatUserUserId", Name = "IX_Chat_User_UserID")] -public class ChatUser -{ - [Key] - [Column("ChatUserID")] - public int ChatUserId { get; set; } - - [Column("ChatUserUserID")] - public int? ChatUserUserId { get; set; } - - [StringLength(50)] - public string ChatUserNickname { get; set; } = null!; - - public DateTime ChatUserLastModification { get; set; } - - [InverseProperty("InitiatedChatRequestInitiatorChatUser")] - public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); - - [InverseProperty("ChatMessageRecipient")] - public virtual ICollection ChatMessageChatMessageRecipients { get; set; } = new List(); - - [InverseProperty("ChatMessageUser")] - public virtual ICollection ChatMessageChatMessageUsers { get; set; } = new List(); - - [InverseProperty("ChatNotificationReceiver")] - public virtual ICollection ChatNotificationChatNotificationReceivers { get; set; } = new List(); - - [InverseProperty("ChatNotificationSender")] - public virtual ICollection ChatNotificationChatNotificationSenders { get; set; } = new List(); - - [InverseProperty("ChatOnlineSupportChatUser")] - public virtual ICollection ChatOnlineSupports { get; set; } = new List(); - - [InverseProperty("ChatOnlineUserChatUser")] - public virtual ICollection ChatOnlineUsers { get; set; } = new List(); - - [InverseProperty("ChatRoomUserChatUser")] - public virtual ICollection ChatRoomUsers { get; set; } = new List(); - - [InverseProperty("ChatRoomCreatedByChatUser")] - public virtual ICollection ChatRooms { get; set; } = new List(); - - [InverseProperty("ChatSupportCannedResponseChatUser")] - public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); - - [InverseProperty("ChatSupportTakenRoomChatUser")] - public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); - - [ForeignKey("ChatUserUserId")] - [InverseProperty("ChatUsers")] - public virtual CmsUser? ChatUserUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CiFileMetadatum.cs b/Migration.Toolkit.K11/Models/CiFileMetadatum.cs deleted file mode 100644 index 4a16d282..00000000 --- a/Migration.Toolkit.K11/Models/CiFileMetadatum.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CI_FileMetadata")] -[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] -public class CiFileMetadatum -{ - [Key] - [Column("FileMetadataID")] - public int FileMetadataId { get; set; } - - [StringLength(260)] - public string FileLocation { get; set; } = null!; - - [StringLength(32)] - public string FileHash { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CiMigration.cs b/Migration.Toolkit.K11/Models/CiMigration.cs deleted file mode 100644 index 085aca53..00000000 --- a/Migration.Toolkit.K11/Models/CiMigration.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CI_Migration")] -[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] -public class CiMigration -{ - [Key] - [Column("MigrationID")] - public int MigrationId { get; set; } - - [StringLength(255)] - public string MigrationName { get; set; } = null!; - - [Precision(3)] - public DateTime DateApplied { get; set; } - - public int? RowsAffected { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsAbuseReport.cs b/Migration.Toolkit.K11/Models/CmsAbuseReport.cs deleted file mode 100644 index 0e7baf6d..00000000 --- a/Migration.Toolkit.K11/Models/CmsAbuseReport.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_AbuseReport")] -[Index("ReportSiteId", Name = "IX_CMS_AbuseReport_ReportSiteID")] -[Index("ReportStatus", Name = "IX_CMS_AbuseReport_ReportStatus")] -[Index("ReportUserId", Name = "IX_CMS_AbuseReport_ReportUserID")] -public class CmsAbuseReport -{ - [Key] - [Column("ReportID")] - public int ReportId { get; set; } - - [Column("ReportGUID")] - public Guid ReportGuid { get; set; } - - [StringLength(100)] - public string? ReportTitle { get; set; } - - [Column("ReportURL")] - [StringLength(1000)] - public string ReportUrl { get; set; } = null!; - - [StringLength(50)] - public string ReportCulture { get; set; } = null!; - - [Column("ReportObjectID")] - public int? ReportObjectId { get; set; } - - [StringLength(100)] - public string? ReportObjectType { get; set; } - - public string ReportComment { get; set; } = null!; - - [Column("ReportUserID")] - public int? ReportUserId { get; set; } - - public DateTime ReportWhen { get; set; } - - public int ReportStatus { get; set; } - - [Column("ReportSiteID")] - public int ReportSiteId { get; set; } - - [ForeignKey("ReportSiteId")] - [InverseProperty("CmsAbuseReports")] - public virtual CmsSite ReportSite { get; set; } = null!; - - [ForeignKey("ReportUserId")] - [InverseProperty("CmsAbuseReports")] - public virtual CmsUser? ReportUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsAcl.cs b/Migration.Toolkit.K11/Models/CmsAcl.cs deleted file mode 100644 index 35c133d1..00000000 --- a/Migration.Toolkit.K11/Models/CmsAcl.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ACL")] -[Index("AclinheritedAcls", Name = "IX_CMS_ACL_ACLInheritedACLs")] -[Index("AclsiteId", Name = "IX_CMS_ACL_ACLSiteID")] -public class CmsAcl -{ - [Key] - [Column("ACLID")] - public int Aclid { get; set; } - - [Column("ACLInheritedACLs")] - public string AclinheritedAcls { get; set; } = null!; - - [Column("ACLGUID")] - public Guid Aclguid { get; set; } - - [Column("ACLLastModified")] - public DateTime AcllastModified { get; set; } - - [Column("ACLSiteID")] - public int? AclsiteId { get; set; } - - [ForeignKey("AclsiteId")] - [InverseProperty("CmsAcls")] - public virtual CmsSite? Aclsite { get; set; } - - [InverseProperty("Acl")] - public virtual ICollection CmsAclitems { get; set; } = new List(); - - [InverseProperty("NodeAcl")] - public virtual ICollection CmsTrees { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsAclitem.cs b/Migration.Toolkit.K11/Models/CmsAclitem.cs deleted file mode 100644 index 871d5e8c..00000000 --- a/Migration.Toolkit.K11/Models/CmsAclitem.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ACLItem")] -[Index("Aclid", Name = "IX_CMS_ACLItem_ACLID")] -[Index("LastModifiedByUserId", Name = "IX_CMS_ACLItem_LastModifiedByUserID")] -[Index("RoleId", Name = "IX_CMS_ACLItem_RoleID")] -[Index("UserId", Name = "IX_CMS_ACLItem_UserID")] -public class CmsAclitem -{ - [Key] - [Column("ACLItemID")] - public int AclitemId { get; set; } - - [Column("ACLID")] - public int Aclid { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [Column("RoleID")] - public int? RoleId { get; set; } - - public int Allowed { get; set; } - - public int Denied { get; set; } - - public DateTime LastModified { get; set; } - - [Column("LastModifiedByUserID")] - public int? LastModifiedByUserId { get; set; } - - [Column("ACLItemGUID")] - public Guid AclitemGuid { get; set; } - - [ForeignKey("Aclid")] - [InverseProperty("CmsAclitems")] - public virtual CmsAcl Acl { get; set; } = null!; - - [ForeignKey("LastModifiedByUserId")] - [InverseProperty("CmsAclitemLastModifiedByUsers")] - public virtual CmsUser? LastModifiedByUser { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsAclitems")] - public virtual CmsRole? Role { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsAclitemUsers")] - public virtual CmsUser? User { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsAlternativeForm.cs b/Migration.Toolkit.K11/Models/CmsAlternativeForm.cs deleted file mode 100644 index 46de00aa..00000000 --- a/Migration.Toolkit.K11/Models/CmsAlternativeForm.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_AlternativeForm")] -[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] -[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] -public class CmsAlternativeForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(50)] - public string FormName { get; set; } = null!; - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public string? FormDefinition { get; set; } - - public string? FormLayout { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - [Column("FormCoupledClassID")] - public int? FormCoupledClassId { get; set; } - - public bool? FormHideNewParentFields { get; set; } - - [StringLength(50)] - public string? FormLayoutType { get; set; } - - [Column("FormVersionGUID")] - [StringLength(50)] - public string? FormVersionGuid { get; set; } - - [StringLength(400)] - public string? FormCustomizedColumns { get; set; } - - public bool? FormIsCustom { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsAlternativeFormFormClasses")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormCoupledClassId")] - [InverseProperty("CmsAlternativeFormFormCoupledClasses")] - public virtual CmsClass? FormCoupledClass { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsAttachment.cs b/Migration.Toolkit.K11/Models/CmsAttachment.cs deleted file mode 100644 index 8e2dec6a..00000000 --- a/Migration.Toolkit.K11/Models/CmsAttachment.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Attachment")] -[Index("AttachmentDocumentId", Name = "IX_CMS_Attachment_AttachmentDocumentID")] -[Index("AttachmentGuid", "AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentGUID_AttachmentSiteID")] -[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentFormGuid", "AttachmentOrder", Name = "IX_CMS_Attachment_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentFormGUID_AttachmentOrder")] -[Index("AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentSiteID")] -[Index("AttachmentVariantParentId", Name = "IX_CMS_Attachment_AttachmentVariantParentID")] -public class CmsAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - public int? AttachmentImageWidth { get; set; } - - public int? AttachmentImageHeight { get; set; } - - [Column("AttachmentDocumentID")] - public int? AttachmentDocumentId { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - public bool? AttachmentIsUnsorted { get; set; } - - public int? AttachmentOrder { get; set; } - - [Column("AttachmentGroupGUID")] - public Guid? AttachmentGroupGuid { get; set; } - - [Column("AttachmentFormGUID")] - public Guid? AttachmentFormGuid { get; set; } - - [StringLength(32)] - public string? AttachmentHash { get; set; } - - [StringLength(250)] - public string? AttachmentTitle { get; set; } - - public string? AttachmentDescription { get; set; } - - public string? AttachmentCustomData { get; set; } - - public string? AttachmentSearchContent { get; set; } - - [StringLength(50)] - public string? AttachmentVariantDefinitionIdentifier { get; set; } - - [Column("AttachmentVariantParentID")] - public int? AttachmentVariantParentId { get; set; } - - [ForeignKey("AttachmentDocumentId")] - [InverseProperty("CmsAttachments")] - public virtual CmsDocument? AttachmentDocument { get; set; } - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("CmsAttachments")] - public virtual CmsSite AttachmentSite { get; set; } = null!; - - [ForeignKey("AttachmentVariantParentId")] - [InverseProperty("InverseAttachmentVariantParent")] - public virtual CmsAttachment? AttachmentVariantParent { get; set; } - - [InverseProperty("AttachmentVariantParent")] - public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsAttachmentHistory.cs b/Migration.Toolkit.K11/Models/CmsAttachmentHistory.cs deleted file mode 100644 index b20400d7..00000000 --- a/Migration.Toolkit.K11/Models/CmsAttachmentHistory.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_AttachmentHistory")] -[Index("AttachmentGuid", Name = "IX_CMS_AttachmentHistory_AttachmentGUID")] -[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentOrder", Name = "IX_CMS_AttachmentHistory_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentOrder")] -[Index("AttachmentSiteId", Name = "IX_CMS_AttachmentHistory_AttachmentSiteID")] -[Index("AttachmentVariantParentId", Name = "IX_CMS_AttachmentHistory_AttachmentVariantParentID")] -public class CmsAttachmentHistory -{ - [Key] - [Column("AttachmentHistoryID")] - public int AttachmentHistoryId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - public int? AttachmentImageWidth { get; set; } - - public int? AttachmentImageHeight { get; set; } - - [Column("AttachmentDocumentID")] - public int AttachmentDocumentId { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public bool? AttachmentIsUnsorted { get; set; } - - public int? AttachmentOrder { get; set; } - - [Column("AttachmentGroupGUID")] - public Guid? AttachmentGroupGuid { get; set; } - - [StringLength(32)] - public string? AttachmentHash { get; set; } - - [StringLength(250)] - public string? AttachmentTitle { get; set; } - - public string? AttachmentDescription { get; set; } - - public string? AttachmentCustomData { get; set; } - - public DateTime? AttachmentLastModified { get; set; } - - [Column("AttachmentHistoryGUID")] - public Guid AttachmentHistoryGuid { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - public string? AttachmentSearchContent { get; set; } - - [StringLength(50)] - public string? AttachmentVariantDefinitionIdentifier { get; set; } - - [Column("AttachmentVariantParentID")] - public int? AttachmentVariantParentId { get; set; } - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("CmsAttachmentHistories")] - public virtual CmsSite AttachmentSite { get; set; } = null!; - - [ForeignKey("AttachmentVariantParentId")] - [InverseProperty("InverseAttachmentVariantParent")] - public virtual CmsAttachmentHistory? AttachmentVariantParent { get; set; } - - [InverseProperty("AttachmentVariantParent")] - public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); - - [ForeignKey("AttachmentHistoryId")] - [InverseProperty("AttachmentHistories")] - public virtual ICollection VersionHistories { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsAutomationHistory.cs b/Migration.Toolkit.K11/Models/CmsAutomationHistory.cs deleted file mode 100644 index 88e0534c..00000000 --- a/Migration.Toolkit.K11/Models/CmsAutomationHistory.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_AutomationHistory")] -[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] -[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] -[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] -[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] -[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] -[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] -public class CmsAutomationHistory -{ - [Key] - [Column("HistoryID")] - public int HistoryId { get; set; } - - [Column("HistoryStepID")] - public int? HistoryStepId { get; set; } - - [StringLength(440)] - public string? HistoryStepName { get; set; } - - [StringLength(450)] - public string HistoryStepDisplayName { get; set; } = null!; - - public int? HistoryStepType { get; set; } - - [Column("HistoryTargetStepID")] - public int? HistoryTargetStepId { get; set; } - - [StringLength(440)] - public string? HistoryTargetStepName { get; set; } - - [StringLength(450)] - public string? HistoryTargetStepDisplayName { get; set; } - - public int? HistoryTargetStepType { get; set; } - - [Column("HistoryApprovedByUserID")] - public int? HistoryApprovedByUserId { get; set; } - - public DateTime? HistoryApprovedWhen { get; set; } - - public string? HistoryComment { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - public bool HistoryWasRejected { get; set; } - - [Column("HistoryStateID")] - public int HistoryStateId { get; set; } - - [ForeignKey("HistoryApprovedByUserId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsUser? HistoryApprovedByUser { get; set; } - - [ForeignKey("HistoryStateId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsAutomationState HistoryState { get; set; } = null!; - - [ForeignKey("HistoryStepId")] - [InverseProperty("CmsAutomationHistoryHistorySteps")] - public virtual CmsWorkflowStep? HistoryStep { get; set; } - - [ForeignKey("HistoryTargetStepId")] - [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] - public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsAutomationState.cs b/Migration.Toolkit.K11/Models/CmsAutomationState.cs deleted file mode 100644 index 6bf7e4ab..00000000 --- a/Migration.Toolkit.K11/Models/CmsAutomationState.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_AutomationState")] -[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] -[Index("StateSiteId", Name = "IX_CMS_AutomationState_StateSiteID")] -[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] -[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] -[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] -public class CmsAutomationState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [Column("StateStepID")] - public int StateStepId { get; set; } - - [Column("StateObjectID")] - public int StateObjectId { get; set; } - - [StringLength(100)] - public string StateObjectType { get; set; } = null!; - - [StringLength(450)] - public string? StateActionStatus { get; set; } - - public DateTime? StateCreated { get; set; } - - public DateTime? StateLastModified { get; set; } - - [Column("StateWorkflowID")] - public int StateWorkflowId { get; set; } - - public int? StateStatus { get; set; } - - [Column("StateSiteID")] - public int? StateSiteId { get; set; } - - [Column("StateUserID")] - public int? StateUserId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public string? StateCustomData { get; set; } - - [InverseProperty("HistoryState")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [ForeignKey("StateSiteId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsSite? StateSite { get; set; } - - [ForeignKey("StateStepId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflowStep StateStep { get; set; } = null!; - - [ForeignKey("StateUserId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsUser? StateUser { get; set; } - - [ForeignKey("StateWorkflowId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflow StateWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsAvatar.cs b/Migration.Toolkit.K11/Models/CmsAvatar.cs deleted file mode 100644 index bfd2b907..00000000 --- a/Migration.Toolkit.K11/Models/CmsAvatar.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Avatar")] -[Index("AvatarGuid", Name = "IX_CMS_Avatar_AvatarGUID")] -[Index("AvatarType", "AvatarIsCustom", Name = "IX_CMS_Avatar_AvatarType_AvatarIsCustom")] -public class CmsAvatar -{ - [Key] - [Column("AvatarID")] - public int AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarName { get; set; } - - [StringLength(200)] - public string AvatarFileName { get; set; } = null!; - - [StringLength(10)] - public string AvatarFileExtension { get; set; } = null!; - - public byte[]? AvatarBinary { get; set; } - - [StringLength(50)] - public string AvatarType { get; set; } = null!; - - public bool AvatarIsCustom { get; set; } - - [Column("AvatarGUID")] - public Guid AvatarGuid { get; set; } - - public DateTime AvatarLastModified { get; set; } - - [StringLength(100)] - public string AvatarMimeType { get; set; } = null!; - - public int AvatarFileSize { get; set; } - - public int? AvatarImageHeight { get; set; } - - public int? AvatarImageWidth { get; set; } - - public bool? DefaultMaleUserAvatar { get; set; } - - public bool? DefaultFemaleUserAvatar { get; set; } - - public bool? DefaultGroupAvatar { get; set; } - - public bool? DefaultUserAvatar { get; set; } - - [InverseProperty("UserAvatar")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); - - [InverseProperty("GroupAvatar")] - public virtual ICollection CommunityGroups { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsBadge.cs b/Migration.Toolkit.K11/Models/CmsBadge.cs deleted file mode 100644 index c3178605..00000000 --- a/Migration.Toolkit.K11/Models/CmsBadge.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Badge")] -public class CmsBadge -{ - [Key] - [Column("BadgeID")] - public int BadgeId { get; set; } - - [StringLength(100)] - public string BadgeName { get; set; } = null!; - - [StringLength(200)] - public string BadgeDisplayName { get; set; } = null!; - - [Column("BadgeImageURL")] - [StringLength(200)] - public string? BadgeImageUrl { get; set; } - - public bool BadgeIsAutomatic { get; set; } - - public int? BadgeTopLimit { get; set; } - - [Column("BadgeGUID")] - public Guid BadgeGuid { get; set; } - - public DateTime BadgeLastModified { get; set; } - - [InverseProperty("UserBadge")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsBannedIp.cs b/Migration.Toolkit.K11/Models/CmsBannedIp.cs deleted file mode 100644 index cbf0c498..00000000 --- a/Migration.Toolkit.K11/Models/CmsBannedIp.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_BannedIP")] -[Index("IpaddressSiteId", Name = "IX_CMS_BannedIP_IPAddressSiteID")] -public class CmsBannedIp -{ - [Key] - [Column("IPAddressID")] - public int IpaddressId { get; set; } - - [Column("IPAddress")] - [StringLength(100)] - public string Ipaddress { get; set; } = null!; - - [Column("IPAddressRegular")] - [StringLength(200)] - public string IpaddressRegular { get; set; } = null!; - - [Column("IPAddressAllowed")] - public bool IpaddressAllowed { get; set; } - - [Column("IPAddressAllowOverride")] - public bool IpaddressAllowOverride { get; set; } - - [Column("IPAddressBanReason")] - [StringLength(450)] - public string? IpaddressBanReason { get; set; } - - [Column("IPAddressBanType")] - [StringLength(100)] - public string IpaddressBanType { get; set; } = null!; - - [Column("IPAddressBanEnabled")] - public bool? IpaddressBanEnabled { get; set; } - - [Column("IPAddressSiteID")] - public int? IpaddressSiteId { get; set; } - - [Column("IPAddressGUID")] - public Guid IpaddressGuid { get; set; } - - [Column("IPAddressLastModified")] - public DateTime IpaddressLastModified { get; set; } - - [ForeignKey("IpaddressSiteId")] - [InverseProperty("CmsBannedIps")] - public virtual CmsSite? IpaddressSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsBanner.cs b/Migration.Toolkit.K11/Models/CmsBanner.cs deleted file mode 100644 index 29f7987c..00000000 --- a/Migration.Toolkit.K11/Models/CmsBanner.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Banner")] -[Index("BannerCategoryId", Name = "IX_CMS_Banner_BannerCategoryID")] -[Index("BannerSiteId", Name = "IX_CMS_Banner_BannerSiteID")] -public class CmsBanner -{ - [Key] - [Column("BannerID")] - public int BannerId { get; set; } - - [StringLength(256)] - public string BannerName { get; set; } = null!; - - [StringLength(256)] - public string BannerDisplayName { get; set; } = null!; - - [Column("BannerCategoryID")] - public int BannerCategoryId { get; set; } - - [Required] - public bool? BannerEnabled { get; set; } - - public DateTime? BannerFrom { get; set; } - - public DateTime? BannerTo { get; set; } - - public Guid BannerGuid { get; set; } - - public DateTime BannerLastModified { get; set; } - - public int BannerType { get; set; } - - [Column("BannerURL")] - [StringLength(2083)] - public string BannerUrl { get; set; } = null!; - - public bool BannerBlank { get; set; } - - public double BannerWeight { get; set; } - - public int? BannerHitsLeft { get; set; } - - public int? BannerClicksLeft { get; set; } - - [Column("BannerSiteID")] - public int? BannerSiteId { get; set; } - - public string BannerContent { get; set; } = null!; - - [ForeignKey("BannerCategoryId")] - [InverseProperty("CmsBanners")] - public virtual CmsBannerCategory BannerCategory { get; set; } = null!; - - [ForeignKey("BannerSiteId")] - [InverseProperty("CmsBanners")] - public virtual CmsSite? BannerSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsBannerCategory.cs b/Migration.Toolkit.K11/Models/CmsBannerCategory.cs deleted file mode 100644 index e025cdb7..00000000 --- a/Migration.Toolkit.K11/Models/CmsBannerCategory.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_BannerCategory")] -[Index("BannerCategoryName", "BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategoryName_BannerCategorySiteID", IsUnique = true)] -[Index("BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategorySiteID")] -public class CmsBannerCategory -{ - [Key] - [Column("BannerCategoryID")] - public int BannerCategoryId { get; set; } - - [StringLength(100)] - public string BannerCategoryName { get; set; } = null!; - - [StringLength(200)] - public string BannerCategoryDisplayName { get; set; } = null!; - - [Column("BannerCategorySiteID")] - public int? BannerCategorySiteId { get; set; } - - public Guid BannerCategoryGuid { get; set; } - - public DateTime BannerCategoryLastModified { get; set; } - - [Required] - public bool? BannerCategoryEnabled { get; set; } - - [ForeignKey("BannerCategorySiteId")] - [InverseProperty("CmsBannerCategories")] - public virtual CmsSite? BannerCategorySite { get; set; } - - [InverseProperty("BannerCategory")] - public virtual ICollection CmsBanners { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsCategory.cs b/Migration.Toolkit.K11/Models/CmsCategory.cs deleted file mode 100644 index 959e3e66..00000000 --- a/Migration.Toolkit.K11/Models/CmsCategory.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Category")] -[Index("CategorySiteId", Name = "IX_CMS_Category_CategorySiteID")] -[Index("CategoryUserId", Name = "IX_CMS_Category_CategoryUserID")] -public class CmsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(250)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(250)] - public string? CategoryName { get; set; } - - public string? CategoryDescription { get; set; } - - public int? CategoryCount { get; set; } - - [Required] - public bool? CategoryEnabled { get; set; } - - [Column("CategoryUserID")] - public int? CategoryUserId { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - [StringLength(1500)] - public string? CategoryNamePath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryOrder { get; set; } - - [ForeignKey("CategorySiteId")] - [InverseProperty("CmsCategories")] - public virtual CmsSite? CategorySite { get; set; } - - [ForeignKey("CategoryUserId")] - [InverseProperty("CmsCategories")] - public virtual CmsUser? CategoryUser { get; set; } - - [ForeignKey("CategoryId")] - [InverseProperty("Categories")] - public virtual ICollection Documents { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsClass.cs b/Migration.Toolkit.K11/Models/CmsClass.cs deleted file mode 100644 index 4f2a9a8f..00000000 --- a/Migration.Toolkit.K11/Models/CmsClass.cs +++ /dev/null @@ -1,220 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Class")] -[Index("ClassDefaultPageTemplateId", Name = "IX_CMS_Class_ClassDefaultPageTemplateID")] -[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] -[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] -[Index("ClassPageTemplateCategoryId", Name = "IX_CMS_Class_ClassPageTemplateCategoryID")] -[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] -[Index("ClassShowAsSystemTable", "ClassIsCustomTable", "ClassIsCoupledClass", "ClassIsDocumentType", Name = "IX_CMS_Class_ClassShowAsSystemTable_ClassIsCustomTable_ClassIsCoupledClass_ClassIsDocumentType")] -public class CmsClass -{ - [Key] - [Column("ClassID")] - public int ClassId { get; set; } - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - public bool ClassUsesVersioning { get; set; } - - public bool ClassIsDocumentType { get; set; } - - public bool ClassIsCoupledClass { get; set; } - - public string ClassXmlSchema { get; set; } = null!; - - public string ClassFormDefinition { get; set; } = null!; - - [StringLength(450)] - public string? ClassEditingPageUrl { get; set; } - - [StringLength(450)] - public string? ClassListPageUrl { get; set; } - - [StringLength(100)] - public string ClassNodeNameSource { get; set; } = null!; - - [StringLength(100)] - public string? ClassTableName { get; set; } - - [StringLength(450)] - public string? ClassViewPageUrl { get; set; } - - [StringLength(450)] - public string? ClassPreviewPageUrl { get; set; } - - public string? ClassFormLayout { get; set; } - - [StringLength(450)] - public string? ClassNewPageUrl { get; set; } - - public bool? ClassShowAsSystemTable { get; set; } - - public bool? ClassUsePublishFromTo { get; set; } - - public bool? ClassShowTemplateSelection { get; set; } - - [Column("ClassSKUMappings")] - public string? ClassSkumappings { get; set; } - - public bool? ClassIsMenuItemType { get; set; } - - [StringLength(100)] - public string? ClassNodeAliasSource { get; set; } - - [Column("ClassDefaultPageTemplateID")] - public int? ClassDefaultPageTemplateId { get; set; } - - public DateTime ClassLastModified { get; set; } - - [Column("ClassGUID")] - public Guid ClassGuid { get; set; } - - [Column("ClassCreateSKU")] - public bool? ClassCreateSku { get; set; } - - public bool? ClassIsProduct { get; set; } - - public bool ClassIsCustomTable { get; set; } - - [StringLength(1000)] - public string? ClassShowColumns { get; set; } - - [StringLength(200)] - public string? ClassSearchTitleColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchContentColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchImageColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchCreationDateColumn { get; set; } - - public string? ClassSearchSettings { get; set; } - - [Column("ClassInheritsFromClassID")] - public int? ClassInheritsFromClassId { get; set; } - - public bool? ClassSearchEnabled { get; set; } - - [Column("ClassSKUDefaultDepartmentName")] - [StringLength(200)] - public string? ClassSkudefaultDepartmentName { get; set; } - - [Column("ClassSKUDefaultDepartmentID")] - public int? ClassSkudefaultDepartmentId { get; set; } - - public string? ClassContactMapping { get; set; } - - public bool? ClassContactOverwriteEnabled { get; set; } - - [Column("ClassSKUDefaultProductType")] - [StringLength(50)] - public string? ClassSkudefaultProductType { get; set; } - - [StringLength(100)] - public string? ClassConnectionString { get; set; } - - public bool? ClassIsProductSection { get; set; } - - [Column("ClassPageTemplateCategoryID")] - public int? ClassPageTemplateCategoryId { get; set; } - - [StringLength(50)] - public string? ClassFormLayoutType { get; set; } - - [Column("ClassVersionGUID")] - [StringLength(50)] - public string? ClassVersionGuid { get; set; } - - [StringLength(100)] - public string? ClassDefaultObjectType { get; set; } - - public bool? ClassIsForm { get; set; } - - [Column("ClassResourceID")] - public int? ClassResourceId { get; set; } - - [StringLength(400)] - public string? ClassCustomizedColumns { get; set; } - - public string? ClassCodeGenerationSettings { get; set; } - - [StringLength(200)] - public string? ClassIconClass { get; set; } - - public bool? ClassIsContentOnly { get; set; } - - [Column("ClassURLPattern")] - [StringLength(200)] - public string? ClassUrlpattern { get; set; } - - [ForeignKey("ClassDefaultPageTemplateId")] - [InverseProperty("CmsClasses")] - public virtual CmsPageTemplate? ClassDefaultPageTemplate { get; set; } - - [ForeignKey("ClassPageTemplateCategoryId")] - [InverseProperty("CmsClasses")] - public virtual CmsPageTemplateCategory? ClassPageTemplateCategory { get; set; } - - [ForeignKey("ClassResourceId")] - [InverseProperty("CmsClasses")] - public virtual CmsResource? ClassResource { get; set; } - - [InverseProperty("FormClass")] - public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); - - [InverseProperty("FormCoupledClass")] - public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); - - [InverseProperty("FormClass")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("PageTemplateScopeClass")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsPermissions { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsQueries { get; set; } = new List(); - - [InverseProperty("TransformationClass")] - public virtual ICollection CmsTransformations { get; set; } = new List(); - - [InverseProperty("NodeClass")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("VersionClass")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("ScopeClass")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [ForeignKey("ParentClassId")] - [InverseProperty("ParentClasses")] - public virtual ICollection ChildClasses { get; set; } = new List(); - - [ForeignKey("ChildClassId")] - [InverseProperty("ChildClasses")] - public virtual ICollection ParentClasses { get; set; } = new List(); - - [ForeignKey("ClassId")] - [InverseProperty("Classes")] - public virtual ICollection Scopes { get; set; } = new List(); - - [ForeignKey("ClassId")] - [InverseProperty("Classes")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsConsent.cs b/Migration.Toolkit.K11/Models/CmsConsent.cs deleted file mode 100644 index a2ac73d6..00000000 --- a/Migration.Toolkit.K11/Models/CmsConsent.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Consent")] -public class CmsConsent -{ - [Key] - [Column("ConsentID")] - public int ConsentId { get; set; } - - [StringLength(200)] - public string ConsentDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ConsentName { get; set; } = null!; - - public string ConsentContent { get; set; } = null!; - - public Guid ConsentGuid { get; set; } - - public DateTime ConsentLastModified { get; set; } - - [StringLength(100)] - public string ConsentHash { get; set; } = null!; - - [InverseProperty("ConsentAgreementConsent")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [InverseProperty("ConsentArchiveConsent")] - public virtual ICollection CmsConsentArchives { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsConsentAgreement.cs b/Migration.Toolkit.K11/Models/CmsConsentAgreement.cs deleted file mode 100644 index dc4cbb76..00000000 --- a/Migration.Toolkit.K11/Models/CmsConsentAgreement.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ConsentAgreement")] -[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] -public class CmsConsentAgreement -{ - [Key] - [Column("ConsentAgreementID")] - public int ConsentAgreementId { get; set; } - - public Guid ConsentAgreementGuid { get; set; } - - public bool ConsentAgreementRevoked { get; set; } - - [Column("ConsentAgreementContactID")] - public int ConsentAgreementContactId { get; set; } - - [Column("ConsentAgreementConsentID")] - public int ConsentAgreementConsentId { get; set; } - - [StringLength(100)] - public string? ConsentAgreementConsentHash { get; set; } - - public DateTime ConsentAgreementTime { get; set; } - - [ForeignKey("ConsentAgreementConsentId")] - [InverseProperty("CmsConsentAgreements")] - public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; - - [ForeignKey("ConsentAgreementContactId")] - [InverseProperty("CmsConsentAgreements")] - public virtual OmContact ConsentAgreementContact { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsConsentArchive.cs b/Migration.Toolkit.K11/Models/CmsConsentArchive.cs deleted file mode 100644 index b992e507..00000000 --- a/Migration.Toolkit.K11/Models/CmsConsentArchive.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ConsentArchive")] -[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] -public class CmsConsentArchive -{ - [Key] - [Column("ConsentArchiveID")] - public int ConsentArchiveId { get; set; } - - public Guid ConsentArchiveGuid { get; set; } - - public DateTime ConsentArchiveLastModified { get; set; } - - [Column("ConsentArchiveConsentID")] - public int ConsentArchiveConsentId { get; set; } - - [StringLength(100)] - public string ConsentArchiveHash { get; set; } = null!; - - public string ConsentArchiveContent { get; set; } = null!; - - [ForeignKey("ConsentArchiveConsentId")] - [InverseProperty("CmsConsentArchives")] - public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsCountry.cs b/Migration.Toolkit.K11/Models/CmsCountry.cs deleted file mode 100644 index 3b2f55fd..00000000 --- a/Migration.Toolkit.K11/Models/CmsCountry.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Country")] -public class CmsCountry -{ - [Key] - [Column("CountryID")] - public int CountryId { get; set; } - - [StringLength(200)] - public string CountryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CountryName { get; set; } = null!; - - [Column("CountryGUID")] - public Guid CountryGuid { get; set; } - - public DateTime CountryLastModified { get; set; } - - [StringLength(2)] - public string? CountryTwoLetterCode { get; set; } - - [StringLength(3)] - public string? CountryThreeLetterCode { get; set; } - - [InverseProperty("Country")] - public virtual ICollection CmsStates { get; set; } = new List(); - - [InverseProperty("AddressCountry")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("AddressCountry")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("Country")] - public virtual ICollection ComTaxClassCountries { get; set; } = new List(); - - [InverseProperty("AccountCountry")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactCountry")] - public virtual ICollection OmContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsCssStylesheet.cs b/Migration.Toolkit.K11/Models/CmsCssStylesheet.cs deleted file mode 100644 index cd23995a..00000000 --- a/Migration.Toolkit.K11/Models/CmsCssStylesheet.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_CssStylesheet")] -[Index("StylesheetName", Name = "IX_CMS_CssStylesheet_StylesheetName")] -public class CmsCssStylesheet -{ - [Key] - [Column("StylesheetID")] - public int StylesheetId { get; set; } - - [StringLength(200)] - public string StylesheetDisplayName { get; set; } = null!; - - [StringLength(200)] - public string StylesheetName { get; set; } = null!; - - public string? StylesheetText { get; set; } - - [Column("StylesheetVersionGUID")] - public Guid? StylesheetVersionGuid { get; set; } - - [Column("StylesheetGUID")] - public Guid? StylesheetGuid { get; set; } - - public DateTime StylesheetLastModified { get; set; } - - public string? StylesheetDynamicCode { get; set; } - - [StringLength(200)] - public string? StylesheetDynamicLanguage { get; set; } - - [InverseProperty("DocumentStylesheet")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("SiteDefaultEditorStylesheetNavigation")] - public virtual ICollection CmsSiteSiteDefaultEditorStylesheetNavigations { get; set; } = new List(); - - [InverseProperty("SiteDefaultStylesheet")] - public virtual ICollection CmsSiteSiteDefaultStylesheets { get; set; } = new List(); - - [ForeignKey("StylesheetId")] - [InverseProperty("Stylesheets")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsCulture.cs b/Migration.Toolkit.K11/Models/CmsCulture.cs deleted file mode 100644 index 863d3f3f..00000000 --- a/Migration.Toolkit.K11/Models/CmsCulture.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Culture")] -[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] -[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] -public class CmsCulture -{ - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; - - [StringLength(200)] - public string CultureShortName { get; set; } = null!; - - [Column("CultureGUID")] - public Guid CultureGuid { get; set; } - - public DateTime CultureLastModified { get; set; } - - [StringLength(100)] - public string? CultureAlias { get; set; } - - [Column("CultureIsUICulture")] - public bool? CultureIsUiculture { get; set; } - - [InverseProperty("PageTemplateScopeCulture")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("TranslationCulture")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); - - [InverseProperty("Culture")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("ScopeCulture")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [ForeignKey("IndexCultureId")] - [InverseProperty("IndexCultures")] - public virtual ICollection Indices { get; set; } = new List(); - - [ForeignKey("CultureId")] - [InverseProperty("Cultures")] - public virtual ICollection Sites { get; set; } = new List(); - - [ForeignKey("CultureId")] - [InverseProperty("Cultures")] - public virtual ICollection Words { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsDeviceProfile.cs b/Migration.Toolkit.K11/Models/CmsDeviceProfile.cs deleted file mode 100644 index 2058d624..00000000 --- a/Migration.Toolkit.K11/Models/CmsDeviceProfile.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_DeviceProfile")] -public class CmsDeviceProfile -{ - [Key] - [Column("ProfileID")] - public int ProfileId { get; set; } - - [StringLength(100)] - public string ProfileName { get; set; } = null!; - - [StringLength(200)] - public string ProfileDisplayName { get; set; } = null!; - - public int? ProfileOrder { get; set; } - - public string? ProfileMacro { get; set; } - - public string? ProfileUserAgents { get; set; } - - [Required] - public bool? ProfileEnabled { get; set; } - - public int? ProfilePreviewWidth { get; set; } - - public int? ProfilePreviewHeight { get; set; } - - [Column("ProfileGUID")] - public Guid? ProfileGuid { get; set; } - - public DateTime? ProfileLastModified { get; set; } - - [InverseProperty("DeviceProfile")] - public virtual ICollection CmsDeviceProfileLayouts { get; set; } = new List(); - - [InverseProperty("Profile")] - public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsDeviceProfileLayout.cs b/Migration.Toolkit.K11/Models/CmsDeviceProfileLayout.cs deleted file mode 100644 index 4d512c47..00000000 --- a/Migration.Toolkit.K11/Models/CmsDeviceProfileLayout.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_DeviceProfileLayout")] -[Index("DeviceProfileId", Name = "IX_CMS_DeviceProfileLayout_DeviceProfileID")] -[Index("SourceLayoutId", Name = "IX_CMS_DeviceProfileLayout_SourceLayoutID")] -[Index("TargetLayoutId", Name = "IX_CMS_DeviceProfileLayout_TargetLayoutID")] -public class CmsDeviceProfileLayout -{ - [Key] - [Column("DeviceProfileLayoutID")] - public int DeviceProfileLayoutId { get; set; } - - [Column("DeviceProfileID")] - public int DeviceProfileId { get; set; } - - [Column("SourceLayoutID")] - public int SourceLayoutId { get; set; } - - [Column("TargetLayoutID")] - public int TargetLayoutId { get; set; } - - [Column("DeviceProfileLayoutGUID")] - public Guid DeviceProfileLayoutGuid { get; set; } - - public DateTime DeviceProfileLayoutLastModified { get; set; } - - [ForeignKey("DeviceProfileId")] - [InverseProperty("CmsDeviceProfileLayouts")] - public virtual CmsDeviceProfile DeviceProfile { get; set; } = null!; - - [ForeignKey("SourceLayoutId")] - [InverseProperty("CmsDeviceProfileLayoutSourceLayouts")] - public virtual CmsLayout SourceLayout { get; set; } = null!; - - [ForeignKey("TargetLayoutId")] - [InverseProperty("CmsDeviceProfileLayoutTargetLayouts")] - public virtual CmsLayout TargetLayout { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsDocument.cs b/Migration.Toolkit.K11/Models/CmsDocument.cs deleted file mode 100644 index 256cf015..00000000 --- a/Migration.Toolkit.K11/Models/CmsDocument.cs +++ /dev/null @@ -1,283 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Document")] -[Index("DocumentCheckedOutByUserId", Name = "IX_CMS_Document_DocumentCheckedOutByUserID")] -[Index("DocumentCheckedOutVersionHistoryId", Name = "IX_CMS_Document_DocumentCheckedOutVersionHistoryID")] -[Index("DocumentCreatedByUserId", Name = "IX_CMS_Document_DocumentCreatedByUserID")] -[Index("DocumentCulture", Name = "IX_CMS_Document_DocumentCulture")] -[Index("DocumentForeignKeyValue", "DocumentId", "DocumentNodeId", Name = "IX_CMS_Document_DocumentForeignKeyValue_DocumentID_DocumentNodeID")] -[Index("DocumentModifiedByUserId", Name = "IX_CMS_Document_DocumentModifiedByUserID")] -[Index("DocumentNodeId", "DocumentId", "DocumentCulture", Name = "IX_CMS_Document_DocumentNodeID_DocumentID_DocumentCulture", IsUnique = true)] -[Index("DocumentPageTemplateId", Name = "IX_CMS_Document_DocumentPageTemplateID")] -[Index("DocumentPublishedVersionHistoryId", Name = "IX_CMS_Document_DocumentPublishedVersionHistoryID")] -[Index("DocumentTagGroupId", Name = "IX_CMS_Document_DocumentTagGroupID")] -[Index("DocumentUrlPath", Name = "IX_CMS_Document_DocumentUrlPath_DocumentID_DocumentNodeID")] -[Index("DocumentWildcardRule", "DocumentPriority", Name = "IX_CMS_Document_DocumentWildcardRule_DocumentPriority")] -[Index("DocumentWorkflowStepId", Name = "IX_CMS_Document_DocumentWorkflowStepID")] -public class CmsDocument -{ - [Key] - [Column("DocumentID")] - public int DocumentId { get; set; } - - [StringLength(100)] - public string DocumentName { get; set; } = null!; - - [StringLength(1500)] - public string? DocumentNamePath { get; set; } - - public DateTime? DocumentModifiedWhen { get; set; } - - [Column("DocumentModifiedByUserID")] - public int? DocumentModifiedByUserId { get; set; } - - public int? DocumentForeignKeyValue { get; set; } - - [Column("DocumentCreatedByUserID")] - public int? DocumentCreatedByUserId { get; set; } - - public DateTime? DocumentCreatedWhen { get; set; } - - [Column("DocumentCheckedOutByUserID")] - public int? DocumentCheckedOutByUserId { get; set; } - - public DateTime? DocumentCheckedOutWhen { get; set; } - - [Column("DocumentCheckedOutVersionHistoryID")] - public int? DocumentCheckedOutVersionHistoryId { get; set; } - - [Column("DocumentPublishedVersionHistoryID")] - public int? DocumentPublishedVersionHistoryId { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - public DateTime? DocumentPublishFrom { get; set; } - - public DateTime? DocumentPublishTo { get; set; } - - public string? DocumentUrlPath { get; set; } - - [StringLength(10)] - public string DocumentCulture { get; set; } = null!; - - [Column("DocumentNodeID")] - public int DocumentNodeId { get; set; } - - public string? DocumentPageTitle { get; set; } - - public string? DocumentPageKeyWords { get; set; } - - public string? DocumentPageDescription { get; set; } - - public bool DocumentShowInSiteMap { get; set; } - - public bool DocumentMenuItemHideInNavigation { get; set; } - - [StringLength(200)] - public string? DocumentMenuCaption { get; set; } - - [StringLength(100)] - public string? DocumentMenuStyle { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImage { get; set; } - - [Column("DocumentPageTemplateID")] - public int? DocumentPageTemplateId { get; set; } - - [StringLength(450)] - public string? DocumentMenuJavascript { get; set; } - - [StringLength(450)] - public string? DocumentMenuRedirectUrl { get; set; } - - public bool? DocumentUseNamePathForUrlPath { get; set; } - - [Column("DocumentStylesheetID")] - public int? DocumentStylesheetId { get; set; } - - public string? DocumentContent { get; set; } - - [StringLength(100)] - public string? DocumentMenuClass { get; set; } - - [StringLength(200)] - public string? DocumentMenuStyleHighlighted { get; set; } - - [StringLength(100)] - public string? DocumentMenuClassHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImageHighlighted { get; set; } - - public bool? DocumentMenuItemInactive { get; set; } - - public string? DocumentCustomData { get; set; } - - [StringLength(100)] - public string? DocumentExtensions { get; set; } - - public string? DocumentTags { get; set; } - - [Column("DocumentTagGroupID")] - public int? DocumentTagGroupId { get; set; } - - [StringLength(440)] - public string? DocumentWildcardRule { get; set; } - - public string? DocumentWebParts { get; set; } - - public double? DocumentRatingValue { get; set; } - - public int? DocumentRatings { get; set; } - - public int? DocumentPriority { get; set; } - - [StringLength(50)] - public string? DocumentType { get; set; } - - public DateTime? DocumentLastPublished { get; set; } - - public bool? DocumentUseCustomExtensions { get; set; } - - public string? DocumentGroupWebParts { get; set; } - - public bool? DocumentCheckedOutAutomatically { get; set; } - - [StringLength(200)] - public string? DocumentTrackConversionName { get; set; } - - [StringLength(100)] - public string? DocumentConversionValue { get; set; } - - public bool? DocumentSearchExcluded { get; set; } - - [StringLength(50)] - public string? DocumentLastVersionNumber { get; set; } - - public bool? DocumentIsArchived { get; set; } - - [StringLength(32)] - public string? DocumentHash { get; set; } - - public bool? DocumentLogVisitActivity { get; set; } - - [Column("DocumentGUID")] - public Guid? DocumentGuid { get; set; } - - [Column("DocumentWorkflowCycleGUID")] - public Guid? DocumentWorkflowCycleGuid { get; set; } - - [StringLength(100)] - public string? DocumentSitemapSettings { get; set; } - - public bool? DocumentIsWaitingForTranslation { get; set; } - - [Column("DocumentSKUName")] - [StringLength(440)] - public string? DocumentSkuname { get; set; } - - [Column("DocumentSKUDescription")] - public string? DocumentSkudescription { get; set; } - - [Column("DocumentSKUShortDescription")] - public string? DocumentSkushortDescription { get; set; } - - [StringLength(450)] - public string? DocumentWorkflowActionStatus { get; set; } - - public bool? DocumentMenuRedirectToFirstChild { get; set; } - - [Required] - public bool? DocumentCanBePublished { get; set; } - - [Required] - public bool? DocumentInheritsStylesheet { get; set; } - - [InverseProperty("CommentPostDocument")] - public virtual ICollection BlogComments { get; set; } = new List(); - - [InverseProperty("SubscriptionPostDocument")] - public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); - - [InverseProperty("BoardDocument")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("AttachmentDocument")] - public virtual ICollection CmsAttachments { get; set; } = new List(); - - [InverseProperty("PersonalizationDocument")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [ForeignKey("DocumentCheckedOutByUserId")] - [InverseProperty("CmsDocumentDocumentCheckedOutByUsers")] - public virtual CmsUser? DocumentCheckedOutByUser { get; set; } - - [ForeignKey("DocumentCheckedOutVersionHistoryId")] - [InverseProperty("CmsDocumentDocumentCheckedOutVersionHistories")] - public virtual CmsVersionHistory? DocumentCheckedOutVersionHistory { get; set; } - - [ForeignKey("DocumentCreatedByUserId")] - [InverseProperty("CmsDocumentDocumentCreatedByUsers")] - public virtual CmsUser? DocumentCreatedByUser { get; set; } - - [ForeignKey("DocumentModifiedByUserId")] - [InverseProperty("CmsDocumentDocumentModifiedByUsers")] - public virtual CmsUser? DocumentModifiedByUser { get; set; } - - [ForeignKey("DocumentNodeId")] - [InverseProperty("CmsDocuments")] - public virtual CmsTree DocumentNode { get; set; } = null!; - - [ForeignKey("DocumentPageTemplateId")] - [InverseProperty("CmsDocuments")] - public virtual CmsPageTemplate? DocumentPageTemplate { get; set; } - - [ForeignKey("DocumentPublishedVersionHistoryId")] - [InverseProperty("CmsDocumentDocumentPublishedVersionHistories")] - public virtual CmsVersionHistory? DocumentPublishedVersionHistory { get; set; } - - [ForeignKey("DocumentStylesheetId")] - [InverseProperty("CmsDocuments")] - public virtual CmsCssStylesheet? DocumentStylesheet { get; set; } - - [ForeignKey("DocumentTagGroupId")] - [InverseProperty("CmsDocuments")] - public virtual CmsTagGroup? DocumentTagGroup { get; set; } - - [ForeignKey("DocumentWorkflowStepId")] - [InverseProperty("CmsDocuments")] - public virtual CmsWorkflowStep? DocumentWorkflowStep { get; set; } - - [InverseProperty("ForumDocument")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [InverseProperty("VariantDocument")] - public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); - - [ForeignKey("DocumentId")] - [InverseProperty("Documents")] - public virtual ICollection Categories { get; set; } = new List(); - - [ForeignKey("DocumentId")] - [InverseProperty("Documents")] - public virtual ICollection Tags { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsDocumentAlias.cs b/Migration.Toolkit.K11/Models/CmsDocumentAlias.cs deleted file mode 100644 index ed43edf4..00000000 --- a/Migration.Toolkit.K11/Models/CmsDocumentAlias.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_DocumentAlias")] -[Index("AliasNodeId", Name = "IX_CMS_DocumentAlias_AliasNodeID")] -[Index("AliasSiteId", Name = "IX_CMS_DocumentAlias_AliasSiteID")] -[Index("AliasWildcardRule", "AliasPriority", Name = "IX_CMS_DocumentAlias_AliasWildcardRule_AliasPriority")] -[Index("AliasCulture", Name = "IX_CMS_Document_AliasCulture")] -public class CmsDocumentAlias -{ - [Key] - [Column("AliasID")] - public int AliasId { get; set; } - - [Column("AliasNodeID")] - public int AliasNodeId { get; set; } - - [StringLength(20)] - public string? AliasCulture { get; set; } - - [Column("AliasURLPath")] - public string? AliasUrlpath { get; set; } - - [StringLength(100)] - public string? AliasExtensions { get; set; } - - [StringLength(440)] - public string? AliasWildcardRule { get; set; } - - public int? AliasPriority { get; set; } - - [Column("AliasGUID")] - public Guid? AliasGuid { get; set; } - - public DateTime AliasLastModified { get; set; } - - [Column("AliasSiteID")] - public int AliasSiteId { get; set; } - - [StringLength(50)] - public string? AliasActionMode { get; set; } - - [ForeignKey("AliasNodeId")] - [InverseProperty("CmsDocumentAliases")] - public virtual CmsTree AliasNode { get; set; } = null!; - - [ForeignKey("AliasSiteId")] - [InverseProperty("CmsDocumentAliases")] - public virtual CmsSite AliasSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsDocumentTypeScope.cs b/Migration.Toolkit.K11/Models/CmsDocumentTypeScope.cs deleted file mode 100644 index 5d2bc026..00000000 --- a/Migration.Toolkit.K11/Models/CmsDocumentTypeScope.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_DocumentTypeScope")] -[Index("ScopeSiteId", Name = "IX_CMS_DocumentTypeScope_ScopeSiteID")] -public class CmsDocumentTypeScope -{ - [Key] - [Column("ScopeID")] - public int ScopeId { get; set; } - - public string ScopePath { get; set; } = null!; - - [Column("ScopeSiteID")] - public int? ScopeSiteId { get; set; } - - public DateTime ScopeLastModified { get; set; } - - [Column("ScopeGUID")] - public Guid? ScopeGuid { get; set; } - - public bool? ScopeIncludeChildren { get; set; } - - public bool? ScopeAllowAllTypes { get; set; } - - public bool? ScopeAllowLinks { get; set; } - - [Column("ScopeAllowABVariant")] - public bool? ScopeAllowAbvariant { get; set; } - - public string? ScopeMacroCondition { get; set; } - - [ForeignKey("ScopeSiteId")] - [InverseProperty("CmsDocumentTypeScopes")] - public virtual CmsSite? ScopeSite { get; set; } - - [ForeignKey("ScopeId")] - [InverseProperty("Scopes")] - public virtual ICollection Classes { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsEmail.cs b/Migration.Toolkit.K11/Models/CmsEmail.cs deleted file mode 100644 index d45a5b4c..00000000 --- a/Migration.Toolkit.K11/Models/CmsEmail.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Email")] -[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] -public class CmsEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [StringLength(254)] - public string EmailFrom { get; set; } = null!; - - [StringLength(998)] - public string? EmailTo { get; set; } - - [StringLength(998)] - public string? EmailCc { get; set; } - - [StringLength(998)] - public string? EmailBcc { get; set; } - - [StringLength(450)] - public string EmailSubject { get; set; } = null!; - - public string? EmailBody { get; set; } - - public string? EmailPlainTextBody { get; set; } - - public int EmailFormat { get; set; } - - public int EmailPriority { get; set; } - - [Column("EmailSiteID")] - public int? EmailSiteId { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - public DateTime EmailLastModified { get; set; } - - public int? EmailStatus { get; set; } - - public bool? EmailIsMass { get; set; } - - [StringLength(254)] - public string? EmailReplyTo { get; set; } - - public string? EmailHeaders { get; set; } - - public DateTime? EmailCreated { get; set; } - - [InverseProperty("Email")] - public virtual ICollection CmsEmailUsers { get; set; } = new List(); - - [ForeignKey("EmailId")] - [InverseProperty("Emails")] - public virtual ICollection Attachments { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsEmailAttachment.cs b/Migration.Toolkit.K11/Models/CmsEmailAttachment.cs deleted file mode 100644 index b05aa408..00000000 --- a/Migration.Toolkit.K11/Models/CmsEmailAttachment.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_EmailAttachment")] -public class CmsEmailAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[] AttachmentBinary { get; set; } = null!; - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - [Column("AttachmentContentID")] - [StringLength(255)] - public string? AttachmentContentId { get; set; } - - [Column("AttachmentSiteID")] - public int? AttachmentSiteId { get; set; } - - [ForeignKey("AttachmentId")] - [InverseProperty("Attachments")] - public virtual ICollection Emails { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsEmailTemplate.cs b/Migration.Toolkit.K11/Models/CmsEmailTemplate.cs deleted file mode 100644 index 92d44981..00000000 --- a/Migration.Toolkit.K11/Models/CmsEmailTemplate.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_EmailTemplate")] -[Index("EmailTemplateName", "EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateName_EmailTemplateSiteID")] -[Index("EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateSiteID")] -public class CmsEmailTemplate -{ - [Key] - [Column("EmailTemplateID")] - public int EmailTemplateId { get; set; } - - [StringLength(200)] - public string EmailTemplateName { get; set; } = null!; - - [StringLength(200)] - public string EmailTemplateDisplayName { get; set; } = null!; - - public string? EmailTemplateText { get; set; } - - [Column("EmailTemplateSiteID")] - public int? EmailTemplateSiteId { get; set; } - - [Column("EmailTemplateGUID")] - public Guid EmailTemplateGuid { get; set; } - - public DateTime EmailTemplateLastModified { get; set; } - - public string? EmailTemplatePlainText { get; set; } - - [StringLength(250)] - public string? EmailTemplateSubject { get; set; } - - [StringLength(254)] - public string? EmailTemplateFrom { get; set; } - - [StringLength(998)] - public string? EmailTemplateCc { get; set; } - - [StringLength(998)] - public string? EmailTemplateBcc { get; set; } - - [StringLength(100)] - public string? EmailTemplateType { get; set; } - - public string? EmailTemplateDescription { get; set; } - - [StringLength(254)] - public string? EmailTemplateReplyTo { get; set; } - - [ForeignKey("EmailTemplateSiteId")] - [InverseProperty("CmsEmailTemplates")] - public virtual CmsSite? EmailTemplateSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsEmailUser.cs b/Migration.Toolkit.K11/Models/CmsEmailUser.cs deleted file mode 100644 index f3f40e12..00000000 --- a/Migration.Toolkit.K11/Models/CmsEmailUser.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("EmailId", "UserId")] -[Table("CMS_EmailUser")] -[Index("Status", Name = "IX_CMS_EmailUser_Status")] -[Index("UserId", Name = "IX_CMS_EmailUser_UserID")] -public class CmsEmailUser -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [Key] - [Column("UserID")] - public int UserId { get; set; } - - public string? LastSendResult { get; set; } - - public DateTime? LastSendAttempt { get; set; } - - public int? Status { get; set; } - - [ForeignKey("EmailId")] - [InverseProperty("CmsEmailUsers")] - public virtual CmsEmail Email { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsEmailUsers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsEventLog.cs b/Migration.Toolkit.K11/Models/CmsEventLog.cs deleted file mode 100644 index f31c98fb..00000000 --- a/Migration.Toolkit.K11/Models/CmsEventLog.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_EventLog")] -[Index("SiteId", Name = "IX_CMS_EventLog_SiteID")] -public class CmsEventLog -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(5)] - public string EventType { get; set; } = null!; - - public DateTime EventTime { get; set; } - - [StringLength(100)] - public string Source { get; set; } = null!; - - [StringLength(100)] - public string EventCode { get; set; } = null!; - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(250)] - public string? UserName { get; set; } - - [Column("IPAddress")] - [StringLength(100)] - public string? Ipaddress { get; set; } - - [Column("NodeID")] - public int? NodeId { get; set; } - - [StringLength(100)] - public string? DocumentName { get; set; } - - public string? EventDescription { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - public string? EventUrl { get; set; } - - [StringLength(100)] - public string? EventMachineName { get; set; } - - public string? EventUserAgent { get; set; } - - public string? EventUrlReferrer { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsExternalLogin.cs b/Migration.Toolkit.K11/Models/CmsExternalLogin.cs deleted file mode 100644 index 6d7073b0..00000000 --- a/Migration.Toolkit.K11/Models/CmsExternalLogin.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ExternalLogin")] -[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] -public class CmsExternalLogin -{ - [Key] - [Column("ExternalLoginID")] - public int ExternalLoginId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(200)] - public string? LoginProvider { get; set; } - - [StringLength(200)] - public string? IdentityKey { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsExternalLogins")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsForm.cs b/Migration.Toolkit.K11/Models/CmsForm.cs deleted file mode 100644 index cb04e0bf..00000000 --- a/Migration.Toolkit.K11/Models/CmsForm.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Form")] -[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] -[Index("FormSiteId", Name = "IX_CMS_Form_FormSiteID")] -public class CmsForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(100)] - public string FormName { get; set; } = null!; - - [StringLength(998)] - public string? FormSendToEmail { get; set; } - - [StringLength(254)] - public string? FormSendFromEmail { get; set; } - - [StringLength(250)] - public string? FormEmailSubject { get; set; } - - public string? FormEmailTemplate { get; set; } - - public bool? FormEmailAttachUploadedDocs { get; set; } - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public int FormItems { get; set; } - - public string? FormReportFields { get; set; } - - [StringLength(400)] - public string? FormRedirectToUrl { get; set; } - - public string? FormDisplayText { get; set; } - - public bool FormClearAfterSave { get; set; } - - [StringLength(400)] - public string? FormSubmitButtonText { get; set; } - - [Column("FormSiteID")] - public int FormSiteId { get; set; } - - [StringLength(254)] - public string? FormConfirmationEmailField { get; set; } - - public string? FormConfirmationTemplate { get; set; } - - [StringLength(254)] - public string? FormConfirmationSendFromEmail { get; set; } - - [StringLength(250)] - public string? FormConfirmationEmailSubject { get; set; } - - public int? FormAccess { get; set; } - - [StringLength(255)] - public string? FormSubmitButtonImage { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - public bool? FormLogActivity { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsForms")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormSiteId")] - [InverseProperty("CmsForms")] - public virtual CmsSite FormSite { get; set; } = null!; - - [ForeignKey("FormId")] - [InverseProperty("Forms")] - public virtual ICollection Roles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsFormUserControl.cs b/Migration.Toolkit.K11/Models/CmsFormUserControl.cs deleted file mode 100644 index 29aac7a2..00000000 --- a/Migration.Toolkit.K11/Models/CmsFormUserControl.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_FormUserControl")] -[Index("UserControlCodeName", Name = "IX_CMS_FormUserControl_UserControlCodeName", IsUnique = true)] -[Index("UserControlParentId", Name = "IX_CMS_FormUserControl_UserControlParentID")] -[Index("UserControlResourceId", Name = "IX_CMS_FormUserControl_UserControlResourceID")] -public class CmsFormUserControl -{ - [Key] - [Column("UserControlID")] - public int UserControlId { get; set; } - - [StringLength(200)] - public string UserControlDisplayName { get; set; } = null!; - - [StringLength(200)] - public string UserControlCodeName { get; set; } = null!; - - [StringLength(400)] - public string UserControlFileName { get; set; } = null!; - - public bool UserControlForText { get; set; } - - public bool UserControlForLongText { get; set; } - - public bool UserControlForInteger { get; set; } - - public bool UserControlForDecimal { get; set; } - - public bool UserControlForDateTime { get; set; } - - public bool UserControlForBoolean { get; set; } - - public bool UserControlForFile { get; set; } - - public bool UserControlShowInBizForms { get; set; } - - [StringLength(50)] - public string UserControlDefaultDataType { get; set; } = null!; - - public int? UserControlDefaultDataTypeSize { get; set; } - - public bool? UserControlShowInDocumentTypes { get; set; } - - public bool? UserControlShowInSystemTables { get; set; } - - public bool? UserControlShowInWebParts { get; set; } - - public bool? UserControlShowInReports { get; set; } - - [Column("UserControlGUID")] - public Guid UserControlGuid { get; set; } - - public DateTime UserControlLastModified { get; set; } - - public bool UserControlForGuid { get; set; } - - public bool? UserControlShowInCustomTables { get; set; } - - public bool UserControlForVisibility { get; set; } - - public string? UserControlParameters { get; set; } - - public bool UserControlForDocAttachments { get; set; } - - [Column("UserControlResourceID")] - public int? UserControlResourceId { get; set; } - - public int? UserControlType { get; set; } - - [Column("UserControlParentID")] - public int? UserControlParentId { get; set; } - - public string? UserControlDescription { get; set; } - - [Column("UserControlThumbnailGUID")] - public Guid? UserControlThumbnailGuid { get; set; } - - public int? UserControlPriority { get; set; } - - public bool? UserControlIsSystem { get; set; } - - public bool UserControlForBinary { get; set; } - - public bool UserControlForDocRelationships { get; set; } - - [StringLength(200)] - public string? UserControlAssemblyName { get; set; } - - [StringLength(200)] - public string? UserControlClassName { get; set; } - - [InverseProperty("UserControlParent")] - public virtual ICollection InverseUserControlParent { get; set; } = new List(); - - [ForeignKey("UserControlParentId")] - [InverseProperty("InverseUserControlParent")] - public virtual CmsFormUserControl? UserControlParent { get; set; } - - [ForeignKey("UserControlResourceId")] - [InverseProperty("CmsFormUserControls")] - public virtual CmsResource? UserControlResource { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsHelpTopic.cs b/Migration.Toolkit.K11/Models/CmsHelpTopic.cs deleted file mode 100644 index 5d4f41e6..00000000 --- a/Migration.Toolkit.K11/Models/CmsHelpTopic.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_HelpTopic")] -[Index("HelpTopicUielementId", Name = "IX_CMS_HelpTopic_HelpTopicUIElementID")] -public class CmsHelpTopic -{ - [Key] - [Column("HelpTopicID")] - public int HelpTopicId { get; set; } - - [Column("HelpTopicUIElementID")] - public int HelpTopicUielementId { get; set; } - - [StringLength(200)] - public string HelpTopicName { get; set; } = null!; - - [StringLength(1023)] - public string HelpTopicLink { get; set; } = null!; - - public DateTime HelpTopicLastModified { get; set; } - - [Column("HelpTopicGUID")] - public Guid HelpTopicGuid { get; set; } - - public int? HelpTopicOrder { get; set; } - - [ForeignKey("HelpTopicUielementId")] - [InverseProperty("CmsHelpTopics")] - public virtual CmsUielement HelpTopicUielement { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsLayout.cs b/Migration.Toolkit.K11/Models/CmsLayout.cs deleted file mode 100644 index 92d32c2e..00000000 --- a/Migration.Toolkit.K11/Models/CmsLayout.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Layout")] -[Index("LayoutDisplayName", Name = "IX_CMS_Layout_LayoutDisplayName")] -public class CmsLayout -{ - [Key] - [Column("LayoutID")] - public int LayoutId { get; set; } - - [StringLength(100)] - public string LayoutCodeName { get; set; } = null!; - - [StringLength(200)] - public string LayoutDisplayName { get; set; } = null!; - - public string? LayoutDescription { get; set; } - - public string LayoutCode { get; set; } = null!; - - [Column("LayoutVersionGUID")] - [StringLength(50)] - public string? LayoutVersionGuid { get; set; } - - [Column("LayoutGUID")] - public Guid LayoutGuid { get; set; } - - public DateTime LayoutLastModified { get; set; } - - [StringLength(50)] - public string? LayoutType { get; set; } - - [Column("LayoutCSS")] - public string? LayoutCss { get; set; } - - [Column("LayoutThumbnailGUID")] - public Guid? LayoutThumbnailGuid { get; set; } - - public int? LayoutZoneCount { get; set; } - - public bool? LayoutIsConvertible { get; set; } - - [StringLength(200)] - public string? LayoutIconClass { get; set; } - - [InverseProperty("SourceLayout")] - public virtual ICollection CmsDeviceProfileLayoutSourceLayouts { get; set; } = new List(); - - [InverseProperty("TargetLayout")] - public virtual ICollection CmsDeviceProfileLayoutTargetLayouts { get; set; } = new List(); - - [InverseProperty("PageTemplateLayoutNavigation")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("Layout")] - public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsLicenseKey.cs b/Migration.Toolkit.K11/Models/CmsLicenseKey.cs deleted file mode 100644 index c76e52fa..00000000 --- a/Migration.Toolkit.K11/Models/CmsLicenseKey.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_LicenseKey")] -public class CmsLicenseKey -{ - [Key] - [Column("LicenseKeyID")] - public int LicenseKeyId { get; set; } - - [StringLength(255)] - public string? LicenseDomain { get; set; } - - public string? LicenseKey { get; set; } - - [StringLength(200)] - public string? LicenseEdition { get; set; } - - [StringLength(200)] - public string? LicenseExpiration { get; set; } - - public int? LicenseServers { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsMacroIdentity.cs b/Migration.Toolkit.K11/Models/CmsMacroIdentity.cs deleted file mode 100644 index 489275b4..00000000 --- a/Migration.Toolkit.K11/Models/CmsMacroIdentity.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_MacroIdentity")] -[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] -public class CmsMacroIdentity -{ - [Key] - [Column("MacroIdentityID")] - public int MacroIdentityId { get; set; } - - public Guid MacroIdentityGuid { get; set; } - - public DateTime MacroIdentityLastModified { get; set; } - - [StringLength(200)] - public string MacroIdentityName { get; set; } = null!; - - [Column("MacroIdentityEffectiveUserID")] - public int? MacroIdentityEffectiveUserId { get; set; } - - [InverseProperty("UserMacroIdentityMacroIdentity")] - public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); - - [ForeignKey("MacroIdentityEffectiveUserId")] - [InverseProperty("CmsMacroIdentities")] - public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsMacroRule.cs b/Migration.Toolkit.K11/Models/CmsMacroRule.cs deleted file mode 100644 index b70d0fe2..00000000 --- a/Migration.Toolkit.K11/Models/CmsMacroRule.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_MacroRule")] -public class CmsMacroRule -{ - [Key] - [Column("MacroRuleID")] - public int MacroRuleId { get; set; } - - [StringLength(200)] - public string MacroRuleName { get; set; } = null!; - - [StringLength(1000)] - public string MacroRuleText { get; set; } = null!; - - public string? MacroRuleParameters { get; set; } - - [StringLength(100)] - public string? MacroRuleResourceName { get; set; } - - public DateTime MacroRuleLastModified { get; set; } - - [Column("MacroRuleGUID")] - public Guid MacroRuleGuid { get; set; } - - public string MacroRuleCondition { get; set; } = null!; - - [StringLength(500)] - public string MacroRuleDisplayName { get; set; } = null!; - - public bool? MacroRuleIsCustom { get; set; } - - public bool MacroRuleRequiresContext { get; set; } - - [StringLength(450)] - public string? MacroRuleDescription { get; set; } - - [StringLength(2500)] - public string? MacroRuleRequiredData { get; set; } - - public bool? MacroRuleEnabled { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsMembership.cs b/Migration.Toolkit.K11/Models/CmsMembership.cs deleted file mode 100644 index 30eae764..00000000 --- a/Migration.Toolkit.K11/Models/CmsMembership.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Membership")] -[Index("MembershipSiteId", Name = "IX_CMS_Membership_MembershipSiteID")] -public class CmsMembership -{ - [Key] - [Column("MembershipID")] - public int MembershipId { get; set; } - - [StringLength(200)] - public string MembershipName { get; set; } = null!; - - [StringLength(200)] - public string MembershipDisplayName { get; set; } = null!; - - public string? MembershipDescription { get; set; } - - public DateTime MembershipLastModified { get; set; } - - [Column("MembershipGUID")] - public Guid MembershipGuid { get; set; } - - [Column("MembershipSiteID")] - public int? MembershipSiteId { get; set; } - - [InverseProperty("Membership")] - public virtual ICollection CmsMembershipUsers { get; set; } = new List(); - - [ForeignKey("MembershipSiteId")] - [InverseProperty("CmsMemberships")] - public virtual CmsSite? MembershipSite { get; set; } - - [ForeignKey("MembershipId")] - [InverseProperty("Memberships")] - public virtual ICollection Roles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsMembershipUser.cs b/Migration.Toolkit.K11/Models/CmsMembershipUser.cs deleted file mode 100644 index 881f9625..00000000 --- a/Migration.Toolkit.K11/Models/CmsMembershipUser.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_MembershipUser")] -[Index("MembershipId", "UserId", Name = "IX_CMS_MembershipUser_MembershipID_UserID", IsUnique = true)] -[Index("UserId", Name = "IX_CMS_MembershipUser_UserID")] -public class CmsMembershipUser -{ - [Key] - [Column("MembershipUserID")] - public int MembershipUserId { get; set; } - - [Column("MembershipID")] - public int MembershipId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - public DateTime? ValidTo { get; set; } - - public bool? SendNotification { get; set; } - - [ForeignKey("MembershipId")] - [InverseProperty("CmsMembershipUsers")] - public virtual CmsMembership Membership { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsMembershipUsers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsMetaFile.cs b/Migration.Toolkit.K11/Models/CmsMetaFile.cs deleted file mode 100644 index f970ced2..00000000 --- a/Migration.Toolkit.K11/Models/CmsMetaFile.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_MetaFile")] -[Index("MetaFileGuid", "MetaFileSiteId", "MetaFileObjectType", "MetaFileObjectId", "MetaFileGroupName", Name = "IX_CMS_MetaFile_MetaFileGUID_MetaFileSiteID_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName")] -[Index("MetaFileSiteId", Name = "IX_CMS_MetaFile_MetaFileSiteID")] -public class CmsMetaFile -{ - [Key] - [Column("MetaFileID")] - public int MetaFileId { get; set; } - - [Column("MetaFileObjectID")] - public int MetaFileObjectId { get; set; } - - [StringLength(100)] - public string MetaFileObjectType { get; set; } = null!; - - [StringLength(100)] - public string? MetaFileGroupName { get; set; } - - [StringLength(250)] - public string MetaFileName { get; set; } = null!; - - [StringLength(50)] - public string MetaFileExtension { get; set; } = null!; - - public int MetaFileSize { get; set; } - - [StringLength(100)] - public string MetaFileMimeType { get; set; } = null!; - - public byte[]? MetaFileBinary { get; set; } - - public int? MetaFileImageWidth { get; set; } - - public int? MetaFileImageHeight { get; set; } - - [Column("MetaFileGUID")] - public Guid MetaFileGuid { get; set; } - - public DateTime MetaFileLastModified { get; set; } - - [Column("MetaFileSiteID")] - public int? MetaFileSiteId { get; set; } - - [StringLength(250)] - public string? MetaFileTitle { get; set; } - - public string? MetaFileDescription { get; set; } - - public string? MetaFileCustomData { get; set; } - - [ForeignKey("MetaFileSiteId")] - [InverseProperty("CmsMetaFiles")] - public virtual CmsSite? MetaFileSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsModuleLicenseKey.cs b/Migration.Toolkit.K11/Models/CmsModuleLicenseKey.cs deleted file mode 100644 index 536a283a..00000000 --- a/Migration.Toolkit.K11/Models/CmsModuleLicenseKey.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ModuleLicenseKey")] -[Index("ModuleLicenseKeyResourceId", Name = "IX_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID")] -public class CmsModuleLicenseKey -{ - [Key] - [Column("ModuleLicenseKeyID")] - public int ModuleLicenseKeyId { get; set; } - - public Guid ModuleLicenseKeyGuid { get; set; } - - public DateTime ModuleLicenseKeyLastModified { get; set; } - - public string ModuleLicenseKeyLicense { get; set; } = null!; - - [Column("ModuleLicenseKeyResourceID")] - public int ModuleLicenseKeyResourceId { get; set; } - - [ForeignKey("ModuleLicenseKeyResourceId")] - [InverseProperty("CmsModuleLicenseKeys")] - public virtual CmsResource ModuleLicenseKeyResource { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsModuleUsageCounter.cs b/Migration.Toolkit.K11/Models/CmsModuleUsageCounter.cs deleted file mode 100644 index 72c95a11..00000000 --- a/Migration.Toolkit.K11/Models/CmsModuleUsageCounter.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -[Table("CMS_ModuleUsageCounter")] -public class CmsModuleUsageCounter -{ - [Column("ModuleUsageCounterID")] - public int ModuleUsageCounterId { get; set; } - - [StringLength(200)] - public string ModuleUsageCounterName { get; set; } = null!; - - public long ModuleUsageCounterValue { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsObjectSetting.cs b/Migration.Toolkit.K11/Models/CmsObjectSetting.cs deleted file mode 100644 index ead49e19..00000000 --- a/Migration.Toolkit.K11/Models/CmsObjectSetting.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ObjectSettings")] -[Index("ObjectCheckedOutByUserId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutByUserID")] -[Index("ObjectCheckedOutVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID")] -[Index("ObjectPublishedVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectPublishedVersionHistoryID")] -[Index("ObjectSettingsObjectId", "ObjectSettingsObjectType", Name = "IX_CMS_ObjectSettings_ObjectSettingsObjectType_ObjectSettingsObjectID", IsUnique = true)] -[Index("ObjectWorkflowStepId", Name = "IX_CMS_ObjectSettings_ObjectWorkflowStepID")] -public class CmsObjectSetting -{ - [Key] - [Column("ObjectSettingsID")] - public int ObjectSettingsId { get; set; } - - public string? ObjectTags { get; set; } - - [Column("ObjectCheckedOutByUserID")] - public int? ObjectCheckedOutByUserId { get; set; } - - public DateTime? ObjectCheckedOutWhen { get; set; } - - [Column("ObjectCheckedOutVersionHistoryID")] - public int? ObjectCheckedOutVersionHistoryId { get; set; } - - [Column("ObjectWorkflowStepID")] - public int? ObjectWorkflowStepId { get; set; } - - [Column("ObjectPublishedVersionHistoryID")] - public int? ObjectPublishedVersionHistoryId { get; set; } - - [Column("ObjectSettingsObjectID")] - public int ObjectSettingsObjectId { get; set; } - - [StringLength(100)] - public string ObjectSettingsObjectType { get; set; } = null!; - - public string? ObjectComments { get; set; } - - public bool? ObjectWorkflowSendEmails { get; set; } - - [ForeignKey("ObjectCheckedOutByUserId")] - [InverseProperty("CmsObjectSettings")] - public virtual CmsUser? ObjectCheckedOutByUser { get; set; } - - [ForeignKey("ObjectCheckedOutVersionHistoryId")] - [InverseProperty("CmsObjectSettingObjectCheckedOutVersionHistories")] - public virtual CmsObjectVersionHistory? ObjectCheckedOutVersionHistory { get; set; } - - [ForeignKey("ObjectPublishedVersionHistoryId")] - [InverseProperty("CmsObjectSettingObjectPublishedVersionHistories")] - public virtual CmsObjectVersionHistory? ObjectPublishedVersionHistory { get; set; } - - [ForeignKey("ObjectWorkflowStepId")] - [InverseProperty("CmsObjectSettings")] - public virtual CmsWorkflowStep? ObjectWorkflowStep { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsObjectVersionHistory.cs b/Migration.Toolkit.K11/Models/CmsObjectVersionHistory.cs deleted file mode 100644 index 228272a5..00000000 --- a/Migration.Toolkit.K11/Models/CmsObjectVersionHistory.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ObjectVersionHistory")] -[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionModifiedByUserId", Name = "IX_CMS_ObjectVersionHistory_VersionModifiedByUserID")] -[Index("VersionObjectSiteId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectSiteID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionObjectType", "VersionObjectId", "VersionModifiedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectType_VersionObjectID_VersionModifiedWhen", IsDescending = new[] { false, false, true })] -public class CmsObjectVersionHistory -{ - [Key] - [Column("VersionID")] - public int VersionId { get; set; } - - [Column("VersionObjectID")] - public int? VersionObjectId { get; set; } - - [StringLength(100)] - public string VersionObjectType { get; set; } = null!; - - [Column("VersionObjectSiteID")] - public int? VersionObjectSiteId { get; set; } - - [StringLength(450)] - public string VersionObjectDisplayName { get; set; } = null!; - - [Column("VersionXML")] - public string VersionXml { get; set; } = null!; - - [Column("VersionBinaryDataXML")] - public string? VersionBinaryDataXml { get; set; } - - [Column("VersionModifiedByUserID")] - public int? VersionModifiedByUserId { get; set; } - - public DateTime VersionModifiedWhen { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [StringLength(50)] - public string VersionNumber { get; set; } = null!; - - [Column("VersionSiteBindingIDs")] - public string? VersionSiteBindingIds { get; set; } - - public string? VersionComment { get; set; } - - [InverseProperty("ObjectCheckedOutVersionHistory")] - public virtual ICollection CmsObjectSettingObjectCheckedOutVersionHistories { get; set; } = new List(); - - [InverseProperty("ObjectPublishedVersionHistory")] - public virtual ICollection CmsObjectSettingObjectPublishedVersionHistories { get; set; } = new List(); - - [ForeignKey("VersionDeletedByUserId")] - [InverseProperty("CmsObjectVersionHistoryVersionDeletedByUsers")] - public virtual CmsUser? VersionDeletedByUser { get; set; } - - [ForeignKey("VersionModifiedByUserId")] - [InverseProperty("CmsObjectVersionHistoryVersionModifiedByUsers")] - public virtual CmsUser? VersionModifiedByUser { get; set; } - - [ForeignKey("VersionObjectSiteId")] - [InverseProperty("CmsObjectVersionHistories")] - public virtual CmsSite? VersionObjectSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsObjectWorkflowTrigger.cs b/Migration.Toolkit.K11/Models/CmsObjectWorkflowTrigger.cs deleted file mode 100644 index e9c82c73..00000000 --- a/Migration.Toolkit.K11/Models/CmsObjectWorkflowTrigger.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ObjectWorkflowTrigger")] -[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] -public class CmsObjectWorkflowTrigger -{ - [Key] - [Column("TriggerID")] - public int TriggerId { get; set; } - - [Column("TriggerGUID")] - public Guid TriggerGuid { get; set; } - - public DateTime TriggerLastModified { get; set; } - - public int TriggerType { get; set; } - - public string? TriggerMacroCondition { get; set; } - - [Column("TriggerWorkflowID")] - public int TriggerWorkflowId { get; set; } - - [StringLength(450)] - public string TriggerDisplayName { get; set; } = null!; - - [StringLength(100)] - public string TriggerObjectType { get; set; } = null!; - - public string? TriggerParameters { get; set; } - - [StringLength(100)] - public string? TriggerTargetObjectType { get; set; } - - [Column("TriggerTargetObjectID")] - public int? TriggerTargetObjectId { get; set; } - - [ForeignKey("TriggerWorkflowId")] - [InverseProperty("CmsObjectWorkflowTriggers")] - public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsOpenIduser.cs b/Migration.Toolkit.K11/Models/CmsOpenIduser.cs deleted file mode 100644 index ba85fce2..00000000 --- a/Migration.Toolkit.K11/Models/CmsOpenIduser.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_OpenIDUser")] -[Index("OpenId", Name = "IX_CMS_OpenIDUser_OpenID")] -[Index("UserId", Name = "IX_CMS_OpenIDUser_UserID")] -public class CmsOpenIduser -{ - [Key] - [Column("OpenIDUserID")] - public int OpenIduserId { get; set; } - - [Column("OpenID")] - public string OpenId { get; set; } = null!; - - [Column("OpenIDProviderURL")] - [StringLength(450)] - public string? OpenIdproviderUrl { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsOpenIdusers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsPageTemplate.cs b/Migration.Toolkit.K11/Models/CmsPageTemplate.cs deleted file mode 100644 index 4b16497d..00000000 --- a/Migration.Toolkit.K11/Models/CmsPageTemplate.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_PageTemplate")] -[Index("PageTemplateCodeName", "PageTemplateDisplayName", Name = "IX_CMS_PageTemplate_PageTemplateCodeName_PageTemplateDisplayName")] -[Index("PageTemplateIsReusable", "PageTemplateForAllPages", "PageTemplateShowAsMasterTemplate", Name = "IX_CMS_PageTemplate_PageTemplateIsReusable_PageTemplateForAllPages_PageTemplateShowAsMasterTemplate")] -[Index("PageTemplateLayoutId", Name = "IX_CMS_PageTemplate_PageTemplateLayoutID")] -[Index("PageTemplateSiteId", "PageTemplateCodeName", "PageTemplateGuid", Name = "IX_CMS_PageTemplate_PageTemplateSiteID_PageTemplateCodeName_PageTemplateGUID")] -public class CmsPageTemplate -{ - [Key] - [Column("PageTemplateID")] - public int PageTemplateId { get; set; } - - [StringLength(200)] - public string PageTemplateDisplayName { get; set; } = null!; - - [StringLength(100)] - public string PageTemplateCodeName { get; set; } = null!; - - public string? PageTemplateDescription { get; set; } - - [StringLength(400)] - public string? PageTemplateFile { get; set; } - - [Column("PageTemplateCategoryID")] - public int? PageTemplateCategoryId { get; set; } - - [Column("PageTemplateLayoutID")] - public int? PageTemplateLayoutId { get; set; } - - public string? PageTemplateWebParts { get; set; } - - public bool? PageTemplateIsReusable { get; set; } - - public bool? PageTemplateShowAsMasterTemplate { get; set; } - - [StringLength(200)] - public string? PageTemplateInheritPageLevels { get; set; } - - public string? PageTemplateLayout { get; set; } - - [Column("PageTemplateVersionGUID")] - [StringLength(200)] - public string? PageTemplateVersionGuid { get; set; } - - public string? PageTemplateHeader { get; set; } - - [Column("PageTemplateGUID")] - public Guid PageTemplateGuid { get; set; } - - public DateTime PageTemplateLastModified { get; set; } - - [Column("PageTemplateSiteID")] - public int? PageTemplateSiteId { get; set; } - - public bool? PageTemplateForAllPages { get; set; } - - [StringLength(10)] - public string PageTemplateType { get; set; } = null!; - - [StringLength(50)] - public string? PageTemplateLayoutType { get; set; } - - [Column("PageTemplateCSS")] - public string? PageTemplateCss { get; set; } - - public bool? PageTemplateIsAllowedForProductSection { get; set; } - - public bool? PageTemplateInheritParentHeader { get; set; } - - public bool? PageTemplateAllowInheritHeader { get; set; } - - [Column("PageTemplateThumbnailGUID")] - public Guid? PageTemplateThumbnailGuid { get; set; } - - public bool? PageTemplateCloneAsAdHoc { get; set; } - - [StringLength(200)] - public string? PageTemplateDefaultController { get; set; } - - [StringLength(200)] - public string? PageTemplateDefaultAction { get; set; } - - [Column("PageTemplateNodeGUID")] - public Guid? PageTemplateNodeGuid { get; set; } - - [Column("PageTemplateMasterPageTemplateID")] - public int? PageTemplateMasterPageTemplateId { get; set; } - - public string? PageTemplateProperties { get; set; } - - public bool? PageTemplateIsLayout { get; set; } - - [StringLength(200)] - public string? PageTemplateIconClass { get; set; } - - [InverseProperty("ClassDefaultPageTemplate")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("DocumentPageTemplate")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("PageTemplateScopeTemplate")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("PageTemplate")] - public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); - - [InverseProperty("NodeTemplate")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("ElementPageTemplate")] - public virtual ICollection CmsUielements { get; set; } = new List(); - - [InverseProperty("MvtvariantPageTemplate")] - public virtual ICollection OmMvtvariants { get; set; } = new List(); - - [InverseProperty("VariantPageTemplate")] - public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); - - [ForeignKey("PageTemplateCategoryId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsPageTemplateCategory? PageTemplateCategory { get; set; } - - [ForeignKey("PageTemplateLayoutId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsLayout? PageTemplateLayoutNavigation { get; set; } - - [ForeignKey("PageTemplateSiteId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsSite? PageTemplateSite { get; set; } - - [ForeignKey("PageTemplateId")] - [InverseProperty("PageTemplates")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsPageTemplateCategory.cs b/Migration.Toolkit.K11/Models/CmsPageTemplateCategory.cs deleted file mode 100644 index 25919b65..00000000 --- a/Migration.Toolkit.K11/Models/CmsPageTemplateCategory.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_PageTemplateCategory")] -[Index("CategoryLevel", Name = "IX_CMS_PageTemplateCategory_CategoryLevel")] -[Index("CategoryParentId", Name = "IX_CMS_PageTemplateCategory_CategoryParentID")] -public class CmsPageTemplateCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(200)] - public string? CategoryName { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryTemplateChildCount { get; set; } - - public string? CategoryPath { get; set; } - - public int? CategoryLevel { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsPageTemplateCategory? CategoryParent { get; set; } - - [InverseProperty("ClassPageTemplateCategory")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("PageTemplateCategory")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsPageTemplateScope.cs b/Migration.Toolkit.K11/Models/CmsPageTemplateScope.cs deleted file mode 100644 index 78e20b05..00000000 --- a/Migration.Toolkit.K11/Models/CmsPageTemplateScope.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_PageTemplateScope")] -[Index("PageTemplateScopeClassId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeClassID")] -[Index("PageTemplateScopeCultureId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeCultureID")] -[Index("PageTemplateScopeLevels", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeLevels")] -[Index("PageTemplateScopeSiteId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeSiteID")] -[Index("PageTemplateScopeTemplateId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeTemplateID")] -public class CmsPageTemplateScope -{ - [Key] - [Column("PageTemplateScopeID")] - public int PageTemplateScopeId { get; set; } - - public string PageTemplateScopePath { get; set; } = null!; - - public string? PageTemplateScopeLevels { get; set; } - - [Column("PageTemplateScopeCultureID")] - public int? PageTemplateScopeCultureId { get; set; } - - [Column("PageTemplateScopeClassID")] - public int? PageTemplateScopeClassId { get; set; } - - [Column("PageTemplateScopeTemplateID")] - public int PageTemplateScopeTemplateId { get; set; } - - [Column("PageTemplateScopeSiteID")] - public int? PageTemplateScopeSiteId { get; set; } - - public DateTime PageTemplateScopeLastModified { get; set; } - - [Column("PageTemplateScopeGUID")] - public Guid PageTemplateScopeGuid { get; set; } - - [ForeignKey("PageTemplateScopeClassId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsClass? PageTemplateScopeClass { get; set; } - - [ForeignKey("PageTemplateScopeCultureId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsCulture? PageTemplateScopeCulture { get; set; } - - [ForeignKey("PageTemplateScopeSiteId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsSite? PageTemplateScopeSite { get; set; } - - [ForeignKey("PageTemplateScopeTemplateId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsPageTemplate PageTemplateScopeTemplate { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsPermission.cs b/Migration.Toolkit.K11/Models/CmsPermission.cs deleted file mode 100644 index c09423ed..00000000 --- a/Migration.Toolkit.K11/Models/CmsPermission.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Permission")] -[Index("ClassId", "PermissionName", Name = "IX_CMS_Permission_ClassID_PermissionName")] -[Index("ResourceId", "PermissionName", Name = "IX_CMS_Permission_ResourceID_PermissionName")] -public class CmsPermission -{ - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [StringLength(100)] - public string PermissionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string PermissionName { get; set; } = null!; - - [Column("ClassID")] - public int? ClassId { get; set; } - - [Column("ResourceID")] - public int? ResourceId { get; set; } - - [Column("PermissionGUID")] - public Guid PermissionGuid { get; set; } - - public DateTime PermissionLastModified { get; set; } - - public string? PermissionDescription { get; set; } - - public bool? PermissionDisplayInMatrix { get; set; } - - public int? PermissionOrder { get; set; } - - public bool? PermissionEditableByGlobalAdmin { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsPermissions")] - public virtual CmsClass? Class { get; set; } - - [InverseProperty("Permission")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection ForumsForumRoles { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); - - [ForeignKey("ResourceId")] - [InverseProperty("CmsPermissions")] - public virtual CmsResource? Resource { get; set; } - - [ForeignKey("PermissionId")] - [InverseProperty("Permissions")] - public virtual ICollection Roles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsPersonalization.cs b/Migration.Toolkit.K11/Models/CmsPersonalization.cs deleted file mode 100644 index 5e99f210..00000000 --- a/Migration.Toolkit.K11/Models/CmsPersonalization.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Personalization")] -[Index("PersonalizationId", "PersonalizationUserId", "PersonalizationDocumentId", "PersonalizationDashboardName", Name = "IX_CMS_Personalization_PersonalizationID_PersonalizationUserID_PersonalizationDocumentID_PersonalizationDashboardName", - IsUnique = true)] -[Index("PersonalizationSiteId", Name = "IX_CMS_Personalization_PersonalizationSiteID_SiteID")] -[Index("PersonalizationUserId", Name = "IX_CMS_Personalization_PersonalizationUserID")] -public class CmsPersonalization -{ - [Key] - [Column("PersonalizationID")] - public int PersonalizationId { get; set; } - - [Column("PersonalizationGUID")] - public Guid PersonalizationGuid { get; set; } - - public DateTime PersonalizationLastModified { get; set; } - - [Column("PersonalizationUserID")] - public int? PersonalizationUserId { get; set; } - - [Column("PersonalizationDocumentID")] - public int? PersonalizationDocumentId { get; set; } - - public string? PersonalizationWebParts { get; set; } - - [StringLength(200)] - public string? PersonalizationDashboardName { get; set; } - - [Column("PersonalizationSiteID")] - public int? PersonalizationSiteId { get; set; } - - [ForeignKey("PersonalizationDocumentId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsDocument? PersonalizationDocument { get; set; } - - [ForeignKey("PersonalizationSiteId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsSite? PersonalizationSite { get; set; } - - [ForeignKey("PersonalizationUserId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsUser? PersonalizationUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsQuery.cs b/Migration.Toolkit.K11/Models/CmsQuery.cs deleted file mode 100644 index 27d89fbc..00000000 --- a/Migration.Toolkit.K11/Models/CmsQuery.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Query")] -[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] -public class CmsQuery -{ - [Key] - [Column("QueryID")] - public int QueryId { get; set; } - - [StringLength(100)] - public string QueryName { get; set; } = null!; - - [Column("QueryTypeID")] - public int QueryTypeId { get; set; } - - public string QueryText { get; set; } = null!; - - public bool QueryRequiresTransaction { get; set; } - - [Column("ClassID")] - public int? ClassId { get; set; } - - public bool QueryIsLocked { get; set; } - - public DateTime QueryLastModified { get; set; } - - [Column("QueryGUID")] - public Guid QueryGuid { get; set; } - - public bool? QueryIsCustom { get; set; } - - [StringLength(100)] - public string? QueryConnectionString { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsQueries")] - public virtual CmsClass? Class { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsRelationship.cs b/Migration.Toolkit.K11/Models/CmsRelationship.cs deleted file mode 100644 index 2fb77c4c..00000000 --- a/Migration.Toolkit.K11/Models/CmsRelationship.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Relationship")] -[Index("LeftNodeId", Name = "IX_CMS_Relationship_LeftNodeID")] -[Index("RelationshipNameId", Name = "IX_CMS_Relationship_RelationshipNameID")] -[Index("RightNodeId", Name = "IX_CMS_Relationship_RightNodeID")] -public class CmsRelationship -{ - [Key] - [Column("RelationshipID")] - public int RelationshipId { get; set; } - - [Column("LeftNodeID")] - public int LeftNodeId { get; set; } - - [Column("RightNodeID")] - public int RightNodeId { get; set; } - - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - public string? RelationshipCustomData { get; set; } - - public int? RelationshipOrder { get; set; } - - public bool? RelationshipIsAdHoc { get; set; } - - [ForeignKey("LeftNodeId")] - [InverseProperty("CmsRelationshipLeftNodes")] - public virtual CmsTree LeftNode { get; set; } = null!; - - [ForeignKey("RelationshipNameId")] - [InverseProperty("CmsRelationships")] - public virtual CmsRelationshipName RelationshipName { get; set; } = null!; - - [ForeignKey("RightNodeId")] - [InverseProperty("CmsRelationshipRightNodes")] - public virtual CmsTree RightNode { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsRelationshipName.cs b/Migration.Toolkit.K11/Models/CmsRelationshipName.cs deleted file mode 100644 index 110e22c3..00000000 --- a/Migration.Toolkit.K11/Models/CmsRelationshipName.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_RelationshipName")] -[Index("RelationshipAllowedObjects", Name = "IX_CMS_RelationshipName_RelationshipAllowedObjects")] -[Index("RelationshipName", "RelationshipDisplayName", Name = "IX_CMS_RelationshipName_RelationshipName_RelationshipDisplayName")] -public class CmsRelationshipName -{ - [Key] - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - [StringLength(200)] - public string RelationshipDisplayName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipName { get; set; } = null!; - - public string? RelationshipAllowedObjects { get; set; } - - [Column("RelationshipGUID")] - public Guid RelationshipGuid { get; set; } - - public DateTime RelationshipLastModified { get; set; } - - public bool? RelationshipNameIsAdHoc { get; set; } - - [InverseProperty("RelationshipName")] - public virtual ICollection CmsRelationships { get; set; } = new List(); - - [ForeignKey("RelationshipNameId")] - [InverseProperty("RelationshipNames")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsResource.cs b/Migration.Toolkit.K11/Models/CmsResource.cs deleted file mode 100644 index f65dd291..00000000 --- a/Migration.Toolkit.K11/Models/CmsResource.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Resource")] -[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] -public class CmsResource -{ - [Key] - [Column("ResourceID")] - public int ResourceId { get; set; } - - [StringLength(100)] - public string ResourceDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - public string? ResourceDescription { get; set; } - - public bool? ShowInDevelopment { get; set; } - - [Column("ResourceURL")] - [StringLength(1000)] - public string? ResourceUrl { get; set; } - - [Column("ResourceGUID")] - public Guid ResourceGuid { get; set; } - - public DateTime ResourceLastModified { get; set; } - - public bool? ResourceIsInDevelopment { get; set; } - - public bool? ResourceHasFiles { get; set; } - - [StringLength(200)] - public string? ResourceVersion { get; set; } - - [StringLength(200)] - public string? ResourceAuthor { get; set; } - - [StringLength(50)] - public string? ResourceInstallationState { get; set; } - - [StringLength(50)] - public string? ResourceInstalledVersion { get; set; } - - [InverseProperty("ClassResource")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("UserControlResource")] - public virtual ICollection CmsFormUserControls { get; set; } = new List(); - - [InverseProperty("ModuleLicenseKeyResource")] - public virtual ICollection CmsModuleLicenseKeys { get; set; } = new List(); - - [InverseProperty("Resource")] - public virtual ICollection CmsPermissions { get; set; } = new List(); - - [InverseProperty("ResourceLibraryResource")] - public virtual ICollection CmsResourceLibraries { get; set; } = new List(); - - [InverseProperty("TaskResource")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("CategoryResource")] - public virtual ICollection CmsSettingsCategories { get; set; } = new List(); - - [InverseProperty("ElementResource")] - public virtual ICollection CmsUielements { get; set; } = new List(); - - [InverseProperty("WebPartResource")] - public virtual ICollection CmsWebParts { get; set; } = new List(); - - [InverseProperty("ActionResource")] - public virtual ICollection CmsWorkflowActions { get; set; } = new List(); - - [ForeignKey("ResourceId")] - [InverseProperty("Resources")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsResourceLibrary.cs b/Migration.Toolkit.K11/Models/CmsResourceLibrary.cs deleted file mode 100644 index 76616e36..00000000 --- a/Migration.Toolkit.K11/Models/CmsResourceLibrary.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ResourceLibrary")] -[Index("ResourceLibraryResourceId", Name = "IX_CMS_ResourceLibrary")] -public class CmsResourceLibrary -{ - [Key] - [Column("ResourceLibraryID")] - public int ResourceLibraryId { get; set; } - - [Column("ResourceLibraryResourceID")] - public int ResourceLibraryResourceId { get; set; } - - [StringLength(200)] - public string ResourceLibraryPath { get; set; } = null!; - - [ForeignKey("ResourceLibraryResourceId")] - [InverseProperty("CmsResourceLibraries")] - public virtual CmsResource ResourceLibraryResource { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsResourceString.cs b/Migration.Toolkit.K11/Models/CmsResourceString.cs deleted file mode 100644 index a9e11cf1..00000000 --- a/Migration.Toolkit.K11/Models/CmsResourceString.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ResourceString")] -[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] -public class CmsResourceString -{ - [Key] - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("StringGUID")] - public Guid StringGuid { get; set; } - - [InverseProperty("TranslationString")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsResourceTranslation.cs b/Migration.Toolkit.K11/Models/CmsResourceTranslation.cs deleted file mode 100644 index e5adb900..00000000 --- a/Migration.Toolkit.K11/Models/CmsResourceTranslation.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ResourceTranslation")] -[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] -[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] -public class CmsResourceTranslation -{ - [Key] - [Column("TranslationID")] - public int TranslationId { get; set; } - - [Column("TranslationStringID")] - public int TranslationStringId { get; set; } - - public string? TranslationText { get; set; } - - [Column("TranslationCultureID")] - public int TranslationCultureId { get; set; } - - [ForeignKey("TranslationCultureId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsCulture TranslationCulture { get; set; } = null!; - - [ForeignKey("TranslationStringId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsResourceString TranslationString { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsRole.cs b/Migration.Toolkit.K11/Models/CmsRole.cs deleted file mode 100644 index f1fce13d..00000000 --- a/Migration.Toolkit.K11/Models/CmsRole.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Role")] -[Index("RoleGroupId", Name = "IX_CMS_Role_RoleGroupID")] -[Index("SiteId", "RoleId", Name = "IX_CMS_Role_SiteID_RoleID")] -[Index("SiteId", "RoleName", "RoleGroupId", Name = "IX_CMS_Role_SiteID_RoleName_RoleGroupID", IsUnique = true)] -public class CmsRole -{ - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - public DateTime RoleLastModified { get; set; } - - [Column("RoleGroupID")] - public int? RoleGroupId { get; set; } - - public bool? RoleIsGroupAdministrator { get; set; } - - public bool? RoleIsDomain { get; set; } - - [InverseProperty("Role")] - public virtual ICollection CmsAclitems { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection ForumsForumRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); - - [ForeignKey("RoleGroupId")] - [InverseProperty("CmsRoles")] - public virtual CommunityGroup? RoleGroup { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsRoles")] - public virtual CmsSite? Site { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Boards { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Elements { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("RolesNavigation")] - public virtual ICollection ElementsNavigation { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Forms { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Memberships { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Permissions { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Polls { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsScheduledTask.cs b/Migration.Toolkit.K11/Models/CmsScheduledTask.cs deleted file mode 100644 index ed21f4ef..00000000 --- a/Migration.Toolkit.K11/Models/CmsScheduledTask.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ScheduledTask")] -[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] -[Index("TaskResourceId", Name = "IX_CMS_ScheduledTask_TaskResourceID")] -[Index("TaskSiteId", "TaskDisplayName", Name = "IX_CMS_ScheduledTask_TaskSiteID_TaskDisplayName")] -[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] -public class CmsScheduledTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(200)] - public string TaskName { get; set; } = null!; - - [StringLength(200)] - public string TaskDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TaskAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string? TaskClass { get; set; } - - [StringLength(1000)] - public string TaskInterval { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime? TaskLastRunTime { get; set; } - - public DateTime? TaskNextRunTime { get; set; } - - public string? TaskLastResult { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - public bool? TaskDeleteAfterLastRun { get; set; } - - [StringLength(100)] - public string? TaskServerName { get; set; } - - [Column("TaskGUID")] - public Guid TaskGuid { get; set; } - - public DateTime TaskLastModified { get; set; } - - public int? TaskExecutions { get; set; } - - [Column("TaskResourceID")] - public int? TaskResourceId { get; set; } - - public bool? TaskRunInSeparateThread { get; set; } - - public bool? TaskUseExternalService { get; set; } - - public bool? TaskAllowExternalService { get; set; } - - public DateTime? TaskLastExecutionReset { get; set; } - - [StringLength(400)] - public string? TaskCondition { get; set; } - - public bool? TaskRunIndividually { get; set; } - - [Column("TaskUserID")] - public int? TaskUserId { get; set; } - - public int? TaskType { get; set; } - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [StringLength(200)] - public string? TaskExecutingServerName { get; set; } - - public bool TaskEnabled { get; set; } - - public bool TaskIsRunning { get; set; } - - [InverseProperty("CampaignScheduledTask")] - public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); - - [InverseProperty("TestWinnerScheduledTask")] - public virtual ICollection NewsletterAbtests { get; set; } = new List(); - - [InverseProperty("NewsletterDynamicScheduledTask")] - public virtual ICollection NewsletterNewsletters { get; set; } = new List(); - - [ForeignKey("TaskResourceId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsResource? TaskResource { get; set; } - - [ForeignKey("TaskSiteId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsSite? TaskSite { get; set; } - - [ForeignKey("TaskUserId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsUser? TaskUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsSearchEngine.cs b/Migration.Toolkit.K11/Models/CmsSearchEngine.cs deleted file mode 100644 index df011b4c..00000000 --- a/Migration.Toolkit.K11/Models/CmsSearchEngine.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SearchEngine")] -public class CmsSearchEngine -{ - [Key] - [Column("SearchEngineID")] - public int SearchEngineId { get; set; } - - [StringLength(200)] - public string SearchEngineDisplayName { get; set; } = null!; - - [StringLength(200)] - public string SearchEngineName { get; set; } = null!; - - [StringLength(450)] - public string SearchEngineDomainRule { get; set; } = null!; - - [StringLength(200)] - public string? SearchEngineKeywordParameter { get; set; } - - [Column("SearchEngineGUID")] - public Guid SearchEngineGuid { get; set; } - - public DateTime SearchEngineLastModified { get; set; } - - [StringLength(200)] - public string? SearchEngineCrawler { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsSearchIndex.cs b/Migration.Toolkit.K11/Models/CmsSearchIndex.cs deleted file mode 100644 index 0c585b1a..00000000 --- a/Migration.Toolkit.K11/Models/CmsSearchIndex.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SearchIndex")] -public class CmsSearchIndex -{ - [Key] - [Column("IndexID")] - public int IndexId { get; set; } - - [StringLength(200)] - public string IndexName { get; set; } = null!; - - [StringLength(200)] - public string IndexDisplayName { get; set; } = null!; - - [StringLength(200)] - public string? IndexAnalyzerType { get; set; } - - public bool IndexIsCommunityGroup { get; set; } - - public string? IndexSettings { get; set; } - - [Column("IndexGUID")] - public Guid IndexGuid { get; set; } - - public DateTime IndexLastModified { get; set; } - - public DateTime? IndexLastRebuildTime { get; set; } - - [StringLength(200)] - public string IndexType { get; set; } = null!; - - [StringLength(200)] - public string? IndexStopWordsFile { get; set; } - - [StringLength(200)] - public string? IndexCustomAnalyzerAssemblyName { get; set; } - - [StringLength(200)] - public string? IndexCustomAnalyzerClassName { get; set; } - - public int? IndexBatchSize { get; set; } - - [StringLength(10)] - public string? IndexStatus { get; set; } - - public DateTime? IndexLastUpdate { get; set; } - - [StringLength(200)] - public string? IndexCrawlerUserName { get; set; } - - [StringLength(200)] - public string? IndexCrawlerFormsUserName { get; set; } - - [StringLength(200)] - public string? IndexCrawlerUserPassword { get; set; } - - [StringLength(200)] - public string? IndexCrawlerDomain { get; set; } - - public bool? IndexIsOutdated { get; set; } - - [StringLength(200)] - public string IndexProvider { get; set; } = null!; - - [StringLength(200)] - public string? IndexSearchServiceName { get; set; } - - [StringLength(200)] - public string? IndexAdminKey { get; set; } - - [StringLength(200)] - public string? IndexQueryKey { get; set; } - - [ForeignKey("IndexId")] - [InverseProperty("Indices")] - public virtual ICollection IndexCultures { get; set; } = new List(); - - [ForeignKey("IndexId")] - [InverseProperty("Indices")] - public virtual ICollection IndexSites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsSearchTask.cs b/Migration.Toolkit.K11/Models/CmsSearchTask.cs deleted file mode 100644 index f9e5d0d9..00000000 --- a/Migration.Toolkit.K11/Models/CmsSearchTask.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SearchTask")] -public class CmsSearchTask -{ - [Key] - [Column("SearchTaskID")] - public int SearchTaskId { get; set; } - - [StringLength(100)] - public string SearchTaskType { get; set; } = null!; - - [StringLength(100)] - public string? SearchTaskObjectType { get; set; } - - [StringLength(200)] - public string? SearchTaskField { get; set; } - - [StringLength(600)] - public string SearchTaskValue { get; set; } = null!; - - [StringLength(200)] - public string? SearchTaskServerName { get; set; } - - [StringLength(100)] - public string SearchTaskStatus { get; set; } = null!; - - public int SearchTaskPriority { get; set; } - - public DateTime SearchTaskCreated { get; set; } - - public string? SearchTaskErrorMessage { get; set; } - - [Column("SearchTaskRelatedObjectID")] - public int? SearchTaskRelatedObjectId { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsSearchTaskAzure.cs b/Migration.Toolkit.K11/Models/CmsSearchTaskAzure.cs deleted file mode 100644 index f81c530d..00000000 --- a/Migration.Toolkit.K11/Models/CmsSearchTaskAzure.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SearchTaskAzure")] -[Index("SearchTaskAzurePriority", Name = "IX_CMS_SearchTaskAzure_SearchTaskAzurePriority", AllDescending = true)] -public class CmsSearchTaskAzure -{ - [Key] - [Column("SearchTaskAzureID")] - public int SearchTaskAzureId { get; set; } - - [StringLength(100)] - public string SearchTaskAzureType { get; set; } = null!; - - [StringLength(100)] - public string? SearchTaskAzureObjectType { get; set; } - - [StringLength(200)] - public string? SearchTaskAzureMetadata { get; set; } - - [StringLength(600)] - public string SearchTaskAzureAdditionalData { get; set; } = null!; - - [Column("SearchTaskAzureInitiatorObjectID")] - public int? SearchTaskAzureInitiatorObjectId { get; set; } - - public int SearchTaskAzurePriority { get; set; } - - public string? SearchTaskAzureErrorMessage { get; set; } - - public DateTime SearchTaskAzureCreated { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsSession.cs b/Migration.Toolkit.K11/Models/CmsSession.cs deleted file mode 100644 index 469aef7a..00000000 --- a/Migration.Toolkit.K11/Models/CmsSession.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Session")] -[Index("SessionIdentificator", Name = "IX_CMS_Session_SessionIdentificator", IsUnique = true)] -[Index("SessionSiteId", Name = "IX_CMS_Session_SessionSiteID")] -[Index("SessionUserId", Name = "IX_CMS_Session_SessionUserID")] -[Index("SessionUserIsHidden", Name = "IX_CMS_Session_SessionUserIsHidden")] -public class CmsSession -{ - [StringLength(50)] - public string SessionIdentificator { get; set; } = null!; - - [Column("SessionUserID")] - public int? SessionUserId { get; set; } - - [StringLength(450)] - public string? SessionLocation { get; set; } - - public DateTime SessionLastActive { get; set; } - - public DateTime? SessionLastLogon { get; set; } - - public DateTime SessionExpires { get; set; } - - public bool SessionExpired { get; set; } - - [Column("SessionSiteID")] - public int? SessionSiteId { get; set; } - - public bool SessionUserIsHidden { get; set; } - - [StringLength(450)] - public string? SessionFullName { get; set; } - - [StringLength(254)] - public string? SessionEmail { get; set; } - - [StringLength(254)] - public string? SessionUserName { get; set; } - - [StringLength(254)] - public string? SessionNickName { get; set; } - - public DateTime? SessionUserCreated { get; set; } - - [Column("SessionContactID")] - public int? SessionContactId { get; set; } - - [Key] - [Column("SessionID")] - public int SessionId { get; set; } - - [ForeignKey("SessionSiteId")] - [InverseProperty("CmsSessions")] - public virtual CmsSite? SessionSite { get; set; } - - [ForeignKey("SessionUserId")] - [InverseProperty("CmsSessions")] - public virtual CmsUser? SessionUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsSettingsCategory.cs b/Migration.Toolkit.K11/Models/CmsSettingsCategory.cs deleted file mode 100644 index cae29e42..00000000 --- a/Migration.Toolkit.K11/Models/CmsSettingsCategory.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SettingsCategory")] -[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] -[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] -public class CmsSettingsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - public int? CategoryOrder { get; set; } - - [StringLength(100)] - public string? CategoryName { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - [StringLength(200)] - public string? CategoryIconPath { get; set; } - - public bool? CategoryIsGroup { get; set; } - - public bool? CategoryIsCustom { get; set; } - - [Column("CategoryResourceID")] - public int? CategoryResourceId { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsSettingsCategory? CategoryParent { get; set; } - - [ForeignKey("CategoryResourceId")] - [InverseProperty("CmsSettingsCategories")] - public virtual CmsResource? CategoryResource { get; set; } - - [InverseProperty("KeyCategory")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsSettingsKey.cs b/Migration.Toolkit.K11/Models/CmsSettingsKey.cs deleted file mode 100644 index 8e263b14..00000000 --- a/Migration.Toolkit.K11/Models/CmsSettingsKey.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SettingsKey")] -[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] -[Index("SiteId", "KeyName", Name = "IX_CMS_SettingsKey_SiteID_KeyName")] -public class CmsSettingsKey -{ - [Key] - [Column("KeyID")] - public int KeyId { get; set; } - - [StringLength(100)] - public string KeyName { get; set; } = null!; - - [StringLength(200)] - public string KeyDisplayName { get; set; } = null!; - - public string? KeyDescription { get; set; } - - public string? KeyValue { get; set; } - - [StringLength(50)] - public string KeyType { get; set; } = null!; - - [Column("KeyCategoryID")] - public int? KeyCategoryId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("KeyGUID")] - public Guid KeyGuid { get; set; } - - public DateTime KeyLastModified { get; set; } - - public int? KeyOrder { get; set; } - - public string? KeyDefaultValue { get; set; } - - [StringLength(255)] - public string? KeyValidation { get; set; } - - [StringLength(200)] - public string? KeyEditingControlPath { get; set; } - - public bool? KeyIsGlobal { get; set; } - - public bool? KeyIsCustom { get; set; } - - public bool? KeyIsHidden { get; set; } - - public string? KeyFormControlSettings { get; set; } - - public string? KeyExplanationText { get; set; } - - [ForeignKey("KeyCategoryId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSettingsCategory? KeyCategory { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSite? Site { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsSite.cs b/Migration.Toolkit.K11/Models/CmsSite.cs deleted file mode 100644 index 970b769a..00000000 --- a/Migration.Toolkit.K11/Models/CmsSite.cs +++ /dev/null @@ -1,407 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Site")] -[Index("SiteDefaultEditorStylesheet", Name = "IX_CMS_Site_SiteDefaultEditorStylesheet")] -[Index("SiteDefaultStylesheetId", Name = "IX_CMS_Site_SiteDefaultStylesheetID")] -[Index("SiteDomainName", "SiteStatus", Name = "IX_CMS_Site_SiteDomainName_SiteStatus")] -[Index("SiteName", Name = "IX_CMS_Site_SiteName")] -public class CmsSite -{ - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - [StringLength(200)] - public string SiteDisplayName { get; set; } = null!; - - public string? SiteDescription { get; set; } - - [StringLength(20)] - public string SiteStatus { get; set; } = null!; - - [StringLength(400)] - public string SiteDomainName { get; set; } = null!; - - [Column("SiteDefaultStylesheetID")] - public int? SiteDefaultStylesheetId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - public int? SiteDefaultEditorStylesheet { get; set; } - - [Column("SiteGUID")] - public Guid SiteGuid { get; set; } - - public DateTime SiteLastModified { get; set; } - - public bool? SiteIsOffline { get; set; } - - [Column("SiteOfflineRedirectURL")] - [StringLength(400)] - public string? SiteOfflineRedirectUrl { get; set; } - - public string? SiteOfflineMessage { get; set; } - - [Column("SitePresentationURL")] - [StringLength(400)] - public string? SitePresentationUrl { get; set; } - - public bool? SiteIsContentOnly { get; set; } - - [InverseProperty("CampaignSite")] - public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); - - [InverseProperty("ConversionSite")] - public virtual ICollection AnalyticsConversions { get; set; } = new List(); - - [InverseProperty("StatisticsSite")] - public virtual ICollection AnalyticsStatistics { get; set; } = new List(); - - [InverseProperty("BoardSite")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("ChatNotificationSite")] - public virtual ICollection ChatNotifications { get; set; } = new List(); - - [InverseProperty("ChatOnlineSupportSite")] - public virtual ICollection ChatOnlineSupports { get; set; } = new List(); - - [InverseProperty("ChatOnlineUserSite")] - public virtual ICollection ChatOnlineUsers { get; set; } = new List(); - - [InverseProperty("ChatRoomSite")] - public virtual ICollection ChatRooms { get; set; } = new List(); - - [InverseProperty("ChatSupportCannedResponseSite")] - public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); - - [InverseProperty("ReportSite")] - public virtual ICollection CmsAbuseReports { get; set; } = new List(); - - [InverseProperty("Aclsite")] - public virtual ICollection CmsAcls { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection CmsAttachmentHistories { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection CmsAttachments { get; set; } = new List(); - - [InverseProperty("StateSite")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("IpaddressSite")] - public virtual ICollection CmsBannedIps { get; set; } = new List(); - - [InverseProperty("BannerCategorySite")] - public virtual ICollection CmsBannerCategories { get; set; } = new List(); - - [InverseProperty("BannerSite")] - public virtual ICollection CmsBanners { get; set; } = new List(); - - [InverseProperty("CategorySite")] - public virtual ICollection CmsCategories { get; set; } = new List(); - - [InverseProperty("AliasSite")] - public virtual ICollection CmsDocumentAliases { get; set; } = new List(); - - [InverseProperty("ScopeSite")] - public virtual ICollection CmsDocumentTypeScopes { get; set; } = new List(); - - [InverseProperty("EmailTemplateSite")] - public virtual ICollection CmsEmailTemplates { get; set; } = new List(); - - [InverseProperty("FormSite")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("MembershipSite")] - public virtual ICollection CmsMemberships { get; set; } = new List(); - - [InverseProperty("MetaFileSite")] - public virtual ICollection CmsMetaFiles { get; set; } = new List(); - - [InverseProperty("VersionObjectSite")] - public virtual ICollection CmsObjectVersionHistories { get; set; } = new List(); - - [InverseProperty("PageTemplateScopeSite")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("PageTemplateSite")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("PersonalizationSite")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsRoles { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("SessionSite")] - public virtual ICollection CmsSessions { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsSiteDomainAliases { get; set; } = new List(); - - [InverseProperty("TagGroupSite")] - public virtual ICollection CmsTagGroups { get; set; } = new List(); - - [InverseProperty("NodeLinkedNodeSite")] - public virtual ICollection CmsTreeNodeLinkedNodeSites { get; set; } = new List(); - - [InverseProperty("NodeSite")] - public virtual ICollection CmsTreeNodeSites { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsUserSites { get; set; } = new List(); - - [InverseProperty("NodeSite")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("ScopeSite")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [InverseProperty("BrandSite")] - public virtual ICollection ComBrands { get; set; } = new List(); - - [InverseProperty("CarrierSite")] - public virtual ICollection ComCarriers { get; set; } = new List(); - - [InverseProperty("CollectionSite")] - public virtual ICollection ComCollections { get; set; } = new List(); - - [InverseProperty("CurrencySite")] - public virtual ICollection ComCurrencies { get; set; } = new List(); - - [InverseProperty("EventSite")] - public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); - - [InverseProperty("CustomerSite")] - public virtual ICollection ComCustomers { get; set; } = new List(); - - [InverseProperty("DepartmentSite")] - public virtual ICollection ComDepartments { get; set; } = new List(); - - [InverseProperty("DiscountSite")] - public virtual ICollection ComDiscounts { get; set; } = new List(); - - [InverseProperty("ExchangeTableSite")] - public virtual ICollection ComExchangeTables { get; set; } = new List(); - - [InverseProperty("GiftCardSite")] - public virtual ICollection ComGiftCards { get; set; } = new List(); - - [InverseProperty("InternalStatusSite")] - public virtual ICollection ComInternalStatuses { get; set; } = new List(); - - [InverseProperty("ManufacturerSite")] - public virtual ICollection ComManufacturers { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscountSite")] - public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); - - [InverseProperty("CategorySite")] - public virtual ICollection ComOptionCategories { get; set; } = new List(); - - [InverseProperty("StatusSite")] - public virtual ICollection ComOrderStatuses { get; set; } = new List(); - - [InverseProperty("OrderSite")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("PaymentOptionSite")] - public virtual ICollection ComPaymentOptions { get; set; } = new List(); - - [InverseProperty("PublicStatusSite")] - public virtual ICollection ComPublicStatuses { get; set; } = new List(); - - [InverseProperty("ShippingOptionSite")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); - - [InverseProperty("ShoppingCartSite")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [InverseProperty("Skusite")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [InverseProperty("SupplierSite")] - public virtual ICollection ComSuppliers { get; set; } = new List(); - - [InverseProperty("TaxClassSite")] - public virtual ICollection ComTaxClasses { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("GroupSite")] - public virtual ICollection CommunityGroups { get; set; } = new List(); - - [InverseProperty("ExportSite")] - public virtual ICollection ExportHistories { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection ExportTasks { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection ForumsAttachments { get; set; } = new List(); - - [InverseProperty("GroupSite")] - public virtual ICollection ForumsForumGroups { get; set; } = new List(); - - [InverseProperty("ForumSite")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection IntegrationTasks { get; set; } = new List(); - - [InverseProperty("FileSite")] - public virtual ICollection MediaFiles { get; set; } = new List(); - - [InverseProperty("LibrarySite")] - public virtual ICollection MediaLibraries { get; set; } = new List(); - - [InverseProperty("TemplateSite")] - public virtual ICollection NewsletterEmailTemplates { get; set; } = new List(); - - [InverseProperty("EmailWidgetSite")] - public virtual ICollection NewsletterEmailWidgets { get; set; } = new List(); - - [InverseProperty("EmailSite")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("IssueSite")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [InverseProperty("NewsletterSite")] - public virtual ICollection NewsletterNewsletters { get; set; } = new List(); - - [InverseProperty("SubscriberSite")] - public virtual ICollection NewsletterSubscribers { get; set; } = new List(); - - [InverseProperty("SubscriptionSite")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("TemplateSite")] - public virtual ICollection NotificationTemplates { get; set; } = new List(); - - [InverseProperty("AbtestSite")] - public virtual ICollection OmAbtests { get; set; } = new List(); - - [InverseProperty("AbvariantSite")] - public virtual ICollection OmAbvariants { get; set; } = new List(); - - [InverseProperty("MvtestSite")] - public virtual ICollection OmMvtests { get; set; } = new List(); - - [InverseProperty("PollSite")] - public virtual ICollection PollsPolls { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionSite")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("SharePointConnectionSite")] - public virtual ICollection SharePointSharePointConnections { get; set; } = new List(); - - [InverseProperty("SharePointFileSite")] - public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); - - [InverseProperty("SharePointLibrarySite")] - public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); - - [ForeignKey("SiteDefaultEditorStylesheet")] - [InverseProperty("CmsSiteSiteDefaultEditorStylesheetNavigations")] - public virtual CmsCssStylesheet? SiteDefaultEditorStylesheetNavigation { get; set; } - - [ForeignKey("SiteDefaultStylesheetId")] - [InverseProperty("CmsSiteSiteDefaultStylesheets")] - public virtual CmsCssStylesheet? SiteDefaultStylesheet { get; set; } - - [InverseProperty("FacebookAccountSite")] - public virtual ICollection SmFacebookAccounts { get; set; } = new List(); - - [InverseProperty("FacebookApplicationSite")] - public virtual ICollection SmFacebookApplications { get; set; } = new List(); - - [InverseProperty("FacebookPostSite")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); - - [InverseProperty("LinkedInApplicationSite")] - public virtual ICollection SmLinkedInApplications { get; set; } = new List(); - - [InverseProperty("LinkedInPostSite")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); - - [InverseProperty("TwitterAccountSite")] - public virtual ICollection SmTwitterAccounts { get; set; } = new List(); - - [InverseProperty("TwitterApplicationSite")] - public virtual ICollection SmTwitterApplications { get; set; } = new List(); - - [InverseProperty("TwitterPostSite")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); - - [InverseProperty("ServerSite")] - public virtual ICollection StagingServers { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection StagingTasks { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Classes { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Containers { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Cultures { get; set; } = new List(); - - [ForeignKey("IndexSiteId")] - [InverseProperty("IndexSites")] - public virtual ICollection Indices { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection PageTemplates { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Polls { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection RelationshipNames { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Resources { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Servers { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Stylesheets { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsSiteDomainAlias.cs b/Migration.Toolkit.K11/Models/CmsSiteDomainAlias.cs deleted file mode 100644 index 3f4da1db..00000000 --- a/Migration.Toolkit.K11/Models/CmsSiteDomainAlias.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SiteDomainAlias")] -[Index("SiteDomainAliasName", Name = "IX_CMS_SiteDomainAlias_SiteDomainAliasName")] -[Index("SiteId", Name = "IX_CMS_SiteDomainAlias_SiteID")] -public class CmsSiteDomainAlias -{ - [Key] - [Column("SiteDomainAliasID")] - public int SiteDomainAliasId { get; set; } - - [StringLength(400)] - public string SiteDomainAliasName { get; set; } = null!; - - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - [Column("SiteDomainGUID")] - public Guid? SiteDomainGuid { get; set; } - - public DateTime SiteDomainLastModified { get; set; } - - [StringLength(450)] - public string? SiteDomainDefaultAliasPath { get; set; } - - [StringLength(450)] - public string? SiteDomainRedirectUrl { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsSiteDomainAliases")] - public virtual CmsSite Site { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsSmtpserver.cs b/Migration.Toolkit.K11/Models/CmsSmtpserver.cs deleted file mode 100644 index b01ef868..00000000 --- a/Migration.Toolkit.K11/Models/CmsSmtpserver.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SMTPServer")] -public class CmsSmtpserver -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(200)] - public string ServerName { get; set; } = null!; - - [StringLength(50)] - public string? ServerUserName { get; set; } - - [StringLength(200)] - public string? ServerPassword { get; set; } - - [Column("ServerUseSSL")] - public bool ServerUseSsl { get; set; } - - public bool ServerEnabled { get; set; } - - public bool ServerIsGlobal { get; set; } - - [Column("ServerGUID")] - public Guid ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public int? ServerPriority { get; set; } - - public int? ServerDeliveryMethod { get; set; } - - [StringLength(450)] - public string? ServerPickupDirectory { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("Servers")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsState.cs b/Migration.Toolkit.K11/Models/CmsState.cs deleted file mode 100644 index 62b74e64..00000000 --- a/Migration.Toolkit.K11/Models/CmsState.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_State")] -[Index("CountryId", Name = "IX_CMS_State_CountryID")] -[Index("StateCode", Name = "IX_CMS_State_StateCode")] -public class CmsState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [StringLength(200)] - public string StateDisplayName { get; set; } = null!; - - [StringLength(200)] - public string StateName { get; set; } = null!; - - [StringLength(100)] - public string? StateCode { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public DateTime StateLastModified { get; set; } - - [InverseProperty("AddressState")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("AddressState")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("State")] - public virtual ICollection ComTaxClassStates { get; set; } = new List(); - - [ForeignKey("CountryId")] - [InverseProperty("CmsStates")] - public virtual CmsCountry Country { get; set; } = null!; - - [InverseProperty("AccountState")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactState")] - public virtual ICollection OmContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsTag.cs b/Migration.Toolkit.K11/Models/CmsTag.cs deleted file mode 100644 index f40434af..00000000 --- a/Migration.Toolkit.K11/Models/CmsTag.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Tag")] -[Index("TagGroupId", Name = "IX_CMS_Tag_TagGroupID")] -public class CmsTag -{ - [Key] - [Column("TagID")] - public int TagId { get; set; } - - [StringLength(250)] - public string TagName { get; set; } = null!; - - public int TagCount { get; set; } - - [Column("TagGroupID")] - public int TagGroupId { get; set; } - - [Column("TagGUID")] - public Guid TagGuid { get; set; } - - [ForeignKey("TagGroupId")] - [InverseProperty("CmsTags")] - public virtual CmsTagGroup TagGroup { get; set; } = null!; - - [ForeignKey("TagId")] - [InverseProperty("Tags")] - public virtual ICollection Documents { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsTagGroup.cs b/Migration.Toolkit.K11/Models/CmsTagGroup.cs deleted file mode 100644 index 5a1558fd..00000000 --- a/Migration.Toolkit.K11/Models/CmsTagGroup.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_TagGroup")] -[Index("TagGroupSiteId", Name = "IX_CMS_TagGroup_TagGroupSiteID")] -public class CmsTagGroup -{ - [Key] - [Column("TagGroupID")] - public int TagGroupId { get; set; } - - [StringLength(250)] - public string TagGroupDisplayName { get; set; } = null!; - - [StringLength(250)] - public string TagGroupName { get; set; } = null!; - - public string? TagGroupDescription { get; set; } - - [Column("TagGroupSiteID")] - public int TagGroupSiteId { get; set; } - - public bool TagGroupIsAdHoc { get; set; } - - public DateTime TagGroupLastModified { get; set; } - - [Column("TagGroupGUID")] - public Guid TagGroupGuid { get; set; } - - [InverseProperty("DocumentTagGroup")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("TagGroup")] - public virtual ICollection CmsTags { get; set; } = new List(); - - [ForeignKey("TagGroupSiteId")] - [InverseProperty("CmsTagGroups")] - public virtual CmsSite TagGroupSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsTemplateDeviceLayout.cs b/Migration.Toolkit.K11/Models/CmsTemplateDeviceLayout.cs deleted file mode 100644 index 3a338089..00000000 --- a/Migration.Toolkit.K11/Models/CmsTemplateDeviceLayout.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_TemplateDeviceLayout")] -[Index("LayoutId", Name = "IX_CMS_TemplateDeviceLayout_LayoutID")] -[Index("PageTemplateId", "ProfileId", Name = "IX_CMS_TemplateDeviceLayout_PageTemplateID_ProfileID", IsUnique = true)] -[Index("ProfileId", Name = "IX_CMS_TemplateDeviceLayout_ProfileID")] -public class CmsTemplateDeviceLayout -{ - [Key] - [Column("TemplateDeviceLayoutID")] - public int TemplateDeviceLayoutId { get; set; } - - [Column("PageTemplateID")] - public int PageTemplateId { get; set; } - - [Column("ProfileID")] - public int ProfileId { get; set; } - - [Column("LayoutID")] - public int? LayoutId { get; set; } - - public string? LayoutCode { get; set; } - - [StringLength(50)] - public string? LayoutType { get; set; } - - [Column("LayoutCSS")] - public string? LayoutCss { get; set; } - - public DateTime LayoutLastModified { get; set; } - - [Column("LayoutGUID")] - public Guid LayoutGuid { get; set; } - - [Column("LayoutVersionGUID")] - [StringLength(50)] - public string? LayoutVersionGuid { get; set; } - - [ForeignKey("LayoutId")] - [InverseProperty("CmsTemplateDeviceLayouts")] - public virtual CmsLayout? Layout { get; set; } - - [ForeignKey("PageTemplateId")] - [InverseProperty("CmsTemplateDeviceLayouts")] - public virtual CmsPageTemplate PageTemplate { get; set; } = null!; - - [ForeignKey("ProfileId")] - [InverseProperty("CmsTemplateDeviceLayouts")] - public virtual CmsDeviceProfile Profile { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsTimeZone.cs b/Migration.Toolkit.K11/Models/CmsTimeZone.cs deleted file mode 100644 index 3a34d358..00000000 --- a/Migration.Toolkit.K11/Models/CmsTimeZone.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_TimeZone")] -public class CmsTimeZone -{ - [Key] - [Column("TimeZoneID")] - public int TimeZoneId { get; set; } - - [StringLength(200)] - public string TimeZoneName { get; set; } = null!; - - [StringLength(200)] - public string TimeZoneDisplayName { get; set; } = null!; - - [Column("TimeZoneGMT")] - public double TimeZoneGmt { get; set; } - - public bool? TimeZoneDaylight { get; set; } - - public DateTime TimeZoneRuleStartIn { get; set; } - - [StringLength(200)] - public string TimeZoneRuleStartRule { get; set; } = null!; - - public DateTime TimeZoneRuleEndIn { get; set; } - - [StringLength(200)] - public string TimeZoneRuleEndRule { get; set; } = null!; - - [Column("TimeZoneGUID")] - public Guid TimeZoneGuid { get; set; } - - public DateTime TimeZoneLastModified { get; set; } - - [InverseProperty("UserTimeZone")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsTransformation.cs b/Migration.Toolkit.K11/Models/CmsTransformation.cs deleted file mode 100644 index 0a54be63..00000000 --- a/Migration.Toolkit.K11/Models/CmsTransformation.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Transformation")] -[Index("TransformationClassId", Name = "IX_CMS_Transformation_TransformationClassID")] -public class CmsTransformation -{ - [Key] - [Column("TransformationID")] - public int TransformationId { get; set; } - - [StringLength(100)] - public string TransformationName { get; set; } = null!; - - public string TransformationCode { get; set; } = null!; - - [StringLength(50)] - public string TransformationType { get; set; } = null!; - - [Column("TransformationClassID")] - public int TransformationClassId { get; set; } - - [Column("TransformationVersionGUID")] - [StringLength(50)] - public string? TransformationVersionGuid { get; set; } - - [Column("TransformationGUID")] - public Guid TransformationGuid { get; set; } - - public DateTime TransformationLastModified { get; set; } - - public bool? TransformationIsHierarchical { get; set; } - - [Column("TransformationHierarchicalXML")] - public string? TransformationHierarchicalXml { get; set; } - - [Column("TransformationCSS")] - public string? TransformationCss { get; set; } - - [StringLength(700)] - public string? TransformationPreferredDocument { get; set; } - - [ForeignKey("TransformationClassId")] - [InverseProperty("CmsTransformations")] - public virtual CmsClass TransformationClass { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsTranslationService.cs b/Migration.Toolkit.K11/Models/CmsTranslationService.cs deleted file mode 100644 index d5c774ba..00000000 --- a/Migration.Toolkit.K11/Models/CmsTranslationService.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_TranslationService")] -public class CmsTranslationService -{ - [Key] - [Column("TranslationServiceID")] - public int TranslationServiceId { get; set; } - - [StringLength(200)] - public string TranslationServiceAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceClassName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceDisplayName { get; set; } = null!; - - public bool TranslationServiceIsMachine { get; set; } - - public DateTime TranslationServiceLastModified { get; set; } - - [Column("TranslationServiceGUID")] - public Guid TranslationServiceGuid { get; set; } - - public bool TranslationServiceEnabled { get; set; } - - public bool? TranslationServiceSupportsInstructions { get; set; } - - public bool? TranslationServiceSupportsPriority { get; set; } - - public bool? TranslationServiceSupportsDeadline { get; set; } - - public bool? TranslationServiceGenerateTargetTag { get; set; } - - [StringLength(1000)] - public string? TranslationServiceParameter { get; set; } - - public bool? TranslationServiceSupportsStatusUpdate { get; set; } - - public bool? TranslationServiceSupportsCancel { get; set; } - - [InverseProperty("SubmissionService")] - public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsTranslationSubmission.cs b/Migration.Toolkit.K11/Models/CmsTranslationSubmission.cs deleted file mode 100644 index 6b136a4a..00000000 --- a/Migration.Toolkit.K11/Models/CmsTranslationSubmission.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_TranslationSubmission")] -[Index("SubmissionServiceId", Name = "IX_CMS_TranslationSubmission_SubmissionServiceID")] -[Index("SubmissionSubmittedByUserId", Name = "IX_CMS_TranslationSubmission_SubmissionSubmittedByUserID")] -public class CmsTranslationSubmission -{ - [Key] - [Column("SubmissionID")] - public int SubmissionId { get; set; } - - [StringLength(200)] - public string SubmissionName { get; set; } = null!; - - [StringLength(200)] - public string? SubmissionTicket { get; set; } - - public int SubmissionStatus { get; set; } - - [Column("SubmissionServiceID")] - public int SubmissionServiceId { get; set; } - - [StringLength(10)] - public string SubmissionSourceCulture { get; set; } = null!; - - public string SubmissionTargetCulture { get; set; } = null!; - - public int SubmissionPriority { get; set; } - - public DateTime? SubmissionDeadline { get; set; } - - [StringLength(500)] - public string? SubmissionInstructions { get; set; } - - public DateTime SubmissionLastModified { get; set; } - - [Column("SubmissionGUID")] - public Guid SubmissionGuid { get; set; } - - [Column("SubmissionSiteID")] - public int? SubmissionSiteId { get; set; } - - public double? SubmissionPrice { get; set; } - - public string? SubmissionStatusMessage { get; set; } - - public bool? SubmissionTranslateAttachments { get; set; } - - public int SubmissionItemCount { get; set; } - - public DateTime SubmissionDate { get; set; } - - public int? SubmissionWordCount { get; set; } - - public int? SubmissionCharCount { get; set; } - - [Column("SubmissionSubmittedByUserID")] - public int? SubmissionSubmittedByUserId { get; set; } - - [InverseProperty("SubmissionItemSubmission")] - public virtual ICollection CmsTranslationSubmissionItems { get; set; } = new List(); - - [ForeignKey("SubmissionServiceId")] - [InverseProperty("CmsTranslationSubmissions")] - public virtual CmsTranslationService SubmissionService { get; set; } = null!; - - [ForeignKey("SubmissionSubmittedByUserId")] - [InverseProperty("CmsTranslationSubmissions")] - public virtual CmsUser? SubmissionSubmittedByUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsTranslationSubmissionItem.cs b/Migration.Toolkit.K11/Models/CmsTranslationSubmissionItem.cs deleted file mode 100644 index 6ded3322..00000000 --- a/Migration.Toolkit.K11/Models/CmsTranslationSubmissionItem.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_TranslationSubmissionItem")] -[Index("SubmissionItemSubmissionId", Name = "IX_CMS_TranslationSubmissionItem_SubmissionItemSubmissionID")] -public class CmsTranslationSubmissionItem -{ - [Key] - [Column("SubmissionItemID")] - public int SubmissionItemId { get; set; } - - [Column("SubmissionItemSubmissionID")] - public int SubmissionItemSubmissionId { get; set; } - - [Column("SubmissionItemSourceXLIFF")] - public string? SubmissionItemSourceXliff { get; set; } - - [Column("SubmissionItemTargetXLIFF")] - public string? SubmissionItemTargetXliff { get; set; } - - [StringLength(100)] - public string SubmissionItemObjectType { get; set; } = null!; - - [Column("SubmissionItemObjectID")] - public int SubmissionItemObjectId { get; set; } - - [Column("SubmissionItemGUID")] - public Guid SubmissionItemGuid { get; set; } - - public DateTime SubmissionItemLastModified { get; set; } - - [StringLength(200)] - public string SubmissionItemName { get; set; } = null!; - - public int? SubmissionItemWordCount { get; set; } - - public int? SubmissionItemCharCount { get; set; } - - public string? SubmissionItemCustomData { get; set; } - - [Column("SubmissionItemTargetObjectID")] - public int SubmissionItemTargetObjectId { get; set; } - - [StringLength(50)] - public string? SubmissionItemType { get; set; } - - [StringLength(10)] - public string? SubmissionItemTargetCulture { get; set; } - - [ForeignKey("SubmissionItemSubmissionId")] - [InverseProperty("CmsTranslationSubmissionItems")] - public virtual CmsTranslationSubmission SubmissionItemSubmission { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsTree.cs b/Migration.Toolkit.K11/Models/CmsTree.cs deleted file mode 100644 index 73dd0958..00000000 --- a/Migration.Toolkit.K11/Models/CmsTree.cs +++ /dev/null @@ -1,183 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Tree")] -[Index("NodeAclid", Name = "IX_CMS_Tree_NodeACLID")] -[Index("NodeAliasPath", Name = "IX_CMS_Tree_NodeAliasPath")] -[Index("NodeClassId", Name = "IX_CMS_Tree_NodeClassID")] -[Index("NodeGroupId", Name = "IX_CMS_Tree_NodeGroupID")] -[Index("NodeLevel", Name = "IX_CMS_Tree_NodeLevel")] -[Index("NodeLinkedNodeId", Name = "IX_CMS_Tree_NodeLinkedNodeID")] -[Index("NodeLinkedNodeSiteId", Name = "IX_CMS_Tree_NodeLinkedNodeSiteID")] -[Index("NodeOriginalNodeId", Name = "IX_CMS_Tree_NodeOriginalNodeID")] -[Index("NodeOwner", Name = "IX_CMS_Tree_NodeOwner")] -[Index("NodeParentId", "NodeAlias", "NodeName", Name = "IX_CMS_Tree_NodeParentID_NodeAlias_NodeName")] -[Index("NodeSkuid", Name = "IX_CMS_Tree_NodeSKUID")] -[Index("NodeSiteId", "NodeGuid", Name = "IX_CMS_Tree_NodeSiteID_NodeGUID", IsUnique = true)] -[Index("NodeTemplateId", Name = "IX_CMS_Tree_NodeTemplateID")] -public class CmsTree -{ - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - public string NodeAliasPath { get; set; } = null!; - - [StringLength(100)] - public string NodeName { get; set; } = null!; - - [StringLength(50)] - public string NodeAlias { get; set; } = null!; - - [Column("NodeClassID")] - public int NodeClassId { get; set; } - - [Column("NodeParentID")] - public int? NodeParentId { get; set; } - - public int NodeLevel { get; set; } - - [Column("NodeACLID")] - public int? NodeAclid { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeGUID")] - public Guid NodeGuid { get; set; } - - public int? NodeOrder { get; set; } - - public bool? IsSecuredNode { get; set; } - - public int? NodeCacheMinutes { get; set; } - - [Column("NodeSKUID")] - public int? NodeSkuid { get; set; } - - public string? NodeDocType { get; set; } - - public string? NodeHeadTags { get; set; } - - public string? NodeBodyElementAttributes { get; set; } - - [StringLength(200)] - public string? NodeInheritPageLevels { get; set; } - - [Column("RequiresSSL")] - public int? RequiresSsl { get; set; } - - [Column("NodeLinkedNodeID")] - public int? NodeLinkedNodeId { get; set; } - - public int? NodeOwner { get; set; } - - public string? NodeCustomData { get; set; } - - [Column("NodeGroupID")] - public int? NodeGroupId { get; set; } - - [Column("NodeLinkedNodeSiteID")] - public int? NodeLinkedNodeSiteId { get; set; } - - [Column("NodeTemplateID")] - public int? NodeTemplateId { get; set; } - - public bool? NodeTemplateForAllCultures { get; set; } - - public bool? NodeInheritPageTemplate { get; set; } - - public bool? NodeAllowCacheInFileSystem { get; set; } - - public bool? NodeHasChildren { get; set; } - - public bool? NodeHasLinks { get; set; } - - [Column("NodeOriginalNodeID")] - public int? NodeOriginalNodeId { get; set; } - - public bool NodeIsContentOnly { get; set; } - - [Column("NodeIsACLOwner")] - public bool NodeIsAclowner { get; set; } - - public string? NodeBodyScripts { get; set; } - - [InverseProperty("AliasNode")] - public virtual ICollection CmsDocumentAliases { get; set; } = new List(); - - [InverseProperty("DocumentNode")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("LeftNode")] - public virtual ICollection CmsRelationshipLeftNodes { get; set; } = new List(); - - [InverseProperty("RightNode")] - public virtual ICollection CmsRelationshipRightNodes { get; set; } = new List(); - - [InverseProperty("Node")] - public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); - - [InverseProperty("AttendeeEventNode")] - public virtual ICollection EventsAttendees { get; set; } = new List(); - - [InverseProperty("NodeLinkedNode")] - public virtual ICollection InverseNodeLinkedNode { get; set; } = new List(); - - [InverseProperty("NodeOriginalNode")] - public virtual ICollection InverseNodeOriginalNode { get; set; } = new List(); - - [InverseProperty("NodeParent")] - public virtual ICollection InverseNodeParent { get; set; } = new List(); - - [ForeignKey("NodeAclid")] - [InverseProperty("CmsTrees")] - public virtual CmsAcl? NodeAcl { get; set; } - - [ForeignKey("NodeClassId")] - [InverseProperty("CmsTrees")] - public virtual CmsClass NodeClass { get; set; } = null!; - - [ForeignKey("NodeGroupId")] - [InverseProperty("CmsTrees")] - public virtual CommunityGroup? NodeGroup { get; set; } - - [ForeignKey("NodeLinkedNodeId")] - [InverseProperty("InverseNodeLinkedNode")] - public virtual CmsTree? NodeLinkedNode { get; set; } - - [ForeignKey("NodeLinkedNodeSiteId")] - [InverseProperty("CmsTreeNodeLinkedNodeSites")] - public virtual CmsSite? NodeLinkedNodeSite { get; set; } - - [ForeignKey("NodeOriginalNodeId")] - [InverseProperty("InverseNodeOriginalNode")] - public virtual CmsTree? NodeOriginalNode { get; set; } - - [ForeignKey("NodeOwner")] - [InverseProperty("CmsTrees")] - public virtual CmsUser? NodeOwnerNavigation { get; set; } - - [ForeignKey("NodeParentId")] - [InverseProperty("InverseNodeParent")] - public virtual CmsTree? NodeParent { get; set; } - - [ForeignKey("NodeSiteId")] - [InverseProperty("CmsTreeNodeSites")] - public virtual CmsSite NodeSite { get; set; } = null!; - - [ForeignKey("NodeSkuid")] - [InverseProperty("CmsTrees")] - public virtual ComSku? NodeSku { get; set; } - - [ForeignKey("NodeTemplateId")] - [InverseProperty("CmsTrees")] - public virtual CmsPageTemplate? NodeTemplate { get; set; } - - [InverseProperty("Node")] - public virtual ICollection PersonasPersonaNodes { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsUielement.cs b/Migration.Toolkit.K11/Models/CmsUielement.cs deleted file mode 100644 index bc94cf40..00000000 --- a/Migration.Toolkit.K11/Models/CmsUielement.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_UIElement")] -[Index("ElementGuid", Name = "IX_CMS_UIElement_ElementGUID", IsUnique = true)] -[Index("ElementPageTemplateId", Name = "IX_CMS_UIElement_ElementPageTemplateID")] -[Index("ElementParentId", Name = "IX_CMS_UIElement_ElementParentID")] -public class CmsUielement -{ - [Key] - [Column("ElementID")] - public int ElementId { get; set; } - - [StringLength(200)] - public string ElementDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ElementName { get; set; } = null!; - - [StringLength(200)] - public string? ElementCaption { get; set; } - - [Column("ElementTargetURL")] - [StringLength(650)] - public string? ElementTargetUrl { get; set; } - - [Column("ElementResourceID")] - public int ElementResourceId { get; set; } - - [Column("ElementParentID")] - public int? ElementParentId { get; set; } - - public int ElementChildCount { get; set; } - - public int? ElementOrder { get; set; } - - public int ElementLevel { get; set; } - - [Column("ElementIDPath")] - [StringLength(450)] - public string ElementIdpath { get; set; } = null!; - - [StringLength(200)] - public string? ElementIconPath { get; set; } - - public bool? ElementIsCustom { get; set; } - - public DateTime ElementLastModified { get; set; } - - [Column("ElementGUID")] - public Guid ElementGuid { get; set; } - - public int? ElementSize { get; set; } - - public string? ElementDescription { get; set; } - - [StringLength(20)] - public string? ElementFromVersion { get; set; } - - [Column("ElementPageTemplateID")] - public int? ElementPageTemplateId { get; set; } - - [StringLength(50)] - public string? ElementType { get; set; } - - public string? ElementProperties { get; set; } - - public bool? ElementIsMenu { get; set; } - - [StringLength(200)] - public string? ElementFeature { get; set; } - - [StringLength(100)] - public string? ElementIconClass { get; set; } - - public bool? ElementIsGlobalApplication { get; set; } - - public bool? ElementCheckModuleReadPermission { get; set; } - - public string? ElementAccessCondition { get; set; } - - public string? ElementVisibilityCondition { get; set; } - - public bool ElementRequiresGlobalAdminPriviligeLevel { get; set; } - - [InverseProperty("HelpTopicUielement")] - public virtual ICollection CmsHelpTopics { get; set; } = new List(); - - [ForeignKey("ElementPageTemplateId")] - [InverseProperty("CmsUielements")] - public virtual CmsPageTemplate? ElementPageTemplate { get; set; } - - [ForeignKey("ElementParentId")] - [InverseProperty("InverseElementParent")] - public virtual CmsUielement? ElementParent { get; set; } - - [ForeignKey("ElementResourceId")] - [InverseProperty("CmsUielements")] - public virtual CmsResource ElementResource { get; set; } = null!; - - [InverseProperty("ElementParent")] - public virtual ICollection InverseElementParent { get; set; } = new List(); - - [ForeignKey("ElementId")] - [InverseProperty("Elements")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("ElementId")] - [InverseProperty("ElementsNavigation")] - public virtual ICollection RolesNavigation { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsUser.cs b/Migration.Toolkit.K11/Models/CmsUser.cs deleted file mode 100644 index dbba74b9..00000000 --- a/Migration.Toolkit.K11/Models/CmsUser.cs +++ /dev/null @@ -1,339 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_User")] -[Index("Email", Name = "IX_CMS_User_Email")] -[Index("FullName", Name = "IX_CMS_User_FullName")] -[Index("UserEnabled", "UserIsHidden", Name = "IX_CMS_User_UserEnabled_UserIsHidden")] -[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] -[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] -[Index("UserPrivilegeLevel", Name = "IX_CMS_User_UserPrivilegeLevel")] -public class CmsUser -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [InverseProperty("CommentApprovedByUser")] - public virtual ICollection BlogCommentCommentApprovedByUsers { get; set; } = new List(); - - [InverseProperty("CommentUser")] - public virtual ICollection BlogCommentCommentUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); - - [InverseProperty("BoardUser")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("MessageApprovedByUser")] - public virtual ICollection BoardMessageMessageApprovedByUsers { get; set; } = new List(); - - [InverseProperty("MessageUser")] - public virtual ICollection BoardMessageMessageUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection BoardSubscriptions { get; set; } = new List(); - - [InverseProperty("InitiatedChatRequestUser")] - public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); - - [InverseProperty("ChatUserUser")] - public virtual ICollection ChatUsers { get; set; } = new List(); - - [InverseProperty("ReportUser")] - public virtual ICollection CmsAbuseReports { get; set; } = new List(); - - [InverseProperty("LastModifiedByUser")] - public virtual ICollection CmsAclitemLastModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsAclitemUsers { get; set; } = new List(); - - [InverseProperty("HistoryApprovedByUser")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateUser")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("CategoryUser")] - public virtual ICollection CmsCategories { get; set; } = new List(); - - [InverseProperty("DocumentCheckedOutByUser")] - public virtual ICollection CmsDocumentDocumentCheckedOutByUsers { get; set; } = new List(); - - [InverseProperty("DocumentCreatedByUser")] - public virtual ICollection CmsDocumentDocumentCreatedByUsers { get; set; } = new List(); - - [InverseProperty("DocumentModifiedByUser")] - public virtual ICollection CmsDocumentDocumentModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsEmailUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsExternalLogins { get; set; } = new List(); - - [InverseProperty("MacroIdentityEffectiveUser")] - public virtual ICollection CmsMacroIdentities { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsMembershipUsers { get; set; } = new List(); - - [InverseProperty("ObjectCheckedOutByUser")] - public virtual ICollection CmsObjectSettings { get; set; } = new List(); - - [InverseProperty("VersionDeletedByUser")] - public virtual ICollection CmsObjectVersionHistoryVersionDeletedByUsers { get; set; } = new List(); - - [InverseProperty("VersionModifiedByUser")] - public virtual ICollection CmsObjectVersionHistoryVersionModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsOpenIdusers { get; set; } = new List(); - - [InverseProperty("PersonalizationUser")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [InverseProperty("TaskUser")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("SessionUser")] - public virtual ICollection CmsSessions { get; set; } = new List(); - - [InverseProperty("SubmissionSubmittedByUser")] - public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); - - [InverseProperty("NodeOwnerNavigation")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("UserMacroIdentityUser")] - public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } - - [InverseProperty("User")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("UserActivatedByUser")] - public virtual ICollection CmsUserSettingUserActivatedByUsers { get; set; } = new List(); - - [InverseProperty("UserSettingsUserNavigation")] - public virtual CmsUserSetting? CmsUserSettingUserSettingsUserNavigation { get; set; } - - public virtual ICollection CmsUserSettingUserSettingsUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsUserSites { get; set; } = new List(); - - [InverseProperty("ModifiedByUser")] - public virtual ICollection CmsVersionHistoryModifiedByUsers { get; set; } = new List(); - - [InverseProperty("VersionDeletedByUser")] - public virtual ICollection CmsVersionHistoryVersionDeletedByUsers { get; set; } = new List(); - - [InverseProperty("ApprovedByUser")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); - - [InverseProperty("CustomerUser")] - public virtual ICollection ComCustomers { get; set; } = new List(); - - [InverseProperty("ChangedByUser")] - public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); - - [InverseProperty("OrderCreatedByUser")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartUser")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("FriendApprovedByNavigation")] - public virtual ICollection CommunityFriendFriendApprovedByNavigations { get; set; } = new List(); - - [InverseProperty("FriendRejectedByNavigation")] - public virtual ICollection CommunityFriendFriendRejectedByNavigations { get; set; } = new List(); - - [InverseProperty("FriendRequestedUser")] - public virtual ICollection CommunityFriendFriendRequestedUsers { get; set; } = new List(); - - [InverseProperty("FriendUser")] - public virtual ICollection CommunityFriendFriendUsers { get; set; } = new List(); - - [InverseProperty("GroupApprovedByUser")] - public virtual ICollection CommunityGroupGroupApprovedByUsers { get; set; } = new List(); - - [InverseProperty("GroupCreatedByUser")] - public virtual ICollection CommunityGroupGroupCreatedByUsers { get; set; } = new List(); - - [InverseProperty("MemberApprovedByUser")] - public virtual ICollection CommunityGroupMemberMemberApprovedByUsers { get; set; } = new List(); - - [InverseProperty("MemberInvitedByUser")] - public virtual ICollection CommunityGroupMemberMemberInvitedByUsers { get; set; } = new List(); - - [InverseProperty("MemberUser")] - public virtual ICollection CommunityGroupMemberMemberUsers { get; set; } = new List(); - - [InverseProperty("InvitedByUser")] - public virtual ICollection CommunityInvitationInvitedByUsers { get; set; } = new List(); - - [InverseProperty("InvitedUser")] - public virtual ICollection CommunityInvitationInvitedUsers { get; set; } = new List(); - - [InverseProperty("ExportUser")] - public virtual ICollection ExportHistories { get; set; } = new List(); - - [InverseProperty("PostApprovedByUser")] - public virtual ICollection ForumsForumPostPostApprovedByUsers { get; set; } = new List(); - - [InverseProperty("PostUser")] - public virtual ICollection ForumsForumPostPostUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [InverseProperty("FileCreatedByUser")] - public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); - - [InverseProperty("FileModifiedByUser")] - public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); - - [InverseProperty("MessageRecipientUser")] - public virtual ICollection MessagingMessageMessageRecipientUsers { get; set; } = new List(); - - [InverseProperty("MessageSenderUser")] - public virtual ICollection MessagingMessageMessageSenderUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("AccountOwnerUser")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactOwnerUser")] - public virtual ICollection OmContacts { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionUser")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("SavedReportCreatedByUser")] - public virtual ICollection ReportingSavedReports { get; set; } = new List(); - - [InverseProperty("User")] - public virtual StagingTaskGroupUser? StagingTaskGroupUser { get; set; } - - [InverseProperty("User")] - public virtual ICollection StagingTaskUsers { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Boards { get; set; } = new List(); - - [ForeignKey("ContactListUserId")] - [InverseProperty("ContactListUsers")] - public virtual ICollection ContactListContactUsers { get; set; } = new List(); - - [ForeignKey("ContactListContactUserId")] - [InverseProperty("ContactListContactUsers")] - public virtual ICollection ContactListUsers { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Forums { get; set; } = new List(); - - [ForeignKey("IgnoreListUserId")] - [InverseProperty("IgnoreListUsers")] - public virtual ICollection IgnoreListIgnoredUsers { get; set; } = new List(); - - [ForeignKey("IgnoreListIgnoredUserId")] - [InverseProperty("IgnoreListIgnoredUsers")] - public virtual ICollection IgnoreListUsers { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Workflows { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsUserCulture.cs b/Migration.Toolkit.K11/Models/CmsUserCulture.cs deleted file mode 100644 index fb140775..00000000 --- a/Migration.Toolkit.K11/Models/CmsUserCulture.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("UserId", "CultureId", "SiteId")] -[Table("CMS_UserCulture")] -[Index("CultureId", Name = "IX_CMS_UserCulture_CultureID")] -[Index("SiteId", Name = "IX_CMS_UserCulture_SiteID")] -public class CmsUserCulture -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("CultureId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsCulture Culture { get; set; } = null!; - - [ForeignKey("SiteId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsUserMacroIdentity.cs b/Migration.Toolkit.K11/Models/CmsUserMacroIdentity.cs deleted file mode 100644 index 4c4a38c2..00000000 --- a/Migration.Toolkit.K11/Models/CmsUserMacroIdentity.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_UserMacroIdentity")] -[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] -[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] -public class CmsUserMacroIdentity -{ - [Key] - [Column("UserMacroIdentityID")] - public int UserMacroIdentityId { get; set; } - - public DateTime UserMacroIdentityLastModified { get; set; } - - [Column("UserMacroIdentityUserID")] - public int UserMacroIdentityUserId { get; set; } - - [Column("UserMacroIdentityMacroIdentityID")] - public int? UserMacroIdentityMacroIdentityId { get; set; } - - public Guid UserMacroIdentityUserGuid { get; set; } - - [ForeignKey("UserMacroIdentityMacroIdentityId")] - [InverseProperty("CmsUserMacroIdentities")] - public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } - - [ForeignKey("UserMacroIdentityUserId")] - [InverseProperty("CmsUserMacroIdentity")] - public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsUserRole.cs b/Migration.Toolkit.K11/Models/CmsUserRole.cs deleted file mode 100644 index 58e47c17..00000000 --- a/Migration.Toolkit.K11/Models/CmsUserRole.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_UserRole")] -[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] -[Index("RoleId", "ValidTo", "UserId", Name = "IX_CMS_UserRole_UserID")] -[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] -public class CmsUserRole -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } - - [Key] - [Column("UserRoleID")] - public int UserRoleId { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsUserSetting.cs b/Migration.Toolkit.K11/Models/CmsUserSetting.cs deleted file mode 100644 index 3ecfd9c1..00000000 --- a/Migration.Toolkit.K11/Models/CmsUserSetting.cs +++ /dev/null @@ -1,170 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_UserSettings")] -[Index("UserActivatedByUserId", Name = "IX_CMS_UserSettings_UserActivatedByUserID")] -[Index("UserAuthenticationGuid", Name = "IX_CMS_UserSettings_UserAuthenticationGUID")] -[Index("UserAvatarId", Name = "IX_CMS_UserSettings_UserAvatarID")] -[Index("UserBadgeId", Name = "IX_CMS_UserSettings_UserBadgeID")] -[Index("UserFacebookId", Name = "IX_CMS_UserSettings_UserFacebookID")] -[Index("UserGender", Name = "IX_CMS_UserSettings_UserGender")] -[Index("UserNickName", Name = "IX_CMS_UserSettings_UserNickName")] -[Index("UserPasswordRequestHash", Name = "IX_CMS_UserSettings_UserPasswordRequestHash")] -[Index("UserSettingsUserGuid", Name = "IX_CMS_UserSettings_UserSettingsUserGUID")] -[Index("UserSettingsUserId", Name = "IX_CMS_UserSettings_UserSettingsUserID", IsUnique = true)] -[Index("UserTimeZoneId", Name = "IX_CMS_UserSettings_UserTimeZoneID")] -[Index("UserWaitingForApproval", Name = "IX_CMS_UserSettings_UserWaitingForApproval")] -[Index("WindowsLiveId", Name = "IX_CMS_UserSettings_WindowsLiveID")] -public class CmsUserSetting -{ - [Key] - [Column("UserSettingsID")] - public int UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - [StringLength(200)] - public string? UserMessagingNotificationEmail { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [ForeignKey("UserActivatedByUserId")] - [InverseProperty("CmsUserSettingUserActivatedByUsers")] - public virtual CmsUser? UserActivatedByUser { get; set; } - - [ForeignKey("UserAvatarId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsAvatar? UserAvatar { get; set; } - - [ForeignKey("UserBadgeId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsBadge? UserBadge { get; set; } - - public virtual CmsUser UserSettingsUser { get; set; } = null!; - - [ForeignKey("UserSettingsUserId")] - [InverseProperty("CmsUserSettingUserSettingsUserNavigation")] - public virtual CmsUser UserSettingsUserNavigation { get; set; } = null!; - - [ForeignKey("UserTimeZoneId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsTimeZone? UserTimeZone { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsUserSite.cs b/Migration.Toolkit.K11/Models/CmsUserSite.cs deleted file mode 100644 index dda4568f..00000000 --- a/Migration.Toolkit.K11/Models/CmsUserSite.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_UserSite")] -[Index("SiteId", Name = "IX_CMS_UserSite_SiteID")] -[Index("UserId", "SiteId", Name = "IX_CMS_UserSite_UserID_SiteID", IsUnique = true)] -public class CmsUserSite -{ - [Key] - [Column("UserSiteID")] - public int UserSiteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsUserSites")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserSites")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsVersionHistory.cs b/Migration.Toolkit.K11/Models/CmsVersionHistory.cs deleted file mode 100644 index 61e910d3..00000000 --- a/Migration.Toolkit.K11/Models/CmsVersionHistory.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_VersionHistory")] -[Index("ModifiedByUserId", Name = "IX_CMS_VersionHistory_ModifiedByUserID")] -[Index("NodeSiteId", Name = "IX_CMS_VersionHistory_NodeSiteID")] -[Index("ToBePublished", "PublishFrom", "PublishTo", Name = "IX_CMS_VersionHistory_ToBePublished_PublishFrom_PublishTo")] -[Index("VersionClassId", Name = "IX_CMS_VersionHistory_VersionClassID")] -[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_VersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionWorkflowId", Name = "IX_CMS_VersionHistory_VersionWorkflowID")] -[Index("VersionWorkflowStepId", Name = "IX_CMS_VersionHistory_VersionWorkflowStepID")] -public class CmsVersionHistory -{ - [Key] - [Column("VersionHistoryID")] - public int VersionHistoryId { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("DocumentID")] - public int? DocumentId { get; set; } - - [StringLength(450)] - public string DocumentNamePath { get; set; } = null!; - - [Column("NodeXML")] - public string NodeXml { get; set; } = null!; - - [Column("ModifiedByUserID")] - public int? ModifiedByUserId { get; set; } - - public DateTime ModifiedWhen { get; set; } - - [StringLength(50)] - public string? VersionNumber { get; set; } - - public string? VersionComment { get; set; } - - public bool ToBePublished { get; set; } - - public DateTime? PublishFrom { get; set; } - - public DateTime? PublishTo { get; set; } - - public DateTime? WasPublishedFrom { get; set; } - - public DateTime? WasPublishedTo { get; set; } - - [StringLength(100)] - public string? VersionDocumentName { get; set; } - - [StringLength(50)] - public string? VersionDocumentType { get; set; } - - [Column("VersionClassID")] - public int? VersionClassId { get; set; } - - [StringLength(450)] - public string? VersionMenuRedirectUrl { get; set; } - - [Column("VersionWorkflowID")] - public int? VersionWorkflowId { get; set; } - - [Column("VersionWorkflowStepID")] - public int? VersionWorkflowStepId { get; set; } - - [StringLength(450)] - public string? VersionNodeAliasPath { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [InverseProperty("DocumentCheckedOutVersionHistory")] - public virtual ICollection CmsDocumentDocumentCheckedOutVersionHistories { get; set; } = new List(); - - [InverseProperty("DocumentPublishedVersionHistory")] - public virtual ICollection CmsDocumentDocumentPublishedVersionHistories { get; set; } = new List(); - - [InverseProperty("VersionHistory")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [ForeignKey("ModifiedByUserId")] - [InverseProperty("CmsVersionHistoryModifiedByUsers")] - public virtual CmsUser? ModifiedByUser { get; set; } - - [ForeignKey("NodeSiteId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsSite NodeSite { get; set; } = null!; - - [ForeignKey("VersionClassId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsClass? VersionClass { get; set; } - - [ForeignKey("VersionDeletedByUserId")] - [InverseProperty("CmsVersionHistoryVersionDeletedByUsers")] - public virtual CmsUser? VersionDeletedByUser { get; set; } - - [ForeignKey("VersionWorkflowId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsWorkflow? VersionWorkflow { get; set; } - - [ForeignKey("VersionWorkflowStepId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsWorkflowStep? VersionWorkflowStep { get; set; } - - [ForeignKey("VersionHistoryId")] - [InverseProperty("VersionHistories")] - public virtual ICollection AttachmentHistories { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmServer.cs b/Migration.Toolkit.K11/Models/CmsWebFarmServer.cs deleted file mode 100644 index 91666db4..00000000 --- a/Migration.Toolkit.K11/Models/CmsWebFarmServer.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebFarmServer")] -[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] -public class CmsWebFarmServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(300)] - public string ServerDisplayName { get; set; } = null!; - - [StringLength(300)] - public string ServerName { get; set; } = null!; - - [Column("ServerGUID")] - public Guid? ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public bool ServerEnabled { get; set; } - - public bool IsExternalWebAppServer { get; set; } - - [InverseProperty("Server")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmServerLog.cs b/Migration.Toolkit.K11/Models/CmsWebFarmServerLog.cs deleted file mode 100644 index 30dbcabd..00000000 --- a/Migration.Toolkit.K11/Models/CmsWebFarmServerLog.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebFarmServerLog")] -public class CmsWebFarmServerLog -{ - [Key] - [Column("WebFarmServerLogID")] - public int WebFarmServerLogId { get; set; } - - public DateTime LogTime { get; set; } - - [StringLength(200)] - public string LogCode { get; set; } = null!; - - [Column("ServerID")] - public int ServerId { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmServerMonitoring.cs b/Migration.Toolkit.K11/Models/CmsWebFarmServerMonitoring.cs deleted file mode 100644 index ff8aef2e..00000000 --- a/Migration.Toolkit.K11/Models/CmsWebFarmServerMonitoring.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebFarmServerMonitoring")] -public class CmsWebFarmServerMonitoring -{ - [Key] - [Column("WebFarmServerMonitoringID")] - public int WebFarmServerMonitoringId { get; set; } - - [Column("ServerID")] - public int ServerId { get; set; } - - public DateTime? ServerPing { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmServerTask.cs b/Migration.Toolkit.K11/Models/CmsWebFarmServerTask.cs deleted file mode 100644 index f728ca5a..00000000 --- a/Migration.Toolkit.K11/Models/CmsWebFarmServerTask.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("ServerId", "TaskId")] -[Table("CMS_WebFarmServerTask")] -[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] -public class CmsWebFarmServerTask -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - public string? ErrorMessage { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmServer Server { get; set; } = null!; - - [ForeignKey("TaskId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmTask Task { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmTask.cs b/Migration.Toolkit.K11/Models/CmsWebFarmTask.cs deleted file mode 100644 index 57c2561e..00000000 --- a/Migration.Toolkit.K11/Models/CmsWebFarmTask.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebFarmTask")] -[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] -public class CmsWebFarmTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - public string? TaskTextData { get; set; } - - public byte[]? TaskBinaryData { get; set; } - - public DateTime? TaskCreated { get; set; } - - public string? TaskTarget { get; set; } - - [StringLength(450)] - public string? TaskMachineName { get; set; } - - [Column("TaskGUID")] - public Guid? TaskGuid { get; set; } - - public bool? TaskIsAnonymous { get; set; } - - public string? TaskErrorMessage { get; set; } - - public bool? TaskIsMemory { get; set; } - - [InverseProperty("Task")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsWebPart.cs b/Migration.Toolkit.K11/Models/CmsWebPart.cs deleted file mode 100644 index 27399e74..00000000 --- a/Migration.Toolkit.K11/Models/CmsWebPart.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebPart")] -[Index("WebPartCategoryId", Name = "IX_CMS_WebPart_WebPartCategoryID")] -[Index("WebPartName", Name = "IX_CMS_WebPart_WebPartName")] -[Index("WebPartParentId", Name = "IX_CMS_WebPart_WebPartParentID")] -[Index("WebPartResourceId", Name = "IX_CMS_WebPart_WebPartResourceID")] -public class CmsWebPart -{ - [Key] - [Column("WebPartID")] - public int WebPartId { get; set; } - - [StringLength(100)] - public string WebPartName { get; set; } = null!; - - [StringLength(100)] - public string WebPartDisplayName { get; set; } = null!; - - public string? WebPartDescription { get; set; } - - [StringLength(100)] - public string WebPartFileName { get; set; } = null!; - - public string WebPartProperties { get; set; } = null!; - - [Column("WebPartCategoryID")] - public int WebPartCategoryId { get; set; } - - [Column("WebPartParentID")] - public int? WebPartParentId { get; set; } - - public string? WebPartDocumentation { get; set; } - - [Column("WebPartGUID")] - public Guid WebPartGuid { get; set; } - - public DateTime WebPartLastModified { get; set; } - - public int? WebPartType { get; set; } - - public string? WebPartDefaultValues { get; set; } - - [Column("WebPartResourceID")] - public int? WebPartResourceId { get; set; } - - [Column("WebPartCSS")] - public string? WebPartCss { get; set; } - - public bool? WebPartSkipInsertProperties { get; set; } - - [Column("WebPartThumbnailGUID")] - public Guid? WebPartThumbnailGuid { get; set; } - - public string? WebPartDefaultConfiguration { get; set; } - - [StringLength(200)] - public string? WebPartIconClass { get; set; } - - [InverseProperty("WebPartLayoutWebPart")] - public virtual ICollection CmsWebPartLayouts { get; set; } = new List(); - - [InverseProperty("WidgetWebPart")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [InverseProperty("WebPartParent")] - public virtual ICollection InverseWebPartParent { get; set; } = new List(); - - [ForeignKey("WebPartCategoryId")] - [InverseProperty("CmsWebParts")] - public virtual CmsWebPartCategory WebPartCategory { get; set; } = null!; - - [ForeignKey("WebPartParentId")] - [InverseProperty("InverseWebPartParent")] - public virtual CmsWebPart? WebPartParent { get; set; } - - [ForeignKey("WebPartResourceId")] - [InverseProperty("CmsWebParts")] - public virtual CmsResource? WebPartResource { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsWebPartCategory.cs b/Migration.Toolkit.K11/Models/CmsWebPartCategory.cs deleted file mode 100644 index f4e590d0..00000000 --- a/Migration.Toolkit.K11/Models/CmsWebPartCategory.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebPartCategory")] -[Index("CategoryParentId", Name = "IX_CMS_WebPartCategory_CategoryParentID")] -public class CmsWebPartCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(100)] - public string CategoryDisplayName { get; set; } = null!; - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(100)] - public string CategoryName { get; set; } = null!; - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public string CategoryPath { get; set; } = null!; - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryWebPartChildCount { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsWebPartCategory? CategoryParent { get; set; } - - [InverseProperty("WebPartCategory")] - public virtual ICollection CmsWebParts { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsWebPartContainer.cs b/Migration.Toolkit.K11/Models/CmsWebPartContainer.cs deleted file mode 100644 index cf7d95eb..00000000 --- a/Migration.Toolkit.K11/Models/CmsWebPartContainer.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebPartContainer")] -[Index("ContainerName", Name = "IX_CMS_WebPartContainer_ContainerName")] -public class CmsWebPartContainer -{ - [Key] - [Column("ContainerID")] - public int ContainerId { get; set; } - - [StringLength(200)] - public string ContainerDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ContainerName { get; set; } = null!; - - public string? ContainerTextBefore { get; set; } - - public string? ContainerTextAfter { get; set; } - - [Column("ContainerGUID")] - public Guid ContainerGuid { get; set; } - - public DateTime ContainerLastModified { get; set; } - - [Column("ContainerCSS")] - public string? ContainerCss { get; set; } - - [ForeignKey("ContainerId")] - [InverseProperty("Containers")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsWebPartLayout.cs b/Migration.Toolkit.K11/Models/CmsWebPartLayout.cs deleted file mode 100644 index a88bb1e6..00000000 --- a/Migration.Toolkit.K11/Models/CmsWebPartLayout.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebPartLayout")] -[Index("WebPartLayoutWebPartId", Name = "IX_CMS_WebPartLayout_WebPartLayoutWebPartID")] -public class CmsWebPartLayout -{ - [Key] - [Column("WebPartLayoutID")] - public int WebPartLayoutId { get; set; } - - [StringLength(200)] - public string WebPartLayoutCodeName { get; set; } = null!; - - [StringLength(200)] - public string WebPartLayoutDisplayName { get; set; } = null!; - - public string? WebPartLayoutDescription { get; set; } - - public string? WebPartLayoutCode { get; set; } - - [Column("WebPartLayoutVersionGUID")] - [StringLength(100)] - public string? WebPartLayoutVersionGuid { get; set; } - - [Column("WebPartLayoutWebPartID")] - public int WebPartLayoutWebPartId { get; set; } - - [Column("WebPartLayoutGUID")] - public Guid WebPartLayoutGuid { get; set; } - - public DateTime WebPartLayoutLastModified { get; set; } - - [Column("WebPartLayoutCSS")] - public string? WebPartLayoutCss { get; set; } - - public bool? WebPartLayoutIsDefault { get; set; } - - [InverseProperty("WidgetLayout")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [ForeignKey("WebPartLayoutWebPartId")] - [InverseProperty("CmsWebPartLayouts")] - public virtual CmsWebPart WebPartLayoutWebPart { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsWebTemplate.cs b/Migration.Toolkit.K11/Models/CmsWebTemplate.cs deleted file mode 100644 index 4a057695..00000000 --- a/Migration.Toolkit.K11/Models/CmsWebTemplate.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebTemplate")] -public class CmsWebTemplate -{ - [Key] - [Column("WebTemplateID")] - public int WebTemplateId { get; set; } - - [StringLength(200)] - public string WebTemplateDisplayName { get; set; } = null!; - - [StringLength(100)] - public string WebTemplateFileName { get; set; } = null!; - - public string WebTemplateDescription { get; set; } = null!; - - [Column("WebTemplateGUID")] - public Guid WebTemplateGuid { get; set; } - - public DateTime WebTemplateLastModified { get; set; } - - [StringLength(100)] - public string WebTemplateName { get; set; } = null!; - - public int WebTemplateOrder { get; set; } - - [StringLength(200)] - public string WebTemplateLicenses { get; set; } = null!; - - [Column("WebTemplateThumbnailGUID")] - public Guid? WebTemplateThumbnailGuid { get; set; } - - public string? WebTemplateShortDescription { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsWidget.cs b/Migration.Toolkit.K11/Models/CmsWidget.cs deleted file mode 100644 index eabc6e03..00000000 --- a/Migration.Toolkit.K11/Models/CmsWidget.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Widget")] -[Index("WidgetCategoryId", Name = "IX_CMS_Widget_WidgetCategoryID")] -[Index("WidgetIsEnabled", "WidgetForGroup", "WidgetForEditor", "WidgetForUser", Name = "IX_CMS_Widget_WidgetIsEnabled_WidgetForGroup_WidgetForEditor_WidgetForUser")] -[Index("WidgetLayoutId", Name = "IX_CMS_Widget_WidgetLayoutID")] -[Index("WidgetWebPartId", Name = "IX_CMS_Widget_WidgetWebPartID")] -public class CmsWidget -{ - [Key] - [Column("WidgetID")] - public int WidgetId { get; set; } - - [Column("WidgetWebPartID")] - public int WidgetWebPartId { get; set; } - - [StringLength(100)] - public string WidgetDisplayName { get; set; } = null!; - - [StringLength(100)] - public string WidgetName { get; set; } = null!; - - public string? WidgetDescription { get; set; } - - [Column("WidgetCategoryID")] - public int WidgetCategoryId { get; set; } - - public string? WidgetProperties { get; set; } - - public int WidgetSecurity { get; set; } - - [Column("WidgetGUID")] - public Guid WidgetGuid { get; set; } - - public DateTime WidgetLastModified { get; set; } - - public bool WidgetIsEnabled { get; set; } - - public bool WidgetForGroup { get; set; } - - public bool WidgetForEditor { get; set; } - - public bool WidgetForUser { get; set; } - - public bool WidgetForDashboard { get; set; } - - public bool WidgetForInline { get; set; } - - public string? WidgetDocumentation { get; set; } - - public string? WidgetDefaultValues { get; set; } - - [Column("WidgetLayoutID")] - public int? WidgetLayoutId { get; set; } - - public bool? WidgetSkipInsertProperties { get; set; } - - [Column("WidgetThumbnailGUID")] - public Guid? WidgetThumbnailGuid { get; set; } - - [StringLength(200)] - public string? WidgetIconClass { get; set; } - - [InverseProperty("Widget")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [ForeignKey("WidgetCategoryId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWidgetCategory WidgetCategory { get; set; } = null!; - - [ForeignKey("WidgetLayoutId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWebPartLayout? WidgetLayout { get; set; } - - [ForeignKey("WidgetWebPartId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWebPart WidgetWebPart { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsWidgetCategory.cs b/Migration.Toolkit.K11/Models/CmsWidgetCategory.cs deleted file mode 100644 index c986262e..00000000 --- a/Migration.Toolkit.K11/Models/CmsWidgetCategory.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WidgetCategory")] -[Index("WidgetCategoryParentId", Name = "IX_CMS_WidgetCategory_WidgetCategoryParentID")] -public class CmsWidgetCategory -{ - [Key] - [Column("WidgetCategoryID")] - public int WidgetCategoryId { get; set; } - - [StringLength(100)] - public string WidgetCategoryName { get; set; } = null!; - - [StringLength(100)] - public string WidgetCategoryDisplayName { get; set; } = null!; - - [Column("WidgetCategoryParentID")] - public int? WidgetCategoryParentId { get; set; } - - public string WidgetCategoryPath { get; set; } = null!; - - public int WidgetCategoryLevel { get; set; } - - public int? WidgetCategoryChildCount { get; set; } - - public int? WidgetCategoryWidgetChildCount { get; set; } - - [StringLength(450)] - public string? WidgetCategoryImagePath { get; set; } - - [Column("WidgetCategoryGUID")] - public Guid WidgetCategoryGuid { get; set; } - - public DateTime WidgetCategoryLastModified { get; set; } - - [InverseProperty("WidgetCategory")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [InverseProperty("WidgetCategoryParent")] - public virtual ICollection InverseWidgetCategoryParent { get; set; } = new List(); - - [ForeignKey("WidgetCategoryParentId")] - [InverseProperty("InverseWidgetCategoryParent")] - public virtual CmsWidgetCategory? WidgetCategoryParent { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/CmsWidgetRole.cs b/Migration.Toolkit.K11/Models/CmsWidgetRole.cs deleted file mode 100644 index 4f49f70b..00000000 --- a/Migration.Toolkit.K11/Models/CmsWidgetRole.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("WidgetId", "RoleId", "PermissionId")] -[Table("CMS_WidgetRole")] -[Index("PermissionId", Name = "IX_CMS_WidgetRole_PermissionID")] -[Index("RoleId", Name = "IX_CMS_WidgetRole_RoleID")] -public class CmsWidgetRole -{ - [Key] - [Column("WidgetID")] - public int WidgetId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("PermissionId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("WidgetId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsWidget Widget { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflow.cs b/Migration.Toolkit.K11/Models/CmsWorkflow.cs deleted file mode 100644 index 2652ebf3..00000000 --- a/Migration.Toolkit.K11/Models/CmsWorkflow.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Workflow")] -public class CmsWorkflow -{ - [Key] - [Column("WorkflowID")] - public int WorkflowId { get; set; } - - public string WorkflowDisplayName { get; set; } = null!; - - [StringLength(450)] - public string WorkflowName { get; set; } = null!; - - [Column("WorkflowGUID")] - public Guid WorkflowGuid { get; set; } - - public DateTime WorkflowLastModified { get; set; } - - public bool? WorkflowAutoPublishChanges { get; set; } - - public bool? WorkflowUseCheckinCheckout { get; set; } - - public int? WorkflowType { get; set; } - - public bool? WorkflowSendEmails { get; set; } - - public bool? WorkflowSendApproveEmails { get; set; } - - public bool? WorkflowSendRejectEmails { get; set; } - - public bool? WorkflowSendPublishEmails { get; set; } - - public bool? WorkflowSendArchiveEmails { get; set; } - - [StringLength(200)] - public string? WorkflowApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowPublishedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowArchivedTemplateName { get; set; } - - public bool? WorkflowSendReadyForApprovalEmails { get; set; } - - [StringLength(200)] - public string? WorkflowReadyForApprovalTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowNotificationTemplateName { get; set; } - - public string? WorkflowAllowedObjects { get; set; } - - public int? WorkflowRecurrenceType { get; set; } - - [Required] - public bool? WorkflowEnabled { get; set; } - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateWorkflow")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("TriggerWorkflow")] - public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); - - [InverseProperty("VersionWorkflow")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [InverseProperty("ScopeWorkflow")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [InverseProperty("StepWorkflow")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); - - [InverseProperty("TransitionWorkflow")] - public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); - - [ForeignKey("WorkflowId")] - [InverseProperty("Workflows")] - public virtual ICollection Users { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowAction.cs b/Migration.Toolkit.K11/Models/CmsWorkflowAction.cs deleted file mode 100644 index 89a981ff..00000000 --- a/Migration.Toolkit.K11/Models/CmsWorkflowAction.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowAction")] -[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] -public class CmsWorkflowAction -{ - [Key] - [Column("ActionID")] - public int ActionId { get; set; } - - [StringLength(200)] - public string ActionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ActionName { get; set; } = null!; - - public string? ActionParameters { get; set; } - - public string? ActionDescription { get; set; } - - [StringLength(200)] - public string ActionAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string ActionClass { get; set; } = null!; - - [Column("ActionResourceID")] - public int? ActionResourceId { get; set; } - - [Column("ActionThumbnailGUID")] - public Guid? ActionThumbnailGuid { get; set; } - - [Column("ActionGUID")] - public Guid ActionGuid { get; set; } - - public DateTime ActionLastModified { get; set; } - - [Required] - public bool? ActionEnabled { get; set; } - - public string? ActionAllowedObjects { get; set; } - - [Column("ActionIconGUID")] - public Guid? ActionIconGuid { get; set; } - - public int? ActionWorkflowType { get; set; } - - [StringLength(200)] - public string? ActionIconClass { get; set; } - - [StringLength(200)] - public string? ActionThumbnailClass { get; set; } - - [ForeignKey("ActionResourceId")] - [InverseProperty("CmsWorkflowActions")] - public virtual CmsResource? ActionResource { get; set; } - - [InverseProperty("StepAction")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowHistory.cs b/Migration.Toolkit.K11/Models/CmsWorkflowHistory.cs deleted file mode 100644 index d1a7d7d5..00000000 --- a/Migration.Toolkit.K11/Models/CmsWorkflowHistory.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowHistory")] -[Index("ApprovedByUserId", Name = "IX_CMS_WorkflowHistory_ApprovedByUserID")] -[Index("ApprovedWhen", Name = "IX_CMS_WorkflowHistory_ApprovedWhen")] -[Index("HistoryWorkflowId", Name = "IX_CMS_WorkflowHistory_HistoryWorkflowID")] -[Index("StepId", Name = "IX_CMS_WorkflowHistory_StepID")] -[Index("TargetStepId", Name = "IX_CMS_WorkflowHistory_TargetStepID")] -[Index("VersionHistoryId", Name = "IX_CMS_WorkflowHistory_VersionHistoryID")] -public class CmsWorkflowHistory -{ - [Key] - [Column("WorkflowHistoryID")] - public int WorkflowHistoryId { get; set; } - - [Column("VersionHistoryID")] - public int VersionHistoryId { get; set; } - - [Column("StepID")] - public int? StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [Column("ApprovedByUserID")] - public int? ApprovedByUserId { get; set; } - - public DateTime? ApprovedWhen { get; set; } - - public string? Comment { get; set; } - - public bool WasRejected { get; set; } - - [StringLength(440)] - public string? StepName { get; set; } - - [Column("TargetStepID")] - public int? TargetStepId { get; set; } - - [StringLength(440)] - public string? TargetStepName { get; set; } - - [StringLength(450)] - public string? TargetStepDisplayName { get; set; } - - public int? StepType { get; set; } - - public int? TargetStepType { get; set; } - - [StringLength(100)] - public string? HistoryObjectType { get; set; } - - [Column("HistoryObjectID")] - public int? HistoryObjectId { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int? HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - [ForeignKey("ApprovedByUserId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsUser? ApprovedByUser { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsWorkflow? HistoryWorkflow { get; set; } - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowHistorySteps")] - public virtual CmsWorkflowStep? Step { get; set; } - - [ForeignKey("TargetStepId")] - [InverseProperty("CmsWorkflowHistoryTargetSteps")] - public virtual CmsWorkflowStep? TargetStep { get; set; } - - [ForeignKey("VersionHistoryId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsVersionHistory VersionHistory { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowScope.cs b/Migration.Toolkit.K11/Models/CmsWorkflowScope.cs deleted file mode 100644 index fc3bbb80..00000000 --- a/Migration.Toolkit.K11/Models/CmsWorkflowScope.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowScope")] -[Index("ScopeClassId", Name = "IX_CMS_WorkflowScope_ScopeClassID")] -[Index("ScopeCultureId", Name = "IX_CMS_WorkflowScope_ScopeCultureID")] -[Index("ScopeSiteId", Name = "IX_CMS_WorkflowScope_ScopeSiteID")] -[Index("ScopeWorkflowId", Name = "IX_CMS_WorkflowScope_ScopeWorkflowID")] -public class CmsWorkflowScope -{ - [Key] - [Column("ScopeID")] - public int ScopeId { get; set; } - - public string ScopeStartingPath { get; set; } = null!; - - [Column("ScopeWorkflowID")] - public int ScopeWorkflowId { get; set; } - - [Column("ScopeClassID")] - public int? ScopeClassId { get; set; } - - [Column("ScopeSiteID")] - public int ScopeSiteId { get; set; } - - [Column("ScopeGUID")] - public Guid ScopeGuid { get; set; } - - public DateTime ScopeLastModified { get; set; } - - [Column("ScopeCultureID")] - public int? ScopeCultureId { get; set; } - - public bool? ScopeExcludeChildren { get; set; } - - public bool ScopeExcluded { get; set; } - - public string? ScopeMacroCondition { get; set; } - - [ForeignKey("ScopeClassId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsClass? ScopeClass { get; set; } - - [ForeignKey("ScopeCultureId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsCulture? ScopeCulture { get; set; } - - [ForeignKey("ScopeSiteId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsSite ScopeSite { get; set; } = null!; - - [ForeignKey("ScopeWorkflowId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsWorkflow ScopeWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowStep.cs b/Migration.Toolkit.K11/Models/CmsWorkflowStep.cs deleted file mode 100644 index 9343f711..00000000 --- a/Migration.Toolkit.K11/Models/CmsWorkflowStep.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowStep")] -[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] -[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] -[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] -[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] -public class CmsWorkflowStep -{ - [Key] - [Column("StepID")] - public int StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [StringLength(440)] - public string? StepName { get; set; } - - public int? StepOrder { get; set; } - - [Column("StepWorkflowID")] - public int StepWorkflowId { get; set; } - - [Column("StepGUID")] - public Guid StepGuid { get; set; } - - public DateTime StepLastModified { get; set; } - - public int? StepType { get; set; } - - public bool? StepAllowReject { get; set; } - - public string? StepDefinition { get; set; } - - public int? StepRolesSecurity { get; set; } - - public int? StepUsersSecurity { get; set; } - - [StringLength(200)] - public string? StepApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? StepRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? StepReadyforApprovalTemplateName { get; set; } - - public bool? StepSendApproveEmails { get; set; } - - public bool? StepSendRejectEmails { get; set; } - - public bool? StepSendReadyForApprovalEmails { get; set; } - - public bool? StepSendEmails { get; set; } - - public bool? StepAllowPublish { get; set; } - - [Column("StepActionID")] - public int? StepActionId { get; set; } - - public string? StepActionParameters { get; set; } - - public int? StepWorkflowType { get; set; } - - [InverseProperty("HistoryStep")] - public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); - - [InverseProperty("HistoryTargetStep")] - public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("StateStep")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("DocumentWorkflowStep")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("ObjectWorkflowStep")] - public virtual ICollection CmsObjectSettings { get; set; } = new List(); - - [InverseProperty("VersionWorkflowStep")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowHistorySteps { get; set; } = new List(); - - [InverseProperty("TargetStep")] - public virtual ICollection CmsWorkflowHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); - - [InverseProperty("TransitionEndStep")] - public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); - - [InverseProperty("TransitionStartStep")] - public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); - - [ForeignKey("StepActionId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflowAction? StepAction { get; set; } - - [ForeignKey("StepWorkflowId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflow StepWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowStepRole.cs b/Migration.Toolkit.K11/Models/CmsWorkflowStepRole.cs deleted file mode 100644 index aa321eff..00000000 --- a/Migration.Toolkit.K11/Models/CmsWorkflowStepRole.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowStepRoles")] -[Index("RoleId", Name = "IX_CMS_WorkflowStepRoles_RoleID")] -public class CmsWorkflowStepRole -{ - [Key] - [Column("WorkflowStepRoleID")] - public int WorkflowStepRoleId { get; set; } - - [Column("StepID")] - public int StepId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [Column("StepSourcePointGUID")] - public Guid? StepSourcePointGuid { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsWorkflowStepRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowStepRoles")] - public virtual CmsWorkflowStep Step { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowStepUser.cs b/Migration.Toolkit.K11/Models/CmsWorkflowStepUser.cs deleted file mode 100644 index fd19d9c7..00000000 --- a/Migration.Toolkit.K11/Models/CmsWorkflowStepUser.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowStepUser")] -[Index("UserId", Name = "IX_CMS_WorkflowStepUser_UserID")] -public class CmsWorkflowStepUser -{ - [Key] - [Column("WorkflowStepUserID")] - public int WorkflowStepUserId { get; set; } - - [Column("StepID")] - public int StepId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("StepSourcePointGUID")] - public Guid? StepSourcePointGuid { get; set; } - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowStepUsers")] - public virtual CmsWorkflowStep Step { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsWorkflowStepUsers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowTransition.cs b/Migration.Toolkit.K11/Models/CmsWorkflowTransition.cs deleted file mode 100644 index 59c0f4ad..00000000 --- a/Migration.Toolkit.K11/Models/CmsWorkflowTransition.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowTransition")] -[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] -[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] -[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] -public class CmsWorkflowTransition -{ - [Key] - [Column("TransitionID")] - public int TransitionId { get; set; } - - [Column("TransitionStartStepID")] - public int TransitionStartStepId { get; set; } - - [Column("TransitionEndStepID")] - public int TransitionEndStepId { get; set; } - - public int TransitionType { get; set; } - - public DateTime TransitionLastModified { get; set; } - - [Column("TransitionSourcePointGUID")] - public Guid? TransitionSourcePointGuid { get; set; } - - [Column("TransitionWorkflowID")] - public int TransitionWorkflowId { get; set; } - - [ForeignKey("TransitionEndStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] - public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; - - [ForeignKey("TransitionStartStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] - public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; - - [ForeignKey("TransitionWorkflowId")] - [InverseProperty("CmsWorkflowTransitions")] - public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComAddress.cs b/Migration.Toolkit.K11/Models/ComAddress.cs deleted file mode 100644 index ae47cbaa..00000000 --- a/Migration.Toolkit.K11/Models/ComAddress.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Address")] -[Index("AddressCountryId", Name = "IX_COM_Address_AddressCountryID")] -[Index("AddressCustomerId", Name = "IX_COM_Address_AddressCustomerID")] -[Index("AddressStateId", Name = "IX_COM_Address_AddressStateID")] -public class ComAddress -{ - [Key] - [Column("AddressID")] - public int AddressId { get; set; } - - [StringLength(200)] - public string AddressName { get; set; } = null!; - - [StringLength(100)] - public string AddressLine1 { get; set; } = null!; - - [StringLength(100)] - public string? AddressLine2 { get; set; } - - [StringLength(100)] - public string AddressCity { get; set; } = null!; - - [StringLength(20)] - public string AddressZip { get; set; } = null!; - - [StringLength(26)] - public string? AddressPhone { get; set; } - - [Column("AddressCustomerID")] - public int AddressCustomerId { get; set; } - - [Column("AddressCountryID")] - public int AddressCountryId { get; set; } - - [Column("AddressStateID")] - public int? AddressStateId { get; set; } - - [StringLength(200)] - public string AddressPersonalName { get; set; } = null!; - - [Column("AddressGUID")] - public Guid? AddressGuid { get; set; } - - public DateTime AddressLastModified { get; set; } - - [ForeignKey("AddressCountryId")] - [InverseProperty("ComAddresses")] - public virtual CmsCountry AddressCountry { get; set; } = null!; - - [ForeignKey("AddressCustomerId")] - [InverseProperty("ComAddresses")] - public virtual ComCustomer AddressCustomer { get; set; } = null!; - - [ForeignKey("AddressStateId")] - [InverseProperty("ComAddresses")] - public virtual CmsState? AddressState { get; set; } - - [InverseProperty("ShoppingCartBillingAddress")] - public virtual ICollection ComShoppingCartShoppingCartBillingAddresses { get; set; } = new List(); - - [InverseProperty("ShoppingCartCompanyAddress")] - public virtual ICollection ComShoppingCartShoppingCartCompanyAddresses { get; set; } = new List(); - - [InverseProperty("ShoppingCartShippingAddress")] - public virtual ICollection ComShoppingCartShoppingCartShippingAddresses { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ComBrand.cs b/Migration.Toolkit.K11/Models/ComBrand.cs deleted file mode 100644 index dec3548c..00000000 --- a/Migration.Toolkit.K11/Models/ComBrand.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Brand")] -[Index("BrandDisplayName", Name = "IX_COM_Brand_BrandDisplayName")] -[Index("BrandSiteId", "BrandEnabled", Name = "IX_COM_Brand_BrandSiteID_BrandEnabled")] -public class ComBrand -{ - [Key] - [Column("BrandID")] - public int BrandId { get; set; } - - [StringLength(200)] - public string BrandDisplayName { get; set; } = null!; - - [StringLength(200)] - public string BrandName { get; set; } = null!; - - public string? BrandDescription { get; set; } - - [StringLength(400)] - public string? BrandHomepage { get; set; } - - [Column("BrandThumbnailGUID")] - public Guid? BrandThumbnailGuid { get; set; } - - [Column("BrandSiteID")] - public int BrandSiteId { get; set; } - - [Required] - public bool? BrandEnabled { get; set; } - - public Guid BrandGuid { get; set; } - - public DateTime BrandLastModified { get; set; } - - [ForeignKey("BrandSiteId")] - [InverseProperty("ComBrands")] - public virtual CmsSite BrandSite { get; set; } = null!; - - [InverseProperty("Brand")] - public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); - - [InverseProperty("Skubrand")] - public virtual ICollection ComSkus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ComCarrier.cs b/Migration.Toolkit.K11/Models/ComCarrier.cs deleted file mode 100644 index 16eb5fa1..00000000 --- a/Migration.Toolkit.K11/Models/ComCarrier.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Carrier")] -[Index("CarrierSiteId", Name = "IX_COM_Carrier_CarrierSiteID")] -public class ComCarrier -{ - [Key] - [Column("CarrierID")] - public int CarrierId { get; set; } - - [StringLength(200)] - public string CarrierDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CarrierName { get; set; } = null!; - - [Column("CarrierSiteID")] - public int CarrierSiteId { get; set; } - - [Column("CarrierGUID")] - public Guid CarrierGuid { get; set; } - - [StringLength(200)] - public string CarrierAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string CarrierClassName { get; set; } = null!; - - public DateTime CarrierLastModified { get; set; } - - [ForeignKey("CarrierSiteId")] - [InverseProperty("ComCarriers")] - public virtual CmsSite CarrierSite { get; set; } = null!; - - [InverseProperty("ShippingOptionCarrier")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ComCollection.cs b/Migration.Toolkit.K11/Models/ComCollection.cs deleted file mode 100644 index c0164a89..00000000 --- a/Migration.Toolkit.K11/Models/ComCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Collection")] -[Index("CollectionDisplayName", Name = "IX_COM_Collection_CollectionDisplayName")] -[Index("CollectionSiteId", "CollectionEnabled", Name = "IX_COM_Collection_CollectionSiteID_CollectionEnabled")] -public class ComCollection -{ - [Key] - [Column("CollectionID")] - public int CollectionId { get; set; } - - [StringLength(200)] - public string CollectionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CollectionName { get; set; } = null!; - - public string? CollectionDescription { get; set; } - - [Column("CollectionSiteID")] - public int CollectionSiteId { get; set; } - - [Required] - public bool? CollectionEnabled { get; set; } - - public Guid CollectionGuid { get; set; } - - public DateTime CollectionLastModified { get; set; } - - [ForeignKey("CollectionSiteId")] - [InverseProperty("ComCollections")] - public virtual CmsSite CollectionSite { get; set; } = null!; - - [InverseProperty("Collection")] - public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); - - [InverseProperty("Skucollection")] - public virtual ICollection ComSkus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ComCouponCode.cs b/Migration.Toolkit.K11/Models/ComCouponCode.cs deleted file mode 100644 index 7909ba15..00000000 --- a/Migration.Toolkit.K11/Models/ComCouponCode.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_CouponCode")] -[Index("CouponCodeDiscountId", Name = "IX_COM_CouponCode_CouponCodeDiscountID")] -public class ComCouponCode -{ - [Key] - [Column("CouponCodeID")] - public int CouponCodeId { get; set; } - - [StringLength(200)] - public string CouponCodeCode { get; set; } = null!; - - public int? CouponCodeUseCount { get; set; } - - public int? CouponCodeUseLimit { get; set; } - - [Column("CouponCodeDiscountID")] - public int CouponCodeDiscountId { get; set; } - - public DateTime CouponCodeLastModified { get; set; } - - [Column("CouponCodeGUID")] - public Guid CouponCodeGuid { get; set; } - - [ForeignKey("CouponCodeDiscountId")] - [InverseProperty("ComCouponCodes")] - public virtual ComDiscount CouponCodeDiscount { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComCurrency.cs b/Migration.Toolkit.K11/Models/ComCurrency.cs deleted file mode 100644 index e0aa22c3..00000000 --- a/Migration.Toolkit.K11/Models/ComCurrency.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Currency")] -[Index("CurrencyDisplayName", Name = "IX_COM_Currency_CurrencyDisplayName")] -[Index("CurrencySiteId", Name = "IX_COM_Currency_CurrencySiteID")] -public class ComCurrency -{ - [Key] - [Column("CurrencyID")] - public int CurrencyId { get; set; } - - [StringLength(200)] - public string CurrencyName { get; set; } = null!; - - [StringLength(200)] - public string CurrencyDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CurrencyCode { get; set; } = null!; - - public int? CurrencyRoundTo { get; set; } - - public bool CurrencyEnabled { get; set; } - - [StringLength(200)] - public string CurrencyFormatString { get; set; } = null!; - - public bool CurrencyIsMain { get; set; } - - [Column("CurrencyGUID")] - public Guid? CurrencyGuid { get; set; } - - public DateTime CurrencyLastModified { get; set; } - - [Column("CurrencySiteID")] - public int? CurrencySiteId { get; set; } - - [InverseProperty("ExchangeRateToCurrency")] - public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); - - [InverseProperty("OrderCurrency")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartCurrency")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("CurrencySiteId")] - [InverseProperty("ComCurrencies")] - public virtual CmsSite? CurrencySite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComCurrencyExchangeRate.cs b/Migration.Toolkit.K11/Models/ComCurrencyExchangeRate.cs deleted file mode 100644 index 4fb4ba30..00000000 --- a/Migration.Toolkit.K11/Models/ComCurrencyExchangeRate.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_CurrencyExchangeRate")] -[Index("ExchangeRateToCurrencyId", Name = "IX_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID")] -[Index("ExchangeTableId", Name = "IX_COM_CurrencyExchangeRate_ExchangeTableID")] -public class ComCurrencyExchangeRate -{ - [Key] - [Column("ExchagneRateID")] - public int ExchagneRateId { get; set; } - - [Column("ExchangeRateToCurrencyID")] - public int ExchangeRateToCurrencyId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal ExchangeRateValue { get; set; } - - [Column("ExchangeTableID")] - public int ExchangeTableId { get; set; } - - [Column("ExchangeRateGUID")] - public Guid ExchangeRateGuid { get; set; } - - public DateTime ExchangeRateLastModified { get; set; } - - [ForeignKey("ExchangeRateToCurrencyId")] - [InverseProperty("ComCurrencyExchangeRates")] - public virtual ComCurrency ExchangeRateToCurrency { get; set; } = null!; - - [ForeignKey("ExchangeTableId")] - [InverseProperty("ComCurrencyExchangeRates")] - public virtual ComExchangeTable ExchangeTable { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComCustomer.cs b/Migration.Toolkit.K11/Models/ComCustomer.cs deleted file mode 100644 index 3ca9d456..00000000 --- a/Migration.Toolkit.K11/Models/ComCustomer.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Customer")] -[Index("CustomerEmail", Name = "IX_COM_Customer_CustomerEmail")] -[Index("CustomerFirstName", Name = "IX_COM_Customer_CustomerFirstName")] -[Index("CustomerLastName", Name = "IX_COM_Customer_CustomerLastName")] -[Index("CustomerSiteId", Name = "IX_COM_Customer_CustomerSiteID")] -[Index("CustomerUserId", Name = "IX_COM_Customer_CustomerUserID")] -public class ComCustomer -{ - [Key] - [Column("CustomerID")] - public int CustomerId { get; set; } - - [StringLength(200)] - public string CustomerFirstName { get; set; } = null!; - - [StringLength(200)] - public string CustomerLastName { get; set; } = null!; - - [StringLength(254)] - public string? CustomerEmail { get; set; } - - [StringLength(26)] - public string? CustomerPhone { get; set; } - - [StringLength(50)] - public string? CustomerFax { get; set; } - - [StringLength(200)] - public string? CustomerCompany { get; set; } - - [Column("CustomerUserID")] - public int? CustomerUserId { get; set; } - - [Column("CustomerGUID")] - public Guid CustomerGuid { get; set; } - - [Column("CustomerTaxRegistrationID")] - [StringLength(50)] - public string? CustomerTaxRegistrationId { get; set; } - - [Column("CustomerOrganizationID")] - [StringLength(50)] - public string? CustomerOrganizationId { get; set; } - - public DateTime CustomerLastModified { get; set; } - - [Column("CustomerSiteID")] - public int? CustomerSiteId { get; set; } - - public DateTime? CustomerCreated { get; set; } - - [InverseProperty("AddressCustomer")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("EventCustomer")] - public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); - - [InverseProperty("OrderCustomer")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartCustomer")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("CustomerSiteId")] - [InverseProperty("ComCustomers")] - public virtual CmsSite? CustomerSite { get; set; } - - [ForeignKey("CustomerUserId")] - [InverseProperty("ComCustomers")] - public virtual CmsUser? CustomerUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComCustomerCreditHistory.cs b/Migration.Toolkit.K11/Models/ComCustomerCreditHistory.cs deleted file mode 100644 index 7327cf07..00000000 --- a/Migration.Toolkit.K11/Models/ComCustomerCreditHistory.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_CustomerCreditHistory")] -[Index("EventCustomerId", "EventDate", Name = "IX_COM_CustomerCreditHistory_EventCustomerID_EventDate", IsDescending = new[] { false, true })] -[Index("EventSiteId", Name = "IX_COM_CustomerCreditHistory_EventSiteID")] -public class ComCustomerCreditHistory -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(200)] - public string EventName { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal EventCreditChange { get; set; } - - public DateTime EventDate { get; set; } - - public string? EventDescription { get; set; } - - [Column("EventCustomerID")] - public int EventCustomerId { get; set; } - - [Column("EventCreditGUID")] - public Guid? EventCreditGuid { get; set; } - - public DateTime EventCreditLastModified { get; set; } - - [Column("EventSiteID")] - public int? EventSiteId { get; set; } - - [ForeignKey("EventCustomerId")] - [InverseProperty("ComCustomerCreditHistories")] - public virtual ComCustomer EventCustomer { get; set; } = null!; - - [ForeignKey("EventSiteId")] - [InverseProperty("ComCustomerCreditHistories")] - public virtual CmsSite? EventSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComDepartment.cs b/Migration.Toolkit.K11/Models/ComDepartment.cs deleted file mode 100644 index 164eaea9..00000000 --- a/Migration.Toolkit.K11/Models/ComDepartment.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Department")] -[Index("DepartmentDefaultTaxClassId", Name = "IX_COM_Department_DepartmentDefaultTaxClassID")] -[Index("DepartmentSiteId", Name = "IX_COM_Department_DepartmentSiteID")] -public class ComDepartment -{ - [Key] - [Column("DepartmentID")] - public int DepartmentId { get; set; } - - [StringLength(200)] - public string DepartmentName { get; set; } = null!; - - [StringLength(200)] - public string DepartmentDisplayName { get; set; } = null!; - - [Column("DepartmentDefaultTaxClassID")] - public int? DepartmentDefaultTaxClassId { get; set; } - - [Column("DepartmentGUID")] - public Guid DepartmentGuid { get; set; } - - public DateTime DepartmentLastModified { get; set; } - - [Column("DepartmentSiteID")] - public int? DepartmentSiteId { get; set; } - - [InverseProperty("Skudepartment")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("DepartmentDefaultTaxClassId")] - [InverseProperty("ComDepartments")] - public virtual ComTaxClass? DepartmentDefaultTaxClass { get; set; } - - [ForeignKey("DepartmentSiteId")] - [InverseProperty("ComDepartments")] - public virtual CmsSite? DepartmentSite { get; set; } - - [ForeignKey("DepartmentId")] - [InverseProperty("Departments")] - public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ComDiscount.cs b/Migration.Toolkit.K11/Models/ComDiscount.cs deleted file mode 100644 index 3a56b090..00000000 --- a/Migration.Toolkit.K11/Models/ComDiscount.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Discount")] -[Index("DiscountSiteId", Name = "IX_COM_Discount_DiscountSiteID")] -public class ComDiscount -{ - [Key] - [Column("DiscountID")] - public int DiscountId { get; set; } - - [StringLength(200)] - public string DiscountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string DiscountName { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal DiscountValue { get; set; } - - [Required] - public bool? DiscountEnabled { get; set; } - - [Column("DiscountGUID")] - public Guid DiscountGuid { get; set; } - - public DateTime DiscountLastModified { get; set; } - - [Column("DiscountSiteID")] - public int DiscountSiteId { get; set; } - - public string? DiscountDescription { get; set; } - - public DateTime? DiscountValidFrom { get; set; } - - public DateTime? DiscountValidTo { get; set; } - - public double DiscountOrder { get; set; } - - public string? DiscountProductCondition { get; set; } - - [StringLength(400)] - public string? DiscountRoles { get; set; } - - [StringLength(200)] - public string? DiscountCustomerRestriction { get; set; } - - public bool DiscountIsFlat { get; set; } - - public string? DiscountCartCondition { get; set; } - - [StringLength(100)] - public string DiscountApplyTo { get; set; } = null!; - - [Required] - public bool? DiscountApplyFurtherDiscounts { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? DiscountOrderAmount { get; set; } - - public bool DiscountUsesCoupons { get; set; } - - [InverseProperty("CouponCodeDiscount")] - public virtual ICollection ComCouponCodes { get; set; } = new List(); - - [ForeignKey("DiscountSiteId")] - [InverseProperty("ComDiscounts")] - public virtual CmsSite DiscountSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComExchangeTable.cs b/Migration.Toolkit.K11/Models/ComExchangeTable.cs deleted file mode 100644 index 71e5687a..00000000 --- a/Migration.Toolkit.K11/Models/ComExchangeTable.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_ExchangeTable")] -[Index("ExchangeTableSiteId", Name = "IX_COM_ExchangeTable_ExchangeTableSiteID")] -public class ComExchangeTable -{ - [Key] - [Column("ExchangeTableID")] - public int ExchangeTableId { get; set; } - - [StringLength(200)] - public string ExchangeTableDisplayName { get; set; } = null!; - - public DateTime? ExchangeTableValidFrom { get; set; } - - public DateTime? ExchangeTableValidTo { get; set; } - - [Column("ExchangeTableGUID")] - public Guid ExchangeTableGuid { get; set; } - - public DateTime ExchangeTableLastModified { get; set; } - - [Column("ExchangeTableSiteID")] - public int? ExchangeTableSiteId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? ExchangeTableRateFromGlobalCurrency { get; set; } - - [InverseProperty("ExchangeTable")] - public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); - - [ForeignKey("ExchangeTableSiteId")] - [InverseProperty("ComExchangeTables")] - public virtual CmsSite? ExchangeTableSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComGiftCard.cs b/Migration.Toolkit.K11/Models/ComGiftCard.cs deleted file mode 100644 index 995e3761..00000000 --- a/Migration.Toolkit.K11/Models/ComGiftCard.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_GiftCard")] -[Index("GiftCardSiteId", Name = "IX_COM_GiftCard_GiftCardSiteID")] -public class ComGiftCard -{ - [Key] - [Column("GiftCardID")] - public int GiftCardId { get; set; } - - public Guid GiftCardGuid { get; set; } - - [StringLength(200)] - public string GiftCardDisplayName { get; set; } = null!; - - [StringLength(200)] - public string GiftCardName { get; set; } = null!; - - public string? GiftCardDescription { get; set; } - - [Required] - public bool? GiftCardEnabled { get; set; } - - public DateTime GiftCardLastModified { get; set; } - - [Column("GiftCardSiteID")] - public int GiftCardSiteId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal GiftCardValue { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? GiftCardMinimumOrderPrice { get; set; } - - public string? GiftCardCartCondition { get; set; } - - public DateTime? GiftCardValidFrom { get; set; } - - public DateTime? GiftCardValidTo { get; set; } - - [StringLength(200)] - public string? GiftCardCustomerRestriction { get; set; } - - [StringLength(400)] - public string? GiftCardRoles { get; set; } - - [InverseProperty("GiftCardCouponCodeGiftCard")] - public virtual ICollection ComGiftCardCouponCodes { get; set; } = new List(); - - [ForeignKey("GiftCardSiteId")] - [InverseProperty("ComGiftCards")] - public virtual CmsSite GiftCardSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComGiftCardCouponCode.cs b/Migration.Toolkit.K11/Models/ComGiftCardCouponCode.cs deleted file mode 100644 index 01c4b5b5..00000000 --- a/Migration.Toolkit.K11/Models/ComGiftCardCouponCode.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_GiftCardCouponCode")] -[Index("GiftCardCouponCodeGiftCardId", Name = "IX_COM_GiftCardCouponCodeGiftCardID")] -public class ComGiftCardCouponCode -{ - [Key] - [Column("GiftCardCouponCodeID")] - public int GiftCardCouponCodeId { get; set; } - - [StringLength(200)] - public string GiftCardCouponCodeCode { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal GiftCardCouponCodeRemainingValue { get; set; } - - [Column("GiftCardCouponCodeGiftCardID")] - public int GiftCardCouponCodeGiftCardId { get; set; } - - public Guid GiftCardCouponCodeGuid { get; set; } - - public DateTime GiftCardCouponCodeLastModified { get; set; } - - [ForeignKey("GiftCardCouponCodeGiftCardId")] - [InverseProperty("ComGiftCardCouponCodes")] - public virtual ComGiftCard GiftCardCouponCodeGiftCard { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComInternalStatus.cs b/Migration.Toolkit.K11/Models/ComInternalStatus.cs deleted file mode 100644 index 70e133d7..00000000 --- a/Migration.Toolkit.K11/Models/ComInternalStatus.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_InternalStatus")] -[Index("InternalStatusSiteId", Name = "IX_COM_InternalStatus_InternalStatusSiteID")] -public class ComInternalStatus -{ - [Key] - [Column("InternalStatusID")] - public int InternalStatusId { get; set; } - - [StringLength(200)] - public string InternalStatusName { get; set; } = null!; - - [StringLength(200)] - public string InternalStatusDisplayName { get; set; } = null!; - - [Required] - public bool? InternalStatusEnabled { get; set; } - - [Column("InternalStatusGUID")] - public Guid InternalStatusGuid { get; set; } - - public DateTime InternalStatusLastModified { get; set; } - - [Column("InternalStatusSiteID")] - public int? InternalStatusSiteId { get; set; } - - [InverseProperty("SkuinternalStatus")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("InternalStatusSiteId")] - [InverseProperty("ComInternalStatuses")] - public virtual CmsSite? InternalStatusSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComManufacturer.cs b/Migration.Toolkit.K11/Models/ComManufacturer.cs deleted file mode 100644 index c5805cc3..00000000 --- a/Migration.Toolkit.K11/Models/ComManufacturer.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Manufacturer")] -[Index("ManufacturerSiteId", Name = "IX_COM_Manufacturer_ManufacturerSiteID")] -public class ComManufacturer -{ - [Key] - [Column("ManufacturerID")] - public int ManufacturerId { get; set; } - - [StringLength(200)] - public string ManufacturerDisplayName { get; set; } = null!; - - [StringLength(400)] - public string? ManufactureHomepage { get; set; } - - [Required] - public bool? ManufacturerEnabled { get; set; } - - [Column("ManufacturerGUID")] - public Guid ManufacturerGuid { get; set; } - - public DateTime ManufacturerLastModified { get; set; } - - [Column("ManufacturerSiteID")] - public int? ManufacturerSiteId { get; set; } - - [Column("ManufacturerThumbnailGUID")] - public Guid? ManufacturerThumbnailGuid { get; set; } - - public string? ManufacturerDescription { get; set; } - - [StringLength(200)] - public string? ManufacturerName { get; set; } - - [InverseProperty("Skumanufacturer")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("ManufacturerSiteId")] - [InverseProperty("ComManufacturers")] - public virtual CmsSite? ManufacturerSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyCouponCode.cs b/Migration.Toolkit.K11/Models/ComMultiBuyCouponCode.cs deleted file mode 100644 index 4a85e6f5..00000000 --- a/Migration.Toolkit.K11/Models/ComMultiBuyCouponCode.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_MultiBuyCouponCode")] -[Index("MultiBuyCouponCodeMultiBuyDiscountId", Name = "IX_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID")] -public class ComMultiBuyCouponCode -{ - [Key] - [Column("MultiBuyCouponCodeID")] - public int MultiBuyCouponCodeId { get; set; } - - [StringLength(200)] - public string MultiBuyCouponCodeCode { get; set; } = null!; - - public int? MultiBuyCouponCodeUseLimit { get; set; } - - public int? MultiBuyCouponCodeUseCount { get; set; } - - [Column("MultiBuyCouponCodeMultiBuyDiscountID")] - public int MultiBuyCouponCodeMultiBuyDiscountId { get; set; } - - public DateTime MultiBuyCouponCodeLastModified { get; set; } - - [Column("MultiBuyCouponCodeGUID")] - public Guid MultiBuyCouponCodeGuid { get; set; } - - [ForeignKey("MultiBuyCouponCodeMultiBuyDiscountId")] - [InverseProperty("ComMultiBuyCouponCodes")] - public virtual ComMultiBuyDiscount MultiBuyCouponCodeMultiBuyDiscount { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyDiscount.cs b/Migration.Toolkit.K11/Models/ComMultiBuyDiscount.cs deleted file mode 100644 index 181b232e..00000000 --- a/Migration.Toolkit.K11/Models/ComMultiBuyDiscount.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_MultiBuyDiscount")] -[Index("MultiBuyDiscountApplyToSkuid", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID")] -[Index("MultiBuyDiscountSiteId", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountSiteID")] -public class ComMultiBuyDiscount -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [StringLength(200)] - public string MultiBuyDiscountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string MultiBuyDiscountName { get; set; } = null!; - - public string? MultiBuyDiscountDescription { get; set; } - - [Required] - public bool? MultiBuyDiscountEnabled { get; set; } - - [Column("MultiBuyDiscountGUID")] - public Guid MultiBuyDiscountGuid { get; set; } - - public DateTime MultiBuyDiscountLastModified { get; set; } - - [Column("MultiBuyDiscountSiteID")] - public int MultiBuyDiscountSiteId { get; set; } - - [Required] - public bool? MultiBuyDiscountApplyFurtherDiscounts { get; set; } - - public int MultiBuyDiscountMinimumBuyCount { get; set; } - - public DateTime? MultiBuyDiscountValidFrom { get; set; } - - public DateTime? MultiBuyDiscountValidTo { get; set; } - - [StringLength(200)] - public string MultiBuyDiscountCustomerRestriction { get; set; } = null!; - - [StringLength(400)] - public string? MultiBuyDiscountRoles { get; set; } - - [Column("MultiBuyDiscountApplyToSKUID")] - public int? MultiBuyDiscountApplyToSkuid { get; set; } - - public int? MultiBuyDiscountLimitPerOrder { get; set; } - - public bool? MultiBuyDiscountUsesCoupons { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? MultiBuyDiscountValue { get; set; } - - public bool? MultiBuyDiscountIsFlat { get; set; } - - [Required] - public bool? MultiBuyDiscountAutoAddEnabled { get; set; } - - public int? MultiBuyDiscountPriority { get; set; } - - public bool MultiBuyDiscountIsProductCoupon { get; set; } - - [InverseProperty("MultiBuyCouponCodeMultiBuyDiscount")] - public virtual ICollection ComMultiBuyCouponCodes { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscount")] - public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); - - [InverseProperty("MultibuyDiscount")] - public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscount")] - public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); - - [ForeignKey("MultiBuyDiscountApplyToSkuid")] - [InverseProperty("ComMultiBuyDiscounts")] - public virtual ComSku? MultiBuyDiscountApplyToSku { get; set; } - - [ForeignKey("MultiBuyDiscountSiteId")] - [InverseProperty("ComMultiBuyDiscounts")] - public virtual CmsSite MultiBuyDiscountSite { get; set; } = null!; - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("MultiBuyDiscounts")] - public virtual ICollection Departments { get; set; } = new List(); - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("MultiBuyDiscounts")] - public virtual ICollection Skus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountBrand.cs b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountBrand.cs deleted file mode 100644 index 97f01ede..00000000 --- a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountBrand.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("MultiBuyDiscountId", "BrandId")] -[Table("COM_MultiBuyDiscountBrand")] -[Index("BrandId", Name = "IX_COM_MultiBuyDiscountBrand_BrandID")] -public class ComMultiBuyDiscountBrand -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [Key] - [Column("BrandID")] - public int BrandId { get; set; } - - [Required] - public bool? BrandIncluded { get; set; } - - [ForeignKey("BrandId")] - [InverseProperty("ComMultiBuyDiscountBrands")] - public virtual ComBrand Brand { get; set; } = null!; - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountBrands")] - public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountCollection.cs b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountCollection.cs deleted file mode 100644 index f1e7fd77..00000000 --- a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountCollection.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("MultibuyDiscountId", "CollectionId")] -[Table("COM_MultiBuyDiscountCollection")] -[Index("CollectionId", Name = "IX_COM_MultiBuyDiscountCollection_CollectionID")] -public class ComMultiBuyDiscountCollection -{ - [Key] - [Column("MultibuyDiscountID")] - public int MultibuyDiscountId { get; set; } - - [Key] - [Column("CollectionID")] - public int CollectionId { get; set; } - - [Required] - public bool? CollectionIncluded { get; set; } - - [ForeignKey("CollectionId")] - [InverseProperty("ComMultiBuyDiscountCollections")] - public virtual ComCollection Collection { get; set; } = null!; - - [ForeignKey("MultibuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountCollections")] - public virtual ComMultiBuyDiscount MultibuyDiscount { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountTree.cs b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountTree.cs deleted file mode 100644 index c9fe8131..00000000 --- a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountTree.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("MultiBuyDiscountId", "NodeId")] -[Table("COM_MultiBuyDiscountTree")] -[Index("NodeId", Name = "IX_COM_MultiBuyDiscountTree_NodeID")] -public class ComMultiBuyDiscountTree -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - [Required] - public bool? NodeIncluded { get; set; } - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountTrees")] - public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; - - [ForeignKey("NodeId")] - [InverseProperty("ComMultiBuyDiscountTrees")] - public virtual CmsTree Node { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComOptionCategory.cs b/Migration.Toolkit.K11/Models/ComOptionCategory.cs deleted file mode 100644 index 8b5a29f1..00000000 --- a/Migration.Toolkit.K11/Models/ComOptionCategory.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_OptionCategory")] -[Index("CategorySiteId", Name = "IX_COM_OptionCategory_CategorySiteID")] -public class ComOptionCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryName { get; set; } = null!; - - [StringLength(200)] - public string CategorySelectionType { get; set; } = null!; - - [StringLength(200)] - public string? CategoryDefaultOptions { get; set; } - - public string? CategoryDescription { get; set; } - - [StringLength(200)] - public string? CategoryDefaultRecord { get; set; } - - [Required] - public bool? CategoryEnabled { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - public bool? CategoryDisplayPrice { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - public int? CategoryTextMaxLength { get; set; } - - [StringLength(20)] - public string? CategoryType { get; set; } - - public int? CategoryTextMinLength { get; set; } - - [StringLength(200)] - public string? CategoryLiveSiteDisplayName { get; set; } - - [ForeignKey("CategorySiteId")] - [InverseProperty("ComOptionCategories")] - public virtual CmsSite? CategorySite { get; set; } - - [InverseProperty("Category")] - public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); - - [InverseProperty("SkuoptionCategory")] - public virtual ICollection ComSkus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ComOrder.cs b/Migration.Toolkit.K11/Models/ComOrder.cs deleted file mode 100644 index bfe094f7..00000000 --- a/Migration.Toolkit.K11/Models/ComOrder.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Order")] -[Index("OrderBillingAddressId", Name = "IX_COM_Order_OrderBillingAddressID")] -[Index("OrderCompanyAddressId", Name = "IX_COM_Order_OrderCompanyAddressID")] -[Index("OrderCreatedByUserId", Name = "IX_COM_Order_OrderCreatedByUserID")] -[Index("OrderCurrencyId", Name = "IX_COM_Order_OrderCurrencyID")] -[Index("OrderCustomerId", Name = "IX_COM_Order_OrderCustomerID")] -[Index("OrderPaymentOptionId", Name = "IX_COM_Order_OrderPaymentOptionID")] -[Index("OrderShippingAddressId", Name = "IX_COM_Order_OrderShippingAddressID")] -[Index("OrderShippingOptionId", Name = "IX_COM_Order_OrderShippingOptionID")] -[Index("OrderSiteId", "OrderDate", Name = "IX_COM_Order_OrderSiteID_OrderDate", IsDescending = new[] { false, true })] -[Index("OrderStatusId", Name = "IX_COM_Order_OrderStatusID")] -public class ComOrder -{ - [Key] - [Column("OrderID")] - public int OrderId { get; set; } - - [Column("OrderBillingAddressID")] - public int OrderBillingAddressId { get; set; } - - [Column("OrderShippingAddressID")] - public int? OrderShippingAddressId { get; set; } - - [Column("OrderShippingOptionID")] - public int? OrderShippingOptionId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderTotalShipping { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderTotalPrice { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderTotalTax { get; set; } - - public DateTime OrderDate { get; set; } - - [Column("OrderStatusID")] - public int? OrderStatusId { get; set; } - - [Column("OrderCurrencyID")] - public int? OrderCurrencyId { get; set; } - - [Column("OrderCustomerID")] - public int OrderCustomerId { get; set; } - - [Column("OrderCreatedByUserID")] - public int? OrderCreatedByUserId { get; set; } - - public string? OrderNote { get; set; } - - [Column("OrderSiteID")] - public int OrderSiteId { get; set; } - - [Column("OrderPaymentOptionID")] - public int? OrderPaymentOptionId { get; set; } - - public string? OrderInvoice { get; set; } - - [StringLength(200)] - public string? OrderInvoiceNumber { get; set; } - - [Column("OrderCompanyAddressID")] - public int? OrderCompanyAddressId { get; set; } - - [StringLength(100)] - public string? OrderTrackingNumber { get; set; } - - public string? OrderCustomData { get; set; } - - public string? OrderPaymentResult { get; set; } - - [Column("OrderGUID")] - public Guid OrderGuid { get; set; } - - public DateTime OrderLastModified { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderTotalPriceInMainCurrency { get; set; } - - public bool? OrderIsPaid { get; set; } - - [StringLength(10)] - public string? OrderCulture { get; set; } - - public string? OrderDiscounts { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderGrandTotal { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderGrandTotalInMainCurrency { get; set; } - - public string? OrderOtherPayments { get; set; } - - public string? OrderTaxSummary { get; set; } - - public string? OrderCouponCodes { get; set; } - - [InverseProperty("OrderItemOrder")] - public virtual ICollection ComOrderItems { get; set; } = new List(); - - [InverseProperty("Order")] - public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); - - [ForeignKey("OrderBillingAddressId")] - [InverseProperty("ComOrderOrderBillingAddresses")] - public virtual ComOrderAddress OrderBillingAddress { get; set; } = null!; - - [ForeignKey("OrderCompanyAddressId")] - [InverseProperty("ComOrderOrderCompanyAddresses")] - public virtual ComOrderAddress? OrderCompanyAddress { get; set; } - - [ForeignKey("OrderCreatedByUserId")] - [InverseProperty("ComOrders")] - public virtual CmsUser? OrderCreatedByUser { get; set; } - - [ForeignKey("OrderCurrencyId")] - [InverseProperty("ComOrders")] - public virtual ComCurrency? OrderCurrency { get; set; } - - [ForeignKey("OrderCustomerId")] - [InverseProperty("ComOrders")] - public virtual ComCustomer OrderCustomer { get; set; } = null!; - - [ForeignKey("OrderPaymentOptionId")] - [InverseProperty("ComOrders")] - public virtual ComPaymentOption? OrderPaymentOption { get; set; } - - [ForeignKey("OrderShippingAddressId")] - [InverseProperty("ComOrderOrderShippingAddresses")] - public virtual ComOrderAddress? OrderShippingAddress { get; set; } - - [ForeignKey("OrderShippingOptionId")] - [InverseProperty("ComOrders")] - public virtual ComShippingOption? OrderShippingOption { get; set; } - - [ForeignKey("OrderSiteId")] - [InverseProperty("ComOrders")] - public virtual CmsSite OrderSite { get; set; } = null!; - - [ForeignKey("OrderStatusId")] - [InverseProperty("ComOrders")] - public virtual ComOrderStatus? OrderStatus { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComOrderAddress.cs b/Migration.Toolkit.K11/Models/ComOrderAddress.cs deleted file mode 100644 index 0347a219..00000000 --- a/Migration.Toolkit.K11/Models/ComOrderAddress.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_OrderAddress")] -[Index("AddressCountryId", Name = "IX_COM_OrderAddress_AddressCountryID")] -[Index("AddressStateId", Name = "IX_COM_OrderAddress_AddressStateID")] -public class ComOrderAddress -{ - [Key] - [Column("AddressID")] - public int AddressId { get; set; } - - [StringLength(100)] - public string AddressLine1 { get; set; } = null!; - - [StringLength(100)] - public string? AddressLine2 { get; set; } - - [StringLength(100)] - public string AddressCity { get; set; } = null!; - - [StringLength(20)] - public string AddressZip { get; set; } = null!; - - [StringLength(26)] - public string? AddressPhone { get; set; } - - [Column("AddressCountryID")] - public int AddressCountryId { get; set; } - - [Column("AddressStateID")] - public int? AddressStateId { get; set; } - - [StringLength(200)] - public string AddressPersonalName { get; set; } = null!; - - [Column("AddressGUID")] - public Guid? AddressGuid { get; set; } - - public DateTime AddressLastModified { get; set; } - - [ForeignKey("AddressCountryId")] - [InverseProperty("ComOrderAddresses")] - public virtual CmsCountry AddressCountry { get; set; } = null!; - - [ForeignKey("AddressStateId")] - [InverseProperty("ComOrderAddresses")] - public virtual CmsState? AddressState { get; set; } - - [InverseProperty("OrderBillingAddress")] - public virtual ICollection ComOrderOrderBillingAddresses { get; set; } = new List(); - - [InverseProperty("OrderCompanyAddress")] - public virtual ICollection ComOrderOrderCompanyAddresses { get; set; } = new List(); - - [InverseProperty("OrderShippingAddress")] - public virtual ICollection ComOrderOrderShippingAddresses { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ComOrderItem.cs b/Migration.Toolkit.K11/Models/ComOrderItem.cs deleted file mode 100644 index 559aab1e..00000000 --- a/Migration.Toolkit.K11/Models/ComOrderItem.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_OrderItem")] -[Index("OrderItemOrderId", Name = "IX_COM_OrderItem_OrderItemOrderID")] -[Index("OrderItemSkuid", Name = "IX_COM_OrderItem_OrderItemSKUID")] -public class ComOrderItem -{ - [Key] - [Column("OrderItemID")] - public int OrderItemId { get; set; } - - [Column("OrderItemOrderID")] - public int OrderItemOrderId { get; set; } - - [Column("OrderItemSKUID")] - public int OrderItemSkuid { get; set; } - - [Column("OrderItemSKUName")] - [StringLength(450)] - public string OrderItemSkuname { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderItemUnitPrice { get; set; } - - public int OrderItemUnitCount { get; set; } - - public string? OrderItemCustomData { get; set; } - - public Guid OrderItemGuid { get; set; } - - public Guid? OrderItemParentGuid { get; set; } - - public DateTime OrderItemLastModified { get; set; } - - public DateTime? OrderItemValidTo { get; set; } - - [Column("OrderItemBundleGUID")] - public Guid? OrderItemBundleGuid { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderItemTotalPriceInMainCurrency { get; set; } - - public bool? OrderItemSendNotification { get; set; } - - public string? OrderItemText { get; set; } - - public string? OrderItemProductDiscounts { get; set; } - - public string? OrderItemDiscountSummary { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderItemTotalPrice { get; set; } - - [InverseProperty("OrderItem")] - public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); - - [ForeignKey("OrderItemOrderId")] - [InverseProperty("ComOrderItems")] - public virtual ComOrder OrderItemOrder { get; set; } = null!; - - [ForeignKey("OrderItemSkuid")] - [InverseProperty("ComOrderItems")] - public virtual ComSku OrderItemSku { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComOrderItemSkufile.cs b/Migration.Toolkit.K11/Models/ComOrderItemSkufile.cs deleted file mode 100644 index 24a076eb..00000000 --- a/Migration.Toolkit.K11/Models/ComOrderItemSkufile.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_OrderItemSKUFile")] -[Index("FileId", Name = "IX_COM_OrderItemSKUFile_FileID")] -[Index("OrderItemId", Name = "IX_COM_OrderItemSKUFile_OrderItemID")] -public class ComOrderItemSkufile -{ - [Key] - [Column("OrderItemSKUFileID")] - public int OrderItemSkufileId { get; set; } - - public Guid Token { get; set; } - - [Column("OrderItemID")] - public int OrderItemId { get; set; } - - [Column("FileID")] - public int FileId { get; set; } - - [ForeignKey("FileId")] - [InverseProperty("ComOrderItemSkufiles")] - public virtual ComSkufile File { get; set; } = null!; - - [ForeignKey("OrderItemId")] - [InverseProperty("ComOrderItemSkufiles")] - public virtual ComOrderItem OrderItem { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComOrderStatus.cs b/Migration.Toolkit.K11/Models/ComOrderStatus.cs deleted file mode 100644 index 55f9bdc6..00000000 --- a/Migration.Toolkit.K11/Models/ComOrderStatus.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_OrderStatus")] -[Index("StatusSiteId", "StatusOrder", Name = "IX_COM_OrderStatus_StatusSiteID_StatusOrder")] -public class ComOrderStatus -{ - [Key] - [Column("StatusID")] - public int StatusId { get; set; } - - [StringLength(200)] - public string StatusName { get; set; } = null!; - - [StringLength(200)] - public string StatusDisplayName { get; set; } = null!; - - public int? StatusOrder { get; set; } - - [Required] - public bool? StatusEnabled { get; set; } - - [StringLength(7)] - public string? StatusColor { get; set; } - - [Column("StatusGUID")] - public Guid StatusGuid { get; set; } - - public DateTime StatusLastModified { get; set; } - - public bool? StatusSendNotification { get; set; } - - [Column("StatusSiteID")] - public int? StatusSiteId { get; set; } - - public bool? StatusOrderIsPaid { get; set; } - - [InverseProperty("FromStatus")] - public virtual ICollection ComOrderStatusUserFromStatuses { get; set; } = new List(); - - [InverseProperty("ToStatus")] - public virtual ICollection ComOrderStatusUserToStatuses { get; set; } = new List(); - - [InverseProperty("OrderStatus")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("PaymentOptionAuthorizedOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionAuthorizedOrderStatuses { get; set; } = new List(); - - [InverseProperty("PaymentOptionFailedOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionFailedOrderStatuses { get; set; } = new List(); - - [InverseProperty("PaymentOptionSucceededOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionSucceededOrderStatuses { get; set; } = new List(); - - [ForeignKey("StatusSiteId")] - [InverseProperty("ComOrderStatuses")] - public virtual CmsSite? StatusSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComOrderStatusUser.cs b/Migration.Toolkit.K11/Models/ComOrderStatusUser.cs deleted file mode 100644 index 0c444db2..00000000 --- a/Migration.Toolkit.K11/Models/ComOrderStatusUser.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_OrderStatusUser")] -[Index("ChangedByUserId", Name = "IX_COM_OrderStatusUser_ChangedByUserID")] -[Index("FromStatusId", Name = "IX_COM_OrderStatusUser_FromStatusID")] -[Index("OrderId", "Date", Name = "IX_COM_OrderStatusUser_OrderID_Date")] -[Index("ToStatusId", Name = "IX_COM_OrderStatusUser_ToStatusID")] -public class ComOrderStatusUser -{ - [Key] - [Column("OrderStatusUserID")] - public int OrderStatusUserId { get; set; } - - [Column("OrderID")] - public int OrderId { get; set; } - - [Column("FromStatusID")] - public int? FromStatusId { get; set; } - - [Column("ToStatusID")] - public int ToStatusId { get; set; } - - [Column("ChangedByUserID")] - public int? ChangedByUserId { get; set; } - - public DateTime Date { get; set; } - - public string? Note { get; set; } - - [ForeignKey("ChangedByUserId")] - [InverseProperty("ComOrderStatusUsers")] - public virtual CmsUser? ChangedByUser { get; set; } - - [ForeignKey("FromStatusId")] - [InverseProperty("ComOrderStatusUserFromStatuses")] - public virtual ComOrderStatus? FromStatus { get; set; } - - [ForeignKey("OrderId")] - [InverseProperty("ComOrderStatusUsers")] - public virtual ComOrder Order { get; set; } = null!; - - [ForeignKey("ToStatusId")] - [InverseProperty("ComOrderStatusUserToStatuses")] - public virtual ComOrderStatus ToStatus { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComPaymentOption.cs b/Migration.Toolkit.K11/Models/ComPaymentOption.cs deleted file mode 100644 index 7502dba7..00000000 --- a/Migration.Toolkit.K11/Models/ComPaymentOption.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_PaymentOption")] -[Index("PaymentOptionAuthorizedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID")] -[Index("PaymentOptionFailedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionFailedOrderStatusID")] -[Index("PaymentOptionSiteId", Name = "IX_COM_PaymentOption_PaymentOptionSiteID")] -[Index("PaymentOptionSucceededOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionSucceededOrderStatusID")] -public class ComPaymentOption -{ - [Key] - [Column("PaymentOptionID")] - public int PaymentOptionId { get; set; } - - [StringLength(200)] - public string PaymentOptionName { get; set; } = null!; - - [StringLength(200)] - public string PaymentOptionDisplayName { get; set; } = null!; - - [Required] - public bool? PaymentOptionEnabled { get; set; } - - [Column("PaymentOptionSiteID")] - public int? PaymentOptionSiteId { get; set; } - - [StringLength(500)] - public string? PaymentOptionPaymentGateUrl { get; set; } - - [StringLength(200)] - public string? PaymentOptionAssemblyName { get; set; } - - [StringLength(200)] - public string? PaymentOptionClassName { get; set; } - - [Column("PaymentOptionSucceededOrderStatusID")] - public int? PaymentOptionSucceededOrderStatusId { get; set; } - - [Column("PaymentOptionFailedOrderStatusID")] - public int? PaymentOptionFailedOrderStatusId { get; set; } - - [Column("PaymentOptionGUID")] - public Guid PaymentOptionGuid { get; set; } - - public DateTime PaymentOptionLastModified { get; set; } - - public bool? PaymentOptionAllowIfNoShipping { get; set; } - - [Column("PaymentOptionThumbnailGUID")] - public Guid? PaymentOptionThumbnailGuid { get; set; } - - public string? PaymentOptionDescription { get; set; } - - [Column("PaymentOptionAuthorizedOrderStatusID")] - public int? PaymentOptionAuthorizedOrderStatusId { get; set; } - - [InverseProperty("OrderPaymentOption")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartPaymentOption")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("PaymentOptionAuthorizedOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionAuthorizedOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionAuthorizedOrderStatus { get; set; } - - [ForeignKey("PaymentOptionFailedOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionFailedOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionFailedOrderStatus { get; set; } - - [ForeignKey("PaymentOptionSiteId")] - [InverseProperty("ComPaymentOptions")] - public virtual CmsSite? PaymentOptionSite { get; set; } - - [ForeignKey("PaymentOptionSucceededOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionSucceededOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionSucceededOrderStatus { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComPublicStatus.cs b/Migration.Toolkit.K11/Models/ComPublicStatus.cs deleted file mode 100644 index dcdb6355..00000000 --- a/Migration.Toolkit.K11/Models/ComPublicStatus.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_PublicStatus")] -[Index("PublicStatusSiteId", Name = "IX_COM_PublicStatus_PublicStatusSiteID")] -public class ComPublicStatus -{ - [Key] - [Column("PublicStatusID")] - public int PublicStatusId { get; set; } - - [StringLength(200)] - public string PublicStatusName { get; set; } = null!; - - [StringLength(200)] - public string PublicStatusDisplayName { get; set; } = null!; - - [Required] - public bool? PublicStatusEnabled { get; set; } - - [Column("PublicStatusGUID")] - public Guid? PublicStatusGuid { get; set; } - - public DateTime PublicStatusLastModified { get; set; } - - [Column("PublicStatusSiteID")] - public int? PublicStatusSiteId { get; set; } - - [InverseProperty("SkupublicStatus")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("PublicStatusSiteId")] - [InverseProperty("ComPublicStatuses")] - public virtual CmsSite? PublicStatusSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComShippingCost.cs b/Migration.Toolkit.K11/Models/ComShippingCost.cs deleted file mode 100644 index c5a3278b..00000000 --- a/Migration.Toolkit.K11/Models/ComShippingCost.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_ShippingCost")] -[Index("ShippingCostShippingOptionId", Name = "IX_COM_ShippingCost_ShippingCostShippingOptionID")] -public class ComShippingCost -{ - [Key] - [Column("ShippingCostID")] - public int ShippingCostId { get; set; } - - [Column("ShippingCostShippingOptionID")] - public int ShippingCostShippingOptionId { get; set; } - - public double ShippingCostMinWeight { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal ShippingCostValue { get; set; } - - [Column("ShippingCostGUID")] - public Guid ShippingCostGuid { get; set; } - - public DateTime ShippingCostLastModified { get; set; } - - [ForeignKey("ShippingCostShippingOptionId")] - [InverseProperty("ComShippingCosts")] - public virtual ComShippingOption ShippingCostShippingOption { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComShippingOption.cs b/Migration.Toolkit.K11/Models/ComShippingOption.cs deleted file mode 100644 index d1b0c564..00000000 --- a/Migration.Toolkit.K11/Models/ComShippingOption.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_ShippingOption")] -[Index("ShippingOptionCarrierId", Name = "IX_COM_ShippingOption_ShippingOptionCarrierID")] -[Index("ShippingOptionSiteId", Name = "IX_COM_ShippingOption_ShippingOptionSiteID_ShippingOptionDisplayName_ShippingOptionEnabled")] -[Index("ShippingOptionTaxClassId", Name = "IX_COM_ShippingOption_ShippingOptionTaxClassID")] -public class ComShippingOption -{ - [Key] - [Column("ShippingOptionID")] - public int ShippingOptionId { get; set; } - - [StringLength(200)] - public string ShippingOptionName { get; set; } = null!; - - [StringLength(200)] - public string ShippingOptionDisplayName { get; set; } = null!; - - [Required] - public bool? ShippingOptionEnabled { get; set; } - - [Column("ShippingOptionSiteID")] - public int? ShippingOptionSiteId { get; set; } - - [Column("ShippingOptionGUID")] - public Guid ShippingOptionGuid { get; set; } - - public DateTime ShippingOptionLastModified { get; set; } - - [Column("ShippingOptionThumbnailGUID")] - public Guid? ShippingOptionThumbnailGuid { get; set; } - - public string? ShippingOptionDescription { get; set; } - - [Column("ShippingOptionCarrierID")] - public int? ShippingOptionCarrierId { get; set; } - - [StringLength(200)] - public string? ShippingOptionCarrierServiceName { get; set; } - - [Column("ShippingOptionTaxClassID")] - public int? ShippingOptionTaxClassId { get; set; } - - [InverseProperty("OrderShippingOption")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShippingCostShippingOption")] - public virtual ICollection ComShippingCosts { get; set; } = new List(); - - [InverseProperty("ShoppingCartShippingOption")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("ShippingOptionCarrierId")] - [InverseProperty("ComShippingOptions")] - public virtual ComCarrier? ShippingOptionCarrier { get; set; } - - [ForeignKey("ShippingOptionSiteId")] - [InverseProperty("ComShippingOptions")] - public virtual CmsSite? ShippingOptionSite { get; set; } - - [ForeignKey("ShippingOptionTaxClassId")] - [InverseProperty("ComShippingOptions")] - public virtual ComTaxClass? ShippingOptionTaxClass { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComShoppingCart.cs b/Migration.Toolkit.K11/Models/ComShoppingCart.cs deleted file mode 100644 index d38a5ed5..00000000 --- a/Migration.Toolkit.K11/Models/ComShoppingCart.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_ShoppingCart")] -[Index("ShoppingCartBillingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartBillingAddressID")] -[Index("ShoppingCartCompanyAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartCompanyAddressID")] -[Index("ShoppingCartCurrencyId", Name = "IX_COM_ShoppingCart_ShoppingCartCurrencyID")] -[Index("ShoppingCartCustomerId", Name = "IX_COM_ShoppingCart_ShoppingCartCustomerID")] -[Index("ShoppingCartLastUpdate", Name = "IX_COM_ShoppingCart_ShoppingCartLastUpdate")] -[Index("ShoppingCartPaymentOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartPaymentOptionID")] -[Index("ShoppingCartShippingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingAddressID")] -[Index("ShoppingCartShippingOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingOptionID")] -[Index("ShoppingCartSiteId", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID")] -[Index("ShoppingCartGuid", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID_ShoppingCartGUID")] -[Index("ShoppingCartUserId", Name = "IX_COM_ShoppingCart_ShoppingCartUserID")] -public class ComShoppingCart -{ - [Key] - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [Column("ShoppingCartGUID")] - public Guid ShoppingCartGuid { get; set; } - - [Column("ShoppingCartUserID")] - public int? ShoppingCartUserId { get; set; } - - [Column("ShoppingCartSiteID")] - public int ShoppingCartSiteId { get; set; } - - public DateTime ShoppingCartLastUpdate { get; set; } - - [Column("ShoppingCartCurrencyID")] - public int? ShoppingCartCurrencyId { get; set; } - - [Column("ShoppingCartPaymentOptionID")] - public int? ShoppingCartPaymentOptionId { get; set; } - - [Column("ShoppingCartShippingOptionID")] - public int? ShoppingCartShippingOptionId { get; set; } - - [Column("ShoppingCartBillingAddressID")] - public int? ShoppingCartBillingAddressId { get; set; } - - [Column("ShoppingCartShippingAddressID")] - public int? ShoppingCartShippingAddressId { get; set; } - - [Column("ShoppingCartCustomerID")] - public int? ShoppingCartCustomerId { get; set; } - - public string? ShoppingCartNote { get; set; } - - [Column("ShoppingCartCompanyAddressID")] - public int? ShoppingCartCompanyAddressId { get; set; } - - public string? ShoppingCartCustomData { get; set; } - - [Column("ShoppingCartContactID")] - public int? ShoppingCartContactId { get; set; } - - [InverseProperty("ShoppingCart")] - public virtual ICollection ComShoppingCartCouponCodes { get; set; } = new List(); - - [InverseProperty("ShoppingCart")] - public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); - - [ForeignKey("ShoppingCartBillingAddressId")] - [InverseProperty("ComShoppingCartShoppingCartBillingAddresses")] - public virtual ComAddress? ShoppingCartBillingAddress { get; set; } - - [ForeignKey("ShoppingCartCompanyAddressId")] - [InverseProperty("ComShoppingCartShoppingCartCompanyAddresses")] - public virtual ComAddress? ShoppingCartCompanyAddress { get; set; } - - [ForeignKey("ShoppingCartCurrencyId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComCurrency? ShoppingCartCurrency { get; set; } - - [ForeignKey("ShoppingCartCustomerId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComCustomer? ShoppingCartCustomer { get; set; } - - [ForeignKey("ShoppingCartPaymentOptionId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComPaymentOption? ShoppingCartPaymentOption { get; set; } - - [ForeignKey("ShoppingCartShippingAddressId")] - [InverseProperty("ComShoppingCartShoppingCartShippingAddresses")] - public virtual ComAddress? ShoppingCartShippingAddress { get; set; } - - [ForeignKey("ShoppingCartShippingOptionId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComShippingOption? ShoppingCartShippingOption { get; set; } - - [ForeignKey("ShoppingCartSiteId")] - [InverseProperty("ComShoppingCarts")] - public virtual CmsSite ShoppingCartSite { get; set; } = null!; - - [ForeignKey("ShoppingCartUserId")] - [InverseProperty("ComShoppingCarts")] - public virtual CmsUser? ShoppingCartUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComShoppingCartCouponCode.cs b/Migration.Toolkit.K11/Models/ComShoppingCartCouponCode.cs deleted file mode 100644 index 947fb755..00000000 --- a/Migration.Toolkit.K11/Models/ComShoppingCartCouponCode.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_ShoppingCartCouponCode")] -[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartCouponCode_ShoppingCartID")] -public class ComShoppingCartCouponCode -{ - [Key] - [Column("ShoppingCartCouponCodeID")] - public int ShoppingCartCouponCodeId { get; set; } - - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [StringLength(200)] - public string CouponCode { get; set; } = null!; - - [ForeignKey("ShoppingCartId")] - [InverseProperty("ComShoppingCartCouponCodes")] - public virtual ComShoppingCart ShoppingCart { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComShoppingCartSku.cs b/Migration.Toolkit.K11/Models/ComShoppingCartSku.cs deleted file mode 100644 index 3e652dba..00000000 --- a/Migration.Toolkit.K11/Models/ComShoppingCartSku.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_ShoppingCartSKU")] -[Index("Skuid", Name = "IX_COM_ShoppingCartSKU_SKUID")] -[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartSKU_ShoppingCartID")] -public class ComShoppingCartSku -{ - [Key] - [Column("CartItemID")] - public int CartItemId { get; set; } - - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("SKUUnits")] - public int Skuunits { get; set; } - - public string? CartItemCustomData { get; set; } - - public Guid? CartItemGuid { get; set; } - - public Guid? CartItemParentGuid { get; set; } - - public DateTime? CartItemValidTo { get; set; } - - [Column("CartItemBundleGUID")] - public Guid? CartItemBundleGuid { get; set; } - - public string? CartItemText { get; set; } - - public int? CartItemAutoAddedUnits { get; set; } - - [ForeignKey("ShoppingCartId")] - [InverseProperty("ComShoppingCartSkus")] - public virtual ComShoppingCart ShoppingCart { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComShoppingCartSkus")] - public virtual ComSku Sku { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComSku.cs b/Migration.Toolkit.K11/Models/ComSku.cs deleted file mode 100644 index 42ed7e22..00000000 --- a/Migration.Toolkit.K11/Models/ComSku.cs +++ /dev/null @@ -1,277 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_SKU")] -[Index("SkubrandId", Name = "IX_COM_SKU_SKUBrandID")] -[Index("SkucollectionId", Name = "IX_COM_SKU_SKUCollectionID")] -[Index("SkudepartmentId", Name = "IX_COM_SKU_SKUDepartmentID")] -[Index("SkuinternalStatusId", Name = "IX_COM_SKU_SKUInternalStatusID")] -[Index("SkumanufacturerId", Name = "IX_COM_SKU_SKUManufacturerID")] -[Index("Skuname", Name = "IX_COM_SKU_SKUName")] -[Index("SkuoptionCategoryId", Name = "IX_COM_SKU_SKUOptionCategoryID")] -[Index("SkuparentSkuid", Name = "IX_COM_SKU_SKUParentSKUID")] -[Index("Skuprice", Name = "IX_COM_SKU_SKUPrice")] -[Index("SkupublicStatusId", Name = "IX_COM_SKU_SKUPublicStatusID")] -[Index("SkusiteId", Name = "IX_COM_SKU_SKUSiteID")] -[Index("SkusupplierId", Name = "IX_COM_SKU_SKUSupplierID")] -[Index("SkutaxClassId", Name = "IX_COM_SKU_SKUTaxClassID")] -public class ComSku -{ - [Key] - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("SKUNumber")] - [StringLength(200)] - public string? Skunumber { get; set; } - - [Column("SKUName")] - [StringLength(440)] - public string Skuname { get; set; } = null!; - - [Column("SKUDescription")] - public string? Skudescription { get; set; } - - [Column("SKUPrice", TypeName = "decimal(18, 9)")] - public decimal Skuprice { get; set; } - - [Required] - [Column("SKUEnabled")] - public bool? Skuenabled { get; set; } - - [Column("SKUDepartmentID")] - public int? SkudepartmentId { get; set; } - - [Column("SKUManufacturerID")] - public int? SkumanufacturerId { get; set; } - - [Column("SKUInternalStatusID")] - public int? SkuinternalStatusId { get; set; } - - [Column("SKUPublicStatusID")] - public int? SkupublicStatusId { get; set; } - - [Column("SKUSupplierID")] - public int? SkusupplierId { get; set; } - - [Column("SKUAvailableInDays")] - public int? SkuavailableInDays { get; set; } - - [Column("SKUGUID")] - public Guid Skuguid { get; set; } - - [Column("SKUImagePath")] - [StringLength(450)] - public string? SkuimagePath { get; set; } - - [Column("SKUWeight")] - public double? Skuweight { get; set; } - - [Column("SKUWidth")] - public double? Skuwidth { get; set; } - - [Column("SKUDepth")] - public double? Skudepth { get; set; } - - [Column("SKUHeight")] - public double? Skuheight { get; set; } - - [Column("SKUAvailableItems")] - public int? SkuavailableItems { get; set; } - - [Column("SKUSellOnlyAvailable")] - public bool? SkusellOnlyAvailable { get; set; } - - [Column("SKUCustomData")] - public string? SkucustomData { get; set; } - - [Column("SKUOptionCategoryID")] - public int? SkuoptionCategoryId { get; set; } - - [Column("SKUOrder")] - public int? Skuorder { get; set; } - - [Column("SKULastModified")] - public DateTime SkulastModified { get; set; } - - [Column("SKUCreated")] - public DateTime? Skucreated { get; set; } - - [Column("SKUSiteID")] - public int? SkusiteId { get; set; } - - [Column("SKUNeedsShipping")] - public bool? SkuneedsShipping { get; set; } - - [Column("SKUValidUntil")] - public DateTime? SkuvalidUntil { get; set; } - - [Column("SKUProductType")] - [StringLength(50)] - public string? SkuproductType { get; set; } - - [Column("SKUMaxItemsInOrder")] - public int? SkumaxItemsInOrder { get; set; } - - [Column("SKUValidity")] - [StringLength(50)] - public string? Skuvalidity { get; set; } - - [Column("SKUValidFor")] - public int? SkuvalidFor { get; set; } - - [Column("SKUMembershipGUID")] - public Guid? SkumembershipGuid { get; set; } - - [Column("SKUConversionName")] - [StringLength(100)] - public string? SkuconversionName { get; set; } - - [Column("SKUConversionValue")] - [StringLength(200)] - public string? SkuconversionValue { get; set; } - - [Column("SKUBundleInventoryType")] - [StringLength(50)] - public string? SkubundleInventoryType { get; set; } - - [Column("SKUMinItemsInOrder")] - public int? SkuminItemsInOrder { get; set; } - - [Column("SKURetailPrice", TypeName = "decimal(18, 9)")] - public decimal? SkuretailPrice { get; set; } - - [Column("SKUParentSKUID")] - public int? SkuparentSkuid { get; set; } - - [Column("SKUShortDescription")] - public string? SkushortDescription { get; set; } - - [Column("SKUEproductFilesCount")] - public int? SkueproductFilesCount { get; set; } - - [Column("SKUBundleItemsCount")] - public int? SkubundleItemsCount { get; set; } - - [Column("SKUInStoreFrom")] - public DateTime? SkuinStoreFrom { get; set; } - - [Column("SKUReorderAt")] - public int? SkureorderAt { get; set; } - - [Column("SKUTrackInventory")] - [StringLength(50)] - public string? SkutrackInventory { get; set; } - - [Column("SKUTaxClassID")] - public int? SkutaxClassId { get; set; } - - [Column("SKUBrandID")] - public int? SkubrandId { get; set; } - - [Column("SKUCollectionID")] - public int? SkucollectionId { get; set; } - - [InverseProperty("NodeSku")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscountApplyToSku")] - public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); - - [InverseProperty("OrderItemSku")] - public virtual ICollection ComOrderItems { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); - - [InverseProperty("FileSku")] - public virtual ICollection ComSkufiles { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); - - [InverseProperty("VolumeDiscountSku")] - public virtual ICollection ComVolumeDiscounts { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("SkuparentSku")] - public virtual ICollection InverseSkuparentSku { get; set; } = new List(); - - [ForeignKey("SkubrandId")] - [InverseProperty("ComSkus")] - public virtual ComBrand? Skubrand { get; set; } - - [ForeignKey("SkucollectionId")] - [InverseProperty("ComSkus")] - public virtual ComCollection? Skucollection { get; set; } - - [ForeignKey("SkudepartmentId")] - [InverseProperty("ComSkus")] - public virtual ComDepartment? Skudepartment { get; set; } - - [ForeignKey("SkuinternalStatusId")] - [InverseProperty("ComSkus")] - public virtual ComInternalStatus? SkuinternalStatus { get; set; } - - [ForeignKey("SkumanufacturerId")] - [InverseProperty("ComSkus")] - public virtual ComManufacturer? Skumanufacturer { get; set; } - - [ForeignKey("SkuoptionCategoryId")] - [InverseProperty("ComSkus")] - public virtual ComOptionCategory? SkuoptionCategory { get; set; } - - [ForeignKey("SkuparentSkuid")] - [InverseProperty("InverseSkuparentSku")] - public virtual ComSku? SkuparentSku { get; set; } - - [ForeignKey("SkupublicStatusId")] - [InverseProperty("ComSkus")] - public virtual ComPublicStatus? SkupublicStatus { get; set; } - - [ForeignKey("SkusiteId")] - [InverseProperty("ComSkus")] - public virtual CmsSite? Skusite { get; set; } - - [ForeignKey("SkusupplierId")] - [InverseProperty("ComSkus")] - public virtual ComSupplier? Skusupplier { get; set; } - - [ForeignKey("SkutaxClassId")] - [InverseProperty("ComSkus")] - public virtual ComTaxClass? SkutaxClass { get; set; } - - [ForeignKey("Skuid")] - [InverseProperty("Skus")] - public virtual ICollection Bundles { get; set; } = new List(); - - [ForeignKey("Skuid")] - [InverseProperty("Skus")] - public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); - - [ForeignKey("Skuid")] - [InverseProperty("SkusNavigation")] - public virtual ICollection OptionSkus { get; set; } = new List(); - - [ForeignKey("VariantSkuid")] - [InverseProperty("VariantSkus")] - public virtual ICollection OptionSkusNavigation { get; set; } = new List(); - - [ForeignKey("BundleId")] - [InverseProperty("Bundles")] - public virtual ICollection Skus { get; set; } = new List(); - - [ForeignKey("OptionSkuid")] - [InverseProperty("OptionSkus")] - public virtual ICollection SkusNavigation { get; set; } = new List(); - - [ForeignKey("OptionSkuid")] - [InverseProperty("OptionSkusNavigation")] - public virtual ICollection VariantSkus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ComSkufile.cs b/Migration.Toolkit.K11/Models/ComSkufile.cs deleted file mode 100644 index 0af601af..00000000 --- a/Migration.Toolkit.K11/Models/ComSkufile.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_SKUFile")] -[Index("FileSkuid", Name = "IX_COM_SKUFile_FileSKUID")] -public class ComSkufile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileSKUID")] - public int FileSkuid { get; set; } - - [StringLength(450)] - public string FilePath { get; set; } = null!; - - [StringLength(50)] - public string FileType { get; set; } = null!; - - public DateTime FileLastModified { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [Column("FileMetaFileGUID")] - public Guid? FileMetaFileGuid { get; set; } - - [InverseProperty("File")] - public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); - - [ForeignKey("FileSkuid")] - [InverseProperty("ComSkufiles")] - public virtual ComSku FileSku { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComSkuoptionCategory.cs b/Migration.Toolkit.K11/Models/ComSkuoptionCategory.cs deleted file mode 100644 index 4ee3cf8d..00000000 --- a/Migration.Toolkit.K11/Models/ComSkuoptionCategory.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_SKUOptionCategory")] -[Index("CategoryId", Name = "IX_COM_SKUOptionCategory_CategoryID")] -[Index("Skuid", Name = "IX_COM_SKUOptionCategory_SKUID")] -public class ComSkuoptionCategory -{ - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("CategoryID")] - public int CategoryId { get; set; } - - public bool? AllowAllOptions { get; set; } - - [Key] - [Column("SKUCategoryID")] - public int SkucategoryId { get; set; } - - [Column("SKUCategoryOrder")] - public int? SkucategoryOrder { get; set; } - - [ForeignKey("CategoryId")] - [InverseProperty("ComSkuoptionCategories")] - public virtual ComOptionCategory Category { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComSkuoptionCategories")] - public virtual ComSku Sku { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComSupplier.cs b/Migration.Toolkit.K11/Models/ComSupplier.cs deleted file mode 100644 index b7c3acd0..00000000 --- a/Migration.Toolkit.K11/Models/ComSupplier.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Supplier")] -[Index("SupplierSiteId", Name = "IX_COM_Supplier_SupplierSiteID")] -public class ComSupplier -{ - [Key] - [Column("SupplierID")] - public int SupplierId { get; set; } - - [StringLength(200)] - public string SupplierDisplayName { get; set; } = null!; - - [StringLength(50)] - public string? SupplierPhone { get; set; } - - [StringLength(254)] - public string? SupplierEmail { get; set; } - - [StringLength(50)] - public string? SupplierFax { get; set; } - - [Required] - public bool? SupplierEnabled { get; set; } - - [Column("SupplierGUID")] - public Guid SupplierGuid { get; set; } - - public DateTime SupplierLastModified { get; set; } - - [Column("SupplierSiteID")] - public int? SupplierSiteId { get; set; } - - [StringLength(200)] - public string? SupplierName { get; set; } - - [InverseProperty("Skusupplier")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("SupplierSiteId")] - [InverseProperty("ComSuppliers")] - public virtual CmsSite? SupplierSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComTaxClass.cs b/Migration.Toolkit.K11/Models/ComTaxClass.cs deleted file mode 100644 index 41ed5a73..00000000 --- a/Migration.Toolkit.K11/Models/ComTaxClass.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_TaxClass")] -[Index("TaxClassSiteId", Name = "IX_COM_TaxClass_TaxClassSiteID")] -public class ComTaxClass -{ - [Key] - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [StringLength(200)] - public string TaxClassName { get; set; } = null!; - - [StringLength(200)] - public string TaxClassDisplayName { get; set; } = null!; - - [Column("TaxClassZeroIfIDSupplied")] - public bool? TaxClassZeroIfIdsupplied { get; set; } - - [Column("TaxClassGUID")] - public Guid TaxClassGuid { get; set; } - - public DateTime TaxClassLastModified { get; set; } - - [Column("TaxClassSiteID")] - public int? TaxClassSiteId { get; set; } - - [InverseProperty("DepartmentDefaultTaxClass")] - public virtual ICollection ComDepartments { get; set; } = new List(); - - [InverseProperty("ShippingOptionTaxClass")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); - - [InverseProperty("SkutaxClass")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [InverseProperty("TaxClass")] - public virtual ICollection ComTaxClassCountries { get; set; } = new List(); - - [InverseProperty("TaxClass")] - public virtual ICollection ComTaxClassStates { get; set; } = new List(); - - [ForeignKey("TaxClassSiteId")] - [InverseProperty("ComTaxClasses")] - public virtual CmsSite? TaxClassSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ComTaxClassCountry.cs b/Migration.Toolkit.K11/Models/ComTaxClassCountry.cs deleted file mode 100644 index e7b9afe4..00000000 --- a/Migration.Toolkit.K11/Models/ComTaxClassCountry.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_TaxClassCountry")] -[Index("CountryId", Name = "IX_COM_TaxClassCountry_CountryID")] -[Index("TaxClassId", "CountryId", Name = "IX_COM_TaxClassCountry_TaxClassID_CountryID", IsUnique = true)] -public class ComTaxClassCountry -{ - [Key] - [Column("TaxClassCountryID")] - public int TaxClassCountryId { get; set; } - - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal TaxValue { get; set; } - - [ForeignKey("CountryId")] - [InverseProperty("ComTaxClassCountries")] - public virtual CmsCountry Country { get; set; } = null!; - - [ForeignKey("TaxClassId")] - [InverseProperty("ComTaxClassCountries")] - public virtual ComTaxClass TaxClass { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComTaxClassState.cs b/Migration.Toolkit.K11/Models/ComTaxClassState.cs deleted file mode 100644 index 6f0505d3..00000000 --- a/Migration.Toolkit.K11/Models/ComTaxClassState.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_TaxClassState")] -[Index("StateId", Name = "IX_COM_TaxClassState_StateID")] -[Index("TaxClassId", "StateId", Name = "IX_COM_TaxClassState_TaxClassID_StateID", IsUnique = true)] -public class ComTaxClassState -{ - [Key] - [Column("TaxClassStateID")] - public int TaxClassStateId { get; set; } - - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [Column("StateID")] - public int StateId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal TaxValue { get; set; } - - [ForeignKey("StateId")] - [InverseProperty("ComTaxClassStates")] - public virtual CmsState State { get; set; } = null!; - - [ForeignKey("TaxClassId")] - [InverseProperty("ComTaxClassStates")] - public virtual ComTaxClass TaxClass { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComVolumeDiscount.cs b/Migration.Toolkit.K11/Models/ComVolumeDiscount.cs deleted file mode 100644 index 0ff15709..00000000 --- a/Migration.Toolkit.K11/Models/ComVolumeDiscount.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_VolumeDiscount")] -[Index("VolumeDiscountSkuid", Name = "IX_COM_VolumeDiscount_VolumeDiscountSKUID")] -public class ComVolumeDiscount -{ - [Key] - [Column("VolumeDiscountID")] - public int VolumeDiscountId { get; set; } - - [Column("VolumeDiscountSKUID")] - public int VolumeDiscountSkuid { get; set; } - - public int VolumeDiscountMinCount { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal VolumeDiscountValue { get; set; } - - public bool VolumeDiscountIsFlatValue { get; set; } - - [Column("VolumeDiscountGUID")] - public Guid VolumeDiscountGuid { get; set; } - - public DateTime VolumeDiscountLastModified { get; set; } - - [ForeignKey("VolumeDiscountSkuid")] - [InverseProperty("ComVolumeDiscounts")] - public virtual ComSku VolumeDiscountSku { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ComWishlist.cs b/Migration.Toolkit.K11/Models/ComWishlist.cs deleted file mode 100644 index 47d6775a..00000000 --- a/Migration.Toolkit.K11/Models/ComWishlist.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("UserId", "Skuid", "SiteId")] -[Table("COM_Wishlist")] -[Index("Skuid", Name = "IX_COM_Wishlist_SKUID")] -[Index("SiteId", "UserId", Name = "IX_COM_Wishlist_SiteID_UserID")] -public class ComWishlist -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [Key] - [Column("SKUID")] - public int Skuid { get; set; } - - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("ComWishlists")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComWishlists")] - public virtual ComSku Sku { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("ComWishlists")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CommunityGroup.cs b/Migration.Toolkit.K11/Models/CommunityGroup.cs deleted file mode 100644 index d319f6b5..00000000 --- a/Migration.Toolkit.K11/Models/CommunityGroup.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Community_Group")] -[Index("GroupApproved", Name = "IX_Community_Group_GroupApproved")] -[Index("GroupApprovedByUserId", Name = "IX_Community_Group_GroupApprovedByUserID")] -[Index("GroupAvatarId", Name = "IX_Community_Group_GroupAvatarID")] -[Index("GroupCreatedByUserId", Name = "IX_Community_Group_GroupCreatedByUserID")] -[Index("GroupSiteId", "GroupName", Name = "IX_Community_Group_GroupSiteID_GroupName")] -public class CommunityGroup -{ - [Key] - [Column("GroupID")] - public int GroupId { get; set; } - - [Column("GroupGUID")] - public Guid GroupGuid { get; set; } - - public DateTime GroupLastModified { get; set; } - - [Column("GroupSiteID")] - public int GroupSiteId { get; set; } - - [StringLength(200)] - public string GroupDisplayName { get; set; } = null!; - - [StringLength(100)] - public string GroupName { get; set; } = null!; - - public string GroupDescription { get; set; } = null!; - - [Column("GroupNodeGUID")] - public Guid? GroupNodeGuid { get; set; } - - public int GroupApproveMembers { get; set; } - - public int GroupAccess { get; set; } - - [Column("GroupCreatedByUserID")] - public int? GroupCreatedByUserId { get; set; } - - [Column("GroupApprovedByUserID")] - public int? GroupApprovedByUserId { get; set; } - - [Column("GroupAvatarID")] - public int? GroupAvatarId { get; set; } - - public bool? GroupApproved { get; set; } - - public DateTime GroupCreatedWhen { get; set; } - - public bool? GroupSendJoinLeaveNotification { get; set; } - - public bool? GroupSendWaitingForApprovalNotification { get; set; } - - public int? GroupSecurity { get; set; } - - public bool? GroupLogActivity { get; set; } - - [InverseProperty("BoardGroup")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("RoleGroup")] - public virtual ICollection CmsRoles { get; set; } = new List(); - - [InverseProperty("NodeGroup")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("MemberGroup")] - public virtual ICollection CommunityGroupMembers { get; set; } = new List(); - - [InverseProperty("Group")] - public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); - - [InverseProperty("InvitationGroup")] - public virtual ICollection CommunityInvitations { get; set; } = new List(); - - [InverseProperty("GroupGroup")] - public virtual ICollection ForumsForumGroups { get; set; } = new List(); - - [InverseProperty("ForumCommunityGroup")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [ForeignKey("GroupApprovedByUserId")] - [InverseProperty("CommunityGroupGroupApprovedByUsers")] - public virtual CmsUser? GroupApprovedByUser { get; set; } - - [ForeignKey("GroupAvatarId")] - [InverseProperty("CommunityGroups")] - public virtual CmsAvatar? GroupAvatar { get; set; } - - [ForeignKey("GroupCreatedByUserId")] - [InverseProperty("CommunityGroupGroupCreatedByUsers")] - public virtual CmsUser? GroupCreatedByUser { get; set; } - - [ForeignKey("GroupSiteId")] - [InverseProperty("CommunityGroups")] - public virtual CmsSite GroupSite { get; set; } = null!; - - [InverseProperty("LibraryGroup")] - public virtual ICollection MediaLibraries { get; set; } = new List(); - - [InverseProperty("PollGroup")] - public virtual ICollection PollsPolls { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/CommunityGroupMember.cs b/Migration.Toolkit.K11/Models/CommunityGroupMember.cs deleted file mode 100644 index 3ab6ee47..00000000 --- a/Migration.Toolkit.K11/Models/CommunityGroupMember.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Community_GroupMember")] -[Index("MemberApprovedByUserId", Name = "IX_Community_GroupMember_MemberApprovedByUserID")] -[Index("MemberGroupId", Name = "IX_Community_GroupMember_MemberGroupID")] -[Index("MemberInvitedByUserId", Name = "IX_Community_GroupMember_MemberInvitedByUserID")] -[Index("MemberStatus", Name = "IX_Community_GroupMember_MemberStatus")] -[Index("MemberUserId", Name = "IX_Community_GroupMember_MemberUserID")] -public class CommunityGroupMember -{ - [Key] - [Column("MemberID")] - public int MemberId { get; set; } - - [Column("MemberGUID")] - public Guid MemberGuid { get; set; } - - [Column("MemberUserID")] - public int MemberUserId { get; set; } - - [Column("MemberGroupID")] - public int MemberGroupId { get; set; } - - public DateTime MemberJoined { get; set; } - - public DateTime? MemberApprovedWhen { get; set; } - - public DateTime? MemberRejectedWhen { get; set; } - - [Column("MemberApprovedByUserID")] - public int? MemberApprovedByUserId { get; set; } - - public string? MemberComment { get; set; } - - [Column("MemberInvitedByUserID")] - public int? MemberInvitedByUserId { get; set; } - - public int? MemberStatus { get; set; } - - [ForeignKey("MemberApprovedByUserId")] - [InverseProperty("CommunityGroupMemberMemberApprovedByUsers")] - public virtual CmsUser? MemberApprovedByUser { get; set; } - - [ForeignKey("MemberGroupId")] - [InverseProperty("CommunityGroupMembers")] - public virtual CommunityGroup MemberGroup { get; set; } = null!; - - [ForeignKey("MemberInvitedByUserId")] - [InverseProperty("CommunityGroupMemberMemberInvitedByUsers")] - public virtual CmsUser? MemberInvitedByUser { get; set; } - - [ForeignKey("MemberUserId")] - [InverseProperty("CommunityGroupMemberMemberUsers")] - public virtual CmsUser MemberUser { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CommunityGroupRolePermission.cs b/Migration.Toolkit.K11/Models/CommunityGroupRolePermission.cs deleted file mode 100644 index 1aa1c519..00000000 --- a/Migration.Toolkit.K11/Models/CommunityGroupRolePermission.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("GroupId", "RoleId", "PermissionId")] -[Table("Community_GroupRolePermission")] -[Index("PermissionId", Name = "IX_Community_GroupRolePermission_PermissionID")] -[Index("RoleId", Name = "IX_Community_GroupRolePermission_RoleID")] -public class CommunityGroupRolePermission -{ - [Key] - [Column("GroupID")] - public int GroupId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("GroupId")] - [InverseProperty("CommunityGroupRolePermissions")] - public virtual CommunityGroup Group { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("CommunityGroupRolePermissions")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("CommunityGroupRolePermissions")] - public virtual CmsRole Role { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/CommunityInvitation.cs b/Migration.Toolkit.K11/Models/CommunityInvitation.cs deleted file mode 100644 index 293c6c35..00000000 --- a/Migration.Toolkit.K11/Models/CommunityInvitation.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Community_Invitation")] -[Index("InvitationGroupId", Name = "IX_Community_Invitation_InvitationGroupID")] -[Index("InvitedByUserId", Name = "IX_Community_Invitation_InvitedByUserID")] -[Index("InvitedUserId", Name = "IX_Community_Invitation_InvitedUserID")] -public class CommunityInvitation -{ - [Key] - [Column("InvitationID")] - public int InvitationId { get; set; } - - [Column("InvitedUserID")] - public int? InvitedUserId { get; set; } - - [Column("InvitedByUserID")] - public int InvitedByUserId { get; set; } - - [Column("InvitationGroupID")] - public int? InvitationGroupId { get; set; } - - public DateTime? InvitationCreated { get; set; } - - public DateTime? InvitationValidTo { get; set; } - - public string? InvitationComment { get; set; } - - [Column("InvitationGUID")] - public Guid InvitationGuid { get; set; } - - public DateTime InvitationLastModified { get; set; } - - [StringLength(254)] - public string? InvitationUserEmail { get; set; } - - [ForeignKey("InvitationGroupId")] - [InverseProperty("CommunityInvitations")] - public virtual CommunityGroup? InvitationGroup { get; set; } - - [ForeignKey("InvitedByUserId")] - [InverseProperty("CommunityInvitationInvitedByUsers")] - public virtual CmsUser InvitedByUser { get; set; } = null!; - - [ForeignKey("InvitedUserId")] - [InverseProperty("CommunityInvitationInvitedUsers")] - public virtual CmsUser? InvitedUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ContentFile.cs b/Migration.Toolkit.K11/Models/ContentFile.cs deleted file mode 100644 index da05bec8..00000000 --- a/Migration.Toolkit.K11/Models/ContentFile.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_File")] -public class ContentFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [StringLength(500)] - public string? FileDescription { get; set; } - - [StringLength(100)] - public string FileName { get; set; } = null!; - - public Guid? FileAttachment { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/EventsAttendee.cs b/Migration.Toolkit.K11/Models/EventsAttendee.cs deleted file mode 100644 index ece716e8..00000000 --- a/Migration.Toolkit.K11/Models/EventsAttendee.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Events_Attendee")] -[Index("AttendeeEventNodeId", Name = "IX_Events_Attendee_AttendeeEventNodeID")] -public class EventsAttendee -{ - [Key] - [Column("AttendeeID")] - public int AttendeeId { get; set; } - - [StringLength(254)] - public string AttendeeEmail { get; set; } = null!; - - [StringLength(100)] - public string? AttendeeFirstName { get; set; } - - [StringLength(100)] - public string? AttendeeLastName { get; set; } - - [StringLength(50)] - public string? AttendeePhone { get; set; } - - [Column("AttendeeEventNodeID")] - public int AttendeeEventNodeId { get; set; } - - [Column("AttendeeGUID")] - public Guid AttendeeGuid { get; set; } - - public DateTime AttendeeLastModified { get; set; } - - [ForeignKey("AttendeeEventNodeId")] - [InverseProperty("EventsAttendees")] - public virtual CmsTree AttendeeEventNode { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ExportHistory.cs b/Migration.Toolkit.K11/Models/ExportHistory.cs deleted file mode 100644 index 41ef5363..00000000 --- a/Migration.Toolkit.K11/Models/ExportHistory.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Export_History")] -[Index("ExportSiteId", Name = "IX_Export_History_ExportSiteID")] -[Index("ExportUserId", Name = "IX_Export_History_ExportUserID")] -public class ExportHistory -{ - [Key] - [Column("ExportID")] - public int ExportId { get; set; } - - public DateTime ExportDateTime { get; set; } - - [StringLength(450)] - public string ExportFileName { get; set; } = null!; - - [Column("ExportSiteID")] - public int? ExportSiteId { get; set; } - - [Column("ExportUserID")] - public int? ExportUserId { get; set; } - - public string? ExportSettings { get; set; } - - [ForeignKey("ExportSiteId")] - [InverseProperty("ExportHistories")] - public virtual CmsSite? ExportSite { get; set; } - - [ForeignKey("ExportUserId")] - [InverseProperty("ExportHistories")] - public virtual CmsUser? ExportUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ExportTask.cs b/Migration.Toolkit.K11/Models/ExportTask.cs deleted file mode 100644 index 204ae5bf..00000000 --- a/Migration.Toolkit.K11/Models/ExportTask.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Export_Task")] -[Index("TaskSiteId", "TaskObjectType", Name = "IX_Export_Task_TaskSiteID_TaskObjectType")] -public class ExportTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [ForeignKey("TaskSiteId")] - [InverseProperty("ExportTasks")] - public virtual CmsSite? TaskSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ForumsAttachment.cs b/Migration.Toolkit.K11/Models/ForumsAttachment.cs deleted file mode 100644 index 3bf5eb62..00000000 --- a/Migration.Toolkit.K11/Models/ForumsAttachment.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Forums_Attachment")] -[Index("AttachmentSiteId", "AttachmentGuid", Name = "IX_Forums_Attachment_AttachmentGUID", IsUnique = true)] -[Index("AttachmentPostId", Name = "IX_Forums_Attachment_AttachmentPostID")] -public class ForumsAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(200)] - public string AttachmentFileName { get; set; } = null!; - - [StringLength(10)] - public string AttachmentFileExtension { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public int AttachmentFileSize { get; set; } - - public int? AttachmentImageHeight { get; set; } - - public int? AttachmentImageWidth { get; set; } - - [Column("AttachmentPostID")] - public int AttachmentPostId { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - [ForeignKey("AttachmentPostId")] - [InverseProperty("ForumsAttachments")] - public virtual ForumsForumPost AttachmentPost { get; set; } = null!; - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("ForumsAttachments")] - public virtual CmsSite AttachmentSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ForumsForum.cs b/Migration.Toolkit.K11/Models/ForumsForum.cs deleted file mode 100644 index 5c9f96b6..00000000 --- a/Migration.Toolkit.K11/Models/ForumsForum.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Forums_Forum")] -[Index("ForumCommunityGroupId", Name = "IX_Forums_Forum_ForumCommunityGroupID")] -[Index("ForumDocumentId", Name = "IX_Forums_Forum_ForumDocumentID")] -[Index("ForumSiteId", "ForumName", Name = "IX_Forums_Forum_ForumSiteID_ForumName")] -public class ForumsForum -{ - [Key] - [Column("ForumID")] - public int ForumId { get; set; } - - [Column("ForumGroupID")] - public int ForumGroupId { get; set; } - - [StringLength(200)] - public string ForumName { get; set; } = null!; - - [StringLength(200)] - public string ForumDisplayName { get; set; } = null!; - - public string? ForumDescription { get; set; } - - public int? ForumOrder { get; set; } - - [Column("ForumDocumentID")] - public int? ForumDocumentId { get; set; } - - public bool ForumOpen { get; set; } - - public bool ForumModerated { get; set; } - - public bool? ForumDisplayEmails { get; set; } - - public bool? ForumRequireEmail { get; set; } - - public int ForumAccess { get; set; } - - public int ForumThreads { get; set; } - - public int ForumPosts { get; set; } - - public DateTime? ForumLastPostTime { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserName { get; set; } - - [StringLength(200)] - public string? ForumBaseUrl { get; set; } - - public bool? ForumAllowChangeName { get; set; } - - [Column("ForumHTMLEditor")] - public bool? ForumHtmleditor { get; set; } - - [Column("ForumUseCAPTCHA")] - public bool? ForumUseCaptcha { get; set; } - - [Column("ForumGUID")] - public Guid ForumGuid { get; set; } - - public DateTime ForumLastModified { get; set; } - - [StringLength(200)] - public string? ForumUnsubscriptionUrl { get; set; } - - public bool? ForumIsLocked { get; set; } - - public string? ForumSettings { get; set; } - - public bool? ForumAuthorEdit { get; set; } - - public bool? ForumAuthorDelete { get; set; } - - public int? ForumType { get; set; } - - public int? ForumIsAnswerLimit { get; set; } - - public int? ForumImageMaxSideSize { get; set; } - - public DateTime? ForumLastPostTimeAbsolute { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserNameAbsolute { get; set; } - - public int? ForumPostsAbsolute { get; set; } - - public int? ForumThreadsAbsolute { get; set; } - - public int? ForumAttachmentMaxFileSize { get; set; } - - public int? ForumDiscussionActions { get; set; } - - [Column("ForumSiteID")] - public int ForumSiteId { get; set; } - - public bool? ForumLogActivity { get; set; } - - [Column("ForumCommunityGroupID")] - public int? ForumCommunityGroupId { get; set; } - - public bool? ForumEnableOptIn { get; set; } - - public bool? ForumSendOptInConfirmation { get; set; } - - [Column("ForumOptInApprovalURL")] - [StringLength(450)] - public string? ForumOptInApprovalUrl { get; set; } - - [ForeignKey("ForumCommunityGroupId")] - [InverseProperty("ForumsForums")] - public virtual CommunityGroup? ForumCommunityGroup { get; set; } - - [ForeignKey("ForumDocumentId")] - [InverseProperty("ForumsForums")] - public virtual CmsDocument? ForumDocument { get; set; } - - [ForeignKey("ForumGroupId")] - [InverseProperty("ForumsForums")] - public virtual ForumsForumGroup ForumGroup { get; set; } = null!; - - [ForeignKey("ForumSiteId")] - [InverseProperty("ForumsForums")] - public virtual CmsSite ForumSite { get; set; } = null!; - - [InverseProperty("PostForum")] - public virtual ICollection ForumsForumPosts { get; set; } = new List(); - - [InverseProperty("Forum")] - public virtual ICollection ForumsForumRoles { get; set; } = new List(); - - [InverseProperty("SubscriptionForum")] - public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); - - [InverseProperty("Forum")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [ForeignKey("ForumId")] - [InverseProperty("Forums")] - public virtual ICollection Users { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ForumsForumGroup.cs b/Migration.Toolkit.K11/Models/ForumsForumGroup.cs deleted file mode 100644 index eb811aa0..00000000 --- a/Migration.Toolkit.K11/Models/ForumsForumGroup.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Forums_ForumGroup")] -[Index("GroupGroupId", Name = "IX_Forums_ForumGroup_GroupGroupID")] -[Index("GroupSiteId", "GroupName", Name = "IX_Forums_ForumGroup_GroupSiteID_GroupName")] -public class ForumsForumGroup -{ - [Key] - [Column("GroupID")] - public int GroupId { get; set; } - - [Column("GroupSiteID")] - public int GroupSiteId { get; set; } - - [StringLength(200)] - public string GroupName { get; set; } = null!; - - [StringLength(200)] - public string GroupDisplayName { get; set; } = null!; - - public int? GroupOrder { get; set; } - - public string? GroupDescription { get; set; } - - [Column("GroupGUID")] - public Guid GroupGuid { get; set; } - - public DateTime GroupLastModified { get; set; } - - [StringLength(200)] - public string? GroupBaseUrl { get; set; } - - [StringLength(200)] - public string? GroupUnsubscriptionUrl { get; set; } - - [Column("GroupGroupID")] - public int? GroupGroupId { get; set; } - - public bool? GroupAuthorEdit { get; set; } - - public bool? GroupAuthorDelete { get; set; } - - public int? GroupType { get; set; } - - public int? GroupIsAnswerLimit { get; set; } - - public int? GroupImageMaxSideSize { get; set; } - - public bool? GroupDisplayEmails { get; set; } - - public bool? GroupRequireEmail { get; set; } - - [Column("GroupHTMLEditor")] - public bool? GroupHtmleditor { get; set; } - - [Column("GroupUseCAPTCHA")] - public bool? GroupUseCaptcha { get; set; } - - public int? GroupAttachmentMaxFileSize { get; set; } - - public int? GroupDiscussionActions { get; set; } - - public bool? GroupLogActivity { get; set; } - - public bool? GroupEnableOptIn { get; set; } - - public bool? GroupSendOptInConfirmation { get; set; } - - [Column("GroupOptInApprovalURL")] - [StringLength(450)] - public string? GroupOptInApprovalUrl { get; set; } - - [InverseProperty("ForumGroup")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [ForeignKey("GroupGroupId")] - [InverseProperty("ForumsForumGroups")] - public virtual CommunityGroup? GroupGroup { get; set; } - - [ForeignKey("GroupSiteId")] - [InverseProperty("ForumsForumGroups")] - public virtual CmsSite GroupSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ForumsForumPost.cs b/Migration.Toolkit.K11/Models/ForumsForumPost.cs deleted file mode 100644 index f117c464..00000000 --- a/Migration.Toolkit.K11/Models/ForumsForumPost.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Forums_ForumPost")] -[Index("PostApproved", Name = "IX_Forums_ForumPost_PostApproved")] -[Index("PostApprovedByUserId", Name = "IX_Forums_ForumPost_PostApprovedByUserID")] -[Index("PostForumId", Name = "IX_Forums_ForumPost_PostForumID")] -[Index("PostLevel", Name = "IX_Forums_ForumPost_PostLevel")] -[Index("PostParentId", Name = "IX_Forums_ForumPost_PostParentID")] -[Index("PostUserId", Name = "IX_Forums_ForumPost_PostUserID")] -public class ForumsForumPost -{ - [Key] - public int PostId { get; set; } - - [Column("PostForumID")] - public int PostForumId { get; set; } - - [Column("PostParentID")] - public int? PostParentId { get; set; } - - [Column("PostIDPath")] - public string PostIdpath { get; set; } = null!; - - public int PostLevel { get; set; } - - [StringLength(450)] - public string PostSubject { get; set; } = null!; - - [Column("PostUserID")] - public int? PostUserId { get; set; } - - [StringLength(200)] - public string PostUserName { get; set; } = null!; - - [StringLength(254)] - public string? PostUserMail { get; set; } - - public string? PostText { get; set; } - - public DateTime PostTime { get; set; } - - [Column("PostApprovedByUserID")] - public int? PostApprovedByUserId { get; set; } - - public int? PostThreadPosts { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserName { get; set; } - - public DateTime? PostThreadLastPostTime { get; set; } - - public string? PostUserSignature { get; set; } - - [Column("PostGUID")] - public Guid PostGuid { get; set; } - - public DateTime PostLastModified { get; set; } - - public bool? PostApproved { get; set; } - - public bool? PostIsLocked { get; set; } - - public int? PostIsAnswer { get; set; } - - public int PostStickOrder { get; set; } - - public int? PostViews { get; set; } - - public DateTime? PostLastEdit { get; set; } - - public string? PostInfo { get; set; } - - public int? PostAttachmentCount { get; set; } - - public int? PostType { get; set; } - - public int? PostThreadPostsAbsolute { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserNameAbsolute { get; set; } - - public DateTime? PostThreadLastPostTimeAbsolute { get; set; } - - public bool? PostQuestionSolved { get; set; } - - public int? PostIsNotAnswer { get; set; } - - [Column("PostSiteID")] - public int? PostSiteId { get; set; } - - [InverseProperty("AttachmentPost")] - public virtual ICollection ForumsAttachments { get; set; } = new List(); - - [InverseProperty("SubscriptionPost")] - public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); - - [InverseProperty("Post")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [InverseProperty("PostParent")] - public virtual ICollection InversePostParent { get; set; } = new List(); - - [ForeignKey("PostApprovedByUserId")] - [InverseProperty("ForumsForumPostPostApprovedByUsers")] - public virtual CmsUser? PostApprovedByUser { get; set; } - - [ForeignKey("PostForumId")] - [InverseProperty("ForumsForumPosts")] - public virtual ForumsForum PostForum { get; set; } = null!; - - [ForeignKey("PostParentId")] - [InverseProperty("InversePostParent")] - public virtual ForumsForumPost? PostParent { get; set; } - - [ForeignKey("PostUserId")] - [InverseProperty("ForumsForumPostPostUsers")] - public virtual CmsUser? PostUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ForumsForumRole.cs b/Migration.Toolkit.K11/Models/ForumsForumRole.cs deleted file mode 100644 index 8daf079b..00000000 --- a/Migration.Toolkit.K11/Models/ForumsForumRole.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("ForumId", "RoleId", "PermissionId")] -[Table("Forums_ForumRoles")] -[Index("PermissionId", Name = "IX_Forums_ForumRoles_PermissionID")] -[Index("RoleId", Name = "IX_Forums_ForumRoles_RoleID")] -public class ForumsForumRole -{ - [Key] - [Column("ForumID")] - public int ForumId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("ForumId")] - [InverseProperty("ForumsForumRoles")] - public virtual ForumsForum Forum { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("ForumsForumRoles")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("ForumsForumRoles")] - public virtual CmsRole Role { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ForumsForumSubscription.cs b/Migration.Toolkit.K11/Models/ForumsForumSubscription.cs deleted file mode 100644 index 31079334..00000000 --- a/Migration.Toolkit.K11/Models/ForumsForumSubscription.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Forums_ForumSubscription")] -[Index("SubscriptionForumId", Name = "IX_Forums_ForumSubscription_SubscriptionForumID")] -[Index("SubscriptionPostId", Name = "IX_Forums_ForumSubscription_SubscriptionPostID")] -[Index("SubscriptionUserId", Name = "IX_Forums_ForumSubscription_SubscriptionUserID")] -public class ForumsForumSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionUserID")] - public int? SubscriptionUserId { get; set; } - - [StringLength(254)] - public string? SubscriptionEmail { get; set; } - - [Column("SubscriptionForumID")] - public int SubscriptionForumId { get; set; } - - [Column("SubscriptionPostID")] - public int? SubscriptionPostId { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public DateTime SubscriptionLastModified { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [ForeignKey("SubscriptionForumId")] - [InverseProperty("ForumsForumSubscriptions")] - public virtual ForumsForum SubscriptionForum { get; set; } = null!; - - [ForeignKey("SubscriptionPostId")] - [InverseProperty("ForumsForumSubscriptions")] - public virtual ForumsForumPost? SubscriptionPost { get; set; } - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("ForumsForumSubscriptions")] - public virtual CmsUser? SubscriptionUser { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ForumsUserFavorite.cs b/Migration.Toolkit.K11/Models/ForumsUserFavorite.cs deleted file mode 100644 index 388cc7dd..00000000 --- a/Migration.Toolkit.K11/Models/ForumsUserFavorite.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Forums_UserFavorites")] -[Index("ForumId", Name = "IX_Forums_UserFavorites_ForumID")] -[Index("PostId", Name = "IX_Forums_UserFavorites_PostID")] -[Index("SiteId", Name = "IX_Forums_UserFavorites_SiteID")] -[Index("UserId", Name = "IX_Forums_UserFavorites_UserID")] -[Index("UserId", "PostId", "ForumId", Name = "IX_Forums_UserFavorites_UserID_PostID_ForumID", IsUnique = true)] -public class ForumsUserFavorite -{ - [Key] - [Column("FavoriteID")] - public int FavoriteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("PostID")] - public int? PostId { get; set; } - - [Column("ForumID")] - public int? ForumId { get; set; } - - [StringLength(100)] - public string? FavoriteName { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [Column("FavoriteGUID")] - public Guid FavoriteGuid { get; set; } - - public DateTime FavoriteLastModified { get; set; } - - [ForeignKey("ForumId")] - [InverseProperty("ForumsUserFavorites")] - public virtual ForumsForum? Forum { get; set; } - - [ForeignKey("PostId")] - [InverseProperty("ForumsUserFavorites")] - public virtual ForumsForumPost? Post { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("ForumsUserFavorites")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("ForumsUserFavorites")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/IntegrationConnector.cs b/Migration.Toolkit.K11/Models/IntegrationConnector.cs deleted file mode 100644 index 5788df5b..00000000 --- a/Migration.Toolkit.K11/Models/IntegrationConnector.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Integration_Connector")] -[Index("ConnectorEnabled", Name = "IX_Integration_Connector_ConnectorEnabled")] -public class IntegrationConnector -{ - [Key] - [Column("ConnectorID")] - public int ConnectorId { get; set; } - - [StringLength(100)] - public string ConnectorName { get; set; } = null!; - - [StringLength(440)] - public string ConnectorDisplayName { get; set; } = null!; - - [StringLength(400)] - public string ConnectorAssemblyName { get; set; } = null!; - - [StringLength(400)] - public string ConnectorClassName { get; set; } = null!; - - [Required] - public bool? ConnectorEnabled { get; set; } - - public DateTime ConnectorLastModified { get; set; } - - [InverseProperty("SynchronizationConnector")] - public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/IntegrationSyncLog.cs b/Migration.Toolkit.K11/Models/IntegrationSyncLog.cs deleted file mode 100644 index 6aad44c9..00000000 --- a/Migration.Toolkit.K11/Models/IntegrationSyncLog.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Integration_SyncLog")] -[Index("SyncLogSynchronizationId", Name = "IX_Integration_SyncLog_SyncLogTaskID")] -public class IntegrationSyncLog -{ - [Key] - [Column("SyncLogID")] - public int SyncLogId { get; set; } - - [Column("SyncLogSynchronizationID")] - public int SyncLogSynchronizationId { get; set; } - - public DateTime SyncLogTime { get; set; } - - public string? SyncLogErrorMessage { get; set; } - - [ForeignKey("SyncLogSynchronizationId")] - [InverseProperty("IntegrationSyncLogs")] - public virtual IntegrationSynchronization SyncLogSynchronization { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/IntegrationSynchronization.cs b/Migration.Toolkit.K11/Models/IntegrationSynchronization.cs deleted file mode 100644 index 618b1b86..00000000 --- a/Migration.Toolkit.K11/Models/IntegrationSynchronization.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Integration_Synchronization")] -[Index("SynchronizationConnectorId", Name = "IX_Integration_Synchronization_SynchronizationConnectorID")] -[Index("SynchronizationTaskId", Name = "IX_Integration_Synchronization_SynchronizationTaskID")] -public class IntegrationSynchronization -{ - [Key] - [Column("SynchronizationID")] - public int SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int SynchronizationTaskId { get; set; } - - [Column("SynchronizationConnectorID")] - public int SynchronizationConnectorId { get; set; } - - public DateTime SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - public bool? SynchronizationIsRunning { get; set; } - - [InverseProperty("SyncLogSynchronization")] - public virtual ICollection IntegrationSyncLogs { get; set; } = new List(); - - [ForeignKey("SynchronizationConnectorId")] - [InverseProperty("IntegrationSynchronizations")] - public virtual IntegrationConnector SynchronizationConnector { get; set; } = null!; - - [ForeignKey("SynchronizationTaskId")] - [InverseProperty("IntegrationSynchronizations")] - public virtual IntegrationTask SynchronizationTask { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/IntegrationTask.cs b/Migration.Toolkit.K11/Models/IntegrationTask.cs deleted file mode 100644 index 9e9f4c84..00000000 --- a/Migration.Toolkit.K11/Models/IntegrationTask.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Integration_Task")] -[Index("TaskIsInbound", Name = "IX_Integration_Task_TaskIsInbound")] -[Index("TaskSiteId", Name = "IX_Integration_Task_TaskSiteID")] -[Index("TaskType", Name = "IX_Integration_Task_TaskType")] -public class IntegrationTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool TaskIsInbound { get; set; } - - [StringLength(50)] - public string? TaskProcessType { get; set; } - - public string TaskData { get; set; } = null!; - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(50)] - public string? TaskDataType { get; set; } - - [InverseProperty("SynchronizationTask")] - public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); - - [ForeignKey("TaskSiteId")] - [InverseProperty("IntegrationTasks")] - public virtual CmsSite? TaskSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/MediaFile.cs b/Migration.Toolkit.K11/Models/MediaFile.cs deleted file mode 100644 index 576877b9..00000000 --- a/Migration.Toolkit.K11/Models/MediaFile.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Media_File")] -[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] -[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] -[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] -[Index("FileSiteId", "FileGuid", Name = "IX_Media_File_FileSiteID_FileGUID")] -public class MediaFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string FileTitle { get; set; } = null!; - - public string FileDescription { get; set; } = null!; - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public string FilePath { get; set; } = null!; - - public long FileSize { get; set; } - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileLibraryID")] - public int FileLibraryId { get; set; } - - [Column("FileSiteID")] - public int FileSiteId { get; set; } - - [Column("FileCreatedByUserID")] - public int? FileCreatedByUserId { get; set; } - - public DateTime FileCreatedWhen { get; set; } - - [Column("FileModifiedByUserID")] - public int? FileModifiedByUserId { get; set; } - - public DateTime FileModifiedWhen { get; set; } - - public string? FileCustomData { get; set; } - - [ForeignKey("FileCreatedByUserId")] - [InverseProperty("MediaFileFileCreatedByUsers")] - public virtual CmsUser? FileCreatedByUser { get; set; } - - [ForeignKey("FileLibraryId")] - [InverseProperty("MediaFiles")] - public virtual MediaLibrary FileLibrary { get; set; } = null!; - - [ForeignKey("FileModifiedByUserId")] - [InverseProperty("MediaFileFileModifiedByUsers")] - public virtual CmsUser? FileModifiedByUser { get; set; } - - [ForeignKey("FileSiteId")] - [InverseProperty("MediaFiles")] - public virtual CmsSite FileSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/MediaLibrary.cs b/Migration.Toolkit.K11/Models/MediaLibrary.cs deleted file mode 100644 index 8a62a308..00000000 --- a/Migration.Toolkit.K11/Models/MediaLibrary.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Media_Library")] -[Index("LibraryGroupId", Name = "IX_Media_Library_LibraryGroupID")] -[Index("LibrarySiteId", "LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] -public class MediaLibrary -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [StringLength(250)] - public string LibraryName { get; set; } = null!; - - [StringLength(250)] - public string LibraryDisplayName { get; set; } = null!; - - public string? LibraryDescription { get; set; } - - [StringLength(250)] - public string LibraryFolder { get; set; } = null!; - - public int? LibraryAccess { get; set; } - - [Column("LibraryGroupID")] - public int? LibraryGroupId { get; set; } - - [Column("LibrarySiteID")] - public int LibrarySiteId { get; set; } - - [Column("LibraryGUID")] - public Guid? LibraryGuid { get; set; } - - public DateTime? LibraryLastModified { get; set; } - - [StringLength(450)] - public string? LibraryTeaserPath { get; set; } - - [Column("LibraryTeaserGUID")] - public Guid? LibraryTeaserGuid { get; set; } - - [ForeignKey("LibraryGroupId")] - [InverseProperty("MediaLibraries")] - public virtual CommunityGroup? LibraryGroup { get; set; } - - [ForeignKey("LibrarySiteId")] - [InverseProperty("MediaLibraries")] - public virtual CmsSite LibrarySite { get; set; } = null!; - - [InverseProperty("FileLibrary")] - public virtual ICollection MediaFiles { get; set; } = new List(); - - [InverseProperty("Library")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/MediaLibraryRolePermission.cs b/Migration.Toolkit.K11/Models/MediaLibraryRolePermission.cs deleted file mode 100644 index 55df393b..00000000 --- a/Migration.Toolkit.K11/Models/MediaLibraryRolePermission.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("LibraryId", "RoleId", "PermissionId")] -[Table("Media_LibraryRolePermission")] -[Index("PermissionId", Name = "IX_Media_LibraryRolePermission_PermissionID")] -[Index("RoleId", Name = "IX_Media_LibraryRolePermission_RoleID")] -public class MediaLibraryRolePermission -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("LibraryId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual MediaLibrary Library { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual CmsRole Role { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/NewsletterAbtest.cs b/Migration.Toolkit.K11/Models/NewsletterAbtest.cs deleted file mode 100644 index 39b06af6..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterAbtest.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_ABTest")] -[Index("TestIssueId", Name = "IX_Newsletter_ABTest_TestIssueID", IsUnique = true)] -[Index("TestWinnerIssueId", Name = "IX_Newsletter_ABTest_TestWinnerIssueID")] -[Index("TestWinnerScheduledTaskId", Name = "IX_Newsletter_ABTest_TestWinnerScheduledTaskID")] -public class NewsletterAbtest -{ - [Key] - [Column("TestID")] - public int TestId { get; set; } - - [Column("TestIssueID")] - public int TestIssueId { get; set; } - - public int TestWinnerOption { get; set; } - - public int? TestSelectWinnerAfter { get; set; } - - [Column("TestWinnerIssueID")] - public int? TestWinnerIssueId { get; set; } - - public DateTime? TestWinnerSelected { get; set; } - - public DateTime TestLastModified { get; set; } - - [Column("TestGUID")] - public Guid TestGuid { get; set; } - - [Column("TestWinnerScheduledTaskID")] - public int? TestWinnerScheduledTaskId { get; set; } - - public int TestSizePercentage { get; set; } - - public int? TestNumberPerVariantEmails { get; set; } - - [ForeignKey("TestIssueId")] - [InverseProperty("NewsletterAbtestTestIssue")] - public virtual NewsletterNewsletterIssue TestIssue { get; set; } = null!; - - [ForeignKey("TestWinnerIssueId")] - [InverseProperty("NewsletterAbtestTestWinnerIssues")] - public virtual NewsletterNewsletterIssue? TestWinnerIssue { get; set; } - - [ForeignKey("TestWinnerScheduledTaskId")] - [InverseProperty("NewsletterAbtests")] - public virtual CmsScheduledTask? TestWinnerScheduledTask { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/NewsletterClickedLink.cs b/Migration.Toolkit.K11/Models/NewsletterClickedLink.cs deleted file mode 100644 index 3060af23..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterClickedLink.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_ClickedLink")] -[Index("ClickedLinkNewsletterLinkId", Name = "IX_Newsletter_ClickedLink_ClickedLinkNewsletterLinkID")] -public class NewsletterClickedLink -{ - [Key] - [Column("ClickedLinkID")] - public int ClickedLinkId { get; set; } - - public Guid ClickedLinkGuid { get; set; } - - [StringLength(254)] - public string ClickedLinkEmail { get; set; } = null!; - - [Column("ClickedLinkNewsletterLinkID")] - public int ClickedLinkNewsletterLinkId { get; set; } - - public DateTime? ClickedLinkTime { get; set; } - - [ForeignKey("ClickedLinkNewsletterLinkId")] - [InverseProperty("NewsletterClickedLinks")] - public virtual NewsletterLink ClickedLinkNewsletterLink { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/NewsletterEmail.cs b/Migration.Toolkit.K11/Models/NewsletterEmail.cs deleted file mode 100644 index 46187bb9..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterEmail.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_Emails")] -[Index("EmailGuid", Name = "IX_Newsletter_Emails_EmailGUID", IsUnique = true)] -[Index("EmailNewsletterIssueId", Name = "IX_Newsletter_Emails_EmailNewsletterIssueID")] -[Index("EmailSending", Name = "IX_Newsletter_Emails_EmailSending")] -[Index("EmailSiteId", Name = "IX_Newsletter_Emails_EmailSiteID")] -[Index("EmailSubscriberId", Name = "IX_Newsletter_Emails_EmailSubscriberID")] -public class NewsletterEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [Column("EmailNewsletterIssueID")] - public int EmailNewsletterIssueId { get; set; } - - [Column("EmailSubscriberID")] - public int? EmailSubscriberId { get; set; } - - [Column("EmailSiteID")] - public int EmailSiteId { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - public bool? EmailSending { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - [Column("EmailContactID")] - public int? EmailContactId { get; set; } - - [StringLength(254)] - public string? EmailAddress { get; set; } - - [ForeignKey("EmailNewsletterIssueId")] - [InverseProperty("NewsletterEmails")] - public virtual NewsletterNewsletterIssue EmailNewsletterIssue { get; set; } = null!; - - [ForeignKey("EmailSiteId")] - [InverseProperty("NewsletterEmails")] - public virtual CmsSite EmailSite { get; set; } = null!; - - [ForeignKey("EmailSubscriberId")] - [InverseProperty("NewsletterEmails")] - public virtual NewsletterSubscriber? EmailSubscriber { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/NewsletterEmailTemplate.cs b/Migration.Toolkit.K11/Models/NewsletterEmailTemplate.cs deleted file mode 100644 index 14a0fd0f..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterEmailTemplate.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_EmailTemplate")] -[Index("TemplateSiteId", "TemplateName", Name = "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateName", IsUnique = true)] -public class NewsletterEmailTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(250)] - public string TemplateDisplayName { get; set; } = null!; - - [StringLength(250)] - public string TemplateName { get; set; } = null!; - - [Column("TemplateSiteID")] - public int TemplateSiteId { get; set; } - - [StringLength(50)] - public string TemplateType { get; set; } = null!; - - [Column("TemplateGUID")] - public Guid TemplateGuid { get; set; } - - public DateTime TemplateLastModified { get; set; } - - [StringLength(450)] - public string? TemplateSubject { get; set; } - - [Column("TemplateThumbnailGUID")] - public Guid? TemplateThumbnailGuid { get; set; } - - public string? TemplateDescription { get; set; } - - [StringLength(200)] - public string? TemplateIconClass { get; set; } - - public string? TemplateCode { get; set; } - - [Column("TemplateInlineCSS")] - public bool TemplateInlineCss { get; set; } - - [InverseProperty("Template")] - public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); - - [InverseProperty("IssueTemplate")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [InverseProperty("NewsletterOptInTemplate")] - public virtual ICollection NewsletterNewsletterNewsletterOptInTemplates { get; set; } = new List(); - - [InverseProperty("NewsletterUnsubscriptionTemplate")] - public virtual ICollection NewsletterNewsletterNewsletterUnsubscriptionTemplates { get; set; } = new List(); - - [ForeignKey("TemplateSiteId")] - [InverseProperty("NewsletterEmailTemplates")] - public virtual CmsSite TemplateSite { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("Templates")] - public virtual ICollection Newsletters { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/NewsletterEmailWidget.cs b/Migration.Toolkit.K11/Models/NewsletterEmailWidget.cs deleted file mode 100644 index 794a1431..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterEmailWidget.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_EmailWidget")] -[Index("EmailWidgetSiteId", Name = "IX_Newsletter_EmailWidget_EmailWidgetSiteID")] -public class NewsletterEmailWidget -{ - [Key] - [Column("EmailWidgetID")] - public int EmailWidgetId { get; set; } - - public Guid EmailWidgetGuid { get; set; } - - public DateTime EmailWidgetLastModified { get; set; } - - [StringLength(250)] - public string EmailWidgetDisplayName { get; set; } = null!; - - [StringLength(250)] - public string EmailWidgetName { get; set; } = null!; - - public string? EmailWidgetDescription { get; set; } - - public string? EmailWidgetCode { get; set; } - - [Column("EmailWidgetSiteID")] - public int EmailWidgetSiteId { get; set; } - - [Column("EmailWidgetThumbnailGUID")] - public Guid? EmailWidgetThumbnailGuid { get; set; } - - [StringLength(200)] - public string? EmailWidgetIconCssClass { get; set; } - - public string? EmailWidgetProperties { get; set; } - - [ForeignKey("EmailWidgetSiteId")] - [InverseProperty("NewsletterEmailWidgets")] - public virtual CmsSite EmailWidgetSite { get; set; } = null!; - - [InverseProperty("EmailWidget")] - public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/NewsletterEmailWidgetTemplate.cs b/Migration.Toolkit.K11/Models/NewsletterEmailWidgetTemplate.cs deleted file mode 100644 index cb382c89..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterEmailWidgetTemplate.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_EmailWidgetTemplate")] -[Index("EmailWidgetId", Name = "IX_Newsletter_EmailWidgetTemplate_EmailWidgetID")] -[Index("TemplateId", Name = "IX_Newsletter_EmailWidgetTemplate_TemplateID")] -public class NewsletterEmailWidgetTemplate -{ - [Key] - [Column("EmailWidgetTemplateID")] - public int EmailWidgetTemplateId { get; set; } - - [Column("EmailWidgetID")] - public int EmailWidgetId { get; set; } - - [Column("TemplateID")] - public int TemplateId { get; set; } - - [ForeignKey("EmailWidgetId")] - [InverseProperty("NewsletterEmailWidgetTemplates")] - public virtual NewsletterEmailWidget EmailWidget { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("NewsletterEmailWidgetTemplates")] - public virtual NewsletterEmailTemplate Template { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/NewsletterIssueContactGroup.cs b/Migration.Toolkit.K11/Models/NewsletterIssueContactGroup.cs deleted file mode 100644 index 5d2c3b64..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterIssueContactGroup.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_IssueContactGroup")] -[Index("ContactGroupId", Name = "IX_Newsletter_IssueContactGroup_ContactGroupID")] -public class NewsletterIssueContactGroup -{ - [Key] - [Column("IssueContactGroupID")] - public int IssueContactGroupId { get; set; } - - [Column("IssueID")] - public int IssueId { get; set; } - - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [ForeignKey("ContactGroupId")] - [InverseProperty("NewsletterIssueContactGroups")] - public virtual OmContactGroup ContactGroup { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/NewsletterLink.cs b/Migration.Toolkit.K11/Models/NewsletterLink.cs deleted file mode 100644 index 304c6e2d..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterLink.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_Link")] -[Index("LinkIssueId", Name = "IX_Newsletter_Link_LinkIssueID")] -public class NewsletterLink -{ - [Key] - [Column("LinkID")] - public int LinkId { get; set; } - - [Column("LinkIssueID")] - public int LinkIssueId { get; set; } - - public string LinkTarget { get; set; } = null!; - - [StringLength(450)] - public string LinkDescription { get; set; } = null!; - - [Column("LinkGUID")] - public Guid LinkGuid { get; set; } - - [ForeignKey("LinkIssueId")] - [InverseProperty("NewsletterLinks")] - public virtual NewsletterNewsletterIssue LinkIssue { get; set; } = null!; - - [InverseProperty("ClickedLinkNewsletterLink")] - public virtual ICollection NewsletterClickedLinks { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/NewsletterNewsletter.cs b/Migration.Toolkit.K11/Models/NewsletterNewsletter.cs deleted file mode 100644 index 9294589d..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterNewsletter.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_Newsletter")] -[Index("NewsletterDynamicScheduledTaskId", Name = "IX_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID")] -[Index("NewsletterOptInTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterOptInTemplateID")] -[Index("NewsletterSiteId", "NewsletterName", Name = "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterName", IsUnique = true)] -[Index("NewsletterSubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterSubscriptionTemplateID")] -[Index("NewsletterUnsubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID")] -public class NewsletterNewsletter -{ - [Key] - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - [StringLength(250)] - public string NewsletterDisplayName { get; set; } = null!; - - [StringLength(250)] - public string NewsletterName { get; set; } = null!; - - [Column("NewsletterSubscriptionTemplateID")] - public int? NewsletterSubscriptionTemplateId { get; set; } - - [Column("NewsletterUnsubscriptionTemplateID")] - public int NewsletterUnsubscriptionTemplateId { get; set; } - - [StringLength(200)] - public string NewsletterSenderName { get; set; } = null!; - - [StringLength(254)] - public string NewsletterSenderEmail { get; set; } = null!; - - [StringLength(100)] - public string? NewsletterDynamicSubject { get; set; } - - [Column("NewsletterDynamicURL")] - [StringLength(500)] - public string? NewsletterDynamicUrl { get; set; } - - [Column("NewsletterDynamicScheduledTaskID")] - public int? NewsletterDynamicScheduledTaskId { get; set; } - - [Column("NewsletterSiteID")] - public int NewsletterSiteId { get; set; } - - [Column("NewsletterGUID")] - public Guid NewsletterGuid { get; set; } - - [StringLength(1000)] - public string? NewsletterUnsubscribeUrl { get; set; } - - [StringLength(500)] - public string? NewsletterBaseUrl { get; set; } - - public DateTime NewsletterLastModified { get; set; } - - public bool? NewsletterEnableOptIn { get; set; } - - [Column("NewsletterOptInTemplateID")] - public int? NewsletterOptInTemplateId { get; set; } - - public bool? NewsletterSendOptInConfirmation { get; set; } - - [Column("NewsletterOptInApprovalURL")] - [StringLength(450)] - public string? NewsletterOptInApprovalUrl { get; set; } - - public bool? NewsletterTrackOpenEmails { get; set; } - - public bool? NewsletterTrackClickedLinks { get; set; } - - [StringLength(998)] - public string? NewsletterDraftEmails { get; set; } - - public bool? NewsletterLogActivity { get; set; } - - [StringLength(5)] - public string NewsletterSource { get; set; } = null!; - - public int NewsletterType { get; set; } - - [ForeignKey("NewsletterDynamicScheduledTaskId")] - [InverseProperty("NewsletterNewsletters")] - public virtual CmsScheduledTask? NewsletterDynamicScheduledTask { get; set; } - - [InverseProperty("IssueNewsletter")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [ForeignKey("NewsletterOptInTemplateId")] - [InverseProperty("NewsletterNewsletterNewsletterOptInTemplates")] - public virtual NewsletterEmailTemplate? NewsletterOptInTemplate { get; set; } - - [ForeignKey("NewsletterSiteId")] - [InverseProperty("NewsletterNewsletters")] - public virtual CmsSite NewsletterSite { get; set; } = null!; - - [InverseProperty("Newsletter")] - public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); - - [ForeignKey("NewsletterUnsubscriptionTemplateId")] - [InverseProperty("NewsletterNewsletterNewsletterUnsubscriptionTemplates")] - public virtual NewsletterEmailTemplate NewsletterUnsubscriptionTemplate { get; set; } = null!; - - [InverseProperty("UnsubscriptionNewsletter")] - public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); - - [ForeignKey("NewsletterId")] - [InverseProperty("Newsletters")] - public virtual ICollection Templates { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/NewsletterNewsletterIssue.cs b/Migration.Toolkit.K11/Models/NewsletterNewsletterIssue.cs deleted file mode 100644 index 7a3342e6..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterNewsletterIssue.cs +++ /dev/null @@ -1,125 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_NewsletterIssue")] -[Index("IssueNewsletterId", Name = "IX_Newsletter_NewsletterIssue_IssueNewsletterID")] -[Index("IssueScheduledTaskId", Name = "IX_Newsletter_NewsletterIssue_IssueScheduledTaskID")] -[Index("IssueSiteId", Name = "IX_Newsletter_NewsletterIssue_IssueSiteID")] -[Index("IssueTemplateId", Name = "IX_Newsletter_NewsletterIssue_IssueTemplateID")] -[Index("IssueVariantOfIssueId", Name = "IX_Newsletter_NewsletterIssue_IssueVariantOfIssueID")] -public class NewsletterNewsletterIssue -{ - [Key] - [Column("IssueID")] - public int IssueId { get; set; } - - [StringLength(450)] - public string IssueSubject { get; set; } = null!; - - public string IssueText { get; set; } = null!; - - public int IssueUnsubscribed { get; set; } - - [Column("IssueNewsletterID")] - public int IssueNewsletterId { get; set; } - - [Column("IssueTemplateID")] - public int? IssueTemplateId { get; set; } - - public int IssueSentEmails { get; set; } - - public DateTime? IssueMailoutTime { get; set; } - - [Column("IssueGUID")] - public Guid IssueGuid { get; set; } - - public DateTime IssueLastModified { get; set; } - - [Column("IssueSiteID")] - public int IssueSiteId { get; set; } - - public int? IssueOpenedEmails { get; set; } - - public int? IssueBounces { get; set; } - - public int? IssueStatus { get; set; } - - [Column("IssueIsABTest")] - public bool? IssueIsAbtest { get; set; } - - [Column("IssueVariantOfIssueID")] - public int? IssueVariantOfIssueId { get; set; } - - [StringLength(200)] - public string? IssueVariantName { get; set; } - - [StringLength(200)] - public string? IssueSenderName { get; set; } - - [StringLength(254)] - public string? IssueSenderEmail { get; set; } - - [Column("IssueScheduledTaskID")] - public int? IssueScheduledTaskId { get; set; } - - [Column("IssueUTMSource")] - [StringLength(200)] - public string? IssueUtmsource { get; set; } - - [Column("IssueUseUTM")] - public bool IssueUseUtm { get; set; } - - [Column("IssueUTMCampaign")] - [StringLength(200)] - public string? IssueUtmcampaign { get; set; } - - [StringLength(200)] - public string IssueDisplayName { get; set; } = null!; - - public string? IssueWidgets { get; set; } - - public string? IssuePreheader { get; set; } - - public string? IssuePlainText { get; set; } - - [InverseProperty("IssueVariantOfIssue")] - public virtual ICollection InverseIssueVariantOfIssue { get; set; } = new List(); - - [ForeignKey("IssueNewsletterId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual NewsletterNewsletter IssueNewsletter { get; set; } = null!; - - [ForeignKey("IssueSiteId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual CmsSite IssueSite { get; set; } = null!; - - [ForeignKey("IssueTemplateId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual NewsletterEmailTemplate? IssueTemplate { get; set; } - - [ForeignKey("IssueVariantOfIssueId")] - [InverseProperty("InverseIssueVariantOfIssue")] - public virtual NewsletterNewsletterIssue? IssueVariantOfIssue { get; set; } - - [InverseProperty("TestIssue")] - public virtual NewsletterAbtest? NewsletterAbtestTestIssue { get; set; } - - [InverseProperty("TestWinnerIssue")] - public virtual ICollection NewsletterAbtestTestWinnerIssues { get; set; } = new List(); - - [InverseProperty("EmailNewsletterIssue")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("LinkIssue")] - public virtual ICollection NewsletterLinks { get; set; } = new List(); - - [InverseProperty("OpenedEmailIssue")] - public virtual ICollection NewsletterOpenedEmails { get; set; } = new List(); - - [InverseProperty("UnsubscriptionFromIssue")] - public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/NewsletterOpenedEmail.cs b/Migration.Toolkit.K11/Models/NewsletterOpenedEmail.cs deleted file mode 100644 index 330e8a6c..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterOpenedEmail.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_OpenedEmail")] -[Index("OpenedEmailIssueId", Name = "IX_Newsletter_OpenedEmail_OpenedEmailIssueID")] -public class NewsletterOpenedEmail -{ - [Key] - [Column("OpenedEmailID")] - public int OpenedEmailId { get; set; } - - [StringLength(254)] - public string OpenedEmailEmail { get; set; } = null!; - - public Guid OpenedEmailGuid { get; set; } - - public DateTime? OpenedEmailTime { get; set; } - - [Column("OpenedEmailIssueID")] - public int OpenedEmailIssueId { get; set; } - - [ForeignKey("OpenedEmailIssueId")] - [InverseProperty("NewsletterOpenedEmails")] - public virtual NewsletterNewsletterIssue OpenedEmailIssue { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/NewsletterSubscriber.cs b/Migration.Toolkit.K11/Models/NewsletterSubscriber.cs deleted file mode 100644 index 860cefdc..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterSubscriber.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_Subscriber")] -[Index("SubscriberEmail", Name = "IX_Newsletter_Subscriber_SubscriberEmail")] -[Index("SubscriberType", "SubscriberRelatedId", Name = "IX_Newsletter_Subscriber_SubscriberType_SubscriberRelatedID")] -public class NewsletterSubscriber -{ - [Key] - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [StringLength(254)] - public string? SubscriberEmail { get; set; } - - [StringLength(200)] - public string? SubscriberFirstName { get; set; } - - [StringLength(200)] - public string? SubscriberLastName { get; set; } - - [Column("SubscriberSiteID")] - public int SubscriberSiteId { get; set; } - - [Column("SubscriberGUID")] - public Guid SubscriberGuid { get; set; } - - public string? SubscriberCustomData { get; set; } - - [StringLength(100)] - public string? SubscriberType { get; set; } - - [Column("SubscriberRelatedID")] - public int SubscriberRelatedId { get; set; } - - public DateTime SubscriberLastModified { get; set; } - - [StringLength(440)] - public string? SubscriberFullName { get; set; } - - public int? SubscriberBounces { get; set; } - - [InverseProperty("EmailSubscriber")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("Subscriber")] - public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); - - [ForeignKey("SubscriberSiteId")] - [InverseProperty("NewsletterSubscribers")] - public virtual CmsSite SubscriberSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/NewsletterSubscriberNewsletter.cs b/Migration.Toolkit.K11/Models/NewsletterSubscriberNewsletter.cs deleted file mode 100644 index 65518eeb..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterSubscriberNewsletter.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_SubscriberNewsletter")] -[Index("NewsletterId", "SubscriptionApproved", Name = "IX_Newsletter_SubscriberNewsletter_NewsletterID_SubscriptionApproved")] -[Index("SubscriberId", "NewsletterId", Name = "UQ_Newsletter_SubscriberNewsletter", IsUnique = true)] -public class NewsletterSubscriberNewsletter -{ - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - public DateTime SubscribedWhen { get; set; } - - public bool? SubscriptionApproved { get; set; } - - public DateTime? SubscriptionApprovedWhen { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [Key] - [Column("SubscriberNewsletterID")] - public int SubscriberNewsletterId { get; set; } - - [ForeignKey("NewsletterId")] - [InverseProperty("NewsletterSubscriberNewsletters")] - public virtual NewsletterNewsletter Newsletter { get; set; } = null!; - - [ForeignKey("SubscriberId")] - [InverseProperty("NewsletterSubscriberNewsletters")] - public virtual NewsletterSubscriber Subscriber { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/NewsletterUnsubscription.cs b/Migration.Toolkit.K11/Models/NewsletterUnsubscription.cs deleted file mode 100644 index c4c70203..00000000 --- a/Migration.Toolkit.K11/Models/NewsletterUnsubscription.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_Unsubscription")] -[Index("UnsubscriptionEmail", "UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_Email_NewsletterID")] -[Index("UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_NewsletterID")] -[Index("UnsubscriptionFromIssueId", Name = "IX_Newsletter_Unsubscription_UnsubscriptionFromIssueID")] -public class NewsletterUnsubscription -{ - [Key] - [Column("UnsubscriptionID")] - public int UnsubscriptionId { get; set; } - - [StringLength(254)] - public string UnsubscriptionEmail { get; set; } = null!; - - public DateTime UnsubscriptionCreated { get; set; } - - [Column("UnsubscriptionNewsletterID")] - public int? UnsubscriptionNewsletterId { get; set; } - - [Column("UnsubscriptionFromIssueID")] - public int? UnsubscriptionFromIssueId { get; set; } - - [Column("UnsubscriptionGUID")] - public Guid UnsubscriptionGuid { get; set; } - - [ForeignKey("UnsubscriptionFromIssueId")] - [InverseProperty("NewsletterUnsubscriptions")] - public virtual NewsletterNewsletterIssue? UnsubscriptionFromIssue { get; set; } - - [ForeignKey("UnsubscriptionNewsletterId")] - [InverseProperty("NewsletterUnsubscriptions")] - public virtual NewsletterNewsletter? UnsubscriptionNewsletter { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/NotificationGateway.cs b/Migration.Toolkit.K11/Models/NotificationGateway.cs deleted file mode 100644 index fd2e1df8..00000000 --- a/Migration.Toolkit.K11/Models/NotificationGateway.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("Notification_Gateway")] -public class NotificationGateway -{ - [Key] - [Column("GatewayID")] - public int GatewayId { get; set; } - - [StringLength(200)] - public string GatewayName { get; set; } = null!; - - [StringLength(200)] - public string GatewayDisplayName { get; set; } = null!; - - [StringLength(200)] - public string GatewayAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string GatewayClassName { get; set; } = null!; - - public string? GatewayDescription { get; set; } - - public bool? GatewaySupportsEmail { get; set; } - - public bool? GatewaySupportsPlainText { get; set; } - - [Column("GatewaySupportsHTMLText")] - public bool? GatewaySupportsHtmltext { get; set; } - - public DateTime GatewayLastModified { get; set; } - - [Column("GatewayGUID")] - public Guid GatewayGuid { get; set; } - - public bool? GatewayEnabled { get; set; } - - [InverseProperty("SubscriptionGateway")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("Gateway")] - public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/NotificationSubscription.cs b/Migration.Toolkit.K11/Models/NotificationSubscription.cs deleted file mode 100644 index 5bddeb4c..00000000 --- a/Migration.Toolkit.K11/Models/NotificationSubscription.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Notification_Subscription")] -[Index("SubscriptionEventSource", "SubscriptionEventCode", "SubscriptionEventObjectId", Name = "IX_Notification_Subscription_SubscriptionEventSource_SubscriptionEventCode_SubscriptionEventObjectID")] -[Index("SubscriptionGatewayId", Name = "IX_Notification_Subscription_SubscriptionGatewayID")] -[Index("SubscriptionSiteId", Name = "IX_Notification_Subscription_SubscriptionSiteID")] -[Index("SubscriptionTemplateId", Name = "IX_Notification_Subscription_SubscriptionTemplateID")] -[Index("SubscriptionUserId", Name = "IX_Notification_Subscription_SubscriptionUserID")] -public class NotificationSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionGatewayID")] - public int SubscriptionGatewayId { get; set; } - - [Column("SubscriptionTemplateID")] - public int SubscriptionTemplateId { get; set; } - - [StringLength(100)] - public string? SubscriptionEventSource { get; set; } - - [StringLength(100)] - public string? SubscriptionEventCode { get; set; } - - [StringLength(250)] - public string SubscriptionEventDisplayName { get; set; } = null!; - - [Column("SubscriptionEventObjectID")] - public int? SubscriptionEventObjectId { get; set; } - - public DateTime SubscriptionTime { get; set; } - - [Column("SubscriptionUserID")] - public int SubscriptionUserId { get; set; } - - [StringLength(250)] - public string SubscriptionTarget { get; set; } = null!; - - public DateTime SubscriptionLastModified { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public string? SubscriptionEventData1 { get; set; } - - public string? SubscriptionEventData2 { get; set; } - - [Column("SubscriptionUseHTML")] - public bool? SubscriptionUseHtml { get; set; } - - [Column("SubscriptionSiteID")] - public int? SubscriptionSiteId { get; set; } - - [ForeignKey("SubscriptionGatewayId")] - [InverseProperty("NotificationSubscriptions")] - public virtual NotificationGateway SubscriptionGateway { get; set; } = null!; - - [ForeignKey("SubscriptionSiteId")] - [InverseProperty("NotificationSubscriptions")] - public virtual CmsSite? SubscriptionSite { get; set; } - - [ForeignKey("SubscriptionTemplateId")] - [InverseProperty("NotificationSubscriptions")] - public virtual NotificationTemplate SubscriptionTemplate { get; set; } = null!; - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("NotificationSubscriptions")] - public virtual CmsUser SubscriptionUser { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/NotificationTemplate.cs b/Migration.Toolkit.K11/Models/NotificationTemplate.cs deleted file mode 100644 index 089dd037..00000000 --- a/Migration.Toolkit.K11/Models/NotificationTemplate.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Notification_Template")] -[Index("TemplateSiteId", Name = "IX_Notification_Template_TemplateSiteID")] -public class NotificationTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(200)] - public string TemplateName { get; set; } = null!; - - [StringLength(200)] - public string TemplateDisplayName { get; set; } = null!; - - [Column("TemplateSiteID")] - public int? TemplateSiteId { get; set; } - - public DateTime TemplateLastModified { get; set; } - - [Column("TemplateGUID")] - public Guid TemplateGuid { get; set; } - - [InverseProperty("SubscriptionTemplate")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("Template")] - public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); - - [ForeignKey("TemplateSiteId")] - [InverseProperty("NotificationTemplates")] - public virtual CmsSite? TemplateSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/NotificationTemplateText.cs b/Migration.Toolkit.K11/Models/NotificationTemplateText.cs deleted file mode 100644 index 205b043d..00000000 --- a/Migration.Toolkit.K11/Models/NotificationTemplateText.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Notification_TemplateText")] -[Index("GatewayId", Name = "IX_Notification_TemplateText_GatewayID")] -[Index("TemplateId", Name = "IX_Notification_TemplateText_TemplateID")] -public class NotificationTemplateText -{ - [Key] - [Column("TemplateTextID")] - public int TemplateTextId { get; set; } - - [Column("TemplateID")] - public int TemplateId { get; set; } - - [Column("GatewayID")] - public int GatewayId { get; set; } - - [StringLength(250)] - public string TemplateSubject { get; set; } = null!; - - [Column("TemplateHTMLText")] - public string TemplateHtmltext { get; set; } = null!; - - public string TemplatePlainText { get; set; } = null!; - - [Column("TemplateTextGUID")] - public Guid TemplateTextGuid { get; set; } - - public DateTime TemplateTextLastModified { get; set; } - - [ForeignKey("GatewayId")] - [InverseProperty("NotificationTemplateTexts")] - public virtual NotificationGateway Gateway { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("NotificationTemplateTexts")] - public virtual NotificationTemplate Template { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/OmAbtest.cs b/Migration.Toolkit.K11/Models/OmAbtest.cs deleted file mode 100644 index e305c29e..00000000 --- a/Migration.Toolkit.K11/Models/OmAbtest.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ABTest")] -[Index("AbtestSiteId", Name = "IX_OM_ABTest_SiteID")] -public class OmAbtest -{ - [Key] - [Column("ABTestID")] - public int AbtestId { get; set; } - - [Column("ABTestName")] - [StringLength(50)] - public string AbtestName { get; set; } = null!; - - [Column("ABTestDescription")] - public string? AbtestDescription { get; set; } - - [Column("ABTestCulture")] - [StringLength(50)] - public string? AbtestCulture { get; set; } - - [Column("ABTestOriginalPage")] - [StringLength(450)] - public string AbtestOriginalPage { get; set; } = null!; - - [Column("ABTestOpenFrom")] - public DateTime? AbtestOpenFrom { get; set; } - - [Column("ABTestOpenTo")] - public DateTime? AbtestOpenTo { get; set; } - - [Column("ABTestSiteID")] - public int AbtestSiteId { get; set; } - - [Column("ABTestGUID")] - public Guid AbtestGuid { get; set; } - - [Column("ABTestLastModified")] - public DateTime AbtestLastModified { get; set; } - - [Column("ABTestDisplayName")] - [StringLength(100)] - public string AbtestDisplayName { get; set; } = null!; - - [Column("ABTestIncludedTraffic")] - public int AbtestIncludedTraffic { get; set; } - - [Column("ABTestVisitorTargeting")] - public string? AbtestVisitorTargeting { get; set; } - - [Column("ABTestConversions")] - public string? AbtestConversions { get; set; } - - [Column("ABTestWinnerGUID")] - public Guid? AbtestWinnerGuid { get; set; } - - [ForeignKey("AbtestSiteId")] - [InverseProperty("OmAbtests")] - public virtual CmsSite AbtestSite { get; set; } = null!; - - [InverseProperty("AbvariantTest")] - public virtual ICollection OmAbvariants { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/OmAbvariant.cs b/Migration.Toolkit.K11/Models/OmAbvariant.cs deleted file mode 100644 index 9aa05369..00000000 --- a/Migration.Toolkit.K11/Models/OmAbvariant.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ABVariant")] -[Index("AbvariantSiteId", Name = "IX_OM_ABVariant_ABVariantSiteID")] -[Index("AbvariantTestId", Name = "IX_OM_ABVariant_ABVariantTestID")] -public class OmAbvariant -{ - [Key] - [Column("ABVariantID")] - public int AbvariantId { get; set; } - - [Column("ABVariantDisplayName")] - [StringLength(110)] - public string AbvariantDisplayName { get; set; } = null!; - - [Column("ABVariantName")] - [StringLength(50)] - public string AbvariantName { get; set; } = null!; - - [Column("ABVariantTestID")] - public int AbvariantTestId { get; set; } - - [Column("ABVariantPath")] - [StringLength(450)] - public string AbvariantPath { get; set; } = null!; - - [Column("ABVariantGUID")] - public Guid AbvariantGuid { get; set; } - - [Column("ABVariantLastModified")] - public DateTime AbvariantLastModified { get; set; } - - [Column("ABVariantSiteID")] - public int AbvariantSiteId { get; set; } - - [ForeignKey("AbvariantSiteId")] - [InverseProperty("OmAbvariants")] - public virtual CmsSite AbvariantSite { get; set; } = null!; - - [ForeignKey("AbvariantTestId")] - [InverseProperty("OmAbvariants")] - public virtual OmAbtest AbvariantTest { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/OmAccount.cs b/Migration.Toolkit.K11/Models/OmAccount.cs deleted file mode 100644 index 4463f7f6..00000000 --- a/Migration.Toolkit.K11/Models/OmAccount.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_Account")] -[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] -[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] -[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] -[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] -[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] -[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] -[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] -public class OmAccount -{ - [Key] - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [ForeignKey("AccountCountryId")] - [InverseProperty("OmAccounts")] - public virtual CmsCountry? AccountCountry { get; set; } - - [ForeignKey("AccountOwnerUserId")] - [InverseProperty("OmAccounts")] - public virtual CmsUser? AccountOwnerUser { get; set; } - - [ForeignKey("AccountPrimaryContactId")] - [InverseProperty("OmAccountAccountPrimaryContacts")] - public virtual OmContact? AccountPrimaryContact { get; set; } - - [ForeignKey("AccountSecondaryContactId")] - [InverseProperty("OmAccountAccountSecondaryContacts")] - public virtual OmContact? AccountSecondaryContact { get; set; } - - [ForeignKey("AccountStateId")] - [InverseProperty("OmAccounts")] - public virtual CmsState? AccountState { get; set; } - - [ForeignKey("AccountStatusId")] - [InverseProperty("OmAccounts")] - public virtual OmAccountStatus? AccountStatus { get; set; } - - [ForeignKey("AccountSubsidiaryOfId")] - [InverseProperty("InverseAccountSubsidiaryOf")] - public virtual OmAccount? AccountSubsidiaryOf { get; set; } - - [InverseProperty("AccountSubsidiaryOf")] - public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); - - [InverseProperty("Account")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/OmAccountContact.cs b/Migration.Toolkit.K11/Models/OmAccountContact.cs deleted file mode 100644 index e257be3f..00000000 --- a/Migration.Toolkit.K11/Models/OmAccountContact.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_AccountContact")] -[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] -[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] -[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] -public class OmAccountContact -{ - [Key] - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("AccountId")] - [InverseProperty("OmAccountContacts")] - public virtual OmAccount Account { get; set; } = null!; - - [ForeignKey("ContactId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("ContactRoleId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContactRole? ContactRole { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/OmAccountStatus.cs b/Migration.Toolkit.K11/Models/OmAccountStatus.cs deleted file mode 100644 index 903b4932..00000000 --- a/Migration.Toolkit.K11/Models/OmAccountStatus.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_AccountStatus")] -public class OmAccountStatus -{ - [Key] - [Column("AccountStatusID")] - public int AccountStatusId { get; set; } - - [StringLength(200)] - public string AccountStatusName { get; set; } = null!; - - [StringLength(200)] - public string AccountStatusDisplayName { get; set; } = null!; - - public string? AccountStatusDescription { get; set; } - - [InverseProperty("AccountStatus")] - public virtual ICollection OmAccounts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/OmActivity.cs b/Migration.Toolkit.K11/Models/OmActivity.cs deleted file mode 100644 index 7c402f37..00000000 --- a/Migration.Toolkit.K11/Models/OmActivity.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_Activity")] -[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] -[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] -[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] -[Index("ActivitySiteId", Name = "IX_OM_Activity_ActivitySiteID")] -[Index("ActivityType", "ActivityItemId", "ActivityNodeId", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityNodeID_ActivityUTMSource_ActivityUTMContent_ActivityCampaign")] -public class OmActivity -{ - [Key] - [Column("ActivityID")] - public int ActivityId { get; set; } - - [Column("ActivityContactID")] - public int ActivityContactId { get; set; } - - public DateTime? ActivityCreated { get; set; } - - [StringLength(250)] - public string ActivityType { get; set; } = null!; - - [Column("ActivityItemID")] - public int? ActivityItemId { get; set; } - - [Column("ActivityItemDetailID")] - public int? ActivityItemDetailId { get; set; } - - [StringLength(250)] - public string? ActivityValue { get; set; } - - [Column("ActivityURL")] - public string? ActivityUrl { get; set; } - - [StringLength(250)] - public string? ActivityTitle { get; set; } - - [Column("ActivitySiteID")] - public int ActivitySiteId { get; set; } - - public string? ActivityComment { get; set; } - - [StringLength(200)] - public string? ActivityCampaign { get; set; } - - [Column("ActivityURLReferrer")] - public string? ActivityUrlreferrer { get; set; } - - [StringLength(10)] - public string? ActivityCulture { get; set; } - - [Column("ActivityNodeID")] - public int? ActivityNodeId { get; set; } - - [Column("ActivityUTMSource")] - [StringLength(200)] - public string? ActivityUtmsource { get; set; } - - [Column("ActivityABVariantName")] - [StringLength(200)] - public string? ActivityAbvariantName { get; set; } - - [Column("ActivityMVTCombinationName")] - [StringLength(200)] - public string? ActivityMvtcombinationName { get; set; } - - [Column("ActivityURLHash")] - public long ActivityUrlhash { get; set; } - - [Column("ActivityUTMContent")] - [StringLength(200)] - public string? ActivityUtmcontent { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/OmActivityRecalculationQueue.cs b/Migration.Toolkit.K11/Models/OmActivityRecalculationQueue.cs deleted file mode 100644 index 501c5375..00000000 --- a/Migration.Toolkit.K11/Models/OmActivityRecalculationQueue.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ActivityRecalculationQueue")] -public class OmActivityRecalculationQueue -{ - [Key] - [Column("ActivityRecalculationQueueID")] - public int ActivityRecalculationQueueId { get; set; } - - [Column("ActivityRecalculationQueueActivityID")] - public int ActivityRecalculationQueueActivityId { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/OmActivityType.cs b/Migration.Toolkit.K11/Models/OmActivityType.cs deleted file mode 100644 index 562dee28..00000000 --- a/Migration.Toolkit.K11/Models/OmActivityType.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ActivityType")] -public class OmActivityType -{ - [Key] - [Column("ActivityTypeID")] - public int ActivityTypeId { get; set; } - - [StringLength(250)] - public string ActivityTypeDisplayName { get; set; } = null!; - - [StringLength(250)] - public string ActivityTypeName { get; set; } = null!; - - public bool? ActivityTypeEnabled { get; set; } - - public bool? ActivityTypeIsCustom { get; set; } - - public string? ActivityTypeDescription { get; set; } - - public bool? ActivityTypeManualCreationAllowed { get; set; } - - [StringLength(200)] - public string? ActivityTypeMainFormControl { get; set; } - - [StringLength(200)] - public string? ActivityTypeDetailFormControl { get; set; } - - public bool ActivityTypeIsHiddenInContentOnly { get; set; } - - [StringLength(7)] - public string? ActivityTypeColor { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/OmContact.cs b/Migration.Toolkit.K11/Models/OmContact.cs deleted file mode 100644 index 55850a9b..00000000 --- a/Migration.Toolkit.K11/Models/OmContact.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_Contact")] -[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] -[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] -[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] -[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] -[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] -[Index("ContactPersonaId", "ContactLastName", Name = "IX_OM_Contact_ContactPersonaID_ContactLastName")] -[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] -[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] -public class OmContact -{ - [Key] - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(50)] - public string? ContactJobTitle { get; set; } - - [StringLength(100)] - public string? ContactAddress1 { get; set; } - - [StringLength(100)] - public string? ContactCity { get; set; } - - [Column("ContactZIP")] - [StringLength(100)] - public string? ContactZip { get; set; } - - [Column("ContactStateID")] - public int? ContactStateId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [StringLength(26)] - public string? ContactMobilePhone { get; set; } - - [StringLength(26)] - public string? ContactBusinessPhone { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - public DateTime? ContactBirthday { get; set; } - - public int? ContactGender { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - public string? ContactNotes { get; set; } - - [Column("ContactOwnerUserID")] - public int? ContactOwnerUserId { get; set; } - - public bool? ContactMonitored { get; set; } - - [Column("ContactGUID")] - public Guid ContactGuid { get; set; } - - public DateTime ContactLastModified { get; set; } - - public DateTime ContactCreated { get; set; } - - public int? ContactBounces { get; set; } - - [StringLength(200)] - public string? ContactCampaign { get; set; } - - [Column("ContactSalesForceLeadID")] - [StringLength(18)] - public string? ContactSalesForceLeadId { get; set; } - - public bool? ContactSalesForceLeadReplicationDisabled { get; set; } - - public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } - - public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } - - [StringLength(100)] - public string? ContactCompanyName { get; set; } - - public bool? ContactSalesForceLeadReplicationRequired { get; set; } - - [Column("ContactPersonaID")] - public int? ContactPersonaId { get; set; } - - [InverseProperty("ConsentAgreementContact")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [ForeignKey("ContactCountryId")] - [InverseProperty("OmContacts")] - public virtual CmsCountry? ContactCountry { get; set; } - - [ForeignKey("ContactOwnerUserId")] - [InverseProperty("OmContacts")] - public virtual CmsUser? ContactOwnerUser { get; set; } - - [ForeignKey("ContactStateId")] - [InverseProperty("OmContacts")] - public virtual CmsState? ContactState { get; set; } - - [ForeignKey("ContactStatusId")] - [InverseProperty("OmContacts")] - public virtual OmContactStatus? ContactStatus { get; set; } - - [InverseProperty("AccountPrimaryContact")] - public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); - - [InverseProperty("AccountSecondaryContact")] - public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmMemberships { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [InverseProperty("VisitorToContactContact")] - public virtual ICollection OmVisitorToContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/OmContactChangeRecalculationQueue.cs b/Migration.Toolkit.K11/Models/OmContactChangeRecalculationQueue.cs deleted file mode 100644 index 5b6e0fb4..00000000 --- a/Migration.Toolkit.K11/Models/OmContactChangeRecalculationQueue.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ContactChangeRecalculationQueue")] -public class OmContactChangeRecalculationQueue -{ - [Key] - [Column("ContactChangeRecalculationQueueID")] - public int ContactChangeRecalculationQueueId { get; set; } - - [Column("ContactChangeRecalculationQueueContactID")] - public int ContactChangeRecalculationQueueContactId { get; set; } - - public string? ContactChangeRecalculationQueueChangedColumns { get; set; } - - public bool ContactChangeRecalculationQueueContactIsNew { get; set; } - - public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/OmContactGroup.cs b/Migration.Toolkit.K11/Models/OmContactGroup.cs deleted file mode 100644 index 0142c661..00000000 --- a/Migration.Toolkit.K11/Models/OmContactGroup.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ContactGroup")] -public class OmContactGroup -{ - [Key] - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [StringLength(200)] - public string ContactGroupName { get; set; } = null!; - - [StringLength(200)] - public string ContactGroupDisplayName { get; set; } = null!; - - public string? ContactGroupDescription { get; set; } - - public string? ContactGroupDynamicCondition { get; set; } - - public bool? ContactGroupEnabled { get; set; } - - public DateTime? ContactGroupLastModified { get; set; } - - [Column("ContactGroupGUID")] - public Guid? ContactGroupGuid { get; set; } - - public int? ContactGroupStatus { get; set; } - - [InverseProperty("ContactGroup")] - public virtual ICollection NewsletterIssueContactGroups { get; set; } = new List(); - - [InverseProperty("ContactGroupMemberContactGroup")] - public virtual ICollection OmContactGroupMembers { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/OmContactGroupMember.cs b/Migration.Toolkit.K11/Models/OmContactGroupMember.cs deleted file mode 100644 index 3b4d3c87..00000000 --- a/Migration.Toolkit.K11/Models/OmContactGroupMember.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ContactGroupMember")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] -[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] -public class OmContactGroupMember -{ - [Key] - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - public int ContactGroupMemberType { get; set; } - - [Column("ContactGroupMemberRelatedID")] - public int ContactGroupMemberRelatedId { get; set; } - - public bool? ContactGroupMemberFromCondition { get; set; } - - public bool? ContactGroupMemberFromAccount { get; set; } - - public bool? ContactGroupMemberFromManual { get; set; } - - [ForeignKey("ContactGroupMemberContactGroupId")] - [InverseProperty("OmContactGroupMembers")] - public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/OmContactRole.cs b/Migration.Toolkit.K11/Models/OmContactRole.cs deleted file mode 100644 index 3e725325..00000000 --- a/Migration.Toolkit.K11/Models/OmContactRole.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ContactRole")] -public class OmContactRole -{ - [Key] - [Column("ContactRoleID")] - public int ContactRoleId { get; set; } - - [StringLength(200)] - public string ContactRoleName { get; set; } = null!; - - [StringLength(200)] - public string ContactRoleDisplayName { get; set; } = null!; - - public string? ContactRoleDescription { get; set; } - - [InverseProperty("ContactRole")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/OmContactStatus.cs b/Migration.Toolkit.K11/Models/OmContactStatus.cs deleted file mode 100644 index 9c5b78f9..00000000 --- a/Migration.Toolkit.K11/Models/OmContactStatus.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ContactStatus")] -public class OmContactStatus -{ - [Key] - [Column("ContactStatusID")] - public int ContactStatusId { get; set; } - - [StringLength(200)] - public string ContactStatusName { get; set; } = null!; - - [StringLength(200)] - public string ContactStatusDisplayName { get; set; } = null!; - - public string? ContactStatusDescription { get; set; } - - [InverseProperty("ContactStatus")] - public virtual ICollection OmContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/OmMembership.cs b/Migration.Toolkit.K11/Models/OmMembership.cs deleted file mode 100644 index d12b12d4..00000000 --- a/Migration.Toolkit.K11/Models/OmMembership.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_Membership")] -[Index("ContactId", Name = "IX_OM_Membership_ContactID")] -[Index("RelatedId", Name = "IX_OM_Membership_RelatedID")] -public class OmMembership -{ - [Key] - [Column("MembershipID")] - public int MembershipId { get; set; } - - [Column("RelatedID")] - public int RelatedId { get; set; } - - public int MemberType { get; set; } - - [Column("MembershipGUID")] - public Guid MembershipGuid { get; set; } - - public DateTime MembershipCreated { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("ContactId")] - [InverseProperty("OmMemberships")] - public virtual OmContact Contact { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/OmMvtcombination.cs b/Migration.Toolkit.K11/Models/OmMvtcombination.cs deleted file mode 100644 index fec0bddf..00000000 --- a/Migration.Toolkit.K11/Models/OmMvtcombination.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_MVTCombination")] -[Index("MvtcombinationPageTemplateId", Name = "IX_OM_MVTCombination_MVTCombinationPageTemplateID")] -public class OmMvtcombination -{ - [Key] - [Column("MVTCombinationID")] - public int MvtcombinationId { get; set; } - - [Column("MVTCombinationName")] - [StringLength(200)] - public string MvtcombinationName { get; set; } = null!; - - [Column("MVTCombinationCustomName")] - [StringLength(200)] - public string? MvtcombinationCustomName { get; set; } - - [Column("MVTCombinationPageTemplateID")] - public int MvtcombinationPageTemplateId { get; set; } - - [Column("MVTCombinationEnabled")] - public bool MvtcombinationEnabled { get; set; } - - [Column("MVTCombinationGUID")] - public Guid MvtcombinationGuid { get; set; } - - [Column("MVTCombinationLastModified")] - public DateTime MvtcombinationLastModified { get; set; } - - [Column("MVTCombinationIsDefault")] - public bool? MvtcombinationIsDefault { get; set; } - - [Column("MVTCombinationConversions")] - public int? MvtcombinationConversions { get; set; } - - [Column("MVTCombinationDocumentID")] - public int? MvtcombinationDocumentId { get; set; } - - [ForeignKey("MvtcombinationId")] - [InverseProperty("Mvtcombinations")] - public virtual ICollection Mvtvariants { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/OmMvtest.cs b/Migration.Toolkit.K11/Models/OmMvtest.cs deleted file mode 100644 index 44a72807..00000000 --- a/Migration.Toolkit.K11/Models/OmMvtest.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_MVTest")] -[Index("MvtestSiteId", Name = "IX_OM_MVTest_MVTestSiteID")] -public class OmMvtest -{ - [Key] - [Column("MVTestID")] - public int MvtestId { get; set; } - - [Column("MVTestName")] - [StringLength(50)] - public string MvtestName { get; set; } = null!; - - [Column("MVTestDescription")] - public string? MvtestDescription { get; set; } - - [Column("MVTestPage")] - [StringLength(450)] - public string MvtestPage { get; set; } = null!; - - [Column("MVTestSiteID")] - public int MvtestSiteId { get; set; } - - [Column("MVTestCulture")] - [StringLength(50)] - public string? MvtestCulture { get; set; } - - [Column("MVTestOpenFrom")] - public DateTime? MvtestOpenFrom { get; set; } - - [Column("MVTestOpenTo")] - public DateTime? MvtestOpenTo { get; set; } - - [Column("MVTestMaxConversions")] - public int? MvtestMaxConversions { get; set; } - - [Column("MVTestConversions")] - public int? MvtestConversions { get; set; } - - [Column("MVTestTargetConversionType")] - [StringLength(100)] - public string? MvtestTargetConversionType { get; set; } - - [Column("MVTestGUID")] - public Guid MvtestGuid { get; set; } - - [Column("MVTestLastModified")] - public DateTime MvtestLastModified { get; set; } - - [Column("MVTestEnabled")] - public bool MvtestEnabled { get; set; } - - [Column("MVTestDisplayName")] - [StringLength(100)] - public string MvtestDisplayName { get; set; } = null!; - - [ForeignKey("MvtestSiteId")] - [InverseProperty("OmMvtests")] - public virtual CmsSite MvtestSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/OmMvtvariant.cs b/Migration.Toolkit.K11/Models/OmMvtvariant.cs deleted file mode 100644 index 5ec98451..00000000 --- a/Migration.Toolkit.K11/Models/OmMvtvariant.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_MVTVariant")] -[Index("MvtvariantPageTemplateId", Name = "IX_OM_MVTVariant_MVTVariantPageTemplateID")] -public class OmMvtvariant -{ - [Key] - [Column("MVTVariantID")] - public int MvtvariantId { get; set; } - - [Column("MVTVariantName")] - [StringLength(100)] - public string MvtvariantName { get; set; } = null!; - - [Column("MVTVariantDisplayName")] - [StringLength(200)] - public string MvtvariantDisplayName { get; set; } = null!; - - [Column("MVTVariantInstanceGUID")] - public Guid? MvtvariantInstanceGuid { get; set; } - - [Column("MVTVariantZoneID")] - [StringLength(200)] - public string? MvtvariantZoneId { get; set; } - - [Column("MVTVariantPageTemplateID")] - public int MvtvariantPageTemplateId { get; set; } - - [Required] - [Column("MVTVariantEnabled")] - public bool? MvtvariantEnabled { get; set; } - - [Column("MVTVariantWebParts")] - public string? MvtvariantWebParts { get; set; } - - [Column("MVTVariantGUID")] - public Guid MvtvariantGuid { get; set; } - - [Column("MVTVariantLastModified")] - public DateTime MvtvariantLastModified { get; set; } - - [Column("MVTVariantDescription")] - public string? MvtvariantDescription { get; set; } - - [Column("MVTVariantDocumentID")] - public int? MvtvariantDocumentId { get; set; } - - [ForeignKey("MvtvariantPageTemplateId")] - [InverseProperty("OmMvtvariants")] - public virtual CmsPageTemplate MvtvariantPageTemplate { get; set; } = null!; - - [ForeignKey("MvtvariantId")] - [InverseProperty("Mvtvariants")] - public virtual ICollection Mvtcombinations { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/OmPersonalizationVariant.cs b/Migration.Toolkit.K11/Models/OmPersonalizationVariant.cs deleted file mode 100644 index 20adf1a0..00000000 --- a/Migration.Toolkit.K11/Models/OmPersonalizationVariant.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_PersonalizationVariant")] -[Index("VariantPageTemplateId", Name = "IX_OM_PersonalizationVariant_VariantDocumentID")] -[Index("VariantDocumentId", Name = "IX_OM_PersonalizationVariant_VariantPageTemplateID")] -public class OmPersonalizationVariant -{ - [Key] - [Column("VariantID")] - public int VariantId { get; set; } - - [Required] - public bool? VariantEnabled { get; set; } - - [StringLength(200)] - public string VariantName { get; set; } = null!; - - [StringLength(200)] - public string VariantDisplayName { get; set; } = null!; - - [Column("VariantInstanceGUID")] - public Guid? VariantInstanceGuid { get; set; } - - [Column("VariantZoneID")] - [StringLength(200)] - public string? VariantZoneId { get; set; } - - [Column("VariantPageTemplateID")] - public int VariantPageTemplateId { get; set; } - - public string VariantWebParts { get; set; } = null!; - - public int? VariantPosition { get; set; } - - [Column("VariantGUID")] - public Guid VariantGuid { get; set; } - - public DateTime VariantLastModified { get; set; } - - public string? VariantDescription { get; set; } - - [Column("VariantDocumentID")] - public int? VariantDocumentId { get; set; } - - public string VariantDisplayCondition { get; set; } = null!; - - [ForeignKey("VariantDocumentId")] - [InverseProperty("OmPersonalizationVariants")] - public virtual CmsDocument? VariantDocument { get; set; } - - [ForeignKey("VariantPageTemplateId")] - [InverseProperty("OmPersonalizationVariants")] - public virtual CmsPageTemplate VariantPageTemplate { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/OmRule.cs b/Migration.Toolkit.K11/Models/OmRule.cs deleted file mode 100644 index 0304db26..00000000 --- a/Migration.Toolkit.K11/Models/OmRule.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_Rule")] -[Index("RuleScoreId", Name = "IX_OM_Rule_RuleScoreID")] -public class OmRule -{ - [Key] - [Column("RuleID")] - public int RuleId { get; set; } - - [Column("RuleScoreID")] - public int RuleScoreId { get; set; } - - [StringLength(200)] - public string RuleDisplayName { get; set; } = null!; - - [StringLength(200)] - public string RuleName { get; set; } = null!; - - public int RuleValue { get; set; } - - public bool? RuleIsRecurring { get; set; } - - public int? RuleMaxPoints { get; set; } - - public DateTime? RuleValidUntil { get; set; } - - [StringLength(50)] - public string? RuleValidity { get; set; } - - public int? RuleValidFor { get; set; } - - public int RuleType { get; set; } - - [StringLength(250)] - public string? RuleParameter { get; set; } - - public string RuleCondition { get; set; } = null!; - - public DateTime RuleLastModified { get; set; } - - [Column("RuleGUID")] - public Guid RuleGuid { get; set; } - - public bool RuleBelongsToPersona { get; set; } - - [InverseProperty("Rule")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [ForeignKey("RuleScoreId")] - [InverseProperty("OmRules")] - public virtual OmScore RuleScore { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/OmScore.cs b/Migration.Toolkit.K11/Models/OmScore.cs deleted file mode 100644 index 5a736512..00000000 --- a/Migration.Toolkit.K11/Models/OmScore.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_Score")] -public class OmScore -{ - [Key] - [Column("ScoreID")] - public int ScoreId { get; set; } - - [StringLength(200)] - public string ScoreName { get; set; } = null!; - - [StringLength(200)] - public string ScoreDisplayName { get; set; } = null!; - - public string? ScoreDescription { get; set; } - - public bool ScoreEnabled { get; set; } - - public int? ScoreEmailAtScore { get; set; } - - [StringLength(998)] - public string? ScoreNotificationEmail { get; set; } - - public DateTime ScoreLastModified { get; set; } - - [Column("ScoreGUID")] - public Guid ScoreGuid { get; set; } - - public int? ScoreStatus { get; set; } - - [Column("ScoreScheduledTaskID")] - public int? ScoreScheduledTaskId { get; set; } - - public bool ScoreBelongsToPersona { get; set; } - - [InverseProperty("RuleScore")] - public virtual ICollection OmRules { get; set; } = new List(); - - [InverseProperty("Score")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/OmScoreContactRule.cs b/Migration.Toolkit.K11/Models/OmScoreContactRule.cs deleted file mode 100644 index b2b954b9..00000000 --- a/Migration.Toolkit.K11/Models/OmScoreContactRule.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ScoreContactRule")] -[Index("ContactId", Name = "IX_OM_ScoreContactRule_ContactID")] -[Index("RuleId", Name = "IX_OM_ScoreContactRule_RuleID")] -[Index("ScoreId", Name = "IX_OM_ScoreContactRule_ScoreID_ContactID_Value_Expiration")] -[Index("ScoreId", "ContactId", "RuleId", Name = "UQ_OM_ScoreContactRule", IsUnique = true)] -public class OmScoreContactRule -{ - [Column("ScoreID")] - public int ScoreId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("RuleID")] - public int RuleId { get; set; } - - public int Value { get; set; } - - public DateTime? Expiration { get; set; } - - [Key] - [Column("ScoreContactRuleID")] - public int ScoreContactRuleId { get; set; } - - [ForeignKey("ContactId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("RuleId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmRule Rule { get; set; } = null!; - - [ForeignKey("ScoreId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmScore Score { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/OmVisitorToContact.cs b/Migration.Toolkit.K11/Models/OmVisitorToContact.cs deleted file mode 100644 index c2e81723..00000000 --- a/Migration.Toolkit.K11/Models/OmVisitorToContact.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_VisitorToContact")] -[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] -[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] -public class OmVisitorToContact -{ - [Key] - [Column("VisitorToContactID")] - public int VisitorToContactId { get; set; } - - [Column("VisitorToContactVisitorGUID")] - public Guid VisitorToContactVisitorGuid { get; set; } - - [Column("VisitorToContactContactID")] - public int VisitorToContactContactId { get; set; } - - [ForeignKey("VisitorToContactContactId")] - [InverseProperty("OmVisitorToContacts")] - public virtual OmContact VisitorToContactContact { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/PersonasPersona.cs b/Migration.Toolkit.K11/Models/PersonasPersona.cs deleted file mode 100644 index c490b093..00000000 --- a/Migration.Toolkit.K11/Models/PersonasPersona.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Personas_Persona")] -[Index("PersonaScoreId", Name = "IX_Personas_Persona_PersonaScoreID")] -public class PersonasPersona -{ - [Key] - [Column("PersonaID")] - public int PersonaId { get; set; } - - [StringLength(200)] - public string PersonaDisplayName { get; set; } = null!; - - [StringLength(200)] - public string PersonaName { get; set; } = null!; - - public string? PersonaDescription { get; set; } - - [Required] - public bool? PersonaEnabled { get; set; } - - [Column("PersonaGUID")] - public Guid PersonaGuid { get; set; } - - [Column("PersonaScoreID")] - public int PersonaScoreId { get; set; } - - [Column("PersonaPictureMetafileGUID")] - public Guid? PersonaPictureMetafileGuid { get; set; } - - public int PersonaPointsThreshold { get; set; } - - [InverseProperty("PersonaContactHistoryPersona")] - public virtual ICollection PersonasPersonaContactHistories { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/PersonasPersonaContactHistory.cs b/Migration.Toolkit.K11/Models/PersonasPersonaContactHistory.cs deleted file mode 100644 index 2184bf7f..00000000 --- a/Migration.Toolkit.K11/Models/PersonasPersonaContactHistory.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Personas_PersonaContactHistory")] -[Index("PersonaContactHistoryPersonaId", Name = "IX_Personas_PersonaContactHistoryPersonaID")] -public class PersonasPersonaContactHistory -{ - [Key] - [Column("PersonaContactHistoryID")] - public int PersonaContactHistoryId { get; set; } - - [Column("PersonaContactHistoryPersonaID")] - public int? PersonaContactHistoryPersonaId { get; set; } - - [Column(TypeName = "date")] - public DateTime PersonaContactHistoryDate { get; set; } - - public int PersonaContactHistoryContacts { get; set; } - - [ForeignKey("PersonaContactHistoryPersonaId")] - [InverseProperty("PersonasPersonaContactHistories")] - public virtual PersonasPersona? PersonaContactHistoryPersona { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/PersonasPersonaNode.cs b/Migration.Toolkit.K11/Models/PersonasPersonaNode.cs deleted file mode 100644 index b8930a1f..00000000 --- a/Migration.Toolkit.K11/Models/PersonasPersonaNode.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("PersonaId", "NodeId")] -[Table("Personas_PersonaNode")] -[Index("NodeId", Name = "IX_Personas_PersonaNode_NodeID")] -[Index("PersonaId", Name = "IX_Personas_PersonaNode_PersonaID")] -public class PersonasPersonaNode -{ - [Key] - [Column("PersonaID")] - public int PersonaId { get; set; } - - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - [ForeignKey("NodeId")] - [InverseProperty("PersonasPersonaNodes")] - public virtual CmsTree Node { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/PollsPoll.cs b/Migration.Toolkit.K11/Models/PollsPoll.cs deleted file mode 100644 index e0373e9c..00000000 --- a/Migration.Toolkit.K11/Models/PollsPoll.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Polls_Poll")] -[Index("PollGroupId", Name = "IX_Polls_Poll_PollGroupID")] -[Index("PollSiteId", "PollCodeName", Name = "IX_Polls_Poll_PollSiteID_PollCodeName")] -public class PollsPoll -{ - [Key] - [Column("PollID")] - public int PollId { get; set; } - - [StringLength(200)] - public string PollCodeName { get; set; } = null!; - - [StringLength(200)] - public string PollDisplayName { get; set; } = null!; - - [StringLength(100)] - public string? PollTitle { get; set; } - - public DateTime? PollOpenFrom { get; set; } - - public DateTime? PollOpenTo { get; set; } - - public bool PollAllowMultipleAnswers { get; set; } - - [StringLength(450)] - public string PollQuestion { get; set; } = null!; - - public int PollAccess { get; set; } - - [StringLength(450)] - public string? PollResponseMessage { get; set; } - - [Column("PollGUID")] - public Guid PollGuid { get; set; } - - public DateTime PollLastModified { get; set; } - - [Column("PollGroupID")] - public int? PollGroupId { get; set; } - - [Column("PollSiteID")] - public int? PollSiteId { get; set; } - - public bool? PollLogActivity { get; set; } - - [ForeignKey("PollGroupId")] - [InverseProperty("PollsPolls")] - public virtual CommunityGroup? PollGroup { get; set; } - - [ForeignKey("PollSiteId")] - [InverseProperty("PollsPolls")] - public virtual CmsSite? PollSite { get; set; } - - [InverseProperty("AnswerPoll")] - public virtual ICollection PollsPollAnswers { get; set; } = new List(); - - [ForeignKey("PollId")] - [InverseProperty("Polls")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("PollId")] - [InverseProperty("Polls")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/PollsPollAnswer.cs b/Migration.Toolkit.K11/Models/PollsPollAnswer.cs deleted file mode 100644 index 8acd619d..00000000 --- a/Migration.Toolkit.K11/Models/PollsPollAnswer.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Polls_PollAnswer")] -[Index("AnswerPollId", Name = "IX_Polls_PollAnswer_AnswerPollID")] -public class PollsPollAnswer -{ - [Key] - [Column("AnswerID")] - public int AnswerId { get; set; } - - [StringLength(200)] - public string AnswerText { get; set; } = null!; - - public int? AnswerOrder { get; set; } - - public int? AnswerCount { get; set; } - - public bool? AnswerEnabled { get; set; } - - [Column("AnswerPollID")] - public int AnswerPollId { get; set; } - - [Column("AnswerGUID")] - public Guid AnswerGuid { get; set; } - - public DateTime AnswerLastModified { get; set; } - - [StringLength(100)] - public string? AnswerForm { get; set; } - - [StringLength(100)] - public string? AnswerAlternativeForm { get; set; } - - public bool? AnswerHideForm { get; set; } - - [ForeignKey("AnswerPollId")] - [InverseProperty("PollsPollAnswers")] - public virtual PollsPoll AnswerPoll { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ReportingReport.cs b/Migration.Toolkit.K11/Models/ReportingReport.cs deleted file mode 100644 index 82d9183d..00000000 --- a/Migration.Toolkit.K11/Models/ReportingReport.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_Report")] -[Index("ReportCategoryId", Name = "IX_Reporting_Report_ReportCategoryID")] -[Index("ReportGuid", "ReportName", Name = "IX_Reporting_Report_ReportGUID_ReportName")] -[Index("ReportName", Name = "IX_Reporting_Report_ReportName", IsUnique = true)] -public class ReportingReport -{ - [Key] - [Column("ReportID")] - public int ReportId { get; set; } - - [StringLength(200)] - public string ReportName { get; set; } = null!; - - [StringLength(440)] - public string ReportDisplayName { get; set; } = null!; - - public string? ReportLayout { get; set; } - - public string? ReportParameters { get; set; } - - [Column("ReportCategoryID")] - public int ReportCategoryId { get; set; } - - public int ReportAccess { get; set; } - - [Column("ReportGUID")] - public Guid ReportGuid { get; set; } - - public DateTime ReportLastModified { get; set; } - - public bool? ReportEnableSubscription { get; set; } - - [StringLength(100)] - public string? ReportConnectionString { get; set; } - - [ForeignKey("ReportCategoryId")] - [InverseProperty("ReportingReports")] - public virtual ReportingReportCategory ReportCategory { get; set; } = null!; - - [InverseProperty("GraphReport")] - public virtual ICollection ReportingReportGraphs { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionReport")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("TableReport")] - public virtual ICollection ReportingReportTables { get; set; } = new List(); - - [InverseProperty("ValueReport")] - public virtual ICollection ReportingReportValues { get; set; } = new List(); - - [InverseProperty("SavedReportReport")] - public virtual ICollection ReportingSavedReports { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ReportingReportCategory.cs b/Migration.Toolkit.K11/Models/ReportingReportCategory.cs deleted file mode 100644 index 203752de..00000000 --- a/Migration.Toolkit.K11/Models/ReportingReportCategory.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_ReportCategory")] -[Index("CategoryParentId", Name = "IX_Reporting_ReportCategory_CategoryParentID")] -public class ReportingReportCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryCodeName { get; set; } = null!; - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public string CategoryPath { get; set; } = null!; - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryReportChildCount { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual ReportingReportCategory? CategoryParent { get; set; } - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); - - [InverseProperty("ReportCategory")] - public virtual ICollection ReportingReports { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ReportingReportGraph.cs b/Migration.Toolkit.K11/Models/ReportingReportGraph.cs deleted file mode 100644 index a9bc7652..00000000 --- a/Migration.Toolkit.K11/Models/ReportingReportGraph.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_ReportGraph")] -[Index("GraphGuid", Name = "IX_Reporting_ReportGraph_GraphGUID", IsUnique = true)] -[Index("GraphReportId", "GraphName", Name = "IX_Reporting_ReportGraph_GraphReportID_GraphName", IsUnique = true)] -public class ReportingReportGraph -{ - [Key] - [Column("GraphID")] - public int GraphId { get; set; } - - [StringLength(100)] - public string GraphName { get; set; } = null!; - - [StringLength(450)] - public string GraphDisplayName { get; set; } = null!; - - public string GraphQuery { get; set; } = null!; - - public bool GraphQueryIsStoredProcedure { get; set; } - - [StringLength(50)] - public string GraphType { get; set; } = null!; - - [Column("GraphReportID")] - public int GraphReportId { get; set; } - - [StringLength(200)] - public string? GraphTitle { get; set; } - - [Column("GraphXAxisTitle")] - [StringLength(200)] - public string? GraphXaxisTitle { get; set; } - - [Column("GraphYAxisTitle")] - [StringLength(200)] - public string? GraphYaxisTitle { get; set; } - - public int? GraphWidth { get; set; } - - public int? GraphHeight { get; set; } - - public int? GraphLegendPosition { get; set; } - - public string? GraphSettings { get; set; } - - [Column("GraphGUID")] - public Guid GraphGuid { get; set; } - - public DateTime GraphLastModified { get; set; } - - public bool? GraphIsHtml { get; set; } - - [StringLength(100)] - public string? GraphConnectionString { get; set; } - - [ForeignKey("GraphReportId")] - [InverseProperty("ReportingReportGraphs")] - public virtual ReportingReport GraphReport { get; set; } = null!; - - [InverseProperty("ReportSubscriptionGraph")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/ReportingReportSubscription.cs b/Migration.Toolkit.K11/Models/ReportingReportSubscription.cs deleted file mode 100644 index 19521464..00000000 --- a/Migration.Toolkit.K11/Models/ReportingReportSubscription.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_ReportSubscription")] -[Index("ReportSubscriptionGraphId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionGraphID")] -[Index("ReportSubscriptionReportId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionReportID")] -[Index("ReportSubscriptionSiteId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionSiteID")] -[Index("ReportSubscriptionTableId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionTableID")] -[Index("ReportSubscriptionUserId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionUserID")] -[Index("ReportSubscriptionValueId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionValueID")] -public class ReportingReportSubscription -{ - [Key] - [Column("ReportSubscriptionID")] - public int ReportSubscriptionId { get; set; } - - [Column("ReportSubscriptionReportID")] - public int ReportSubscriptionReportId { get; set; } - - [StringLength(1000)] - public string ReportSubscriptionInterval { get; set; } = null!; - - public string? ReportSubscriptionCondition { get; set; } - - [Required] - public bool? ReportSubscriptionEnabled { get; set; } - - public string? ReportSubscriptionParameters { get; set; } - - [Column("ReportSubscriptionGUID")] - public Guid ReportSubscriptionGuid { get; set; } - - public DateTime ReportSubscriptionLastModified { get; set; } - - [StringLength(200)] - public string? ReportSubscriptionSubject { get; set; } - - [Column("ReportSubscriptionGraphID")] - public int? ReportSubscriptionGraphId { get; set; } - - [Column("ReportSubscriptionTableID")] - public int? ReportSubscriptionTableId { get; set; } - - [Column("ReportSubscriptionValueID")] - public int? ReportSubscriptionValueId { get; set; } - - [Column("ReportSubscriptionUserID")] - public int ReportSubscriptionUserId { get; set; } - - [StringLength(400)] - public string ReportSubscriptionEmail { get; set; } = null!; - - [Required] - public bool? ReportSubscriptionOnlyNonEmpty { get; set; } - - public DateTime? ReportSubscriptionLastPostDate { get; set; } - - public DateTime? ReportSubscriptionNextPostDate { get; set; } - - [Column("ReportSubscriptionSiteID")] - public int ReportSubscriptionSiteId { get; set; } - - public string? ReportSubscriptionSettings { get; set; } - - [ForeignKey("ReportSubscriptionGraphId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportGraph? ReportSubscriptionGraph { get; set; } - - [ForeignKey("ReportSubscriptionReportId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReport ReportSubscriptionReport { get; set; } = null!; - - [ForeignKey("ReportSubscriptionSiteId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual CmsSite ReportSubscriptionSite { get; set; } = null!; - - [ForeignKey("ReportSubscriptionTableId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportTable? ReportSubscriptionTable { get; set; } - - [ForeignKey("ReportSubscriptionUserId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual CmsUser ReportSubscriptionUser { get; set; } = null!; - - [ForeignKey("ReportSubscriptionValueId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportValue? ReportSubscriptionValue { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ReportingReportTable.cs b/Migration.Toolkit.K11/Models/ReportingReportTable.cs deleted file mode 100644 index 1b068300..00000000 --- a/Migration.Toolkit.K11/Models/ReportingReportTable.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_ReportTable")] -[Index("TableReportId", Name = "IX_Reporting_ReportTable_TableReportID")] -[Index("TableName", "TableReportId", Name = "IX_Reporting_ReportTable_TableReportID_TableName", IsUnique = true)] -public class ReportingReportTable -{ - [Key] - [Column("TableID")] - public int TableId { get; set; } - - [StringLength(100)] - public string TableName { get; set; } = null!; - - [StringLength(450)] - public string TableDisplayName { get; set; } = null!; - - public string TableQuery { get; set; } = null!; - - public bool TableQueryIsStoredProcedure { get; set; } - - [Column("TableReportID")] - public int TableReportId { get; set; } - - public string? TableSettings { get; set; } - - [Column("TableGUID")] - public Guid TableGuid { get; set; } - - public DateTime TableLastModified { get; set; } - - [StringLength(100)] - public string? TableConnectionString { get; set; } - - [InverseProperty("ReportSubscriptionTable")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [ForeignKey("TableReportId")] - [InverseProperty("ReportingReportTables")] - public virtual ReportingReport TableReport { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ReportingReportValue.cs b/Migration.Toolkit.K11/Models/ReportingReportValue.cs deleted file mode 100644 index 2cf5b978..00000000 --- a/Migration.Toolkit.K11/Models/ReportingReportValue.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_ReportValue")] -[Index("ValueName", "ValueReportId", Name = "IX_Reporting_ReportValue_ValueName_ValueReportID")] -[Index("ValueReportId", Name = "IX_Reporting_ReportValue_ValueReportID")] -public class ReportingReportValue -{ - [Key] - [Column("ValueID")] - public int ValueId { get; set; } - - [StringLength(100)] - public string ValueName { get; set; } = null!; - - [StringLength(450)] - public string ValueDisplayName { get; set; } = null!; - - public string ValueQuery { get; set; } = null!; - - public bool ValueQueryIsStoredProcedure { get; set; } - - [StringLength(200)] - public string? ValueFormatString { get; set; } - - [Column("ValueReportID")] - public int ValueReportId { get; set; } - - [Column("ValueGUID")] - public Guid ValueGuid { get; set; } - - public DateTime ValueLastModified { get; set; } - - public string? ValueSettings { get; set; } - - [StringLength(100)] - public string? ValueConnectionString { get; set; } - - [InverseProperty("ReportSubscriptionValue")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [ForeignKey("ValueReportId")] - [InverseProperty("ReportingReportValues")] - public virtual ReportingReport ValueReport { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ReportingSavedGraph.cs b/Migration.Toolkit.K11/Models/ReportingSavedGraph.cs deleted file mode 100644 index 18217ce6..00000000 --- a/Migration.Toolkit.K11/Models/ReportingSavedGraph.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_SavedGraph")] -[Index("SavedGraphGuid", Name = "IX_Reporting_SavedGraph_SavedGraphGUID")] -[Index("SavedGraphSavedReportId", Name = "IX_Reporting_SavedGraph_SavedGraphSavedReportID")] -public class ReportingSavedGraph -{ - [Key] - [Column("SavedGraphID")] - public int SavedGraphId { get; set; } - - [Column("SavedGraphSavedReportID")] - public int SavedGraphSavedReportId { get; set; } - - [Column("SavedGraphGUID")] - public Guid SavedGraphGuid { get; set; } - - public byte[] SavedGraphBinary { get; set; } = null!; - - [StringLength(100)] - public string SavedGraphMimeType { get; set; } = null!; - - public DateTime SavedGraphLastModified { get; set; } - - [ForeignKey("SavedGraphSavedReportId")] - [InverseProperty("ReportingSavedGraphs")] - public virtual ReportingSavedReport SavedGraphSavedReport { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ReportingSavedReport.cs b/Migration.Toolkit.K11/Models/ReportingSavedReport.cs deleted file mode 100644 index a85ce283..00000000 --- a/Migration.Toolkit.K11/Models/ReportingSavedReport.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_SavedReport")] -[Index("SavedReportCreatedByUserId", Name = "IX_Reporting_SavedReport_SavedReportCreatedByUserID")] -public class ReportingSavedReport -{ - [Key] - [Column("SavedReportID")] - public int SavedReportId { get; set; } - - [Column("SavedReportReportID")] - public int SavedReportReportId { get; set; } - - [Column("SavedReportGUID")] - public Guid SavedReportGuid { get; set; } - - [StringLength(200)] - public string? SavedReportTitle { get; set; } - - public DateTime SavedReportDate { get; set; } - - [Column("SavedReportHTML")] - public string SavedReportHtml { get; set; } = null!; - - public string SavedReportParameters { get; set; } = null!; - - [Column("SavedReportCreatedByUserID")] - public int? SavedReportCreatedByUserId { get; set; } - - public DateTime SavedReportLastModified { get; set; } - - [InverseProperty("SavedGraphSavedReport")] - public virtual ICollection ReportingSavedGraphs { get; set; } = new List(); - - [ForeignKey("SavedReportCreatedByUserId")] - [InverseProperty("ReportingSavedReports")] - public virtual CmsUser? SavedReportCreatedByUser { get; set; } - - [ForeignKey("SavedReportReportId")] - [InverseProperty("ReportingSavedReports")] - public virtual ReportingReport SavedReportReport { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/SharePointSharePointConnection.cs b/Migration.Toolkit.K11/Models/SharePointSharePointConnection.cs deleted file mode 100644 index bd996d54..00000000 --- a/Migration.Toolkit.K11/Models/SharePointSharePointConnection.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SharePoint_SharePointConnection")] -[Index("SharePointConnectionSiteId", Name = "IX_SharePoint_SharePointConnection_SharePointConnectionSiteID")] -public class SharePointSharePointConnection -{ - [Key] - [Column("SharePointConnectionID")] - public int SharePointConnectionId { get; set; } - - [Column("SharePointConnectionGUID")] - public Guid SharePointConnectionGuid { get; set; } - - [Column("SharePointConnectionSiteID")] - public int SharePointConnectionSiteId { get; set; } - - [StringLength(512)] - public string SharePointConnectionSiteUrl { get; set; } = null!; - - [StringLength(30)] - public string SharePointConnectionAuthMode { get; set; } = null!; - - [StringLength(100)] - public string SharePointConnectionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string SharePointConnectionName { get; set; } = null!; - - [StringLength(30)] - public string SharePointConnectionSharePointVersion { get; set; } = null!; - - [StringLength(100)] - public string? SharePointConnectionUserName { get; set; } - - [StringLength(100)] - public string? SharePointConnectionPassword { get; set; } - - [StringLength(100)] - public string? SharePointConnectionDomain { get; set; } - - public DateTime SharePointConnectionLastModified { get; set; } - - [ForeignKey("SharePointConnectionSiteId")] - [InverseProperty("SharePointSharePointConnections")] - public virtual CmsSite SharePointConnectionSite { get; set; } = null!; - - [InverseProperty("SharePointLibrarySharePointConnection")] - public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/SharePointSharePointFile.cs b/Migration.Toolkit.K11/Models/SharePointSharePointFile.cs deleted file mode 100644 index 84df96ce..00000000 --- a/Migration.Toolkit.K11/Models/SharePointSharePointFile.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SharePoint_SharePointFile")] -[Index("SharePointFileSiteId", Name = "IX_SharePoint_SharePointFile_SharePointFileSiteID")] -[Index("SharePointFileSharePointLibraryId", "SharePointFileServerRelativeUrl", Name = "UQ_SharePoint_SharePointFile_LibraryID_ServerRelativeURL", IsUnique = true)] -public class SharePointSharePointFile -{ - [Key] - [Column("SharePointFileID")] - public int SharePointFileId { get; set; } - - [Column("SharePointFileGUID")] - public Guid SharePointFileGuid { get; set; } - - [Column("SharePointFileSiteID")] - public int SharePointFileSiteId { get; set; } - - [StringLength(150)] - public string SharePointFileName { get; set; } = null!; - - [StringLength(150)] - public string? SharePointFileExtension { get; set; } - - [StringLength(255)] - public string? SharePointFileMimeType { get; set; } - - [Column("SharePointFileETag")] - [StringLength(255)] - public string? SharePointFileEtag { get; set; } - - public long SharePointFileSize { get; set; } - - public DateTime SharePointFileServerLastModified { get; set; } - - [Column("SharePointFileServerRelativeURL")] - [StringLength(300)] - public string SharePointFileServerRelativeUrl { get; set; } = null!; - - [Column("SharePointFileSharePointLibraryID")] - public int SharePointFileSharePointLibraryId { get; set; } - - public byte[]? SharePointFileBinary { get; set; } - - [ForeignKey("SharePointFileSharePointLibraryId")] - [InverseProperty("SharePointSharePointFiles")] - public virtual SharePointSharePointLibrary SharePointFileSharePointLibrary { get; set; } = null!; - - [ForeignKey("SharePointFileSiteId")] - [InverseProperty("SharePointSharePointFiles")] - public virtual CmsSite SharePointFileSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/SharePointSharePointLibrary.cs b/Migration.Toolkit.K11/Models/SharePointSharePointLibrary.cs deleted file mode 100644 index 6a96c5cc..00000000 --- a/Migration.Toolkit.K11/Models/SharePointSharePointLibrary.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SharePoint_SharePointLibrary")] -[Index("SharePointLibrarySharePointConnectionId", Name = "IX_SharePoint_SharePointLibrary_SharePointLibrarySharepointConnectionID")] -[Index("SharePointLibrarySiteId", Name = "IX_SharePoint_SharePointLibrary_SharePointlibrarySiteID")] -public class SharePointSharePointLibrary -{ - [Key] - [Column("SharePointLibraryID")] - public int SharePointLibraryId { get; set; } - - [StringLength(100)] - public string SharePointLibraryName { get; set; } = null!; - - [Column("SharePointLibrarySharePointConnectionID")] - public int? SharePointLibrarySharePointConnectionId { get; set; } - - [StringLength(100)] - public string SharePointLibraryListTitle { get; set; } = null!; - - public int SharePointLibrarySynchronizationPeriod { get; set; } - - [Column("SharePointLibraryGUID")] - public Guid SharePointLibraryGuid { get; set; } - - [Column("SharePointLibrarySiteID")] - public int SharePointLibrarySiteId { get; set; } - - [StringLength(100)] - public string SharePointLibraryDisplayName { get; set; } = null!; - - public DateTime SharePointLibraryLastModified { get; set; } - - public int SharePointLibraryListType { get; set; } - - [ForeignKey("SharePointLibrarySharePointConnectionId")] - [InverseProperty("SharePointSharePointLibraries")] - public virtual SharePointSharePointConnection? SharePointLibrarySharePointConnection { get; set; } - - [ForeignKey("SharePointLibrarySiteId")] - [InverseProperty("SharePointSharePointLibraries")] - public virtual CmsSite SharePointLibrarySite { get; set; } = null!; - - [InverseProperty("SharePointFileSharePointLibrary")] - public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/SmFacebookAccount.cs b/Migration.Toolkit.K11/Models/SmFacebookAccount.cs deleted file mode 100644 index 133d3e8e..00000000 --- a/Migration.Toolkit.K11/Models/SmFacebookAccount.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_FacebookAccount")] -[Index("FacebookAccountFacebookApplicationId", Name = "IX_SM_FacebookAccount_FacebookAccountFacebookApplicationID")] -[Index("FacebookAccountSiteId", Name = "IX_SM_FacebookAccount_FacebookAccountSiteID")] -public class SmFacebookAccount -{ - [Key] - [Column("FacebookAccountID")] - public int FacebookAccountId { get; set; } - - [Column("FacebookAccountGUID")] - public Guid FacebookAccountGuid { get; set; } - - public DateTime FacebookAccountLastModified { get; set; } - - [Column("FacebookAccountSiteID")] - public int FacebookAccountSiteId { get; set; } - - [StringLength(200)] - public string FacebookAccountName { get; set; } = null!; - - [StringLength(200)] - public string FacebookAccountDisplayName { get; set; } = null!; - - [Column("FacebookAccountPageID")] - [StringLength(500)] - public string FacebookAccountPageId { get; set; } = null!; - - public string FacebookAccountPageAccessToken { get; set; } = null!; - - [Column("FacebookAccountFacebookApplicationID")] - public int FacebookAccountFacebookApplicationId { get; set; } - - public DateTime? FacebookAccountPageAccessTokenExpiration { get; set; } - - [StringLength(1000)] - public string? FacebookAccountPageUrl { get; set; } - - public bool? FacebookAccountIsDefault { get; set; } - - [ForeignKey("FacebookAccountFacebookApplicationId")] - [InverseProperty("SmFacebookAccounts")] - public virtual SmFacebookApplication FacebookAccountFacebookApplication { get; set; } = null!; - - [ForeignKey("FacebookAccountSiteId")] - [InverseProperty("SmFacebookAccounts")] - public virtual CmsSite FacebookAccountSite { get; set; } = null!; - - [InverseProperty("FacebookPostFacebookAccount")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/SmFacebookApplication.cs b/Migration.Toolkit.K11/Models/SmFacebookApplication.cs deleted file mode 100644 index 63dc6adb..00000000 --- a/Migration.Toolkit.K11/Models/SmFacebookApplication.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_FacebookApplication")] -[Index("FacebookApplicationSiteId", Name = "IX_SM_FacebookApplication_FacebookApplicationSiteID")] -public class SmFacebookApplication -{ - [Key] - [Column("FacebookApplicationID")] - public int FacebookApplicationId { get; set; } - - [StringLength(500)] - public string FacebookApplicationConsumerKey { get; set; } = null!; - - [StringLength(500)] - public string FacebookApplicationConsumerSecret { get; set; } = null!; - - [StringLength(200)] - public string FacebookApplicationName { get; set; } = null!; - - [StringLength(200)] - public string FacebookApplicationDisplayName { get; set; } = null!; - - [Column("FacebookApplicationGUID")] - public Guid FacebookApplicationGuid { get; set; } - - public DateTime FacebookApplicationLastModified { get; set; } - - [Column("FacebookApplicationSiteID")] - public int FacebookApplicationSiteId { get; set; } - - [ForeignKey("FacebookApplicationSiteId")] - [InverseProperty("SmFacebookApplications")] - public virtual CmsSite FacebookApplicationSite { get; set; } = null!; - - [InverseProperty("FacebookAccountFacebookApplication")] - public virtual ICollection SmFacebookAccounts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/SmFacebookPost.cs b/Migration.Toolkit.K11/Models/SmFacebookPost.cs deleted file mode 100644 index 2b5a982b..00000000 --- a/Migration.Toolkit.K11/Models/SmFacebookPost.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_FacebookPost")] -[Index("FacebookPostCampaignId", Name = "IX_SM_FacebookPost_FacebookPostCampaignID")] -[Index("FacebookPostFacebookAccountId", Name = "IX_SM_FacebookPost_FacebookPostFacebookAccountID")] -[Index("FacebookPostSiteId", Name = "IX_SM_FacebookPost_FacebookPostSiteID")] -public class SmFacebookPost -{ - [Key] - [Column("FacebookPostID")] - public int FacebookPostId { get; set; } - - [Column("FacebookPostGUID")] - public Guid FacebookPostGuid { get; set; } - - public DateTime FacebookPostLastModified { get; set; } - - [Column("FacebookPostSiteID")] - public int FacebookPostSiteId { get; set; } - - [Column("FacebookPostFacebookAccountID")] - public int FacebookPostFacebookAccountId { get; set; } - - public string FacebookPostText { get; set; } = null!; - - [Column("FacebookPostURLShortenerType")] - public int? FacebookPostUrlshortenerType { get; set; } - - public int? FacebookPostErrorCode { get; set; } - - public int? FacebookPostErrorSubcode { get; set; } - - [Column("FacebookPostExternalID")] - public string? FacebookPostExternalId { get; set; } - - public DateTime? FacebookPostPublishedDateTime { get; set; } - - public DateTime? FacebookPostScheduledPublishDateTime { get; set; } - - [Column("FacebookPostCampaignID")] - public int? FacebookPostCampaignId { get; set; } - - public bool? FacebookPostPostAfterDocumentPublish { get; set; } - - public int? FacebookPostInsightPeopleReached { get; set; } - - public int? FacebookPostInsightLikesFromPage { get; set; } - - public int? FacebookPostInsightCommentsFromPage { get; set; } - - public int? FacebookPostInsightSharesFromPage { get; set; } - - public int? FacebookPostInsightLikesTotal { get; set; } - - public int? FacebookPostInsightCommentsTotal { get; set; } - - public int? FacebookPostInsightNegativeHidePost { get; set; } - - public int? FacebookPostInsightNegativeHideAllPosts { get; set; } - - public int? FacebookPostInsightNegativeReportSpam { get; set; } - - public int? FacebookPostInsightNegativeUnlikePage { get; set; } - - public DateTime? FacebookPostInsightsLastUpdated { get; set; } - - [Column("FacebookPostDocumentGUID")] - public Guid? FacebookPostDocumentGuid { get; set; } - - public bool? FacebookPostIsCreatedByUser { get; set; } - - [ForeignKey("FacebookPostCampaignId")] - [InverseProperty("SmFacebookPosts")] - public virtual AnalyticsCampaign? FacebookPostCampaign { get; set; } - - [ForeignKey("FacebookPostFacebookAccountId")] - [InverseProperty("SmFacebookPosts")] - public virtual SmFacebookAccount FacebookPostFacebookAccount { get; set; } = null!; - - [ForeignKey("FacebookPostSiteId")] - [InverseProperty("SmFacebookPosts")] - public virtual CmsSite FacebookPostSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/SmInsight.cs b/Migration.Toolkit.K11/Models/SmInsight.cs deleted file mode 100644 index 50774215..00000000 --- a/Migration.Toolkit.K11/Models/SmInsight.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_Insight")] -[Index("InsightCodeName", "InsightPeriodType", Name = "IX_SM_Insight_InsightCodeName_InsightPeriodType")] -public class SmInsight -{ - [Key] - [Column("InsightID")] - public int InsightId { get; set; } - - [StringLength(200)] - public string InsightCodeName { get; set; } = null!; - - [Column("InsightExternalID")] - public string InsightExternalId { get; set; } = null!; - - [StringLength(20)] - public string InsightPeriodType { get; set; } = null!; - - public string? InsightValueName { get; set; } - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitDays { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitMonths { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitWeeks { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitYears { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/SmInsightHitDay.cs b/Migration.Toolkit.K11/Models/SmInsightHitDay.cs deleted file mode 100644 index ecf42752..00000000 --- a/Migration.Toolkit.K11/Models/SmInsightHitDay.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_InsightHit_Day")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Day_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public class SmInsightHitDay -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitDays")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/SmInsightHitMonth.cs b/Migration.Toolkit.K11/Models/SmInsightHitMonth.cs deleted file mode 100644 index 1a44d4e4..00000000 --- a/Migration.Toolkit.K11/Models/SmInsightHitMonth.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_InsightHit_Month")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Month_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public class SmInsightHitMonth -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitMonths")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/SmInsightHitWeek.cs b/Migration.Toolkit.K11/Models/SmInsightHitWeek.cs deleted file mode 100644 index fd056e1b..00000000 --- a/Migration.Toolkit.K11/Models/SmInsightHitWeek.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_InsightHit_Week")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Week_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public class SmInsightHitWeek -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitWeeks")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/SmInsightHitYear.cs b/Migration.Toolkit.K11/Models/SmInsightHitYear.cs deleted file mode 100644 index 2eb4a0c5..00000000 --- a/Migration.Toolkit.K11/Models/SmInsightHitYear.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_InsightHit_Year")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Year_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public class SmInsightHitYear -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitYears")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/SmLinkedInAccount.cs b/Migration.Toolkit.K11/Models/SmLinkedInAccount.cs deleted file mode 100644 index 803af4b6..00000000 --- a/Migration.Toolkit.K11/Models/SmLinkedInAccount.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_LinkedInAccount")] -public class SmLinkedInAccount -{ - [Key] - [Column("LinkedInAccountID")] - public int LinkedInAccountId { get; set; } - - [StringLength(200)] - public string LinkedInAccountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string LinkedInAccountName { get; set; } = null!; - - public bool? LinkedInAccountIsDefault { get; set; } - - [StringLength(500)] - public string LinkedInAccountAccessToken { get; set; } = null!; - - [StringLength(500)] - public string LinkedInAccountAccessTokenSecret { get; set; } = null!; - - public DateTime LinkedInAccountLastModified { get; set; } - - [Column("LinkedInAccountGUID")] - public Guid LinkedInAccountGuid { get; set; } - - [Column("LinkedInAccountSiteID")] - public int LinkedInAccountSiteId { get; set; } - - [Column("LinkedInAccountProfileID")] - [StringLength(50)] - public string LinkedInAccountProfileId { get; set; } = null!; - - [Column("LinkedInAccountLinkedInApplicationID")] - public int LinkedInAccountLinkedInApplicationId { get; set; } - - [StringLength(200)] - public string? LinkedInAccountProfileName { get; set; } - - public DateTime? LinkedInAccountAccessTokenExpiration { get; set; } - - [InverseProperty("LinkedInPostLinkedInAccount")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/SmLinkedInApplication.cs b/Migration.Toolkit.K11/Models/SmLinkedInApplication.cs deleted file mode 100644 index cf1f4691..00000000 --- a/Migration.Toolkit.K11/Models/SmLinkedInApplication.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_LinkedInApplication")] -[Index("LinkedInApplicationSiteId", Name = "IX_SM_LinkedInApplication_LinkedInApplicationSiteID")] -public class SmLinkedInApplication -{ - [Key] - [Column("LinkedInApplicationID")] - public int LinkedInApplicationId { get; set; } - - [StringLength(200)] - public string LinkedInApplicationDisplayName { get; set; } = null!; - - [StringLength(200)] - public string LinkedInApplicationName { get; set; } = null!; - - [StringLength(500)] - public string LinkedInApplicationConsumerSecret { get; set; } = null!; - - [StringLength(500)] - public string LinkedInApplicationConsumerKey { get; set; } = null!; - - public DateTime LinkedInApplicationLastModified { get; set; } - - [Column("LinkedInApplicationGUID")] - public Guid LinkedInApplicationGuid { get; set; } - - [Column("LinkedInApplicationSiteID")] - public int LinkedInApplicationSiteId { get; set; } - - [ForeignKey("LinkedInApplicationSiteId")] - [InverseProperty("SmLinkedInApplications")] - public virtual CmsSite LinkedInApplicationSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/SmLinkedInPost.cs b/Migration.Toolkit.K11/Models/SmLinkedInPost.cs deleted file mode 100644 index ccefb693..00000000 --- a/Migration.Toolkit.K11/Models/SmLinkedInPost.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_LinkedInPost")] -[Index("LinkedInPostCampaignId", Name = "IX_SM_LinkedInPost_LinkedInPostCampaignID")] -[Index("LinkedInPostLinkedInAccountId", Name = "IX_SM_LinkedInPost_LinkedInPostLinkedInAccountID")] -[Index("LinkedInPostSiteId", Name = "IX_SM_LinkedInPost_LinkedInPostSiteID")] -public class SmLinkedInPost -{ - [Key] - [Column("LinkedInPostID")] - public int LinkedInPostId { get; set; } - - [Column("LinkedInPostLinkedInAccountID")] - public int LinkedInPostLinkedInAccountId { get; set; } - - [StringLength(700)] - public string LinkedInPostComment { get; set; } = null!; - - [Column("LinkedInPostSiteID")] - public int LinkedInPostSiteId { get; set; } - - [Column("LinkedInPostGUID")] - public Guid LinkedInPostGuid { get; set; } - - public DateTime? LinkedInPostLastModified { get; set; } - - [StringLength(200)] - public string? LinkedInPostUpdateKey { get; set; } - - [Column("LinkedInPostURLShortenerType")] - public int? LinkedInPostUrlshortenerType { get; set; } - - public DateTime? LinkedInPostScheduledPublishDateTime { get; set; } - - [Column("LinkedInPostCampaignID")] - public int? LinkedInPostCampaignId { get; set; } - - public DateTime? LinkedInPostPublishedDateTime { get; set; } - - [Column("LinkedInPostHTTPStatusCode")] - public int? LinkedInPostHttpstatusCode { get; set; } - - public int? LinkedInPostErrorCode { get; set; } - - public string? LinkedInPostErrorMessage { get; set; } - - [Column("LinkedInPostDocumentGUID")] - public Guid? LinkedInPostDocumentGuid { get; set; } - - public bool? LinkedInPostIsCreatedByUser { get; set; } - - public bool? LinkedInPostPostAfterDocumentPublish { get; set; } - - public DateTime? LinkedInPostInsightsLastUpdated { get; set; } - - public int? LinkedInPostCommentCount { get; set; } - - public int? LinkedInPostImpressionCount { get; set; } - - public int? LinkedInPostLikeCount { get; set; } - - public int? LinkedInPostShareCount { get; set; } - - public int? LinkedInPostClickCount { get; set; } - - public double? LinkedInPostEngagement { get; set; } - - [ForeignKey("LinkedInPostCampaignId")] - [InverseProperty("SmLinkedInPosts")] - public virtual AnalyticsCampaign? LinkedInPostCampaign { get; set; } - - [ForeignKey("LinkedInPostLinkedInAccountId")] - [InverseProperty("SmLinkedInPosts")] - public virtual SmLinkedInAccount LinkedInPostLinkedInAccount { get; set; } = null!; - - [ForeignKey("LinkedInPostSiteId")] - [InverseProperty("SmLinkedInPosts")] - public virtual CmsSite LinkedInPostSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/SmTwitterAccount.cs b/Migration.Toolkit.K11/Models/SmTwitterAccount.cs deleted file mode 100644 index fb76cf8d..00000000 --- a/Migration.Toolkit.K11/Models/SmTwitterAccount.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_TwitterAccount")] -[Index("TwitterAccountSiteId", Name = "IX_SM_TwitterAccount_TwitterAccountSiteID")] -[Index("TwitterAccountTwitterApplicationId", Name = "IX_SM_TwitterAccount_TwitterAccountTwitterApplicationID")] -public class SmTwitterAccount -{ - [Key] - [Column("TwitterAccountID")] - public int TwitterAccountId { get; set; } - - [StringLength(200)] - public string TwitterAccountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TwitterAccountName { get; set; } = null!; - - public DateTime TwitterAccountLastModified { get; set; } - - [Column("TwitterAccountGUID")] - public Guid TwitterAccountGuid { get; set; } - - [Column("TwitterAccountSiteID")] - public int TwitterAccountSiteId { get; set; } - - [StringLength(500)] - public string TwitterAccountAccessToken { get; set; } = null!; - - [StringLength(500)] - public string TwitterAccountAccessTokenSecret { get; set; } = null!; - - [Column("TwitterAccountTwitterApplicationID")] - public int TwitterAccountTwitterApplicationId { get; set; } - - public int? TwitterAccountFollowers { get; set; } - - public int? TwitterAccountMentions { get; set; } - - [StringLength(40)] - public string? TwitterAccountMentionsRange { get; set; } - - [Column("TwitterAccountUserID")] - [StringLength(20)] - public string? TwitterAccountUserId { get; set; } - - public bool? TwitterAccountIsDefault { get; set; } - - [InverseProperty("TwitterPostTwitterAccount")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); - - [ForeignKey("TwitterAccountSiteId")] - [InverseProperty("SmTwitterAccounts")] - public virtual CmsSite TwitterAccountSite { get; set; } = null!; - - [ForeignKey("TwitterAccountTwitterApplicationId")] - [InverseProperty("SmTwitterAccounts")] - public virtual SmTwitterApplication TwitterAccountTwitterApplication { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/SmTwitterApplication.cs b/Migration.Toolkit.K11/Models/SmTwitterApplication.cs deleted file mode 100644 index c723a90b..00000000 --- a/Migration.Toolkit.K11/Models/SmTwitterApplication.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_TwitterApplication")] -[Index("TwitterApplicationSiteId", Name = "IX_SM_TwitterApplication_TwitterApplicationSiteID")] -public class SmTwitterApplication -{ - [Key] - [Column("TwitterApplicationID")] - public int TwitterApplicationId { get; set; } - - [StringLength(200)] - public string TwitterApplicationDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TwitterApplicationName { get; set; } = null!; - - public DateTime TwitterApplicationLastModified { get; set; } - - [Column("TwitterApplicationGUID")] - public Guid TwitterApplicationGuid { get; set; } - - [Column("TwitterApplicationSiteID")] - public int TwitterApplicationSiteId { get; set; } - - [StringLength(500)] - public string TwitterApplicationConsumerKey { get; set; } = null!; - - [StringLength(500)] - public string TwitterApplicationConsumerSecret { get; set; } = null!; - - [InverseProperty("TwitterAccountTwitterApplication")] - public virtual ICollection SmTwitterAccounts { get; set; } = new List(); - - [ForeignKey("TwitterApplicationSiteId")] - [InverseProperty("SmTwitterApplications")] - public virtual CmsSite TwitterApplicationSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/SmTwitterPost.cs b/Migration.Toolkit.K11/Models/SmTwitterPost.cs deleted file mode 100644 index efa009ab..00000000 --- a/Migration.Toolkit.K11/Models/SmTwitterPost.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_TwitterPost")] -[Index("TwitterPostCampaignId", Name = "IX_SM_TwitterPost_TwitterPostCampaignID")] -[Index("TwitterPostSiteId", Name = "IX_SM_TwitterPost_TwitterPostSiteID")] -[Index("TwitterPostTwitterAccountId", Name = "IX_SM_TwitterPost_TwitterPostTwitterAccountID")] -public class SmTwitterPost -{ - [Key] - [Column("TwitterPostID")] - public int TwitterPostId { get; set; } - - [Column("TwitterPostGUID")] - public Guid TwitterPostGuid { get; set; } - - public DateTime TwitterPostLastModified { get; set; } - - [Column("TwitterPostSiteID")] - public int TwitterPostSiteId { get; set; } - - [Column("TwitterPostTwitterAccountID")] - public int TwitterPostTwitterAccountId { get; set; } - - public string TwitterPostText { get; set; } = null!; - - [Column("TwitterPostURLShortenerType")] - public int? TwitterPostUrlshortenerType { get; set; } - - [Column("TwitterPostExternalID")] - public string? TwitterPostExternalId { get; set; } - - public int? TwitterPostErrorCode { get; set; } - - public DateTime? TwitterPostPublishedDateTime { get; set; } - - public DateTime? TwitterPostScheduledPublishDateTime { get; set; } - - [Column("TwitterPostCampaignID")] - public int? TwitterPostCampaignId { get; set; } - - public int? TwitterPostFavorites { get; set; } - - public int? TwitterPostRetweets { get; set; } - - public bool? TwitterPostPostAfterDocumentPublish { get; set; } - - public DateTime? TwitterPostInsightsUpdateDateTime { get; set; } - - [Column("TwitterPostDocumentGUID")] - public Guid? TwitterPostDocumentGuid { get; set; } - - public bool? TwitterPostIsCreatedByUser { get; set; } - - [ForeignKey("TwitterPostCampaignId")] - [InverseProperty("SmTwitterPosts")] - public virtual AnalyticsCampaign? TwitterPostCampaign { get; set; } - - [ForeignKey("TwitterPostSiteId")] - [InverseProperty("SmTwitterPosts")] - public virtual CmsSite TwitterPostSite { get; set; } = null!; - - [ForeignKey("TwitterPostTwitterAccountId")] - [InverseProperty("SmTwitterPosts")] - public virtual SmTwitterAccount TwitterPostTwitterAccount { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/StagingServer.cs b/Migration.Toolkit.K11/Models/StagingServer.cs deleted file mode 100644 index d64658b3..00000000 --- a/Migration.Toolkit.K11/Models/StagingServer.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Staging_Server")] -[Index("ServerEnabled", Name = "IX_Staging_Server_ServerEnabled")] -[Index("ServerSiteId", Name = "IX_Staging_Server_ServerSiteID")] -public class StagingServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(100)] - public string ServerName { get; set; } = null!; - - [StringLength(440)] - public string ServerDisplayName { get; set; } = null!; - - [Column("ServerSiteID")] - public int ServerSiteId { get; set; } - - [Column("ServerURL")] - [StringLength(450)] - public string ServerUrl { get; set; } = null!; - - [Required] - public bool? ServerEnabled { get; set; } - - [StringLength(20)] - public string ServerAuthentication { get; set; } = null!; - - [StringLength(100)] - public string? ServerUsername { get; set; } - - [StringLength(100)] - public string? ServerPassword { get; set; } - - [Column("ServerX509ClientKeyID")] - [StringLength(200)] - public string? ServerX509clientKeyId { get; set; } - - [Column("ServerX509ServerKeyID")] - [StringLength(200)] - public string? ServerX509serverKeyId { get; set; } - - [Column("ServerGUID")] - public Guid ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - [ForeignKey("ServerSiteId")] - [InverseProperty("StagingServers")] - public virtual CmsSite ServerSite { get; set; } = null!; - - [InverseProperty("SynchronizationServer")] - public virtual ICollection StagingSynchronizations { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/StagingSynchronization.cs b/Migration.Toolkit.K11/Models/StagingSynchronization.cs deleted file mode 100644 index 528cdb39..00000000 --- a/Migration.Toolkit.K11/Models/StagingSynchronization.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Staging_Synchronization")] -[Index("SynchronizationServerId", Name = "IX_Staging_Synchronization_SynchronizationServerID")] -[Index("SynchronizationTaskId", Name = "IX_Staging_Synchronization_SynchronizationTaskID")] -public class StagingSynchronization -{ - [Key] - [Column("SynchronizationID")] - public int SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int SynchronizationTaskId { get; set; } - - [Column("SynchronizationServerID")] - public int SynchronizationServerId { get; set; } - - public DateTime? SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - [ForeignKey("SynchronizationServerId")] - [InverseProperty("StagingSynchronizations")] - public virtual StagingServer SynchronizationServer { get; set; } = null!; - - [ForeignKey("SynchronizationTaskId")] - [InverseProperty("StagingSynchronizations")] - public virtual StagingTask SynchronizationTask { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/StagingTask.cs b/Migration.Toolkit.K11/Models/StagingTask.cs deleted file mode 100644 index a27a6dff..00000000 --- a/Migration.Toolkit.K11/Models/StagingTask.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Staging_Task")] -[Index("TaskDocumentId", "TaskNodeId", "TaskRunning", Name = "IX_Staging_Task_TaskDocumentID_TaskNodeID_TaskRunning")] -[Index("TaskObjectType", "TaskObjectId", "TaskRunning", Name = "IX_Staging_Task_TaskObjectType_TaskObjectID_TaskRunning")] -[Index("TaskSiteId", Name = "IX_Staging_Task_TaskSiteID")] -[Index("TaskType", Name = "IX_Staging_Task_TaskType")] -public class StagingTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - [StringLength(450)] - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool? TaskRunning { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - public string? TaskServers { get; set; } - - [InverseProperty("SynchronizationTask")] - public virtual ICollection StagingSynchronizations { get; set; } = new List(); - - [InverseProperty("Task")] - public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); - - [InverseProperty("Task")] - public virtual ICollection StagingTaskUsers { get; set; } = new List(); - - [ForeignKey("TaskSiteId")] - [InverseProperty("StagingTasks")] - public virtual CmsSite? TaskSite { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/StagingTaskGroup.cs b/Migration.Toolkit.K11/Models/StagingTaskGroup.cs deleted file mode 100644 index e7373fe4..00000000 --- a/Migration.Toolkit.K11/Models/StagingTaskGroup.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("staging_TaskGroup")] -public class StagingTaskGroup -{ - [Key] - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [StringLength(50)] - public string TaskGroupCodeName { get; set; } = null!; - - public Guid TaskGroupGuid { get; set; } - - public string? TaskGroupDescription { get; set; } - - [InverseProperty("TaskGroup")] - public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); - - [InverseProperty("TaskGroup")] - public virtual ICollection StagingTaskGroupUsers { get; set; } = new List(); -} diff --git a/Migration.Toolkit.K11/Models/StagingTaskGroupTask.cs b/Migration.Toolkit.K11/Models/StagingTaskGroupTask.cs deleted file mode 100644 index 900fb7e4..00000000 --- a/Migration.Toolkit.K11/Models/StagingTaskGroupTask.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("staging_TaskGroupTask")] -[Index("TaskGroupId", Name = "IX_Staging_TaskGroupTask_TaskGroupID")] -[Index("TaskId", Name = "IX_Staging_TaskGroupTask_TaskID")] -public class StagingTaskGroupTask -{ - [Key] - [Column("TaskGroupTaskID")] - public int TaskGroupTaskId { get; set; } - - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [ForeignKey("TaskId")] - [InverseProperty("StagingTaskGroupTasks")] - public virtual StagingTask Task { get; set; } = null!; - - [ForeignKey("TaskGroupId")] - [InverseProperty("StagingTaskGroupTasks")] - public virtual StagingTaskGroup TaskGroup { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/StagingTaskGroupUser.cs b/Migration.Toolkit.K11/Models/StagingTaskGroupUser.cs deleted file mode 100644 index 509a0f3c..00000000 --- a/Migration.Toolkit.K11/Models/StagingTaskGroupUser.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("staging_TaskGroupUser")] -[Index("TaskGroupId", Name = "IX_Staging_TaskGroupUser_TaskGroup_ID")] -[Index("UserId", Name = "IX_Staging_TaskGroupUser_UserID", IsUnique = true)] -public class StagingTaskGroupUser -{ - [Key] - [Column("TaskGroupUserID")] - public int TaskGroupUserId { get; set; } - - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("TaskGroupId")] - [InverseProperty("StagingTaskGroupUsers")] - public virtual StagingTaskGroup TaskGroup { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("StagingTaskGroupUser")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/StagingTaskUser.cs b/Migration.Toolkit.K11/Models/StagingTaskUser.cs deleted file mode 100644 index d332d44c..00000000 --- a/Migration.Toolkit.K11/Models/StagingTaskUser.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Staging_TaskUser")] -[Index("TaskId", Name = "IX_Staging_TaskUser_TaskID")] -[Index("UserId", Name = "IX_Staging_TaskUser_UserID")] -public class StagingTaskUser -{ - [Key] - [Column("TaskUserID")] - public int TaskUserId { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("TaskId")] - [InverseProperty("StagingTaskUsers")] - public virtual StagingTask Task { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("StagingTaskUsers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/TempFile.cs b/Migration.Toolkit.K11/Models/TempFile.cs deleted file mode 100644 index 7646c9e3..00000000 --- a/Migration.Toolkit.K11/Models/TempFile.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.K11.Models; - -[Table("Temp_File")] -public class TempFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileParentGUID")] - public Guid FileParentGuid { get; set; } - - public int FileNumber { get; set; } - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - public long FileSize { get; set; } - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - public byte[]? FileBinary { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - public DateTime FileLastModified { get; set; } - - [StringLength(200)] - public string FileDirectory { get; set; } = null!; - - [StringLength(200)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string? FileTitle { get; set; } - - public string? FileDescription { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewBoardsBoardMessageJoined.cs b/Migration.Toolkit.K11/Models/ViewBoardsBoardMessageJoined.cs deleted file mode 100644 index 34d7e5f0..00000000 --- a/Migration.Toolkit.K11/Models/ViewBoardsBoardMessageJoined.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewBoardsBoardMessageJoined -{ - [Column("BoardID")] - public int BoardId { get; set; } - - [StringLength(250)] - public string BoardName { get; set; } = null!; - - [StringLength(250)] - public string BoardDisplayName { get; set; } = null!; - - public string BoardDescription { get; set; } = null!; - - public DateTime? BoardOpenedFrom { get; set; } - - public bool BoardOpened { get; set; } - - public DateTime? BoardOpenedTo { get; set; } - - public bool BoardEnabled { get; set; } - - public bool BoardModerated { get; set; } - - public int BoardAccess { get; set; } - - public bool BoardUseCaptcha { get; set; } - - public DateTime BoardLastModified { get; set; } - - public int BoardMessages { get; set; } - - [Column("BoardDocumentID")] - public int BoardDocumentId { get; set; } - - [Column("BoardGUID")] - public Guid BoardGuid { get; set; } - - [Column("BoardUserID")] - public int? BoardUserId { get; set; } - - [Column("BoardGroupID")] - public int? BoardGroupId { get; set; } - - public DateTime? BoardLastMessageTime { get; set; } - - [StringLength(250)] - public string? BoardLastMessageUserName { get; set; } - - [Column("BoardUnsubscriptionURL")] - [StringLength(450)] - public string? BoardUnsubscriptionUrl { get; set; } - - public bool? BoardRequireEmails { get; set; } - - [Column("BoardSiteID")] - public int BoardSiteId { get; set; } - - public bool BoardEnableSubscriptions { get; set; } - - [Column("BoardBaseURL")] - [StringLength(450)] - public string? BoardBaseUrl { get; set; } - - [Column("MessageID")] - public int MessageId { get; set; } - - [StringLength(250)] - public string MessageUserName { get; set; } = null!; - - public string MessageText { get; set; } = null!; - - [StringLength(254)] - public string MessageEmail { get; set; } = null!; - - [Column("MessageURL")] - [StringLength(450)] - public string MessageUrl { get; set; } = null!; - - public bool MessageIsSpam { get; set; } - - [Column("MessageBoardID")] - public int MessageBoardId { get; set; } - - public bool MessageApproved { get; set; } - - [Column("MessageUserID")] - public int? MessageUserId { get; set; } - - [Column("MessageApprovedByUserID")] - public int? MessageApprovedByUserId { get; set; } - - public string MessageUserInfo { get; set; } = null!; - - [Column("MessageAvatarGUID")] - public Guid? MessageAvatarGuid { get; set; } - - public DateTime MessageInserted { get; set; } - - public DateTime MessageLastModified { get; set; } - - [Column("MessageGUID")] - public Guid MessageGuid { get; set; } - - public double? MessageRatingValue { get; set; } - - [Column("GroupID")] - public int? GroupId { get; set; } - - [Column("GroupGUID")] - public Guid? GroupGuid { get; set; } - - public DateTime? GroupLastModified { get; set; } - - [Column("GroupSiteID")] - public int? GroupSiteId { get; set; } - - [StringLength(200)] - public string? GroupDisplayName { get; set; } - - [StringLength(100)] - public string? GroupName { get; set; } - - public string? GroupDescription { get; set; } - - [Column("GroupNodeGUID")] - public Guid? GroupNodeGuid { get; set; } - - public int? GroupApproveMembers { get; set; } - - public int? GroupAccess { get; set; } - - [Column("GroupCreatedByUserID")] - public int? GroupCreatedByUserId { get; set; } - - [Column("GroupApprovedByUserID")] - public int? GroupApprovedByUserId { get; set; } - - [Column("GroupAvatarID")] - public int? GroupAvatarId { get; set; } - - public bool? GroupApproved { get; set; } - - public DateTime? GroupCreatedWhen { get; set; } - - public bool? GroupSendJoinLeaveNotification { get; set; } - - public bool? GroupSendWaitingForApprovalNotification { get; set; } - - public int? GroupSecurity { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsAclitemItemsAndOperator.cs b/Migration.Toolkit.K11/Models/ViewCmsAclitemItemsAndOperator.cs deleted file mode 100644 index bb2470ec..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsAclitemItemsAndOperator.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsAclitemItemsAndOperator -{ - [Column("ACLOwnerNodeID")] - public int AclownerNodeId { get; set; } - - [Column("ACLItemID")] - public int AclitemId { get; set; } - - public int Allowed { get; set; } - - public int Denied { get; set; } - - [StringLength(51)] - public string? Operator { get; set; } - - [StringLength(100)] - public string? OperatorName { get; set; } - - [Column("ACLID")] - public int Aclid { get; set; } - - [StringLength(450)] - public string? OperatorFullName { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [Column("RoleID")] - public int? RoleId { get; set; } - - [Column("RoleGroupID")] - public int? RoleGroupId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs deleted file mode 100644 index 203a6eca..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsObjectVersionHistoryUserJoined -{ - [Column("VersionID")] - public int VersionId { get; set; } - - [Column("VersionObjectID")] - public int? VersionObjectId { get; set; } - - [StringLength(100)] - public string VersionObjectType { get; set; } = null!; - - [Column("VersionObjectSiteID")] - public int? VersionObjectSiteId { get; set; } - - [StringLength(450)] - public string VersionObjectDisplayName { get; set; } = null!; - - [Column("VersionXML")] - public string VersionXml { get; set; } = null!; - - [Column("VersionBinaryDataXML")] - public string? VersionBinaryDataXml { get; set; } - - [Column("VersionModifiedByUserID")] - public int? VersionModifiedByUserId { get; set; } - - public DateTime VersionModifiedWhen { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [StringLength(50)] - public string VersionNumber { get; set; } = null!; - - [Column("VersionSiteBindingIDs")] - public string? VersionSiteBindingIds { get; set; } - - public string? VersionComment { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(100)] - public string? UserName { get; set; } - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string? UserPassword { get; set; } - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool? UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid? UserGuid { get; set; } - - public DateTime? UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int? UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs deleted file mode 100644 index d7cc429e..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsPageTemplateCategoryPageTemplateJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(200)] - public string? CodeName { get; set; } - - [StringLength(200)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryTemplateChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [StringLength(20)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; - - public bool? Parameter { get; set; } - - public int? PageTemplateForAllPages { get; set; } - - [StringLength(10)] - public string? PageTemplateType { get; set; } - - public int? PageTemplateIsReusable { get; set; } - - [StringLength(200)] - public string? PageTemplateIconClass { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsRelationshipJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsRelationshipJoined.cs deleted file mode 100644 index 695215f5..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsRelationshipJoined.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsRelationshipJoined -{ - [Column("LeftNodeID")] - public int LeftNodeId { get; set; } - - [Column("LeftNodeGUID")] - public Guid LeftNodeGuid { get; set; } - - [StringLength(100)] - public string LeftNodeName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipName { get; set; } = null!; - - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - [Column("RightNodeID")] - public int RightNodeId { get; set; } - - [Column("RightNodeGUID")] - public Guid RightNodeGuid { get; set; } - - [StringLength(100)] - public string RightNodeName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipDisplayName { get; set; } = null!; - - public string? RelationshipCustomData { get; set; } - - [Column("LeftClassID")] - public int LeftClassId { get; set; } - - [Column("RightClassID")] - public int RightClassId { get; set; } - - [Column("RelationshipID")] - public int RelationshipId { get; set; } - - public int? RelationshipOrder { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsResourceStringJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsResourceStringJoined.cs deleted file mode 100644 index 61c49d9e..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsResourceStringJoined.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsResourceStringJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("TranslationID")] - public int? TranslationId { get; set; } - - [Column("TranslationStringID")] - public int? TranslationStringId { get; set; } - - [Column("TranslationCultureID")] - public int? TranslationCultureId { get; set; } - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int? CultureId { get; set; } - - [StringLength(200)] - public string? CultureName { get; set; } - - [StringLength(50)] - public string? CultureCode { get; set; } - - [Column("CultureGUID")] - public Guid? CultureGuid { get; set; } - - public DateTime? CultureLastModified { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsResourceTranslatedJoined.cs deleted file mode 100644 index ea467833..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsResourceTranslatedJoined.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsResourceTranslatedJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsRoleResourcePermissionJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsRoleResourcePermissionJoined.cs deleted file mode 100644 index 7d65166f..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsRoleResourcePermissionJoined.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsRoleResourcePermissionJoined -{ - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - [StringLength(100)] - public string PermissionName { get; set; } = null!; - - [Column("PermissionID")] - public int PermissionId { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsSiteDocumentCount.cs b/Migration.Toolkit.K11/Models/ViewCmsSiteDocumentCount.cs deleted file mode 100644 index 815652bf..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsSiteDocumentCount.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsSiteDocumentCount -{ - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - [StringLength(200)] - public string SiteDisplayName { get; set; } = null!; - - public string? SiteDescription { get; set; } - - [StringLength(20)] - public string SiteStatus { get; set; } = null!; - - [StringLength(400)] - public string SiteDomainName { get; set; } = null!; - - [Column("SiteDefaultStylesheetID")] - public int? SiteDefaultStylesheetId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - public int? SiteDefaultEditorStylesheet { get; set; } - - [Column("SiteGUID")] - public Guid SiteGuid { get; set; } - - public DateTime SiteLastModified { get; set; } - - public bool? SiteIsContentOnly { get; set; } - - public int? Documents { get; set; } - - public bool? SiteIsOffline { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs deleted file mode 100644 index e4e2cfee..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsSiteRoleResourceUielementJoined -{ - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(200)] - public string ElementName { get; set; } = null!; - - [StringLength(100)] - public string? SiteName { get; set; } - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - [Column("RoleSiteID")] - public int? RoleSiteId { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsTreeJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsTreeJoined.cs deleted file mode 100644 index 223c7375..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsTreeJoined.cs +++ /dev/null @@ -1,291 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsTreeJoined -{ - [StringLength(100)] - public string ClassName { get; set; } = null!; - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [Column("NodeID")] - public int NodeId { get; set; } - - [StringLength(450)] - public string NodeAliasPath { get; set; } = null!; - - [StringLength(100)] - public string NodeName { get; set; } = null!; - - [StringLength(50)] - public string NodeAlias { get; set; } = null!; - - [Column("NodeClassID")] - public int NodeClassId { get; set; } - - [Column("NodeParentID")] - public int? NodeParentId { get; set; } - - public int NodeLevel { get; set; } - - [Column("NodeACLID")] - public int? NodeAclid { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeGUID")] - public Guid NodeGuid { get; set; } - - public int? NodeOrder { get; set; } - - public bool? IsSecuredNode { get; set; } - - public int? NodeCacheMinutes { get; set; } - - [Column("NodeSKUID")] - public int? NodeSkuid { get; set; } - - public string? NodeDocType { get; set; } - - public string? NodeHeadTags { get; set; } - - public string? NodeBodyElementAttributes { get; set; } - - [StringLength(200)] - public string? NodeInheritPageLevels { get; set; } - - [Column("RequiresSSL")] - public int? RequiresSsl { get; set; } - - [Column("NodeLinkedNodeID")] - public int? NodeLinkedNodeId { get; set; } - - public int? NodeOwner { get; set; } - - public string? NodeCustomData { get; set; } - - [Column("NodeGroupID")] - public int? NodeGroupId { get; set; } - - [Column("NodeLinkedNodeSiteID")] - public int? NodeLinkedNodeSiteId { get; set; } - - [Column("NodeTemplateID")] - public int? NodeTemplateId { get; set; } - - public bool? NodeTemplateForAllCultures { get; set; } - - public bool? NodeInheritPageTemplate { get; set; } - - public bool? NodeAllowCacheInFileSystem { get; set; } - - public bool? NodeHasChildren { get; set; } - - public bool? NodeHasLinks { get; set; } - - [Column("NodeOriginalNodeID")] - public int? NodeOriginalNodeId { get; set; } - - public bool NodeIsContentOnly { get; set; } - - [Column("NodeIsACLOwner")] - public bool NodeIsAclowner { get; set; } - - public string? NodeBodyScripts { get; set; } - - [Column("DocumentID")] - public int DocumentId { get; set; } - - [StringLength(100)] - public string DocumentName { get; set; } = null!; - - [StringLength(1500)] - public string? DocumentNamePath { get; set; } - - public DateTime? DocumentModifiedWhen { get; set; } - - [Column("DocumentModifiedByUserID")] - public int? DocumentModifiedByUserId { get; set; } - - public int? DocumentForeignKeyValue { get; set; } - - [Column("DocumentCreatedByUserID")] - public int? DocumentCreatedByUserId { get; set; } - - public DateTime? DocumentCreatedWhen { get; set; } - - [Column("DocumentCheckedOutByUserID")] - public int? DocumentCheckedOutByUserId { get; set; } - - public DateTime? DocumentCheckedOutWhen { get; set; } - - [Column("DocumentCheckedOutVersionHistoryID")] - public int? DocumentCheckedOutVersionHistoryId { get; set; } - - [Column("DocumentPublishedVersionHistoryID")] - public int? DocumentPublishedVersionHistoryId { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - public DateTime? DocumentPublishFrom { get; set; } - - public DateTime? DocumentPublishTo { get; set; } - - [StringLength(450)] - public string? DocumentUrlPath { get; set; } - - [StringLength(10)] - public string DocumentCulture { get; set; } = null!; - - [Column("DocumentNodeID")] - public int DocumentNodeId { get; set; } - - public string? DocumentPageTitle { get; set; } - - public string? DocumentPageKeyWords { get; set; } - - public string? DocumentPageDescription { get; set; } - - public bool DocumentShowInSiteMap { get; set; } - - public bool DocumentMenuItemHideInNavigation { get; set; } - - [StringLength(200)] - public string? DocumentMenuCaption { get; set; } - - [StringLength(100)] - public string? DocumentMenuStyle { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImage { get; set; } - - [Column("DocumentPageTemplateID")] - public int? DocumentPageTemplateId { get; set; } - - [StringLength(450)] - public string? DocumentMenuJavascript { get; set; } - - [StringLength(450)] - public string? DocumentMenuRedirectUrl { get; set; } - - public bool? DocumentUseNamePathForUrlPath { get; set; } - - [Column("DocumentStylesheetID")] - public int? DocumentStylesheetId { get; set; } - - public string? DocumentContent { get; set; } - - [StringLength(100)] - public string? DocumentMenuClass { get; set; } - - [StringLength(200)] - public string? DocumentMenuStyleHighlighted { get; set; } - - [StringLength(100)] - public string? DocumentMenuClassHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImageHighlighted { get; set; } - - public bool? DocumentMenuItemInactive { get; set; } - - public string? DocumentCustomData { get; set; } - - [StringLength(100)] - public string? DocumentExtensions { get; set; } - - public string? DocumentTags { get; set; } - - [Column("DocumentTagGroupID")] - public int? DocumentTagGroupId { get; set; } - - [StringLength(440)] - public string? DocumentWildcardRule { get; set; } - - public string? DocumentWebParts { get; set; } - - public double? DocumentRatingValue { get; set; } - - public int? DocumentRatings { get; set; } - - public int? DocumentPriority { get; set; } - - [StringLength(50)] - public string? DocumentType { get; set; } - - public DateTime? DocumentLastPublished { get; set; } - - public bool? DocumentUseCustomExtensions { get; set; } - - public string? DocumentGroupWebParts { get; set; } - - public bool? DocumentCheckedOutAutomatically { get; set; } - - [StringLength(200)] - public string? DocumentTrackConversionName { get; set; } - - [StringLength(100)] - public string? DocumentConversionValue { get; set; } - - public bool? DocumentSearchExcluded { get; set; } - - [StringLength(50)] - public string? DocumentLastVersionNumber { get; set; } - - public bool? DocumentIsArchived { get; set; } - - [StringLength(32)] - public string? DocumentHash { get; set; } - - public bool? DocumentLogVisitActivity { get; set; } - - [Column("DocumentGUID")] - public Guid? DocumentGuid { get; set; } - - [Column("DocumentWorkflowCycleGUID")] - public Guid? DocumentWorkflowCycleGuid { get; set; } - - [StringLength(100)] - public string? DocumentSitemapSettings { get; set; } - - public bool? DocumentIsWaitingForTranslation { get; set; } - - [Column("DocumentSKUName")] - [StringLength(440)] - public string? DocumentSkuname { get; set; } - - [Column("DocumentSKUDescription")] - public string? DocumentSkudescription { get; set; } - - [Column("DocumentSKUShortDescription")] - public string? DocumentSkushortDescription { get; set; } - - [StringLength(450)] - public string? DocumentWorkflowActionStatus { get; set; } - - public bool? DocumentMenuRedirectToFirstChild { get; set; } - - public bool DocumentCanBePublished { get; set; } - - public bool DocumentInheritsStylesheet { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsUser.cs b/Migration.Toolkit.K11/Models/ViewCmsUser.cs deleted file mode 100644 index a7331e8c..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsUser.cs +++ /dev/null @@ -1,217 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsUser -{ - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [Column("UserSettingsID")] - public int? UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - [StringLength(200)] - public string? UserMessagingNotificationEmail { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid? UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int? UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarFileName { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserDocument.cs b/Migration.Toolkit.K11/Models/ViewCmsUserDocument.cs deleted file mode 100644 index aefc7de0..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsUserDocument.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsUserDocument -{ - [StringLength(450)] - public string DocumentName { get; set; } = null!; - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeID")] - public int NodeId { get; set; } - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [StringLength(1500)] - public string? DocumentNamePath { get; set; } - - public DateTime? DocumentModifiedWhen { get; set; } - - [StringLength(10)] - public string DocumentCulture { get; set; } = null!; - - [StringLength(200)] - public string? CultureName { get; set; } - - [Column("UserID1")] - public int? UserId1 { get; set; } - - [Column("UserID2")] - public int? UserId2 { get; set; } - - [Column("UserID3")] - public int? UserId3 { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - [StringLength(450)] - public string NodeAliasPath { get; set; } = null!; - - [StringLength(12)] - [Unicode(false)] - public string Type { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserRoleJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsUserRoleJoined.cs deleted file mode 100644 index e62bd3c6..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsUserRoleJoined.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsUserRoleJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(450)] - public string? FullName { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - [Column("RoleGroupID")] - public int? RoleGroupId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [StringLength(100)] - public string? SiteName { get; set; } - - [Column("SiteGUID")] - public Guid? SiteGuid { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRole.cs b/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRole.cs deleted file mode 100644 index 9666bb84..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRole.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsUserRoleMembershipRole -{ - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - public DateTime? ValidTo { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs deleted file mode 100644 index d9a3198c..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsUserRoleMembershipRoleValidOnlyJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserSettingsRoleJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsUserSettingsRoleJoined.cs deleted file mode 100644 index c46d5483..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsUserSettingsRoleJoined.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsUserSettingsRoleJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - public bool UserEnabled { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs deleted file mode 100644 index 463984e1..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsWebPartCategoryWebpartJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(100)] - public string CodeName { get; set; } = null!; - - [StringLength(100)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryWebPartChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [Column("WebPartParentID")] - public int? WebPartParentId { get; set; } - - [StringLength(100)] - public string? WebPartFileName { get; set; } - - [Column("WebPartGUID")] - public Guid? WebPartGuid { get; set; } - - public int? WebPartType { get; set; } - - [StringLength(1000)] - public string? WebPartDescription { get; set; } - - [StringLength(15)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; - - [Column("ThumbnailGUID")] - public Guid? ThumbnailGuid { get; set; } - - [StringLength(200)] - public string? IconClass { get; set; } - - public bool? WebPartSkipInsertProperties { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs deleted file mode 100644 index 53d63924..00000000 --- a/Migration.Toolkit.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCmsWidgetCategoryWidgetJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(100)] - public string CodeName { get; set; } = null!; - - [StringLength(100)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? WidgetCategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? WidgetCategoryChildCount { get; set; } - - public int? WidgetCategoryWidgetChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [Column("WidgetWebPartID")] - public int? WidgetWebPartId { get; set; } - - public int WidgetSecurity { get; set; } - - public bool? WidgetForGroup { get; set; } - - public bool? WidgetForInline { get; set; } - - public bool? WidgetForUser { get; set; } - - public bool? WidgetForEditor { get; set; } - - public bool? WidgetForDashboard { get; set; } - - [Column("WidgetGUID")] - public Guid? WidgetGuid { get; set; } - - [StringLength(14)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs b/Migration.Toolkit.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs deleted file mode 100644 index c7907651..00000000 --- a/Migration.Toolkit.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewComSkuoptionCategoryOptionCategoryJoined -{ - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("CategoryID")] - public int CategoryId { get; set; } - - public bool? AllowAllOptions { get; set; } - - [Column("SKUCategoryID")] - public int SkucategoryId { get; set; } - - [Column("SKUCategoryOrder")] - public int? SkucategoryOrder { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryName { get; set; } = null!; - - [StringLength(200)] - public string CategorySelectionType { get; set; } = null!; - - [StringLength(200)] - public string? CategoryDefaultOptions { get; set; } - - public string? CategoryDescription { get; set; } - - [StringLength(200)] - public string? CategoryDefaultRecord { get; set; } - - public bool CategoryEnabled { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - public bool? CategoryDisplayPrice { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - public int? CategoryTextMaxLength { get; set; } - - [StringLength(20)] - public string? CategoryType { get; set; } - - public int? CategoryTextMinLength { get; set; } - - [StringLength(200)] - public string? CategoryLiveSiteDisplayName { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCommunityGroup.cs b/Migration.Toolkit.K11/Models/ViewCommunityGroup.cs deleted file mode 100644 index 68426306..00000000 --- a/Migration.Toolkit.K11/Models/ViewCommunityGroup.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCommunityGroup -{ - [Column("GroupID")] - public int GroupId { get; set; } - - [Column("GroupGUID")] - public Guid GroupGuid { get; set; } - - public DateTime GroupLastModified { get; set; } - - [Column("GroupSiteID")] - public int GroupSiteId { get; set; } - - [StringLength(200)] - public string GroupDisplayName { get; set; } = null!; - - [StringLength(100)] - public string GroupName { get; set; } = null!; - - public string GroupDescription { get; set; } = null!; - - [Column("GroupNodeGUID")] - public Guid? GroupNodeGuid { get; set; } - - public int GroupApproveMembers { get; set; } - - public int GroupAccess { get; set; } - - [Column("GroupCreatedByUserID")] - public int? GroupCreatedByUserId { get; set; } - - [Column("GroupApprovedByUserID")] - public int? GroupApprovedByUserId { get; set; } - - [Column("GroupAvatarID")] - public int? GroupAvatarId { get; set; } - - public bool? GroupApproved { get; set; } - - public DateTime GroupCreatedWhen { get; set; } - - public bool? GroupSendJoinLeaveNotification { get; set; } - - public bool? GroupSendWaitingForApprovalNotification { get; set; } - - public int? GroupSecurity { get; set; } - - public bool? GroupLogActivity { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarFileName { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewCommunityMember.cs b/Migration.Toolkit.K11/Models/ViewCommunityMember.cs deleted file mode 100644 index 53de7d66..00000000 --- a/Migration.Toolkit.K11/Models/ViewCommunityMember.cs +++ /dev/null @@ -1,248 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewCommunityMember -{ - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [Column("UserSettingsID")] - public int? UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - [StringLength(200)] - public string? UserMessagingNotificationEmail { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid? UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int? UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [Column("MemberID")] - public int? MemberId { get; set; } - - [Column("MemberGUID")] - public Guid? MemberGuid { get; set; } - - [Column("MemberUserID")] - public int? MemberUserId { get; set; } - - [Column("MemberGroupID")] - public int? MemberGroupId { get; set; } - - public DateTime? MemberJoined { get; set; } - - public DateTime? MemberApprovedWhen { get; set; } - - public DateTime? MemberRejectedWhen { get; set; } - - [Column("MemberApprovedByUserID")] - public int? MemberApprovedByUserId { get; set; } - - public string? MemberComment { get; set; } - - [Column("MemberInvitedByUserID")] - public int? MemberInvitedByUserId { get; set; } - - public int? MemberStatus { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } - - [StringLength(200)] - public string? AvatarName { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewForumsGroupForumPostJoined.cs b/Migration.Toolkit.K11/Models/ViewForumsGroupForumPostJoined.cs deleted file mode 100644 index b660bb96..00000000 --- a/Migration.Toolkit.K11/Models/ViewForumsGroupForumPostJoined.cs +++ /dev/null @@ -1,227 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewForumsGroupForumPostJoined -{ - [Column("ForumID")] - public int? ForumId { get; set; } - - [Column("ForumGroupID")] - public int? ForumGroupId { get; set; } - - [StringLength(200)] - public string? ForumName { get; set; } - - [StringLength(200)] - public string? ForumDisplayName { get; set; } - - public string? ForumDescription { get; set; } - - public int? ForumOrder { get; set; } - - [Column("ForumDocumentID")] - public int? ForumDocumentId { get; set; } - - public bool? ForumOpen { get; set; } - - public bool? ForumModerated { get; set; } - - public bool? ForumDisplayEmails { get; set; } - - public bool? ForumRequireEmail { get; set; } - - public int? ForumAccess { get; set; } - - public int? ForumThreads { get; set; } - - public int? ForumPosts { get; set; } - - public DateTime? ForumLastPostTime { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserName { get; set; } - - [StringLength(200)] - public string? ForumBaseUrl { get; set; } - - public bool? ForumAllowChangeName { get; set; } - - [Column("ForumHTMLEditor")] - public bool? ForumHtmleditor { get; set; } - - [Column("ForumUseCAPTCHA")] - public bool? ForumUseCaptcha { get; set; } - - [Column("ForumGUID")] - public Guid? ForumGuid { get; set; } - - public DateTime? ForumLastModified { get; set; } - - [StringLength(200)] - public string? ForumUnsubscriptionUrl { get; set; } - - public bool? ForumIsLocked { get; set; } - - public string? ForumSettings { get; set; } - - public bool? ForumAuthorEdit { get; set; } - - public bool? ForumAuthorDelete { get; set; } - - public int? ForumType { get; set; } - - public int? ForumIsAnswerLimit { get; set; } - - public int? ForumImageMaxSideSize { get; set; } - - public DateTime? ForumLastPostTimeAbsolute { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserNameAbsolute { get; set; } - - public int? ForumPostsAbsolute { get; set; } - - public int? ForumThreadsAbsolute { get; set; } - - public int? ForumAttachmentMaxFileSize { get; set; } - - public int? ForumDiscussionActions { get; set; } - - [Column("ForumSiteID")] - public int? ForumSiteId { get; set; } - - [Column("GroupID")] - public int? GroupId { get; set; } - - [Column("GroupSiteID")] - public int? GroupSiteId { get; set; } - - [StringLength(200)] - public string? GroupName { get; set; } - - [StringLength(200)] - public string? GroupDisplayName { get; set; } - - public int? GroupOrder { get; set; } - - public string? GroupDescription { get; set; } - - [Column("GroupGUID")] - public Guid? GroupGuid { get; set; } - - public DateTime? GroupLastModified { get; set; } - - [StringLength(200)] - public string? GroupBaseUrl { get; set; } - - [StringLength(200)] - public string? GroupUnsubscriptionUrl { get; set; } - - [Column("GroupGroupID")] - public int? GroupGroupId { get; set; } - - public bool? GroupAuthorEdit { get; set; } - - public bool? GroupAuthorDelete { get; set; } - - public int? GroupType { get; set; } - - public int? GroupIsAnswerLimit { get; set; } - - public int? GroupImageMaxSideSize { get; set; } - - public bool? GroupDisplayEmails { get; set; } - - public bool? GroupRequireEmail { get; set; } - - [Column("GroupHTMLEditor")] - public bool? GroupHtmleditor { get; set; } - - [Column("GroupUseCAPTCHA")] - public bool? GroupUseCaptcha { get; set; } - - public int? GroupAttachmentMaxFileSize { get; set; } - - public int? GroupDiscussionActions { get; set; } - - public int PostId { get; set; } - - [Column("PostForumID")] - public int PostForumId { get; set; } - - [Column("PostParentID")] - public int? PostParentId { get; set; } - - [Column("PostIDPath")] - [StringLength(450)] - public string PostIdpath { get; set; } = null!; - - public int PostLevel { get; set; } - - [StringLength(450)] - public string PostSubject { get; set; } = null!; - - [Column("PostUserID")] - public int? PostUserId { get; set; } - - [StringLength(200)] - public string PostUserName { get; set; } = null!; - - [StringLength(254)] - public string? PostUserMail { get; set; } - - public string? PostText { get; set; } - - public DateTime PostTime { get; set; } - - [Column("PostApprovedByUserID")] - public int? PostApprovedByUserId { get; set; } - - public int? PostThreadPosts { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserName { get; set; } - - public DateTime? PostThreadLastPostTime { get; set; } - - public string? PostUserSignature { get; set; } - - [Column("PostGUID")] - public Guid PostGuid { get; set; } - - public DateTime PostLastModified { get; set; } - - public bool? PostApproved { get; set; } - - public bool? PostIsLocked { get; set; } - - public int? PostIsAnswer { get; set; } - - public int PostStickOrder { get; set; } - - public int? PostViews { get; set; } - - public DateTime? PostLastEdit { get; set; } - - public string? PostInfo { get; set; } - - public int? PostAttachmentCount { get; set; } - - public int? PostType { get; set; } - - public int? PostThreadPostsAbsolute { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserNameAbsolute { get; set; } - - public DateTime? PostThreadLastPostTimeAbsolute { get; set; } - - public bool? PostQuestionSolved { get; set; } - - public int? PostIsNotAnswer { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewIntegrationTaskJoined.cs b/Migration.Toolkit.K11/Models/ViewIntegrationTaskJoined.cs deleted file mode 100644 index e49897f2..00000000 --- a/Migration.Toolkit.K11/Models/ViewIntegrationTaskJoined.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewIntegrationTaskJoined -{ - [Column("SynchronizationID")] - public int? SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int? SynchronizationTaskId { get; set; } - - [Column("SynchronizationConnectorID")] - public int? SynchronizationConnectorId { get; set; } - - public DateTime? SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - public bool? SynchronizationIsRunning { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - [StringLength(450)] - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool TaskIsInbound { get; set; } - - [StringLength(50)] - public string? TaskProcessType { get; set; } - - public string TaskData { get; set; } = null!; - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(50)] - public string? TaskDataType { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewMembershipMembershipUserJoined.cs b/Migration.Toolkit.K11/Models/ViewMembershipMembershipUserJoined.cs deleted file mode 100644 index 8bc0b640..00000000 --- a/Migration.Toolkit.K11/Models/ViewMembershipMembershipUserJoined.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewMembershipMembershipUserJoined -{ - [StringLength(200)] - public string MembershipDisplayName { get; set; } = null!; - - [Column("MembershipID")] - public int MembershipId { get; set; } - - public DateTime? ValidTo { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [Column("MembershipSiteID")] - public int? MembershipSiteId { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewNewsletterSubscriptionsJoined.cs b/Migration.Toolkit.K11/Models/ViewNewsletterSubscriptionsJoined.cs deleted file mode 100644 index 4339f3af..00000000 --- a/Migration.Toolkit.K11/Models/ViewNewsletterSubscriptionsJoined.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewNewsletterSubscriptionsJoined -{ - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [StringLength(440)] - public string? SubscriberFullName { get; set; } - - [StringLength(254)] - public string? SubscriberEmail { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - [StringLength(100)] - public string? SubscriberType { get; set; } - - public int? SubscriberBounces { get; set; } - - [StringLength(250)] - public string NewsletterDisplayName { get; set; } = null!; - - [Column("SubscriberRelatedID")] - public int SubscriberRelatedId { get; set; } - - [Column("SubscriberNewsletterID")] - public int SubscriberNewsletterId { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Toolkit.K11/Models/ViewOmAccountContactAccountJoined.cs deleted file mode 100644 index eaffc266..00000000 --- a/Migration.Toolkit.K11/Models/ViewOmAccountContactAccountJoined.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewOmAccountContactAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewOmAccountContactContactJoined.cs b/Migration.Toolkit.K11/Models/ViewOmAccountContactContactJoined.cs deleted file mode 100644 index c5cbe210..00000000 --- a/Migration.Toolkit.K11/Models/ViewOmAccountContactContactJoined.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewOmAccountContactContactJoined -{ - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewOmAccountJoined.cs b/Migration.Toolkit.K11/Models/ViewOmAccountJoined.cs deleted file mode 100644 index d6b8536e..00000000 --- a/Migration.Toolkit.K11/Models/ViewOmAccountJoined.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewOmAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [StringLength(100)] - public string? PrimaryContactFirstName { get; set; } - - [StringLength(100)] - public string? PrimaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? PrimaryContactLastName { get; set; } - - [StringLength(100)] - public string? SecondaryContactFirstName { get; set; } - - [StringLength(100)] - public string? SecondaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? SecondaryContactLastName { get; set; } - - [StringLength(200)] - public string? SubsidiaryOfName { get; set; } - - [StringLength(302)] - public string PrimaryContactFullName { get; set; } = null!; - - [StringLength(302)] - public string SecondaryContactFullName { get; set; } = null!; - - [StringLength(201)] - public string AccountFullAddress { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberAccountJoined.cs deleted file mode 100644 index 646e8c00..00000000 --- a/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberAccountJoined.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewOmContactGroupMemberAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewPollAnswerCount.cs b/Migration.Toolkit.K11/Models/ViewPollAnswerCount.cs deleted file mode 100644 index 452759e6..00000000 --- a/Migration.Toolkit.K11/Models/ViewPollAnswerCount.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewPollAnswerCount -{ - [Column("PollID")] - public int PollId { get; set; } - - [StringLength(200)] - public string PollCodeName { get; set; } = null!; - - [StringLength(200)] - public string PollDisplayName { get; set; } = null!; - - [StringLength(100)] - public string? PollTitle { get; set; } - - public DateTime? PollOpenFrom { get; set; } - - public DateTime? PollOpenTo { get; set; } - - public bool PollAllowMultipleAnswers { get; set; } - - [StringLength(450)] - public string PollQuestion { get; set; } = null!; - - public int PollAccess { get; set; } - - [StringLength(450)] - public string? PollResponseMessage { get; set; } - - [Column("PollGUID")] - public Guid PollGuid { get; set; } - - public DateTime PollLastModified { get; set; } - - [Column("PollGroupID")] - public int? PollGroupId { get; set; } - - [Column("PollSiteID")] - public int? PollSiteId { get; set; } - - public bool? PollLogActivity { get; set; } - - public int? AnswerCount { get; set; } -} diff --git a/Migration.Toolkit.K11/Models/ViewReportingCategoryReportJoined.cs b/Migration.Toolkit.K11/Models/ViewReportingCategoryReportJoined.cs deleted file mode 100644 index afbb6e0c..00000000 --- a/Migration.Toolkit.K11/Models/ViewReportingCategoryReportJoined.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public class ViewReportingCategoryReportJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(200)] - public string CodeName { get; set; } = null!; - - [StringLength(440)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(651)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryReportChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - public string? ReportLayout { get; set; } - - public string? ReportParameters { get; set; } - - public int? ReportAccess { get; set; } - - [StringLength(14)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; -} diff --git a/Migration.Toolkit.K11/SettingsKeys.cs b/Migration.Toolkit.K11/SettingsKeys.cs deleted file mode 100644 index f496b4d6..00000000 --- a/Migration.Toolkit.K11/SettingsKeys.cs +++ /dev/null @@ -1,750 +0,0 @@ -// ReSharper disable InconsistentNaming -// ReSharper disable IdentifierTypo - -namespace Migration.Toolkit.K11; - -public static class SettingsKeys -{ - public const string CMSABTestingEnabled = "CMSABTestingEnabled"; - public const string CMSAccessDeniedPageURL = "CMSAccessDeniedPageURL"; - public const string CMSActivityPointsForBlogCommentPost = "CMSActivityPointsForBlogCommentPost"; - public const string CMSActivityPointsForBlogPost = "CMSActivityPointsForBlogPost"; - public const string CMSActivityPointsForForumPost = "CMSActivityPointsForForumPost"; - public const string CMSActivityPointsForMessageBoardPost = "CMSActivityPointsForMessageBoardPost"; - public const string CMSActivityTrackedExtensions = "CMSActivityTrackedExtensions"; - public const string CMSAdminEmailAddress = "CMSAdminEmailAddress"; - public const string CMSAllowAttachmentTranslation = "CMSAllowAttachmentTranslation"; - public const string CMSAllowComponentsCSS = "CMSAllowComponentsCSS"; - public const string CMSAllowDynamicNewsletters = "CMSAllowDynamicNewsletters"; - public const string CMSAllowedURLCharacters = "CMSAllowedURLCharacters"; - public const string CMSAllowGlobalCategories = "CMSAllowGlobalCategories"; - public const string CMSAllowGZip = "CMSAllowGZip"; - public const string CMSAllowOnSiteEditing = "CMSAllowOnSiteEditing"; - public const string CMSAllowPermanentPreviewLink = "CMSAllowPermanentPreviewLink"; - public const string CMSAllowPreviewMode = "CMSAllowPreviewMode"; - public const string CMSAllowUrlsWithoutLanguagePrefixes = "CMSAllowUrlsWithoutLanguagePrefixes"; - public const string CMSAlternativeURLsConstraint = "CMSAlternativeURLsConstraint"; - public const string CMSAlternativeURLsErrorMessage = "CMSAlternativeURLsErrorMessage"; - public const string CMSAlternativeURLsExcludedURLs = "CMSAlternativeURLsExcludedURLs"; - public const string CMSAlternativeURLsMode = "CMSAlternativeURLsMode"; - public const string CMSAlternativeUrlUIEnabled = "CMSAlternativeUrlUIEnabled"; - public const string CMSAnalyticsEnabled = "CMSAnalyticsEnabled"; - public const string CMSAnalyticsExcludedFileExtensions = "CMSAnalyticsExcludedFileExtensions"; - public const string CMSAnalyticsExcludedIPs = "CMSAnalyticsExcludedIPs"; - public const string CMSAnalyticsExcludedURLs = "CMSAnalyticsExcludedURLs"; - public const string CMSAnalyticsExcludeSearchEngines = "CMSAnalyticsExcludeSearchEngines"; - public const string CMSAnalyticsTrackAggregatedViews = "CMSAnalyticsTrackAggregatedViews"; - public const string CMSAnalyticsTrackBrowserTypes = "CMSAnalyticsTrackBrowserTypes"; - public const string CMSAnalyticsTrackCountries = "CMSAnalyticsTrackCountries"; - public const string CMSAnalyticsTrackFileDownloads = "CMSAnalyticsTrackFileDownloads"; - public const string CMSAnalyticsTrackInvalidPages = "CMSAnalyticsTrackInvalidPages"; - public const string CMSAnalyticsTrackPageViews = "CMSAnalyticsTrackPageViews"; - public const string CMSAnalyticsTrackReferrals = "CMSAnalyticsTrackReferrals"; - public const string CMSAnalyticsTrackRegisteredUsers = "CMSAnalyticsTrackRegisteredUsers"; - public const string CMSAnalyticsTrackVisits = "CMSAnalyticsTrackVisits"; - public const string CMSAnalyticsVisitorsSmartCheck = "CMSAnalyticsVisitorsSmartCheck"; - public const string CMSApplicationHealthMonitoringInterval = "CMSApplicationHealthMonitoringInterval"; - public const string CMSApplicationID = "CMSApplicationID"; - public const string CMSApplicationSecret = "CMSApplicationSecret"; - public const string CMSApplicationState = "CMSApplicationState"; - public const string CMSArchiveEmails = "CMSArchiveEmails"; - public const string CMSAuthorizeNETAPILogin = "CMSAuthorizeNETAPILogin"; - public const string CMSAuthorizeNETTransactionKey = "CMSAuthorizeNETTransactionKey"; - public const string CMSAuthorizeNETTransactionType = "CMSAuthorizeNETTransactionType"; - public const string CMSAutocompleteEnableForLogin = "CMSAutocompleteEnableForLogin"; - public const string CMSAutomaticallySignInUser = "CMSAutomaticallySignInUser"; - public const string CMSAutoResizeImageHeight = "CMSAutoResizeImageHeight"; - public const string CMSAutoResizeImageMaxSideSize = "CMSAutoResizeImageMaxSideSize"; - public const string CMSAutoResizeImageWidth = "CMSAutoResizeImageWidth"; - public const string CMSAvatarHeight = "CMSAvatarHeight"; - public const string CMSAvatarMaxSideSize = "CMSAvatarMaxSideSize"; - public const string CMSAvatarType = "CMSAvatarType"; - public const string CMSAvatarWidth = "CMSAvatarWidth"; - public const string CMSBadWordsAction = "CMSBadWordsAction"; - public const string CMSBadWordsReplacement = "CMSBadWordsReplacement"; - public const string CMSBannedIPEnabled = "CMSBannedIPEnabled"; - public const string CMSBannedIPRedirectURL = "CMSBannedIPRedirectURL"; - public const string CMSBitlyAPIKey = "CMSBitlyAPIKey"; - public const string CMSBitlyLogin = "CMSBitlyLogin"; - public const string CMSBizFormFilesFolder = "CMSBizFormFilesFolder"; - public const string CMSBlockSubscribersGlobally = "CMSBlockSubscribersGlobally"; - public const string CMSBlogEnableOptIn = "CMSBlogEnableOptIn"; - public const string CMSBlogEnableOptInConfirmation = "CMSBlogEnableOptInConfirmation"; - public const string CMSBlogOptInApprovalPath = "CMSBlogOptInApprovalPath"; - public const string CMSBlogOptInInterval = "CMSBlogOptInInterval"; - public const string CMSBlogsUnsubscriptionUrl = "CMSBlogsUnsubscriptionUrl"; - public const string CMSBoardBaseUrl = "CMSBoardBaseUrl"; - public const string CMSBoardEnableOptIn = "CMSBoardEnableOptIn"; - public const string CMSBoardEnableOptInConfirmation = "CMSBoardEnableOptInConfirmation"; - public const string CMSBoardOptInApprovalPath = "CMSBoardOptInApprovalPath"; - public const string CMSBoardOptInInterval = "CMSBoardOptInInterval"; - public const string CMSBoardUnsubsriptionURL = "CMSBoardUnsubsriptionURL"; - public const string CMSBouncedEmailAddress = "CMSBouncedEmailAddress"; - public const string CMSBouncedEmailsLimit = "CMSBouncedEmailsLimit"; - public const string CMSCacheImages = "CMSCacheImages"; - public const string CMSCacheMinutes = "CMSCacheMinutes"; - public const string CMSCachePageInfo = "CMSCachePageInfo"; - public const string CMSCampaignNewPageLocation = "CMSCampaignNewPageLocation"; - public const string CMSCaptchaControl = "CMSCaptchaControl"; - public const string CMSChatAllowAnonymGlobally = "CMSChatAllowAnonymGlobally"; - public const string CMSChatDaysNeededToDeleteRecods = "CMSChatDaysNeededToDeleteRecods"; - public const string CMSChatDisplayAnnouncementAtFirstLoad = "CMSChatDisplayAnnouncementAtFirstLoad"; - public const string CMSChatDisplayChangeNicknameAtFirstLoad = "CMSChatDisplayChangeNicknameAtFirstLoad"; - public const string CMSChatDisplayEnterAtFirstLoad = "CMSChatDisplayEnterAtFirstLoad"; - public const string CMSChatDisplayInvitedAtFirstLoad = "CMSChatDisplayInvitedAtFirstLoad"; - public const string CMSChatDisplayKickAtFirstLoad = "CMSChatDisplayKickAtFirstLoad"; - public const string CMSChatDisplayLeaveAtFirstLoad = "CMSChatDisplayLeaveAtFirstLoad"; - public const string CMSChatDisplaySupportGreetingAtFirstLoad = "CMSChatDisplaySupportGreetingAtFirstLoad"; - public const string CMSChatEnableBBCode = "CMSChatEnableBBCode"; - public const string CMSChatEnableFloodProtection = "CMSChatEnableFloodProtection"; - public const string CMSChatEnableSmileys = "CMSChatEnableSmileys"; - public const string CMSChatEnableSoundLiveChat = "CMSChatEnableSoundLiveChat"; - public const string CMSChatEnableSoundSupportChat = "CMSChatEnableSoundSupportChat"; - public const string CMSChatErrorDeleteAllTrans = "CMSChatErrorDeleteAllTrans"; - public const string CMSChatErrorTrans = "CMSChatErrorTrans"; - public const string CMSChatFirstLoadMessagesCount = "CMSChatFirstLoadMessagesCount"; - public const string CMSChatFloodProtectionChangeNickname = "CMSChatFloodProtectionChangeNickname"; - public const string CMSChatFloodProtectionCreateRoom = "CMSChatFloodProtectionCreateRoom"; - public const string CMSChatFloodProtectionJoinRoom = "CMSChatFloodProtectionJoinRoom"; - public const string CMSChatFloodProtectionPostMessage = "CMSChatFloodProtectionPostMessage"; - public const string CMSChatForceAnonymUniqueNicknames = "CMSChatForceAnonymUniqueNicknames"; - public const string CMSChatGlobalPingInterval = "CMSChatGlobalPingInterval"; - public const string CMSChatGuestPrefix = "CMSChatGuestPrefix"; - public const string CMSChatInitiatedChatTrans = "CMSChatInitiatedChatTrans"; - public const string CMSChatKickLastingTime = "CMSChatKickLastingTime"; - public const string CMSChatMaximumMessageLength = "CMSChatMaximumMessageLength"; - public const string CMSChatNotificationTrans = "CMSChatNotificationTrans"; - public const string CMSChatOnlineUserTrans = "CMSChatOnlineUserTrans"; - public const string CMSChatRedirectURLJoin = "CMSChatRedirectURLJoin"; - public const string CMSChatRedirectURLLeave = "CMSChatRedirectURLLeave"; - public const string CMSChatRedirectURLLogin = "CMSChatRedirectURLLogin"; - public const string CMSChatRedirectURLLogout = "CMSChatRedirectURLLogout"; - public const string CMSChatResolveURLEnabled = "CMSChatResolveURLEnabled"; - public const string CMSChatRoomMessageTrans = "CMSChatRoomMessageTrans"; - public const string CMSChatRoomNameTrans = "CMSChatRoomNameTrans"; - public const string CMSChatRoomPingInterval = "CMSChatRoomPingInterval"; - public const string CMSChatRoomPopupWindow = "CMSChatRoomPopupWindow"; - public const string CMSChatRoomTrans = "CMSChatRoomTrans"; - public const string CMSChatRoomUserTrans = "CMSChatRoomUserTrans"; - public const string CMSChatSendSupportMessagesTo = "CMSChatSendSupportMessagesTo"; - public const string CMSChatSupportEnabled = "CMSChatSupportEnabled"; - public const string CMSChatSupportEngineerLogoutTimeout = "CMSChatSupportEngineerLogoutTimeout"; - public const string CMSChatSupportRequestTrans = "CMSChatSupportRequestTrans"; - public const string CMSChatSupportTakenRoomReleaseTimeout = "CMSChatSupportTakenRoomReleaseTimeout"; - public const string CMSChatUserLogoutTimeout = "CMSChatUserLogoutTimeout"; - public const string CMSChatWPDefaultGroupPagesBy = "CMSChatWPDefaultGroupPagesBy"; - public const string CMSChatWPDefaultInviteModePagingItems = "CMSChatWPDefaultInviteModePagingItems"; - public const string CMSChatWPDefaultInviteModeSearchMode = "CMSChatWPDefaultInviteModeSearchMode"; - public const string CMSChatWPDefaultPagingItems = "CMSChatWPDefaultPagingItems"; - public const string CMSChatWPDefaultSearchOnlineMaxUsers = "CMSChatWPDefaultSearchOnlineMaxUsers"; - public const string CMSChatWPDefaultShowFilterLimit = "CMSChatWPDefaultShowFilterLimit"; - public const string CMSCheapestVariantAdvertising = "CMSCheapestVariantAdvertising"; - public const string CMSCheckBadWords = "CMSCheckBadWords"; - public const string CMSCheckDocumentPermissions = "CMSCheckDocumentPermissions"; - public const string CMSCheckFilesPermissions = "CMSCheckFilesPermissions"; - public const string CMSCheckMediaFilePermissions = "CMSCheckMediaFilePermissions"; - public const string CMSCheckPagePermissions = "CMSCheckPagePermissions"; - public const string CMSCheckPublishedFiles = "CMSCheckPublishedFiles"; - public const string CMSClientCacheMinutes = "CMSClientCacheMinutes"; - public const string CMSCMActivitiesEnabled = "CMSCMActivitiesEnabled"; - public const string CMSCMAddingProductToSC = "CMSCMAddingProductToSC"; - public const string CMSCMAddingProductToWL = "CMSCMAddingProductToWL"; - public const string CMSCMBizFormSubmission = "CMSCMBizFormSubmission"; - public const string CMSCMBlogPostComments = "CMSCMBlogPostComments"; - public const string CMSCMBlogPostSubscription = "CMSCMBlogPostSubscription"; - public const string CMSCMClickthroughTracking = "CMSCMClickthroughTracking"; - public const string CMSCMContentRating = "CMSCMContentRating"; - public const string CMSCMCustomActivities = "CMSCMCustomActivities"; - public const string CMSCMCustomTableForm = "CMSCMCustomTableForm"; - public const string CMSCMEmailOpening = "CMSCMEmailOpening"; - public const string CMSCMEnableGeolocation = "CMSCMEnableGeolocation"; - public const string CMSCMEventBooking = "CMSCMEventBooking"; - public const string CMSCMExternalSearch = "CMSCMExternalSearch"; - public const string CMSCMForumPosts = "CMSCMForumPosts"; - public const string CMSCMForumPostSubscription = "CMSCMForumPostSubscription"; - public const string CMSCMGeoCity = "CMSCMGeoCity"; - public const string CMSCMGeoCountry = "CMSCMGeoCountry"; - public const string CMSCMGeoLatitude = "CMSCMGeoLatitude"; - public const string CMSCMGeoLongitude = "CMSCMGeoLongitude"; - public const string CMSCMGeoMetro = "CMSCMGeoMetro"; - public const string CMSCMGeoNewDB = "CMSCMGeoNewDB"; - public const string CMSCMGeoOrganization = "CMSCMGeoOrganization"; - public const string CMSCMGeoPostal = "CMSCMGeoPostal"; - public const string CMSCMGeoState = "CMSCMGeoState"; - public const string CMSCMGeoSuffix = "CMSCMGeoSuffix"; - public const string CMSCMLandingPage = "CMSCMLandingPage"; - public const string CMSCMMessageBoardPosts = "CMSCMMessageBoardPosts"; - public const string CMSCMMessageBoardSubscription = "CMSCMMessageBoardSubscription"; - public const string CMSCMNewsletterSubscribe = "CMSCMNewsletterSubscribe"; - public const string CMSCMNewsletterUnsubscribe = "CMSCMNewsletterUnsubscribe"; - public const string CMSCMNewsletterUnsubscribedFromAll = "CMSCMNewsletterUnsubscribedFromAll"; - public const string CMSCMPageVisits = "CMSCMPageVisits"; - public const string CMSCMPollVoting = "CMSCMPollVoting"; - public const string CMSCMPurchase = "CMSCMPurchase"; - public const string CMSCMPurchasedProduct = "CMSCMPurchasedProduct"; - public const string CMSCMRemovingProductFromSC = "CMSCMRemovingProductFromSC"; - public const string CMSCMSearch = "CMSCMSearch"; - public const string CMSCMStamp = "CMSCMStamp"; - public const string CMSCMUserLogin = "CMSCMUserLogin"; - public const string CMSCMUserRegistration = "CMSCMUserRegistration"; - public const string CMSCodeNamePrefix = "CMSCodeNamePrefix"; - public const string CMSCombineComponentsCSS = "CMSCombineComponentsCSS"; - public const string CMSCombineImagesWithDefaultCulture = "CMSCombineImagesWithDefaultCulture"; - public const string CMSCombineWithDefaultCulture = "CMSCombineWithDefaultCulture"; - public const string CMSConfirmChanges = "CMSConfirmChanges"; - public const string CMSContentImageWatermark = "CMSContentImageWatermark"; - public const string CMSContentPersonalizationEnabled = "CMSContentPersonalizationEnabled"; - public const string CMSControlElement = "CMSControlElement"; - public const string CMSConvertTablesToDivs = "CMSConvertTablesToDivs"; - public const string CMSDataVersion = "CMSDataVersion"; - public const string CMSDBSeparationStartedByServer = "CMSDBSeparationStartedByServer"; - public const string CMSDBVersion = "CMSDBVersion"; - public const string CMSDebugAllCache = "CMSDebugAllCache"; - public const string CMSDebugAllFiles = "CMSDebugAllFiles"; - public const string CMSDebugAllForEverything = "CMSDebugAllForEverything"; - public const string CMSDebugAllHandlers = "CMSDebugAllHandlers"; - public const string CMSDebugAllMacros = "CMSDebugAllMacros"; - public const string CMSDebugAllOutput = "CMSDebugAllOutput"; - public const string CMSDebugAllRequests = "CMSDebugAllRequests"; - public const string CMSDebugAllSecurity = "CMSDebugAllSecurity"; - public const string CMSDebugAllSQLQueries = "CMSDebugAllSQLQueries"; - public const string CMSDebugAllViewState = "CMSDebugAllViewState"; - public const string CMSDebugAllWebFarm = "CMSDebugAllWebFarm"; - public const string CMSDebugAnalytics = "CMSDebugAnalytics"; - public const string CMSDebugAnalyticsLive = "CMSDebugAnalyticsLive"; - public const string CMSDebugAnalyticsLogLength = "CMSDebugAnalyticsLogLength"; - public const string CMSDebugAnalyticsStack = "CMSDebugAnalyticsStack"; - public const string CMSDebugCache = "CMSDebugCache"; - public const string CMSDebugCacheLive = "CMSDebugCacheLive"; - public const string CMSDebugCacheLogLength = "CMSDebugCacheLogLength"; - public const string CMSDebugCacheStack = "CMSDebugCacheStack"; - public const string CMSDebugEverything = "CMSDebugEverything"; - public const string CMSDebugEverythingEverywhere = "CMSDebugEverythingEverywhere"; - public const string CMSDebugEverythingLive = "CMSDebugEverythingLive"; - public const string CMSDebugEverythingLogLength = "CMSDebugEverythingLogLength"; - public const string CMSDebugFiles = "CMSDebugFiles"; - public const string CMSDebugFilesLive = "CMSDebugFilesLive"; - public const string CMSDebugFilesLogLength = "CMSDebugFilesLogLength"; - public const string CMSDebugFilesStack = "CMSDebugFilesStack"; - public const string CMSDebugHandlers = "CMSDebugHandlers"; - public const string CMSDebugHandlersLive = "CMSDebugHandlersLive"; - public const string CMSDebugHandlersLogLength = "CMSDebugHandlersLogLength"; - public const string CMSDebugHandlersStack = "CMSDebugHandlersStack"; - public const string CMSDebugImportExport = "CMSDebugImportExport"; - public const string CMSDebugMacros = "CMSDebugMacros"; - public const string CMSDebugMacrosDetailed = "CMSDebugMacrosDetailed"; - public const string CMSDebugMacrosLive = "CMSDebugMacrosLive"; - public const string CMSDebugMacrosLogLength = "CMSDebugMacrosLogLength"; - public const string CMSDebugMacrosStack = "CMSDebugMacrosStack"; - public const string CMSDebugOutput = "CMSDebugOutput"; - public const string CMSDebugOutputLive = "CMSDebugOutputLive"; - public const string CMSDebugOutputLogLength = "CMSDebugOutputLogLength"; - public const string CMSDebugRequests = "CMSDebugRequests"; - public const string CMSDebugRequestsLive = "CMSDebugRequestsLive"; - public const string CMSDebugRequestsLogLength = "CMSDebugRequestsLogLength"; - public const string CMSDebugRequestsStack = "CMSDebugRequestsStack"; - public const string CMSDebugResources = "CMSDebugResources"; - public const string CMSDebugScheduler = "CMSDebugScheduler"; - public const string CMSDebugSecurity = "CMSDebugSecurity"; - public const string CMSDebugSecurityLive = "CMSDebugSecurityLive"; - public const string CMSDebugSecurityLogLength = "CMSDebugSecurityLogLength"; - public const string CMSDebugSecurityStack = "CMSDebugSecurityStack"; - public const string CMSDebugSQLConnections = "CMSDebugSQLConnections"; - public const string CMSDebugSQLQueries = "CMSDebugSQLQueries"; - public const string CMSDebugSQLQueriesLive = "CMSDebugSQLQueriesLive"; - public const string CMSDebugSQLQueriesLogLength = "CMSDebugSQLQueriesLogLength"; - public const string CMSDebugSQLQueriesStack = "CMSDebugSQLQueriesStack"; - public const string CMSDebugStackForEverything = "CMSDebugStackForEverything"; - public const string CMSDebugViewState = "CMSDebugViewState"; - public const string CMSDebugViewStateLive = "CMSDebugViewStateLive"; - public const string CMSDebugViewStateLogLength = "CMSDebugViewStateLogLength"; - public const string CMSDebugWebFarm = "CMSDebugWebFarm"; - public const string CMSDebugWebFarmLive = "CMSDebugWebFarmLive"; - public const string CMSDebugWebFarmLogLength = "CMSDebugWebFarmLogLength"; - public const string CMSDebugWebFarmStack = "CMSDebugWebFarmStack"; - public const string CMSDefaulPage = "CMSDefaulPage"; - public const string CMSDefaultAliasPath = "CMSDefaultAliasPath"; - public const string CMSDefaultControlForBoolean = "CMSDefaultControlForBoolean"; - public const string CMSDefaultControlForDateTime = "CMSDefaultControlForDateTime"; - public const string CMSDefaultControlForDecimal = "CMSDefaultControlForDecimal"; - public const string CMSDefaultControlForDocAttachments = "CMSDefaultControlForDocAttachments"; - public const string CMSDefaultControlForDocRelationships = "CMSDefaultControlForDocRelationships"; - public const string CMSDefaultControlForFile = "CMSDefaultControlForFile"; - public const string CMSDefaultControlForGUID = "CMSDefaultControlForGUID"; - public const string CMSDefaultControlForInteger = "CMSDefaultControlForInteger"; - public const string CMSDefaultControlForLongText = "CMSDefaultControlForLongText"; - public const string CMSDefaultControlForText = "CMSDefaultControlForText"; - public const string CMSDefaultCookieLevel = "CMSDefaultCookieLevel"; - public const string CMSDefaultCultureCode = "CMSDefaultCultureCode"; - public const string CMSDefaultDeletedNodePath = "CMSDefaultDeletedNodePath"; - public const string CMSDefaultProductImageUrl = "CMSDefaultProductImageUrl"; - public const string CMSDefaultReportConnectionString = "CMSDefaultReportConnectionString"; - public const string CMSDefaultUrlPathPrefix = "CMSDefaultUrlPathPrefix"; - public const string CMSDefaultUserID = "CMSDefaultUserID"; - public const string CMSDeleteInactiveContactsLastXDays = "CMSDeleteInactiveContactsLastXDays"; - public const string CMSDeleteInactiveContactsMethod = "CMSDeleteInactiveContactsMethod"; - public const string CMSDeleteNonActivatedUserAfter = "CMSDeleteNonActivatedUserAfter"; - public const string CMSDenyLoginInterval = "CMSDenyLoginInterval"; - public const string CMSDepartmentTemplatePath = "CMSDepartmentTemplatePath"; - public const string CMSDeploymentMode = "CMSDeploymentMode"; - public const string CMSDeviceProfilesEnable = "CMSDeviceProfilesEnable"; - public const string CMSDisableDebug = "CMSDisableDebug"; - public const string CMSDisplayAccountLockInformation = "CMSDisplayAccountLockInformation"; - public const string CMSDisplayArchivedIcon = "CMSDisplayArchivedIcon"; - public const string CMSDisplayCheckedOutIcon = "CMSDisplayCheckedOutIcon"; - public const string CMSDisplayLinkedIcon = "CMSDisplayLinkedIcon"; - public const string CMSDisplayNotPublishedIcon = "CMSDisplayNotPublishedIcon"; - public const string CMSDisplayNotTranslatedIcon = "CMSDisplayNotTranslatedIcon"; - public const string CMSDisplayPublishedIcon = "CMSDisplayPublishedIcon"; - public const string CMSDisplayRedirectedIcon = "CMSDisplayRedirectedIcon"; - public const string CMSDisplayVersionNotPublishedIcon = "CMSDisplayVersionNotPublishedIcon"; - public const string CMSEmailBatchSize = "CMSEmailBatchSize"; - public const string CMSEmailEncoding = "CMSEmailEncoding"; - public const string CMSEmailFormat = "CMSEmailFormat"; - public const string CMSEmailQueueEnabled = "CMSEmailQueueEnabled"; - public const string CMSEmailsEnabled = "CMSEmailsEnabled"; - public const string CMSEmailTranslationFrom = "CMSEmailTranslationFrom"; - public const string CMSEmailTranslationRecipients = "CMSEmailTranslationRecipients"; - public const string CMSEnableCI = "CMSEnableCI"; - public const string CMSEnableCodeEditSiteAdministrators = "CMSEnableCodeEditSiteAdministrators"; - public const string CMSEnableDefaultAvatars = "CMSEnableDefaultAvatars"; - public const string CMSEnableFacebookConnect = "CMSEnableFacebookConnect"; - public const string CMSEnableHealthMonitoring = "CMSEnableHealthMonitoring"; - public const string CMSEnableLinkedIn = "CMSEnableLinkedIn"; - public const string CMSEnableObjectsVersioning = "CMSEnableObjectsVersioning"; - public const string CMSEnableOnlineMarketing = "CMSEnableOnlineMarketing"; - public const string CMSEnableOpenID = "CMSEnableOpenID"; - public const string CMSEnableOutputCache = "CMSEnableOutputCache"; - public const string CMSEnablePartialCache = "CMSEnablePartialCache"; - public const string CMSEnableSiteCounters = "CMSEnableSiteCounters"; - public const string CMSEnableTranlsationRESTService = "CMSEnableTranlsationRESTService"; - public const string CMSEnableTranslations = "CMSEnableTranslations"; - public const string CMSEnableUserCounts = "CMSEnableUserCounts"; - public const string CMSEnableVersioningCMSAlternativeForm = "CMSEnableVersioningCMSAlternativeForm"; - public const string CMSEnableVersioningCMSCssStylesheet = "CMSEnableVersioningCMSCssStylesheet"; - public const string CMSEnableVersioningCMSCustomTable = "CMSEnableVersioningCMSCustomTable"; - public const string CMSEnableVersioningCMSDocumentType = "CMSEnableVersioningCMSDocumentType"; - public const string CMSEnableVersioningCMSEmailTemplate = "CMSEnableVersioningCMSEmailTemplate"; - public const string CMSEnableVersioningCMSForm = "CMSEnableVersioningCMSForm"; - public const string CMSEnableVersioningCMSLayout = "CMSEnableVersioningCMSLayout"; - public const string CMSEnableVersioningCMSPageTemplate = "CMSEnableVersioningCMSPageTemplate"; - public const string CMSEnableVersioningCMSQuery = "CMSEnableVersioningCMSQuery"; - public const string CMSEnableVersioningCMSTemplateDeviceLayout = "CMSEnableVersioningCMSTemplateDeviceLayout"; - public const string CMSEnableVersioningCMSTransformation = "CMSEnableVersioningCMSTransformation"; - public const string CMSEnableVersioningCMSUIElement = "CMSEnableVersioningCMSUIElement"; - public const string CMSEnableVersioningCMSWebPartContainer = "CMSEnableVersioningCMSWebPartContainer"; - public const string CMSEnableVersioningCMSWebPartLayout = "CMSEnableVersioningCMSWebPartLayout"; - public const string CMSEnableVersioningCMSWorkflow = "CMSEnableVersioningCMSWorkflow"; - public const string CMSEnableVersioningMAAutomationProcess = "CMSEnableVersioningMAAutomationProcess"; - public const string CMSEnableVersioningMediaFile = "CMSEnableVersioningMediaFile"; - public const string CMSEnableVersioningNewsletterEmailTemplate = "CMSEnableVersioningNewsletterEmailTemplate"; - public const string CMSEnableVersioningNewsletterEmailWidget = "CMSEnableVersioningNewsletterEmailWidget"; - public const string CMSEnableVersioningNewsletterIssue = "CMSEnableVersioningNewsletterIssue"; - public const string CMSEnableVersioningReportingReport = "CMSEnableVersioningReportingReport"; - public const string CMSEnableVersioningReportingReportGraph = "CMSEnableVersioningReportingReportGraph"; - public const string CMSEnableVersioningReportingReportTable = "CMSEnableVersioningReportingReportTable"; - public const string CMSEnableVersioningReportingReportValue = "CMSEnableVersioningReportingReportValue"; - public const string CMSEnableWebDAV = "CMSEnableWebDAV"; - public const string CMSEnableWindowsLiveID = "CMSEnableWindowsLiveID"; - public const string CMSEventManagerInvitationFrom = "CMSEventManagerInvitationFrom"; - public const string CMSEventManagerInvitationSubject = "CMSEventManagerInvitationSubject"; - public const string CMSEventManagerSenderName = "CMSEventManagerSenderName"; - public const string CMSExcludedAttributesFilterURLs = "CMSExcludedAttributesFilterURLs"; - public const string CMSExcludedFormFilterURLs = "CMSExcludedFormFilterURLs"; - public const string CMSExcludedHTML5FilterURLs = "CMSExcludedHTML5FilterURLs"; - public const string CMSExcludedJavascriptFilterURLs = "CMSExcludedJavascriptFilterURLs"; - public const string CMSExcludedLowercaseFilterURLs = "CMSExcludedLowercaseFilterURLs"; - public const string CMSExcludeDocumentsFromSearch = "CMSExcludeDocumentsFromSearch"; - public const string CMSExcludeDocumentTypesFromSearch = "CMSExcludeDocumentTypesFromSearch"; - public const string CMSExcludedResolveFilterURLs = "CMSExcludedResolveFilterURLs"; - public const string CMSExcludedSelfcloseFilterURLs = "CMSExcludedSelfcloseFilterURLs"; - public const string CMSExcludedURLs = "CMSExcludedURLs"; - public const string CMSExcludedXHTMLFilterURLs = "CMSExcludedXHTMLFilterURLs"; - public const string CMSExportLogObjectChanges = "CMSExportLogObjectChanges"; - public const string CMSFacebookApplicationSecret = "CMSFacebookApplicationSecret"; - public const string CMSFacebookConnectApiKey = "CMSFacebookConnectApiKey"; - public const string CMSFacebookMapUserProfile = "CMSFacebookMapUserProfile"; - public const string CMSFacebookRoles = "CMSFacebookRoles"; - public const string CMSFacebookUserMapping = "CMSFacebookUserMapping"; - public const string CMSFaviconPath = "CMSFaviconPath"; - public const string CMSFilesFolder = "CMSFilesFolder"; - public const string CMSFilesFriendlyURLExtension = "CMSFilesFriendlyURLExtension"; - public const string CMSFilesLocationType = "CMSFilesLocationType"; - public const string CMSFileSystemOutputCacheMinutes = "CMSFileSystemOutputCacheMinutes"; - public const string CMSFloodInterval = "CMSFloodInterval"; - public const string CMSFloodProtectionEnabled = "CMSFloodProtectionEnabled"; - public const string CMSForbiddenCharactersReplacement = "CMSForbiddenCharactersReplacement"; - public const string CMSForbiddenURLCharacters = "CMSForbiddenURLCharacters"; - public const string CMSForumAttachmentExtensions = "CMSForumAttachmentExtensions"; - public const string CMSForumBaseUrl = "CMSForumBaseUrl"; - public const string CMSForumEnableOptIn = "CMSForumEnableOptIn"; - public const string CMSForumEnableOptInConfirmation = "CMSForumEnableOptInConfirmation"; - public const string CMSForumMaxPostNode = "CMSForumMaxPostNode"; - public const string CMSForumOptInApprovalPath = "CMSForumOptInApprovalPath"; - public const string CMSForumOptInInterval = "CMSForumOptInInterval"; - public const string CMSForumUnsubscriptionUrl = "CMSForumUnsubscriptionUrl"; - public const string CMSFriendlyURLExtension = "CMSFriendlyURLExtension"; - public const string CMSGenerateNewsletters = "CMSGenerateNewsletters"; - public const string CMSGenerateThumbnails = "CMSGenerateThumbnails"; - public const string CMSGoogleSitemapURL = "CMSGoogleSitemapURL"; - public const string CMSGoogleTranslateAPIKey = "CMSGoogleTranslateAPIKey"; - public const string CMSGravatarDefaultImage = "CMSGravatarDefaultImage"; - public const string CMSGravatarRating = "CMSGravatarRating"; - public const string CMSGroupAvatarHeight = "CMSGroupAvatarHeight"; - public const string CMSGroupAvatarMaxSideSize = "CMSGroupAvatarMaxSideSize"; - public const string CMSGroupAvatarWidth = "CMSGroupAvatarWidth"; - public const string CMSGroupManagementPath = "CMSGroupManagementPath"; - public const string CMSGroupProfilePath = "CMSGroupProfilePath"; - public const string CMSGroupsSecurityAccessPath = "CMSGroupsSecurityAccessPath"; - public const string CMSGroupTemplatePath = "CMSGroupTemplatePath"; - public const string CMSHideUnavailableUserInterface = "CMSHideUnavailableUserInterface"; - public const string CMSHotfixDataVersion = "CMSHotfixDataVersion"; - public const string CMSHotfixProcedureInProgress = "CMSHotfixProcedureInProgress"; - public const string CMSHotfixVersion = "CMSHotfixVersion"; - public const string CMSImageWatermark = "CMSImageWatermark"; - public const string CMSImageWatermarkPosition = "CMSImageWatermarkPosition"; - public const string CMSIncludeTaxInPrices = "CMSIncludeTaxInPrices"; - public const string CMSIndentOutputHtml = "CMSIndentOutputHtml"; - public const string CMSIntegrationEnabled = "CMSIntegrationEnabled"; - public const string CMSIntegrationLogExternal = "CMSIntegrationLogExternal"; - public const string CMSIntegrationLogInternal = "CMSIntegrationLogInternal"; - public const string CMSIntegrationProcessExternal = "CMSIntegrationProcessExternal"; - public const string CMSIntegrationProcessInternal = "CMSIntegrationProcessInternal"; - public const string CMSInvitationAcceptationPath = "CMSInvitationAcceptationPath"; - public const string CMSInvitationValidity = "CMSInvitationValidity"; - public const string CMSKeepChangedDocumentAccesible = "CMSKeepChangedDocumentAccesible"; - public const string CMSKeepNewCheckedOut = "CMSKeepNewCheckedOut"; - public const string CMSLayoutMappingEnable = "CMSLayoutMappingEnable"; - public const string CMSLinkedInAccessToken = "CMSLinkedInAccessToken"; - public const string CMSLinkedInApiKey = "CMSLinkedInApiKey"; - public const string CMSLinkedInApplicationSecret = "CMSLinkedInApplicationSecret"; - public const string CMSLinkedInRoles = "CMSLinkedInRoles"; - public const string CMSLinkedInSignInPermissionScope = "CMSLinkedInSignInPermissionScope"; - public const string CMSLiveIDRequiredUserDataPage = "CMSLiveIDRequiredUserDataPage"; - public const string CMSLiveIDRoles = "CMSLiveIDRoles"; - public const string CMSLogAnalytics = "CMSLogAnalytics"; - public const string CMSLogCache = "CMSLogCache"; - public const string CMSLogEverythingToFile = "CMSLogEverythingToFile"; - public const string CMSLogFiles = "CMSLogFiles"; - public const string CMSLogHandlers = "CMSLogHandlers"; - public const string CMSLogMacros = "CMSLogMacros"; - public const string CMSLogMetadata = "CMSLogMetadata"; - public const string CMSLogOutput = "CMSLogOutput"; - public const string CMSLogPageNotFoundException = "CMSLogPageNotFoundException"; - public const string CMSLogRequests = "CMSLogRequests"; - public const string CMSLogSecurity = "CMSLogSecurity"; - public const string CMSLogSize = "CMSLogSize"; - public const string CMSLogSQLQueries = "CMSLogSQLQueries"; - public const string CMSLogToDatabase = "CMSLogToDatabase"; - public const string CMSLogToFileSystem = "CMSLogToFileSystem"; - public const string CMSLogToTrace = "CMSLogToTrace"; - public const string CMSLogViewState = "CMSLogViewState"; - public const string CMSLogWebFarm = "CMSLogWebFarm"; - public const string CMSManualTranslationDeleteSuccessfulSubmissions = "CMSManualTranslationDeleteSuccessfulSubmissions"; - public const string CMSManualTranslationExportFolder = "CMSManualTranslationExportFolder"; - public const string CMSManualTranslationImportFolder = "CMSManualTranslationImportFolder"; - public const string CMSMarkShoppingCartAsAbandonedPeriod = "CMSMarkShoppingCartAsAbandonedPeriod"; - public const string CMSMaxCacheFileSize = "CMSMaxCacheFileSize"; - public const string CMSMaximumInvalidLogonAttempts = "CMSMaximumInvalidLogonAttempts"; - public const string CMSMaxTreeNodes = "CMSMaxTreeNodes"; - public const string CMSMaxUITreeNodes = "CMSMaxUITreeNodes"; - public const string CMSMediaFileAllowedExtensions = "CMSMediaFileAllowedExtensions"; - public const string CMSMediaFileHiddenFolder = "CMSMediaFileHiddenFolder"; - public const string CMSMediaFilePreviewSuffix = "CMSMediaFilePreviewSuffix"; - public const string CMSMediaImageWatermark = "CMSMediaImageWatermark"; - public const string CMSMediaLibrariesFolder = "CMSMediaLibrariesFolder"; - public const string CMSMediaLibraryMaxSubFolders = "CMSMediaLibraryMaxSubFolders"; - public const string CMSMediaUsePermanentURLs = "CMSMediaUsePermanentURLs"; - public const string CMSMemberManagementPath = "CMSMemberManagementPath"; - public const string CMSMemberProfilePath = "CMSMemberProfilePath"; - public const string CMSMembershipReminder = "CMSMembershipReminder"; - public const string CMSMetaImageWatermark = "CMSMetaImageWatermark"; - public const string CMSMFDisplayInitToken = "CMSMFDisplayInitToken"; - public const string CMSMFEnabled = "CMSMFEnabled"; - public const string CMSMFRequired = "CMSMFRequired"; - public const string CMSMinWatermarkImageHeight = "CMSMinWatermarkImageHeight"; - public const string CMSMinWatermarkImageWidth = "CMSMinWatermarkImageWidth"; - public const string CMSModuleUsageTrackingEnabled = "CMSModuleUsageTrackingEnabled"; - public const string CMSModuleUsageTrackingIdentity = "CMSModuleUsageTrackingIdentity"; - public const string CMSMonitorBouncedEmails = "CMSMonitorBouncedEmails"; - public const string CMSMoveViewStateToEnd = "CMSMoveViewStateToEnd"; - public const string CMSMSTranslatorTextAPISubscriptionKey = "CMSMSTranslatorTextAPISubscriptionKey"; - public const string CMSMVTEnabled = "CMSMVTEnabled"; - public const string CMSMyAccountURL = "CMSMyAccountURL"; - public const string CMSNewDocumentOrder = "CMSNewDocumentOrder"; - public const string CMSNewsletterUnsubscriptionURL = "CMSNewsletterUnsubscriptionURL"; - public const string CMSNewsletterUseExternalService = "CMSNewsletterUseExternalService"; - public const string CMSNoreplyEmailAddress = "CMSNoreplyEmailAddress"; - public const string CMSObjectVersionHistoryLength = "CMSObjectVersionHistoryLength"; - public const string CMSObjectVersionHistoryMajorVersionsLength = "CMSObjectVersionHistoryMajorVersionsLength"; - public const string CMSObjectVersionHistoryPromoteToMajorTimeInterval = "CMSObjectVersionHistoryPromoteToMajorTimeInterval"; - public const string CMSObjectVersionHistoryUseLastVersionInterval = "CMSObjectVersionHistoryUseLastVersionInterval"; - public const string CMSOnSiteEditButton = "CMSOnSiteEditButton"; - public const string CMSOpenIDRoles = "CMSOpenIDRoles"; - public const string CMSOptInApprovalURL = "CMSOptInApprovalURL"; - public const string CMSOptInInterval = "CMSOptInInterval"; - public const string CMSOutputCacheItems = "CMSOutputCacheItems"; - public const string CMSPageDescriptionPrefix = "CMSPageDescriptionPrefix"; - public const string CMSPageKeyWordsPrefix = "CMSPageKeyWordsPrefix"; - public const string CMSPageNotFoundForNonPublished = "CMSPageNotFoundForNonPublished"; - public const string CMSPageNotFoundUrl = "CMSPageNotFoundUrl"; - public const string CMSPageTitleFormat = "CMSPageTitleFormat"; - public const string CMSPageTitlePrefix = "CMSPageTitlePrefix"; - public const string CMSPartialCacheItems = "CMSPartialCacheItems"; - public const string CMSPasswordExpiration = "CMSPasswordExpiration"; - public const string CMSPasswordExpirationBehaviour = "CMSPasswordExpirationBehaviour"; - public const string CMSPasswordExpirationEmail = "CMSPasswordExpirationEmail"; - public const string CMSPasswordExpirationPeriod = "CMSPasswordExpirationPeriod"; - public const string CMSPasswordExpirationWarningPeriod = "CMSPasswordExpirationWarningPeriod"; - public const string CMSPasswordFormat = "CMSPasswordFormat"; - public const string CMSPaypalCancelReturnUrl = "CMSPaypalCancelReturnUrl"; - public const string CMSPayPalCredentialsAccountType = "CMSPayPalCredentialsAccountType"; - public const string CMSPayPalCredentialsClientId = "CMSPayPalCredentialsClientId"; - public const string CMSPayPalCredentialsClientSecret = "CMSPayPalCredentialsClientSecret"; - public const string CMSPayPalReturnUrl = "CMSPayPalReturnUrl"; - public const string CMSPayPalTransactionType = "CMSPayPalTransactionType"; - public const string CMSPersonalizeUserInterface = "CMSPersonalizeUserInterface"; - public const string CMSPolicyForcePolicyOnLogon = "CMSPolicyForcePolicyOnLogon"; - public const string CMSPolicyMinimalLength = "CMSPolicyMinimalLength"; - public const string CMSPolicyNumberOfNonAlphaNumChars = "CMSPolicyNumberOfNonAlphaNumChars"; - public const string CMSPolicyRegularExpression = "CMSPolicyRegularExpression"; - public const string CMSPolicyViolationMessage = "CMSPolicyViolationMessage"; - public const string CMSPollsAllowGlobal = "CMSPollsAllowGlobal"; - public const string CMSPOP3AuthenticationMethod = "CMSPOP3AuthenticationMethod"; - public const string CMSPOP3Password = "CMSPOP3Password"; - public const string CMSPOP3ServerName = "CMSPOP3ServerName"; - public const string CMSPOP3ServerPort = "CMSPOP3ServerPort"; - public const string CMSPOP3UserName = "CMSPOP3UserName"; - public const string CMSPOP3UseSSL = "CMSPOP3UseSSL"; - public const string CMSPriceRounding = "CMSPriceRounding"; - public const string CMSProcessDomainPrefix = "CMSProcessDomainPrefix"; - public const string CMSReCaptchaPrivateKey = "CMSReCaptchaPrivateKey"; - public const string CMSReCaptchaPublicKey = "CMSReCaptchaPublicKey"; - public const string CMSRedirectAliasesToMainURL = "CMSRedirectAliasesToMainURL"; - public const string CMSRedirectFilesToDisk = "CMSRedirectFilesToDisk"; - public const string CMSRedirectInvalidCasePages = "CMSRedirectInvalidCasePages"; - public const string CMSRedirectToMainExtension = "CMSRedirectToMainExtension"; - public const string CMSRegistrationAdministratorApproval = "CMSRegistrationAdministratorApproval"; - public const string CMSRegistrationApprovalPath = "CMSRegistrationApprovalPath"; - public const string CMSRegistrationEmailConfirmation = "CMSRegistrationEmailConfirmation"; - public const string CMSRememberUniGridState = "CMSRememberUniGridState"; - public const string CMSRequiredLinkedInPage = "CMSRequiredLinkedInPage"; - public const string CMSRequiredOpenIDPage = "CMSRequiredOpenIDPage"; - public const string CMSReservedUserNames = "CMSReservedUserNames"; - public const string CMSResetPasswordInterval = "CMSResetPasswordInterval"; - public const string CMSResetPasswordURL = "CMSResetPasswordURL"; - public const string CMSResizeImagesToDevice = "CMSResizeImagesToDevice"; - public const string CMSResolveMacrosInCSS = "CMSResolveMacrosInCSS"; - public const string CMSResourceCompressionEnabled = "CMSResourceCompressionEnabled"; - public const string CMSRESTAllowedDocTypes = "CMSRESTAllowedDocTypes"; - public const string CMSRESTAllowedObjectTypes = "CMSRESTAllowedObjectTypes"; - public const string CMSRESTAllowSensitiveFields = "CMSRESTAllowSensitiveFields"; - public const string CMSRESTDefaultEncoding = "CMSRESTDefaultEncoding"; - public const string CMSRESTDocumentsReadOnly = "CMSRESTDocumentsReadOnly"; - public const string CMSRESTDocumentsSecurityCheck = "CMSRESTDocumentsSecurityCheck"; - public const string CMSRESTGenerateHash = "CMSRESTGenerateHash"; - public const string CMSRESTObjectsReadOnly = "CMSRESTObjectsReadOnly"; - public const string CMSRestoreObjects = "CMSRestoreObjects"; - public const string CMSRESTServiceEnabled = "CMSRESTServiceEnabled"; - public const string CMSRESTServiceTypeEnabled = "CMSRESTServiceTypeEnabled"; - public const string CMSRevalidateClientCache = "CMSRevalidateClientCache"; - public const string CMSRobotsPath = "CMSRobotsPath"; - public const string CMSSalesForceCredentials = "CMSSalesForceCredentials"; - public const string CMSSalesForceLeadReplicationBatchSize = "CMSSalesForceLeadReplicationBatchSize"; - public const string CMSSalesForceLeadReplicationDefaultCompanyName = "CMSSalesForceLeadReplicationDefaultCompanyName"; - public const string CMSSalesForceLeadReplicationEnabled = "CMSSalesForceLeadReplicationEnabled"; - public const string CMSSalesForceLeadReplicationLeadDescription = "CMSSalesForceLeadReplicationLeadDescription"; - public const string CMSSalesForceLeadReplicationMapping = "CMSSalesForceLeadReplicationMapping"; - public const string CMSSalesForceLeadReplicationMappingDateTime = "CMSSalesForceLeadReplicationMappingDateTime"; - public const string CMSSalesForceLeadReplicationMinScoreValue = "CMSSalesForceLeadReplicationMinScoreValue"; - public const string CMSSalesForceLeadReplicationScoreID = "CMSSalesForceLeadReplicationScoreID"; - public const string CMSSalesForceLeadReplicationUpdateEnabled = "CMSSalesForceLeadReplicationUpdateEnabled"; - public const string CMSSchedulerInterval = "CMSSchedulerInterval"; - public const string CMSSchedulerServiceInterval = "CMSSchedulerServiceInterval"; - public const string CMSSchedulerTasksEnabled = "CMSSchedulerTasksEnabled"; - public const string CMSSchedulerUseExternalService = "CMSSchedulerUseExternalService"; - public const string CMSScreenLockEnabled = "CMSScreenLockEnabled"; - public const string CMSScreenLockInterval = "CMSScreenLockInterval"; - public const string CMSScreenLockWarningInterval = "CMSScreenLockWarningInterval"; - public const string CMSScriptMinificationEnabled = "CMSScriptMinificationEnabled"; - public const string CMSSearchAllowedFileTypes = "CMSSearchAllowedFileTypes"; - public const string CMSSearchIndexingEnabled = "CMSSearchIndexingEnabled"; - public const string CMSSecuredAreasLogonPage = "CMSSecuredAreasLogonPage"; - public const string CMSSendAccountUnlockEmail = "CMSSendAccountUnlockEmail"; - public const string CMSSendBlogEmailsFrom = "CMSSendBlogEmailsFrom"; - public const string CMSSendBoardEmailsFrom = "CMSSendBoardEmailsFrom"; - public const string CMSSendEmailNotificationsFrom = "CMSSendEmailNotificationsFrom"; - public const string CMSSendErrorNotificationTo = "CMSSendErrorNotificationTo"; - public const string CMSSendForumEmailsFrom = "CMSSendForumEmailsFrom"; - public const string CMSSendPasswordEmailsFrom = "CMSSendPasswordEmailsFrom"; - public const string CMSSendPasswordResetConfirmation = "CMSSendPasswordResetConfirmation"; - public const string CMSSendWorkflowEmails = "CMSSendWorkflowEmails"; - public const string CMSSendWorkflowEmailsFrom = "CMSSendWorkflowEmailsFrom"; - public const string CMSServerTimeZone = "CMSServerTimeZone"; - public const string CMSServiceHealthMonitoringInterval = "CMSServiceHealthMonitoringInterval"; - public const string CMSSessionManagerSchedulerInterval = "CMSSessionManagerSchedulerInterval"; - public const string CMSSessionUseDBRepository = "CMSSessionUseDBRepository"; - public const string CMSSharePointCache = "CMSSharePointCache"; - public const string CMSSharePointCacheSizeLimit = "CMSSharePointCacheSizeLimit"; - public const string CMSShoppingCartExpirationPeriod = "CMSShoppingCartExpirationPeriod"; - public const string CMSShoppingCartURL = "CMSShoppingCartURL"; - public const string CMSSitemapPath = "CMSSitemapPath"; - public const string CMSSiteSharedAccounts = "CMSSiteSharedAccounts"; - public const string CMSSiteTimeZone = "CMSSiteTimeZone"; - public const string CMSSMTPServer = "CMSSMTPServer"; - public const string CMSSMTPServerPassword = "CMSSMTPServerPassword"; - public const string CMSSMTPServerTip = "CMSSMTPServerTip"; - public const string CMSSMTPServerUser = "CMSSMTPServerUser"; - public const string CMSSocialMarketingURLShorteningFacebook = "CMSSocialMarketingURLShorteningFacebook"; - public const string CMSSocialMarketingURLShorteningLinkedIn = "CMSSocialMarketingURLShorteningLinkedIn"; - public const string CMSSocialMarketingURLShorteningTwitter = "CMSSocialMarketingURLShorteningTwitter"; - public const string CMSStagingLogChanges = "CMSStagingLogChanges"; - public const string CMSStagingLogDataChanges = "CMSStagingLogDataChanges"; - public const string CMSStagingLogObjectChanges = "CMSStagingLogObjectChanges"; - public const string CMSStagingLogStagingChanges = "CMSStagingLogStagingChanges"; - public const string CMSStagingServiceAuthentication = "CMSStagingServiceAuthentication"; - public const string CMSStagingServiceEnabled = "CMSStagingServiceEnabled"; - public const string CMSStagingServicePassword = "CMSStagingServicePassword"; - public const string CMSStagingServiceUsername = "CMSStagingServiceUsername"; - public const string CMSStagingServiceX509ClientBase64KeyId = "CMSStagingServiceX509ClientBase64KeyId"; - public const string CMSStagingServiceX509ServerBase64KeyId = "CMSStagingServiceX509ServerBase64KeyId"; - public const string CMSStoreAddToShoppingCartConversionName = "CMSStoreAddToShoppingCartConversionName"; - public const string CMSStoreAddToShoppingCartConversionValue = "CMSStoreAddToShoppingCartConversionValue"; - public const string CMSStoreAllowAnonymousCustomers = "CMSStoreAllowAnonymousCustomers"; - public const string CMSStoreAllowGlobalDepartments = "CMSStoreAllowGlobalDepartments"; - public const string CMSStoreAllowGlobalManufacturers = "CMSStoreAllowGlobalManufacturers"; - public const string CMSStoreAllowGlobalPaymentMethods = "CMSStoreAllowGlobalPaymentMethods"; - public const string CMSStoreAllowGlobalProductOptions = "CMSStoreAllowGlobalProductOptions"; - public const string CMSStoreAllowGlobalProducts = "CMSStoreAllowGlobalProducts"; - public const string CMSStoreAllowGlobalSuppliers = "CMSStoreAllowGlobalSuppliers"; - public const string CMSStoreAllowProductsWithoutDocuments = "CMSStoreAllowProductsWithoutDocuments"; - public const string CMSStoreAltFormLayoutsInFS = "CMSStoreAltFormLayoutsInFS"; - public const string CMSStoreApplyTaxesBasedOn = "CMSStoreApplyTaxesBasedOn"; - public const string CMSStoreAutoRegisterCustomer = "CMSStoreAutoRegisterCustomer"; - public const string CMSStoreAutoRegistrationEmailTemplate = "CMSStoreAutoRegistrationEmailTemplate"; - public const string CMSStoreCheckoutProcess = "CMSStoreCheckoutProcess"; - public const string CMSStoreCSSStylesheetsInFS = "CMSStoreCSSStylesheetsInFS"; - public const string CMSStoreDefaultCountryName = "CMSStoreDefaultCountryName"; - public const string CMSStoreDisplayProductsInSectionsTree = "CMSStoreDisplayProductsInSectionsTree"; - public const string CMSStoreEProductsReminder = "CMSStoreEProductsReminder"; - public const string CMSStoreFormLayoutsInFS = "CMSStoreFormLayoutsInFS"; - public const string CMSStoreInvoiceNumberPattern = "CMSStoreInvoiceNumberPattern"; - public const string CMSStoreInvoiceTemplate = "CMSStoreInvoiceTemplate"; - public const string CMSStoreLayoutsInFS = "CMSStoreLayoutsInFS"; - public const string CMSStoreMassUnit = "CMSStoreMassUnit"; - public const string CMSStoreNewProductStatus = "CMSStoreNewProductStatus"; - public const string CMSStoreOrderConversionName = "CMSStoreOrderConversionName"; - public const string CMSStoreOrderConversionValue = "CMSStoreOrderConversionValue"; - public const string CMSStorePageTemplatesInFS = "CMSStorePageTemplatesInFS"; - public const string CMSStoreProductsAreNewFor = "CMSStoreProductsAreNewFor"; - public const string CMSStoreProductsStartingPath = "CMSStoreProductsStartingPath"; - public const string CMSStoreProductsTree = "CMSStoreProductsTree"; - public const string CMSStoreRedirectToShoppingCart = "CMSStoreRedirectToShoppingCart"; - public const string CMSStoreRegistrationConversionName = "CMSStoreRegistrationConversionName"; - public const string CMSStoreRegistrationConversionValue = "CMSStoreRegistrationConversionValue"; - public const string CMSStoreRelatedProductsRelationshipName = "CMSStoreRelatedProductsRelationshipName"; - public const string CMSStoreRequireCompanyInfo = "CMSStoreRequireCompanyInfo"; - public const string CMSStoreSendEmailsFrom = "CMSStoreSendEmailsFrom"; - public const string CMSStoreSendEmailsTo = "CMSStoreSendEmailsTo"; - public const string CMSStoreSendOrderNotification = "CMSStoreSendOrderNotification"; - public const string CMSStoreSendPaymentNotification = "CMSStoreSendPaymentNotification"; - public const string CMSStoreShowOrganizationID = "CMSStoreShowOrganizationID"; - public const string CMSStoreShowTaxRegistrationID = "CMSStoreShowTaxRegistrationID"; - public const string CMSStoreTransformationsInFS = "CMSStoreTransformationsInFS"; - public const string CMSStoreUseCustomerCultureForEmails = "CMSStoreUseCustomerCultureForEmails"; - public const string CMSStoreUseExtraCompanyAddress = "CMSStoreUseExtraCompanyAddress"; - public const string CMSStoreUseGlobalCredit = "CMSStoreUseGlobalCredit"; - public const string CMSStoreUseGlobalCurrencies = "CMSStoreUseGlobalCurrencies"; - public const string CMSStoreUseGlobalExchangeRates = "CMSStoreUseGlobalExchangeRates"; - public const string CMSStoreUseGlobalInternalStatus = "CMSStoreUseGlobalInternalStatus"; - public const string CMSStoreUseGlobalInvoice = "CMSStoreUseGlobalInvoice"; - public const string CMSStoreUseGlobalOrderStatus = "CMSStoreUseGlobalOrderStatus"; - public const string CMSStoreUseGlobalPublicStatus = "CMSStoreUseGlobalPublicStatus"; - public const string CMSStoreUseGlobalTaxClasses = "CMSStoreUseGlobalTaxClasses"; - public const string CMSStoreWebpartContainersInFS = "CMSStoreWebpartContainersInFS"; - public const string CMSStoreWebPartLayoutsInFS = "CMSStoreWebPartLayoutsInFS"; - public const string CMSStoreWeightFormattingString = "CMSStoreWeightFormattingString"; - public const string CMSStrandsAPIID = "CMSStrandsAPIID"; - public const string CMSStrandsAutomaticCatalogUploadEnabled = "CMSStrandsAutomaticCatalogUploadEnabled"; - public const string CMSStrandsAutomaticUploadFrequency = "CMSStrandsAutomaticUploadFrequency"; - public const string CMSStrandsCatalogFeedPassword = "CMSStrandsCatalogFeedPassword"; - public const string CMSStrandsCatalogFeedUsername = "CMSStrandsCatalogFeedUsername"; - public const string CMSStrandsCatalogTransformation = "CMSStrandsCatalogTransformation"; - public const string CMSStrandsCatalogWhereCondition = "CMSStrandsCatalogWhereCondition"; - public const string CMSStrandsDocumentTypes = "CMSStrandsDocumentTypes"; - public const string CMSStrandsPath = "CMSStrandsPath"; - public const string CMSStrandsValidationToken = "CMSStrandsValidationToken"; - public const string CMSStylesheetMinificationEnabled = "CMSStylesheetMinificationEnabled"; - public const string CMSTimeZonesEnable = "CMSTimeZonesEnable"; - public const string CMSTrackAverageTimeOnPage = "CMSTrackAverageTimeOnPage"; - public const string CMSTrackExitPages = "CMSTrackExitPages"; - public const string CMSTrackLandingPages = "CMSTrackLandingPages"; - public const string CMSTrackMobileDevices = "CMSTrackMobileDevices"; - public const string CMSTrackOnSiteKeywords = "CMSTrackOnSiteKeywords"; - public const string CMSTrackReferringSitesDirect = "CMSTrackReferringSitesDirect"; - public const string CMSTrackReferringSitesLocal = "CMSTrackReferringSitesLocal"; - public const string CMSTrackReferringSitesReferring = "CMSTrackReferringSitesReferring"; - public const string CMSTrackSearchCrawlers = "CMSTrackSearchCrawlers"; - public const string CMSTrackSearchEngines = "CMSTrackSearchEngines"; - public const string CMSTrackSearchKeywords = "CMSTrackSearchKeywords"; - public const string CMSTranslateFileTypes = "CMSTranslateFileTypes"; - public const string CMSTranslateWebpartProperties = "CMSTranslateWebpartProperties"; - public const string CMSTranslationsAutoImport = "CMSTranslationsAutoImport"; - public const string CMSTranslationsComPassword = "CMSTranslationsComPassword"; - public const string CMSTranslationsComProjectCode = "CMSTranslationsComProjectCode"; - public const string CMSTranslationsComURL = "CMSTranslationsComURL"; - public const string CMSTranslationsComUserName = "CMSTranslationsComUserName"; - public const string CMSTranslationsEncoding = "CMSTranslationsEncoding"; - public const string CMSTranslationsLastStatusCheck = "CMSTranslationsLastStatusCheck"; - public const string CMSUpdateDocumentAlias = "CMSUpdateDocumentAlias"; - public const string CMSUploadExtensions = "CMSUploadExtensions"; - public const string CMSUseAutomaticVersionNumbering = "CMSUseAutomaticVersionNumbering"; - public const string CMSUseBizFormsSiteFolder = "CMSUseBizFormsSiteFolder"; - public const string CMSUseCheckinCheckout = "CMSUseCheckinCheckout"; - public const string CMSUseDomainForCulture = "CMSUseDomainForCulture"; - public const string CMSUseEventLogListener = "CMSUseEventLogListener"; - public const string CMSUseExternalService = "CMSUseExternalService"; - public const string CMSUseFilesSiteFolder = "CMSUseFilesSiteFolder"; - public const string CMSUseLangPrefixForUrls = "CMSUseLangPrefixForUrls"; - public const string CMSUseMediaLibrariesSiteFolder = "CMSUseMediaLibrariesSiteFolder"; - public const string CMSUseNamePathForUrlPath = "CMSUseNamePathForUrlPath"; - public const string CMSUseNoFollowForUsersLinks = "CMSUseNoFollowForUsersLinks"; - public const string CMSUseObjectCheckinCheckout = "CMSUseObjectCheckinCheckout"; - public const string CMSUseParentGroupIDForNewDocuments = "CMSUseParentGroupIDForNewDocuments"; - public const string CMSUsePasswordPolicy = "CMSUsePasswordPolicy"; - public const string CMSUsePermanentRedirect = "CMSUsePermanentRedirect"; - public const string CMSUsePermanentURLs = "CMSUsePermanentURLs"; - public const string CMSUserAccountUnlockPath = "CMSUserAccountUnlockPath"; - public const string CMSUserUniqueEmail = "CMSUserUniqueEmail"; - public const string CMSUseSessionManagement = "CMSUseSessionManagement"; - public const string CMSUseSitePrefixForUserName = "CMSUseSitePrefixForUserName"; - public const string CMSUseSSL = "CMSUseSSL"; - public const string CMSUseSSLForAdministrationInterface = "CMSUseSSLForAdministrationInterface"; - public const string CMSUseURLsWithTrailingSlash = "CMSUseURLsWithTrailingSlash"; - public const string CMSVersionHistoryLength = "CMSVersionHistoryLength"; - public const string CMSVersioningExtensionsMediaFile = "CMSVersioningExtensionsMediaFile"; - public const string CMSVisitorStatusIdle = "CMSVisitorStatusIdle"; - public const string CMSWebAnalyticsUseJavascriptLogging = "CMSWebAnalyticsUseJavascriptLogging"; - public const string CMSWebDAVExtensions = "CMSWebDAVExtensions"; - public const string CMSWebFarmMaxFileSize = "CMSWebFarmMaxFileSize"; - public const string CMSWebFarmMode = "CMSWebFarmMode"; - public const string CMSWebFarmSynchronizeAttachments = "CMSWebFarmSynchronizeAttachments"; - public const string CMSWebFarmSynchronizeAvatars = "CMSWebFarmSynchronizeAvatars"; - public const string CMSWebFarmSynchronizeBizFormFiles = "CMSWebFarmSynchronizeBizFormFiles"; - public const string CMSWebFarmSynchronizeCache = "CMSWebFarmSynchronizeCache"; - public const string CMSWebFarmSynchronizeDeleteFiles = "CMSWebFarmSynchronizeDeleteFiles"; - public const string CMSWebFarmSynchronizeFiles = "CMSWebFarmSynchronizeFiles"; - public const string CMSWebFarmSynchronizeForumAttachments = "CMSWebFarmSynchronizeForumAttachments"; - public const string CMSWebFarmSynchronizeMediaFiles = "CMSWebFarmSynchronizeMediaFiles"; - public const string CMSWebFarmSynchronizeMetaFiles = "CMSWebFarmSynchronizeMetaFiles"; - public const string CMSWebFarmSynchronizePhysicalFiles = "CMSWebFarmSynchronizePhysicalFiles"; - public const string CMSWebFarmSynchronizeSmartSearch = "CMSWebFarmSynchronizeSmartSearch"; - public const string CMSWebFarmSyncInterval = "CMSWebFarmSyncInterval"; - public const string CMSWIFAllowedAudienceUris = "CMSWIFAllowedAudienceUris"; - public const string CMSWIFCertificateValidator = "CMSWIFCertificateValidator"; - public const string CMSWIFEnabled = "CMSWIFEnabled"; - public const string CMSWIFIdentityProviderURL = "CMSWIFIdentityProviderURL"; - public const string CMSWIFRealm = "CMSWIFRealm"; - public const string CMSWIFTrustedCertificateThumbprint = "CMSWIFTrustedCertificateThumbprint"; - public const string CMSWishlistURL = "CMSWishlistURL"; -} diff --git a/Migration.Toolkit.K11/SettingsKeys.tt b/Migration.Toolkit.K11/SettingsKeys.tt deleted file mode 100644 index 79807a48..00000000 --- a/Migration.Toolkit.K11/SettingsKeys.tt +++ /dev/null @@ -1,28 +0,0 @@ -<#@ template language="C#" #> -<#@ import namespace="System.Data.SqlClient" #> -// ReSharper disable InconsistentNaming -// ReSharper disable IdentifierTypo -namespace Migration.Toolkit.KX12; - -public static class SettingsKeys { -<# - var connectionString = Environment.GetEnvironmentVariable("KENTICO_MT_DEV_KX12_CONNECTION_STRING"); - using var connection = new SqlConnection(connectionString); - using var cmd = connection.CreateCommand(); - cmd.CommandText = """ - SELECT KeyName - FROM CMS_SettingsKey - WHERE KeyName LIKE 'CMS%' - GROUP BY KeyName - ORDER BY KeyName - """; - connection.Open(); - using var reader = cmd.ExecuteReader(); - while (reader.Read()) - { - WriteLine($""" - public const string {reader[0]} = "{reader[0]}"; - """); - } -#> -} \ No newline at end of file diff --git a/Migration.Toolkit.KX12/Auxiliary/Kx13FormControls.cs b/Migration.Toolkit.KX12/Auxiliary/Kx13FormControls.cs deleted file mode 100644 index 21bd0852..00000000 --- a/Migration.Toolkit.KX12/Auxiliary/Kx13FormControls.cs +++ /dev/null @@ -1,234 +0,0 @@ -// ReSharper disable InconsistentNaming - -namespace Migration.Toolkit.KX12.Auxiliary; - -public class Kx12FormControls -{ - public class UserControlForText - { - public const string AbTestConversionTypeSelector = "ABTestConversionTypeSelector"; - public const string ActivityTypeSelector = "ActivityTypeSelector"; - public const string AllowedExtensionsSelector = "AllowedExtensionsSelector"; - public const string Selectalternativeform = "selectalternativeform"; - public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; - public const string AssemblyClassSelector = "AssemblyClassSelector"; - public const string Fieldselector = "fieldselector"; - public const string BizFormSelector = "BizFormSelector"; - public const string BundleInventoryTypeSelector = "BundleInventoryTypeSelector"; - public const string CampaignSelector = "CampaignSelector"; - public const string CategorySelector = "CategorySelector"; - public const string ClassFieldSelector = "ClassFieldSelector"; - public const string ClassFields = "Class_fields"; - public const string CodeName = "CodeName"; - public const string CodeNameWithPrefix = "CodeNameWithPrefix"; - public const string Selectcolor = "selectcolor"; - public const string Columns = "Columns"; - public const string ConnectionStringSelector = "Connection_string_selector"; - public const string ContactClassFields = "Contact_class_fields"; - public const string CountrySelector = "countrySelector"; - public const string CssStylesEditor = "CSS_Styles_Editor"; - public const string Selectculture = "selectculture"; - public const string CultureSelectorForSettings = "CultureSelectorForSettings"; - public const string CurrencySelector = "currencySelector"; - public const string CustomTableItemSelector = "CustomTableItemSelector"; - public const string CustomTableSelector = "CustomTableSelector"; - public const string Selectcolumns = "selectcolumns"; - public const string DepartmentSelector = "DepartmentSelector"; - public const string DropDownListControl = "DropDownListControl"; - public const string DueDateSelector = "Due_date_selector"; - public const string Emailinput = "emailinput"; - public const string EmailTemplateSelector = "Email_template_selector"; - public const string EmailTemplateTypeSelector = "Email_template_type_selector"; - public const string EncodingTextBox = "EncodingTextBox"; - public const string EncryptedPassword = "EncryptedPassword"; - public const string EnumSelector = "EnumSelector"; - public const string EventLogTypeSelector = "EventLogTypeSelector"; - public const string FacebookAutoPost = "Facebook_auto_post"; - public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; - public const string FileSystemSelector = "FileSystemSelector"; - public const string FontIconSelector = "FontIconSelector"; - public const string FormFieldSelector = "FormFieldSelector"; - public const string FormPassword = "FormPassword"; - public const string FullMediaLibrarySelector = "FullMediaLibrarySelector"; - public const string GetGoogleTranslatorApiKey = "Get_Google_Translator_API_key"; - public const string GetMsTranslatorTextApiKey = "GetMSTranslatorTextAPIKey"; - public const string GoToExternalUrl = "Go_to_external_URL"; - public const string GoogleAnalyticsParameterSelector = "Google_Analytics_parameter_selector"; - public const string Html5Input = "HTML5Input"; - public const string IconSelector = "IconSelector"; - public const string InternalStatusSelector = "InternalStatusSelector"; - public const string Internationalphone = "internationalphone"; - public const string LabelControl = "LabelControl"; - public const string LargeTextArea = "LargeTextArea"; - public const string LicenseSelector = "LicenseSelector"; - public const string LinkedInAutoPost = "LinkedInAutoPost"; - public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; - public const string ListBoxControl = "ListBoxControl"; - public const string LocalizableTextArea = "LocalizableTextArea"; - public const string LocalizableTextBox = "LocalizableTextBox"; - public const string MacroAnyAllBoolSelector = "Macro_any-all_bool_selector"; - public const string MacroAnyAllSelector = "MacroAnyAllSelector"; - public const string MacroDateOperator = "Macro_date_operator"; - public const string MacroEditor = "MacroEditor"; - public const string MacroEqualityOperator = "MacroEqualityOperator"; - public const string MacroNegationOperator = "MacroNegationOperator"; - public const string MacroNumericOperator = "Macro_numeric_operator"; - public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; - public const string MacroTextOperator = "Macro_text_operator"; - public const string MacroType = "MacroType"; - public const string ManufacturerSelector = "ManufacturerSelector"; - public const string MediaLibrarySelector = "MediaLibrarySelector"; - public const string MediaSelectionControl = "MediaSelectionControl"; - public const string MembershipSelector = "MembershipSelector"; - public const string MetafileUploaderControl = "MetafileUploaderControl"; - public const string ModuleSelector = "ModuleSelector"; - public const string MultipleCategoriesSelector = "MultipleCategoriesSelector"; - public const string MultipleChoiceControl = "MultipleChoiceControl"; - public const string RoleCheckboxSelector = "RoleCheckboxSelector"; - public const string SimpleCheckboxRoleSelector = "SimpleCheckboxRoleSelector"; - public const string SimpleCheckboxSiteSelector = "SimpleCheckboxSiteSelector"; - public const string MultipleUserSelector = "MultipleUserSelector"; - public const string NewsletterSelector = "NewsletterSelector"; - public const string NewsletterSelectorSimple = "NewsletterSelectorSimple"; - public const string NumericUpDown = "NumericUpDown"; - public const string ObjectColumnSelector = "ObjectColumnSelector"; - public const string ObjectSelector = "ObjectSelector"; - public const string ObjectTransformation = "ObjectTransformation"; - public const string ObjectTypeBinSelector = "ObjectTypeBinSelector"; - public const string ObjectTypeSelector = "ObjectTypeSelector"; - public const string OptionCategoryProductOptionSelector = "OptionCategoryProductOptionSelector"; - public const string OptionCategorySelectionTypeSelector = "OptionCategorySelectionTypeSelector"; - public const string OrderBy = "OrderBy"; - public const string OrderStatusSelector = "OrderStatusSelector"; - public const string DocumentCultureFilter = "DocumentCultureFilter"; - public const string PageLayoutCode = "Page_layout_code"; - public const string Selectdocument = "selectdocument"; - public const string PageTemplateLevels = "PageTemplateLevels"; - public const string Selectpagetemplate = "selectpagetemplate"; - public const string DocumentTypeIconSelector = "DocumentTypeIconSelector"; - public const string Selectclassnames = "selectclassnames"; - public const string Password = "Password"; - public const string PasswordStrength = "PasswordStrength"; - public const string PasswordConfirmator = "PasswordConfirmator"; - public const string Selectpath = "selectpath"; - public const string PaymentSelector = "paymentSelector"; - public const string ProductImageSelector = "ProductImageSelector"; - public const string ProductRelationshipNameSelector = "ProductRelationshipNameSelector"; - public const string ProductSectionsSelector = "ProductSectionsSelector"; - public const string ProductTypeSelector = "ProductTypeSelector"; - public const string PublicStatusSelector = "PublicStatusSelector"; - public const string Selectquery = "selectquery"; - public const string RadioButtonsControl = "RadioButtonsControl"; - public const string AgeRangeSelector = "AgeRangeSelector"; - public const string RelatedDocuments = "RelatedDocuments"; - public const string Relationshipconfiguration = "relationshipconfiguration"; - public const string SelectRelationshipName = "SelectRelationshipName"; - public const string ReportSelectorDropDown = "ReportSelectorDropDown"; - public const string RoleSelector = "RoleSelector"; - public const string SearchClassNameSelector = "SearchClassNameSelector"; - public const string SearchIndexSelector = "SearchIndexSelector"; - public const string SearchIndexTypeSelector = "SearchIndexTypeSelector"; - public const string SelectCmsVersion = "SelectCMSVersion"; - public const string SettingsKeyControlSelector = "SettingsKeyControlSelector"; - public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; - public const string SharePointListSelector = "SharePointListSelector"; - public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; - public const string ShippingSelector = "shippingSelector"; - public const string ShippingServiceSelector = "ShippingServiceSelector"; - public const string Selectsinglepath = "selectsinglepath"; - public const string SinglePathSelectorWithPermissions = "SinglePathSelectorWithPermissions"; - public const string SiteContentCulture = "SiteContentCulture"; - public const string SiteCultureSelector = "SiteCultureSelector"; - public const string SiteCultureSelectorAll = "SiteCultureSelectorAll"; - public const string Selectsite = "selectsite"; - public const string SiteSelectorWithAllFieldForGlobalAdmin = "SiteSelectorWithAllFieldForGlobalAdmin"; - public const string SkuSelector = "SKUSelector"; - public const string StopWordsSelector = "StopWordsSelector"; - public const string SupplierSelector = "SupplierSelector"; - public const string SupportedCultureSelector = "SupportedCultureSelector"; - public const string TableConversionSettings = "TableConversionSettings"; - public const string TagGroupSelector = "TagGroupSelector"; - public const string TagSelector = "TagSelector"; - public const string TaxAddressTypeSelector = "TaxAddressTypeSelector"; - public const string TextAreaControl = "TextAreaControl"; - public const string TextBoxControl = "TextBoxControl"; - public const string TextFilter = "TextFilter"; - public const string TextboxDefaultValueFromSetting = "Textbox_default_value_from_setting"; - public const string TextboxDoubleValidator = "Textbox_double_validator"; - public const string TimeZoneSelector = "TimeZoneSelector"; - public const string TimeZoneTypeSelector = "TimeZoneTypeSelector"; - public const string ToggleButton = "ToggleButton"; - public const string Selecttransformation = "selecttransformation"; - public const string TranslationServiceSelector = "Translation_service_selector"; - public const string TwitterAutoPost = "Twitter_auto_post"; - public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; - public const string Usphone = "usphone"; - public const string Uszipcode = "uszipcode"; - public const string UiCultureSelector = "UICultureSelector"; - public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; - public const string UniSelector = "Uni_selector"; - public const string UrlChecker = "UrlChecker"; - public const string UrlSelector = "URLSelector"; - public const string SmurlShortenerSelector = "SMURLShortenerSelector"; - public const string UserName = "UserName"; - public const string UserNameSelector = "UserNameSelector"; - public const string UserSelector = "UserSelector"; - public const string ValiditySelector = "ValiditySelector"; - public const string ViewSecureText = "ViewSecureText"; - public const string WhereCondition = "WhereCondition"; - public const string WorkflowScopeDefinition = "WorkflowScopeDefinition"; - } - - public class UserControlForLongText - { - public const string AbTestConversionSelector = "ABTestConversionSelector"; - public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; - public const string BbEditorControl = "BBEditorControl"; - public const string CacheDependencies = "CacheDependencies"; - public const string ClassFields = "Class_fields"; - public const string Columns = "Columns"; - public const string ConditionBuilder = "ConditionBuilder"; - public const string ContactClassFields = "Contact_class_fields"; - public const string CssStylesEditor = "CSS_Styles_Editor"; - public const string Selectcolumns = "selectcolumns"; - public const string DropDownListControl = "DropDownListControl"; - public const string FacebookAutoPost = "Facebook_auto_post"; - public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; - public const string FileSystemSelector = "FileSystemSelector"; - public const string Html5Input = "HTML5Input"; - public const string AutoResizeConfiguration = "AutoResizeConfiguration"; - public const string LabelControl = "LabelControl"; - public const string LargeTextArea = "LargeTextArea"; - public const string LinkedInAutoPost = "LinkedInAutoPost"; - public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; - public const string LocalizableTextArea = "LocalizableTextArea"; - public const string LocalizableTextBox = "LocalizableTextBox"; - public const string MacroEditor = "MacroEditor"; - public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; - public const string MultipleObjectBindingControl = "MultipleObjectBindingControl"; - public const string ObjectTypeSelector = "ObjectTypeSelector"; - public const string OptionsSelector = "OptionsSelector"; - public const string OrderBy = "OrderBy"; - public const string PageLayoutCode = "Page_layout_code"; - public const string ProductSectionsSelector = "ProductSectionsSelector"; - public const string RelatedDocuments = "RelatedDocuments"; - public const string ReportGraphSelector = "ReportGraphSelector"; - public const string ReportTableSelector = "ReportTableSelector"; - public const string ReportValueSelector = "ReportValueSelector"; - public const string HtmlAreaControl = "HtmlAreaControl"; - public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; - public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; - public const string TagSelector = "TagSelector"; - public const string TextAreaControl = "TextAreaControl"; - public const string TextBoxControl = "TextBoxControl"; - public const string TextFilter = "TextFilter"; - public const string TranslationServiceSelector = "Translation_service_selector"; - public const string TwitterAutoPost = "Twitter_auto_post"; - public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; - public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; - public const string UniSelector = "Uni_selector"; - public const string SmurlShortenerSelector = "SMURLShortenerSelector"; - public const string ViewSecureText = "ViewSecureText"; - public const string WhereCondition = "WhereCondition"; - } -} diff --git a/Migration.Toolkit.KX12/ContextCustomizations.cs b/Migration.Toolkit.KX12/ContextCustomizations.cs deleted file mode 100644 index 7b08134e..00000000 --- a/Migration.Toolkit.KX12/ContextCustomizations.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Context; - -public partial class KX12Context -{ - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - optionsBuilder - .EnableDetailedErrors() - .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); - base.OnConfiguring(optionsBuilder); - } -} diff --git a/Migration.Toolkit.KX12/DependencyInjectionExtensions.cs b/Migration.Toolkit.KX12/DependencyInjectionExtensions.cs deleted file mode 100644 index 7e410fd6..00000000 --- a/Migration.Toolkit.KX12/DependencyInjectionExtensions.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; - -using Migration.Toolkit.Common; -using Migration.Toolkit.KX12.Context; - -namespace Migration.Toolkit.KX12; - -public static class DependencyInjectionExtensions -{ - public static IServiceCollection UseKx12DbContext(this IServiceCollection services, ToolkitConfiguration toolkitConfiguration) - { - services.AddDbContextFactory(options => options.UseSqlServer(toolkitConfiguration.KxConnectionString)); - return services; - } -} diff --git a/Migration.Toolkit.KX12/Migration.Toolkit.KX12.csproj b/Migration.Toolkit.KX12/Migration.Toolkit.KX12.csproj deleted file mode 100644 index 830b2a78..00000000 --- a/Migration.Toolkit.KX12/Migration.Toolkit.KX12.csproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - TextTemplatingFileGenerator - SettingsKeys.cs - - - - - - True - True - SettingsKeys.tt - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaign.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaign.cs deleted file mode 100644 index 0106a03b..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaign.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_Campaign")] -[Index("CampaignScheduledTaskId", Name = "IX_Analytics_Campaign_CampaignScheduledTaskID")] -[Index("CampaignSiteId", Name = "IX_Analytics_Campaign_CampaignSiteID")] -public class AnalyticsCampaign -{ - [Key] - [Column("CampaignID")] - public int CampaignId { get; set; } - - [StringLength(200)] - public string CampaignName { get; set; } = null!; - - [StringLength(100)] - public string CampaignDisplayName { get; set; } = null!; - - public string? CampaignDescription { get; set; } - - [Column("CampaignSiteID")] - public int CampaignSiteId { get; set; } - - public DateTime? CampaignOpenFrom { get; set; } - - public DateTime? CampaignOpenTo { get; set; } - - [Column("CampaignGUID")] - public Guid CampaignGuid { get; set; } - - public DateTime CampaignLastModified { get; set; } - - [Column("CampaignUTMCode")] - [StringLength(200)] - public string? CampaignUtmcode { get; set; } - - public DateTime? CampaignCalculatedTo { get; set; } - - [Column("CampaignScheduledTaskID")] - public int? CampaignScheduledTaskId { get; set; } - - public int? CampaignVisitors { get; set; } - - [InverseProperty("CampaignAssetCampaign")] - public virtual ICollection AnalyticsCampaignAssets { get; set; } = new List(); - - [InverseProperty("CampaignConversionCampaign")] - public virtual ICollection AnalyticsCampaignConversions { get; set; } = new List(); - - [InverseProperty("CampaignObjectiveCampaign")] - public virtual AnalyticsCampaignObjective? AnalyticsCampaignObjective { get; set; } - - [ForeignKey("CampaignScheduledTaskId")] - [InverseProperty("AnalyticsCampaigns")] - public virtual CmsScheduledTask? CampaignScheduledTask { get; set; } - - [ForeignKey("CampaignSiteId")] - [InverseProperty("AnalyticsCampaigns")] - public virtual CmsSite CampaignSite { get; set; } = null!; - - [InverseProperty("FacebookPostCampaign")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); - - [InverseProperty("LinkedInPostCampaign")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); - - [InverseProperty("TwitterPostCampaign")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignAsset.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignAsset.cs deleted file mode 100644 index 23c7a47d..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignAsset.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_CampaignAsset")] -[Index("CampaignAssetCampaignId", Name = "IX_Analytics_CampaignAsset_CampaignAssetCampaignID")] -public class AnalyticsCampaignAsset -{ - [Key] - [Column("CampaignAssetID")] - public int CampaignAssetId { get; set; } - - public Guid CampaignAssetGuid { get; set; } - - public DateTime CampaignAssetLastModified { get; set; } - - public Guid CampaignAssetAssetGuid { get; set; } - - [Column("CampaignAssetCampaignID")] - public int CampaignAssetCampaignId { get; set; } - - [StringLength(200)] - public string CampaignAssetType { get; set; } = null!; - - [InverseProperty("CampaignAssetUrlCampaignAsset")] - public virtual ICollection AnalyticsCampaignAssetUrls { get; set; } = new List(); - - [ForeignKey("CampaignAssetCampaignId")] - [InverseProperty("AnalyticsCampaignAssets")] - public virtual AnalyticsCampaign CampaignAssetCampaign { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignAssetUrl.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignAssetUrl.cs deleted file mode 100644 index 0df35d2b..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignAssetUrl.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_CampaignAssetUrl")] -[Index("CampaignAssetUrlCampaignAssetId", Name = "IX_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID")] -public class AnalyticsCampaignAssetUrl -{ - [Key] - [Column("CampaignAssetUrlID")] - public int CampaignAssetUrlId { get; set; } - - public Guid CampaignAssetUrlGuid { get; set; } - - public string CampaignAssetUrlTarget { get; set; } = null!; - - [StringLength(200)] - public string CampaignAssetUrlPageTitle { get; set; } = null!; - - [Column("CampaignAssetUrlCampaignAssetID")] - public int CampaignAssetUrlCampaignAssetId { get; set; } - - [ForeignKey("CampaignAssetUrlCampaignAssetId")] - [InverseProperty("AnalyticsCampaignAssetUrls")] - public virtual AnalyticsCampaignAsset CampaignAssetUrlCampaignAsset { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversion.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversion.cs deleted file mode 100644 index 7442bf5d..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversion.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_CampaignConversion")] -[Index("CampaignConversionCampaignId", Name = "IX_Analytics_CampaignConversion_CampaignConversionCampaignID")] -public class AnalyticsCampaignConversion -{ - [Key] - [Column("CampaignConversionID")] - public int CampaignConversionId { get; set; } - - public Guid CampaignConversionGuid { get; set; } - - public DateTime CampaignConversionLastModified { get; set; } - - [StringLength(100)] - public string CampaignConversionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string CampaignConversionName { get; set; } = null!; - - [Column("CampaignConversionCampaignID")] - public int CampaignConversionCampaignId { get; set; } - - public int CampaignConversionOrder { get; set; } - - [StringLength(250)] - public string CampaignConversionActivityType { get; set; } = null!; - - public int CampaignConversionHits { get; set; } - - [Column("CampaignConversionItemID")] - public int? CampaignConversionItemId { get; set; } - - public double CampaignConversionValue { get; set; } - - public bool CampaignConversionIsFunnelStep { get; set; } - - [Column("CampaignConversionURL")] - public string? CampaignConversionUrl { get; set; } - - [InverseProperty("CampaignConversionHitsConversion")] - public virtual ICollection AnalyticsCampaignConversionHits { get; set; } = new List(); - - [InverseProperty("CampaignObjectiveCampaignConversion")] - public virtual ICollection AnalyticsCampaignObjectives { get; set; } = new List(); - - [ForeignKey("CampaignConversionCampaignId")] - [InverseProperty("AnalyticsCampaignConversions")] - public virtual AnalyticsCampaign CampaignConversionCampaign { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversionHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversionHit.cs deleted file mode 100644 index 2caee981..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversionHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_CampaignConversionHits")] -[Index("CampaignConversionHitsConversionId", Name = "IX_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID")] -public class AnalyticsCampaignConversionHit -{ - [Key] - [Column("CampaignConversionHitsID")] - public int CampaignConversionHitsId { get; set; } - - [Column("CampaignConversionHitsConversionID")] - public int CampaignConversionHitsConversionId { get; set; } - - public int CampaignConversionHitsCount { get; set; } - - [StringLength(200)] - public string CampaignConversionHitsSourceName { get; set; } = null!; - - [StringLength(200)] - public string? CampaignConversionHitsContentName { get; set; } - - [ForeignKey("CampaignConversionHitsConversionId")] - [InverseProperty("AnalyticsCampaignConversionHits")] - public virtual AnalyticsCampaignConversion CampaignConversionHitsConversion { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignObjective.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignObjective.cs deleted file mode 100644 index 1144bba1..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignObjective.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_CampaignObjective")] -[Index("CampaignObjectiveCampaignId", Name = "CK_Analytics_CampaignObjective_CampaignObjectiveCampaignID", IsUnique = true)] -[Index("CampaignObjectiveCampaignConversionId", Name = "IX_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID")] -public class AnalyticsCampaignObjective -{ - [Key] - [Column("CampaignObjectiveID")] - public int CampaignObjectiveId { get; set; } - - public Guid CampaignObjectiveGuid { get; set; } - - public DateTime CampaignObjectiveLastModified { get; set; } - - [Column("CampaignObjectiveCampaignID")] - public int CampaignObjectiveCampaignId { get; set; } - - public int? CampaignObjectiveValue { get; set; } - - [Column("CampaignObjectiveCampaignConversionID")] - public int CampaignObjectiveCampaignConversionId { get; set; } - - [ForeignKey("CampaignObjectiveCampaignId")] - [InverseProperty("AnalyticsCampaignObjective")] - public virtual AnalyticsCampaign CampaignObjectiveCampaign { get; set; } = null!; - - [ForeignKey("CampaignObjectiveCampaignConversionId")] - [InverseProperty("AnalyticsCampaignObjectives")] - public virtual AnalyticsCampaignConversion CampaignObjectiveCampaignConversion { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsConversion.cs b/Migration.Toolkit.KX12/Models/AnalyticsConversion.cs deleted file mode 100644 index 360bcee8..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsConversion.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_Conversion")] -[Index("ConversionSiteId", Name = "IX_Analytics_Conversion_ConversionSiteID")] -public class AnalyticsConversion -{ - [Key] - [Column("ConversionID")] - public int ConversionId { get; set; } - - [StringLength(200)] - public string ConversionName { get; set; } = null!; - - [StringLength(200)] - public string ConversionDisplayName { get; set; } = null!; - - public string? ConversionDescription { get; set; } - - [Column("ConversionGUID")] - public Guid ConversionGuid { get; set; } - - public DateTime ConversionLastModified { get; set; } - - [Column("ConversionSiteID")] - public int ConversionSiteId { get; set; } - - [ForeignKey("ConversionSiteId")] - [InverseProperty("AnalyticsConversions")] - public virtual CmsSite ConversionSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsDayHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsDayHit.cs deleted file mode 100644 index 8c43e292..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsDayHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_DayHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_DayHits_HitsStatisticsID")] -public class AnalyticsDayHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsDayHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsExitPage.cs b/Migration.Toolkit.KX12/Models/AnalyticsExitPage.cs deleted file mode 100644 index e67194d4..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsExitPage.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_ExitPages")] -[Index("ExitPageLastModified", Name = "IX_Analytics_ExitPages_ExitPageLastModified")] -public class AnalyticsExitPage -{ - [Key] - [StringLength(200)] - public string SessionIdentificator { get; set; } = null!; - - [Column("ExitPageNodeID")] - public int ExitPageNodeId { get; set; } - - public DateTime ExitPageLastModified { get; set; } - - [Column("ExitPageSiteID")] - public int ExitPageSiteId { get; set; } - - [StringLength(10)] - public string? ExitPageCulture { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsHourHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsHourHit.cs deleted file mode 100644 index 977f2efb..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsHourHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_HourHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_HourHits_HitsStatisticsID")] -public class AnalyticsHourHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsHourHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsMonthHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsMonthHit.cs deleted file mode 100644 index 40e9b0ce..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsMonthHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_MonthHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_MonthHits_HitsStatisticsID")] -public class AnalyticsMonthHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsMonthHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsStatistic.cs b/Migration.Toolkit.KX12/Models/AnalyticsStatistic.cs deleted file mode 100644 index 86f47f59..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsStatistic.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_Statistics")] -[Index("StatisticsSiteId", Name = "IX_Analytics_Statistics_StatisticsSiteID")] -public class AnalyticsStatistic -{ - [Key] - [Column("StatisticsID")] - public int StatisticsId { get; set; } - - [Column("StatisticsSiteID")] - public int? StatisticsSiteId { get; set; } - - [StringLength(400)] - public string StatisticsCode { get; set; } = null!; - - [StringLength(450)] - public string? StatisticsObjectName { get; set; } - - [Column("StatisticsObjectID")] - public int? StatisticsObjectId { get; set; } - - [StringLength(10)] - public string? StatisticsObjectCulture { get; set; } - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsDayHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsHourHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsMonthHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsWeekHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsYearHits { get; set; } = new List(); - - [ForeignKey("StatisticsSiteId")] - [InverseProperty("AnalyticsStatistics")] - public virtual CmsSite? StatisticsSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsWeekHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsWeekHit.cs deleted file mode 100644 index 42ec7702..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsWeekHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_WeekHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_WeekHits_HitsStatisticsID")] -public class AnalyticsWeekHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsWeekHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsYearHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsYearHit.cs deleted file mode 100644 index 583eabdf..00000000 --- a/Migration.Toolkit.KX12/Models/AnalyticsYearHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_YearHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_WeekYearHits_HitsStatisticsID")] -public class AnalyticsYearHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsYearHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/BadWordsWord.cs b/Migration.Toolkit.KX12/Models/BadWordsWord.cs deleted file mode 100644 index 02bcd559..00000000 --- a/Migration.Toolkit.KX12/Models/BadWordsWord.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("BadWords_Word")] -[Index("WordIsGlobal", Name = "IX_BadWords_Word_WordIsGlobal")] -public class BadWordsWord -{ - [Key] - [Column("WordID")] - public int WordId { get; set; } - - [Column("WordGUID")] - public Guid WordGuid { get; set; } - - public DateTime WordLastModified { get; set; } - - [StringLength(200)] - public string WordExpression { get; set; } = null!; - - [StringLength(200)] - public string? WordReplacement { get; set; } - - public int? WordAction { get; set; } - - public bool WordIsGlobal { get; set; } - - public bool WordIsRegularExpression { get; set; } - - public bool? WordMatchWholeWord { get; set; } - - [ForeignKey("WordId")] - [InverseProperty("Words")] - public virtual ICollection Cultures { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/BlogComment.cs b/Migration.Toolkit.KX12/Models/BlogComment.cs deleted file mode 100644 index d71681b3..00000000 --- a/Migration.Toolkit.KX12/Models/BlogComment.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Blog_Comment")] -[Index("CommentApprovedByUserId", Name = "IX_Blog_Comment_CommentApprovedByUserID")] -[Index("CommentPostDocumentId", Name = "IX_Blog_Comment_CommentPostDocumentID")] -[Index("CommentUserId", Name = "IX_Blog_Comment_CommentUserID")] -public class BlogComment -{ - [Key] - [Column("CommentID")] - public int CommentId { get; set; } - - [StringLength(200)] - public string CommentUserName { get; set; } = null!; - - [Column("CommentUserID")] - public int? CommentUserId { get; set; } - - [StringLength(450)] - public string? CommentUrl { get; set; } - - public string CommentText { get; set; } = null!; - - [Column("CommentApprovedByUserID")] - public int? CommentApprovedByUserId { get; set; } - - [Column("CommentPostDocumentID")] - public int CommentPostDocumentId { get; set; } - - public DateTime CommentDate { get; set; } - - public bool? CommentIsSpam { get; set; } - - public bool? CommentApproved { get; set; } - - [StringLength(254)] - public string? CommentEmail { get; set; } - - public string? CommentInfo { get; set; } - - [Column("CommentGUID")] - public Guid CommentGuid { get; set; } - - [ForeignKey("CommentApprovedByUserId")] - [InverseProperty("BlogCommentCommentApprovedByUsers")] - public virtual CmsUser? CommentApprovedByUser { get; set; } - - [ForeignKey("CommentPostDocumentId")] - [InverseProperty("BlogComments")] - public virtual CmsDocument CommentPostDocument { get; set; } = null!; - - [ForeignKey("CommentUserId")] - [InverseProperty("BlogCommentCommentUsers")] - public virtual CmsUser? CommentUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/BlogPostSubscription.cs b/Migration.Toolkit.KX12/Models/BlogPostSubscription.cs deleted file mode 100644 index b3a54967..00000000 --- a/Migration.Toolkit.KX12/Models/BlogPostSubscription.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Blog_PostSubscription")] -[Index("SubscriptionPostDocumentId", Name = "IX_Blog_PostSubscription_SubscriptionPostDocumentID")] -[Index("SubscriptionUserId", Name = "IX_Blog_PostSubscription_SubscriptionUserID")] -public class BlogPostSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionPostDocumentID")] - public int SubscriptionPostDocumentId { get; set; } - - [Column("SubscriptionUserID")] - public int? SubscriptionUserId { get; set; } - - [StringLength(254)] - public string? SubscriptionEmail { get; set; } - - public DateTime SubscriptionLastModified { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [ForeignKey("SubscriptionPostDocumentId")] - [InverseProperty("BlogPostSubscriptions")] - public virtual CmsDocument SubscriptionPostDocument { get; set; } = null!; - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("BlogPostSubscriptions")] - public virtual CmsUser? SubscriptionUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/BoardBoard.cs b/Migration.Toolkit.KX12/Models/BoardBoard.cs deleted file mode 100644 index 7237dba6..00000000 --- a/Migration.Toolkit.KX12/Models/BoardBoard.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Board_Board")] -[Index("BoardDocumentId", "BoardName", Name = "IX_Board_Board_BoardDocumentID_BoardName", IsUnique = true)] -[Index("BoardGroupId", "BoardName", Name = "IX_Board_Board_BoardGroupID_BoardName")] -[Index("BoardSiteId", Name = "IX_Board_Board_BoardSiteID")] -[Index("BoardUserId", "BoardName", Name = "IX_Board_Board_BoardUserID_BoardName")] -public class BoardBoard -{ - [Key] - [Column("BoardID")] - public int BoardId { get; set; } - - [StringLength(250)] - public string BoardName { get; set; } = null!; - - [StringLength(250)] - public string BoardDisplayName { get; set; } = null!; - - public string BoardDescription { get; set; } = null!; - - public bool BoardOpened { get; set; } - - public DateTime? BoardOpenedFrom { get; set; } - - public DateTime? BoardOpenedTo { get; set; } - - public bool BoardEnabled { get; set; } - - public int BoardAccess { get; set; } - - public bool BoardModerated { get; set; } - - public bool BoardUseCaptcha { get; set; } - - public int BoardMessages { get; set; } - - public DateTime BoardLastModified { get; set; } - - [Column("BoardGUID")] - public Guid BoardGuid { get; set; } - - [Column("BoardDocumentID")] - public int BoardDocumentId { get; set; } - - [Column("BoardUserID")] - public int? BoardUserId { get; set; } - - [Column("BoardGroupID")] - public int? BoardGroupId { get; set; } - - public DateTime? BoardLastMessageTime { get; set; } - - [StringLength(250)] - public string? BoardLastMessageUserName { get; set; } - - [Column("BoardUnsubscriptionURL")] - [StringLength(450)] - public string? BoardUnsubscriptionUrl { get; set; } - - public bool? BoardRequireEmails { get; set; } - - [Column("BoardSiteID")] - public int BoardSiteId { get; set; } - - public bool BoardEnableSubscriptions { get; set; } - - [Column("BoardBaseURL")] - [StringLength(450)] - public string? BoardBaseUrl { get; set; } - - public bool? BoardLogActivity { get; set; } - - public bool? BoardEnableOptIn { get; set; } - - public bool? BoardSendOptInConfirmation { get; set; } - - [Column("BoardOptInApprovalURL")] - [StringLength(450)] - public string? BoardOptInApprovalUrl { get; set; } - - [ForeignKey("BoardDocumentId")] - [InverseProperty("BoardBoards")] - public virtual CmsDocument BoardDocument { get; set; } = null!; - - [ForeignKey("BoardGroupId")] - [InverseProperty("BoardBoards")] - public virtual CommunityGroup? BoardGroup { get; set; } - - [InverseProperty("MessageBoard")] - public virtual ICollection BoardMessagesNavigation { get; set; } = new List(); - - [ForeignKey("BoardSiteId")] - [InverseProperty("BoardBoards")] - public virtual CmsSite BoardSite { get; set; } = null!; - - [InverseProperty("SubscriptionBoard")] - public virtual ICollection BoardSubscriptions { get; set; } = new List(); - - [ForeignKey("BoardUserId")] - [InverseProperty("BoardBoards")] - public virtual CmsUser? BoardUser { get; set; } - - [ForeignKey("BoardId")] - [InverseProperty("Boards")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("BoardId")] - [InverseProperty("Boards")] - public virtual ICollection Users { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/BoardMessage.cs b/Migration.Toolkit.KX12/Models/BoardMessage.cs deleted file mode 100644 index 8db10c6c..00000000 --- a/Migration.Toolkit.KX12/Models/BoardMessage.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Board_Message")] -[Index("MessageApprovedByUserId", Name = "IX_Board_Message_MessageApprovedByUserID")] -[Index("MessageApproved", "MessageIsSpam", Name = "IX_Board_Message_MessageApproved_MessageIsSpam")] -[Index("MessageBoardId", "MessageGuid", Name = "IX_Board_Message_MessageBoardID_MessageGUID", IsUnique = true)] -[Index("MessageUserId", Name = "IX_Board_Message_MessageUserID")] -public class BoardMessage -{ - [Key] - [Column("MessageID")] - public int MessageId { get; set; } - - [StringLength(250)] - public string MessageUserName { get; set; } = null!; - - public string MessageText { get; set; } = null!; - - [StringLength(254)] - public string MessageEmail { get; set; } = null!; - - [Column("MessageURL")] - [StringLength(450)] - public string MessageUrl { get; set; } = null!; - - public bool MessageIsSpam { get; set; } - - [Column("MessageBoardID")] - public int MessageBoardId { get; set; } - - public bool MessageApproved { get; set; } - - [Column("MessageApprovedByUserID")] - public int? MessageApprovedByUserId { get; set; } - - [Column("MessageUserID")] - public int? MessageUserId { get; set; } - - public string MessageUserInfo { get; set; } = null!; - - [Column("MessageAvatarGUID")] - public Guid? MessageAvatarGuid { get; set; } - - public DateTime MessageInserted { get; set; } - - public DateTime MessageLastModified { get; set; } - - [Column("MessageGUID")] - public Guid MessageGuid { get; set; } - - public double? MessageRatingValue { get; set; } - - [ForeignKey("MessageApprovedByUserId")] - [InverseProperty("BoardMessageMessageApprovedByUsers")] - public virtual CmsUser? MessageApprovedByUser { get; set; } - - [ForeignKey("MessageBoardId")] - [InverseProperty("BoardMessagesNavigation")] - public virtual BoardBoard MessageBoard { get; set; } = null!; - - [ForeignKey("MessageUserId")] - [InverseProperty("BoardMessageMessageUsers")] - public virtual CmsUser? MessageUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/BoardSubscription.cs b/Migration.Toolkit.KX12/Models/BoardSubscription.cs deleted file mode 100644 index 9c53ab06..00000000 --- a/Migration.Toolkit.KX12/Models/BoardSubscription.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Board_Subscription")] -[Index("SubscriptionBoardId", Name = "IX_Board_Subscription_SubscriptionBoardID")] -[Index("SubscriptionUserId", Name = "IX_Board_Subscription_SubscriptionUserID")] -public class BoardSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionBoardID")] - public int SubscriptionBoardId { get; set; } - - [Column("SubscriptionUserID")] - public int? SubscriptionUserId { get; set; } - - [StringLength(254)] - public string SubscriptionEmail { get; set; } = null!; - - public DateTime SubscriptionLastModified { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [ForeignKey("SubscriptionBoardId")] - [InverseProperty("BoardSubscriptions")] - public virtual BoardBoard SubscriptionBoard { get; set; } = null!; - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("BoardSubscriptions")] - public virtual CmsUser? SubscriptionUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ChatInitiatedChatRequest.cs b/Migration.Toolkit.KX12/Models/ChatInitiatedChatRequest.cs deleted file mode 100644 index d90ae21b..00000000 --- a/Migration.Toolkit.KX12/Models/ChatInitiatedChatRequest.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_InitiatedChatRequest")] -[Index("InitiatedChatRequestInitiatorChatUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestInitiatorChatUserID")] -[Index("InitiatedChatRequestUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestUserID")] -[Index("InitiatedChatRequestRoomId", Name = "UQ_Chat_InitiatedChatRequest_RoomID", IsUnique = true)] -[Index("InitiatedChatRequestUserId", "InitiatedChatRequestContactId", Name = "UQ_Chat_InitiatedChatRequest_UserIDContactID", IsUnique = true)] -public class ChatInitiatedChatRequest -{ - [Key] - [Column("InitiatedChatRequestID")] - public int InitiatedChatRequestId { get; set; } - - [Column("InitiatedChatRequestUserID")] - public int? InitiatedChatRequestUserId { get; set; } - - [Column("InitiatedChatRequestContactID")] - public int? InitiatedChatRequestContactId { get; set; } - - [Column("InitiatedChatRequestRoomID")] - public int InitiatedChatRequestRoomId { get; set; } - - public int InitiatedChatRequestState { get; set; } - - [StringLength(100)] - public string InitiatedChatRequestInitiatorName { get; set; } = null!; - - [Column("InitiatedChatRequestInitiatorChatUserID")] - public int InitiatedChatRequestInitiatorChatUserId { get; set; } - - public DateTime InitiatedChatRequestLastModification { get; set; } - - [ForeignKey("InitiatedChatRequestInitiatorChatUserId")] - [InverseProperty("ChatInitiatedChatRequests")] - public virtual ChatUser InitiatedChatRequestInitiatorChatUser { get; set; } = null!; - - [ForeignKey("InitiatedChatRequestRoomId")] - [InverseProperty("ChatInitiatedChatRequest")] - public virtual ChatRoom InitiatedChatRequestRoom { get; set; } = null!; - - [ForeignKey("InitiatedChatRequestUserId")] - [InverseProperty("ChatInitiatedChatRequests")] - public virtual CmsUser? InitiatedChatRequestUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ChatMessage.cs b/Migration.Toolkit.KX12/Models/ChatMessage.cs deleted file mode 100644 index c00deedf..00000000 --- a/Migration.Toolkit.KX12/Models/ChatMessage.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_Message")] -[Index("ChatMessageLastModified", Name = "IX_Chat_Message_ChatMessageLastModified")] -[Index("ChatMessageRecipientId", Name = "IX_Chat_Message_ChatMessageRecipientID")] -[Index("ChatMessageRoomId", Name = "IX_Chat_Message_ChatMessageRoomID")] -[Index("ChatMessageSystemMessageType", Name = "IX_Chat_Message_ChatMessageSystemMessageType")] -[Index("ChatMessageUserId", Name = "IX_Chat_Message_ChatMessageUserID")] -public class ChatMessage -{ - [Key] - [Column("ChatMessageID")] - public int ChatMessageId { get; set; } - - public DateTime ChatMessageCreatedWhen { get; set; } - - [Column("ChatMessageIPAddress")] - public string ChatMessageIpaddress { get; set; } = null!; - - [Column("ChatMessageUserID")] - public int? ChatMessageUserId { get; set; } - - [Column("ChatMessageRoomID")] - public int ChatMessageRoomId { get; set; } - - public bool ChatMessageRejected { get; set; } - - public DateTime ChatMessageLastModified { get; set; } - - public string ChatMessageText { get; set; } = null!; - - public int ChatMessageSystemMessageType { get; set; } - - [Column("ChatMessageRecipientID")] - public int? ChatMessageRecipientId { get; set; } - - [ForeignKey("ChatMessageRecipientId")] - [InverseProperty("ChatMessageChatMessageRecipients")] - public virtual ChatUser? ChatMessageRecipient { get; set; } - - [ForeignKey("ChatMessageRoomId")] - [InverseProperty("ChatMessages")] - public virtual ChatRoom ChatMessageRoom { get; set; } = null!; - - [ForeignKey("ChatMessageUserId")] - [InverseProperty("ChatMessageChatMessageUsers")] - public virtual ChatUser? ChatMessageUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ChatNotification.cs b/Migration.Toolkit.KX12/Models/ChatNotification.cs deleted file mode 100644 index 21a4e56c..00000000 --- a/Migration.Toolkit.KX12/Models/ChatNotification.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_Notification")] -[Index("ChatNotificationReceiverId", Name = "IX_Chat_Notification_ChatNotificationReceiverID")] -[Index("ChatNotificationRoomId", Name = "IX_Chat_Notification_ChatNotificationRoomID")] -[Index("ChatNotificationSenderId", Name = "IX_Chat_Notification_ChatNotificationSenderID")] -[Index("ChatNotificationSiteId", Name = "IX_Chat_Notification_ChatNotificationSiteID")] -public class ChatNotification -{ - [Key] - [Column("ChatNotificationID")] - public int ChatNotificationId { get; set; } - - [Column("ChatNotificationSenderID")] - public int ChatNotificationSenderId { get; set; } - - [Column("ChatNotificationReceiverID")] - public int ChatNotificationReceiverId { get; set; } - - public bool ChatNotificationIsRead { get; set; } - - public int ChatNotificationType { get; set; } - - [Column("ChatNotificationRoomID")] - public int? ChatNotificationRoomId { get; set; } - - public DateTime ChatNotificationSendDateTime { get; set; } - - public DateTime? ChatNotificationReadDateTime { get; set; } - - [Column("ChatNotificationSiteID")] - public int? ChatNotificationSiteId { get; set; } - - [ForeignKey("ChatNotificationReceiverId")] - [InverseProperty("ChatNotificationChatNotificationReceivers")] - public virtual ChatUser ChatNotificationReceiver { get; set; } = null!; - - [ForeignKey("ChatNotificationRoomId")] - [InverseProperty("ChatNotifications")] - public virtual ChatRoom? ChatNotificationRoom { get; set; } - - [ForeignKey("ChatNotificationSenderId")] - [InverseProperty("ChatNotificationChatNotificationSenders")] - public virtual ChatUser ChatNotificationSender { get; set; } = null!; - - [ForeignKey("ChatNotificationSiteId")] - [InverseProperty("ChatNotifications")] - public virtual CmsSite? ChatNotificationSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ChatOnlineSupport.cs b/Migration.Toolkit.KX12/Models/ChatOnlineSupport.cs deleted file mode 100644 index 79bc7a24..00000000 --- a/Migration.Toolkit.KX12/Models/ChatOnlineSupport.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_OnlineSupport")] -[Index("ChatOnlineSupportChatUserId", Name = "IX_Chat_OnlineSupport_ChatOnlineSupportChatUserID")] -[Index("ChatOnlineSupportSiteId", Name = "IX_Chat_OnlineSupport_SiteID")] -[Index("ChatOnlineSupportChatUserId", "ChatOnlineSupportSiteId", Name = "UQ_Chat_OnlineSupport_ChatUserID-SiteID", IsUnique = true)] -public class ChatOnlineSupport -{ - [Key] - [Column("ChatOnlineSupportID")] - public int ChatOnlineSupportId { get; set; } - - [Column("ChatOnlineSupportChatUserID")] - public int ChatOnlineSupportChatUserId { get; set; } - - public DateTime ChatOnlineSupportLastChecking { get; set; } - - [Column("ChatOnlineSupportSiteID")] - public int ChatOnlineSupportSiteId { get; set; } - - [StringLength(50)] - public string? ChatOnlineSupportToken { get; set; } - - [ForeignKey("ChatOnlineSupportChatUserId")] - [InverseProperty("ChatOnlineSupports")] - public virtual ChatUser ChatOnlineSupportChatUser { get; set; } = null!; - - [ForeignKey("ChatOnlineSupportSiteId")] - [InverseProperty("ChatOnlineSupports")] - public virtual CmsSite ChatOnlineSupportSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ChatOnlineUser.cs b/Migration.Toolkit.KX12/Models/ChatOnlineUser.cs deleted file mode 100644 index 52f6b1a9..00000000 --- a/Migration.Toolkit.KX12/Models/ChatOnlineUser.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_OnlineUser")] -[Index("ChatOnlineUserChatUserId", Name = "IX_Chat_OnlineUser_ChatOnlineUserChatUserID")] -[Index("ChatOnlineUserSiteId", Name = "IX_Chat_OnlineUser_SiteID")] -[Index("ChatOnlineUserChatUserId", "ChatOnlineUserSiteId", Name = "UQ_Chat_OnlineUser_SiteID-ChatUserID", IsUnique = true)] -public class ChatOnlineUser -{ - [Key] - [Column("ChatOnlineUserID")] - public int ChatOnlineUserId { get; set; } - - [Column("ChatOnlineUserSiteID")] - public int ChatOnlineUserSiteId { get; set; } - - public DateTime? ChatOnlineUserLastChecking { get; set; } - - [Column("ChatOnlineUserChatUserID")] - public int ChatOnlineUserChatUserId { get; set; } - - public DateTime? ChatOnlineUserJoinTime { get; set; } - - public DateTime? ChatOnlineUserLeaveTime { get; set; } - - [StringLength(50)] - public string? ChatOnlineUserToken { get; set; } - - public bool ChatOnlineUserIsHidden { get; set; } - - [ForeignKey("ChatOnlineUserChatUserId")] - [InverseProperty("ChatOnlineUsers")] - public virtual ChatUser ChatOnlineUserChatUser { get; set; } = null!; - - [ForeignKey("ChatOnlineUserSiteId")] - [InverseProperty("ChatOnlineUsers")] - public virtual CmsSite ChatOnlineUserSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ChatPopupWindowSetting.cs b/Migration.Toolkit.KX12/Models/ChatPopupWindowSetting.cs deleted file mode 100644 index 6f5a0603..00000000 --- a/Migration.Toolkit.KX12/Models/ChatPopupWindowSetting.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_PopupWindowSettings")] -public class ChatPopupWindowSetting -{ - [Key] - [Column("ChatPopupWindowSettingsID")] - public int ChatPopupWindowSettingsId { get; set; } - - [StringLength(255)] - public string MessageTransformationName { get; set; } = null!; - - [StringLength(255)] - public string ErrorTransformationName { get; set; } = null!; - - [StringLength(255)] - public string ErrorClearTransformationName { get; set; } = null!; - - [StringLength(255)] - public string UserTransformationName { get; set; } = null!; - - public int ChatPopupWindowSettingsHashCode { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ChatRoom.cs b/Migration.Toolkit.KX12/Models/ChatRoom.cs deleted file mode 100644 index 3a001570..00000000 --- a/Migration.Toolkit.KX12/Models/ChatRoom.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_Room")] -[Index("ChatRoomCreatedByChatUserId", Name = "IX_Chat_Room_ChatRoomCreatedByChatUserID")] -[Index("ChatRoomEnabled", Name = "IX_Chat_Room_Enabled")] -[Index("ChatRoomIsSupport", Name = "IX_Chat_Room_IsSupport")] -[Index("ChatRoomSiteId", Name = "IX_Chat_Room_SiteID")] -public class ChatRoom -{ - [Key] - [Column("ChatRoomID")] - public int ChatRoomId { get; set; } - - [StringLength(100)] - public string ChatRoomName { get; set; } = null!; - - [StringLength(100)] - public string ChatRoomDisplayName { get; set; } = null!; - - [Column("ChatRoomSiteID")] - public int? ChatRoomSiteId { get; set; } - - public bool ChatRoomEnabled { get; set; } - - public bool ChatRoomPrivate { get; set; } - - public bool ChatRoomAllowAnonym { get; set; } - - public DateTime ChatRoomCreatedWhen { get; set; } - - [StringLength(100)] - public string? ChatRoomPassword { get; set; } - - [Column("ChatRoomCreatedByChatUserID")] - public int? ChatRoomCreatedByChatUserId { get; set; } - - public bool ChatRoomIsSupport { get; set; } - - public bool ChatRoomIsOneToOne { get; set; } - - [StringLength(500)] - public string? ChatRoomDescription { get; set; } - - public DateTime ChatRoomLastModification { get; set; } - - public DateTime? ChatRoomScheduledToDelete { get; set; } - - public DateTime ChatRoomPrivateStateLastModification { get; set; } - - [Column("ChatRoomGUID")] - public Guid ChatRoomGuid { get; set; } - - [InverseProperty("InitiatedChatRequestRoom")] - public virtual ChatInitiatedChatRequest? ChatInitiatedChatRequest { get; set; } - - [InverseProperty("ChatMessageRoom")] - public virtual ICollection ChatMessages { get; set; } = new List(); - - [InverseProperty("ChatNotificationRoom")] - public virtual ICollection ChatNotifications { get; set; } = new List(); - - [ForeignKey("ChatRoomCreatedByChatUserId")] - [InverseProperty("ChatRooms")] - public virtual ChatUser? ChatRoomCreatedByChatUser { get; set; } - - [ForeignKey("ChatRoomSiteId")] - [InverseProperty("ChatRooms")] - public virtual CmsSite? ChatRoomSite { get; set; } - - [InverseProperty("ChatRoomUserRoom")] - public virtual ICollection ChatRoomUsers { get; set; } = new List(); - - [InverseProperty("ChatSupportTakenRoomRoom")] - public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/ChatRoomUser.cs b/Migration.Toolkit.KX12/Models/ChatRoomUser.cs deleted file mode 100644 index 5f0fb8b3..00000000 --- a/Migration.Toolkit.KX12/Models/ChatRoomUser.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_RoomUser")] -[Index("ChatRoomUserChatUserId", Name = "IX_Chat_RoomUser_ChatRoomUserChatUserID")] -[Index("ChatRoomUserRoomId", Name = "IX_Chat_RoomUser_ChatRoomUserRoomID")] -[Index("ChatRoomUserRoomId", "ChatRoomUserChatUserId", Name = "UQ_Chat_RoomUser_RoomID-ChatUserID", IsUnique = true)] -public class ChatRoomUser -{ - [Key] - [Column("ChatRoomUserID")] - public int ChatRoomUserId { get; set; } - - [Column("ChatRoomUserRoomID")] - public int ChatRoomUserRoomId { get; set; } - - [Column("ChatRoomUserChatUserID")] - public int ChatRoomUserChatUserId { get; set; } - - public DateTime? ChatRoomUserLastChecking { get; set; } - - public DateTime? ChatRoomUserKickExpiration { get; set; } - - public DateTime? ChatRoomUserJoinTime { get; set; } - - public DateTime? ChatRoomUserLeaveTime { get; set; } - - public int ChatRoomUserAdminLevel { get; set; } - - public DateTime ChatRoomUserLastModification { get; set; } - - [ForeignKey("ChatRoomUserChatUserId")] - [InverseProperty("ChatRoomUsers")] - public virtual ChatUser ChatRoomUserChatUser { get; set; } = null!; - - [ForeignKey("ChatRoomUserRoomId")] - [InverseProperty("ChatRoomUsers")] - public virtual ChatRoom ChatRoomUserRoom { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ChatSupportCannedResponse.cs b/Migration.Toolkit.KX12/Models/ChatSupportCannedResponse.cs deleted file mode 100644 index bc9fed6b..00000000 --- a/Migration.Toolkit.KX12/Models/ChatSupportCannedResponse.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_SupportCannedResponse")] -[Index("ChatSupportCannedResponseChatUserId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseChatUserID")] -[Index("ChatSupportCannedResponseSiteId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseSiteID")] -public class ChatSupportCannedResponse -{ - [Key] - [Column("ChatSupportCannedResponseID")] - public int ChatSupportCannedResponseId { get; set; } - - [Column("ChatSupportCannedResponseChatUserID")] - public int? ChatSupportCannedResponseChatUserId { get; set; } - - [StringLength(500)] - public string ChatSupportCannedResponseText { get; set; } = null!; - - [StringLength(50)] - public string ChatSupportCannedResponseTagName { get; set; } = null!; - - [Column("ChatSupportCannedResponseSiteID")] - public int? ChatSupportCannedResponseSiteId { get; set; } - - [StringLength(100)] - public string ChatSupportCannedResponseName { get; set; } = null!; - - [ForeignKey("ChatSupportCannedResponseChatUserId")] - [InverseProperty("ChatSupportCannedResponses")] - public virtual ChatUser? ChatSupportCannedResponseChatUser { get; set; } - - [ForeignKey("ChatSupportCannedResponseSiteId")] - [InverseProperty("ChatSupportCannedResponses")] - public virtual CmsSite? ChatSupportCannedResponseSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ChatSupportTakenRoom.cs b/Migration.Toolkit.KX12/Models/ChatSupportTakenRoom.cs deleted file mode 100644 index 449dbfd5..00000000 --- a/Migration.Toolkit.KX12/Models/ChatSupportTakenRoom.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_SupportTakenRoom")] -[Index("ChatSupportTakenRoomChatUserId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomChatUserID")] -[Index("ChatSupportTakenRoomRoomId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomRoomID")] -public class ChatSupportTakenRoom -{ - [Key] - [Column("ChatSupportTakenRoomID")] - public int ChatSupportTakenRoomId { get; set; } - - [Column("ChatSupportTakenRoomChatUserID")] - public int? ChatSupportTakenRoomChatUserId { get; set; } - - [Column("ChatSupportTakenRoomRoomID")] - public int ChatSupportTakenRoomRoomId { get; set; } - - public DateTime? ChatSupportTakenRoomResolvedDateTime { get; set; } - - public DateTime ChatSupportTakenRoomLastModification { get; set; } - - [ForeignKey("ChatSupportTakenRoomChatUserId")] - [InverseProperty("ChatSupportTakenRooms")] - public virtual ChatUser? ChatSupportTakenRoomChatUser { get; set; } - - [ForeignKey("ChatSupportTakenRoomRoomId")] - [InverseProperty("ChatSupportTakenRooms")] - public virtual ChatRoom ChatSupportTakenRoomRoom { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ChatUser.cs b/Migration.Toolkit.KX12/Models/ChatUser.cs deleted file mode 100644 index 7bd88146..00000000 --- a/Migration.Toolkit.KX12/Models/ChatUser.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_User")] -[Index("ChatUserUserId", Name = "IX_Chat_User_UserID")] -public class ChatUser -{ - [Key] - [Column("ChatUserID")] - public int ChatUserId { get; set; } - - [Column("ChatUserUserID")] - public int? ChatUserUserId { get; set; } - - [StringLength(50)] - public string ChatUserNickname { get; set; } = null!; - - public DateTime ChatUserLastModification { get; set; } - - [InverseProperty("InitiatedChatRequestInitiatorChatUser")] - public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); - - [InverseProperty("ChatMessageRecipient")] - public virtual ICollection ChatMessageChatMessageRecipients { get; set; } = new List(); - - [InverseProperty("ChatMessageUser")] - public virtual ICollection ChatMessageChatMessageUsers { get; set; } = new List(); - - [InverseProperty("ChatNotificationReceiver")] - public virtual ICollection ChatNotificationChatNotificationReceivers { get; set; } = new List(); - - [InverseProperty("ChatNotificationSender")] - public virtual ICollection ChatNotificationChatNotificationSenders { get; set; } = new List(); - - [InverseProperty("ChatOnlineSupportChatUser")] - public virtual ICollection ChatOnlineSupports { get; set; } = new List(); - - [InverseProperty("ChatOnlineUserChatUser")] - public virtual ICollection ChatOnlineUsers { get; set; } = new List(); - - [InverseProperty("ChatRoomUserChatUser")] - public virtual ICollection ChatRoomUsers { get; set; } = new List(); - - [InverseProperty("ChatRoomCreatedByChatUser")] - public virtual ICollection ChatRooms { get; set; } = new List(); - - [InverseProperty("ChatSupportCannedResponseChatUser")] - public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); - - [InverseProperty("ChatSupportTakenRoomChatUser")] - public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); - - [ForeignKey("ChatUserUserId")] - [InverseProperty("ChatUsers")] - public virtual CmsUser? ChatUserUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CiFileMetadatum.cs b/Migration.Toolkit.KX12/Models/CiFileMetadatum.cs deleted file mode 100644 index 7cd26273..00000000 --- a/Migration.Toolkit.KX12/Models/CiFileMetadatum.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CI_FileMetadata")] -[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] -public class CiFileMetadatum -{ - [Key] - [Column("FileMetadataID")] - public int FileMetadataId { get; set; } - - [StringLength(260)] - public string FileLocation { get; set; } = null!; - - [StringLength(32)] - public string FileHash { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CiMigration.cs b/Migration.Toolkit.KX12/Models/CiMigration.cs deleted file mode 100644 index 2872df66..00000000 --- a/Migration.Toolkit.KX12/Models/CiMigration.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CI_Migration")] -[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] -public class CiMigration -{ - [Key] - [Column("MigrationID")] - public int MigrationId { get; set; } - - [StringLength(255)] - public string MigrationName { get; set; } = null!; - - [Precision(3)] - public DateTime DateApplied { get; set; } - - public int? RowsAffected { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsAbuseReport.cs b/Migration.Toolkit.KX12/Models/CmsAbuseReport.cs deleted file mode 100644 index c1b3c619..00000000 --- a/Migration.Toolkit.KX12/Models/CmsAbuseReport.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_AbuseReport")] -[Index("ReportSiteId", Name = "IX_CMS_AbuseReport_ReportSiteID")] -[Index("ReportStatus", Name = "IX_CMS_AbuseReport_ReportStatus")] -[Index("ReportUserId", Name = "IX_CMS_AbuseReport_ReportUserID")] -public class CmsAbuseReport -{ - [Key] - [Column("ReportID")] - public int ReportId { get; set; } - - [Column("ReportGUID")] - public Guid ReportGuid { get; set; } - - [StringLength(100)] - public string? ReportTitle { get; set; } - - [Column("ReportURL")] - [StringLength(1000)] - public string ReportUrl { get; set; } = null!; - - [StringLength(50)] - public string ReportCulture { get; set; } = null!; - - [Column("ReportObjectID")] - public int? ReportObjectId { get; set; } - - [StringLength(100)] - public string? ReportObjectType { get; set; } - - public string ReportComment { get; set; } = null!; - - [Column("ReportUserID")] - public int? ReportUserId { get; set; } - - public DateTime ReportWhen { get; set; } - - public int ReportStatus { get; set; } - - [Column("ReportSiteID")] - public int ReportSiteId { get; set; } - - [ForeignKey("ReportSiteId")] - [InverseProperty("CmsAbuseReports")] - public virtual CmsSite ReportSite { get; set; } = null!; - - [ForeignKey("ReportUserId")] - [InverseProperty("CmsAbuseReports")] - public virtual CmsUser? ReportUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsAcl.cs b/Migration.Toolkit.KX12/Models/CmsAcl.cs deleted file mode 100644 index be62ccbe..00000000 --- a/Migration.Toolkit.KX12/Models/CmsAcl.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ACL")] -[Index("AclinheritedAcls", Name = "IX_CMS_ACL_ACLInheritedACLs")] -[Index("AclsiteId", Name = "IX_CMS_ACL_ACLSiteID")] -public class CmsAcl -{ - [Key] - [Column("ACLID")] - public int Aclid { get; set; } - - [Column("ACLInheritedACLs")] - public string AclinheritedAcls { get; set; } = null!; - - [Column("ACLGUID")] - public Guid Aclguid { get; set; } - - [Column("ACLLastModified")] - public DateTime AcllastModified { get; set; } - - [Column("ACLSiteID")] - public int? AclsiteId { get; set; } - - [ForeignKey("AclsiteId")] - [InverseProperty("CmsAcls")] - public virtual CmsSite? Aclsite { get; set; } - - [InverseProperty("Acl")] - public virtual ICollection CmsAclitems { get; set; } = new List(); - - [InverseProperty("NodeAcl")] - public virtual ICollection CmsTrees { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsAclitem.cs b/Migration.Toolkit.KX12/Models/CmsAclitem.cs deleted file mode 100644 index 3c1cf3c8..00000000 --- a/Migration.Toolkit.KX12/Models/CmsAclitem.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ACLItem")] -[Index("Aclid", Name = "IX_CMS_ACLItem_ACLID")] -[Index("LastModifiedByUserId", Name = "IX_CMS_ACLItem_LastModifiedByUserID")] -[Index("RoleId", Name = "IX_CMS_ACLItem_RoleID")] -[Index("UserId", Name = "IX_CMS_ACLItem_UserID")] -public class CmsAclitem -{ - [Key] - [Column("ACLItemID")] - public int AclitemId { get; set; } - - [Column("ACLID")] - public int Aclid { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [Column("RoleID")] - public int? RoleId { get; set; } - - public int Allowed { get; set; } - - public int Denied { get; set; } - - public DateTime LastModified { get; set; } - - [Column("LastModifiedByUserID")] - public int? LastModifiedByUserId { get; set; } - - [Column("ACLItemGUID")] - public Guid AclitemGuid { get; set; } - - [ForeignKey("Aclid")] - [InverseProperty("CmsAclitems")] - public virtual CmsAcl Acl { get; set; } = null!; - - [ForeignKey("LastModifiedByUserId")] - [InverseProperty("CmsAclitemLastModifiedByUsers")] - public virtual CmsUser? LastModifiedByUser { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsAclitems")] - public virtual CmsRole? Role { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsAclitemUsers")] - public virtual CmsUser? User { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsAlternativeForm.cs b/Migration.Toolkit.KX12/Models/CmsAlternativeForm.cs deleted file mode 100644 index 1e29a137..00000000 --- a/Migration.Toolkit.KX12/Models/CmsAlternativeForm.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_AlternativeForm")] -[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] -[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] -public class CmsAlternativeForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(50)] - public string FormName { get; set; } = null!; - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public string? FormDefinition { get; set; } - - public string? FormLayout { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - [Column("FormCoupledClassID")] - public int? FormCoupledClassId { get; set; } - - public bool? FormHideNewParentFields { get; set; } - - [StringLength(50)] - public string? FormLayoutType { get; set; } - - [Column("FormVersionGUID")] - [StringLength(50)] - public string? FormVersionGuid { get; set; } - - [StringLength(400)] - public string? FormCustomizedColumns { get; set; } - - public bool? FormIsCustom { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsAlternativeFormFormClasses")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormCoupledClassId")] - [InverseProperty("CmsAlternativeFormFormCoupledClasses")] - public virtual CmsClass? FormCoupledClass { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsAlternativeUrl.cs b/Migration.Toolkit.KX12/Models/CmsAlternativeUrl.cs deleted file mode 100644 index 528d2b5a..00000000 --- a/Migration.Toolkit.KX12/Models/CmsAlternativeUrl.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_AlternativeUrl")] -[Index("AlternativeUrlDocumentId", Name = "IX_CMS_AlternativeUrl_AlternativeUrlDocumentID")] -[Index("AlternativeUrlSiteId", "AlternativeUrlUrl", Name = "IX_CMS_AlternativeUrl_AlternativeUrlSiteID_AlternativeUrlUrl", IsUnique = true)] -public class CmsAlternativeUrl -{ - [Key] - [Column("AlternativeUrlID")] - public int AlternativeUrlId { get; set; } - - [Column("AlternativeUrlGUID")] - public Guid AlternativeUrlGuid { get; set; } - - [Column("AlternativeUrlDocumentID")] - public int AlternativeUrlDocumentId { get; set; } - - [Column("AlternativeUrlSiteID")] - public int AlternativeUrlSiteId { get; set; } - - public string AlternativeUrlUrl { get; set; } = null!; - - public DateTime AlternativeUrlLastModified { get; set; } - - [ForeignKey("AlternativeUrlDocumentId")] - [InverseProperty("CmsAlternativeUrls")] - public virtual CmsDocument AlternativeUrlDocument { get; set; } = null!; - - [ForeignKey("AlternativeUrlSiteId")] - [InverseProperty("CmsAlternativeUrls")] - public virtual CmsSite AlternativeUrlSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsAttachment.cs b/Migration.Toolkit.KX12/Models/CmsAttachment.cs deleted file mode 100644 index d063cb17..00000000 --- a/Migration.Toolkit.KX12/Models/CmsAttachment.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Attachment")] -[Index("AttachmentDocumentId", Name = "IX_CMS_Attachment_AttachmentDocumentID")] -[Index("AttachmentGuid", "AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentGUID_AttachmentSiteID")] -[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentFormGuid", "AttachmentOrder", Name = "IX_CMS_Attachment_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentFormGUID_AttachmentOrder")] -[Index("AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentSiteID")] -[Index("AttachmentVariantParentId", Name = "IX_CMS_Attachment_AttachmentVariantParentID")] -public class CmsAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - public int? AttachmentImageWidth { get; set; } - - public int? AttachmentImageHeight { get; set; } - - [Column("AttachmentDocumentID")] - public int? AttachmentDocumentId { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - public bool? AttachmentIsUnsorted { get; set; } - - public int? AttachmentOrder { get; set; } - - [Column("AttachmentGroupGUID")] - public Guid? AttachmentGroupGuid { get; set; } - - [Column("AttachmentFormGUID")] - public Guid? AttachmentFormGuid { get; set; } - - [StringLength(32)] - public string? AttachmentHash { get; set; } - - [StringLength(250)] - public string? AttachmentTitle { get; set; } - - public string? AttachmentDescription { get; set; } - - public string? AttachmentCustomData { get; set; } - - public string? AttachmentSearchContent { get; set; } - - [StringLength(50)] - public string? AttachmentVariantDefinitionIdentifier { get; set; } - - [Column("AttachmentVariantParentID")] - public int? AttachmentVariantParentId { get; set; } - - [ForeignKey("AttachmentDocumentId")] - [InverseProperty("CmsAttachments")] - public virtual CmsDocument? AttachmentDocument { get; set; } - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("CmsAttachments")] - public virtual CmsSite AttachmentSite { get; set; } = null!; - - [ForeignKey("AttachmentVariantParentId")] - [InverseProperty("InverseAttachmentVariantParent")] - public virtual CmsAttachment? AttachmentVariantParent { get; set; } - - [InverseProperty("AttachmentVariantParent")] - public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsAttachmentHistory.cs b/Migration.Toolkit.KX12/Models/CmsAttachmentHistory.cs deleted file mode 100644 index a9ba70d3..00000000 --- a/Migration.Toolkit.KX12/Models/CmsAttachmentHistory.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_AttachmentHistory")] -[Index("AttachmentGuid", Name = "IX_CMS_AttachmentHistory_AttachmentGUID")] -[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentOrder", Name = "IX_CMS_AttachmentHistory_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentOrder")] -[Index("AttachmentSiteId", Name = "IX_CMS_AttachmentHistory_AttachmentSiteID")] -[Index("AttachmentVariantParentId", Name = "IX_CMS_AttachmentHistory_AttachmentVariantParentID")] -public class CmsAttachmentHistory -{ - [Key] - [Column("AttachmentHistoryID")] - public int AttachmentHistoryId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - public int? AttachmentImageWidth { get; set; } - - public int? AttachmentImageHeight { get; set; } - - [Column("AttachmentDocumentID")] - public int AttachmentDocumentId { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public bool? AttachmentIsUnsorted { get; set; } - - public int? AttachmentOrder { get; set; } - - [Column("AttachmentGroupGUID")] - public Guid? AttachmentGroupGuid { get; set; } - - [StringLength(32)] - public string? AttachmentHash { get; set; } - - [StringLength(250)] - public string? AttachmentTitle { get; set; } - - public string? AttachmentDescription { get; set; } - - public string? AttachmentCustomData { get; set; } - - public DateTime? AttachmentLastModified { get; set; } - - [Column("AttachmentHistoryGUID")] - public Guid AttachmentHistoryGuid { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - public string? AttachmentSearchContent { get; set; } - - [StringLength(50)] - public string? AttachmentVariantDefinitionIdentifier { get; set; } - - [Column("AttachmentVariantParentID")] - public int? AttachmentVariantParentId { get; set; } - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("CmsAttachmentHistories")] - public virtual CmsSite AttachmentSite { get; set; } = null!; - - [ForeignKey("AttachmentVariantParentId")] - [InverseProperty("InverseAttachmentVariantParent")] - public virtual CmsAttachmentHistory? AttachmentVariantParent { get; set; } - - [InverseProperty("AttachmentVariantParent")] - public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); - - [ForeignKey("AttachmentHistoryId")] - [InverseProperty("AttachmentHistories")] - public virtual ICollection VersionHistories { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsAutomationHistory.cs b/Migration.Toolkit.KX12/Models/CmsAutomationHistory.cs deleted file mode 100644 index 0ab49d0c..00000000 --- a/Migration.Toolkit.KX12/Models/CmsAutomationHistory.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_AutomationHistory")] -[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] -[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] -[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] -[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] -[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] -[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] -public class CmsAutomationHistory -{ - [Key] - [Column("HistoryID")] - public int HistoryId { get; set; } - - [Column("HistoryStepID")] - public int? HistoryStepId { get; set; } - - [StringLength(440)] - public string? HistoryStepName { get; set; } - - [StringLength(450)] - public string HistoryStepDisplayName { get; set; } = null!; - - public int? HistoryStepType { get; set; } - - [Column("HistoryTargetStepID")] - public int? HistoryTargetStepId { get; set; } - - [StringLength(440)] - public string? HistoryTargetStepName { get; set; } - - [StringLength(450)] - public string? HistoryTargetStepDisplayName { get; set; } - - public int? HistoryTargetStepType { get; set; } - - [Column("HistoryApprovedByUserID")] - public int? HistoryApprovedByUserId { get; set; } - - public DateTime? HistoryApprovedWhen { get; set; } - - public string? HistoryComment { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - public bool HistoryWasRejected { get; set; } - - [Column("HistoryStateID")] - public int HistoryStateId { get; set; } - - [ForeignKey("HistoryApprovedByUserId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsUser? HistoryApprovedByUser { get; set; } - - [ForeignKey("HistoryStateId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsAutomationState HistoryState { get; set; } = null!; - - [ForeignKey("HistoryStepId")] - [InverseProperty("CmsAutomationHistoryHistorySteps")] - public virtual CmsWorkflowStep? HistoryStep { get; set; } - - [ForeignKey("HistoryTargetStepId")] - [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] - public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsAutomationState.cs b/Migration.Toolkit.KX12/Models/CmsAutomationState.cs deleted file mode 100644 index 39af60d9..00000000 --- a/Migration.Toolkit.KX12/Models/CmsAutomationState.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_AutomationState")] -[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] -[Index("StateSiteId", Name = "IX_CMS_AutomationState_StateSiteID")] -[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] -[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] -[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] -public class CmsAutomationState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [Column("StateStepID")] - public int StateStepId { get; set; } - - [Column("StateObjectID")] - public int StateObjectId { get; set; } - - [StringLength(100)] - public string StateObjectType { get; set; } = null!; - - [StringLength(450)] - public string? StateActionStatus { get; set; } - - public DateTime? StateCreated { get; set; } - - public DateTime? StateLastModified { get; set; } - - [Column("StateWorkflowID")] - public int StateWorkflowId { get; set; } - - public int? StateStatus { get; set; } - - [Column("StateSiteID")] - public int? StateSiteId { get; set; } - - [Column("StateUserID")] - public int? StateUserId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public string? StateCustomData { get; set; } - - [InverseProperty("HistoryState")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [ForeignKey("StateSiteId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsSite? StateSite { get; set; } - - [ForeignKey("StateStepId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflowStep StateStep { get; set; } = null!; - - [ForeignKey("StateUserId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsUser? StateUser { get; set; } - - [ForeignKey("StateWorkflowId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflow StateWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsAvatar.cs b/Migration.Toolkit.KX12/Models/CmsAvatar.cs deleted file mode 100644 index 90e76b1a..00000000 --- a/Migration.Toolkit.KX12/Models/CmsAvatar.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Avatar")] -[Index("AvatarGuid", Name = "IX_CMS_Avatar_AvatarGUID")] -[Index("AvatarType", "AvatarIsCustom", Name = "IX_CMS_Avatar_AvatarType_AvatarIsCustom")] -public class CmsAvatar -{ - [Key] - [Column("AvatarID")] - public int AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarName { get; set; } - - [StringLength(200)] - public string AvatarFileName { get; set; } = null!; - - [StringLength(10)] - public string AvatarFileExtension { get; set; } = null!; - - public byte[]? AvatarBinary { get; set; } - - [StringLength(50)] - public string AvatarType { get; set; } = null!; - - public bool AvatarIsCustom { get; set; } - - [Column("AvatarGUID")] - public Guid AvatarGuid { get; set; } - - public DateTime AvatarLastModified { get; set; } - - [StringLength(100)] - public string AvatarMimeType { get; set; } = null!; - - public int AvatarFileSize { get; set; } - - public int? AvatarImageHeight { get; set; } - - public int? AvatarImageWidth { get; set; } - - public bool? DefaultMaleUserAvatar { get; set; } - - public bool? DefaultFemaleUserAvatar { get; set; } - - public bool? DefaultGroupAvatar { get; set; } - - public bool? DefaultUserAvatar { get; set; } - - [InverseProperty("UserAvatar")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); - - [InverseProperty("GroupAvatar")] - public virtual ICollection CommunityGroups { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsBadge.cs b/Migration.Toolkit.KX12/Models/CmsBadge.cs deleted file mode 100644 index 0806556e..00000000 --- a/Migration.Toolkit.KX12/Models/CmsBadge.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Badge")] -public class CmsBadge -{ - [Key] - [Column("BadgeID")] - public int BadgeId { get; set; } - - [StringLength(100)] - public string BadgeName { get; set; } = null!; - - [StringLength(200)] - public string BadgeDisplayName { get; set; } = null!; - - [Column("BadgeImageURL")] - [StringLength(200)] - public string? BadgeImageUrl { get; set; } - - public bool BadgeIsAutomatic { get; set; } - - public int? BadgeTopLimit { get; set; } - - [Column("BadgeGUID")] - public Guid BadgeGuid { get; set; } - - public DateTime BadgeLastModified { get; set; } - - [InverseProperty("UserBadge")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsBannedIp.cs b/Migration.Toolkit.KX12/Models/CmsBannedIp.cs deleted file mode 100644 index 33ff9af5..00000000 --- a/Migration.Toolkit.KX12/Models/CmsBannedIp.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_BannedIP")] -[Index("IpaddressSiteId", Name = "IX_CMS_BannedIP_IPAddressSiteID")] -public class CmsBannedIp -{ - [Key] - [Column("IPAddressID")] - public int IpaddressId { get; set; } - - [Column("IPAddress")] - [StringLength(100)] - public string Ipaddress { get; set; } = null!; - - [Column("IPAddressRegular")] - [StringLength(200)] - public string IpaddressRegular { get; set; } = null!; - - [Column("IPAddressAllowed")] - public bool IpaddressAllowed { get; set; } - - [Column("IPAddressAllowOverride")] - public bool IpaddressAllowOverride { get; set; } - - [Column("IPAddressBanReason")] - [StringLength(450)] - public string? IpaddressBanReason { get; set; } - - [Column("IPAddressBanType")] - [StringLength(100)] - public string IpaddressBanType { get; set; } = null!; - - [Column("IPAddressBanEnabled")] - public bool? IpaddressBanEnabled { get; set; } - - [Column("IPAddressSiteID")] - public int? IpaddressSiteId { get; set; } - - [Column("IPAddressGUID")] - public Guid IpaddressGuid { get; set; } - - [Column("IPAddressLastModified")] - public DateTime IpaddressLastModified { get; set; } - - [ForeignKey("IpaddressSiteId")] - [InverseProperty("CmsBannedIps")] - public virtual CmsSite? IpaddressSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsBanner.cs b/Migration.Toolkit.KX12/Models/CmsBanner.cs deleted file mode 100644 index 3f091bab..00000000 --- a/Migration.Toolkit.KX12/Models/CmsBanner.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Banner")] -[Index("BannerCategoryId", Name = "IX_CMS_Banner_BannerCategoryID")] -[Index("BannerSiteId", Name = "IX_CMS_Banner_BannerSiteID")] -public class CmsBanner -{ - [Key] - [Column("BannerID")] - public int BannerId { get; set; } - - [StringLength(256)] - public string BannerName { get; set; } = null!; - - [StringLength(256)] - public string BannerDisplayName { get; set; } = null!; - - [Column("BannerCategoryID")] - public int BannerCategoryId { get; set; } - - [Required] - public bool? BannerEnabled { get; set; } - - public DateTime? BannerFrom { get; set; } - - public DateTime? BannerTo { get; set; } - - public Guid BannerGuid { get; set; } - - public DateTime BannerLastModified { get; set; } - - public int BannerType { get; set; } - - [Column("BannerURL")] - [StringLength(2083)] - public string BannerUrl { get; set; } = null!; - - public bool BannerBlank { get; set; } - - public double BannerWeight { get; set; } - - public int? BannerHitsLeft { get; set; } - - public int? BannerClicksLeft { get; set; } - - [Column("BannerSiteID")] - public int? BannerSiteId { get; set; } - - public string BannerContent { get; set; } = null!; - - [ForeignKey("BannerCategoryId")] - [InverseProperty("CmsBanners")] - public virtual CmsBannerCategory BannerCategory { get; set; } = null!; - - [ForeignKey("BannerSiteId")] - [InverseProperty("CmsBanners")] - public virtual CmsSite? BannerSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsBannerCategory.cs b/Migration.Toolkit.KX12/Models/CmsBannerCategory.cs deleted file mode 100644 index 05d52a62..00000000 --- a/Migration.Toolkit.KX12/Models/CmsBannerCategory.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_BannerCategory")] -[Index("BannerCategoryName", "BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategoryName_BannerCategorySiteID", IsUnique = true)] -[Index("BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategorySiteID")] -public class CmsBannerCategory -{ - [Key] - [Column("BannerCategoryID")] - public int BannerCategoryId { get; set; } - - [StringLength(100)] - public string BannerCategoryName { get; set; } = null!; - - [StringLength(200)] - public string BannerCategoryDisplayName { get; set; } = null!; - - [Column("BannerCategorySiteID")] - public int? BannerCategorySiteId { get; set; } - - public Guid BannerCategoryGuid { get; set; } - - public DateTime BannerCategoryLastModified { get; set; } - - [Required] - public bool? BannerCategoryEnabled { get; set; } - - [ForeignKey("BannerCategorySiteId")] - [InverseProperty("CmsBannerCategories")] - public virtual CmsSite? BannerCategorySite { get; set; } - - [InverseProperty("BannerCategory")] - public virtual ICollection CmsBanners { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsCategory.cs b/Migration.Toolkit.KX12/Models/CmsCategory.cs deleted file mode 100644 index bd22a63a..00000000 --- a/Migration.Toolkit.KX12/Models/CmsCategory.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Category")] -[Index("CategorySiteId", Name = "IX_CMS_Category_CategorySiteID")] -[Index("CategoryUserId", Name = "IX_CMS_Category_CategoryUserID")] -public class CmsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(250)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(250)] - public string? CategoryName { get; set; } - - public string? CategoryDescription { get; set; } - - public int? CategoryCount { get; set; } - - [Required] - public bool? CategoryEnabled { get; set; } - - [Column("CategoryUserID")] - public int? CategoryUserId { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - [StringLength(1500)] - public string? CategoryNamePath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryOrder { get; set; } - - [ForeignKey("CategorySiteId")] - [InverseProperty("CmsCategories")] - public virtual CmsSite? CategorySite { get; set; } - - [ForeignKey("CategoryUserId")] - [InverseProperty("CmsCategories")] - public virtual CmsUser? CategoryUser { get; set; } - - [ForeignKey("CategoryId")] - [InverseProperty("Categories")] - public virtual ICollection Documents { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsClass.cs b/Migration.Toolkit.KX12/Models/CmsClass.cs deleted file mode 100644 index e4efa4d0..00000000 --- a/Migration.Toolkit.KX12/Models/CmsClass.cs +++ /dev/null @@ -1,220 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Class")] -[Index("ClassDefaultPageTemplateId", Name = "IX_CMS_Class_ClassDefaultPageTemplateID")] -[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] -[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] -[Index("ClassPageTemplateCategoryId", Name = "IX_CMS_Class_ClassPageTemplateCategoryID")] -[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] -[Index("ClassShowAsSystemTable", "ClassIsCustomTable", "ClassIsCoupledClass", "ClassIsDocumentType", Name = "IX_CMS_Class_ClassShowAsSystemTable_ClassIsCustomTable_ClassIsCoupledClass_ClassIsDocumentType")] -public class CmsClass -{ - [Key] - [Column("ClassID")] - public int ClassId { get; set; } - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - public bool ClassUsesVersioning { get; set; } - - public bool ClassIsDocumentType { get; set; } - - public bool ClassIsCoupledClass { get; set; } - - public string ClassXmlSchema { get; set; } = null!; - - public string ClassFormDefinition { get; set; } = null!; - - [StringLength(450)] - public string? ClassEditingPageUrl { get; set; } - - [StringLength(450)] - public string? ClassListPageUrl { get; set; } - - [StringLength(100)] - public string ClassNodeNameSource { get; set; } = null!; - - [StringLength(100)] - public string? ClassTableName { get; set; } - - [StringLength(450)] - public string? ClassViewPageUrl { get; set; } - - [StringLength(450)] - public string? ClassPreviewPageUrl { get; set; } - - public string? ClassFormLayout { get; set; } - - [StringLength(450)] - public string? ClassNewPageUrl { get; set; } - - public bool? ClassShowAsSystemTable { get; set; } - - public bool? ClassUsePublishFromTo { get; set; } - - public bool? ClassShowTemplateSelection { get; set; } - - [Column("ClassSKUMappings")] - public string? ClassSkumappings { get; set; } - - public bool? ClassIsMenuItemType { get; set; } - - [StringLength(100)] - public string? ClassNodeAliasSource { get; set; } - - [Column("ClassDefaultPageTemplateID")] - public int? ClassDefaultPageTemplateId { get; set; } - - public DateTime ClassLastModified { get; set; } - - [Column("ClassGUID")] - public Guid ClassGuid { get; set; } - - [Column("ClassCreateSKU")] - public bool? ClassCreateSku { get; set; } - - public bool? ClassIsProduct { get; set; } - - public bool ClassIsCustomTable { get; set; } - - [StringLength(1000)] - public string? ClassShowColumns { get; set; } - - [StringLength(200)] - public string? ClassSearchTitleColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchContentColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchImageColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchCreationDateColumn { get; set; } - - public string? ClassSearchSettings { get; set; } - - [Column("ClassInheritsFromClassID")] - public int? ClassInheritsFromClassId { get; set; } - - public bool? ClassSearchEnabled { get; set; } - - [Column("ClassSKUDefaultDepartmentName")] - [StringLength(200)] - public string? ClassSkudefaultDepartmentName { get; set; } - - [Column("ClassSKUDefaultDepartmentID")] - public int? ClassSkudefaultDepartmentId { get; set; } - - public string? ClassContactMapping { get; set; } - - public bool? ClassContactOverwriteEnabled { get; set; } - - [Column("ClassSKUDefaultProductType")] - [StringLength(50)] - public string? ClassSkudefaultProductType { get; set; } - - [StringLength(100)] - public string? ClassConnectionString { get; set; } - - public bool? ClassIsProductSection { get; set; } - - [Column("ClassPageTemplateCategoryID")] - public int? ClassPageTemplateCategoryId { get; set; } - - [StringLength(50)] - public string? ClassFormLayoutType { get; set; } - - [Column("ClassVersionGUID")] - [StringLength(50)] - public string? ClassVersionGuid { get; set; } - - [StringLength(100)] - public string? ClassDefaultObjectType { get; set; } - - public bool? ClassIsForm { get; set; } - - [Column("ClassResourceID")] - public int? ClassResourceId { get; set; } - - [StringLength(400)] - public string? ClassCustomizedColumns { get; set; } - - public string? ClassCodeGenerationSettings { get; set; } - - [StringLength(200)] - public string? ClassIconClass { get; set; } - - public bool? ClassIsContentOnly { get; set; } - - [Column("ClassURLPattern")] - [StringLength(200)] - public string? ClassUrlpattern { get; set; } - - [ForeignKey("ClassDefaultPageTemplateId")] - [InverseProperty("CmsClasses")] - public virtual CmsPageTemplate? ClassDefaultPageTemplate { get; set; } - - [ForeignKey("ClassPageTemplateCategoryId")] - [InverseProperty("CmsClasses")] - public virtual CmsPageTemplateCategory? ClassPageTemplateCategory { get; set; } - - [ForeignKey("ClassResourceId")] - [InverseProperty("CmsClasses")] - public virtual CmsResource? ClassResource { get; set; } - - [InverseProperty("FormClass")] - public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); - - [InverseProperty("FormCoupledClass")] - public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); - - [InverseProperty("FormClass")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("PageTemplateScopeClass")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsPermissions { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsQueries { get; set; } = new List(); - - [InverseProperty("TransformationClass")] - public virtual ICollection CmsTransformations { get; set; } = new List(); - - [InverseProperty("NodeClass")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("VersionClass")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("ScopeClass")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [ForeignKey("ParentClassId")] - [InverseProperty("ParentClasses")] - public virtual ICollection ChildClasses { get; set; } = new List(); - - [ForeignKey("ChildClassId")] - [InverseProperty("ChildClasses")] - public virtual ICollection ParentClasses { get; set; } = new List(); - - [ForeignKey("ClassId")] - [InverseProperty("Classes")] - public virtual ICollection Scopes { get; set; } = new List(); - - [ForeignKey("ClassId")] - [InverseProperty("Classes")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsConsent.cs b/Migration.Toolkit.KX12/Models/CmsConsent.cs deleted file mode 100644 index 3a53ff5c..00000000 --- a/Migration.Toolkit.KX12/Models/CmsConsent.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Consent")] -public class CmsConsent -{ - [Key] - [Column("ConsentID")] - public int ConsentId { get; set; } - - [StringLength(200)] - public string ConsentDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ConsentName { get; set; } = null!; - - public string ConsentContent { get; set; } = null!; - - public Guid ConsentGuid { get; set; } - - public DateTime ConsentLastModified { get; set; } - - [StringLength(100)] - public string ConsentHash { get; set; } = null!; - - [InverseProperty("ConsentAgreementConsent")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [InverseProperty("ConsentArchiveConsent")] - public virtual ICollection CmsConsentArchives { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsConsentAgreement.cs b/Migration.Toolkit.KX12/Models/CmsConsentAgreement.cs deleted file mode 100644 index 641bd286..00000000 --- a/Migration.Toolkit.KX12/Models/CmsConsentAgreement.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ConsentAgreement")] -[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] -public class CmsConsentAgreement -{ - [Key] - [Column("ConsentAgreementID")] - public int ConsentAgreementId { get; set; } - - public Guid ConsentAgreementGuid { get; set; } - - public bool ConsentAgreementRevoked { get; set; } - - [Column("ConsentAgreementContactID")] - public int ConsentAgreementContactId { get; set; } - - [Column("ConsentAgreementConsentID")] - public int ConsentAgreementConsentId { get; set; } - - [StringLength(100)] - public string? ConsentAgreementConsentHash { get; set; } - - public DateTime ConsentAgreementTime { get; set; } - - [ForeignKey("ConsentAgreementConsentId")] - [InverseProperty("CmsConsentAgreements")] - public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; - - [ForeignKey("ConsentAgreementContactId")] - [InverseProperty("CmsConsentAgreements")] - public virtual OmContact ConsentAgreementContact { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsConsentArchive.cs b/Migration.Toolkit.KX12/Models/CmsConsentArchive.cs deleted file mode 100644 index d56348eb..00000000 --- a/Migration.Toolkit.KX12/Models/CmsConsentArchive.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ConsentArchive")] -[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] -public class CmsConsentArchive -{ - [Key] - [Column("ConsentArchiveID")] - public int ConsentArchiveId { get; set; } - - public Guid ConsentArchiveGuid { get; set; } - - public DateTime ConsentArchiveLastModified { get; set; } - - [Column("ConsentArchiveConsentID")] - public int ConsentArchiveConsentId { get; set; } - - [StringLength(100)] - public string ConsentArchiveHash { get; set; } = null!; - - public string ConsentArchiveContent { get; set; } = null!; - - [ForeignKey("ConsentArchiveConsentId")] - [InverseProperty("CmsConsentArchives")] - public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsCountry.cs b/Migration.Toolkit.KX12/Models/CmsCountry.cs deleted file mode 100644 index 0a388c7f..00000000 --- a/Migration.Toolkit.KX12/Models/CmsCountry.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Country")] -public class CmsCountry -{ - [Key] - [Column("CountryID")] - public int CountryId { get; set; } - - [StringLength(200)] - public string CountryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CountryName { get; set; } = null!; - - [Column("CountryGUID")] - public Guid CountryGuid { get; set; } - - public DateTime CountryLastModified { get; set; } - - [StringLength(2)] - public string? CountryTwoLetterCode { get; set; } - - [StringLength(3)] - public string? CountryThreeLetterCode { get; set; } - - [InverseProperty("Country")] - public virtual ICollection CmsStates { get; set; } = new List(); - - [InverseProperty("AddressCountry")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("AddressCountry")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("Country")] - public virtual ICollection ComTaxClassCountries { get; set; } = new List(); - - [InverseProperty("AccountCountry")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactCountry")] - public virtual ICollection OmContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsCssStylesheet.cs b/Migration.Toolkit.KX12/Models/CmsCssStylesheet.cs deleted file mode 100644 index 20235d51..00000000 --- a/Migration.Toolkit.KX12/Models/CmsCssStylesheet.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_CssStylesheet")] -[Index("StylesheetName", Name = "IX_CMS_CssStylesheet_StylesheetName")] -public class CmsCssStylesheet -{ - [Key] - [Column("StylesheetID")] - public int StylesheetId { get; set; } - - [StringLength(200)] - public string StylesheetDisplayName { get; set; } = null!; - - [StringLength(200)] - public string StylesheetName { get; set; } = null!; - - public string? StylesheetText { get; set; } - - [Column("StylesheetVersionGUID")] - public Guid? StylesheetVersionGuid { get; set; } - - [Column("StylesheetGUID")] - public Guid? StylesheetGuid { get; set; } - - public DateTime StylesheetLastModified { get; set; } - - public string? StylesheetDynamicCode { get; set; } - - [StringLength(200)] - public string? StylesheetDynamicLanguage { get; set; } - - [InverseProperty("DocumentStylesheet")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("SiteDefaultEditorStylesheetNavigation")] - public virtual ICollection CmsSiteSiteDefaultEditorStylesheetNavigations { get; set; } = new List(); - - [InverseProperty("SiteDefaultStylesheet")] - public virtual ICollection CmsSiteSiteDefaultStylesheets { get; set; } = new List(); - - [ForeignKey("StylesheetId")] - [InverseProperty("Stylesheets")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsCulture.cs b/Migration.Toolkit.KX12/Models/CmsCulture.cs deleted file mode 100644 index 14814c96..00000000 --- a/Migration.Toolkit.KX12/Models/CmsCulture.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Culture")] -[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] -[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] -public class CmsCulture -{ - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; - - [StringLength(200)] - public string CultureShortName { get; set; } = null!; - - [Column("CultureGUID")] - public Guid CultureGuid { get; set; } - - public DateTime CultureLastModified { get; set; } - - [StringLength(100)] - public string? CultureAlias { get; set; } - - [Column("CultureIsUICulture")] - public bool? CultureIsUiculture { get; set; } - - [InverseProperty("PageTemplateScopeCulture")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("TranslationCulture")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); - - [InverseProperty("Culture")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("ScopeCulture")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [ForeignKey("IndexCultureId")] - [InverseProperty("IndexCultures")] - public virtual ICollection Indices { get; set; } = new List(); - - [ForeignKey("CultureId")] - [InverseProperty("Cultures")] - public virtual ICollection Sites { get; set; } = new List(); - - [ForeignKey("CultureId")] - [InverseProperty("Cultures")] - public virtual ICollection Words { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsDeviceProfile.cs b/Migration.Toolkit.KX12/Models/CmsDeviceProfile.cs deleted file mode 100644 index d33cf7dc..00000000 --- a/Migration.Toolkit.KX12/Models/CmsDeviceProfile.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_DeviceProfile")] -public class CmsDeviceProfile -{ - [Key] - [Column("ProfileID")] - public int ProfileId { get; set; } - - [StringLength(100)] - public string ProfileName { get; set; } = null!; - - [StringLength(200)] - public string ProfileDisplayName { get; set; } = null!; - - public int? ProfileOrder { get; set; } - - public string? ProfileMacro { get; set; } - - public string? ProfileUserAgents { get; set; } - - [Required] - public bool? ProfileEnabled { get; set; } - - public int? ProfilePreviewWidth { get; set; } - - public int? ProfilePreviewHeight { get; set; } - - [Column("ProfileGUID")] - public Guid? ProfileGuid { get; set; } - - public DateTime? ProfileLastModified { get; set; } - - [InverseProperty("DeviceProfile")] - public virtual ICollection CmsDeviceProfileLayouts { get; set; } = new List(); - - [InverseProperty("Profile")] - public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsDeviceProfileLayout.cs b/Migration.Toolkit.KX12/Models/CmsDeviceProfileLayout.cs deleted file mode 100644 index 4c94c56f..00000000 --- a/Migration.Toolkit.KX12/Models/CmsDeviceProfileLayout.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_DeviceProfileLayout")] -[Index("DeviceProfileId", Name = "IX_CMS_DeviceProfileLayout_DeviceProfileID")] -[Index("SourceLayoutId", Name = "IX_CMS_DeviceProfileLayout_SourceLayoutID")] -[Index("TargetLayoutId", Name = "IX_CMS_DeviceProfileLayout_TargetLayoutID")] -public class CmsDeviceProfileLayout -{ - [Key] - [Column("DeviceProfileLayoutID")] - public int DeviceProfileLayoutId { get; set; } - - [Column("DeviceProfileID")] - public int DeviceProfileId { get; set; } - - [Column("SourceLayoutID")] - public int SourceLayoutId { get; set; } - - [Column("TargetLayoutID")] - public int TargetLayoutId { get; set; } - - [Column("DeviceProfileLayoutGUID")] - public Guid DeviceProfileLayoutGuid { get; set; } - - public DateTime DeviceProfileLayoutLastModified { get; set; } - - [ForeignKey("DeviceProfileId")] - [InverseProperty("CmsDeviceProfileLayouts")] - public virtual CmsDeviceProfile DeviceProfile { get; set; } = null!; - - [ForeignKey("SourceLayoutId")] - [InverseProperty("CmsDeviceProfileLayoutSourceLayouts")] - public virtual CmsLayout SourceLayout { get; set; } = null!; - - [ForeignKey("TargetLayoutId")] - [InverseProperty("CmsDeviceProfileLayoutTargetLayouts")] - public virtual CmsLayout TargetLayout { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsDocument.cs b/Migration.Toolkit.KX12/Models/CmsDocument.cs deleted file mode 100644 index a5c56a21..00000000 --- a/Migration.Toolkit.KX12/Models/CmsDocument.cs +++ /dev/null @@ -1,293 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Document")] -[Index("DocumentCheckedOutByUserId", Name = "IX_CMS_Document_DocumentCheckedOutByUserID")] -[Index("DocumentCheckedOutVersionHistoryId", Name = "IX_CMS_Document_DocumentCheckedOutVersionHistoryID")] -[Index("DocumentCreatedByUserId", Name = "IX_CMS_Document_DocumentCreatedByUserID")] -[Index("DocumentCulture", Name = "IX_CMS_Document_DocumentCulture")] -[Index("DocumentForeignKeyValue", "DocumentId", "DocumentNodeId", Name = "IX_CMS_Document_DocumentForeignKeyValue_DocumentID_DocumentNodeID")] -[Index("DocumentModifiedByUserId", Name = "IX_CMS_Document_DocumentModifiedByUserID")] -[Index("DocumentNodeId", "DocumentId", "DocumentCulture", Name = "IX_CMS_Document_DocumentNodeID_DocumentID_DocumentCulture", IsUnique = true)] -[Index("DocumentPageTemplateId", Name = "IX_CMS_Document_DocumentPageTemplateID")] -[Index("DocumentPublishedVersionHistoryId", Name = "IX_CMS_Document_DocumentPublishedVersionHistoryID")] -[Index("DocumentTagGroupId", Name = "IX_CMS_Document_DocumentTagGroupID")] -[Index("DocumentUrlPath", Name = "IX_CMS_Document_DocumentUrlPath_DocumentID_DocumentNodeID")] -[Index("DocumentWildcardRule", "DocumentPriority", Name = "IX_CMS_Document_DocumentWildcardRule_DocumentPriority")] -[Index("DocumentWorkflowStepId", Name = "IX_CMS_Document_DocumentWorkflowStepID")] -public class CmsDocument -{ - [Key] - [Column("DocumentID")] - public int DocumentId { get; set; } - - [StringLength(100)] - public string DocumentName { get; set; } = null!; - - [StringLength(1500)] - public string? DocumentNamePath { get; set; } - - public DateTime? DocumentModifiedWhen { get; set; } - - [Column("DocumentModifiedByUserID")] - public int? DocumentModifiedByUserId { get; set; } - - public int? DocumentForeignKeyValue { get; set; } - - [Column("DocumentCreatedByUserID")] - public int? DocumentCreatedByUserId { get; set; } - - public DateTime? DocumentCreatedWhen { get; set; } - - [Column("DocumentCheckedOutByUserID")] - public int? DocumentCheckedOutByUserId { get; set; } - - public DateTime? DocumentCheckedOutWhen { get; set; } - - [Column("DocumentCheckedOutVersionHistoryID")] - public int? DocumentCheckedOutVersionHistoryId { get; set; } - - [Column("DocumentPublishedVersionHistoryID")] - public int? DocumentPublishedVersionHistoryId { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - public DateTime? DocumentPublishFrom { get; set; } - - public DateTime? DocumentPublishTo { get; set; } - - public string? DocumentUrlPath { get; set; } - - [StringLength(10)] - public string DocumentCulture { get; set; } = null!; - - [Column("DocumentNodeID")] - public int DocumentNodeId { get; set; } - - public string? DocumentPageTitle { get; set; } - - public string? DocumentPageKeyWords { get; set; } - - public string? DocumentPageDescription { get; set; } - - public bool DocumentShowInSiteMap { get; set; } - - public bool DocumentMenuItemHideInNavigation { get; set; } - - [StringLength(200)] - public string? DocumentMenuCaption { get; set; } - - [StringLength(100)] - public string? DocumentMenuStyle { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImage { get; set; } - - [Column("DocumentPageTemplateID")] - public int? DocumentPageTemplateId { get; set; } - - [StringLength(450)] - public string? DocumentMenuJavascript { get; set; } - - [StringLength(450)] - public string? DocumentMenuRedirectUrl { get; set; } - - public bool? DocumentUseNamePathForUrlPath { get; set; } - - [Column("DocumentStylesheetID")] - public int? DocumentStylesheetId { get; set; } - - public string? DocumentContent { get; set; } - - [StringLength(100)] - public string? DocumentMenuClass { get; set; } - - [StringLength(200)] - public string? DocumentMenuStyleHighlighted { get; set; } - - [StringLength(100)] - public string? DocumentMenuClassHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImageHighlighted { get; set; } - - public bool? DocumentMenuItemInactive { get; set; } - - public string? DocumentCustomData { get; set; } - - [StringLength(100)] - public string? DocumentExtensions { get; set; } - - public string? DocumentTags { get; set; } - - [Column("DocumentTagGroupID")] - public int? DocumentTagGroupId { get; set; } - - [StringLength(440)] - public string? DocumentWildcardRule { get; set; } - - public string? DocumentWebParts { get; set; } - - public double? DocumentRatingValue { get; set; } - - public int? DocumentRatings { get; set; } - - public int? DocumentPriority { get; set; } - - [StringLength(50)] - public string? DocumentType { get; set; } - - public DateTime? DocumentLastPublished { get; set; } - - public bool? DocumentUseCustomExtensions { get; set; } - - public string? DocumentGroupWebParts { get; set; } - - public bool? DocumentCheckedOutAutomatically { get; set; } - - [StringLength(200)] - public string? DocumentTrackConversionName { get; set; } - - [StringLength(100)] - public string? DocumentConversionValue { get; set; } - - public bool? DocumentSearchExcluded { get; set; } - - [StringLength(50)] - public string? DocumentLastVersionNumber { get; set; } - - public bool? DocumentIsArchived { get; set; } - - [StringLength(32)] - public string? DocumentHash { get; set; } - - public bool? DocumentLogVisitActivity { get; set; } - - [Column("DocumentGUID")] - public Guid? DocumentGuid { get; set; } - - [Column("DocumentWorkflowCycleGUID")] - public Guid? DocumentWorkflowCycleGuid { get; set; } - - [StringLength(100)] - public string? DocumentSitemapSettings { get; set; } - - public bool? DocumentIsWaitingForTranslation { get; set; } - - [Column("DocumentSKUName")] - [StringLength(440)] - public string? DocumentSkuname { get; set; } - - [Column("DocumentSKUDescription")] - public string? DocumentSkudescription { get; set; } - - [Column("DocumentSKUShortDescription")] - public string? DocumentSkushortDescription { get; set; } - - [StringLength(450)] - public string? DocumentWorkflowActionStatus { get; set; } - - public bool? DocumentMenuRedirectToFirstChild { get; set; } - - [Required] - public bool? DocumentCanBePublished { get; set; } - - [Required] - public bool? DocumentInheritsStylesheet { get; set; } - - public string? DocumentPageBuilderWidgets { get; set; } - - public string? DocumentPageTemplateConfiguration { get; set; } - - [Column("DocumentABTestConfiguration")] - public string? DocumentAbtestConfiguration { get; set; } - - [InverseProperty("CommentPostDocument")] - public virtual ICollection BlogComments { get; set; } = new List(); - - [InverseProperty("SubscriptionPostDocument")] - public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); - - [InverseProperty("BoardDocument")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("AlternativeUrlDocument")] - public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); - - [InverseProperty("AttachmentDocument")] - public virtual ICollection CmsAttachments { get; set; } = new List(); - - [InverseProperty("PersonalizationDocument")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [ForeignKey("DocumentCheckedOutByUserId")] - [InverseProperty("CmsDocumentDocumentCheckedOutByUsers")] - public virtual CmsUser? DocumentCheckedOutByUser { get; set; } - - [ForeignKey("DocumentCheckedOutVersionHistoryId")] - [InverseProperty("CmsDocumentDocumentCheckedOutVersionHistories")] - public virtual CmsVersionHistory? DocumentCheckedOutVersionHistory { get; set; } - - [ForeignKey("DocumentCreatedByUserId")] - [InverseProperty("CmsDocumentDocumentCreatedByUsers")] - public virtual CmsUser? DocumentCreatedByUser { get; set; } - - [ForeignKey("DocumentModifiedByUserId")] - [InverseProperty("CmsDocumentDocumentModifiedByUsers")] - public virtual CmsUser? DocumentModifiedByUser { get; set; } - - [ForeignKey("DocumentNodeId")] - [InverseProperty("CmsDocuments")] - public virtual CmsTree DocumentNode { get; set; } = null!; - - [ForeignKey("DocumentPageTemplateId")] - [InverseProperty("CmsDocuments")] - public virtual CmsPageTemplate? DocumentPageTemplate { get; set; } - - [ForeignKey("DocumentPublishedVersionHistoryId")] - [InverseProperty("CmsDocumentDocumentPublishedVersionHistories")] - public virtual CmsVersionHistory? DocumentPublishedVersionHistory { get; set; } - - [ForeignKey("DocumentStylesheetId")] - [InverseProperty("CmsDocuments")] - public virtual CmsCssStylesheet? DocumentStylesheet { get; set; } - - [ForeignKey("DocumentTagGroupId")] - [InverseProperty("CmsDocuments")] - public virtual CmsTagGroup? DocumentTagGroup { get; set; } - - [ForeignKey("DocumentWorkflowStepId")] - [InverseProperty("CmsDocuments")] - public virtual CmsWorkflowStep? DocumentWorkflowStep { get; set; } - - [InverseProperty("ForumDocument")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [InverseProperty("VariantDocument")] - public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); - - [ForeignKey("DocumentId")] - [InverseProperty("Documents")] - public virtual ICollection Categories { get; set; } = new List(); - - [ForeignKey("DocumentId")] - [InverseProperty("Documents")] - public virtual ICollection Tags { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsDocumentAlias.cs b/Migration.Toolkit.KX12/Models/CmsDocumentAlias.cs deleted file mode 100644 index 72a4bf79..00000000 --- a/Migration.Toolkit.KX12/Models/CmsDocumentAlias.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_DocumentAlias")] -[Index("AliasNodeId", Name = "IX_CMS_DocumentAlias_AliasNodeID")] -[Index("AliasSiteId", Name = "IX_CMS_DocumentAlias_AliasSiteID")] -[Index("AliasWildcardRule", "AliasPriority", Name = "IX_CMS_DocumentAlias_AliasWildcardRule_AliasPriority")] -[Index("AliasCulture", Name = "IX_CMS_Document_AliasCulture")] -public class CmsDocumentAlias -{ - [Key] - [Column("AliasID")] - public int AliasId { get; set; } - - [Column("AliasNodeID")] - public int AliasNodeId { get; set; } - - [StringLength(20)] - public string? AliasCulture { get; set; } - - [Column("AliasURLPath")] - public string? AliasUrlpath { get; set; } - - [StringLength(100)] - public string? AliasExtensions { get; set; } - - [StringLength(440)] - public string? AliasWildcardRule { get; set; } - - public int? AliasPriority { get; set; } - - [Column("AliasGUID")] - public Guid? AliasGuid { get; set; } - - public DateTime AliasLastModified { get; set; } - - [Column("AliasSiteID")] - public int AliasSiteId { get; set; } - - [StringLength(50)] - public string? AliasActionMode { get; set; } - - [ForeignKey("AliasNodeId")] - [InverseProperty("CmsDocumentAliases")] - public virtual CmsTree AliasNode { get; set; } = null!; - - [ForeignKey("AliasSiteId")] - [InverseProperty("CmsDocumentAliases")] - public virtual CmsSite AliasSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsDocumentTypeScope.cs b/Migration.Toolkit.KX12/Models/CmsDocumentTypeScope.cs deleted file mode 100644 index 66f9fdc8..00000000 --- a/Migration.Toolkit.KX12/Models/CmsDocumentTypeScope.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_DocumentTypeScope")] -[Index("ScopeSiteId", Name = "IX_CMS_DocumentTypeScope_ScopeSiteID")] -public class CmsDocumentTypeScope -{ - [Key] - [Column("ScopeID")] - public int ScopeId { get; set; } - - public string ScopePath { get; set; } = null!; - - [Column("ScopeSiteID")] - public int? ScopeSiteId { get; set; } - - public DateTime ScopeLastModified { get; set; } - - [Column("ScopeGUID")] - public Guid? ScopeGuid { get; set; } - - public bool? ScopeIncludeChildren { get; set; } - - public bool? ScopeAllowAllTypes { get; set; } - - public bool? ScopeAllowLinks { get; set; } - - [Column("ScopeAllowABVariant")] - public bool? ScopeAllowAbvariant { get; set; } - - public string? ScopeMacroCondition { get; set; } - - [ForeignKey("ScopeSiteId")] - [InverseProperty("CmsDocumentTypeScopes")] - public virtual CmsSite? ScopeSite { get; set; } - - [ForeignKey("ScopeId")] - [InverseProperty("Scopes")] - public virtual ICollection Classes { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsEmail.cs b/Migration.Toolkit.KX12/Models/CmsEmail.cs deleted file mode 100644 index a5c961b1..00000000 --- a/Migration.Toolkit.KX12/Models/CmsEmail.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Email")] -[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] -public class CmsEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [StringLength(254)] - public string EmailFrom { get; set; } = null!; - - [StringLength(998)] - public string? EmailTo { get; set; } - - [StringLength(998)] - public string? EmailCc { get; set; } - - [StringLength(998)] - public string? EmailBcc { get; set; } - - [StringLength(450)] - public string EmailSubject { get; set; } = null!; - - public string? EmailBody { get; set; } - - public string? EmailPlainTextBody { get; set; } - - public int EmailFormat { get; set; } - - public int EmailPriority { get; set; } - - [Column("EmailSiteID")] - public int? EmailSiteId { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - public DateTime EmailLastModified { get; set; } - - public int? EmailStatus { get; set; } - - public bool? EmailIsMass { get; set; } - - [StringLength(254)] - public string? EmailReplyTo { get; set; } - - public string? EmailHeaders { get; set; } - - public DateTime? EmailCreated { get; set; } - - [InverseProperty("Email")] - public virtual ICollection CmsEmailUsers { get; set; } = new List(); - - [ForeignKey("EmailId")] - [InverseProperty("Emails")] - public virtual ICollection Attachments { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsEmailAttachment.cs b/Migration.Toolkit.KX12/Models/CmsEmailAttachment.cs deleted file mode 100644 index c17bd8d9..00000000 --- a/Migration.Toolkit.KX12/Models/CmsEmailAttachment.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_EmailAttachment")] -public class CmsEmailAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[] AttachmentBinary { get; set; } = null!; - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - [Column("AttachmentContentID")] - [StringLength(255)] - public string? AttachmentContentId { get; set; } - - [Column("AttachmentSiteID")] - public int? AttachmentSiteId { get; set; } - - [ForeignKey("AttachmentId")] - [InverseProperty("Attachments")] - public virtual ICollection Emails { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsEmailTemplate.cs b/Migration.Toolkit.KX12/Models/CmsEmailTemplate.cs deleted file mode 100644 index 8006b6c8..00000000 --- a/Migration.Toolkit.KX12/Models/CmsEmailTemplate.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_EmailTemplate")] -[Index("EmailTemplateName", "EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateName_EmailTemplateSiteID")] -[Index("EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateSiteID")] -public class CmsEmailTemplate -{ - [Key] - [Column("EmailTemplateID")] - public int EmailTemplateId { get; set; } - - [StringLength(200)] - public string EmailTemplateName { get; set; } = null!; - - [StringLength(200)] - public string EmailTemplateDisplayName { get; set; } = null!; - - public string? EmailTemplateText { get; set; } - - [Column("EmailTemplateSiteID")] - public int? EmailTemplateSiteId { get; set; } - - [Column("EmailTemplateGUID")] - public Guid EmailTemplateGuid { get; set; } - - public DateTime EmailTemplateLastModified { get; set; } - - public string? EmailTemplatePlainText { get; set; } - - [StringLength(250)] - public string? EmailTemplateSubject { get; set; } - - [StringLength(254)] - public string? EmailTemplateFrom { get; set; } - - [StringLength(998)] - public string? EmailTemplateCc { get; set; } - - [StringLength(998)] - public string? EmailTemplateBcc { get; set; } - - [StringLength(100)] - public string? EmailTemplateType { get; set; } - - public string? EmailTemplateDescription { get; set; } - - [StringLength(254)] - public string? EmailTemplateReplyTo { get; set; } - - [ForeignKey("EmailTemplateSiteId")] - [InverseProperty("CmsEmailTemplates")] - public virtual CmsSite? EmailTemplateSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsEmailUser.cs b/Migration.Toolkit.KX12/Models/CmsEmailUser.cs deleted file mode 100644 index 53a65c96..00000000 --- a/Migration.Toolkit.KX12/Models/CmsEmailUser.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("EmailId", "UserId")] -[Table("CMS_EmailUser")] -[Index("Status", Name = "IX_CMS_EmailUser_Status")] -[Index("UserId", Name = "IX_CMS_EmailUser_UserID")] -public class CmsEmailUser -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [Key] - [Column("UserID")] - public int UserId { get; set; } - - public string? LastSendResult { get; set; } - - public DateTime? LastSendAttempt { get; set; } - - public int? Status { get; set; } - - [ForeignKey("EmailId")] - [InverseProperty("CmsEmailUsers")] - public virtual CmsEmail Email { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsEmailUsers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsEventLog.cs b/Migration.Toolkit.KX12/Models/CmsEventLog.cs deleted file mode 100644 index 7b0c05c7..00000000 --- a/Migration.Toolkit.KX12/Models/CmsEventLog.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_EventLog")] -[Index("SiteId", Name = "IX_CMS_EventLog_SiteID")] -public class CmsEventLog -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(5)] - public string EventType { get; set; } = null!; - - public DateTime EventTime { get; set; } - - [StringLength(100)] - public string Source { get; set; } = null!; - - [StringLength(100)] - public string EventCode { get; set; } = null!; - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(250)] - public string? UserName { get; set; } - - [Column("IPAddress")] - [StringLength(100)] - public string? Ipaddress { get; set; } - - [Column("NodeID")] - public int? NodeId { get; set; } - - [StringLength(100)] - public string? DocumentName { get; set; } - - public string? EventDescription { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - public string? EventUrl { get; set; } - - [StringLength(100)] - public string? EventMachineName { get; set; } - - public string? EventUserAgent { get; set; } - - public string? EventUrlReferrer { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsExternalLogin.cs b/Migration.Toolkit.KX12/Models/CmsExternalLogin.cs deleted file mode 100644 index 064b9784..00000000 --- a/Migration.Toolkit.KX12/Models/CmsExternalLogin.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ExternalLogin")] -[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] -public class CmsExternalLogin -{ - [Key] - [Column("ExternalLoginID")] - public int ExternalLoginId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(200)] - public string? LoginProvider { get; set; } - - [StringLength(200)] - public string? IdentityKey { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsExternalLogins")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsForm.cs b/Migration.Toolkit.KX12/Models/CmsForm.cs deleted file mode 100644 index 5eef29cf..00000000 --- a/Migration.Toolkit.KX12/Models/CmsForm.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Form")] -[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] -[Index("FormSiteId", Name = "IX_CMS_Form_FormSiteID")] -public class CmsForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(100)] - public string FormName { get; set; } = null!; - - [StringLength(998)] - public string? FormSendToEmail { get; set; } - - [StringLength(254)] - public string? FormSendFromEmail { get; set; } - - [StringLength(250)] - public string? FormEmailSubject { get; set; } - - public string? FormEmailTemplate { get; set; } - - public bool? FormEmailAttachUploadedDocs { get; set; } - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public int FormItems { get; set; } - - public string? FormReportFields { get; set; } - - [StringLength(400)] - public string? FormRedirectToUrl { get; set; } - - public string? FormDisplayText { get; set; } - - public bool FormClearAfterSave { get; set; } - - [StringLength(400)] - public string? FormSubmitButtonText { get; set; } - - [Column("FormSiteID")] - public int FormSiteId { get; set; } - - [StringLength(254)] - public string? FormConfirmationEmailField { get; set; } - - public string? FormConfirmationTemplate { get; set; } - - [StringLength(254)] - public string? FormConfirmationSendFromEmail { get; set; } - - [StringLength(250)] - public string? FormConfirmationEmailSubject { get; set; } - - public int? FormAccess { get; set; } - - [StringLength(255)] - public string? FormSubmitButtonImage { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - public bool? FormLogActivity { get; set; } - - public int FormDevelopmentModel { get; set; } - - public string? FormBuilderLayout { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsForms")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormSiteId")] - [InverseProperty("CmsForms")] - public virtual CmsSite FormSite { get; set; } = null!; - - [ForeignKey("FormId")] - [InverseProperty("Forms")] - public virtual ICollection Roles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsFormUserControl.cs b/Migration.Toolkit.KX12/Models/CmsFormUserControl.cs deleted file mode 100644 index d4acc5a2..00000000 --- a/Migration.Toolkit.KX12/Models/CmsFormUserControl.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_FormUserControl")] -[Index("UserControlCodeName", Name = "IX_CMS_FormUserControl_UserControlCodeName", IsUnique = true)] -[Index("UserControlParentId", Name = "IX_CMS_FormUserControl_UserControlParentID")] -[Index("UserControlResourceId", Name = "IX_CMS_FormUserControl_UserControlResourceID")] -public class CmsFormUserControl -{ - [Key] - [Column("UserControlID")] - public int UserControlId { get; set; } - - [StringLength(200)] - public string UserControlDisplayName { get; set; } = null!; - - [StringLength(200)] - public string UserControlCodeName { get; set; } = null!; - - [StringLength(400)] - public string UserControlFileName { get; set; } = null!; - - public bool UserControlForText { get; set; } - - public bool UserControlForLongText { get; set; } - - public bool UserControlForInteger { get; set; } - - public bool UserControlForDecimal { get; set; } - - public bool UserControlForDateTime { get; set; } - - public bool UserControlForBoolean { get; set; } - - public bool UserControlForFile { get; set; } - - public bool UserControlShowInBizForms { get; set; } - - [StringLength(50)] - public string UserControlDefaultDataType { get; set; } = null!; - - public int? UserControlDefaultDataTypeSize { get; set; } - - public bool? UserControlShowInDocumentTypes { get; set; } - - public bool? UserControlShowInSystemTables { get; set; } - - public bool? UserControlShowInWebParts { get; set; } - - public bool? UserControlShowInReports { get; set; } - - [Column("UserControlGUID")] - public Guid UserControlGuid { get; set; } - - public DateTime UserControlLastModified { get; set; } - - public bool UserControlForGuid { get; set; } - - public bool? UserControlShowInCustomTables { get; set; } - - public bool UserControlForVisibility { get; set; } - - public string? UserControlParameters { get; set; } - - public bool UserControlForDocAttachments { get; set; } - - [Column("UserControlResourceID")] - public int? UserControlResourceId { get; set; } - - public int? UserControlType { get; set; } - - [Column("UserControlParentID")] - public int? UserControlParentId { get; set; } - - public string? UserControlDescription { get; set; } - - [Column("UserControlThumbnailGUID")] - public Guid? UserControlThumbnailGuid { get; set; } - - public int? UserControlPriority { get; set; } - - public bool? UserControlIsSystem { get; set; } - - public bool UserControlForBinary { get; set; } - - public bool UserControlForDocRelationships { get; set; } - - [StringLength(200)] - public string? UserControlAssemblyName { get; set; } - - [StringLength(200)] - public string? UserControlClassName { get; set; } - - [InverseProperty("UserControlParent")] - public virtual ICollection InverseUserControlParent { get; set; } = new List(); - - [ForeignKey("UserControlParentId")] - [InverseProperty("InverseUserControlParent")] - public virtual CmsFormUserControl? UserControlParent { get; set; } - - [ForeignKey("UserControlResourceId")] - [InverseProperty("CmsFormUserControls")] - public virtual CmsResource? UserControlResource { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsHelpTopic.cs b/Migration.Toolkit.KX12/Models/CmsHelpTopic.cs deleted file mode 100644 index 2686bb05..00000000 --- a/Migration.Toolkit.KX12/Models/CmsHelpTopic.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_HelpTopic")] -[Index("HelpTopicUielementId", Name = "IX_CMS_HelpTopic_HelpTopicUIElementID")] -public class CmsHelpTopic -{ - [Key] - [Column("HelpTopicID")] - public int HelpTopicId { get; set; } - - [Column("HelpTopicUIElementID")] - public int HelpTopicUielementId { get; set; } - - [StringLength(200)] - public string HelpTopicName { get; set; } = null!; - - [StringLength(1023)] - public string HelpTopicLink { get; set; } = null!; - - public DateTime HelpTopicLastModified { get; set; } - - [Column("HelpTopicGUID")] - public Guid HelpTopicGuid { get; set; } - - public int? HelpTopicOrder { get; set; } - - public string? HelpTopicVisibilityCondition { get; set; } - - [ForeignKey("HelpTopicUielementId")] - [InverseProperty("CmsHelpTopics")] - public virtual CmsUielement HelpTopicUielement { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsLayout.cs b/Migration.Toolkit.KX12/Models/CmsLayout.cs deleted file mode 100644 index 82e36314..00000000 --- a/Migration.Toolkit.KX12/Models/CmsLayout.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Layout")] -[Index("LayoutDisplayName", Name = "IX_CMS_Layout_LayoutDisplayName")] -public class CmsLayout -{ - [Key] - [Column("LayoutID")] - public int LayoutId { get; set; } - - [StringLength(100)] - public string LayoutCodeName { get; set; } = null!; - - [StringLength(200)] - public string LayoutDisplayName { get; set; } = null!; - - public string? LayoutDescription { get; set; } - - public string LayoutCode { get; set; } = null!; - - [Column("LayoutVersionGUID")] - [StringLength(50)] - public string? LayoutVersionGuid { get; set; } - - [Column("LayoutGUID")] - public Guid LayoutGuid { get; set; } - - public DateTime LayoutLastModified { get; set; } - - [StringLength(50)] - public string? LayoutType { get; set; } - - [Column("LayoutCSS")] - public string? LayoutCss { get; set; } - - [Column("LayoutThumbnailGUID")] - public Guid? LayoutThumbnailGuid { get; set; } - - public int? LayoutZoneCount { get; set; } - - public bool? LayoutIsConvertible { get; set; } - - [StringLength(200)] - public string? LayoutIconClass { get; set; } - - [InverseProperty("SourceLayout")] - public virtual ICollection CmsDeviceProfileLayoutSourceLayouts { get; set; } = new List(); - - [InverseProperty("TargetLayout")] - public virtual ICollection CmsDeviceProfileLayoutTargetLayouts { get; set; } = new List(); - - [InverseProperty("PageTemplateLayoutNavigation")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("Layout")] - public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsLicenseKey.cs b/Migration.Toolkit.KX12/Models/CmsLicenseKey.cs deleted file mode 100644 index 59c2a859..00000000 --- a/Migration.Toolkit.KX12/Models/CmsLicenseKey.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_LicenseKey")] -public class CmsLicenseKey -{ - [Key] - [Column("LicenseKeyID")] - public int LicenseKeyId { get; set; } - - [StringLength(255)] - public string? LicenseDomain { get; set; } - - public string? LicenseKey { get; set; } - - [StringLength(200)] - public string? LicenseEdition { get; set; } - - [StringLength(200)] - public string? LicenseExpiration { get; set; } - - public int? LicenseServers { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsMacroIdentity.cs b/Migration.Toolkit.KX12/Models/CmsMacroIdentity.cs deleted file mode 100644 index 039a0858..00000000 --- a/Migration.Toolkit.KX12/Models/CmsMacroIdentity.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_MacroIdentity")] -[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] -public class CmsMacroIdentity -{ - [Key] - [Column("MacroIdentityID")] - public int MacroIdentityId { get; set; } - - public Guid MacroIdentityGuid { get; set; } - - public DateTime MacroIdentityLastModified { get; set; } - - [StringLength(200)] - public string MacroIdentityName { get; set; } = null!; - - [Column("MacroIdentityEffectiveUserID")] - public int? MacroIdentityEffectiveUserId { get; set; } - - [InverseProperty("UserMacroIdentityMacroIdentity")] - public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); - - [ForeignKey("MacroIdentityEffectiveUserId")] - [InverseProperty("CmsMacroIdentities")] - public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsMacroRule.cs b/Migration.Toolkit.KX12/Models/CmsMacroRule.cs deleted file mode 100644 index 71d0e8d3..00000000 --- a/Migration.Toolkit.KX12/Models/CmsMacroRule.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_MacroRule")] -public class CmsMacroRule -{ - [Key] - [Column("MacroRuleID")] - public int MacroRuleId { get; set; } - - [StringLength(200)] - public string MacroRuleName { get; set; } = null!; - - [StringLength(1000)] - public string MacroRuleText { get; set; } = null!; - - public string? MacroRuleParameters { get; set; } - - [StringLength(100)] - public string? MacroRuleResourceName { get; set; } - - public DateTime MacroRuleLastModified { get; set; } - - [Column("MacroRuleGUID")] - public Guid MacroRuleGuid { get; set; } - - public string MacroRuleCondition { get; set; } = null!; - - [StringLength(500)] - public string MacroRuleDisplayName { get; set; } = null!; - - public bool? MacroRuleIsCustom { get; set; } - - public bool MacroRuleRequiresContext { get; set; } - - [StringLength(450)] - public string? MacroRuleDescription { get; set; } - - [StringLength(2500)] - public string? MacroRuleRequiredData { get; set; } - - public bool? MacroRuleEnabled { get; set; } - - public int? MacroRuleAvailability { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsMembership.cs b/Migration.Toolkit.KX12/Models/CmsMembership.cs deleted file mode 100644 index 5404094e..00000000 --- a/Migration.Toolkit.KX12/Models/CmsMembership.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Membership")] -[Index("MembershipSiteId", Name = "IX_CMS_Membership_MembershipSiteID")] -public class CmsMembership -{ - [Key] - [Column("MembershipID")] - public int MembershipId { get; set; } - - [StringLength(200)] - public string MembershipName { get; set; } = null!; - - [StringLength(200)] - public string MembershipDisplayName { get; set; } = null!; - - public string? MembershipDescription { get; set; } - - public DateTime MembershipLastModified { get; set; } - - [Column("MembershipGUID")] - public Guid MembershipGuid { get; set; } - - [Column("MembershipSiteID")] - public int? MembershipSiteId { get; set; } - - [InverseProperty("Membership")] - public virtual ICollection CmsMembershipUsers { get; set; } = new List(); - - [ForeignKey("MembershipSiteId")] - [InverseProperty("CmsMemberships")] - public virtual CmsSite? MembershipSite { get; set; } - - [ForeignKey("MembershipId")] - [InverseProperty("Memberships")] - public virtual ICollection Roles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsMembershipUser.cs b/Migration.Toolkit.KX12/Models/CmsMembershipUser.cs deleted file mode 100644 index 55b13044..00000000 --- a/Migration.Toolkit.KX12/Models/CmsMembershipUser.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_MembershipUser")] -[Index("MembershipId", "UserId", Name = "IX_CMS_MembershipUser_MembershipID_UserID", IsUnique = true)] -[Index("UserId", Name = "IX_CMS_MembershipUser_UserID")] -public class CmsMembershipUser -{ - [Key] - [Column("MembershipUserID")] - public int MembershipUserId { get; set; } - - [Column("MembershipID")] - public int MembershipId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - public DateTime? ValidTo { get; set; } - - public bool? SendNotification { get; set; } - - [ForeignKey("MembershipId")] - [InverseProperty("CmsMembershipUsers")] - public virtual CmsMembership Membership { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsMembershipUsers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsMetaFile.cs b/Migration.Toolkit.KX12/Models/CmsMetaFile.cs deleted file mode 100644 index 9d17727d..00000000 --- a/Migration.Toolkit.KX12/Models/CmsMetaFile.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_MetaFile")] -[Index("MetaFileGuid", "MetaFileSiteId", "MetaFileObjectType", "MetaFileObjectId", "MetaFileGroupName", Name = "IX_CMS_MetaFile_MetaFileGUID_MetaFileSiteID_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName")] -[Index("MetaFileSiteId", Name = "IX_CMS_MetaFile_MetaFileSiteID")] -public class CmsMetaFile -{ - [Key] - [Column("MetaFileID")] - public int MetaFileId { get; set; } - - [Column("MetaFileObjectID")] - public int MetaFileObjectId { get; set; } - - [StringLength(100)] - public string MetaFileObjectType { get; set; } = null!; - - [StringLength(100)] - public string? MetaFileGroupName { get; set; } - - [StringLength(250)] - public string MetaFileName { get; set; } = null!; - - [StringLength(50)] - public string MetaFileExtension { get; set; } = null!; - - public int MetaFileSize { get; set; } - - [StringLength(100)] - public string MetaFileMimeType { get; set; } = null!; - - public byte[]? MetaFileBinary { get; set; } - - public int? MetaFileImageWidth { get; set; } - - public int? MetaFileImageHeight { get; set; } - - [Column("MetaFileGUID")] - public Guid MetaFileGuid { get; set; } - - public DateTime MetaFileLastModified { get; set; } - - [Column("MetaFileSiteID")] - public int? MetaFileSiteId { get; set; } - - [StringLength(250)] - public string? MetaFileTitle { get; set; } - - public string? MetaFileDescription { get; set; } - - public string? MetaFileCustomData { get; set; } - - [ForeignKey("MetaFileSiteId")] - [InverseProperty("CmsMetaFiles")] - public virtual CmsSite? MetaFileSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsModuleLicenseKey.cs b/Migration.Toolkit.KX12/Models/CmsModuleLicenseKey.cs deleted file mode 100644 index 11d1ebe3..00000000 --- a/Migration.Toolkit.KX12/Models/CmsModuleLicenseKey.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ModuleLicenseKey")] -[Index("ModuleLicenseKeyResourceId", Name = "IX_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID")] -public class CmsModuleLicenseKey -{ - [Key] - [Column("ModuleLicenseKeyID")] - public int ModuleLicenseKeyId { get; set; } - - public Guid ModuleLicenseKeyGuid { get; set; } - - public DateTime ModuleLicenseKeyLastModified { get; set; } - - public string ModuleLicenseKeyLicense { get; set; } = null!; - - [Column("ModuleLicenseKeyResourceID")] - public int ModuleLicenseKeyResourceId { get; set; } - - [ForeignKey("ModuleLicenseKeyResourceId")] - [InverseProperty("CmsModuleLicenseKeys")] - public virtual CmsResource ModuleLicenseKeyResource { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsModuleUsageCounter.cs b/Migration.Toolkit.KX12/Models/CmsModuleUsageCounter.cs deleted file mode 100644 index aeaa0778..00000000 --- a/Migration.Toolkit.KX12/Models/CmsModuleUsageCounter.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -[Table("CMS_ModuleUsageCounter")] -public class CmsModuleUsageCounter -{ - [Column("ModuleUsageCounterID")] - public int ModuleUsageCounterId { get; set; } - - [StringLength(200)] - public string ModuleUsageCounterName { get; set; } = null!; - - public long ModuleUsageCounterValue { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsObjectSetting.cs b/Migration.Toolkit.KX12/Models/CmsObjectSetting.cs deleted file mode 100644 index 7fd7f175..00000000 --- a/Migration.Toolkit.KX12/Models/CmsObjectSetting.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ObjectSettings")] -[Index("ObjectCheckedOutByUserId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutByUserID")] -[Index("ObjectCheckedOutVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID")] -[Index("ObjectPublishedVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectPublishedVersionHistoryID")] -[Index("ObjectSettingsObjectId", "ObjectSettingsObjectType", Name = "IX_CMS_ObjectSettings_ObjectSettingsObjectType_ObjectSettingsObjectID", IsUnique = true)] -[Index("ObjectWorkflowStepId", Name = "IX_CMS_ObjectSettings_ObjectWorkflowStepID")] -public class CmsObjectSetting -{ - [Key] - [Column("ObjectSettingsID")] - public int ObjectSettingsId { get; set; } - - public string? ObjectTags { get; set; } - - [Column("ObjectCheckedOutByUserID")] - public int? ObjectCheckedOutByUserId { get; set; } - - public DateTime? ObjectCheckedOutWhen { get; set; } - - [Column("ObjectCheckedOutVersionHistoryID")] - public int? ObjectCheckedOutVersionHistoryId { get; set; } - - [Column("ObjectWorkflowStepID")] - public int? ObjectWorkflowStepId { get; set; } - - [Column("ObjectPublishedVersionHistoryID")] - public int? ObjectPublishedVersionHistoryId { get; set; } - - [Column("ObjectSettingsObjectID")] - public int ObjectSettingsObjectId { get; set; } - - [StringLength(100)] - public string ObjectSettingsObjectType { get; set; } = null!; - - public string? ObjectComments { get; set; } - - public bool? ObjectWorkflowSendEmails { get; set; } - - [ForeignKey("ObjectCheckedOutByUserId")] - [InverseProperty("CmsObjectSettings")] - public virtual CmsUser? ObjectCheckedOutByUser { get; set; } - - [ForeignKey("ObjectCheckedOutVersionHistoryId")] - [InverseProperty("CmsObjectSettingObjectCheckedOutVersionHistories")] - public virtual CmsObjectVersionHistory? ObjectCheckedOutVersionHistory { get; set; } - - [ForeignKey("ObjectPublishedVersionHistoryId")] - [InverseProperty("CmsObjectSettingObjectPublishedVersionHistories")] - public virtual CmsObjectVersionHistory? ObjectPublishedVersionHistory { get; set; } - - [ForeignKey("ObjectWorkflowStepId")] - [InverseProperty("CmsObjectSettings")] - public virtual CmsWorkflowStep? ObjectWorkflowStep { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsObjectVersionHistory.cs b/Migration.Toolkit.KX12/Models/CmsObjectVersionHistory.cs deleted file mode 100644 index 71727c6d..00000000 --- a/Migration.Toolkit.KX12/Models/CmsObjectVersionHistory.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ObjectVersionHistory")] -[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionModifiedByUserId", Name = "IX_CMS_ObjectVersionHistory_VersionModifiedByUserID")] -[Index("VersionObjectSiteId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectSiteID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionObjectType", "VersionObjectId", "VersionModifiedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectType_VersionObjectID_VersionModifiedWhen", IsDescending = new[] { false, false, true })] -public class CmsObjectVersionHistory -{ - [Key] - [Column("VersionID")] - public int VersionId { get; set; } - - [Column("VersionObjectID")] - public int? VersionObjectId { get; set; } - - [StringLength(100)] - public string VersionObjectType { get; set; } = null!; - - [Column("VersionObjectSiteID")] - public int? VersionObjectSiteId { get; set; } - - [StringLength(450)] - public string VersionObjectDisplayName { get; set; } = null!; - - [Column("VersionXML")] - public string VersionXml { get; set; } = null!; - - [Column("VersionBinaryDataXML")] - public string? VersionBinaryDataXml { get; set; } - - [Column("VersionModifiedByUserID")] - public int? VersionModifiedByUserId { get; set; } - - public DateTime VersionModifiedWhen { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [StringLength(50)] - public string VersionNumber { get; set; } = null!; - - [Column("VersionSiteBindingIDs")] - public string? VersionSiteBindingIds { get; set; } - - public string? VersionComment { get; set; } - - [InverseProperty("ObjectCheckedOutVersionHistory")] - public virtual ICollection CmsObjectSettingObjectCheckedOutVersionHistories { get; set; } = new List(); - - [InverseProperty("ObjectPublishedVersionHistory")] - public virtual ICollection CmsObjectSettingObjectPublishedVersionHistories { get; set; } = new List(); - - [ForeignKey("VersionDeletedByUserId")] - [InverseProperty("CmsObjectVersionHistoryVersionDeletedByUsers")] - public virtual CmsUser? VersionDeletedByUser { get; set; } - - [ForeignKey("VersionModifiedByUserId")] - [InverseProperty("CmsObjectVersionHistoryVersionModifiedByUsers")] - public virtual CmsUser? VersionModifiedByUser { get; set; } - - [ForeignKey("VersionObjectSiteId")] - [InverseProperty("CmsObjectVersionHistories")] - public virtual CmsSite? VersionObjectSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsObjectWorkflowTrigger.cs b/Migration.Toolkit.KX12/Models/CmsObjectWorkflowTrigger.cs deleted file mode 100644 index 0ab21e83..00000000 --- a/Migration.Toolkit.KX12/Models/CmsObjectWorkflowTrigger.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ObjectWorkflowTrigger")] -[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] -public class CmsObjectWorkflowTrigger -{ - [Key] - [Column("TriggerID")] - public int TriggerId { get; set; } - - [Column("TriggerGUID")] - public Guid TriggerGuid { get; set; } - - public DateTime TriggerLastModified { get; set; } - - public int TriggerType { get; set; } - - public string? TriggerMacroCondition { get; set; } - - [Column("TriggerWorkflowID")] - public int TriggerWorkflowId { get; set; } - - [StringLength(450)] - public string TriggerDisplayName { get; set; } = null!; - - [StringLength(100)] - public string TriggerObjectType { get; set; } = null!; - - public string? TriggerParameters { get; set; } - - [StringLength(100)] - public string? TriggerTargetObjectType { get; set; } - - [Column("TriggerTargetObjectID")] - public int? TriggerTargetObjectId { get; set; } - - [ForeignKey("TriggerWorkflowId")] - [InverseProperty("CmsObjectWorkflowTriggers")] - public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsOpenIduser.cs b/Migration.Toolkit.KX12/Models/CmsOpenIduser.cs deleted file mode 100644 index 0b58d415..00000000 --- a/Migration.Toolkit.KX12/Models/CmsOpenIduser.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_OpenIDUser")] -[Index("OpenId", Name = "IX_CMS_OpenIDUser_OpenID")] -[Index("UserId", Name = "IX_CMS_OpenIDUser_UserID")] -public class CmsOpenIduser -{ - [Key] - [Column("OpenIDUserID")] - public int OpenIduserId { get; set; } - - [Column("OpenID")] - public string OpenId { get; set; } = null!; - - [Column("OpenIDProviderURL")] - [StringLength(450)] - public string? OpenIdproviderUrl { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsOpenIdusers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsPageTemplate.cs b/Migration.Toolkit.KX12/Models/CmsPageTemplate.cs deleted file mode 100644 index a7201cb3..00000000 --- a/Migration.Toolkit.KX12/Models/CmsPageTemplate.cs +++ /dev/null @@ -1,135 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_PageTemplate")] -[Index("PageTemplateCodeName", "PageTemplateDisplayName", Name = "IX_CMS_PageTemplate_PageTemplateCodeName_PageTemplateDisplayName")] -[Index("PageTemplateIsReusable", "PageTemplateForAllPages", "PageTemplateShowAsMasterTemplate", Name = "IX_CMS_PageTemplate_PageTemplateIsReusable_PageTemplateForAllPages_PageTemplateShowAsMasterTemplate")] -[Index("PageTemplateLayoutId", Name = "IX_CMS_PageTemplate_PageTemplateLayoutID")] -[Index("PageTemplateSiteId", "PageTemplateCodeName", "PageTemplateGuid", Name = "IX_CMS_PageTemplate_PageTemplateSiteID_PageTemplateCodeName_PageTemplateGUID")] -public class CmsPageTemplate -{ - [Key] - [Column("PageTemplateID")] - public int PageTemplateId { get; set; } - - [StringLength(200)] - public string PageTemplateDisplayName { get; set; } = null!; - - [StringLength(100)] - public string PageTemplateCodeName { get; set; } = null!; - - public string? PageTemplateDescription { get; set; } - - [StringLength(400)] - public string? PageTemplateFile { get; set; } - - [Column("PageTemplateCategoryID")] - public int? PageTemplateCategoryId { get; set; } - - [Column("PageTemplateLayoutID")] - public int? PageTemplateLayoutId { get; set; } - - public string? PageTemplateWebParts { get; set; } - - public bool? PageTemplateIsReusable { get; set; } - - public bool? PageTemplateShowAsMasterTemplate { get; set; } - - [StringLength(200)] - public string? PageTemplateInheritPageLevels { get; set; } - - public string? PageTemplateLayout { get; set; } - - [Column("PageTemplateVersionGUID")] - [StringLength(200)] - public string? PageTemplateVersionGuid { get; set; } - - public string? PageTemplateHeader { get; set; } - - [Column("PageTemplateGUID")] - public Guid PageTemplateGuid { get; set; } - - public DateTime PageTemplateLastModified { get; set; } - - [Column("PageTemplateSiteID")] - public int? PageTemplateSiteId { get; set; } - - public bool? PageTemplateForAllPages { get; set; } - - [StringLength(10)] - public string PageTemplateType { get; set; } = null!; - - [StringLength(50)] - public string? PageTemplateLayoutType { get; set; } - - [Column("PageTemplateCSS")] - public string? PageTemplateCss { get; set; } - - public bool? PageTemplateIsAllowedForProductSection { get; set; } - - public bool? PageTemplateInheritParentHeader { get; set; } - - public bool? PageTemplateAllowInheritHeader { get; set; } - - [Column("PageTemplateThumbnailGUID")] - public Guid? PageTemplateThumbnailGuid { get; set; } - - public bool? PageTemplateCloneAsAdHoc { get; set; } - - [Column("PageTemplateNodeGUID")] - public Guid? PageTemplateNodeGuid { get; set; } - - [Column("PageTemplateMasterPageTemplateID")] - public int? PageTemplateMasterPageTemplateId { get; set; } - - public string? PageTemplateProperties { get; set; } - - public bool? PageTemplateIsLayout { get; set; } - - [StringLength(200)] - public string? PageTemplateIconClass { get; set; } - - [InverseProperty("ClassDefaultPageTemplate")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("DocumentPageTemplate")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("PageTemplateScopeTemplate")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("PageTemplate")] - public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); - - [InverseProperty("NodeTemplate")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("ElementPageTemplate")] - public virtual ICollection CmsUielements { get; set; } = new List(); - - [InverseProperty("MvtvariantPageTemplate")] - public virtual ICollection OmMvtvariants { get; set; } = new List(); - - [InverseProperty("VariantPageTemplate")] - public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); - - [ForeignKey("PageTemplateCategoryId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsPageTemplateCategory? PageTemplateCategory { get; set; } - - [ForeignKey("PageTemplateLayoutId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsLayout? PageTemplateLayoutNavigation { get; set; } - - [ForeignKey("PageTemplateSiteId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsSite? PageTemplateSite { get; set; } - - [ForeignKey("PageTemplateId")] - [InverseProperty("PageTemplates")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsPageTemplateCategory.cs b/Migration.Toolkit.KX12/Models/CmsPageTemplateCategory.cs deleted file mode 100644 index f829034e..00000000 --- a/Migration.Toolkit.KX12/Models/CmsPageTemplateCategory.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_PageTemplateCategory")] -[Index("CategoryLevel", Name = "IX_CMS_PageTemplateCategory_CategoryLevel")] -[Index("CategoryParentId", Name = "IX_CMS_PageTemplateCategory_CategoryParentID")] -public class CmsPageTemplateCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(200)] - public string? CategoryName { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryTemplateChildCount { get; set; } - - public string? CategoryPath { get; set; } - - public int? CategoryLevel { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsPageTemplateCategory? CategoryParent { get; set; } - - [InverseProperty("ClassPageTemplateCategory")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("PageTemplateCategory")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsPageTemplateConfiguration.cs b/Migration.Toolkit.KX12/Models/CmsPageTemplateConfiguration.cs deleted file mode 100644 index a9a24a65..00000000 --- a/Migration.Toolkit.KX12/Models/CmsPageTemplateConfiguration.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_PageTemplateConfiguration")] -[Index("PageTemplateConfigurationSiteId", Name = "IX_CMS_PageTemplateConfiguration_PageTemplateConfigurationSiteID")] -public class CmsPageTemplateConfiguration -{ - [Key] - [Column("PageTemplateConfigurationID")] - public int PageTemplateConfigurationId { get; set; } - - [Column("PageTemplateConfigurationGUID")] - public Guid PageTemplateConfigurationGuid { get; set; } - - [Column("PageTemplateConfigurationSiteID")] - public int PageTemplateConfigurationSiteId { get; set; } - - public DateTime PageTemplateConfigurationLastModified { get; set; } - - [StringLength(200)] - public string PageTemplateConfigurationName { get; set; } = null!; - - public string? PageTemplateConfigurationDescription { get; set; } - - [Column("PageTemplateConfigurationThumbnailGUID")] - public Guid? PageTemplateConfigurationThumbnailGuid { get; set; } - - public string PageTemplateConfigurationTemplate { get; set; } = null!; - - public string? PageTemplateConfigurationWidgets { get; set; } - - [ForeignKey("PageTemplateConfigurationSiteId")] - [InverseProperty("CmsPageTemplateConfigurations")] - public virtual CmsSite PageTemplateConfigurationSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsPageTemplateScope.cs b/Migration.Toolkit.KX12/Models/CmsPageTemplateScope.cs deleted file mode 100644 index 68cbab30..00000000 --- a/Migration.Toolkit.KX12/Models/CmsPageTemplateScope.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_PageTemplateScope")] -[Index("PageTemplateScopeClassId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeClassID")] -[Index("PageTemplateScopeCultureId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeCultureID")] -[Index("PageTemplateScopeLevels", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeLevels")] -[Index("PageTemplateScopeSiteId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeSiteID")] -[Index("PageTemplateScopeTemplateId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeTemplateID")] -public class CmsPageTemplateScope -{ - [Key] - [Column("PageTemplateScopeID")] - public int PageTemplateScopeId { get; set; } - - public string PageTemplateScopePath { get; set; } = null!; - - public string? PageTemplateScopeLevels { get; set; } - - [Column("PageTemplateScopeCultureID")] - public int? PageTemplateScopeCultureId { get; set; } - - [Column("PageTemplateScopeClassID")] - public int? PageTemplateScopeClassId { get; set; } - - [Column("PageTemplateScopeTemplateID")] - public int PageTemplateScopeTemplateId { get; set; } - - [Column("PageTemplateScopeSiteID")] - public int? PageTemplateScopeSiteId { get; set; } - - public DateTime PageTemplateScopeLastModified { get; set; } - - [Column("PageTemplateScopeGUID")] - public Guid PageTemplateScopeGuid { get; set; } - - [ForeignKey("PageTemplateScopeClassId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsClass? PageTemplateScopeClass { get; set; } - - [ForeignKey("PageTemplateScopeCultureId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsCulture? PageTemplateScopeCulture { get; set; } - - [ForeignKey("PageTemplateScopeSiteId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsSite? PageTemplateScopeSite { get; set; } - - [ForeignKey("PageTemplateScopeTemplateId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsPageTemplate PageTemplateScopeTemplate { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsPermission.cs b/Migration.Toolkit.KX12/Models/CmsPermission.cs deleted file mode 100644 index ca3d9537..00000000 --- a/Migration.Toolkit.KX12/Models/CmsPermission.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Permission")] -[Index("ClassId", "PermissionName", Name = "IX_CMS_Permission_ClassID_PermissionName")] -[Index("ResourceId", "PermissionName", Name = "IX_CMS_Permission_ResourceID_PermissionName")] -public class CmsPermission -{ - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [StringLength(100)] - public string PermissionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string PermissionName { get; set; } = null!; - - [Column("ClassID")] - public int? ClassId { get; set; } - - [Column("ResourceID")] - public int? ResourceId { get; set; } - - [Column("PermissionGUID")] - public Guid PermissionGuid { get; set; } - - public DateTime PermissionLastModified { get; set; } - - public string? PermissionDescription { get; set; } - - public bool? PermissionDisplayInMatrix { get; set; } - - public int? PermissionOrder { get; set; } - - public bool? PermissionEditableByGlobalAdmin { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsPermissions")] - public virtual CmsClass? Class { get; set; } - - [InverseProperty("Permission")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection ForumsForumRoles { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); - - [ForeignKey("ResourceId")] - [InverseProperty("CmsPermissions")] - public virtual CmsResource? Resource { get; set; } - - [ForeignKey("PermissionId")] - [InverseProperty("Permissions")] - public virtual ICollection Roles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsPersonalization.cs b/Migration.Toolkit.KX12/Models/CmsPersonalization.cs deleted file mode 100644 index 4806b696..00000000 --- a/Migration.Toolkit.KX12/Models/CmsPersonalization.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Personalization")] -[Index("PersonalizationId", "PersonalizationUserId", "PersonalizationDocumentId", "PersonalizationDashboardName", Name = "IX_CMS_Personalization_PersonalizationID_PersonalizationUserID_PersonalizationDocumentID_PersonalizationDashboardName", - IsUnique = true)] -[Index("PersonalizationSiteId", Name = "IX_CMS_Personalization_PersonalizationSiteID_SiteID")] -[Index("PersonalizationUserId", Name = "IX_CMS_Personalization_PersonalizationUserID")] -public class CmsPersonalization -{ - [Key] - [Column("PersonalizationID")] - public int PersonalizationId { get; set; } - - [Column("PersonalizationGUID")] - public Guid PersonalizationGuid { get; set; } - - public DateTime PersonalizationLastModified { get; set; } - - [Column("PersonalizationUserID")] - public int? PersonalizationUserId { get; set; } - - [Column("PersonalizationDocumentID")] - public int? PersonalizationDocumentId { get; set; } - - public string? PersonalizationWebParts { get; set; } - - [StringLength(200)] - public string? PersonalizationDashboardName { get; set; } - - [Column("PersonalizationSiteID")] - public int? PersonalizationSiteId { get; set; } - - [ForeignKey("PersonalizationDocumentId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsDocument? PersonalizationDocument { get; set; } - - [ForeignKey("PersonalizationSiteId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsSite? PersonalizationSite { get; set; } - - [ForeignKey("PersonalizationUserId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsUser? PersonalizationUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsQuery.cs b/Migration.Toolkit.KX12/Models/CmsQuery.cs deleted file mode 100644 index b7d28199..00000000 --- a/Migration.Toolkit.KX12/Models/CmsQuery.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Query")] -[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] -public class CmsQuery -{ - [Key] - [Column("QueryID")] - public int QueryId { get; set; } - - [StringLength(100)] - public string QueryName { get; set; } = null!; - - [Column("QueryTypeID")] - public int QueryTypeId { get; set; } - - public string QueryText { get; set; } = null!; - - public bool QueryRequiresTransaction { get; set; } - - [Column("ClassID")] - public int? ClassId { get; set; } - - public bool QueryIsLocked { get; set; } - - public DateTime QueryLastModified { get; set; } - - [Column("QueryGUID")] - public Guid QueryGuid { get; set; } - - public bool? QueryIsCustom { get; set; } - - [StringLength(100)] - public string? QueryConnectionString { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsQueries")] - public virtual CmsClass? Class { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsRelationship.cs b/Migration.Toolkit.KX12/Models/CmsRelationship.cs deleted file mode 100644 index 9d7de1f5..00000000 --- a/Migration.Toolkit.KX12/Models/CmsRelationship.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Relationship")] -[Index("LeftNodeId", Name = "IX_CMS_Relationship_LeftNodeID")] -[Index("RelationshipNameId", Name = "IX_CMS_Relationship_RelationshipNameID")] -[Index("RightNodeId", Name = "IX_CMS_Relationship_RightNodeID")] -public class CmsRelationship -{ - [Key] - [Column("RelationshipID")] - public int RelationshipId { get; set; } - - [Column("LeftNodeID")] - public int LeftNodeId { get; set; } - - [Column("RightNodeID")] - public int RightNodeId { get; set; } - - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - public string? RelationshipCustomData { get; set; } - - public int? RelationshipOrder { get; set; } - - public bool? RelationshipIsAdHoc { get; set; } - - [ForeignKey("LeftNodeId")] - [InverseProperty("CmsRelationshipLeftNodes")] - public virtual CmsTree LeftNode { get; set; } = null!; - - [ForeignKey("RelationshipNameId")] - [InverseProperty("CmsRelationships")] - public virtual CmsRelationshipName RelationshipName { get; set; } = null!; - - [ForeignKey("RightNodeId")] - [InverseProperty("CmsRelationshipRightNodes")] - public virtual CmsTree RightNode { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsRelationshipName.cs b/Migration.Toolkit.KX12/Models/CmsRelationshipName.cs deleted file mode 100644 index 21dee9dd..00000000 --- a/Migration.Toolkit.KX12/Models/CmsRelationshipName.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_RelationshipName")] -[Index("RelationshipAllowedObjects", Name = "IX_CMS_RelationshipName_RelationshipAllowedObjects")] -[Index("RelationshipName", "RelationshipDisplayName", Name = "IX_CMS_RelationshipName_RelationshipName_RelationshipDisplayName")] -public class CmsRelationshipName -{ - [Key] - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - [StringLength(200)] - public string RelationshipDisplayName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipName { get; set; } = null!; - - public string? RelationshipAllowedObjects { get; set; } - - [Column("RelationshipGUID")] - public Guid RelationshipGuid { get; set; } - - public DateTime RelationshipLastModified { get; set; } - - public bool? RelationshipNameIsAdHoc { get; set; } - - [InverseProperty("RelationshipName")] - public virtual ICollection CmsRelationships { get; set; } = new List(); - - [ForeignKey("RelationshipNameId")] - [InverseProperty("RelationshipNames")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsResource.cs b/Migration.Toolkit.KX12/Models/CmsResource.cs deleted file mode 100644 index c479b411..00000000 --- a/Migration.Toolkit.KX12/Models/CmsResource.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Resource")] -[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] -public class CmsResource -{ - [Key] - [Column("ResourceID")] - public int ResourceId { get; set; } - - [StringLength(100)] - public string ResourceDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - public string? ResourceDescription { get; set; } - - public bool? ShowInDevelopment { get; set; } - - [Column("ResourceURL")] - [StringLength(1000)] - public string? ResourceUrl { get; set; } - - [Column("ResourceGUID")] - public Guid ResourceGuid { get; set; } - - public DateTime ResourceLastModified { get; set; } - - public bool? ResourceIsInDevelopment { get; set; } - - public bool? ResourceHasFiles { get; set; } - - [StringLength(200)] - public string? ResourceVersion { get; set; } - - [StringLength(200)] - public string? ResourceAuthor { get; set; } - - [StringLength(50)] - public string? ResourceInstallationState { get; set; } - - [StringLength(50)] - public string? ResourceInstalledVersion { get; set; } - - [InverseProperty("ClassResource")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("UserControlResource")] - public virtual ICollection CmsFormUserControls { get; set; } = new List(); - - [InverseProperty("ModuleLicenseKeyResource")] - public virtual ICollection CmsModuleLicenseKeys { get; set; } = new List(); - - [InverseProperty("Resource")] - public virtual ICollection CmsPermissions { get; set; } = new List(); - - [InverseProperty("ResourceLibraryResource")] - public virtual ICollection CmsResourceLibraries { get; set; } = new List(); - - [InverseProperty("TaskResource")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("CategoryResource")] - public virtual ICollection CmsSettingsCategories { get; set; } = new List(); - - [InverseProperty("ElementResource")] - public virtual ICollection CmsUielements { get; set; } = new List(); - - [InverseProperty("WebPartResource")] - public virtual ICollection CmsWebParts { get; set; } = new List(); - - [InverseProperty("ActionResource")] - public virtual ICollection CmsWorkflowActions { get; set; } = new List(); - - [ForeignKey("ResourceId")] - [InverseProperty("Resources")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsResourceLibrary.cs b/Migration.Toolkit.KX12/Models/CmsResourceLibrary.cs deleted file mode 100644 index dd90f9d1..00000000 --- a/Migration.Toolkit.KX12/Models/CmsResourceLibrary.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ResourceLibrary")] -[Index("ResourceLibraryResourceId", Name = "IX_CMS_ResourceLibrary")] -public class CmsResourceLibrary -{ - [Key] - [Column("ResourceLibraryID")] - public int ResourceLibraryId { get; set; } - - [Column("ResourceLibraryResourceID")] - public int ResourceLibraryResourceId { get; set; } - - [StringLength(200)] - public string ResourceLibraryPath { get; set; } = null!; - - [ForeignKey("ResourceLibraryResourceId")] - [InverseProperty("CmsResourceLibraries")] - public virtual CmsResource ResourceLibraryResource { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsResourceString.cs b/Migration.Toolkit.KX12/Models/CmsResourceString.cs deleted file mode 100644 index 1453437b..00000000 --- a/Migration.Toolkit.KX12/Models/CmsResourceString.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ResourceString")] -[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] -public class CmsResourceString -{ - [Key] - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("StringGUID")] - public Guid StringGuid { get; set; } - - [InverseProperty("TranslationString")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsResourceTranslation.cs b/Migration.Toolkit.KX12/Models/CmsResourceTranslation.cs deleted file mode 100644 index 491ae5d3..00000000 --- a/Migration.Toolkit.KX12/Models/CmsResourceTranslation.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ResourceTranslation")] -[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] -[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] -public class CmsResourceTranslation -{ - [Key] - [Column("TranslationID")] - public int TranslationId { get; set; } - - [Column("TranslationStringID")] - public int TranslationStringId { get; set; } - - public string? TranslationText { get; set; } - - [Column("TranslationCultureID")] - public int TranslationCultureId { get; set; } - - [ForeignKey("TranslationCultureId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsCulture TranslationCulture { get; set; } = null!; - - [ForeignKey("TranslationStringId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsResourceString TranslationString { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsRole.cs b/Migration.Toolkit.KX12/Models/CmsRole.cs deleted file mode 100644 index e6e2ba1a..00000000 --- a/Migration.Toolkit.KX12/Models/CmsRole.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Role")] -[Index("RoleGroupId", Name = "IX_CMS_Role_RoleGroupID")] -[Index("SiteId", "RoleId", Name = "IX_CMS_Role_SiteID_RoleID")] -[Index("SiteId", "RoleName", "RoleGroupId", Name = "IX_CMS_Role_SiteID_RoleName_RoleGroupID", IsUnique = true)] -public class CmsRole -{ - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - public DateTime RoleLastModified { get; set; } - - [Column("RoleGroupID")] - public int? RoleGroupId { get; set; } - - public bool? RoleIsGroupAdministrator { get; set; } - - public bool? RoleIsDomain { get; set; } - - [InverseProperty("Role")] - public virtual ICollection CmsAclitems { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection ForumsForumRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); - - [ForeignKey("RoleGroupId")] - [InverseProperty("CmsRoles")] - public virtual CommunityGroup? RoleGroup { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsRoles")] - public virtual CmsSite? Site { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Boards { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Elements { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("RolesNavigation")] - public virtual ICollection ElementsNavigation { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Forms { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Memberships { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Permissions { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Polls { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsScheduledTask.cs b/Migration.Toolkit.KX12/Models/CmsScheduledTask.cs deleted file mode 100644 index c9f3da6a..00000000 --- a/Migration.Toolkit.KX12/Models/CmsScheduledTask.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ScheduledTask")] -[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] -[Index("TaskResourceId", Name = "IX_CMS_ScheduledTask_TaskResourceID")] -[Index("TaskSiteId", "TaskDisplayName", Name = "IX_CMS_ScheduledTask_TaskSiteID_TaskDisplayName")] -[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] -public class CmsScheduledTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(200)] - public string TaskName { get; set; } = null!; - - [StringLength(200)] - public string TaskDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TaskAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string? TaskClass { get; set; } - - [StringLength(1000)] - public string TaskInterval { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime? TaskLastRunTime { get; set; } - - public DateTime? TaskNextRunTime { get; set; } - - public string? TaskLastResult { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - public bool? TaskDeleteAfterLastRun { get; set; } - - [StringLength(100)] - public string? TaskServerName { get; set; } - - [Column("TaskGUID")] - public Guid TaskGuid { get; set; } - - public DateTime TaskLastModified { get; set; } - - public int? TaskExecutions { get; set; } - - [Column("TaskResourceID")] - public int? TaskResourceId { get; set; } - - public bool? TaskRunInSeparateThread { get; set; } - - public bool? TaskUseExternalService { get; set; } - - public bool? TaskAllowExternalService { get; set; } - - public DateTime? TaskLastExecutionReset { get; set; } - - [StringLength(400)] - public string? TaskCondition { get; set; } - - public bool? TaskRunIndividually { get; set; } - - [Column("TaskUserID")] - public int? TaskUserId { get; set; } - - public int? TaskType { get; set; } - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [StringLength(200)] - public string? TaskExecutingServerName { get; set; } - - public bool TaskEnabled { get; set; } - - public bool TaskIsRunning { get; set; } - - [InverseProperty("CampaignScheduledTask")] - public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); - - [InverseProperty("TestWinnerScheduledTask")] - public virtual ICollection NewsletterAbtests { get; set; } = new List(); - - [InverseProperty("NewsletterDynamicScheduledTask")] - public virtual ICollection NewsletterNewsletters { get; set; } = new List(); - - [ForeignKey("TaskResourceId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsResource? TaskResource { get; set; } - - [ForeignKey("TaskSiteId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsSite? TaskSite { get; set; } - - [ForeignKey("TaskUserId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsUser? TaskUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsSearchEngine.cs b/Migration.Toolkit.KX12/Models/CmsSearchEngine.cs deleted file mode 100644 index 59269d3d..00000000 --- a/Migration.Toolkit.KX12/Models/CmsSearchEngine.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SearchEngine")] -public class CmsSearchEngine -{ - [Key] - [Column("SearchEngineID")] - public int SearchEngineId { get; set; } - - [StringLength(200)] - public string SearchEngineDisplayName { get; set; } = null!; - - [StringLength(200)] - public string SearchEngineName { get; set; } = null!; - - [StringLength(450)] - public string SearchEngineDomainRule { get; set; } = null!; - - [StringLength(200)] - public string? SearchEngineKeywordParameter { get; set; } - - [Column("SearchEngineGUID")] - public Guid SearchEngineGuid { get; set; } - - public DateTime SearchEngineLastModified { get; set; } - - [StringLength(200)] - public string? SearchEngineCrawler { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsSearchIndex.cs b/Migration.Toolkit.KX12/Models/CmsSearchIndex.cs deleted file mode 100644 index 62749e36..00000000 --- a/Migration.Toolkit.KX12/Models/CmsSearchIndex.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SearchIndex")] -public class CmsSearchIndex -{ - [Key] - [Column("IndexID")] - public int IndexId { get; set; } - - [StringLength(200)] - public string IndexName { get; set; } = null!; - - [StringLength(200)] - public string IndexDisplayName { get; set; } = null!; - - [StringLength(200)] - public string? IndexAnalyzerType { get; set; } - - public bool IndexIsCommunityGroup { get; set; } - - public string? IndexSettings { get; set; } - - [Column("IndexGUID")] - public Guid IndexGuid { get; set; } - - public DateTime IndexLastModified { get; set; } - - public DateTime? IndexLastRebuildTime { get; set; } - - [StringLength(200)] - public string IndexType { get; set; } = null!; - - [StringLength(200)] - public string? IndexStopWordsFile { get; set; } - - [StringLength(200)] - public string? IndexCustomAnalyzerAssemblyName { get; set; } - - [StringLength(200)] - public string? IndexCustomAnalyzerClassName { get; set; } - - public int? IndexBatchSize { get; set; } - - [StringLength(10)] - public string? IndexStatus { get; set; } - - public DateTime? IndexLastUpdate { get; set; } - - [StringLength(200)] - public string? IndexCrawlerUserName { get; set; } - - [StringLength(200)] - public string? IndexCrawlerFormsUserName { get; set; } - - [StringLength(200)] - public string? IndexCrawlerUserPassword { get; set; } - - [StringLength(200)] - public string? IndexCrawlerDomain { get; set; } - - public bool? IndexIsOutdated { get; set; } - - [StringLength(200)] - public string IndexProvider { get; set; } = null!; - - [StringLength(200)] - public string? IndexSearchServiceName { get; set; } - - [StringLength(200)] - public string? IndexAdminKey { get; set; } - - [StringLength(200)] - public string? IndexQueryKey { get; set; } - - [ForeignKey("IndexId")] - [InverseProperty("Indices")] - public virtual ICollection IndexCultures { get; set; } = new List(); - - [ForeignKey("IndexId")] - [InverseProperty("Indices")] - public virtual ICollection IndexSites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsSearchTask.cs b/Migration.Toolkit.KX12/Models/CmsSearchTask.cs deleted file mode 100644 index 2dfc1854..00000000 --- a/Migration.Toolkit.KX12/Models/CmsSearchTask.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SearchTask")] -public class CmsSearchTask -{ - [Key] - [Column("SearchTaskID")] - public int SearchTaskId { get; set; } - - [StringLength(100)] - public string SearchTaskType { get; set; } = null!; - - [StringLength(100)] - public string? SearchTaskObjectType { get; set; } - - [StringLength(200)] - public string? SearchTaskField { get; set; } - - [StringLength(600)] - public string SearchTaskValue { get; set; } = null!; - - [StringLength(200)] - public string? SearchTaskServerName { get; set; } - - [StringLength(100)] - public string SearchTaskStatus { get; set; } = null!; - - public int SearchTaskPriority { get; set; } - - public DateTime SearchTaskCreated { get; set; } - - public string? SearchTaskErrorMessage { get; set; } - - [Column("SearchTaskRelatedObjectID")] - public int? SearchTaskRelatedObjectId { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsSearchTaskAzure.cs b/Migration.Toolkit.KX12/Models/CmsSearchTaskAzure.cs deleted file mode 100644 index cd2209f9..00000000 --- a/Migration.Toolkit.KX12/Models/CmsSearchTaskAzure.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SearchTaskAzure")] -[Index("SearchTaskAzurePriority", Name = "IX_CMS_SearchTaskAzure_SearchTaskAzurePriority", AllDescending = true)] -public class CmsSearchTaskAzure -{ - [Key] - [Column("SearchTaskAzureID")] - public int SearchTaskAzureId { get; set; } - - [StringLength(100)] - public string SearchTaskAzureType { get; set; } = null!; - - [StringLength(100)] - public string? SearchTaskAzureObjectType { get; set; } - - [StringLength(200)] - public string? SearchTaskAzureMetadata { get; set; } - - [StringLength(600)] - public string SearchTaskAzureAdditionalData { get; set; } = null!; - - [Column("SearchTaskAzureInitiatorObjectID")] - public int? SearchTaskAzureInitiatorObjectId { get; set; } - - public int SearchTaskAzurePriority { get; set; } - - public string? SearchTaskAzureErrorMessage { get; set; } - - public DateTime SearchTaskAzureCreated { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsSession.cs b/Migration.Toolkit.KX12/Models/CmsSession.cs deleted file mode 100644 index 98b28756..00000000 --- a/Migration.Toolkit.KX12/Models/CmsSession.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Session")] -[Index("SessionIdentificator", Name = "IX_CMS_Session_SessionIdentificator", IsUnique = true)] -[Index("SessionSiteId", Name = "IX_CMS_Session_SessionSiteID")] -[Index("SessionUserId", Name = "IX_CMS_Session_SessionUserID")] -[Index("SessionUserIsHidden", Name = "IX_CMS_Session_SessionUserIsHidden")] -public class CmsSession -{ - [StringLength(50)] - public string SessionIdentificator { get; set; } = null!; - - [Column("SessionUserID")] - public int? SessionUserId { get; set; } - - [StringLength(450)] - public string? SessionLocation { get; set; } - - public DateTime SessionLastActive { get; set; } - - public DateTime? SessionLastLogon { get; set; } - - public DateTime SessionExpires { get; set; } - - public bool SessionExpired { get; set; } - - [Column("SessionSiteID")] - public int? SessionSiteId { get; set; } - - public bool SessionUserIsHidden { get; set; } - - [StringLength(450)] - public string? SessionFullName { get; set; } - - [StringLength(254)] - public string? SessionEmail { get; set; } - - [StringLength(254)] - public string? SessionUserName { get; set; } - - [StringLength(254)] - public string? SessionNickName { get; set; } - - public DateTime? SessionUserCreated { get; set; } - - [Column("SessionContactID")] - public int? SessionContactId { get; set; } - - [Key] - [Column("SessionID")] - public int SessionId { get; set; } - - [ForeignKey("SessionSiteId")] - [InverseProperty("CmsSessions")] - public virtual CmsSite? SessionSite { get; set; } - - [ForeignKey("SessionUserId")] - [InverseProperty("CmsSessions")] - public virtual CmsUser? SessionUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsSettingsCategory.cs b/Migration.Toolkit.KX12/Models/CmsSettingsCategory.cs deleted file mode 100644 index 95c70713..00000000 --- a/Migration.Toolkit.KX12/Models/CmsSettingsCategory.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SettingsCategory")] -[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] -[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] -public class CmsSettingsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - public int? CategoryOrder { get; set; } - - [StringLength(100)] - public string? CategoryName { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - [StringLength(200)] - public string? CategoryIconPath { get; set; } - - public bool? CategoryIsGroup { get; set; } - - public bool? CategoryIsCustom { get; set; } - - [Column("CategoryResourceID")] - public int? CategoryResourceId { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsSettingsCategory? CategoryParent { get; set; } - - [ForeignKey("CategoryResourceId")] - [InverseProperty("CmsSettingsCategories")] - public virtual CmsResource? CategoryResource { get; set; } - - [InverseProperty("KeyCategory")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsSettingsKey.cs b/Migration.Toolkit.KX12/Models/CmsSettingsKey.cs deleted file mode 100644 index aa148dc7..00000000 --- a/Migration.Toolkit.KX12/Models/CmsSettingsKey.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SettingsKey")] -[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] -[Index("SiteId", "KeyName", Name = "IX_CMS_SettingsKey_SiteID_KeyName")] -public class CmsSettingsKey -{ - [Key] - [Column("KeyID")] - public int KeyId { get; set; } - - [StringLength(100)] - public string KeyName { get; set; } = null!; - - [StringLength(200)] - public string KeyDisplayName { get; set; } = null!; - - public string? KeyDescription { get; set; } - - public string? KeyValue { get; set; } - - [StringLength(50)] - public string KeyType { get; set; } = null!; - - [Column("KeyCategoryID")] - public int? KeyCategoryId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("KeyGUID")] - public Guid KeyGuid { get; set; } - - public DateTime KeyLastModified { get; set; } - - public int? KeyOrder { get; set; } - - public string? KeyDefaultValue { get; set; } - - [StringLength(255)] - public string? KeyValidation { get; set; } - - [StringLength(200)] - public string? KeyEditingControlPath { get; set; } - - public bool? KeyIsGlobal { get; set; } - - public bool? KeyIsCustom { get; set; } - - public bool? KeyIsHidden { get; set; } - - public string? KeyFormControlSettings { get; set; } - - public string? KeyExplanationText { get; set; } - - [ForeignKey("KeyCategoryId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSettingsCategory? KeyCategory { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSite? Site { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsSite.cs b/Migration.Toolkit.KX12/Models/CmsSite.cs deleted file mode 100644 index a79fe0eb..00000000 --- a/Migration.Toolkit.KX12/Models/CmsSite.cs +++ /dev/null @@ -1,413 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Site")] -[Index("SiteDefaultEditorStylesheet", Name = "IX_CMS_Site_SiteDefaultEditorStylesheet")] -[Index("SiteDefaultStylesheetId", Name = "IX_CMS_Site_SiteDefaultStylesheetID")] -[Index("SiteDomainName", "SiteStatus", Name = "IX_CMS_Site_SiteDomainName_SiteStatus")] -[Index("SiteName", Name = "IX_CMS_Site_SiteName")] -public class CmsSite -{ - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - [StringLength(200)] - public string SiteDisplayName { get; set; } = null!; - - public string? SiteDescription { get; set; } - - [StringLength(20)] - public string SiteStatus { get; set; } = null!; - - [StringLength(400)] - public string SiteDomainName { get; set; } = null!; - - [Column("SiteDefaultStylesheetID")] - public int? SiteDefaultStylesheetId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - public int? SiteDefaultEditorStylesheet { get; set; } - - [Column("SiteGUID")] - public Guid SiteGuid { get; set; } - - public DateTime SiteLastModified { get; set; } - - public bool? SiteIsOffline { get; set; } - - [Column("SiteOfflineRedirectURL")] - [StringLength(400)] - public string? SiteOfflineRedirectUrl { get; set; } - - public string? SiteOfflineMessage { get; set; } - - [Column("SitePresentationURL")] - [StringLength(400)] - public string? SitePresentationUrl { get; set; } - - public bool? SiteIsContentOnly { get; set; } - - [InverseProperty("CampaignSite")] - public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); - - [InverseProperty("ConversionSite")] - public virtual ICollection AnalyticsConversions { get; set; } = new List(); - - [InverseProperty("StatisticsSite")] - public virtual ICollection AnalyticsStatistics { get; set; } = new List(); - - [InverseProperty("BoardSite")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("ChatNotificationSite")] - public virtual ICollection ChatNotifications { get; set; } = new List(); - - [InverseProperty("ChatOnlineSupportSite")] - public virtual ICollection ChatOnlineSupports { get; set; } = new List(); - - [InverseProperty("ChatOnlineUserSite")] - public virtual ICollection ChatOnlineUsers { get; set; } = new List(); - - [InverseProperty("ChatRoomSite")] - public virtual ICollection ChatRooms { get; set; } = new List(); - - [InverseProperty("ChatSupportCannedResponseSite")] - public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); - - [InverseProperty("ReportSite")] - public virtual ICollection CmsAbuseReports { get; set; } = new List(); - - [InverseProperty("Aclsite")] - public virtual ICollection CmsAcls { get; set; } = new List(); - - [InverseProperty("AlternativeUrlSite")] - public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection CmsAttachmentHistories { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection CmsAttachments { get; set; } = new List(); - - [InverseProperty("StateSite")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("IpaddressSite")] - public virtual ICollection CmsBannedIps { get; set; } = new List(); - - [InverseProperty("BannerCategorySite")] - public virtual ICollection CmsBannerCategories { get; set; } = new List(); - - [InverseProperty("BannerSite")] - public virtual ICollection CmsBanners { get; set; } = new List(); - - [InverseProperty("CategorySite")] - public virtual ICollection CmsCategories { get; set; } = new List(); - - [InverseProperty("AliasSite")] - public virtual ICollection CmsDocumentAliases { get; set; } = new List(); - - [InverseProperty("ScopeSite")] - public virtual ICollection CmsDocumentTypeScopes { get; set; } = new List(); - - [InverseProperty("EmailTemplateSite")] - public virtual ICollection CmsEmailTemplates { get; set; } = new List(); - - [InverseProperty("FormSite")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("MembershipSite")] - public virtual ICollection CmsMemberships { get; set; } = new List(); - - [InverseProperty("MetaFileSite")] - public virtual ICollection CmsMetaFiles { get; set; } = new List(); - - [InverseProperty("VersionObjectSite")] - public virtual ICollection CmsObjectVersionHistories { get; set; } = new List(); - - [InverseProperty("PageTemplateConfigurationSite")] - public virtual ICollection CmsPageTemplateConfigurations { get; set; } = new List(); - - [InverseProperty("PageTemplateScopeSite")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("PageTemplateSite")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("PersonalizationSite")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsRoles { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("SessionSite")] - public virtual ICollection CmsSessions { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsSiteDomainAliases { get; set; } = new List(); - - [InverseProperty("TagGroupSite")] - public virtual ICollection CmsTagGroups { get; set; } = new List(); - - [InverseProperty("NodeLinkedNodeSite")] - public virtual ICollection CmsTreeNodeLinkedNodeSites { get; set; } = new List(); - - [InverseProperty("NodeSite")] - public virtual ICollection CmsTreeNodeSites { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsUserSites { get; set; } = new List(); - - [InverseProperty("NodeSite")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("ScopeSite")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [InverseProperty("BrandSite")] - public virtual ICollection ComBrands { get; set; } = new List(); - - [InverseProperty("CarrierSite")] - public virtual ICollection ComCarriers { get; set; } = new List(); - - [InverseProperty("CollectionSite")] - public virtual ICollection ComCollections { get; set; } = new List(); - - [InverseProperty("CurrencySite")] - public virtual ICollection ComCurrencies { get; set; } = new List(); - - [InverseProperty("EventSite")] - public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); - - [InverseProperty("CustomerSite")] - public virtual ICollection ComCustomers { get; set; } = new List(); - - [InverseProperty("DepartmentSite")] - public virtual ICollection ComDepartments { get; set; } = new List(); - - [InverseProperty("DiscountSite")] - public virtual ICollection ComDiscounts { get; set; } = new List(); - - [InverseProperty("ExchangeTableSite")] - public virtual ICollection ComExchangeTables { get; set; } = new List(); - - [InverseProperty("GiftCardSite")] - public virtual ICollection ComGiftCards { get; set; } = new List(); - - [InverseProperty("InternalStatusSite")] - public virtual ICollection ComInternalStatuses { get; set; } = new List(); - - [InverseProperty("ManufacturerSite")] - public virtual ICollection ComManufacturers { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscountSite")] - public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); - - [InverseProperty("CategorySite")] - public virtual ICollection ComOptionCategories { get; set; } = new List(); - - [InverseProperty("StatusSite")] - public virtual ICollection ComOrderStatuses { get; set; } = new List(); - - [InverseProperty("OrderSite")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("PaymentOptionSite")] - public virtual ICollection ComPaymentOptions { get; set; } = new List(); - - [InverseProperty("PublicStatusSite")] - public virtual ICollection ComPublicStatuses { get; set; } = new List(); - - [InverseProperty("ShippingOptionSite")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); - - [InverseProperty("ShoppingCartSite")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [InverseProperty("Skusite")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [InverseProperty("SupplierSite")] - public virtual ICollection ComSuppliers { get; set; } = new List(); - - [InverseProperty("TaxClassSite")] - public virtual ICollection ComTaxClasses { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("GroupSite")] - public virtual ICollection CommunityGroups { get; set; } = new List(); - - [InverseProperty("ExportSite")] - public virtual ICollection ExportHistories { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection ExportTasks { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection ForumsAttachments { get; set; } = new List(); - - [InverseProperty("GroupSite")] - public virtual ICollection ForumsForumGroups { get; set; } = new List(); - - [InverseProperty("ForumSite")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection IntegrationTasks { get; set; } = new List(); - - [InverseProperty("FileSite")] - public virtual ICollection MediaFiles { get; set; } = new List(); - - [InverseProperty("LibrarySite")] - public virtual ICollection MediaLibraries { get; set; } = new List(); - - [InverseProperty("TemplateSite")] - public virtual ICollection NewsletterEmailTemplates { get; set; } = new List(); - - [InverseProperty("EmailWidgetSite")] - public virtual ICollection NewsletterEmailWidgets { get; set; } = new List(); - - [InverseProperty("EmailSite")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("IssueSite")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [InverseProperty("NewsletterSite")] - public virtual ICollection NewsletterNewsletters { get; set; } = new List(); - - [InverseProperty("SubscriberSite")] - public virtual ICollection NewsletterSubscribers { get; set; } = new List(); - - [InverseProperty("SubscriptionSite")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("TemplateSite")] - public virtual ICollection NotificationTemplates { get; set; } = new List(); - - [InverseProperty("AbtestSite")] - public virtual ICollection OmAbtests { get; set; } = new List(); - - [InverseProperty("AbvariantSite")] - public virtual ICollection OmAbvariants { get; set; } = new List(); - - [InverseProperty("MvtestSite")] - public virtual ICollection OmMvtests { get; set; } = new List(); - - [InverseProperty("PollSite")] - public virtual ICollection PollsPolls { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionSite")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("SharePointConnectionSite")] - public virtual ICollection SharePointSharePointConnections { get; set; } = new List(); - - [InverseProperty("SharePointFileSite")] - public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); - - [InverseProperty("SharePointLibrarySite")] - public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); - - [ForeignKey("SiteDefaultEditorStylesheet")] - [InverseProperty("CmsSiteSiteDefaultEditorStylesheetNavigations")] - public virtual CmsCssStylesheet? SiteDefaultEditorStylesheetNavigation { get; set; } - - [ForeignKey("SiteDefaultStylesheetId")] - [InverseProperty("CmsSiteSiteDefaultStylesheets")] - public virtual CmsCssStylesheet? SiteDefaultStylesheet { get; set; } - - [InverseProperty("FacebookAccountSite")] - public virtual ICollection SmFacebookAccounts { get; set; } = new List(); - - [InverseProperty("FacebookApplicationSite")] - public virtual ICollection SmFacebookApplications { get; set; } = new List(); - - [InverseProperty("FacebookPostSite")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); - - [InverseProperty("LinkedInApplicationSite")] - public virtual ICollection SmLinkedInApplications { get; set; } = new List(); - - [InverseProperty("LinkedInPostSite")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); - - [InverseProperty("TwitterAccountSite")] - public virtual ICollection SmTwitterAccounts { get; set; } = new List(); - - [InverseProperty("TwitterApplicationSite")] - public virtual ICollection SmTwitterApplications { get; set; } = new List(); - - [InverseProperty("TwitterPostSite")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); - - [InverseProperty("ServerSite")] - public virtual ICollection StagingServers { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection StagingTasks { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Classes { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Containers { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Cultures { get; set; } = new List(); - - [ForeignKey("IndexSiteId")] - [InverseProperty("IndexSites")] - public virtual ICollection Indices { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection PageTemplates { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Polls { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection RelationshipNames { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Resources { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Servers { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Stylesheets { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsSiteDomainAlias.cs b/Migration.Toolkit.KX12/Models/CmsSiteDomainAlias.cs deleted file mode 100644 index d2cb035f..00000000 --- a/Migration.Toolkit.KX12/Models/CmsSiteDomainAlias.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SiteDomainAlias")] -[Index("SiteDomainAliasName", Name = "IX_CMS_SiteDomainAlias_SiteDomainAliasName")] -[Index("SiteId", Name = "IX_CMS_SiteDomainAlias_SiteID")] -public class CmsSiteDomainAlias -{ - [Key] - [Column("SiteDomainAliasID")] - public int SiteDomainAliasId { get; set; } - - [StringLength(400)] - public string SiteDomainAliasName { get; set; } = null!; - - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - [Column("SiteDomainGUID")] - public Guid? SiteDomainGuid { get; set; } - - public DateTime SiteDomainLastModified { get; set; } - - [StringLength(450)] - public string? SiteDomainDefaultAliasPath { get; set; } - - [StringLength(450)] - public string? SiteDomainRedirectUrl { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsSiteDomainAliases")] - public virtual CmsSite Site { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsSmtpserver.cs b/Migration.Toolkit.KX12/Models/CmsSmtpserver.cs deleted file mode 100644 index 497b96df..00000000 --- a/Migration.Toolkit.KX12/Models/CmsSmtpserver.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SMTPServer")] -public class CmsSmtpserver -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(200)] - public string ServerName { get; set; } = null!; - - [StringLength(50)] - public string? ServerUserName { get; set; } - - [StringLength(200)] - public string? ServerPassword { get; set; } - - [Column("ServerUseSSL")] - public bool ServerUseSsl { get; set; } - - public bool ServerEnabled { get; set; } - - public bool ServerIsGlobal { get; set; } - - [Column("ServerGUID")] - public Guid ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public int? ServerPriority { get; set; } - - public int? ServerDeliveryMethod { get; set; } - - [StringLength(450)] - public string? ServerPickupDirectory { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("Servers")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsState.cs b/Migration.Toolkit.KX12/Models/CmsState.cs deleted file mode 100644 index 76100b3b..00000000 --- a/Migration.Toolkit.KX12/Models/CmsState.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_State")] -[Index("CountryId", Name = "IX_CMS_State_CountryID")] -[Index("StateCode", Name = "IX_CMS_State_StateCode")] -public class CmsState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [StringLength(200)] - public string StateDisplayName { get; set; } = null!; - - [StringLength(200)] - public string StateName { get; set; } = null!; - - [StringLength(100)] - public string? StateCode { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public DateTime StateLastModified { get; set; } - - [InverseProperty("AddressState")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("AddressState")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("State")] - public virtual ICollection ComTaxClassStates { get; set; } = new List(); - - [ForeignKey("CountryId")] - [InverseProperty("CmsStates")] - public virtual CmsCountry Country { get; set; } = null!; - - [InverseProperty("AccountState")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactState")] - public virtual ICollection OmContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsTag.cs b/Migration.Toolkit.KX12/Models/CmsTag.cs deleted file mode 100644 index d1db2cc2..00000000 --- a/Migration.Toolkit.KX12/Models/CmsTag.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Tag")] -[Index("TagGroupId", Name = "IX_CMS_Tag_TagGroupID")] -public class CmsTag -{ - [Key] - [Column("TagID")] - public int TagId { get; set; } - - [StringLength(250)] - public string TagName { get; set; } = null!; - - public int TagCount { get; set; } - - [Column("TagGroupID")] - public int TagGroupId { get; set; } - - [Column("TagGUID")] - public Guid TagGuid { get; set; } - - [ForeignKey("TagGroupId")] - [InverseProperty("CmsTags")] - public virtual CmsTagGroup TagGroup { get; set; } = null!; - - [ForeignKey("TagId")] - [InverseProperty("Tags")] - public virtual ICollection Documents { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsTagGroup.cs b/Migration.Toolkit.KX12/Models/CmsTagGroup.cs deleted file mode 100644 index 68bdc0c5..00000000 --- a/Migration.Toolkit.KX12/Models/CmsTagGroup.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_TagGroup")] -[Index("TagGroupSiteId", Name = "IX_CMS_TagGroup_TagGroupSiteID")] -public class CmsTagGroup -{ - [Key] - [Column("TagGroupID")] - public int TagGroupId { get; set; } - - [StringLength(250)] - public string TagGroupDisplayName { get; set; } = null!; - - [StringLength(250)] - public string TagGroupName { get; set; } = null!; - - public string? TagGroupDescription { get; set; } - - [Column("TagGroupSiteID")] - public int TagGroupSiteId { get; set; } - - public bool TagGroupIsAdHoc { get; set; } - - public DateTime TagGroupLastModified { get; set; } - - [Column("TagGroupGUID")] - public Guid TagGroupGuid { get; set; } - - [InverseProperty("DocumentTagGroup")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("TagGroup")] - public virtual ICollection CmsTags { get; set; } = new List(); - - [ForeignKey("TagGroupSiteId")] - [InverseProperty("CmsTagGroups")] - public virtual CmsSite TagGroupSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsTemplateDeviceLayout.cs b/Migration.Toolkit.KX12/Models/CmsTemplateDeviceLayout.cs deleted file mode 100644 index ea9d34f1..00000000 --- a/Migration.Toolkit.KX12/Models/CmsTemplateDeviceLayout.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_TemplateDeviceLayout")] -[Index("LayoutId", Name = "IX_CMS_TemplateDeviceLayout_LayoutID")] -[Index("PageTemplateId", "ProfileId", Name = "IX_CMS_TemplateDeviceLayout_PageTemplateID_ProfileID", IsUnique = true)] -[Index("ProfileId", Name = "IX_CMS_TemplateDeviceLayout_ProfileID")] -public class CmsTemplateDeviceLayout -{ - [Key] - [Column("TemplateDeviceLayoutID")] - public int TemplateDeviceLayoutId { get; set; } - - [Column("PageTemplateID")] - public int PageTemplateId { get; set; } - - [Column("ProfileID")] - public int ProfileId { get; set; } - - [Column("LayoutID")] - public int? LayoutId { get; set; } - - public string? LayoutCode { get; set; } - - [StringLength(50)] - public string? LayoutType { get; set; } - - [Column("LayoutCSS")] - public string? LayoutCss { get; set; } - - public DateTime LayoutLastModified { get; set; } - - [Column("LayoutGUID")] - public Guid LayoutGuid { get; set; } - - [Column("LayoutVersionGUID")] - [StringLength(50)] - public string? LayoutVersionGuid { get; set; } - - [ForeignKey("LayoutId")] - [InverseProperty("CmsTemplateDeviceLayouts")] - public virtual CmsLayout? Layout { get; set; } - - [ForeignKey("PageTemplateId")] - [InverseProperty("CmsTemplateDeviceLayouts")] - public virtual CmsPageTemplate PageTemplate { get; set; } = null!; - - [ForeignKey("ProfileId")] - [InverseProperty("CmsTemplateDeviceLayouts")] - public virtual CmsDeviceProfile Profile { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsTimeZone.cs b/Migration.Toolkit.KX12/Models/CmsTimeZone.cs deleted file mode 100644 index 192b8a5f..00000000 --- a/Migration.Toolkit.KX12/Models/CmsTimeZone.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_TimeZone")] -public class CmsTimeZone -{ - [Key] - [Column("TimeZoneID")] - public int TimeZoneId { get; set; } - - [StringLength(200)] - public string TimeZoneName { get; set; } = null!; - - [StringLength(200)] - public string TimeZoneDisplayName { get; set; } = null!; - - [Column("TimeZoneGMT")] - public double TimeZoneGmt { get; set; } - - public bool? TimeZoneDaylight { get; set; } - - public DateTime TimeZoneRuleStartIn { get; set; } - - [StringLength(200)] - public string TimeZoneRuleStartRule { get; set; } = null!; - - public DateTime TimeZoneRuleEndIn { get; set; } - - [StringLength(200)] - public string TimeZoneRuleEndRule { get; set; } = null!; - - [Column("TimeZoneGUID")] - public Guid TimeZoneGuid { get; set; } - - public DateTime TimeZoneLastModified { get; set; } - - [InverseProperty("UserTimeZone")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsTransformation.cs b/Migration.Toolkit.KX12/Models/CmsTransformation.cs deleted file mode 100644 index eae8ff3a..00000000 --- a/Migration.Toolkit.KX12/Models/CmsTransformation.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Transformation")] -[Index("TransformationClassId", Name = "IX_CMS_Transformation_TransformationClassID")] -public class CmsTransformation -{ - [Key] - [Column("TransformationID")] - public int TransformationId { get; set; } - - [StringLength(100)] - public string TransformationName { get; set; } = null!; - - public string TransformationCode { get; set; } = null!; - - [StringLength(50)] - public string TransformationType { get; set; } = null!; - - [Column("TransformationClassID")] - public int TransformationClassId { get; set; } - - [Column("TransformationVersionGUID")] - [StringLength(50)] - public string? TransformationVersionGuid { get; set; } - - [Column("TransformationGUID")] - public Guid TransformationGuid { get; set; } - - public DateTime TransformationLastModified { get; set; } - - public bool? TransformationIsHierarchical { get; set; } - - [Column("TransformationHierarchicalXML")] - public string? TransformationHierarchicalXml { get; set; } - - [Column("TransformationCSS")] - public string? TransformationCss { get; set; } - - [StringLength(700)] - public string? TransformationPreferredDocument { get; set; } - - [ForeignKey("TransformationClassId")] - [InverseProperty("CmsTransformations")] - public virtual CmsClass TransformationClass { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsTranslationService.cs b/Migration.Toolkit.KX12/Models/CmsTranslationService.cs deleted file mode 100644 index 8facdd17..00000000 --- a/Migration.Toolkit.KX12/Models/CmsTranslationService.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_TranslationService")] -public class CmsTranslationService -{ - [Key] - [Column("TranslationServiceID")] - public int TranslationServiceId { get; set; } - - [StringLength(200)] - public string TranslationServiceAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceClassName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceDisplayName { get; set; } = null!; - - public bool TranslationServiceIsMachine { get; set; } - - public DateTime TranslationServiceLastModified { get; set; } - - [Column("TranslationServiceGUID")] - public Guid TranslationServiceGuid { get; set; } - - public bool TranslationServiceEnabled { get; set; } - - public bool? TranslationServiceSupportsInstructions { get; set; } - - public bool? TranslationServiceSupportsPriority { get; set; } - - public bool? TranslationServiceSupportsDeadline { get; set; } - - public bool? TranslationServiceGenerateTargetTag { get; set; } - - [StringLength(1000)] - public string? TranslationServiceParameter { get; set; } - - public bool? TranslationServiceSupportsStatusUpdate { get; set; } - - public bool? TranslationServiceSupportsCancel { get; set; } - - [InverseProperty("SubmissionService")] - public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsTranslationSubmission.cs b/Migration.Toolkit.KX12/Models/CmsTranslationSubmission.cs deleted file mode 100644 index 09b99ba9..00000000 --- a/Migration.Toolkit.KX12/Models/CmsTranslationSubmission.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_TranslationSubmission")] -[Index("SubmissionServiceId", Name = "IX_CMS_TranslationSubmission_SubmissionServiceID")] -[Index("SubmissionSubmittedByUserId", Name = "IX_CMS_TranslationSubmission_SubmissionSubmittedByUserID")] -public class CmsTranslationSubmission -{ - [Key] - [Column("SubmissionID")] - public int SubmissionId { get; set; } - - [StringLength(200)] - public string SubmissionName { get; set; } = null!; - - [StringLength(200)] - public string? SubmissionTicket { get; set; } - - public int SubmissionStatus { get; set; } - - [Column("SubmissionServiceID")] - public int SubmissionServiceId { get; set; } - - [StringLength(10)] - public string SubmissionSourceCulture { get; set; } = null!; - - public string SubmissionTargetCulture { get; set; } = null!; - - public int SubmissionPriority { get; set; } - - public DateTime? SubmissionDeadline { get; set; } - - [StringLength(500)] - public string? SubmissionInstructions { get; set; } - - public DateTime SubmissionLastModified { get; set; } - - [Column("SubmissionGUID")] - public Guid SubmissionGuid { get; set; } - - [Column("SubmissionSiteID")] - public int? SubmissionSiteId { get; set; } - - public double? SubmissionPrice { get; set; } - - public string? SubmissionStatusMessage { get; set; } - - public bool? SubmissionTranslateAttachments { get; set; } - - public int SubmissionItemCount { get; set; } - - public DateTime SubmissionDate { get; set; } - - public int? SubmissionWordCount { get; set; } - - public int? SubmissionCharCount { get; set; } - - [Column("SubmissionSubmittedByUserID")] - public int? SubmissionSubmittedByUserId { get; set; } - - [InverseProperty("SubmissionItemSubmission")] - public virtual ICollection CmsTranslationSubmissionItems { get; set; } = new List(); - - [ForeignKey("SubmissionServiceId")] - [InverseProperty("CmsTranslationSubmissions")] - public virtual CmsTranslationService SubmissionService { get; set; } = null!; - - [ForeignKey("SubmissionSubmittedByUserId")] - [InverseProperty("CmsTranslationSubmissions")] - public virtual CmsUser? SubmissionSubmittedByUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsTranslationSubmissionItem.cs b/Migration.Toolkit.KX12/Models/CmsTranslationSubmissionItem.cs deleted file mode 100644 index 824f47e6..00000000 --- a/Migration.Toolkit.KX12/Models/CmsTranslationSubmissionItem.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_TranslationSubmissionItem")] -[Index("SubmissionItemSubmissionId", Name = "IX_CMS_TranslationSubmissionItem_SubmissionItemSubmissionID")] -public class CmsTranslationSubmissionItem -{ - [Key] - [Column("SubmissionItemID")] - public int SubmissionItemId { get; set; } - - [Column("SubmissionItemSubmissionID")] - public int SubmissionItemSubmissionId { get; set; } - - [Column("SubmissionItemSourceXLIFF")] - public string? SubmissionItemSourceXliff { get; set; } - - [Column("SubmissionItemTargetXLIFF")] - public string? SubmissionItemTargetXliff { get; set; } - - [StringLength(100)] - public string SubmissionItemObjectType { get; set; } = null!; - - [Column("SubmissionItemObjectID")] - public int SubmissionItemObjectId { get; set; } - - [Column("SubmissionItemGUID")] - public Guid SubmissionItemGuid { get; set; } - - public DateTime SubmissionItemLastModified { get; set; } - - [StringLength(200)] - public string SubmissionItemName { get; set; } = null!; - - public int? SubmissionItemWordCount { get; set; } - - public int? SubmissionItemCharCount { get; set; } - - public string? SubmissionItemCustomData { get; set; } - - [Column("SubmissionItemTargetObjectID")] - public int SubmissionItemTargetObjectId { get; set; } - - [StringLength(50)] - public string? SubmissionItemType { get; set; } - - [StringLength(10)] - public string? SubmissionItemTargetCulture { get; set; } - - [ForeignKey("SubmissionItemSubmissionId")] - [InverseProperty("CmsTranslationSubmissionItems")] - public virtual CmsTranslationSubmission SubmissionItemSubmission { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsTree.cs b/Migration.Toolkit.KX12/Models/CmsTree.cs deleted file mode 100644 index efd7c2bd..00000000 --- a/Migration.Toolkit.KX12/Models/CmsTree.cs +++ /dev/null @@ -1,183 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Tree")] -[Index("NodeAclid", Name = "IX_CMS_Tree_NodeACLID")] -[Index("NodeAliasPath", Name = "IX_CMS_Tree_NodeAliasPath")] -[Index("NodeClassId", Name = "IX_CMS_Tree_NodeClassID")] -[Index("NodeGroupId", Name = "IX_CMS_Tree_NodeGroupID")] -[Index("NodeLevel", Name = "IX_CMS_Tree_NodeLevel")] -[Index("NodeLinkedNodeId", Name = "IX_CMS_Tree_NodeLinkedNodeID")] -[Index("NodeLinkedNodeSiteId", Name = "IX_CMS_Tree_NodeLinkedNodeSiteID")] -[Index("NodeOriginalNodeId", Name = "IX_CMS_Tree_NodeOriginalNodeID")] -[Index("NodeOwner", Name = "IX_CMS_Tree_NodeOwner")] -[Index("NodeParentId", "NodeAlias", "NodeName", Name = "IX_CMS_Tree_NodeParentID_NodeAlias_NodeName")] -[Index("NodeSkuid", Name = "IX_CMS_Tree_NodeSKUID")] -[Index("NodeSiteId", "NodeGuid", Name = "IX_CMS_Tree_NodeSiteID_NodeGUID", IsUnique = true)] -[Index("NodeTemplateId", Name = "IX_CMS_Tree_NodeTemplateID")] -public class CmsTree -{ - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - public string NodeAliasPath { get; set; } = null!; - - [StringLength(100)] - public string NodeName { get; set; } = null!; - - [StringLength(50)] - public string NodeAlias { get; set; } = null!; - - [Column("NodeClassID")] - public int NodeClassId { get; set; } - - [Column("NodeParentID")] - public int? NodeParentId { get; set; } - - public int NodeLevel { get; set; } - - [Column("NodeACLID")] - public int? NodeAclid { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeGUID")] - public Guid NodeGuid { get; set; } - - public int? NodeOrder { get; set; } - - public bool? IsSecuredNode { get; set; } - - public int? NodeCacheMinutes { get; set; } - - [Column("NodeSKUID")] - public int? NodeSkuid { get; set; } - - public string? NodeDocType { get; set; } - - public string? NodeHeadTags { get; set; } - - public string? NodeBodyElementAttributes { get; set; } - - [StringLength(200)] - public string? NodeInheritPageLevels { get; set; } - - [Column("RequiresSSL")] - public int? RequiresSsl { get; set; } - - [Column("NodeLinkedNodeID")] - public int? NodeLinkedNodeId { get; set; } - - public int? NodeOwner { get; set; } - - public string? NodeCustomData { get; set; } - - [Column("NodeGroupID")] - public int? NodeGroupId { get; set; } - - [Column("NodeLinkedNodeSiteID")] - public int? NodeLinkedNodeSiteId { get; set; } - - [Column("NodeTemplateID")] - public int? NodeTemplateId { get; set; } - - public bool? NodeTemplateForAllCultures { get; set; } - - public bool? NodeInheritPageTemplate { get; set; } - - public bool? NodeAllowCacheInFileSystem { get; set; } - - public bool? NodeHasChildren { get; set; } - - public bool? NodeHasLinks { get; set; } - - [Column("NodeOriginalNodeID")] - public int? NodeOriginalNodeId { get; set; } - - public bool NodeIsContentOnly { get; set; } - - [Column("NodeIsACLOwner")] - public bool NodeIsAclowner { get; set; } - - public string? NodeBodyScripts { get; set; } - - [InverseProperty("AliasNode")] - public virtual ICollection CmsDocumentAliases { get; set; } = new List(); - - [InverseProperty("DocumentNode")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("LeftNode")] - public virtual ICollection CmsRelationshipLeftNodes { get; set; } = new List(); - - [InverseProperty("RightNode")] - public virtual ICollection CmsRelationshipRightNodes { get; set; } = new List(); - - [InverseProperty("Node")] - public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); - - [InverseProperty("AttendeeEventNode")] - public virtual ICollection EventsAttendees { get; set; } = new List(); - - [InverseProperty("NodeLinkedNode")] - public virtual ICollection InverseNodeLinkedNode { get; set; } = new List(); - - [InverseProperty("NodeOriginalNode")] - public virtual ICollection InverseNodeOriginalNode { get; set; } = new List(); - - [InverseProperty("NodeParent")] - public virtual ICollection InverseNodeParent { get; set; } = new List(); - - [ForeignKey("NodeAclid")] - [InverseProperty("CmsTrees")] - public virtual CmsAcl? NodeAcl { get; set; } - - [ForeignKey("NodeClassId")] - [InverseProperty("CmsTrees")] - public virtual CmsClass NodeClass { get; set; } = null!; - - [ForeignKey("NodeGroupId")] - [InverseProperty("CmsTrees")] - public virtual CommunityGroup? NodeGroup { get; set; } - - [ForeignKey("NodeLinkedNodeId")] - [InverseProperty("InverseNodeLinkedNode")] - public virtual CmsTree? NodeLinkedNode { get; set; } - - [ForeignKey("NodeLinkedNodeSiteId")] - [InverseProperty("CmsTreeNodeLinkedNodeSites")] - public virtual CmsSite? NodeLinkedNodeSite { get; set; } - - [ForeignKey("NodeOriginalNodeId")] - [InverseProperty("InverseNodeOriginalNode")] - public virtual CmsTree? NodeOriginalNode { get; set; } - - [ForeignKey("NodeOwner")] - [InverseProperty("CmsTrees")] - public virtual CmsUser? NodeOwnerNavigation { get; set; } - - [ForeignKey("NodeParentId")] - [InverseProperty("InverseNodeParent")] - public virtual CmsTree? NodeParent { get; set; } - - [ForeignKey("NodeSiteId")] - [InverseProperty("CmsTreeNodeSites")] - public virtual CmsSite NodeSite { get; set; } = null!; - - [ForeignKey("NodeSkuid")] - [InverseProperty("CmsTrees")] - public virtual ComSku? NodeSku { get; set; } - - [ForeignKey("NodeTemplateId")] - [InverseProperty("CmsTrees")] - public virtual CmsPageTemplate? NodeTemplate { get; set; } - - [InverseProperty("Node")] - public virtual ICollection PersonasPersonaNodes { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsUielement.cs b/Migration.Toolkit.KX12/Models/CmsUielement.cs deleted file mode 100644 index ce44343c..00000000 --- a/Migration.Toolkit.KX12/Models/CmsUielement.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_UIElement")] -[Index("ElementGuid", Name = "IX_CMS_UIElement_ElementGUID", IsUnique = true)] -[Index("ElementPageTemplateId", Name = "IX_CMS_UIElement_ElementPageTemplateID")] -[Index("ElementParentId", Name = "IX_CMS_UIElement_ElementParentID")] -public class CmsUielement -{ - [Key] - [Column("ElementID")] - public int ElementId { get; set; } - - [StringLength(200)] - public string ElementDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ElementName { get; set; } = null!; - - [StringLength(200)] - public string? ElementCaption { get; set; } - - [Column("ElementTargetURL")] - [StringLength(650)] - public string? ElementTargetUrl { get; set; } - - [Column("ElementResourceID")] - public int ElementResourceId { get; set; } - - [Column("ElementParentID")] - public int? ElementParentId { get; set; } - - public int ElementChildCount { get; set; } - - public int? ElementOrder { get; set; } - - public int ElementLevel { get; set; } - - [Column("ElementIDPath")] - [StringLength(450)] - public string ElementIdpath { get; set; } = null!; - - [StringLength(200)] - public string? ElementIconPath { get; set; } - - public bool? ElementIsCustom { get; set; } - - public DateTime ElementLastModified { get; set; } - - [Column("ElementGUID")] - public Guid ElementGuid { get; set; } - - public int? ElementSize { get; set; } - - public string? ElementDescription { get; set; } - - [StringLength(20)] - public string? ElementFromVersion { get; set; } - - [Column("ElementPageTemplateID")] - public int? ElementPageTemplateId { get; set; } - - [StringLength(50)] - public string? ElementType { get; set; } - - public string? ElementProperties { get; set; } - - public bool? ElementIsMenu { get; set; } - - [StringLength(200)] - public string? ElementFeature { get; set; } - - [StringLength(100)] - public string? ElementIconClass { get; set; } - - public bool? ElementIsGlobalApplication { get; set; } - - public bool? ElementCheckModuleReadPermission { get; set; } - - public string? ElementAccessCondition { get; set; } - - public string? ElementVisibilityCondition { get; set; } - - public bool ElementRequiresGlobalAdminPriviligeLevel { get; set; } - - [InverseProperty("HelpTopicUielement")] - public virtual ICollection CmsHelpTopics { get; set; } = new List(); - - [ForeignKey("ElementPageTemplateId")] - [InverseProperty("CmsUielements")] - public virtual CmsPageTemplate? ElementPageTemplate { get; set; } - - [ForeignKey("ElementParentId")] - [InverseProperty("InverseElementParent")] - public virtual CmsUielement? ElementParent { get; set; } - - [ForeignKey("ElementResourceId")] - [InverseProperty("CmsUielements")] - public virtual CmsResource ElementResource { get; set; } = null!; - - [InverseProperty("ElementParent")] - public virtual ICollection InverseElementParent { get; set; } = new List(); - - [ForeignKey("ElementId")] - [InverseProperty("Elements")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("ElementId")] - [InverseProperty("ElementsNavigation")] - public virtual ICollection RolesNavigation { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsUser.cs b/Migration.Toolkit.KX12/Models/CmsUser.cs deleted file mode 100644 index 67f1ad12..00000000 --- a/Migration.Toolkit.KX12/Models/CmsUser.cs +++ /dev/null @@ -1,305 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_User")] -[Index("Email", Name = "IX_CMS_User_Email")] -[Index("FullName", Name = "IX_CMS_User_FullName")] -[Index("UserEnabled", "UserIsHidden", Name = "IX_CMS_User_UserEnabled_UserIsHidden")] -[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] -[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] -[Index("UserPrivilegeLevel", Name = "IX_CMS_User_UserPrivilegeLevel")] -public class CmsUser -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [InverseProperty("CommentApprovedByUser")] - public virtual ICollection BlogCommentCommentApprovedByUsers { get; set; } = new List(); - - [InverseProperty("CommentUser")] - public virtual ICollection BlogCommentCommentUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); - - [InverseProperty("BoardUser")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("MessageApprovedByUser")] - public virtual ICollection BoardMessageMessageApprovedByUsers { get; set; } = new List(); - - [InverseProperty("MessageUser")] - public virtual ICollection BoardMessageMessageUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection BoardSubscriptions { get; set; } = new List(); - - [InverseProperty("InitiatedChatRequestUser")] - public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); - - [InverseProperty("ChatUserUser")] - public virtual ICollection ChatUsers { get; set; } = new List(); - - [InverseProperty("ReportUser")] - public virtual ICollection CmsAbuseReports { get; set; } = new List(); - - [InverseProperty("LastModifiedByUser")] - public virtual ICollection CmsAclitemLastModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsAclitemUsers { get; set; } = new List(); - - [InverseProperty("HistoryApprovedByUser")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateUser")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("CategoryUser")] - public virtual ICollection CmsCategories { get; set; } = new List(); - - [InverseProperty("DocumentCheckedOutByUser")] - public virtual ICollection CmsDocumentDocumentCheckedOutByUsers { get; set; } = new List(); - - [InverseProperty("DocumentCreatedByUser")] - public virtual ICollection CmsDocumentDocumentCreatedByUsers { get; set; } = new List(); - - [InverseProperty("DocumentModifiedByUser")] - public virtual ICollection CmsDocumentDocumentModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsEmailUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsExternalLogins { get; set; } = new List(); - - [InverseProperty("MacroIdentityEffectiveUser")] - public virtual ICollection CmsMacroIdentities { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsMembershipUsers { get; set; } = new List(); - - [InverseProperty("ObjectCheckedOutByUser")] - public virtual ICollection CmsObjectSettings { get; set; } = new List(); - - [InverseProperty("VersionDeletedByUser")] - public virtual ICollection CmsObjectVersionHistoryVersionDeletedByUsers { get; set; } = new List(); - - [InverseProperty("VersionModifiedByUser")] - public virtual ICollection CmsObjectVersionHistoryVersionModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsOpenIdusers { get; set; } = new List(); - - [InverseProperty("PersonalizationUser")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [InverseProperty("TaskUser")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("SessionUser")] - public virtual ICollection CmsSessions { get; set; } = new List(); - - [InverseProperty("SubmissionSubmittedByUser")] - public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); - - [InverseProperty("NodeOwnerNavigation")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("UserMacroIdentityUser")] - public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } - - [InverseProperty("User")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("UserActivatedByUser")] - public virtual ICollection CmsUserSettingUserActivatedByUsers { get; set; } = new List(); - - [InverseProperty("UserSettingsUserNavigation")] - public virtual CmsUserSetting? CmsUserSettingUserSettingsUserNavigation { get; set; } - - public virtual ICollection CmsUserSettingUserSettingsUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsUserSites { get; set; } = new List(); - - [InverseProperty("ModifiedByUser")] - public virtual ICollection CmsVersionHistoryModifiedByUsers { get; set; } = new List(); - - [InverseProperty("VersionDeletedByUser")] - public virtual ICollection CmsVersionHistoryVersionDeletedByUsers { get; set; } = new List(); - - [InverseProperty("ApprovedByUser")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); - - [InverseProperty("CustomerUser")] - public virtual ICollection ComCustomers { get; set; } = new List(); - - [InverseProperty("ChangedByUser")] - public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); - - [InverseProperty("OrderCreatedByUser")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartUser")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("GroupApprovedByUser")] - public virtual ICollection CommunityGroupGroupApprovedByUsers { get; set; } = new List(); - - [InverseProperty("GroupCreatedByUser")] - public virtual ICollection CommunityGroupGroupCreatedByUsers { get; set; } = new List(); - - [InverseProperty("MemberApprovedByUser")] - public virtual ICollection CommunityGroupMemberMemberApprovedByUsers { get; set; } = new List(); - - [InverseProperty("MemberInvitedByUser")] - public virtual ICollection CommunityGroupMemberMemberInvitedByUsers { get; set; } = new List(); - - [InverseProperty("MemberUser")] - public virtual ICollection CommunityGroupMemberMemberUsers { get; set; } = new List(); - - [InverseProperty("InvitedByUser")] - public virtual ICollection CommunityInvitationInvitedByUsers { get; set; } = new List(); - - [InverseProperty("InvitedUser")] - public virtual ICollection CommunityInvitationInvitedUsers { get; set; } = new List(); - - [InverseProperty("ExportUser")] - public virtual ICollection ExportHistories { get; set; } = new List(); - - [InverseProperty("PostApprovedByUser")] - public virtual ICollection ForumsForumPostPostApprovedByUsers { get; set; } = new List(); - - [InverseProperty("PostUser")] - public virtual ICollection ForumsForumPostPostUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [InverseProperty("FileCreatedByUser")] - public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); - - [InverseProperty("FileModifiedByUser")] - public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("AccountOwnerUser")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactOwnerUser")] - public virtual ICollection OmContacts { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionUser")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("SavedReportCreatedByUser")] - public virtual ICollection ReportingSavedReports { get; set; } = new List(); - - [InverseProperty("User")] - public virtual StagingTaskGroupUser? StagingTaskGroupUser { get; set; } - - [InverseProperty("User")] - public virtual ICollection StagingTaskUsers { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Boards { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Forums { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Workflows { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsUserCulture.cs b/Migration.Toolkit.KX12/Models/CmsUserCulture.cs deleted file mode 100644 index 5cc04704..00000000 --- a/Migration.Toolkit.KX12/Models/CmsUserCulture.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("UserId", "CultureId", "SiteId")] -[Table("CMS_UserCulture")] -[Index("CultureId", Name = "IX_CMS_UserCulture_CultureID")] -[Index("SiteId", Name = "IX_CMS_UserCulture_SiteID")] -public class CmsUserCulture -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("CultureId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsCulture Culture { get; set; } = null!; - - [ForeignKey("SiteId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsUserMacroIdentity.cs b/Migration.Toolkit.KX12/Models/CmsUserMacroIdentity.cs deleted file mode 100644 index b58dd1e2..00000000 --- a/Migration.Toolkit.KX12/Models/CmsUserMacroIdentity.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_UserMacroIdentity")] -[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] -[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] -public class CmsUserMacroIdentity -{ - [Key] - [Column("UserMacroIdentityID")] - public int UserMacroIdentityId { get; set; } - - public DateTime UserMacroIdentityLastModified { get; set; } - - [Column("UserMacroIdentityUserID")] - public int UserMacroIdentityUserId { get; set; } - - [Column("UserMacroIdentityMacroIdentityID")] - public int? UserMacroIdentityMacroIdentityId { get; set; } - - public Guid UserMacroIdentityUserGuid { get; set; } - - [ForeignKey("UserMacroIdentityMacroIdentityId")] - [InverseProperty("CmsUserMacroIdentities")] - public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } - - [ForeignKey("UserMacroIdentityUserId")] - [InverseProperty("CmsUserMacroIdentity")] - public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsUserRole.cs b/Migration.Toolkit.KX12/Models/CmsUserRole.cs deleted file mode 100644 index af52db96..00000000 --- a/Migration.Toolkit.KX12/Models/CmsUserRole.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_UserRole")] -[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] -[Index("RoleId", "ValidTo", "UserId", Name = "IX_CMS_UserRole_UserID")] -[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] -public class CmsUserRole -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } - - [Key] - [Column("UserRoleID")] - public int UserRoleId { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsUserSetting.cs b/Migration.Toolkit.KX12/Models/CmsUserSetting.cs deleted file mode 100644 index 2a6d0fe9..00000000 --- a/Migration.Toolkit.KX12/Models/CmsUserSetting.cs +++ /dev/null @@ -1,167 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_UserSettings")] -[Index("UserActivatedByUserId", Name = "IX_CMS_UserSettings_UserActivatedByUserID")] -[Index("UserAuthenticationGuid", Name = "IX_CMS_UserSettings_UserAuthenticationGUID")] -[Index("UserAvatarId", Name = "IX_CMS_UserSettings_UserAvatarID")] -[Index("UserBadgeId", Name = "IX_CMS_UserSettings_UserBadgeID")] -[Index("UserFacebookId", Name = "IX_CMS_UserSettings_UserFacebookID")] -[Index("UserGender", Name = "IX_CMS_UserSettings_UserGender")] -[Index("UserNickName", Name = "IX_CMS_UserSettings_UserNickName")] -[Index("UserPasswordRequestHash", Name = "IX_CMS_UserSettings_UserPasswordRequestHash")] -[Index("UserSettingsUserGuid", Name = "IX_CMS_UserSettings_UserSettingsUserGUID")] -[Index("UserSettingsUserId", Name = "IX_CMS_UserSettings_UserSettingsUserID", IsUnique = true)] -[Index("UserTimeZoneId", Name = "IX_CMS_UserSettings_UserTimeZoneID")] -[Index("UserWaitingForApproval", Name = "IX_CMS_UserSettings_UserWaitingForApproval")] -[Index("WindowsLiveId", Name = "IX_CMS_UserSettings_WindowsLiveID")] -public class CmsUserSetting -{ - [Key] - [Column("UserSettingsID")] - public int UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [ForeignKey("UserActivatedByUserId")] - [InverseProperty("CmsUserSettingUserActivatedByUsers")] - public virtual CmsUser? UserActivatedByUser { get; set; } - - [ForeignKey("UserAvatarId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsAvatar? UserAvatar { get; set; } - - [ForeignKey("UserBadgeId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsBadge? UserBadge { get; set; } - - public virtual CmsUser UserSettingsUser { get; set; } = null!; - - [ForeignKey("UserSettingsUserId")] - [InverseProperty("CmsUserSettingUserSettingsUserNavigation")] - public virtual CmsUser UserSettingsUserNavigation { get; set; } = null!; - - [ForeignKey("UserTimeZoneId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsTimeZone? UserTimeZone { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsUserSite.cs b/Migration.Toolkit.KX12/Models/CmsUserSite.cs deleted file mode 100644 index f77fb99b..00000000 --- a/Migration.Toolkit.KX12/Models/CmsUserSite.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_UserSite")] -[Index("SiteId", Name = "IX_CMS_UserSite_SiteID")] -[Index("UserId", "SiteId", Name = "IX_CMS_UserSite_UserID_SiteID", IsUnique = true)] -public class CmsUserSite -{ - [Key] - [Column("UserSiteID")] - public int UserSiteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsUserSites")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserSites")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsVersionHistory.cs b/Migration.Toolkit.KX12/Models/CmsVersionHistory.cs deleted file mode 100644 index a72363b5..00000000 --- a/Migration.Toolkit.KX12/Models/CmsVersionHistory.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_VersionHistory")] -[Index("ModifiedByUserId", Name = "IX_CMS_VersionHistory_ModifiedByUserID")] -[Index("NodeSiteId", Name = "IX_CMS_VersionHistory_NodeSiteID")] -[Index("ToBePublished", "PublishFrom", "PublishTo", Name = "IX_CMS_VersionHistory_ToBePublished_PublishFrom_PublishTo")] -[Index("VersionClassId", Name = "IX_CMS_VersionHistory_VersionClassID")] -[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_VersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionWorkflowId", Name = "IX_CMS_VersionHistory_VersionWorkflowID")] -[Index("VersionWorkflowStepId", Name = "IX_CMS_VersionHistory_VersionWorkflowStepID")] -public class CmsVersionHistory -{ - [Key] - [Column("VersionHistoryID")] - public int VersionHistoryId { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("DocumentID")] - public int? DocumentId { get; set; } - - [StringLength(450)] - public string DocumentNamePath { get; set; } = null!; - - [Column("NodeXML")] - public string NodeXml { get; set; } = null!; - - [Column("ModifiedByUserID")] - public int? ModifiedByUserId { get; set; } - - public DateTime ModifiedWhen { get; set; } - - [StringLength(50)] - public string? VersionNumber { get; set; } - - public string? VersionComment { get; set; } - - public bool ToBePublished { get; set; } - - public DateTime? PublishFrom { get; set; } - - public DateTime? PublishTo { get; set; } - - public DateTime? WasPublishedFrom { get; set; } - - public DateTime? WasPublishedTo { get; set; } - - [StringLength(100)] - public string? VersionDocumentName { get; set; } - - [StringLength(50)] - public string? VersionDocumentType { get; set; } - - [Column("VersionClassID")] - public int? VersionClassId { get; set; } - - [StringLength(450)] - public string? VersionMenuRedirectUrl { get; set; } - - [Column("VersionWorkflowID")] - public int? VersionWorkflowId { get; set; } - - [Column("VersionWorkflowStepID")] - public int? VersionWorkflowStepId { get; set; } - - [StringLength(450)] - public string? VersionNodeAliasPath { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [InverseProperty("DocumentCheckedOutVersionHistory")] - public virtual ICollection CmsDocumentDocumentCheckedOutVersionHistories { get; set; } = new List(); - - [InverseProperty("DocumentPublishedVersionHistory")] - public virtual ICollection CmsDocumentDocumentPublishedVersionHistories { get; set; } = new List(); - - [InverseProperty("VersionHistory")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [ForeignKey("ModifiedByUserId")] - [InverseProperty("CmsVersionHistoryModifiedByUsers")] - public virtual CmsUser? ModifiedByUser { get; set; } - - [ForeignKey("NodeSiteId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsSite NodeSite { get; set; } = null!; - - [ForeignKey("VersionClassId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsClass? VersionClass { get; set; } - - [ForeignKey("VersionDeletedByUserId")] - [InverseProperty("CmsVersionHistoryVersionDeletedByUsers")] - public virtual CmsUser? VersionDeletedByUser { get; set; } - - [ForeignKey("VersionWorkflowId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsWorkflow? VersionWorkflow { get; set; } - - [ForeignKey("VersionWorkflowStepId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsWorkflowStep? VersionWorkflowStep { get; set; } - - [ForeignKey("VersionHistoryId")] - [InverseProperty("VersionHistories")] - public virtual ICollection AttachmentHistories { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmServer.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmServer.cs deleted file mode 100644 index a1a9a7c8..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmServer.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebFarmServer")] -[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] -public class CmsWebFarmServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(300)] - public string ServerDisplayName { get; set; } = null!; - - [StringLength(300)] - public string ServerName { get; set; } = null!; - - [Column("ServerGUID")] - public Guid? ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public bool ServerEnabled { get; set; } - - public bool IsExternalWebAppServer { get; set; } - - [InverseProperty("Server")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmServerLog.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmServerLog.cs deleted file mode 100644 index 0e1ec544..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmServerLog.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebFarmServerLog")] -public class CmsWebFarmServerLog -{ - [Key] - [Column("WebFarmServerLogID")] - public int WebFarmServerLogId { get; set; } - - public DateTime LogTime { get; set; } - - [StringLength(200)] - public string LogCode { get; set; } = null!; - - [Column("ServerID")] - public int ServerId { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmServerMonitoring.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmServerMonitoring.cs deleted file mode 100644 index 553bfa16..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmServerMonitoring.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebFarmServerMonitoring")] -public class CmsWebFarmServerMonitoring -{ - [Key] - [Column("WebFarmServerMonitoringID")] - public int WebFarmServerMonitoringId { get; set; } - - [Column("ServerID")] - public int ServerId { get; set; } - - public DateTime? ServerPing { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmServerTask.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmServerTask.cs deleted file mode 100644 index d74cc100..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmServerTask.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("ServerId", "TaskId")] -[Table("CMS_WebFarmServerTask")] -[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] -public class CmsWebFarmServerTask -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - public string? ErrorMessage { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmServer Server { get; set; } = null!; - - [ForeignKey("TaskId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmTask Task { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmTask.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmTask.cs deleted file mode 100644 index ee4ad347..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmTask.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebFarmTask")] -[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] -public class CmsWebFarmTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(100)] - public string TaskType { get; set; } = null!; - - public string? TaskTextData { get; set; } - - public byte[]? TaskBinaryData { get; set; } - - public DateTime? TaskCreated { get; set; } - - public string? TaskTarget { get; set; } - - [StringLength(450)] - public string? TaskMachineName { get; set; } - - [Column("TaskGUID")] - public Guid? TaskGuid { get; set; } - - public bool? TaskIsAnonymous { get; set; } - - public string? TaskErrorMessage { get; set; } - - public bool? TaskIsMemory { get; set; } - - [InverseProperty("Task")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsWebPart.cs b/Migration.Toolkit.KX12/Models/CmsWebPart.cs deleted file mode 100644 index 98c4a2fc..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWebPart.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebPart")] -[Index("WebPartCategoryId", Name = "IX_CMS_WebPart_WebPartCategoryID")] -[Index("WebPartName", Name = "IX_CMS_WebPart_WebPartName")] -[Index("WebPartParentId", Name = "IX_CMS_WebPart_WebPartParentID")] -[Index("WebPartResourceId", Name = "IX_CMS_WebPart_WebPartResourceID")] -public class CmsWebPart -{ - [Key] - [Column("WebPartID")] - public int WebPartId { get; set; } - - [StringLength(100)] - public string WebPartName { get; set; } = null!; - - [StringLength(100)] - public string WebPartDisplayName { get; set; } = null!; - - public string? WebPartDescription { get; set; } - - [StringLength(100)] - public string WebPartFileName { get; set; } = null!; - - public string WebPartProperties { get; set; } = null!; - - [Column("WebPartCategoryID")] - public int WebPartCategoryId { get; set; } - - [Column("WebPartParentID")] - public int? WebPartParentId { get; set; } - - public string? WebPartDocumentation { get; set; } - - [Column("WebPartGUID")] - public Guid WebPartGuid { get; set; } - - public DateTime WebPartLastModified { get; set; } - - public int? WebPartType { get; set; } - - public string? WebPartDefaultValues { get; set; } - - [Column("WebPartResourceID")] - public int? WebPartResourceId { get; set; } - - [Column("WebPartCSS")] - public string? WebPartCss { get; set; } - - public bool? WebPartSkipInsertProperties { get; set; } - - [Column("WebPartThumbnailGUID")] - public Guid? WebPartThumbnailGuid { get; set; } - - public string? WebPartDefaultConfiguration { get; set; } - - [StringLength(200)] - public string? WebPartIconClass { get; set; } - - [InverseProperty("WebPartLayoutWebPart")] - public virtual ICollection CmsWebPartLayouts { get; set; } = new List(); - - [InverseProperty("WidgetWebPart")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [InverseProperty("WebPartParent")] - public virtual ICollection InverseWebPartParent { get; set; } = new List(); - - [ForeignKey("WebPartCategoryId")] - [InverseProperty("CmsWebParts")] - public virtual CmsWebPartCategory WebPartCategory { get; set; } = null!; - - [ForeignKey("WebPartParentId")] - [InverseProperty("InverseWebPartParent")] - public virtual CmsWebPart? WebPartParent { get; set; } - - [ForeignKey("WebPartResourceId")] - [InverseProperty("CmsWebParts")] - public virtual CmsResource? WebPartResource { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsWebPartCategory.cs b/Migration.Toolkit.KX12/Models/CmsWebPartCategory.cs deleted file mode 100644 index 5f061225..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWebPartCategory.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebPartCategory")] -[Index("CategoryParentId", Name = "IX_CMS_WebPartCategory_CategoryParentID")] -public class CmsWebPartCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(100)] - public string CategoryDisplayName { get; set; } = null!; - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(100)] - public string CategoryName { get; set; } = null!; - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public string CategoryPath { get; set; } = null!; - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryWebPartChildCount { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsWebPartCategory? CategoryParent { get; set; } - - [InverseProperty("WebPartCategory")] - public virtual ICollection CmsWebParts { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsWebPartContainer.cs b/Migration.Toolkit.KX12/Models/CmsWebPartContainer.cs deleted file mode 100644 index 4758df2a..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWebPartContainer.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebPartContainer")] -[Index("ContainerName", Name = "IX_CMS_WebPartContainer_ContainerName")] -public class CmsWebPartContainer -{ - [Key] - [Column("ContainerID")] - public int ContainerId { get; set; } - - [StringLength(200)] - public string ContainerDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ContainerName { get; set; } = null!; - - public string? ContainerTextBefore { get; set; } - - public string? ContainerTextAfter { get; set; } - - [Column("ContainerGUID")] - public Guid ContainerGuid { get; set; } - - public DateTime ContainerLastModified { get; set; } - - [Column("ContainerCSS")] - public string? ContainerCss { get; set; } - - [ForeignKey("ContainerId")] - [InverseProperty("Containers")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsWebPartLayout.cs b/Migration.Toolkit.KX12/Models/CmsWebPartLayout.cs deleted file mode 100644 index 23ae7339..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWebPartLayout.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebPartLayout")] -[Index("WebPartLayoutWebPartId", Name = "IX_CMS_WebPartLayout_WebPartLayoutWebPartID")] -public class CmsWebPartLayout -{ - [Key] - [Column("WebPartLayoutID")] - public int WebPartLayoutId { get; set; } - - [StringLength(200)] - public string WebPartLayoutCodeName { get; set; } = null!; - - [StringLength(200)] - public string WebPartLayoutDisplayName { get; set; } = null!; - - public string? WebPartLayoutDescription { get; set; } - - public string? WebPartLayoutCode { get; set; } - - [Column("WebPartLayoutVersionGUID")] - [StringLength(100)] - public string? WebPartLayoutVersionGuid { get; set; } - - [Column("WebPartLayoutWebPartID")] - public int WebPartLayoutWebPartId { get; set; } - - [Column("WebPartLayoutGUID")] - public Guid WebPartLayoutGuid { get; set; } - - public DateTime WebPartLayoutLastModified { get; set; } - - [Column("WebPartLayoutCSS")] - public string? WebPartLayoutCss { get; set; } - - public bool? WebPartLayoutIsDefault { get; set; } - - [InverseProperty("WidgetLayout")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [ForeignKey("WebPartLayoutWebPartId")] - [InverseProperty("CmsWebPartLayouts")] - public virtual CmsWebPart WebPartLayoutWebPart { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsWebTemplate.cs b/Migration.Toolkit.KX12/Models/CmsWebTemplate.cs deleted file mode 100644 index ef3e5469..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWebTemplate.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebTemplate")] -public class CmsWebTemplate -{ - [Key] - [Column("WebTemplateID")] - public int WebTemplateId { get; set; } - - [StringLength(200)] - public string WebTemplateDisplayName { get; set; } = null!; - - [StringLength(100)] - public string WebTemplateFileName { get; set; } = null!; - - public string WebTemplateDescription { get; set; } = null!; - - [Column("WebTemplateGUID")] - public Guid WebTemplateGuid { get; set; } - - public DateTime WebTemplateLastModified { get; set; } - - [StringLength(100)] - public string WebTemplateName { get; set; } = null!; - - public int WebTemplateOrder { get; set; } - - [StringLength(200)] - public string WebTemplateLicenses { get; set; } = null!; - - [Column("WebTemplateThumbnailGUID")] - public Guid? WebTemplateThumbnailGuid { get; set; } - - public string? WebTemplateShortDescription { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsWidget.cs b/Migration.Toolkit.KX12/Models/CmsWidget.cs deleted file mode 100644 index ec075cbb..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWidget.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Widget")] -[Index("WidgetCategoryId", Name = "IX_CMS_Widget_WidgetCategoryID")] -[Index("WidgetIsEnabled", "WidgetForGroup", "WidgetForEditor", "WidgetForUser", Name = "IX_CMS_Widget_WidgetIsEnabled_WidgetForGroup_WidgetForEditor_WidgetForUser")] -[Index("WidgetLayoutId", Name = "IX_CMS_Widget_WidgetLayoutID")] -[Index("WidgetWebPartId", Name = "IX_CMS_Widget_WidgetWebPartID")] -public class CmsWidget -{ - [Key] - [Column("WidgetID")] - public int WidgetId { get; set; } - - [Column("WidgetWebPartID")] - public int WidgetWebPartId { get; set; } - - [StringLength(100)] - public string WidgetDisplayName { get; set; } = null!; - - [StringLength(100)] - public string WidgetName { get; set; } = null!; - - public string? WidgetDescription { get; set; } - - [Column("WidgetCategoryID")] - public int WidgetCategoryId { get; set; } - - public string? WidgetProperties { get; set; } - - public int WidgetSecurity { get; set; } - - [Column("WidgetGUID")] - public Guid WidgetGuid { get; set; } - - public DateTime WidgetLastModified { get; set; } - - public bool WidgetIsEnabled { get; set; } - - public bool WidgetForGroup { get; set; } - - public bool WidgetForEditor { get; set; } - - public bool WidgetForUser { get; set; } - - public bool WidgetForDashboard { get; set; } - - public bool WidgetForInline { get; set; } - - public string? WidgetDocumentation { get; set; } - - public string? WidgetDefaultValues { get; set; } - - [Column("WidgetLayoutID")] - public int? WidgetLayoutId { get; set; } - - public bool? WidgetSkipInsertProperties { get; set; } - - [Column("WidgetThumbnailGUID")] - public Guid? WidgetThumbnailGuid { get; set; } - - [StringLength(200)] - public string? WidgetIconClass { get; set; } - - [InverseProperty("Widget")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [ForeignKey("WidgetCategoryId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWidgetCategory WidgetCategory { get; set; } = null!; - - [ForeignKey("WidgetLayoutId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWebPartLayout? WidgetLayout { get; set; } - - [ForeignKey("WidgetWebPartId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWebPart WidgetWebPart { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsWidgetCategory.cs b/Migration.Toolkit.KX12/Models/CmsWidgetCategory.cs deleted file mode 100644 index 0a9bfd57..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWidgetCategory.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WidgetCategory")] -[Index("WidgetCategoryParentId", Name = "IX_CMS_WidgetCategory_WidgetCategoryParentID")] -public class CmsWidgetCategory -{ - [Key] - [Column("WidgetCategoryID")] - public int WidgetCategoryId { get; set; } - - [StringLength(100)] - public string WidgetCategoryName { get; set; } = null!; - - [StringLength(100)] - public string WidgetCategoryDisplayName { get; set; } = null!; - - [Column("WidgetCategoryParentID")] - public int? WidgetCategoryParentId { get; set; } - - public string WidgetCategoryPath { get; set; } = null!; - - public int WidgetCategoryLevel { get; set; } - - public int? WidgetCategoryChildCount { get; set; } - - public int? WidgetCategoryWidgetChildCount { get; set; } - - [StringLength(450)] - public string? WidgetCategoryImagePath { get; set; } - - [Column("WidgetCategoryGUID")] - public Guid WidgetCategoryGuid { get; set; } - - public DateTime WidgetCategoryLastModified { get; set; } - - [InverseProperty("WidgetCategory")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [InverseProperty("WidgetCategoryParent")] - public virtual ICollection InverseWidgetCategoryParent { get; set; } = new List(); - - [ForeignKey("WidgetCategoryParentId")] - [InverseProperty("InverseWidgetCategoryParent")] - public virtual CmsWidgetCategory? WidgetCategoryParent { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/CmsWidgetRole.cs b/Migration.Toolkit.KX12/Models/CmsWidgetRole.cs deleted file mode 100644 index 055d60d4..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWidgetRole.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("WidgetId", "RoleId", "PermissionId")] -[Table("CMS_WidgetRole")] -[Index("PermissionId", Name = "IX_CMS_WidgetRole_PermissionID")] -[Index("RoleId", Name = "IX_CMS_WidgetRole_RoleID")] -public class CmsWidgetRole -{ - [Key] - [Column("WidgetID")] - public int WidgetId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("PermissionId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("WidgetId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsWidget Widget { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflow.cs b/Migration.Toolkit.KX12/Models/CmsWorkflow.cs deleted file mode 100644 index 0edcfa70..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWorkflow.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Workflow")] -public class CmsWorkflow -{ - [Key] - [Column("WorkflowID")] - public int WorkflowId { get; set; } - - public string WorkflowDisplayName { get; set; } = null!; - - [StringLength(450)] - public string WorkflowName { get; set; } = null!; - - [Column("WorkflowGUID")] - public Guid WorkflowGuid { get; set; } - - public DateTime WorkflowLastModified { get; set; } - - public bool? WorkflowAutoPublishChanges { get; set; } - - public bool? WorkflowUseCheckinCheckout { get; set; } - - public int? WorkflowType { get; set; } - - public bool? WorkflowSendEmails { get; set; } - - public bool? WorkflowSendApproveEmails { get; set; } - - public bool? WorkflowSendRejectEmails { get; set; } - - public bool? WorkflowSendPublishEmails { get; set; } - - public bool? WorkflowSendArchiveEmails { get; set; } - - [StringLength(200)] - public string? WorkflowApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowPublishedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowArchivedTemplateName { get; set; } - - public bool? WorkflowSendReadyForApprovalEmails { get; set; } - - [StringLength(200)] - public string? WorkflowReadyForApprovalTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowNotificationTemplateName { get; set; } - - public string? WorkflowAllowedObjects { get; set; } - - public int? WorkflowRecurrenceType { get; set; } - - [Required] - public bool? WorkflowEnabled { get; set; } - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateWorkflow")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("TriggerWorkflow")] - public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); - - [InverseProperty("VersionWorkflow")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [InverseProperty("ScopeWorkflow")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [InverseProperty("StepWorkflow")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); - - [InverseProperty("TransitionWorkflow")] - public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); - - [ForeignKey("WorkflowId")] - [InverseProperty("Workflows")] - public virtual ICollection Users { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowAction.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowAction.cs deleted file mode 100644 index 592d0ca4..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowAction.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowAction")] -[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] -public class CmsWorkflowAction -{ - [Key] - [Column("ActionID")] - public int ActionId { get; set; } - - [StringLength(200)] - public string ActionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ActionName { get; set; } = null!; - - public string? ActionParameters { get; set; } - - public string? ActionDescription { get; set; } - - [StringLength(200)] - public string ActionAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string ActionClass { get; set; } = null!; - - [Column("ActionResourceID")] - public int? ActionResourceId { get; set; } - - [Column("ActionThumbnailGUID")] - public Guid? ActionThumbnailGuid { get; set; } - - [Column("ActionGUID")] - public Guid ActionGuid { get; set; } - - public DateTime ActionLastModified { get; set; } - - [Required] - public bool? ActionEnabled { get; set; } - - public string? ActionAllowedObjects { get; set; } - - [Column("ActionIconGUID")] - public Guid? ActionIconGuid { get; set; } - - public int? ActionWorkflowType { get; set; } - - [StringLength(200)] - public string? ActionIconClass { get; set; } - - [StringLength(200)] - public string? ActionThumbnailClass { get; set; } - - [ForeignKey("ActionResourceId")] - [InverseProperty("CmsWorkflowActions")] - public virtual CmsResource? ActionResource { get; set; } - - [InverseProperty("StepAction")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowHistory.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowHistory.cs deleted file mode 100644 index e40dd5dd..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowHistory.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowHistory")] -[Index("ApprovedByUserId", Name = "IX_CMS_WorkflowHistory_ApprovedByUserID")] -[Index("ApprovedWhen", Name = "IX_CMS_WorkflowHistory_ApprovedWhen")] -[Index("HistoryWorkflowId", Name = "IX_CMS_WorkflowHistory_HistoryWorkflowID")] -[Index("StepId", Name = "IX_CMS_WorkflowHistory_StepID")] -[Index("TargetStepId", Name = "IX_CMS_WorkflowHistory_TargetStepID")] -[Index("VersionHistoryId", Name = "IX_CMS_WorkflowHistory_VersionHistoryID")] -public class CmsWorkflowHistory -{ - [Key] - [Column("WorkflowHistoryID")] - public int WorkflowHistoryId { get; set; } - - [Column("VersionHistoryID")] - public int VersionHistoryId { get; set; } - - [Column("StepID")] - public int? StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [Column("ApprovedByUserID")] - public int? ApprovedByUserId { get; set; } - - public DateTime? ApprovedWhen { get; set; } - - public string? Comment { get; set; } - - public bool WasRejected { get; set; } - - [StringLength(440)] - public string? StepName { get; set; } - - [Column("TargetStepID")] - public int? TargetStepId { get; set; } - - [StringLength(440)] - public string? TargetStepName { get; set; } - - [StringLength(450)] - public string? TargetStepDisplayName { get; set; } - - public int? StepType { get; set; } - - public int? TargetStepType { get; set; } - - [StringLength(100)] - public string? HistoryObjectType { get; set; } - - [Column("HistoryObjectID")] - public int? HistoryObjectId { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int? HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - [ForeignKey("ApprovedByUserId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsUser? ApprovedByUser { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsWorkflow? HistoryWorkflow { get; set; } - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowHistorySteps")] - public virtual CmsWorkflowStep? Step { get; set; } - - [ForeignKey("TargetStepId")] - [InverseProperty("CmsWorkflowHistoryTargetSteps")] - public virtual CmsWorkflowStep? TargetStep { get; set; } - - [ForeignKey("VersionHistoryId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsVersionHistory VersionHistory { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowScope.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowScope.cs deleted file mode 100644 index 5f3147c9..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowScope.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowScope")] -[Index("ScopeClassId", Name = "IX_CMS_WorkflowScope_ScopeClassID")] -[Index("ScopeCultureId", Name = "IX_CMS_WorkflowScope_ScopeCultureID")] -[Index("ScopeSiteId", Name = "IX_CMS_WorkflowScope_ScopeSiteID")] -[Index("ScopeWorkflowId", Name = "IX_CMS_WorkflowScope_ScopeWorkflowID")] -public class CmsWorkflowScope -{ - [Key] - [Column("ScopeID")] - public int ScopeId { get; set; } - - public string ScopeStartingPath { get; set; } = null!; - - [Column("ScopeWorkflowID")] - public int ScopeWorkflowId { get; set; } - - [Column("ScopeClassID")] - public int? ScopeClassId { get; set; } - - [Column("ScopeSiteID")] - public int ScopeSiteId { get; set; } - - [Column("ScopeGUID")] - public Guid ScopeGuid { get; set; } - - public DateTime ScopeLastModified { get; set; } - - [Column("ScopeCultureID")] - public int? ScopeCultureId { get; set; } - - public bool? ScopeExcludeChildren { get; set; } - - public bool ScopeExcluded { get; set; } - - public string? ScopeMacroCondition { get; set; } - - [ForeignKey("ScopeClassId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsClass? ScopeClass { get; set; } - - [ForeignKey("ScopeCultureId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsCulture? ScopeCulture { get; set; } - - [ForeignKey("ScopeSiteId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsSite ScopeSite { get; set; } = null!; - - [ForeignKey("ScopeWorkflowId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsWorkflow ScopeWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowStep.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowStep.cs deleted file mode 100644 index a9abf9a1..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowStep.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowStep")] -[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] -[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] -[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] -[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] -public class CmsWorkflowStep -{ - [Key] - [Column("StepID")] - public int StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [StringLength(440)] - public string? StepName { get; set; } - - public int? StepOrder { get; set; } - - [Column("StepWorkflowID")] - public int StepWorkflowId { get; set; } - - [Column("StepGUID")] - public Guid StepGuid { get; set; } - - public DateTime StepLastModified { get; set; } - - public int? StepType { get; set; } - - public bool? StepAllowReject { get; set; } - - public string? StepDefinition { get; set; } - - public int? StepRolesSecurity { get; set; } - - public int? StepUsersSecurity { get; set; } - - [StringLength(200)] - public string? StepApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? StepRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? StepReadyforApprovalTemplateName { get; set; } - - public bool? StepSendApproveEmails { get; set; } - - public bool? StepSendRejectEmails { get; set; } - - public bool? StepSendReadyForApprovalEmails { get; set; } - - public bool? StepSendEmails { get; set; } - - public bool? StepAllowPublish { get; set; } - - [Column("StepActionID")] - public int? StepActionId { get; set; } - - public string? StepActionParameters { get; set; } - - public int? StepWorkflowType { get; set; } - - [InverseProperty("HistoryStep")] - public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); - - [InverseProperty("HistoryTargetStep")] - public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("StateStep")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("DocumentWorkflowStep")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("ObjectWorkflowStep")] - public virtual ICollection CmsObjectSettings { get; set; } = new List(); - - [InverseProperty("VersionWorkflowStep")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowHistorySteps { get; set; } = new List(); - - [InverseProperty("TargetStep")] - public virtual ICollection CmsWorkflowHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); - - [InverseProperty("TransitionEndStep")] - public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); - - [InverseProperty("TransitionStartStep")] - public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); - - [ForeignKey("StepActionId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflowAction? StepAction { get; set; } - - [ForeignKey("StepWorkflowId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflow StepWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowStepRole.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowStepRole.cs deleted file mode 100644 index affcb3e5..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowStepRole.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowStepRoles")] -[Index("RoleId", Name = "IX_CMS_WorkflowStepRoles_RoleID")] -public class CmsWorkflowStepRole -{ - [Key] - [Column("WorkflowStepRoleID")] - public int WorkflowStepRoleId { get; set; } - - [Column("StepID")] - public int StepId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [Column("StepSourcePointGUID")] - public Guid? StepSourcePointGuid { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsWorkflowStepRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowStepRoles")] - public virtual CmsWorkflowStep Step { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowStepUser.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowStepUser.cs deleted file mode 100644 index 585f691c..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowStepUser.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowStepUser")] -[Index("UserId", Name = "IX_CMS_WorkflowStepUser_UserID")] -public class CmsWorkflowStepUser -{ - [Key] - [Column("WorkflowStepUserID")] - public int WorkflowStepUserId { get; set; } - - [Column("StepID")] - public int StepId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("StepSourcePointGUID")] - public Guid? StepSourcePointGuid { get; set; } - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowStepUsers")] - public virtual CmsWorkflowStep Step { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsWorkflowStepUsers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowTransition.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowTransition.cs deleted file mode 100644 index 8addb31c..00000000 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowTransition.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowTransition")] -[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] -[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] -[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] -public class CmsWorkflowTransition -{ - [Key] - [Column("TransitionID")] - public int TransitionId { get; set; } - - [Column("TransitionStartStepID")] - public int TransitionStartStepId { get; set; } - - [Column("TransitionEndStepID")] - public int TransitionEndStepId { get; set; } - - public int TransitionType { get; set; } - - public DateTime TransitionLastModified { get; set; } - - [Column("TransitionSourcePointGUID")] - public Guid? TransitionSourcePointGuid { get; set; } - - [Column("TransitionWorkflowID")] - public int TransitionWorkflowId { get; set; } - - [ForeignKey("TransitionEndStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] - public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; - - [ForeignKey("TransitionStartStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] - public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; - - [ForeignKey("TransitionWorkflowId")] - [InverseProperty("CmsWorkflowTransitions")] - public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComAddress.cs b/Migration.Toolkit.KX12/Models/ComAddress.cs deleted file mode 100644 index 8a922a3d..00000000 --- a/Migration.Toolkit.KX12/Models/ComAddress.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Address")] -[Index("AddressCountryId", Name = "IX_COM_Address_AddressCountryID")] -[Index("AddressCustomerId", Name = "IX_COM_Address_AddressCustomerID")] -[Index("AddressStateId", Name = "IX_COM_Address_AddressStateID")] -public class ComAddress -{ - [Key] - [Column("AddressID")] - public int AddressId { get; set; } - - [StringLength(200)] - public string AddressName { get; set; } = null!; - - [StringLength(100)] - public string AddressLine1 { get; set; } = null!; - - [StringLength(100)] - public string? AddressLine2 { get; set; } - - [StringLength(100)] - public string AddressCity { get; set; } = null!; - - [StringLength(20)] - public string AddressZip { get; set; } = null!; - - [StringLength(26)] - public string? AddressPhone { get; set; } - - [Column("AddressCustomerID")] - public int AddressCustomerId { get; set; } - - [Column("AddressCountryID")] - public int AddressCountryId { get; set; } - - [Column("AddressStateID")] - public int? AddressStateId { get; set; } - - [StringLength(200)] - public string AddressPersonalName { get; set; } = null!; - - [Column("AddressGUID")] - public Guid? AddressGuid { get; set; } - - public DateTime AddressLastModified { get; set; } - - [ForeignKey("AddressCountryId")] - [InverseProperty("ComAddresses")] - public virtual CmsCountry AddressCountry { get; set; } = null!; - - [ForeignKey("AddressCustomerId")] - [InverseProperty("ComAddresses")] - public virtual ComCustomer AddressCustomer { get; set; } = null!; - - [ForeignKey("AddressStateId")] - [InverseProperty("ComAddresses")] - public virtual CmsState? AddressState { get; set; } - - [InverseProperty("ShoppingCartBillingAddress")] - public virtual ICollection ComShoppingCartShoppingCartBillingAddresses { get; set; } = new List(); - - [InverseProperty("ShoppingCartCompanyAddress")] - public virtual ICollection ComShoppingCartShoppingCartCompanyAddresses { get; set; } = new List(); - - [InverseProperty("ShoppingCartShippingAddress")] - public virtual ICollection ComShoppingCartShoppingCartShippingAddresses { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/ComBrand.cs b/Migration.Toolkit.KX12/Models/ComBrand.cs deleted file mode 100644 index 17b0eedc..00000000 --- a/Migration.Toolkit.KX12/Models/ComBrand.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Brand")] -[Index("BrandDisplayName", Name = "IX_COM_Brand_BrandDisplayName")] -[Index("BrandSiteId", "BrandEnabled", Name = "IX_COM_Brand_BrandSiteID_BrandEnabled")] -public class ComBrand -{ - [Key] - [Column("BrandID")] - public int BrandId { get; set; } - - [StringLength(200)] - public string BrandDisplayName { get; set; } = null!; - - [StringLength(200)] - public string BrandName { get; set; } = null!; - - public string? BrandDescription { get; set; } - - [StringLength(400)] - public string? BrandHomepage { get; set; } - - [Column("BrandThumbnailGUID")] - public Guid? BrandThumbnailGuid { get; set; } - - [Column("BrandSiteID")] - public int BrandSiteId { get; set; } - - [Required] - public bool? BrandEnabled { get; set; } - - public Guid BrandGuid { get; set; } - - public DateTime BrandLastModified { get; set; } - - [ForeignKey("BrandSiteId")] - [InverseProperty("ComBrands")] - public virtual CmsSite BrandSite { get; set; } = null!; - - [InverseProperty("Brand")] - public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); - - [InverseProperty("Skubrand")] - public virtual ICollection ComSkus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/ComCarrier.cs b/Migration.Toolkit.KX12/Models/ComCarrier.cs deleted file mode 100644 index 24913c84..00000000 --- a/Migration.Toolkit.KX12/Models/ComCarrier.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Carrier")] -[Index("CarrierSiteId", Name = "IX_COM_Carrier_CarrierSiteID")] -public class ComCarrier -{ - [Key] - [Column("CarrierID")] - public int CarrierId { get; set; } - - [StringLength(200)] - public string CarrierDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CarrierName { get; set; } = null!; - - [Column("CarrierSiteID")] - public int CarrierSiteId { get; set; } - - [Column("CarrierGUID")] - public Guid CarrierGuid { get; set; } - - [StringLength(200)] - public string CarrierAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string CarrierClassName { get; set; } = null!; - - public DateTime CarrierLastModified { get; set; } - - [ForeignKey("CarrierSiteId")] - [InverseProperty("ComCarriers")] - public virtual CmsSite CarrierSite { get; set; } = null!; - - [InverseProperty("ShippingOptionCarrier")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/ComCollection.cs b/Migration.Toolkit.KX12/Models/ComCollection.cs deleted file mode 100644 index c32244fb..00000000 --- a/Migration.Toolkit.KX12/Models/ComCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Collection")] -[Index("CollectionDisplayName", Name = "IX_COM_Collection_CollectionDisplayName")] -[Index("CollectionSiteId", "CollectionEnabled", Name = "IX_COM_Collection_CollectionSiteID_CollectionEnabled")] -public class ComCollection -{ - [Key] - [Column("CollectionID")] - public int CollectionId { get; set; } - - [StringLength(200)] - public string CollectionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CollectionName { get; set; } = null!; - - public string? CollectionDescription { get; set; } - - [Column("CollectionSiteID")] - public int CollectionSiteId { get; set; } - - [Required] - public bool? CollectionEnabled { get; set; } - - public Guid CollectionGuid { get; set; } - - public DateTime CollectionLastModified { get; set; } - - [ForeignKey("CollectionSiteId")] - [InverseProperty("ComCollections")] - public virtual CmsSite CollectionSite { get; set; } = null!; - - [InverseProperty("Collection")] - public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); - - [InverseProperty("Skucollection")] - public virtual ICollection ComSkus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/ComCouponCode.cs b/Migration.Toolkit.KX12/Models/ComCouponCode.cs deleted file mode 100644 index b86b754e..00000000 --- a/Migration.Toolkit.KX12/Models/ComCouponCode.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_CouponCode")] -[Index("CouponCodeDiscountId", Name = "IX_COM_CouponCode_CouponCodeDiscountID")] -public class ComCouponCode -{ - [Key] - [Column("CouponCodeID")] - public int CouponCodeId { get; set; } - - [StringLength(200)] - public string CouponCodeCode { get; set; } = null!; - - public int? CouponCodeUseCount { get; set; } - - public int? CouponCodeUseLimit { get; set; } - - [Column("CouponCodeDiscountID")] - public int CouponCodeDiscountId { get; set; } - - public DateTime CouponCodeLastModified { get; set; } - - [Column("CouponCodeGUID")] - public Guid CouponCodeGuid { get; set; } - - [ForeignKey("CouponCodeDiscountId")] - [InverseProperty("ComCouponCodes")] - public virtual ComDiscount CouponCodeDiscount { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComCurrency.cs b/Migration.Toolkit.KX12/Models/ComCurrency.cs deleted file mode 100644 index 5cd61cd4..00000000 --- a/Migration.Toolkit.KX12/Models/ComCurrency.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Currency")] -[Index("CurrencyDisplayName", Name = "IX_COM_Currency_CurrencyDisplayName")] -[Index("CurrencySiteId", Name = "IX_COM_Currency_CurrencySiteID")] -public class ComCurrency -{ - [Key] - [Column("CurrencyID")] - public int CurrencyId { get; set; } - - [StringLength(200)] - public string CurrencyName { get; set; } = null!; - - [StringLength(200)] - public string CurrencyDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CurrencyCode { get; set; } = null!; - - public int? CurrencyRoundTo { get; set; } - - public bool CurrencyEnabled { get; set; } - - [StringLength(200)] - public string CurrencyFormatString { get; set; } = null!; - - public bool CurrencyIsMain { get; set; } - - [Column("CurrencyGUID")] - public Guid? CurrencyGuid { get; set; } - - public DateTime CurrencyLastModified { get; set; } - - [Column("CurrencySiteID")] - public int? CurrencySiteId { get; set; } - - [InverseProperty("ExchangeRateToCurrency")] - public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); - - [InverseProperty("OrderCurrency")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartCurrency")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("CurrencySiteId")] - [InverseProperty("ComCurrencies")] - public virtual CmsSite? CurrencySite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComCurrencyExchangeRate.cs b/Migration.Toolkit.KX12/Models/ComCurrencyExchangeRate.cs deleted file mode 100644 index 6e6d04ba..00000000 --- a/Migration.Toolkit.KX12/Models/ComCurrencyExchangeRate.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_CurrencyExchangeRate")] -[Index("ExchangeRateToCurrencyId", Name = "IX_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID")] -[Index("ExchangeTableId", Name = "IX_COM_CurrencyExchangeRate_ExchangeTableID")] -public class ComCurrencyExchangeRate -{ - [Key] - [Column("ExchagneRateID")] - public int ExchagneRateId { get; set; } - - [Column("ExchangeRateToCurrencyID")] - public int ExchangeRateToCurrencyId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal ExchangeRateValue { get; set; } - - [Column("ExchangeTableID")] - public int ExchangeTableId { get; set; } - - [Column("ExchangeRateGUID")] - public Guid ExchangeRateGuid { get; set; } - - public DateTime ExchangeRateLastModified { get; set; } - - [ForeignKey("ExchangeRateToCurrencyId")] - [InverseProperty("ComCurrencyExchangeRates")] - public virtual ComCurrency ExchangeRateToCurrency { get; set; } = null!; - - [ForeignKey("ExchangeTableId")] - [InverseProperty("ComCurrencyExchangeRates")] - public virtual ComExchangeTable ExchangeTable { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComCustomer.cs b/Migration.Toolkit.KX12/Models/ComCustomer.cs deleted file mode 100644 index 005c6c11..00000000 --- a/Migration.Toolkit.KX12/Models/ComCustomer.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Customer")] -[Index("CustomerEmail", Name = "IX_COM_Customer_CustomerEmail")] -[Index("CustomerFirstName", Name = "IX_COM_Customer_CustomerFirstName")] -[Index("CustomerLastName", Name = "IX_COM_Customer_CustomerLastName")] -[Index("CustomerSiteId", Name = "IX_COM_Customer_CustomerSiteID")] -[Index("CustomerUserId", Name = "IX_COM_Customer_CustomerUserID")] -public class ComCustomer -{ - [Key] - [Column("CustomerID")] - public int CustomerId { get; set; } - - [StringLength(200)] - public string CustomerFirstName { get; set; } = null!; - - [StringLength(200)] - public string CustomerLastName { get; set; } = null!; - - [StringLength(254)] - public string? CustomerEmail { get; set; } - - [StringLength(26)] - public string? CustomerPhone { get; set; } - - [StringLength(50)] - public string? CustomerFax { get; set; } - - [StringLength(200)] - public string? CustomerCompany { get; set; } - - [Column("CustomerUserID")] - public int? CustomerUserId { get; set; } - - [Column("CustomerGUID")] - public Guid CustomerGuid { get; set; } - - [Column("CustomerTaxRegistrationID")] - [StringLength(50)] - public string? CustomerTaxRegistrationId { get; set; } - - [Column("CustomerOrganizationID")] - [StringLength(50)] - public string? CustomerOrganizationId { get; set; } - - public DateTime CustomerLastModified { get; set; } - - [Column("CustomerSiteID")] - public int? CustomerSiteId { get; set; } - - public DateTime? CustomerCreated { get; set; } - - [InverseProperty("AddressCustomer")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("EventCustomer")] - public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); - - [InverseProperty("OrderCustomer")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartCustomer")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("CustomerSiteId")] - [InverseProperty("ComCustomers")] - public virtual CmsSite? CustomerSite { get; set; } - - [ForeignKey("CustomerUserId")] - [InverseProperty("ComCustomers")] - public virtual CmsUser? CustomerUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComCustomerCreditHistory.cs b/Migration.Toolkit.KX12/Models/ComCustomerCreditHistory.cs deleted file mode 100644 index 3d597d99..00000000 --- a/Migration.Toolkit.KX12/Models/ComCustomerCreditHistory.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_CustomerCreditHistory")] -[Index("EventCustomerId", "EventDate", Name = "IX_COM_CustomerCreditHistory_EventCustomerID_EventDate", IsDescending = new[] { false, true })] -[Index("EventSiteId", Name = "IX_COM_CustomerCreditHistory_EventSiteID")] -public class ComCustomerCreditHistory -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(200)] - public string EventName { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal EventCreditChange { get; set; } - - public DateTime EventDate { get; set; } - - public string? EventDescription { get; set; } - - [Column("EventCustomerID")] - public int EventCustomerId { get; set; } - - [Column("EventCreditGUID")] - public Guid? EventCreditGuid { get; set; } - - public DateTime EventCreditLastModified { get; set; } - - [Column("EventSiteID")] - public int? EventSiteId { get; set; } - - [ForeignKey("EventCustomerId")] - [InverseProperty("ComCustomerCreditHistories")] - public virtual ComCustomer EventCustomer { get; set; } = null!; - - [ForeignKey("EventSiteId")] - [InverseProperty("ComCustomerCreditHistories")] - public virtual CmsSite? EventSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComDepartment.cs b/Migration.Toolkit.KX12/Models/ComDepartment.cs deleted file mode 100644 index e37c85ec..00000000 --- a/Migration.Toolkit.KX12/Models/ComDepartment.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Department")] -[Index("DepartmentDefaultTaxClassId", Name = "IX_COM_Department_DepartmentDefaultTaxClassID")] -[Index("DepartmentDisplayName", Name = "IX_COM_Department_DepartmentDisplayName")] -[Index("DepartmentName", "DepartmentSiteId", Name = "IX_COM_Department_DepartmentName_DepartmentSiteID", IsUnique = true)] -[Index("DepartmentSiteId", Name = "IX_COM_Department_DepartmentSiteID")] -public class ComDepartment -{ - [Key] - [Column("DepartmentID")] - public int DepartmentId { get; set; } - - [StringLength(200)] - public string DepartmentName { get; set; } = null!; - - [StringLength(200)] - public string DepartmentDisplayName { get; set; } = null!; - - [Column("DepartmentDefaultTaxClassID")] - public int? DepartmentDefaultTaxClassId { get; set; } - - [Column("DepartmentGUID")] - public Guid DepartmentGuid { get; set; } - - public DateTime DepartmentLastModified { get; set; } - - [Column("DepartmentSiteID")] - public int? DepartmentSiteId { get; set; } - - [InverseProperty("Skudepartment")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("DepartmentDefaultTaxClassId")] - [InverseProperty("ComDepartments")] - public virtual ComTaxClass? DepartmentDefaultTaxClass { get; set; } - - [ForeignKey("DepartmentSiteId")] - [InverseProperty("ComDepartments")] - public virtual CmsSite? DepartmentSite { get; set; } - - [ForeignKey("DepartmentId")] - [InverseProperty("Departments")] - public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/ComDiscount.cs b/Migration.Toolkit.KX12/Models/ComDiscount.cs deleted file mode 100644 index a0456109..00000000 --- a/Migration.Toolkit.KX12/Models/ComDiscount.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Discount")] -[Index("DiscountSiteId", Name = "IX_COM_Discount_DiscountSiteID")] -public class ComDiscount -{ - [Key] - [Column("DiscountID")] - public int DiscountId { get; set; } - - [StringLength(200)] - public string DiscountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string DiscountName { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal DiscountValue { get; set; } - - [Required] - public bool? DiscountEnabled { get; set; } - - [Column("DiscountGUID")] - public Guid DiscountGuid { get; set; } - - public DateTime DiscountLastModified { get; set; } - - [Column("DiscountSiteID")] - public int DiscountSiteId { get; set; } - - public string? DiscountDescription { get; set; } - - public DateTime? DiscountValidFrom { get; set; } - - public DateTime? DiscountValidTo { get; set; } - - public double DiscountOrder { get; set; } - - public string? DiscountProductCondition { get; set; } - - [StringLength(400)] - public string? DiscountRoles { get; set; } - - [StringLength(200)] - public string? DiscountCustomerRestriction { get; set; } - - public bool DiscountIsFlat { get; set; } - - public string? DiscountCartCondition { get; set; } - - [StringLength(100)] - public string DiscountApplyTo { get; set; } = null!; - - [Required] - public bool? DiscountApplyFurtherDiscounts { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? DiscountOrderAmount { get; set; } - - public bool DiscountUsesCoupons { get; set; } - - [InverseProperty("CouponCodeDiscount")] - public virtual ICollection ComCouponCodes { get; set; } = new List(); - - [ForeignKey("DiscountSiteId")] - [InverseProperty("ComDiscounts")] - public virtual CmsSite DiscountSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComExchangeTable.cs b/Migration.Toolkit.KX12/Models/ComExchangeTable.cs deleted file mode 100644 index 9f397979..00000000 --- a/Migration.Toolkit.KX12/Models/ComExchangeTable.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_ExchangeTable")] -[Index("ExchangeTableSiteId", Name = "IX_COM_ExchangeTable_ExchangeTableSiteID")] -public class ComExchangeTable -{ - [Key] - [Column("ExchangeTableID")] - public int ExchangeTableId { get; set; } - - [StringLength(200)] - public string ExchangeTableDisplayName { get; set; } = null!; - - public DateTime? ExchangeTableValidFrom { get; set; } - - public DateTime? ExchangeTableValidTo { get; set; } - - [Column("ExchangeTableGUID")] - public Guid ExchangeTableGuid { get; set; } - - public DateTime ExchangeTableLastModified { get; set; } - - [Column("ExchangeTableSiteID")] - public int? ExchangeTableSiteId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? ExchangeTableRateFromGlobalCurrency { get; set; } - - [InverseProperty("ExchangeTable")] - public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); - - [ForeignKey("ExchangeTableSiteId")] - [InverseProperty("ComExchangeTables")] - public virtual CmsSite? ExchangeTableSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComGiftCard.cs b/Migration.Toolkit.KX12/Models/ComGiftCard.cs deleted file mode 100644 index 20480743..00000000 --- a/Migration.Toolkit.KX12/Models/ComGiftCard.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_GiftCard")] -[Index("GiftCardSiteId", Name = "IX_COM_GiftCard_GiftCardSiteID")] -public class ComGiftCard -{ - [Key] - [Column("GiftCardID")] - public int GiftCardId { get; set; } - - public Guid GiftCardGuid { get; set; } - - [StringLength(200)] - public string GiftCardDisplayName { get; set; } = null!; - - [StringLength(200)] - public string GiftCardName { get; set; } = null!; - - public string? GiftCardDescription { get; set; } - - [Required] - public bool? GiftCardEnabled { get; set; } - - public DateTime GiftCardLastModified { get; set; } - - [Column("GiftCardSiteID")] - public int GiftCardSiteId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal GiftCardValue { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? GiftCardMinimumOrderPrice { get; set; } - - public string? GiftCardCartCondition { get; set; } - - public DateTime? GiftCardValidFrom { get; set; } - - public DateTime? GiftCardValidTo { get; set; } - - [StringLength(200)] - public string? GiftCardCustomerRestriction { get; set; } - - [StringLength(400)] - public string? GiftCardRoles { get; set; } - - [InverseProperty("GiftCardCouponCodeGiftCard")] - public virtual ICollection ComGiftCardCouponCodes { get; set; } = new List(); - - [ForeignKey("GiftCardSiteId")] - [InverseProperty("ComGiftCards")] - public virtual CmsSite GiftCardSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComGiftCardCouponCode.cs b/Migration.Toolkit.KX12/Models/ComGiftCardCouponCode.cs deleted file mode 100644 index 8e6a61ce..00000000 --- a/Migration.Toolkit.KX12/Models/ComGiftCardCouponCode.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_GiftCardCouponCode")] -[Index("GiftCardCouponCodeGiftCardId", Name = "IX_COM_GiftCardCouponCodeGiftCardID")] -public class ComGiftCardCouponCode -{ - [Key] - [Column("GiftCardCouponCodeID")] - public int GiftCardCouponCodeId { get; set; } - - [StringLength(200)] - public string GiftCardCouponCodeCode { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal GiftCardCouponCodeRemainingValue { get; set; } - - [Column("GiftCardCouponCodeGiftCardID")] - public int GiftCardCouponCodeGiftCardId { get; set; } - - public Guid GiftCardCouponCodeGuid { get; set; } - - public DateTime GiftCardCouponCodeLastModified { get; set; } - - [ForeignKey("GiftCardCouponCodeGiftCardId")] - [InverseProperty("ComGiftCardCouponCodes")] - public virtual ComGiftCard GiftCardCouponCodeGiftCard { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComInternalStatus.cs b/Migration.Toolkit.KX12/Models/ComInternalStatus.cs deleted file mode 100644 index 5d107f94..00000000 --- a/Migration.Toolkit.KX12/Models/ComInternalStatus.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_InternalStatus")] -[Index("InternalStatusSiteId", "InternalStatusDisplayName", "InternalStatusEnabled", Name = "IX_COM_InternalStatus_InternalStatusSiteID_InternalStatusDisplayName_InternalStatusEnabled")] -public class ComInternalStatus -{ - [Key] - [Column("InternalStatusID")] - public int InternalStatusId { get; set; } - - [StringLength(200)] - public string InternalStatusName { get; set; } = null!; - - [StringLength(200)] - public string InternalStatusDisplayName { get; set; } = null!; - - [Required] - public bool? InternalStatusEnabled { get; set; } - - [Column("InternalStatusGUID")] - public Guid InternalStatusGuid { get; set; } - - public DateTime InternalStatusLastModified { get; set; } - - [Column("InternalStatusSiteID")] - public int? InternalStatusSiteId { get; set; } - - [InverseProperty("SkuinternalStatus")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("InternalStatusSiteId")] - [InverseProperty("ComInternalStatuses")] - public virtual CmsSite? InternalStatusSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComManufacturer.cs b/Migration.Toolkit.KX12/Models/ComManufacturer.cs deleted file mode 100644 index f9811b76..00000000 --- a/Migration.Toolkit.KX12/Models/ComManufacturer.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Manufacturer")] -[Index("ManufacturerSiteId", Name = "IX_COM_Manufacturer_ManufacturerSiteID")] -public class ComManufacturer -{ - [Key] - [Column("ManufacturerID")] - public int ManufacturerId { get; set; } - - [StringLength(200)] - public string ManufacturerDisplayName { get; set; } = null!; - - [StringLength(400)] - public string? ManufactureHomepage { get; set; } - - [Required] - public bool? ManufacturerEnabled { get; set; } - - [Column("ManufacturerGUID")] - public Guid ManufacturerGuid { get; set; } - - public DateTime ManufacturerLastModified { get; set; } - - [Column("ManufacturerSiteID")] - public int? ManufacturerSiteId { get; set; } - - [Column("ManufacturerThumbnailGUID")] - public Guid? ManufacturerThumbnailGuid { get; set; } - - public string? ManufacturerDescription { get; set; } - - [StringLength(200)] - public string? ManufacturerName { get; set; } - - [InverseProperty("Skumanufacturer")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("ManufacturerSiteId")] - [InverseProperty("ComManufacturers")] - public virtual CmsSite? ManufacturerSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyCouponCode.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyCouponCode.cs deleted file mode 100644 index 8a2ae371..00000000 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyCouponCode.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_MultiBuyCouponCode")] -[Index("MultiBuyCouponCodeMultiBuyDiscountId", Name = "IX_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID")] -public class ComMultiBuyCouponCode -{ - [Key] - [Column("MultiBuyCouponCodeID")] - public int MultiBuyCouponCodeId { get; set; } - - [StringLength(200)] - public string MultiBuyCouponCodeCode { get; set; } = null!; - - public int? MultiBuyCouponCodeUseLimit { get; set; } - - public int? MultiBuyCouponCodeUseCount { get; set; } - - [Column("MultiBuyCouponCodeMultiBuyDiscountID")] - public int MultiBuyCouponCodeMultiBuyDiscountId { get; set; } - - public DateTime MultiBuyCouponCodeLastModified { get; set; } - - [Column("MultiBuyCouponCodeGUID")] - public Guid MultiBuyCouponCodeGuid { get; set; } - - [ForeignKey("MultiBuyCouponCodeMultiBuyDiscountId")] - [InverseProperty("ComMultiBuyCouponCodes")] - public virtual ComMultiBuyDiscount MultiBuyCouponCodeMultiBuyDiscount { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscount.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscount.cs deleted file mode 100644 index 54c7ab3d..00000000 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscount.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_MultiBuyDiscount")] -[Index("MultiBuyDiscountApplyToSkuid", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID")] -[Index("MultiBuyDiscountSiteId", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountSiteID")] -public class ComMultiBuyDiscount -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [StringLength(200)] - public string MultiBuyDiscountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string MultiBuyDiscountName { get; set; } = null!; - - public string? MultiBuyDiscountDescription { get; set; } - - [Required] - public bool? MultiBuyDiscountEnabled { get; set; } - - [Column("MultiBuyDiscountGUID")] - public Guid MultiBuyDiscountGuid { get; set; } - - public DateTime MultiBuyDiscountLastModified { get; set; } - - [Column("MultiBuyDiscountSiteID")] - public int MultiBuyDiscountSiteId { get; set; } - - [Required] - public bool? MultiBuyDiscountApplyFurtherDiscounts { get; set; } - - public int MultiBuyDiscountMinimumBuyCount { get; set; } - - public DateTime? MultiBuyDiscountValidFrom { get; set; } - - public DateTime? MultiBuyDiscountValidTo { get; set; } - - [StringLength(200)] - public string MultiBuyDiscountCustomerRestriction { get; set; } = null!; - - [StringLength(400)] - public string? MultiBuyDiscountRoles { get; set; } - - [Column("MultiBuyDiscountApplyToSKUID")] - public int? MultiBuyDiscountApplyToSkuid { get; set; } - - public int? MultiBuyDiscountLimitPerOrder { get; set; } - - public bool? MultiBuyDiscountUsesCoupons { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? MultiBuyDiscountValue { get; set; } - - public bool? MultiBuyDiscountIsFlat { get; set; } - - [Required] - public bool? MultiBuyDiscountAutoAddEnabled { get; set; } - - public int? MultiBuyDiscountPriority { get; set; } - - public bool MultiBuyDiscountIsProductCoupon { get; set; } - - [InverseProperty("MultiBuyCouponCodeMultiBuyDiscount")] - public virtual ICollection ComMultiBuyCouponCodes { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscount")] - public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); - - [InverseProperty("MultibuyDiscount")] - public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscount")] - public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); - - [ForeignKey("MultiBuyDiscountApplyToSkuid")] - [InverseProperty("ComMultiBuyDiscounts")] - public virtual ComSku? MultiBuyDiscountApplyToSku { get; set; } - - [ForeignKey("MultiBuyDiscountSiteId")] - [InverseProperty("ComMultiBuyDiscounts")] - public virtual CmsSite MultiBuyDiscountSite { get; set; } = null!; - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("MultiBuyDiscounts")] - public virtual ICollection Departments { get; set; } = new List(); - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("MultiBuyDiscounts")] - public virtual ICollection Skus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountBrand.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountBrand.cs deleted file mode 100644 index fe57bc00..00000000 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountBrand.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("MultiBuyDiscountId", "BrandId")] -[Table("COM_MultiBuyDiscountBrand")] -[Index("BrandId", Name = "IX_COM_MultiBuyDiscountBrand_BrandID")] -public class ComMultiBuyDiscountBrand -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [Key] - [Column("BrandID")] - public int BrandId { get; set; } - - [Required] - public bool? BrandIncluded { get; set; } - - [ForeignKey("BrandId")] - [InverseProperty("ComMultiBuyDiscountBrands")] - public virtual ComBrand Brand { get; set; } = null!; - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountBrands")] - public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountCollection.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountCollection.cs deleted file mode 100644 index cc1e08a1..00000000 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountCollection.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("MultibuyDiscountId", "CollectionId")] -[Table("COM_MultiBuyDiscountCollection")] -[Index("CollectionId", Name = "IX_COM_MultiBuyDiscountCollection_CollectionID")] -public class ComMultiBuyDiscountCollection -{ - [Key] - [Column("MultibuyDiscountID")] - public int MultibuyDiscountId { get; set; } - - [Key] - [Column("CollectionID")] - public int CollectionId { get; set; } - - [Required] - public bool? CollectionIncluded { get; set; } - - [ForeignKey("CollectionId")] - [InverseProperty("ComMultiBuyDiscountCollections")] - public virtual ComCollection Collection { get; set; } = null!; - - [ForeignKey("MultibuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountCollections")] - public virtual ComMultiBuyDiscount MultibuyDiscount { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountTree.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountTree.cs deleted file mode 100644 index 916b60dc..00000000 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountTree.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("MultiBuyDiscountId", "NodeId")] -[Table("COM_MultiBuyDiscountTree")] -[Index("NodeId", Name = "IX_COM_MultiBuyDiscountTree_NodeID")] -public class ComMultiBuyDiscountTree -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - [Required] - public bool? NodeIncluded { get; set; } - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountTrees")] - public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; - - [ForeignKey("NodeId")] - [InverseProperty("ComMultiBuyDiscountTrees")] - public virtual CmsTree Node { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComOptionCategory.cs b/Migration.Toolkit.KX12/Models/ComOptionCategory.cs deleted file mode 100644 index 381158a1..00000000 --- a/Migration.Toolkit.KX12/Models/ComOptionCategory.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_OptionCategory")] -[Index("CategorySiteId", Name = "IX_COM_OptionCategory_CategorySiteID")] -public class ComOptionCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryName { get; set; } = null!; - - [StringLength(200)] - public string CategorySelectionType { get; set; } = null!; - - [StringLength(200)] - public string? CategoryDefaultOptions { get; set; } - - public string? CategoryDescription { get; set; } - - [StringLength(200)] - public string? CategoryDefaultRecord { get; set; } - - [Required] - public bool? CategoryEnabled { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - public bool? CategoryDisplayPrice { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - public int? CategoryTextMaxLength { get; set; } - - [StringLength(20)] - public string? CategoryType { get; set; } - - public int? CategoryTextMinLength { get; set; } - - [StringLength(200)] - public string? CategoryLiveSiteDisplayName { get; set; } - - [ForeignKey("CategorySiteId")] - [InverseProperty("ComOptionCategories")] - public virtual CmsSite? CategorySite { get; set; } - - [InverseProperty("Category")] - public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); - - [InverseProperty("SkuoptionCategory")] - public virtual ICollection ComSkus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/ComOrder.cs b/Migration.Toolkit.KX12/Models/ComOrder.cs deleted file mode 100644 index c07b574c..00000000 --- a/Migration.Toolkit.KX12/Models/ComOrder.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Order")] -[Index("OrderCreatedByUserId", Name = "IX_COM_Order_OrderCreatedByUserID")] -[Index("OrderCurrencyId", Name = "IX_COM_Order_OrderCurrencyID")] -[Index("OrderCustomerId", Name = "IX_COM_Order_OrderCustomerID")] -[Index("OrderPaymentOptionId", Name = "IX_COM_Order_OrderPaymentOptionID")] -[Index("OrderShippingOptionId", Name = "IX_COM_Order_OrderShippingOptionID")] -[Index("OrderSiteId", "OrderDate", Name = "IX_COM_Order_OrderSiteID_OrderDate", IsDescending = new[] { false, true })] -[Index("OrderStatusId", Name = "IX_COM_Order_OrderStatusID")] -public class ComOrder -{ - [Key] - [Column("OrderID")] - public int OrderId { get; set; } - - [Column("OrderShippingOptionID")] - public int? OrderShippingOptionId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderTotalShipping { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderTotalPrice { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderTotalTax { get; set; } - - public DateTime OrderDate { get; set; } - - [Column("OrderStatusID")] - public int? OrderStatusId { get; set; } - - [Column("OrderCurrencyID")] - public int? OrderCurrencyId { get; set; } - - [Column("OrderCustomerID")] - public int OrderCustomerId { get; set; } - - [Column("OrderCreatedByUserID")] - public int? OrderCreatedByUserId { get; set; } - - public string? OrderNote { get; set; } - - [Column("OrderSiteID")] - public int OrderSiteId { get; set; } - - [Column("OrderPaymentOptionID")] - public int? OrderPaymentOptionId { get; set; } - - public string? OrderInvoice { get; set; } - - [StringLength(200)] - public string? OrderInvoiceNumber { get; set; } - - [StringLength(100)] - public string? OrderTrackingNumber { get; set; } - - public string? OrderCustomData { get; set; } - - public string? OrderPaymentResult { get; set; } - - [Column("OrderGUID")] - public Guid OrderGuid { get; set; } - - public DateTime OrderLastModified { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderTotalPriceInMainCurrency { get; set; } - - public bool? OrderIsPaid { get; set; } - - [StringLength(10)] - public string? OrderCulture { get; set; } - - public string? OrderDiscounts { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderGrandTotal { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderGrandTotalInMainCurrency { get; set; } - - public string? OrderOtherPayments { get; set; } - - public string? OrderTaxSummary { get; set; } - - public string? OrderCouponCodes { get; set; } - - [InverseProperty("AddressOrder")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("OrderItemOrder")] - public virtual ICollection ComOrderItems { get; set; } = new List(); - - [InverseProperty("Order")] - public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); - - [ForeignKey("OrderCreatedByUserId")] - [InverseProperty("ComOrders")] - public virtual CmsUser? OrderCreatedByUser { get; set; } - - [ForeignKey("OrderCurrencyId")] - [InverseProperty("ComOrders")] - public virtual ComCurrency? OrderCurrency { get; set; } - - [ForeignKey("OrderCustomerId")] - [InverseProperty("ComOrders")] - public virtual ComCustomer OrderCustomer { get; set; } = null!; - - [ForeignKey("OrderPaymentOptionId")] - [InverseProperty("ComOrders")] - public virtual ComPaymentOption? OrderPaymentOption { get; set; } - - [ForeignKey("OrderShippingOptionId")] - [InverseProperty("ComOrders")] - public virtual ComShippingOption? OrderShippingOption { get; set; } - - [ForeignKey("OrderSiteId")] - [InverseProperty("ComOrders")] - public virtual CmsSite OrderSite { get; set; } = null!; - - [ForeignKey("OrderStatusId")] - [InverseProperty("ComOrders")] - public virtual ComOrderStatus? OrderStatus { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComOrderAddress.cs b/Migration.Toolkit.KX12/Models/ComOrderAddress.cs deleted file mode 100644 index d2011dd1..00000000 --- a/Migration.Toolkit.KX12/Models/ComOrderAddress.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_OrderAddress")] -[Index("AddressCountryId", Name = "IX_COM_OrderAddress_AddressCountryID")] -[Index("AddressOrderId", "AddressType", Name = "IX_COM_OrderAddress_AddressOrderID_AddressType", IsUnique = true)] -[Index("AddressStateId", Name = "IX_COM_OrderAddress_AddressStateID")] -public class ComOrderAddress -{ - [Key] - [Column("AddressID")] - public int AddressId { get; set; } - - [StringLength(100)] - public string AddressLine1 { get; set; } = null!; - - [StringLength(100)] - public string? AddressLine2 { get; set; } - - [StringLength(100)] - public string AddressCity { get; set; } = null!; - - [StringLength(20)] - public string AddressZip { get; set; } = null!; - - [StringLength(26)] - public string? AddressPhone { get; set; } - - [Column("AddressCountryID")] - public int AddressCountryId { get; set; } - - [Column("AddressStateID")] - public int? AddressStateId { get; set; } - - [StringLength(200)] - public string AddressPersonalName { get; set; } = null!; - - [Column("AddressGUID")] - public Guid? AddressGuid { get; set; } - - public DateTime AddressLastModified { get; set; } - - [Column("AddressOrderID")] - public int AddressOrderId { get; set; } - - public int AddressType { get; set; } - - [ForeignKey("AddressCountryId")] - [InverseProperty("ComOrderAddresses")] - public virtual CmsCountry AddressCountry { get; set; } = null!; - - [ForeignKey("AddressOrderId")] - [InverseProperty("ComOrderAddresses")] - public virtual ComOrder AddressOrder { get; set; } = null!; - - [ForeignKey("AddressStateId")] - [InverseProperty("ComOrderAddresses")] - public virtual CmsState? AddressState { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComOrderItem.cs b/Migration.Toolkit.KX12/Models/ComOrderItem.cs deleted file mode 100644 index ffb82f88..00000000 --- a/Migration.Toolkit.KX12/Models/ComOrderItem.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_OrderItem")] -[Index("OrderItemOrderId", Name = "IX_COM_OrderItem_OrderItemOrderID")] -[Index("OrderItemSkuid", Name = "IX_COM_OrderItem_OrderItemSKUID")] -public class ComOrderItem -{ - [Key] - [Column("OrderItemID")] - public int OrderItemId { get; set; } - - [Column("OrderItemOrderID")] - public int OrderItemOrderId { get; set; } - - [Column("OrderItemSKUID")] - public int OrderItemSkuid { get; set; } - - [Column("OrderItemSKUName")] - [StringLength(450)] - public string OrderItemSkuname { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderItemUnitPrice { get; set; } - - public int OrderItemUnitCount { get; set; } - - public string? OrderItemCustomData { get; set; } - - public Guid OrderItemGuid { get; set; } - - public Guid? OrderItemParentGuid { get; set; } - - public DateTime OrderItemLastModified { get; set; } - - public DateTime? OrderItemValidTo { get; set; } - - [Column("OrderItemBundleGUID")] - public Guid? OrderItemBundleGuid { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderItemTotalPriceInMainCurrency { get; set; } - - public bool? OrderItemSendNotification { get; set; } - - public string? OrderItemText { get; set; } - - public string? OrderItemProductDiscounts { get; set; } - - public string? OrderItemDiscountSummary { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderItemTotalPrice { get; set; } - - [InverseProperty("OrderItem")] - public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); - - [ForeignKey("OrderItemOrderId")] - [InverseProperty("ComOrderItems")] - public virtual ComOrder OrderItemOrder { get; set; } = null!; - - [ForeignKey("OrderItemSkuid")] - [InverseProperty("ComOrderItems")] - public virtual ComSku OrderItemSku { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComOrderItemSkufile.cs b/Migration.Toolkit.KX12/Models/ComOrderItemSkufile.cs deleted file mode 100644 index 9ee4a61b..00000000 --- a/Migration.Toolkit.KX12/Models/ComOrderItemSkufile.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_OrderItemSKUFile")] -[Index("FileId", Name = "IX_COM_OrderItemSKUFile_FileID")] -[Index("OrderItemId", Name = "IX_COM_OrderItemSKUFile_OrderItemID")] -public class ComOrderItemSkufile -{ - [Key] - [Column("OrderItemSKUFileID")] - public int OrderItemSkufileId { get; set; } - - public Guid Token { get; set; } - - [Column("OrderItemID")] - public int OrderItemId { get; set; } - - [Column("FileID")] - public int FileId { get; set; } - - [ForeignKey("FileId")] - [InverseProperty("ComOrderItemSkufiles")] - public virtual ComSkufile File { get; set; } = null!; - - [ForeignKey("OrderItemId")] - [InverseProperty("ComOrderItemSkufiles")] - public virtual ComOrderItem OrderItem { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComOrderStatus.cs b/Migration.Toolkit.KX12/Models/ComOrderStatus.cs deleted file mode 100644 index 82baf65e..00000000 --- a/Migration.Toolkit.KX12/Models/ComOrderStatus.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_OrderStatus")] -[Index("StatusSiteId", "StatusOrder", Name = "IX_COM_OrderStatus_StatusSiteID_StatusOrder")] -public class ComOrderStatus -{ - [Key] - [Column("StatusID")] - public int StatusId { get; set; } - - [StringLength(200)] - public string StatusName { get; set; } = null!; - - [StringLength(200)] - public string StatusDisplayName { get; set; } = null!; - - public int? StatusOrder { get; set; } - - [Required] - public bool? StatusEnabled { get; set; } - - [StringLength(7)] - public string? StatusColor { get; set; } - - [Column("StatusGUID")] - public Guid StatusGuid { get; set; } - - public DateTime StatusLastModified { get; set; } - - public bool? StatusSendNotification { get; set; } - - [Column("StatusSiteID")] - public int? StatusSiteId { get; set; } - - public bool? StatusOrderIsPaid { get; set; } - - [InverseProperty("FromStatus")] - public virtual ICollection ComOrderStatusUserFromStatuses { get; set; } = new List(); - - [InverseProperty("ToStatus")] - public virtual ICollection ComOrderStatusUserToStatuses { get; set; } = new List(); - - [InverseProperty("OrderStatus")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("PaymentOptionAuthorizedOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionAuthorizedOrderStatuses { get; set; } = new List(); - - [InverseProperty("PaymentOptionFailedOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionFailedOrderStatuses { get; set; } = new List(); - - [InverseProperty("PaymentOptionSucceededOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionSucceededOrderStatuses { get; set; } = new List(); - - [ForeignKey("StatusSiteId")] - [InverseProperty("ComOrderStatuses")] - public virtual CmsSite? StatusSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComOrderStatusUser.cs b/Migration.Toolkit.KX12/Models/ComOrderStatusUser.cs deleted file mode 100644 index cb1d432e..00000000 --- a/Migration.Toolkit.KX12/Models/ComOrderStatusUser.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_OrderStatusUser")] -[Index("ChangedByUserId", Name = "IX_COM_OrderStatusUser_ChangedByUserID")] -[Index("FromStatusId", Name = "IX_COM_OrderStatusUser_FromStatusID")] -[Index("OrderId", "Date", Name = "IX_COM_OrderStatusUser_OrderID_Date")] -[Index("ToStatusId", Name = "IX_COM_OrderStatusUser_ToStatusID")] -public class ComOrderStatusUser -{ - [Key] - [Column("OrderStatusUserID")] - public int OrderStatusUserId { get; set; } - - [Column("OrderID")] - public int OrderId { get; set; } - - [Column("FromStatusID")] - public int? FromStatusId { get; set; } - - [Column("ToStatusID")] - public int ToStatusId { get; set; } - - [Column("ChangedByUserID")] - public int? ChangedByUserId { get; set; } - - public DateTime Date { get; set; } - - public string? Note { get; set; } - - [ForeignKey("ChangedByUserId")] - [InverseProperty("ComOrderStatusUsers")] - public virtual CmsUser? ChangedByUser { get; set; } - - [ForeignKey("FromStatusId")] - [InverseProperty("ComOrderStatusUserFromStatuses")] - public virtual ComOrderStatus? FromStatus { get; set; } - - [ForeignKey("OrderId")] - [InverseProperty("ComOrderStatusUsers")] - public virtual ComOrder Order { get; set; } = null!; - - [ForeignKey("ToStatusId")] - [InverseProperty("ComOrderStatusUserToStatuses")] - public virtual ComOrderStatus ToStatus { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComPaymentOption.cs b/Migration.Toolkit.KX12/Models/ComPaymentOption.cs deleted file mode 100644 index 46a01f77..00000000 --- a/Migration.Toolkit.KX12/Models/ComPaymentOption.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_PaymentOption")] -[Index("PaymentOptionAuthorizedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID")] -[Index("PaymentOptionFailedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionFailedOrderStatusID")] -[Index("PaymentOptionSiteId", Name = "IX_COM_PaymentOption_PaymentOptionSiteID")] -[Index("PaymentOptionSucceededOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionSucceededOrderStatusID")] -public class ComPaymentOption -{ - [Key] - [Column("PaymentOptionID")] - public int PaymentOptionId { get; set; } - - [StringLength(200)] - public string PaymentOptionName { get; set; } = null!; - - [StringLength(200)] - public string PaymentOptionDisplayName { get; set; } = null!; - - [Required] - public bool? PaymentOptionEnabled { get; set; } - - [Column("PaymentOptionSiteID")] - public int? PaymentOptionSiteId { get; set; } - - [StringLength(500)] - public string? PaymentOptionPaymentGateUrl { get; set; } - - [StringLength(200)] - public string? PaymentOptionAssemblyName { get; set; } - - [StringLength(200)] - public string? PaymentOptionClassName { get; set; } - - [Column("PaymentOptionSucceededOrderStatusID")] - public int? PaymentOptionSucceededOrderStatusId { get; set; } - - [Column("PaymentOptionFailedOrderStatusID")] - public int? PaymentOptionFailedOrderStatusId { get; set; } - - [Column("PaymentOptionGUID")] - public Guid PaymentOptionGuid { get; set; } - - public DateTime PaymentOptionLastModified { get; set; } - - public bool? PaymentOptionAllowIfNoShipping { get; set; } - - [Column("PaymentOptionThumbnailGUID")] - public Guid? PaymentOptionThumbnailGuid { get; set; } - - public string? PaymentOptionDescription { get; set; } - - [Column("PaymentOptionAuthorizedOrderStatusID")] - public int? PaymentOptionAuthorizedOrderStatusId { get; set; } - - [InverseProperty("OrderPaymentOption")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartPaymentOption")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("PaymentOptionAuthorizedOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionAuthorizedOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionAuthorizedOrderStatus { get; set; } - - [ForeignKey("PaymentOptionFailedOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionFailedOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionFailedOrderStatus { get; set; } - - [ForeignKey("PaymentOptionSiteId")] - [InverseProperty("ComPaymentOptions")] - public virtual CmsSite? PaymentOptionSite { get; set; } - - [ForeignKey("PaymentOptionSucceededOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionSucceededOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionSucceededOrderStatus { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComPublicStatus.cs b/Migration.Toolkit.KX12/Models/ComPublicStatus.cs deleted file mode 100644 index 701e3d3c..00000000 --- a/Migration.Toolkit.KX12/Models/ComPublicStatus.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_PublicStatus")] -[Index("PublicStatusSiteId", Name = "IX_COM_PublicStatus_PublicStatusSiteID")] -public class ComPublicStatus -{ - [Key] - [Column("PublicStatusID")] - public int PublicStatusId { get; set; } - - [StringLength(200)] - public string PublicStatusName { get; set; } = null!; - - [StringLength(200)] - public string PublicStatusDisplayName { get; set; } = null!; - - [Required] - public bool? PublicStatusEnabled { get; set; } - - [Column("PublicStatusGUID")] - public Guid? PublicStatusGuid { get; set; } - - public DateTime PublicStatusLastModified { get; set; } - - [Column("PublicStatusSiteID")] - public int? PublicStatusSiteId { get; set; } - - [InverseProperty("SkupublicStatus")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("PublicStatusSiteId")] - [InverseProperty("ComPublicStatuses")] - public virtual CmsSite? PublicStatusSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComShippingCost.cs b/Migration.Toolkit.KX12/Models/ComShippingCost.cs deleted file mode 100644 index 031f783e..00000000 --- a/Migration.Toolkit.KX12/Models/ComShippingCost.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_ShippingCost")] -[Index("ShippingCostShippingOptionId", Name = "IX_COM_ShippingCost_ShippingCostShippingOptionID")] -public class ComShippingCost -{ - [Key] - [Column("ShippingCostID")] - public int ShippingCostId { get; set; } - - [Column("ShippingCostShippingOptionID")] - public int ShippingCostShippingOptionId { get; set; } - - public double ShippingCostMinWeight { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal ShippingCostValue { get; set; } - - [Column("ShippingCostGUID")] - public Guid ShippingCostGuid { get; set; } - - public DateTime ShippingCostLastModified { get; set; } - - [ForeignKey("ShippingCostShippingOptionId")] - [InverseProperty("ComShippingCosts")] - public virtual ComShippingOption ShippingCostShippingOption { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComShippingOption.cs b/Migration.Toolkit.KX12/Models/ComShippingOption.cs deleted file mode 100644 index 69714e06..00000000 --- a/Migration.Toolkit.KX12/Models/ComShippingOption.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_ShippingOption")] -[Index("ShippingOptionCarrierId", Name = "IX_COM_ShippingOption_ShippingOptionCarrierID")] -[Index("ShippingOptionSiteId", Name = "IX_COM_ShippingOption_ShippingOptionSiteID_ShippingOptionDisplayName_ShippingOptionEnabled")] -[Index("ShippingOptionTaxClassId", Name = "IX_COM_ShippingOption_ShippingOptionTaxClassID")] -public class ComShippingOption -{ - [Key] - [Column("ShippingOptionID")] - public int ShippingOptionId { get; set; } - - [StringLength(200)] - public string ShippingOptionName { get; set; } = null!; - - [StringLength(200)] - public string ShippingOptionDisplayName { get; set; } = null!; - - [Required] - public bool? ShippingOptionEnabled { get; set; } - - [Column("ShippingOptionSiteID")] - public int? ShippingOptionSiteId { get; set; } - - [Column("ShippingOptionGUID")] - public Guid ShippingOptionGuid { get; set; } - - public DateTime ShippingOptionLastModified { get; set; } - - [Column("ShippingOptionThumbnailGUID")] - public Guid? ShippingOptionThumbnailGuid { get; set; } - - public string? ShippingOptionDescription { get; set; } - - [Column("ShippingOptionCarrierID")] - public int? ShippingOptionCarrierId { get; set; } - - [StringLength(200)] - public string? ShippingOptionCarrierServiceName { get; set; } - - [Column("ShippingOptionTaxClassID")] - public int? ShippingOptionTaxClassId { get; set; } - - [InverseProperty("OrderShippingOption")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShippingCostShippingOption")] - public virtual ICollection ComShippingCosts { get; set; } = new List(); - - [InverseProperty("ShoppingCartShippingOption")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("ShippingOptionCarrierId")] - [InverseProperty("ComShippingOptions")] - public virtual ComCarrier? ShippingOptionCarrier { get; set; } - - [ForeignKey("ShippingOptionSiteId")] - [InverseProperty("ComShippingOptions")] - public virtual CmsSite? ShippingOptionSite { get; set; } - - [ForeignKey("ShippingOptionTaxClassId")] - [InverseProperty("ComShippingOptions")] - public virtual ComTaxClass? ShippingOptionTaxClass { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComShoppingCart.cs b/Migration.Toolkit.KX12/Models/ComShoppingCart.cs deleted file mode 100644 index d4ca901a..00000000 --- a/Migration.Toolkit.KX12/Models/ComShoppingCart.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_ShoppingCart")] -[Index("ShoppingCartBillingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartBillingAddressID")] -[Index("ShoppingCartCompanyAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartCompanyAddressID")] -[Index("ShoppingCartCurrencyId", Name = "IX_COM_ShoppingCart_ShoppingCartCurrencyID")] -[Index("ShoppingCartCustomerId", Name = "IX_COM_ShoppingCart_ShoppingCartCustomerID")] -[Index("ShoppingCartLastUpdate", Name = "IX_COM_ShoppingCart_ShoppingCartLastUpdate")] -[Index("ShoppingCartPaymentOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartPaymentOptionID")] -[Index("ShoppingCartShippingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingAddressID")] -[Index("ShoppingCartShippingOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingOptionID")] -[Index("ShoppingCartSiteId", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID")] -[Index("ShoppingCartGuid", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID_ShoppingCartGUID")] -[Index("ShoppingCartUserId", Name = "IX_COM_ShoppingCart_ShoppingCartUserID")] -public class ComShoppingCart -{ - [Key] - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [Column("ShoppingCartGUID")] - public Guid ShoppingCartGuid { get; set; } - - [Column("ShoppingCartUserID")] - public int? ShoppingCartUserId { get; set; } - - [Column("ShoppingCartSiteID")] - public int ShoppingCartSiteId { get; set; } - - public DateTime ShoppingCartLastUpdate { get; set; } - - [Column("ShoppingCartCurrencyID")] - public int? ShoppingCartCurrencyId { get; set; } - - [Column("ShoppingCartPaymentOptionID")] - public int? ShoppingCartPaymentOptionId { get; set; } - - [Column("ShoppingCartShippingOptionID")] - public int? ShoppingCartShippingOptionId { get; set; } - - [Column("ShoppingCartBillingAddressID")] - public int? ShoppingCartBillingAddressId { get; set; } - - [Column("ShoppingCartShippingAddressID")] - public int? ShoppingCartShippingAddressId { get; set; } - - [Column("ShoppingCartCustomerID")] - public int? ShoppingCartCustomerId { get; set; } - - public string? ShoppingCartNote { get; set; } - - [Column("ShoppingCartCompanyAddressID")] - public int? ShoppingCartCompanyAddressId { get; set; } - - public string? ShoppingCartCustomData { get; set; } - - [Column("ShoppingCartContactID")] - public int? ShoppingCartContactId { get; set; } - - [InverseProperty("ShoppingCart")] - public virtual ICollection ComShoppingCartCouponCodes { get; set; } = new List(); - - [InverseProperty("ShoppingCart")] - public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); - - [ForeignKey("ShoppingCartBillingAddressId")] - [InverseProperty("ComShoppingCartShoppingCartBillingAddresses")] - public virtual ComAddress? ShoppingCartBillingAddress { get; set; } - - [ForeignKey("ShoppingCartCompanyAddressId")] - [InverseProperty("ComShoppingCartShoppingCartCompanyAddresses")] - public virtual ComAddress? ShoppingCartCompanyAddress { get; set; } - - [ForeignKey("ShoppingCartCurrencyId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComCurrency? ShoppingCartCurrency { get; set; } - - [ForeignKey("ShoppingCartCustomerId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComCustomer? ShoppingCartCustomer { get; set; } - - [ForeignKey("ShoppingCartPaymentOptionId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComPaymentOption? ShoppingCartPaymentOption { get; set; } - - [ForeignKey("ShoppingCartShippingAddressId")] - [InverseProperty("ComShoppingCartShoppingCartShippingAddresses")] - public virtual ComAddress? ShoppingCartShippingAddress { get; set; } - - [ForeignKey("ShoppingCartShippingOptionId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComShippingOption? ShoppingCartShippingOption { get; set; } - - [ForeignKey("ShoppingCartSiteId")] - [InverseProperty("ComShoppingCarts")] - public virtual CmsSite ShoppingCartSite { get; set; } = null!; - - [ForeignKey("ShoppingCartUserId")] - [InverseProperty("ComShoppingCarts")] - public virtual CmsUser? ShoppingCartUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComShoppingCartCouponCode.cs b/Migration.Toolkit.KX12/Models/ComShoppingCartCouponCode.cs deleted file mode 100644 index e9196a53..00000000 --- a/Migration.Toolkit.KX12/Models/ComShoppingCartCouponCode.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_ShoppingCartCouponCode")] -[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartCouponCode_ShoppingCartID")] -public class ComShoppingCartCouponCode -{ - [Key] - [Column("ShoppingCartCouponCodeID")] - public int ShoppingCartCouponCodeId { get; set; } - - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [StringLength(200)] - public string CouponCode { get; set; } = null!; - - [ForeignKey("ShoppingCartId")] - [InverseProperty("ComShoppingCartCouponCodes")] - public virtual ComShoppingCart ShoppingCart { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComShoppingCartSku.cs b/Migration.Toolkit.KX12/Models/ComShoppingCartSku.cs deleted file mode 100644 index e79e3030..00000000 --- a/Migration.Toolkit.KX12/Models/ComShoppingCartSku.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_ShoppingCartSKU")] -[Index("Skuid", Name = "IX_COM_ShoppingCartSKU_SKUID")] -[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartSKU_ShoppingCartID")] -public class ComShoppingCartSku -{ - [Key] - [Column("CartItemID")] - public int CartItemId { get; set; } - - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("SKUUnits")] - public int Skuunits { get; set; } - - public string? CartItemCustomData { get; set; } - - public Guid? CartItemGuid { get; set; } - - public Guid? CartItemParentGuid { get; set; } - - public DateTime? CartItemValidTo { get; set; } - - [Column("CartItemBundleGUID")] - public Guid? CartItemBundleGuid { get; set; } - - public string? CartItemText { get; set; } - - public int? CartItemAutoAddedUnits { get; set; } - - [ForeignKey("ShoppingCartId")] - [InverseProperty("ComShoppingCartSkus")] - public virtual ComShoppingCart ShoppingCart { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComShoppingCartSkus")] - public virtual ComSku Sku { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComSku.cs b/Migration.Toolkit.KX12/Models/ComSku.cs deleted file mode 100644 index 48d9b877..00000000 --- a/Migration.Toolkit.KX12/Models/ComSku.cs +++ /dev/null @@ -1,277 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_SKU")] -[Index("SkubrandId", Name = "IX_COM_SKU_SKUBrandID")] -[Index("SkucollectionId", Name = "IX_COM_SKU_SKUCollectionID")] -[Index("SkudepartmentId", Name = "IX_COM_SKU_SKUDepartmentID")] -[Index("SkuinternalStatusId", Name = "IX_COM_SKU_SKUInternalStatusID")] -[Index("SkumanufacturerId", Name = "IX_COM_SKU_SKUManufacturerID")] -[Index("Skuname", Name = "IX_COM_SKU_SKUName")] -[Index("SkuoptionCategoryId", Name = "IX_COM_SKU_SKUOptionCategoryID")] -[Index("SkuparentSkuid", Name = "IX_COM_SKU_SKUParentSKUID")] -[Index("Skuprice", Name = "IX_COM_SKU_SKUPrice")] -[Index("SkupublicStatusId", Name = "IX_COM_SKU_SKUPublicStatusID")] -[Index("SkusiteId", Name = "IX_COM_SKU_SKUSiteID")] -[Index("SkusupplierId", Name = "IX_COM_SKU_SKUSupplierID")] -[Index("SkutaxClassId", Name = "IX_COM_SKU_SKUTaxClassID")] -public class ComSku -{ - [Key] - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("SKUNumber")] - [StringLength(200)] - public string? Skunumber { get; set; } - - [Column("SKUName")] - [StringLength(440)] - public string Skuname { get; set; } = null!; - - [Column("SKUDescription")] - public string? Skudescription { get; set; } - - [Column("SKUPrice", TypeName = "decimal(18, 9)")] - public decimal Skuprice { get; set; } - - [Required] - [Column("SKUEnabled")] - public bool? Skuenabled { get; set; } - - [Column("SKUDepartmentID")] - public int? SkudepartmentId { get; set; } - - [Column("SKUManufacturerID")] - public int? SkumanufacturerId { get; set; } - - [Column("SKUInternalStatusID")] - public int? SkuinternalStatusId { get; set; } - - [Column("SKUPublicStatusID")] - public int? SkupublicStatusId { get; set; } - - [Column("SKUSupplierID")] - public int? SkusupplierId { get; set; } - - [Column("SKUAvailableInDays")] - public int? SkuavailableInDays { get; set; } - - [Column("SKUGUID")] - public Guid Skuguid { get; set; } - - [Column("SKUImagePath")] - [StringLength(450)] - public string? SkuimagePath { get; set; } - - [Column("SKUWeight")] - public double? Skuweight { get; set; } - - [Column("SKUWidth")] - public double? Skuwidth { get; set; } - - [Column("SKUDepth")] - public double? Skudepth { get; set; } - - [Column("SKUHeight")] - public double? Skuheight { get; set; } - - [Column("SKUAvailableItems")] - public int? SkuavailableItems { get; set; } - - [Column("SKUSellOnlyAvailable")] - public bool? SkusellOnlyAvailable { get; set; } - - [Column("SKUCustomData")] - public string? SkucustomData { get; set; } - - [Column("SKUOptionCategoryID")] - public int? SkuoptionCategoryId { get; set; } - - [Column("SKUOrder")] - public int? Skuorder { get; set; } - - [Column("SKULastModified")] - public DateTime SkulastModified { get; set; } - - [Column("SKUCreated")] - public DateTime? Skucreated { get; set; } - - [Column("SKUSiteID")] - public int? SkusiteId { get; set; } - - [Column("SKUNeedsShipping")] - public bool? SkuneedsShipping { get; set; } - - [Column("SKUValidUntil")] - public DateTime? SkuvalidUntil { get; set; } - - [Column("SKUProductType")] - [StringLength(50)] - public string? SkuproductType { get; set; } - - [Column("SKUMaxItemsInOrder")] - public int? SkumaxItemsInOrder { get; set; } - - [Column("SKUValidity")] - [StringLength(50)] - public string? Skuvalidity { get; set; } - - [Column("SKUValidFor")] - public int? SkuvalidFor { get; set; } - - [Column("SKUMembershipGUID")] - public Guid? SkumembershipGuid { get; set; } - - [Column("SKUConversionName")] - [StringLength(100)] - public string? SkuconversionName { get; set; } - - [Column("SKUConversionValue")] - [StringLength(200)] - public string? SkuconversionValue { get; set; } - - [Column("SKUBundleInventoryType")] - [StringLength(50)] - public string? SkubundleInventoryType { get; set; } - - [Column("SKUMinItemsInOrder")] - public int? SkuminItemsInOrder { get; set; } - - [Column("SKURetailPrice", TypeName = "decimal(18, 9)")] - public decimal? SkuretailPrice { get; set; } - - [Column("SKUParentSKUID")] - public int? SkuparentSkuid { get; set; } - - [Column("SKUShortDescription")] - public string? SkushortDescription { get; set; } - - [Column("SKUEproductFilesCount")] - public int? SkueproductFilesCount { get; set; } - - [Column("SKUBundleItemsCount")] - public int? SkubundleItemsCount { get; set; } - - [Column("SKUInStoreFrom")] - public DateTime? SkuinStoreFrom { get; set; } - - [Column("SKUReorderAt")] - public int? SkureorderAt { get; set; } - - [Column("SKUTrackInventory")] - [StringLength(50)] - public string? SkutrackInventory { get; set; } - - [Column("SKUTaxClassID")] - public int? SkutaxClassId { get; set; } - - [Column("SKUBrandID")] - public int? SkubrandId { get; set; } - - [Column("SKUCollectionID")] - public int? SkucollectionId { get; set; } - - [InverseProperty("NodeSku")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscountApplyToSku")] - public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); - - [InverseProperty("OrderItemSku")] - public virtual ICollection ComOrderItems { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); - - [InverseProperty("FileSku")] - public virtual ICollection ComSkufiles { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); - - [InverseProperty("VolumeDiscountSku")] - public virtual ICollection ComVolumeDiscounts { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("SkuparentSku")] - public virtual ICollection InverseSkuparentSku { get; set; } = new List(); - - [ForeignKey("SkubrandId")] - [InverseProperty("ComSkus")] - public virtual ComBrand? Skubrand { get; set; } - - [ForeignKey("SkucollectionId")] - [InverseProperty("ComSkus")] - public virtual ComCollection? Skucollection { get; set; } - - [ForeignKey("SkudepartmentId")] - [InverseProperty("ComSkus")] - public virtual ComDepartment? Skudepartment { get; set; } - - [ForeignKey("SkuinternalStatusId")] - [InverseProperty("ComSkus")] - public virtual ComInternalStatus? SkuinternalStatus { get; set; } - - [ForeignKey("SkumanufacturerId")] - [InverseProperty("ComSkus")] - public virtual ComManufacturer? Skumanufacturer { get; set; } - - [ForeignKey("SkuoptionCategoryId")] - [InverseProperty("ComSkus")] - public virtual ComOptionCategory? SkuoptionCategory { get; set; } - - [ForeignKey("SkuparentSkuid")] - [InverseProperty("InverseSkuparentSku")] - public virtual ComSku? SkuparentSku { get; set; } - - [ForeignKey("SkupublicStatusId")] - [InverseProperty("ComSkus")] - public virtual ComPublicStatus? SkupublicStatus { get; set; } - - [ForeignKey("SkusiteId")] - [InverseProperty("ComSkus")] - public virtual CmsSite? Skusite { get; set; } - - [ForeignKey("SkusupplierId")] - [InverseProperty("ComSkus")] - public virtual ComSupplier? Skusupplier { get; set; } - - [ForeignKey("SkutaxClassId")] - [InverseProperty("ComSkus")] - public virtual ComTaxClass? SkutaxClass { get; set; } - - [ForeignKey("Skuid")] - [InverseProperty("Skus")] - public virtual ICollection Bundles { get; set; } = new List(); - - [ForeignKey("Skuid")] - [InverseProperty("Skus")] - public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); - - [ForeignKey("Skuid")] - [InverseProperty("SkusNavigation")] - public virtual ICollection OptionSkus { get; set; } = new List(); - - [ForeignKey("VariantSkuid")] - [InverseProperty("VariantSkus")] - public virtual ICollection OptionSkusNavigation { get; set; } = new List(); - - [ForeignKey("BundleId")] - [InverseProperty("Bundles")] - public virtual ICollection Skus { get; set; } = new List(); - - [ForeignKey("OptionSkuid")] - [InverseProperty("OptionSkus")] - public virtual ICollection SkusNavigation { get; set; } = new List(); - - [ForeignKey("OptionSkuid")] - [InverseProperty("OptionSkusNavigation")] - public virtual ICollection VariantSkus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/ComSkufile.cs b/Migration.Toolkit.KX12/Models/ComSkufile.cs deleted file mode 100644 index c7052c3f..00000000 --- a/Migration.Toolkit.KX12/Models/ComSkufile.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_SKUFile")] -[Index("FileSkuid", Name = "IX_COM_SKUFile_FileSKUID")] -public class ComSkufile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileSKUID")] - public int FileSkuid { get; set; } - - [StringLength(450)] - public string FilePath { get; set; } = null!; - - [StringLength(50)] - public string FileType { get; set; } = null!; - - public DateTime FileLastModified { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [Column("FileMetaFileGUID")] - public Guid? FileMetaFileGuid { get; set; } - - [InverseProperty("File")] - public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); - - [ForeignKey("FileSkuid")] - [InverseProperty("ComSkufiles")] - public virtual ComSku FileSku { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComSkuoptionCategory.cs b/Migration.Toolkit.KX12/Models/ComSkuoptionCategory.cs deleted file mode 100644 index 976a6216..00000000 --- a/Migration.Toolkit.KX12/Models/ComSkuoptionCategory.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_SKUOptionCategory")] -[Index("CategoryId", Name = "IX_COM_SKUOptionCategory_CategoryID")] -[Index("Skuid", Name = "IX_COM_SKUOptionCategory_SKUID")] -public class ComSkuoptionCategory -{ - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("CategoryID")] - public int CategoryId { get; set; } - - public bool? AllowAllOptions { get; set; } - - [Key] - [Column("SKUCategoryID")] - public int SkucategoryId { get; set; } - - [Column("SKUCategoryOrder")] - public int? SkucategoryOrder { get; set; } - - [ForeignKey("CategoryId")] - [InverseProperty("ComSkuoptionCategories")] - public virtual ComOptionCategory Category { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComSkuoptionCategories")] - public virtual ComSku Sku { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComSupplier.cs b/Migration.Toolkit.KX12/Models/ComSupplier.cs deleted file mode 100644 index f45f3508..00000000 --- a/Migration.Toolkit.KX12/Models/ComSupplier.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Supplier")] -[Index("SupplierSiteId", Name = "IX_COM_Supplier_SupplierSiteID")] -public class ComSupplier -{ - [Key] - [Column("SupplierID")] - public int SupplierId { get; set; } - - [StringLength(200)] - public string SupplierDisplayName { get; set; } = null!; - - [StringLength(50)] - public string? SupplierPhone { get; set; } - - [StringLength(254)] - public string? SupplierEmail { get; set; } - - [StringLength(50)] - public string? SupplierFax { get; set; } - - [Required] - public bool? SupplierEnabled { get; set; } - - [Column("SupplierGUID")] - public Guid SupplierGuid { get; set; } - - public DateTime SupplierLastModified { get; set; } - - [Column("SupplierSiteID")] - public int? SupplierSiteId { get; set; } - - [StringLength(200)] - public string? SupplierName { get; set; } - - [InverseProperty("Skusupplier")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("SupplierSiteId")] - [InverseProperty("ComSuppliers")] - public virtual CmsSite? SupplierSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComTaxClass.cs b/Migration.Toolkit.KX12/Models/ComTaxClass.cs deleted file mode 100644 index da7bef6c..00000000 --- a/Migration.Toolkit.KX12/Models/ComTaxClass.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_TaxClass")] -[Index("TaxClassSiteId", Name = "IX_COM_TaxClass_TaxClassSiteID")] -public class ComTaxClass -{ - [Key] - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [StringLength(200)] - public string TaxClassName { get; set; } = null!; - - [StringLength(200)] - public string TaxClassDisplayName { get; set; } = null!; - - [Column("TaxClassZeroIfIDSupplied")] - public bool? TaxClassZeroIfIdsupplied { get; set; } - - [Column("TaxClassGUID")] - public Guid TaxClassGuid { get; set; } - - public DateTime TaxClassLastModified { get; set; } - - [Column("TaxClassSiteID")] - public int? TaxClassSiteId { get; set; } - - [InverseProperty("DepartmentDefaultTaxClass")] - public virtual ICollection ComDepartments { get; set; } = new List(); - - [InverseProperty("ShippingOptionTaxClass")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); - - [InverseProperty("SkutaxClass")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [InverseProperty("TaxClass")] - public virtual ICollection ComTaxClassCountries { get; set; } = new List(); - - [InverseProperty("TaxClass")] - public virtual ICollection ComTaxClassStates { get; set; } = new List(); - - [ForeignKey("TaxClassSiteId")] - [InverseProperty("ComTaxClasses")] - public virtual CmsSite? TaxClassSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ComTaxClassCountry.cs b/Migration.Toolkit.KX12/Models/ComTaxClassCountry.cs deleted file mode 100644 index af0a43db..00000000 --- a/Migration.Toolkit.KX12/Models/ComTaxClassCountry.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_TaxClassCountry")] -[Index("CountryId", Name = "IX_COM_TaxClassCountry_CountryID")] -[Index("TaxClassId", "CountryId", Name = "IX_COM_TaxClassCountry_TaxClassID_CountryID", IsUnique = true)] -public class ComTaxClassCountry -{ - [Key] - [Column("TaxClassCountryID")] - public int TaxClassCountryId { get; set; } - - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal TaxValue { get; set; } - - [ForeignKey("CountryId")] - [InverseProperty("ComTaxClassCountries")] - public virtual CmsCountry Country { get; set; } = null!; - - [ForeignKey("TaxClassId")] - [InverseProperty("ComTaxClassCountries")] - public virtual ComTaxClass TaxClass { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComTaxClassState.cs b/Migration.Toolkit.KX12/Models/ComTaxClassState.cs deleted file mode 100644 index 65de2de2..00000000 --- a/Migration.Toolkit.KX12/Models/ComTaxClassState.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_TaxClassState")] -[Index("StateId", Name = "IX_COM_TaxClassState_StateID")] -[Index("TaxClassId", "StateId", Name = "IX_COM_TaxClassState_TaxClassID_StateID", IsUnique = true)] -public class ComTaxClassState -{ - [Key] - [Column("TaxClassStateID")] - public int TaxClassStateId { get; set; } - - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [Column("StateID")] - public int StateId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal TaxValue { get; set; } - - [ForeignKey("StateId")] - [InverseProperty("ComTaxClassStates")] - public virtual CmsState State { get; set; } = null!; - - [ForeignKey("TaxClassId")] - [InverseProperty("ComTaxClassStates")] - public virtual ComTaxClass TaxClass { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComVolumeDiscount.cs b/Migration.Toolkit.KX12/Models/ComVolumeDiscount.cs deleted file mode 100644 index 61a2f654..00000000 --- a/Migration.Toolkit.KX12/Models/ComVolumeDiscount.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_VolumeDiscount")] -[Index("VolumeDiscountSkuid", Name = "IX_COM_VolumeDiscount_VolumeDiscountSKUID")] -public class ComVolumeDiscount -{ - [Key] - [Column("VolumeDiscountID")] - public int VolumeDiscountId { get; set; } - - [Column("VolumeDiscountSKUID")] - public int VolumeDiscountSkuid { get; set; } - - public int VolumeDiscountMinCount { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal VolumeDiscountValue { get; set; } - - public bool VolumeDiscountIsFlatValue { get; set; } - - [Column("VolumeDiscountGUID")] - public Guid VolumeDiscountGuid { get; set; } - - public DateTime VolumeDiscountLastModified { get; set; } - - [ForeignKey("VolumeDiscountSkuid")] - [InverseProperty("ComVolumeDiscounts")] - public virtual ComSku VolumeDiscountSku { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ComWishlist.cs b/Migration.Toolkit.KX12/Models/ComWishlist.cs deleted file mode 100644 index 1065a935..00000000 --- a/Migration.Toolkit.KX12/Models/ComWishlist.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("UserId", "Skuid", "SiteId")] -[Table("COM_Wishlist")] -[Index("Skuid", Name = "IX_COM_Wishlist_SKUID")] -[Index("SiteId", "UserId", Name = "IX_COM_Wishlist_SiteID_UserID")] -public class ComWishlist -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [Key] - [Column("SKUID")] - public int Skuid { get; set; } - - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("ComWishlists")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComWishlists")] - public virtual ComSku Sku { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("ComWishlists")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CommunityGroup.cs b/Migration.Toolkit.KX12/Models/CommunityGroup.cs deleted file mode 100644 index 95a87924..00000000 --- a/Migration.Toolkit.KX12/Models/CommunityGroup.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Community_Group")] -[Index("GroupApproved", Name = "IX_Community_Group_GroupApproved")] -[Index("GroupApprovedByUserId", Name = "IX_Community_Group_GroupApprovedByUserID")] -[Index("GroupAvatarId", Name = "IX_Community_Group_GroupAvatarID")] -[Index("GroupCreatedByUserId", Name = "IX_Community_Group_GroupCreatedByUserID")] -[Index("GroupSiteId", "GroupName", Name = "IX_Community_Group_GroupSiteID_GroupName")] -public class CommunityGroup -{ - [Key] - [Column("GroupID")] - public int GroupId { get; set; } - - [Column("GroupGUID")] - public Guid GroupGuid { get; set; } - - public DateTime GroupLastModified { get; set; } - - [Column("GroupSiteID")] - public int GroupSiteId { get; set; } - - [StringLength(200)] - public string GroupDisplayName { get; set; } = null!; - - [StringLength(100)] - public string GroupName { get; set; } = null!; - - public string GroupDescription { get; set; } = null!; - - [Column("GroupNodeGUID")] - public Guid? GroupNodeGuid { get; set; } - - public int GroupApproveMembers { get; set; } - - public int GroupAccess { get; set; } - - [Column("GroupCreatedByUserID")] - public int? GroupCreatedByUserId { get; set; } - - [Column("GroupApprovedByUserID")] - public int? GroupApprovedByUserId { get; set; } - - [Column("GroupAvatarID")] - public int? GroupAvatarId { get; set; } - - public bool? GroupApproved { get; set; } - - public DateTime GroupCreatedWhen { get; set; } - - public bool? GroupSendJoinLeaveNotification { get; set; } - - public bool? GroupSendWaitingForApprovalNotification { get; set; } - - public int? GroupSecurity { get; set; } - - public bool? GroupLogActivity { get; set; } - - [InverseProperty("BoardGroup")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("RoleGroup")] - public virtual ICollection CmsRoles { get; set; } = new List(); - - [InverseProperty("NodeGroup")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("MemberGroup")] - public virtual ICollection CommunityGroupMembers { get; set; } = new List(); - - [InverseProperty("Group")] - public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); - - [InverseProperty("InvitationGroup")] - public virtual ICollection CommunityInvitations { get; set; } = new List(); - - [InverseProperty("GroupGroup")] - public virtual ICollection ForumsForumGroups { get; set; } = new List(); - - [InverseProperty("ForumCommunityGroup")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [ForeignKey("GroupApprovedByUserId")] - [InverseProperty("CommunityGroupGroupApprovedByUsers")] - public virtual CmsUser? GroupApprovedByUser { get; set; } - - [ForeignKey("GroupAvatarId")] - [InverseProperty("CommunityGroups")] - public virtual CmsAvatar? GroupAvatar { get; set; } - - [ForeignKey("GroupCreatedByUserId")] - [InverseProperty("CommunityGroupGroupCreatedByUsers")] - public virtual CmsUser? GroupCreatedByUser { get; set; } - - [ForeignKey("GroupSiteId")] - [InverseProperty("CommunityGroups")] - public virtual CmsSite GroupSite { get; set; } = null!; - - [InverseProperty("LibraryGroup")] - public virtual ICollection MediaLibraries { get; set; } = new List(); - - [InverseProperty("PollGroup")] - public virtual ICollection PollsPolls { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/CommunityGroupMember.cs b/Migration.Toolkit.KX12/Models/CommunityGroupMember.cs deleted file mode 100644 index a3ba57ec..00000000 --- a/Migration.Toolkit.KX12/Models/CommunityGroupMember.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Community_GroupMember")] -[Index("MemberApprovedByUserId", Name = "IX_Community_GroupMember_MemberApprovedByUserID")] -[Index("MemberGroupId", Name = "IX_Community_GroupMember_MemberGroupID")] -[Index("MemberInvitedByUserId", Name = "IX_Community_GroupMember_MemberInvitedByUserID")] -[Index("MemberStatus", Name = "IX_Community_GroupMember_MemberStatus")] -[Index("MemberUserId", Name = "IX_Community_GroupMember_MemberUserID")] -public class CommunityGroupMember -{ - [Key] - [Column("MemberID")] - public int MemberId { get; set; } - - [Column("MemberGUID")] - public Guid MemberGuid { get; set; } - - [Column("MemberUserID")] - public int MemberUserId { get; set; } - - [Column("MemberGroupID")] - public int MemberGroupId { get; set; } - - public DateTime MemberJoined { get; set; } - - public DateTime? MemberApprovedWhen { get; set; } - - public DateTime? MemberRejectedWhen { get; set; } - - [Column("MemberApprovedByUserID")] - public int? MemberApprovedByUserId { get; set; } - - public string? MemberComment { get; set; } - - [Column("MemberInvitedByUserID")] - public int? MemberInvitedByUserId { get; set; } - - public int? MemberStatus { get; set; } - - [ForeignKey("MemberApprovedByUserId")] - [InverseProperty("CommunityGroupMemberMemberApprovedByUsers")] - public virtual CmsUser? MemberApprovedByUser { get; set; } - - [ForeignKey("MemberGroupId")] - [InverseProperty("CommunityGroupMembers")] - public virtual CommunityGroup MemberGroup { get; set; } = null!; - - [ForeignKey("MemberInvitedByUserId")] - [InverseProperty("CommunityGroupMemberMemberInvitedByUsers")] - public virtual CmsUser? MemberInvitedByUser { get; set; } - - [ForeignKey("MemberUserId")] - [InverseProperty("CommunityGroupMemberMemberUsers")] - public virtual CmsUser MemberUser { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CommunityGroupRolePermission.cs b/Migration.Toolkit.KX12/Models/CommunityGroupRolePermission.cs deleted file mode 100644 index 31661208..00000000 --- a/Migration.Toolkit.KX12/Models/CommunityGroupRolePermission.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("GroupId", "RoleId", "PermissionId")] -[Table("Community_GroupRolePermission")] -[Index("PermissionId", Name = "IX_Community_GroupRolePermission_PermissionID")] -[Index("RoleId", Name = "IX_Community_GroupRolePermission_RoleID")] -public class CommunityGroupRolePermission -{ - [Key] - [Column("GroupID")] - public int GroupId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("GroupId")] - [InverseProperty("CommunityGroupRolePermissions")] - public virtual CommunityGroup Group { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("CommunityGroupRolePermissions")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("CommunityGroupRolePermissions")] - public virtual CmsRole Role { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/CommunityInvitation.cs b/Migration.Toolkit.KX12/Models/CommunityInvitation.cs deleted file mode 100644 index 2ade8741..00000000 --- a/Migration.Toolkit.KX12/Models/CommunityInvitation.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Community_Invitation")] -[Index("InvitationGroupId", Name = "IX_Community_Invitation_InvitationGroupID")] -[Index("InvitedByUserId", Name = "IX_Community_Invitation_InvitedByUserID")] -[Index("InvitedUserId", Name = "IX_Community_Invitation_InvitedUserID")] -public class CommunityInvitation -{ - [Key] - [Column("InvitationID")] - public int InvitationId { get; set; } - - [Column("InvitedUserID")] - public int? InvitedUserId { get; set; } - - [Column("InvitedByUserID")] - public int InvitedByUserId { get; set; } - - [Column("InvitationGroupID")] - public int? InvitationGroupId { get; set; } - - public DateTime? InvitationCreated { get; set; } - - public DateTime? InvitationValidTo { get; set; } - - public string? InvitationComment { get; set; } - - [Column("InvitationGUID")] - public Guid InvitationGuid { get; set; } - - public DateTime InvitationLastModified { get; set; } - - [StringLength(254)] - public string? InvitationUserEmail { get; set; } - - [ForeignKey("InvitationGroupId")] - [InverseProperty("CommunityInvitations")] - public virtual CommunityGroup? InvitationGroup { get; set; } - - [ForeignKey("InvitedByUserId")] - [InverseProperty("CommunityInvitationInvitedByUsers")] - public virtual CmsUser InvitedByUser { get; set; } = null!; - - [ForeignKey("InvitedUserId")] - [InverseProperty("CommunityInvitationInvitedUsers")] - public virtual CmsUser? InvitedUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ContentFile.cs b/Migration.Toolkit.KX12/Models/ContentFile.cs deleted file mode 100644 index 43432949..00000000 --- a/Migration.Toolkit.KX12/Models/ContentFile.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CONTENT_File")] -public class ContentFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [StringLength(500)] - public string? FileDescription { get; set; } - - [StringLength(100)] - public string FileName { get; set; } = null!; - - public Guid? FileAttachment { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/EventsAttendee.cs b/Migration.Toolkit.KX12/Models/EventsAttendee.cs deleted file mode 100644 index 8f826fac..00000000 --- a/Migration.Toolkit.KX12/Models/EventsAttendee.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Events_Attendee")] -[Index("AttendeeEventNodeId", Name = "IX_Events_Attendee_AttendeeEventNodeID")] -public class EventsAttendee -{ - [Key] - [Column("AttendeeID")] - public int AttendeeId { get; set; } - - [StringLength(254)] - public string AttendeeEmail { get; set; } = null!; - - [StringLength(100)] - public string? AttendeeFirstName { get; set; } - - [StringLength(100)] - public string? AttendeeLastName { get; set; } - - [StringLength(50)] - public string? AttendeePhone { get; set; } - - [Column("AttendeeEventNodeID")] - public int AttendeeEventNodeId { get; set; } - - [Column("AttendeeGUID")] - public Guid AttendeeGuid { get; set; } - - public DateTime AttendeeLastModified { get; set; } - - [ForeignKey("AttendeeEventNodeId")] - [InverseProperty("EventsAttendees")] - public virtual CmsTree AttendeeEventNode { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ExportHistory.cs b/Migration.Toolkit.KX12/Models/ExportHistory.cs deleted file mode 100644 index 362bcc17..00000000 --- a/Migration.Toolkit.KX12/Models/ExportHistory.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Export_History")] -[Index("ExportSiteId", Name = "IX_Export_History_ExportSiteID")] -[Index("ExportUserId", Name = "IX_Export_History_ExportUserID")] -public class ExportHistory -{ - [Key] - [Column("ExportID")] - public int ExportId { get; set; } - - public DateTime ExportDateTime { get; set; } - - [StringLength(450)] - public string ExportFileName { get; set; } = null!; - - [Column("ExportSiteID")] - public int? ExportSiteId { get; set; } - - [Column("ExportUserID")] - public int? ExportUserId { get; set; } - - public string? ExportSettings { get; set; } - - [ForeignKey("ExportSiteId")] - [InverseProperty("ExportHistories")] - public virtual CmsSite? ExportSite { get; set; } - - [ForeignKey("ExportUserId")] - [InverseProperty("ExportHistories")] - public virtual CmsUser? ExportUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ExportTask.cs b/Migration.Toolkit.KX12/Models/ExportTask.cs deleted file mode 100644 index d9a99a49..00000000 --- a/Migration.Toolkit.KX12/Models/ExportTask.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Export_Task")] -[Index("TaskSiteId", "TaskObjectType", Name = "IX_Export_Task_TaskSiteID_TaskObjectType")] -public class ExportTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [ForeignKey("TaskSiteId")] - [InverseProperty("ExportTasks")] - public virtual CmsSite? TaskSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ForumsAttachment.cs b/Migration.Toolkit.KX12/Models/ForumsAttachment.cs deleted file mode 100644 index a97f92d1..00000000 --- a/Migration.Toolkit.KX12/Models/ForumsAttachment.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Forums_Attachment")] -[Index("AttachmentSiteId", "AttachmentGuid", Name = "IX_Forums_Attachment_AttachmentGUID", IsUnique = true)] -[Index("AttachmentPostId", Name = "IX_Forums_Attachment_AttachmentPostID")] -public class ForumsAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(200)] - public string AttachmentFileName { get; set; } = null!; - - [StringLength(10)] - public string AttachmentFileExtension { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public int AttachmentFileSize { get; set; } - - public int? AttachmentImageHeight { get; set; } - - public int? AttachmentImageWidth { get; set; } - - [Column("AttachmentPostID")] - public int AttachmentPostId { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - [ForeignKey("AttachmentPostId")] - [InverseProperty("ForumsAttachments")] - public virtual ForumsForumPost AttachmentPost { get; set; } = null!; - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("ForumsAttachments")] - public virtual CmsSite AttachmentSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ForumsForum.cs b/Migration.Toolkit.KX12/Models/ForumsForum.cs deleted file mode 100644 index 29e2aba5..00000000 --- a/Migration.Toolkit.KX12/Models/ForumsForum.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Forums_Forum")] -[Index("ForumCommunityGroupId", Name = "IX_Forums_Forum_ForumCommunityGroupID")] -[Index("ForumDocumentId", Name = "IX_Forums_Forum_ForumDocumentID")] -[Index("ForumSiteId", "ForumName", Name = "IX_Forums_Forum_ForumSiteID_ForumName")] -public class ForumsForum -{ - [Key] - [Column("ForumID")] - public int ForumId { get; set; } - - [Column("ForumGroupID")] - public int ForumGroupId { get; set; } - - [StringLength(200)] - public string ForumName { get; set; } = null!; - - [StringLength(200)] - public string ForumDisplayName { get; set; } = null!; - - public string? ForumDescription { get; set; } - - public int? ForumOrder { get; set; } - - [Column("ForumDocumentID")] - public int? ForumDocumentId { get; set; } - - public bool ForumOpen { get; set; } - - public bool ForumModerated { get; set; } - - public bool? ForumDisplayEmails { get; set; } - - public bool? ForumRequireEmail { get; set; } - - public int ForumAccess { get; set; } - - public int ForumThreads { get; set; } - - public int ForumPosts { get; set; } - - public DateTime? ForumLastPostTime { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserName { get; set; } - - [StringLength(200)] - public string? ForumBaseUrl { get; set; } - - public bool? ForumAllowChangeName { get; set; } - - [Column("ForumHTMLEditor")] - public bool? ForumHtmleditor { get; set; } - - [Column("ForumUseCAPTCHA")] - public bool? ForumUseCaptcha { get; set; } - - [Column("ForumGUID")] - public Guid ForumGuid { get; set; } - - public DateTime ForumLastModified { get; set; } - - [StringLength(200)] - public string? ForumUnsubscriptionUrl { get; set; } - - public bool? ForumIsLocked { get; set; } - - public string? ForumSettings { get; set; } - - public bool? ForumAuthorEdit { get; set; } - - public bool? ForumAuthorDelete { get; set; } - - public int? ForumType { get; set; } - - public int? ForumIsAnswerLimit { get; set; } - - public int? ForumImageMaxSideSize { get; set; } - - public DateTime? ForumLastPostTimeAbsolute { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserNameAbsolute { get; set; } - - public int? ForumPostsAbsolute { get; set; } - - public int? ForumThreadsAbsolute { get; set; } - - public int? ForumAttachmentMaxFileSize { get; set; } - - public int? ForumDiscussionActions { get; set; } - - [Column("ForumSiteID")] - public int ForumSiteId { get; set; } - - public bool? ForumLogActivity { get; set; } - - [Column("ForumCommunityGroupID")] - public int? ForumCommunityGroupId { get; set; } - - public bool? ForumEnableOptIn { get; set; } - - public bool? ForumSendOptInConfirmation { get; set; } - - [Column("ForumOptInApprovalURL")] - [StringLength(450)] - public string? ForumOptInApprovalUrl { get; set; } - - [ForeignKey("ForumCommunityGroupId")] - [InverseProperty("ForumsForums")] - public virtual CommunityGroup? ForumCommunityGroup { get; set; } - - [ForeignKey("ForumDocumentId")] - [InverseProperty("ForumsForums")] - public virtual CmsDocument? ForumDocument { get; set; } - - [ForeignKey("ForumGroupId")] - [InverseProperty("ForumsForums")] - public virtual ForumsForumGroup ForumGroup { get; set; } = null!; - - [ForeignKey("ForumSiteId")] - [InverseProperty("ForumsForums")] - public virtual CmsSite ForumSite { get; set; } = null!; - - [InverseProperty("PostForum")] - public virtual ICollection ForumsForumPosts { get; set; } = new List(); - - [InverseProperty("Forum")] - public virtual ICollection ForumsForumRoles { get; set; } = new List(); - - [InverseProperty("SubscriptionForum")] - public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); - - [InverseProperty("Forum")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [ForeignKey("ForumId")] - [InverseProperty("Forums")] - public virtual ICollection Users { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/ForumsForumGroup.cs b/Migration.Toolkit.KX12/Models/ForumsForumGroup.cs deleted file mode 100644 index cd33d010..00000000 --- a/Migration.Toolkit.KX12/Models/ForumsForumGroup.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Forums_ForumGroup")] -[Index("GroupGroupId", Name = "IX_Forums_ForumGroup_GroupGroupID")] -[Index("GroupSiteId", "GroupName", Name = "IX_Forums_ForumGroup_GroupSiteID_GroupName")] -public class ForumsForumGroup -{ - [Key] - [Column("GroupID")] - public int GroupId { get; set; } - - [Column("GroupSiteID")] - public int GroupSiteId { get; set; } - - [StringLength(200)] - public string GroupName { get; set; } = null!; - - [StringLength(200)] - public string GroupDisplayName { get; set; } = null!; - - public int? GroupOrder { get; set; } - - public string? GroupDescription { get; set; } - - [Column("GroupGUID")] - public Guid GroupGuid { get; set; } - - public DateTime GroupLastModified { get; set; } - - [StringLength(200)] - public string? GroupBaseUrl { get; set; } - - [StringLength(200)] - public string? GroupUnsubscriptionUrl { get; set; } - - [Column("GroupGroupID")] - public int? GroupGroupId { get; set; } - - public bool? GroupAuthorEdit { get; set; } - - public bool? GroupAuthorDelete { get; set; } - - public int? GroupType { get; set; } - - public int? GroupIsAnswerLimit { get; set; } - - public int? GroupImageMaxSideSize { get; set; } - - public bool? GroupDisplayEmails { get; set; } - - public bool? GroupRequireEmail { get; set; } - - [Column("GroupHTMLEditor")] - public bool? GroupHtmleditor { get; set; } - - [Column("GroupUseCAPTCHA")] - public bool? GroupUseCaptcha { get; set; } - - public int? GroupAttachmentMaxFileSize { get; set; } - - public int? GroupDiscussionActions { get; set; } - - public bool? GroupLogActivity { get; set; } - - public bool? GroupEnableOptIn { get; set; } - - public bool? GroupSendOptInConfirmation { get; set; } - - [Column("GroupOptInApprovalURL")] - [StringLength(450)] - public string? GroupOptInApprovalUrl { get; set; } - - [InverseProperty("ForumGroup")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [ForeignKey("GroupGroupId")] - [InverseProperty("ForumsForumGroups")] - public virtual CommunityGroup? GroupGroup { get; set; } - - [ForeignKey("GroupSiteId")] - [InverseProperty("ForumsForumGroups")] - public virtual CmsSite GroupSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ForumsForumPost.cs b/Migration.Toolkit.KX12/Models/ForumsForumPost.cs deleted file mode 100644 index 6835d04d..00000000 --- a/Migration.Toolkit.KX12/Models/ForumsForumPost.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Forums_ForumPost")] -[Index("PostApproved", Name = "IX_Forums_ForumPost_PostApproved")] -[Index("PostApprovedByUserId", Name = "IX_Forums_ForumPost_PostApprovedByUserID")] -[Index("PostForumId", Name = "IX_Forums_ForumPost_PostForumID")] -[Index("PostLevel", Name = "IX_Forums_ForumPost_PostLevel")] -[Index("PostParentId", Name = "IX_Forums_ForumPost_PostParentID")] -[Index("PostUserId", Name = "IX_Forums_ForumPost_PostUserID")] -public class ForumsForumPost -{ - [Key] - public int PostId { get; set; } - - [Column("PostForumID")] - public int PostForumId { get; set; } - - [Column("PostParentID")] - public int? PostParentId { get; set; } - - [Column("PostIDPath")] - public string PostIdpath { get; set; } = null!; - - public int PostLevel { get; set; } - - [StringLength(450)] - public string PostSubject { get; set; } = null!; - - [Column("PostUserID")] - public int? PostUserId { get; set; } - - [StringLength(200)] - public string PostUserName { get; set; } = null!; - - [StringLength(254)] - public string? PostUserMail { get; set; } - - public string? PostText { get; set; } - - public DateTime PostTime { get; set; } - - [Column("PostApprovedByUserID")] - public int? PostApprovedByUserId { get; set; } - - public int? PostThreadPosts { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserName { get; set; } - - public DateTime? PostThreadLastPostTime { get; set; } - - public string? PostUserSignature { get; set; } - - [Column("PostGUID")] - public Guid PostGuid { get; set; } - - public DateTime PostLastModified { get; set; } - - public bool? PostApproved { get; set; } - - public bool? PostIsLocked { get; set; } - - public int? PostIsAnswer { get; set; } - - public int PostStickOrder { get; set; } - - public int? PostViews { get; set; } - - public DateTime? PostLastEdit { get; set; } - - public string? PostInfo { get; set; } - - public int? PostAttachmentCount { get; set; } - - public int? PostType { get; set; } - - public int? PostThreadPostsAbsolute { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserNameAbsolute { get; set; } - - public DateTime? PostThreadLastPostTimeAbsolute { get; set; } - - public bool? PostQuestionSolved { get; set; } - - public int? PostIsNotAnswer { get; set; } - - [Column("PostSiteID")] - public int? PostSiteId { get; set; } - - [InverseProperty("AttachmentPost")] - public virtual ICollection ForumsAttachments { get; set; } = new List(); - - [InverseProperty("SubscriptionPost")] - public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); - - [InverseProperty("Post")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [InverseProperty("PostParent")] - public virtual ICollection InversePostParent { get; set; } = new List(); - - [ForeignKey("PostApprovedByUserId")] - [InverseProperty("ForumsForumPostPostApprovedByUsers")] - public virtual CmsUser? PostApprovedByUser { get; set; } - - [ForeignKey("PostForumId")] - [InverseProperty("ForumsForumPosts")] - public virtual ForumsForum PostForum { get; set; } = null!; - - [ForeignKey("PostParentId")] - [InverseProperty("InversePostParent")] - public virtual ForumsForumPost? PostParent { get; set; } - - [ForeignKey("PostUserId")] - [InverseProperty("ForumsForumPostPostUsers")] - public virtual CmsUser? PostUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ForumsForumRole.cs b/Migration.Toolkit.KX12/Models/ForumsForumRole.cs deleted file mode 100644 index 9bb70b81..00000000 --- a/Migration.Toolkit.KX12/Models/ForumsForumRole.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("ForumId", "RoleId", "PermissionId")] -[Table("Forums_ForumRoles")] -[Index("PermissionId", Name = "IX_Forums_ForumRoles_PermissionID")] -[Index("RoleId", Name = "IX_Forums_ForumRoles_RoleID")] -public class ForumsForumRole -{ - [Key] - [Column("ForumID")] - public int ForumId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("ForumId")] - [InverseProperty("ForumsForumRoles")] - public virtual ForumsForum Forum { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("ForumsForumRoles")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("ForumsForumRoles")] - public virtual CmsRole Role { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ForumsForumSubscription.cs b/Migration.Toolkit.KX12/Models/ForumsForumSubscription.cs deleted file mode 100644 index c770d86a..00000000 --- a/Migration.Toolkit.KX12/Models/ForumsForumSubscription.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Forums_ForumSubscription")] -[Index("SubscriptionForumId", Name = "IX_Forums_ForumSubscription_SubscriptionForumID")] -[Index("SubscriptionPostId", Name = "IX_Forums_ForumSubscription_SubscriptionPostID")] -[Index("SubscriptionUserId", Name = "IX_Forums_ForumSubscription_SubscriptionUserID")] -public class ForumsForumSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionUserID")] - public int? SubscriptionUserId { get; set; } - - [StringLength(254)] - public string? SubscriptionEmail { get; set; } - - [Column("SubscriptionForumID")] - public int SubscriptionForumId { get; set; } - - [Column("SubscriptionPostID")] - public int? SubscriptionPostId { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public DateTime SubscriptionLastModified { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [ForeignKey("SubscriptionForumId")] - [InverseProperty("ForumsForumSubscriptions")] - public virtual ForumsForum SubscriptionForum { get; set; } = null!; - - [ForeignKey("SubscriptionPostId")] - [InverseProperty("ForumsForumSubscriptions")] - public virtual ForumsForumPost? SubscriptionPost { get; set; } - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("ForumsForumSubscriptions")] - public virtual CmsUser? SubscriptionUser { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ForumsUserFavorite.cs b/Migration.Toolkit.KX12/Models/ForumsUserFavorite.cs deleted file mode 100644 index d0687ebc..00000000 --- a/Migration.Toolkit.KX12/Models/ForumsUserFavorite.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Forums_UserFavorites")] -[Index("ForumId", Name = "IX_Forums_UserFavorites_ForumID")] -[Index("PostId", Name = "IX_Forums_UserFavorites_PostID")] -[Index("SiteId", Name = "IX_Forums_UserFavorites_SiteID")] -[Index("UserId", Name = "IX_Forums_UserFavorites_UserID")] -[Index("UserId", "PostId", "ForumId", Name = "IX_Forums_UserFavorites_UserID_PostID_ForumID", IsUnique = true)] -public class ForumsUserFavorite -{ - [Key] - [Column("FavoriteID")] - public int FavoriteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("PostID")] - public int? PostId { get; set; } - - [Column("ForumID")] - public int? ForumId { get; set; } - - [StringLength(100)] - public string? FavoriteName { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [Column("FavoriteGUID")] - public Guid FavoriteGuid { get; set; } - - public DateTime FavoriteLastModified { get; set; } - - [ForeignKey("ForumId")] - [InverseProperty("ForumsUserFavorites")] - public virtual ForumsForum? Forum { get; set; } - - [ForeignKey("PostId")] - [InverseProperty("ForumsUserFavorites")] - public virtual ForumsForumPost? Post { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("ForumsUserFavorites")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("ForumsUserFavorites")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/IntegrationConnector.cs b/Migration.Toolkit.KX12/Models/IntegrationConnector.cs deleted file mode 100644 index a6395be1..00000000 --- a/Migration.Toolkit.KX12/Models/IntegrationConnector.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Integration_Connector")] -[Index("ConnectorEnabled", Name = "IX_Integration_Connector_ConnectorEnabled")] -public class IntegrationConnector -{ - [Key] - [Column("ConnectorID")] - public int ConnectorId { get; set; } - - [StringLength(100)] - public string ConnectorName { get; set; } = null!; - - [StringLength(440)] - public string ConnectorDisplayName { get; set; } = null!; - - [StringLength(400)] - public string ConnectorAssemblyName { get; set; } = null!; - - [StringLength(400)] - public string ConnectorClassName { get; set; } = null!; - - [Required] - public bool? ConnectorEnabled { get; set; } - - public DateTime ConnectorLastModified { get; set; } - - [InverseProperty("SynchronizationConnector")] - public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/IntegrationSyncLog.cs b/Migration.Toolkit.KX12/Models/IntegrationSyncLog.cs deleted file mode 100644 index a632396c..00000000 --- a/Migration.Toolkit.KX12/Models/IntegrationSyncLog.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Integration_SyncLog")] -[Index("SyncLogSynchronizationId", Name = "IX_Integration_SyncLog_SyncLogTaskID")] -public class IntegrationSyncLog -{ - [Key] - [Column("SyncLogID")] - public int SyncLogId { get; set; } - - [Column("SyncLogSynchronizationID")] - public int SyncLogSynchronizationId { get; set; } - - public DateTime SyncLogTime { get; set; } - - public string? SyncLogErrorMessage { get; set; } - - [ForeignKey("SyncLogSynchronizationId")] - [InverseProperty("IntegrationSyncLogs")] - public virtual IntegrationSynchronization SyncLogSynchronization { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/IntegrationSynchronization.cs b/Migration.Toolkit.KX12/Models/IntegrationSynchronization.cs deleted file mode 100644 index ea98f81d..00000000 --- a/Migration.Toolkit.KX12/Models/IntegrationSynchronization.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Integration_Synchronization")] -[Index("SynchronizationConnectorId", Name = "IX_Integration_Synchronization_SynchronizationConnectorID")] -[Index("SynchronizationTaskId", Name = "IX_Integration_Synchronization_SynchronizationTaskID")] -public class IntegrationSynchronization -{ - [Key] - [Column("SynchronizationID")] - public int SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int SynchronizationTaskId { get; set; } - - [Column("SynchronizationConnectorID")] - public int SynchronizationConnectorId { get; set; } - - public DateTime SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - public bool? SynchronizationIsRunning { get; set; } - - [InverseProperty("SyncLogSynchronization")] - public virtual ICollection IntegrationSyncLogs { get; set; } = new List(); - - [ForeignKey("SynchronizationConnectorId")] - [InverseProperty("IntegrationSynchronizations")] - public virtual IntegrationConnector SynchronizationConnector { get; set; } = null!; - - [ForeignKey("SynchronizationTaskId")] - [InverseProperty("IntegrationSynchronizations")] - public virtual IntegrationTask SynchronizationTask { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/IntegrationTask.cs b/Migration.Toolkit.KX12/Models/IntegrationTask.cs deleted file mode 100644 index cd737e21..00000000 --- a/Migration.Toolkit.KX12/Models/IntegrationTask.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Integration_Task")] -[Index("TaskIsInbound", Name = "IX_Integration_Task_TaskIsInbound")] -[Index("TaskSiteId", Name = "IX_Integration_Task_TaskSiteID")] -[Index("TaskType", Name = "IX_Integration_Task_TaskType")] -public class IntegrationTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool TaskIsInbound { get; set; } - - [StringLength(50)] - public string? TaskProcessType { get; set; } - - public string TaskData { get; set; } = null!; - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(50)] - public string? TaskDataType { get; set; } - - [InverseProperty("SynchronizationTask")] - public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); - - [ForeignKey("TaskSiteId")] - [InverseProperty("IntegrationTasks")] - public virtual CmsSite? TaskSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/MediaFile.cs b/Migration.Toolkit.KX12/Models/MediaFile.cs deleted file mode 100644 index 3ca31ac6..00000000 --- a/Migration.Toolkit.KX12/Models/MediaFile.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Media_File")] -[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] -[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] -[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] -[Index("FileSiteId", "FileGuid", Name = "IX_Media_File_FileSiteID_FileGUID")] -public class MediaFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string FileTitle { get; set; } = null!; - - public string FileDescription { get; set; } = null!; - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public string FilePath { get; set; } = null!; - - public long FileSize { get; set; } - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileLibraryID")] - public int FileLibraryId { get; set; } - - [Column("FileSiteID")] - public int FileSiteId { get; set; } - - [Column("FileCreatedByUserID")] - public int? FileCreatedByUserId { get; set; } - - public DateTime FileCreatedWhen { get; set; } - - [Column("FileModifiedByUserID")] - public int? FileModifiedByUserId { get; set; } - - public DateTime FileModifiedWhen { get; set; } - - public string? FileCustomData { get; set; } - - [ForeignKey("FileCreatedByUserId")] - [InverseProperty("MediaFileFileCreatedByUsers")] - public virtual CmsUser? FileCreatedByUser { get; set; } - - [ForeignKey("FileLibraryId")] - [InverseProperty("MediaFiles")] - public virtual MediaLibrary FileLibrary { get; set; } = null!; - - [ForeignKey("FileModifiedByUserId")] - [InverseProperty("MediaFileFileModifiedByUsers")] - public virtual CmsUser? FileModifiedByUser { get; set; } - - [ForeignKey("FileSiteId")] - [InverseProperty("MediaFiles")] - public virtual CmsSite FileSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/MediaLibrary.cs b/Migration.Toolkit.KX12/Models/MediaLibrary.cs deleted file mode 100644 index a5cf7f7a..00000000 --- a/Migration.Toolkit.KX12/Models/MediaLibrary.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Media_Library")] -[Index("LibraryGroupId", Name = "IX_Media_Library_LibraryGroupID")] -[Index("LibrarySiteId", "LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] -public class MediaLibrary -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [StringLength(250)] - public string LibraryName { get; set; } = null!; - - [StringLength(250)] - public string LibraryDisplayName { get; set; } = null!; - - public string? LibraryDescription { get; set; } - - [StringLength(250)] - public string LibraryFolder { get; set; } = null!; - - public int? LibraryAccess { get; set; } - - [Column("LibraryGroupID")] - public int? LibraryGroupId { get; set; } - - [Column("LibrarySiteID")] - public int LibrarySiteId { get; set; } - - [Column("LibraryGUID")] - public Guid? LibraryGuid { get; set; } - - public DateTime? LibraryLastModified { get; set; } - - [StringLength(450)] - public string? LibraryTeaserPath { get; set; } - - [Column("LibraryTeaserGUID")] - public Guid? LibraryTeaserGuid { get; set; } - - [ForeignKey("LibraryGroupId")] - [InverseProperty("MediaLibraries")] - public virtual CommunityGroup? LibraryGroup { get; set; } - - [ForeignKey("LibrarySiteId")] - [InverseProperty("MediaLibraries")] - public virtual CmsSite LibrarySite { get; set; } = null!; - - [InverseProperty("FileLibrary")] - public virtual ICollection MediaFiles { get; set; } = new List(); - - [InverseProperty("Library")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/MediaLibraryRolePermission.cs b/Migration.Toolkit.KX12/Models/MediaLibraryRolePermission.cs deleted file mode 100644 index 2965822f..00000000 --- a/Migration.Toolkit.KX12/Models/MediaLibraryRolePermission.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("LibraryId", "RoleId", "PermissionId")] -[Table("Media_LibraryRolePermission")] -[Index("PermissionId", Name = "IX_Media_LibraryRolePermission_PermissionID")] -[Index("RoleId", Name = "IX_Media_LibraryRolePermission_RoleID")] -public class MediaLibraryRolePermission -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("LibraryId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual MediaLibrary Library { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual CmsRole Role { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterAbtest.cs b/Migration.Toolkit.KX12/Models/NewsletterAbtest.cs deleted file mode 100644 index 1a8f7cd7..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterAbtest.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_ABTest")] -[Index("TestIssueId", Name = "IX_Newsletter_ABTest_TestIssueID", IsUnique = true)] -[Index("TestWinnerIssueId", Name = "IX_Newsletter_ABTest_TestWinnerIssueID")] -[Index("TestWinnerScheduledTaskId", Name = "IX_Newsletter_ABTest_TestWinnerScheduledTaskID")] -public class NewsletterAbtest -{ - [Key] - [Column("TestID")] - public int TestId { get; set; } - - [Column("TestIssueID")] - public int TestIssueId { get; set; } - - public int TestWinnerOption { get; set; } - - public int? TestSelectWinnerAfter { get; set; } - - [Column("TestWinnerIssueID")] - public int? TestWinnerIssueId { get; set; } - - public DateTime? TestWinnerSelected { get; set; } - - public DateTime TestLastModified { get; set; } - - [Column("TestGUID")] - public Guid TestGuid { get; set; } - - [Column("TestWinnerScheduledTaskID")] - public int? TestWinnerScheduledTaskId { get; set; } - - public int TestSizePercentage { get; set; } - - public int? TestNumberPerVariantEmails { get; set; } - - [ForeignKey("TestIssueId")] - [InverseProperty("NewsletterAbtestTestIssue")] - public virtual NewsletterNewsletterIssue TestIssue { get; set; } = null!; - - [ForeignKey("TestWinnerIssueId")] - [InverseProperty("NewsletterAbtestTestWinnerIssues")] - public virtual NewsletterNewsletterIssue? TestWinnerIssue { get; set; } - - [ForeignKey("TestWinnerScheduledTaskId")] - [InverseProperty("NewsletterAbtests")] - public virtual CmsScheduledTask? TestWinnerScheduledTask { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterClickedLink.cs b/Migration.Toolkit.KX12/Models/NewsletterClickedLink.cs deleted file mode 100644 index e4376616..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterClickedLink.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_ClickedLink")] -[Index("ClickedLinkNewsletterLinkId", Name = "IX_Newsletter_ClickedLink_ClickedLinkNewsletterLinkID")] -public class NewsletterClickedLink -{ - [Key] - [Column("ClickedLinkID")] - public int ClickedLinkId { get; set; } - - public Guid ClickedLinkGuid { get; set; } - - [StringLength(254)] - public string ClickedLinkEmail { get; set; } = null!; - - [Column("ClickedLinkNewsletterLinkID")] - public int ClickedLinkNewsletterLinkId { get; set; } - - public DateTime? ClickedLinkTime { get; set; } - - [ForeignKey("ClickedLinkNewsletterLinkId")] - [InverseProperty("NewsletterClickedLinks")] - public virtual NewsletterLink ClickedLinkNewsletterLink { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterEmail.cs b/Migration.Toolkit.KX12/Models/NewsletterEmail.cs deleted file mode 100644 index 630678b2..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterEmail.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_Emails")] -[Index("EmailGuid", Name = "IX_Newsletter_Emails_EmailGUID", IsUnique = true)] -[Index("EmailNewsletterIssueId", Name = "IX_Newsletter_Emails_EmailNewsletterIssueID")] -[Index("EmailSending", Name = "IX_Newsletter_Emails_EmailSending")] -[Index("EmailSiteId", Name = "IX_Newsletter_Emails_EmailSiteID")] -[Index("EmailSubscriberId", Name = "IX_Newsletter_Emails_EmailSubscriberID")] -public class NewsletterEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [Column("EmailNewsletterIssueID")] - public int EmailNewsletterIssueId { get; set; } - - [Column("EmailSubscriberID")] - public int? EmailSubscriberId { get; set; } - - [Column("EmailSiteID")] - public int EmailSiteId { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - public bool? EmailSending { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - [Column("EmailContactID")] - public int? EmailContactId { get; set; } - - [StringLength(254)] - public string? EmailAddress { get; set; } - - [ForeignKey("EmailNewsletterIssueId")] - [InverseProperty("NewsletterEmails")] - public virtual NewsletterNewsletterIssue EmailNewsletterIssue { get; set; } = null!; - - [ForeignKey("EmailSiteId")] - [InverseProperty("NewsletterEmails")] - public virtual CmsSite EmailSite { get; set; } = null!; - - [ForeignKey("EmailSubscriberId")] - [InverseProperty("NewsletterEmails")] - public virtual NewsletterSubscriber? EmailSubscriber { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterEmailTemplate.cs b/Migration.Toolkit.KX12/Models/NewsletterEmailTemplate.cs deleted file mode 100644 index 8043ed53..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterEmailTemplate.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_EmailTemplate")] -[Index("TemplateSiteId", "TemplateName", Name = "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateName", IsUnique = true)] -public class NewsletterEmailTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(250)] - public string TemplateDisplayName { get; set; } = null!; - - [StringLength(250)] - public string TemplateName { get; set; } = null!; - - [Column("TemplateSiteID")] - public int TemplateSiteId { get; set; } - - [StringLength(50)] - public string TemplateType { get; set; } = null!; - - [Column("TemplateGUID")] - public Guid TemplateGuid { get; set; } - - public DateTime TemplateLastModified { get; set; } - - [StringLength(450)] - public string? TemplateSubject { get; set; } - - [Column("TemplateThumbnailGUID")] - public Guid? TemplateThumbnailGuid { get; set; } - - public string? TemplateDescription { get; set; } - - [StringLength(200)] - public string? TemplateIconClass { get; set; } - - public string? TemplateCode { get; set; } - - [Column("TemplateInlineCSS")] - public bool TemplateInlineCss { get; set; } - - [InverseProperty("Template")] - public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); - - [InverseProperty("IssueTemplate")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [InverseProperty("NewsletterOptInTemplate")] - public virtual ICollection NewsletterNewsletterNewsletterOptInTemplates { get; set; } = new List(); - - [InverseProperty("NewsletterUnsubscriptionTemplate")] - public virtual ICollection NewsletterNewsletterNewsletterUnsubscriptionTemplates { get; set; } = new List(); - - [ForeignKey("TemplateSiteId")] - [InverseProperty("NewsletterEmailTemplates")] - public virtual CmsSite TemplateSite { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("Templates")] - public virtual ICollection Newsletters { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterEmailWidget.cs b/Migration.Toolkit.KX12/Models/NewsletterEmailWidget.cs deleted file mode 100644 index 94195f26..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterEmailWidget.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_EmailWidget")] -[Index("EmailWidgetSiteId", Name = "IX_Newsletter_EmailWidget_EmailWidgetSiteID")] -public class NewsletterEmailWidget -{ - [Key] - [Column("EmailWidgetID")] - public int EmailWidgetId { get; set; } - - public Guid EmailWidgetGuid { get; set; } - - public DateTime EmailWidgetLastModified { get; set; } - - [StringLength(250)] - public string EmailWidgetDisplayName { get; set; } = null!; - - [StringLength(250)] - public string EmailWidgetName { get; set; } = null!; - - public string? EmailWidgetDescription { get; set; } - - public string? EmailWidgetCode { get; set; } - - [Column("EmailWidgetSiteID")] - public int EmailWidgetSiteId { get; set; } - - [Column("EmailWidgetThumbnailGUID")] - public Guid? EmailWidgetThumbnailGuid { get; set; } - - [StringLength(200)] - public string? EmailWidgetIconCssClass { get; set; } - - public string? EmailWidgetProperties { get; set; } - - [ForeignKey("EmailWidgetSiteId")] - [InverseProperty("NewsletterEmailWidgets")] - public virtual CmsSite EmailWidgetSite { get; set; } = null!; - - [InverseProperty("EmailWidget")] - public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterEmailWidgetTemplate.cs b/Migration.Toolkit.KX12/Models/NewsletterEmailWidgetTemplate.cs deleted file mode 100644 index 0df6e78d..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterEmailWidgetTemplate.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_EmailWidgetTemplate")] -[Index("EmailWidgetId", Name = "IX_Newsletter_EmailWidgetTemplate_EmailWidgetID")] -[Index("TemplateId", Name = "IX_Newsletter_EmailWidgetTemplate_TemplateID")] -public class NewsletterEmailWidgetTemplate -{ - [Key] - [Column("EmailWidgetTemplateID")] - public int EmailWidgetTemplateId { get; set; } - - [Column("EmailWidgetID")] - public int EmailWidgetId { get; set; } - - [Column("TemplateID")] - public int TemplateId { get; set; } - - [ForeignKey("EmailWidgetId")] - [InverseProperty("NewsletterEmailWidgetTemplates")] - public virtual NewsletterEmailWidget EmailWidget { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("NewsletterEmailWidgetTemplates")] - public virtual NewsletterEmailTemplate Template { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterIssueContactGroup.cs b/Migration.Toolkit.KX12/Models/NewsletterIssueContactGroup.cs deleted file mode 100644 index 343c00d8..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterIssueContactGroup.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_IssueContactGroup")] -[Index("ContactGroupId", Name = "IX_Newsletter_IssueContactGroup_ContactGroupID")] -public class NewsletterIssueContactGroup -{ - [Key] - [Column("IssueContactGroupID")] - public int IssueContactGroupId { get; set; } - - [Column("IssueID")] - public int IssueId { get; set; } - - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [ForeignKey("ContactGroupId")] - [InverseProperty("NewsletterIssueContactGroups")] - public virtual OmContactGroup ContactGroup { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterLink.cs b/Migration.Toolkit.KX12/Models/NewsletterLink.cs deleted file mode 100644 index b9c2cd64..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterLink.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_Link")] -[Index("LinkIssueId", Name = "IX_Newsletter_Link_LinkIssueID")] -public class NewsletterLink -{ - [Key] - [Column("LinkID")] - public int LinkId { get; set; } - - [Column("LinkIssueID")] - public int LinkIssueId { get; set; } - - public string LinkTarget { get; set; } = null!; - - [StringLength(450)] - public string LinkDescription { get; set; } = null!; - - [Column("LinkGUID")] - public Guid LinkGuid { get; set; } - - [ForeignKey("LinkIssueId")] - [InverseProperty("NewsletterLinks")] - public virtual NewsletterNewsletterIssue LinkIssue { get; set; } = null!; - - [InverseProperty("ClickedLinkNewsletterLink")] - public virtual ICollection NewsletterClickedLinks { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterNewsletter.cs b/Migration.Toolkit.KX12/Models/NewsletterNewsletter.cs deleted file mode 100644 index 11377899..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterNewsletter.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_Newsletter")] -[Index("NewsletterDynamicScheduledTaskId", Name = "IX_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID")] -[Index("NewsletterOptInTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterOptInTemplateID")] -[Index("NewsletterSiteId", "NewsletterName", Name = "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterName", IsUnique = true)] -[Index("NewsletterSubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterSubscriptionTemplateID")] -[Index("NewsletterUnsubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID")] -public class NewsletterNewsletter -{ - [Key] - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - [StringLength(250)] - public string NewsletterDisplayName { get; set; } = null!; - - [StringLength(250)] - public string NewsletterName { get; set; } = null!; - - [Column("NewsletterSubscriptionTemplateID")] - public int? NewsletterSubscriptionTemplateId { get; set; } - - [Column("NewsletterUnsubscriptionTemplateID")] - public int NewsletterUnsubscriptionTemplateId { get; set; } - - [StringLength(200)] - public string NewsletterSenderName { get; set; } = null!; - - [StringLength(254)] - public string NewsletterSenderEmail { get; set; } = null!; - - [StringLength(100)] - public string? NewsletterDynamicSubject { get; set; } - - [Column("NewsletterDynamicURL")] - [StringLength(500)] - public string? NewsletterDynamicUrl { get; set; } - - [Column("NewsletterDynamicScheduledTaskID")] - public int? NewsletterDynamicScheduledTaskId { get; set; } - - [Column("NewsletterSiteID")] - public int NewsletterSiteId { get; set; } - - [Column("NewsletterGUID")] - public Guid NewsletterGuid { get; set; } - - [StringLength(1000)] - public string? NewsletterUnsubscribeUrl { get; set; } - - [StringLength(500)] - public string? NewsletterBaseUrl { get; set; } - - public DateTime NewsletterLastModified { get; set; } - - public bool? NewsletterEnableOptIn { get; set; } - - [Column("NewsletterOptInTemplateID")] - public int? NewsletterOptInTemplateId { get; set; } - - public bool? NewsletterSendOptInConfirmation { get; set; } - - [Column("NewsletterOptInApprovalURL")] - [StringLength(450)] - public string? NewsletterOptInApprovalUrl { get; set; } - - public bool? NewsletterTrackOpenEmails { get; set; } - - public bool? NewsletterTrackClickedLinks { get; set; } - - [StringLength(998)] - public string? NewsletterDraftEmails { get; set; } - - public bool? NewsletterLogActivity { get; set; } - - [StringLength(5)] - public string NewsletterSource { get; set; } = null!; - - public int NewsletterType { get; set; } - - [ForeignKey("NewsletterDynamicScheduledTaskId")] - [InverseProperty("NewsletterNewsletters")] - public virtual CmsScheduledTask? NewsletterDynamicScheduledTask { get; set; } - - [InverseProperty("IssueNewsletter")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [ForeignKey("NewsletterOptInTemplateId")] - [InverseProperty("NewsletterNewsletterNewsletterOptInTemplates")] - public virtual NewsletterEmailTemplate? NewsletterOptInTemplate { get; set; } - - [ForeignKey("NewsletterSiteId")] - [InverseProperty("NewsletterNewsletters")] - public virtual CmsSite NewsletterSite { get; set; } = null!; - - [InverseProperty("Newsletter")] - public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); - - [ForeignKey("NewsletterUnsubscriptionTemplateId")] - [InverseProperty("NewsletterNewsletterNewsletterUnsubscriptionTemplates")] - public virtual NewsletterEmailTemplate NewsletterUnsubscriptionTemplate { get; set; } = null!; - - [InverseProperty("UnsubscriptionNewsletter")] - public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); - - [ForeignKey("NewsletterId")] - [InverseProperty("Newsletters")] - public virtual ICollection Templates { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterNewsletterIssue.cs b/Migration.Toolkit.KX12/Models/NewsletterNewsletterIssue.cs deleted file mode 100644 index 2b2ab877..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterNewsletterIssue.cs +++ /dev/null @@ -1,125 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_NewsletterIssue")] -[Index("IssueNewsletterId", Name = "IX_Newsletter_NewsletterIssue_IssueNewsletterID")] -[Index("IssueScheduledTaskId", Name = "IX_Newsletter_NewsletterIssue_IssueScheduledTaskID")] -[Index("IssueSiteId", Name = "IX_Newsletter_NewsletterIssue_IssueSiteID")] -[Index("IssueTemplateId", Name = "IX_Newsletter_NewsletterIssue_IssueTemplateID")] -[Index("IssueVariantOfIssueId", Name = "IX_Newsletter_NewsletterIssue_IssueVariantOfIssueID")] -public class NewsletterNewsletterIssue -{ - [Key] - [Column("IssueID")] - public int IssueId { get; set; } - - [StringLength(450)] - public string IssueSubject { get; set; } = null!; - - public string IssueText { get; set; } = null!; - - public int IssueUnsubscribed { get; set; } - - [Column("IssueNewsletterID")] - public int IssueNewsletterId { get; set; } - - [Column("IssueTemplateID")] - public int? IssueTemplateId { get; set; } - - public int IssueSentEmails { get; set; } - - public DateTime? IssueMailoutTime { get; set; } - - [Column("IssueGUID")] - public Guid IssueGuid { get; set; } - - public DateTime IssueLastModified { get; set; } - - [Column("IssueSiteID")] - public int IssueSiteId { get; set; } - - public int? IssueOpenedEmails { get; set; } - - public int? IssueBounces { get; set; } - - public int? IssueStatus { get; set; } - - [Column("IssueIsABTest")] - public bool? IssueIsAbtest { get; set; } - - [Column("IssueVariantOfIssueID")] - public int? IssueVariantOfIssueId { get; set; } - - [StringLength(200)] - public string? IssueVariantName { get; set; } - - [StringLength(200)] - public string? IssueSenderName { get; set; } - - [StringLength(254)] - public string? IssueSenderEmail { get; set; } - - [Column("IssueScheduledTaskID")] - public int? IssueScheduledTaskId { get; set; } - - [Column("IssueUTMSource")] - [StringLength(200)] - public string? IssueUtmsource { get; set; } - - [Column("IssueUseUTM")] - public bool IssueUseUtm { get; set; } - - [Column("IssueUTMCampaign")] - [StringLength(200)] - public string? IssueUtmcampaign { get; set; } - - [StringLength(200)] - public string IssueDisplayName { get; set; } = null!; - - public string? IssueWidgets { get; set; } - - public string? IssuePreheader { get; set; } - - public string? IssuePlainText { get; set; } - - [InverseProperty("IssueVariantOfIssue")] - public virtual ICollection InverseIssueVariantOfIssue { get; set; } = new List(); - - [ForeignKey("IssueNewsletterId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual NewsletterNewsletter IssueNewsletter { get; set; } = null!; - - [ForeignKey("IssueSiteId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual CmsSite IssueSite { get; set; } = null!; - - [ForeignKey("IssueTemplateId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual NewsletterEmailTemplate? IssueTemplate { get; set; } - - [ForeignKey("IssueVariantOfIssueId")] - [InverseProperty("InverseIssueVariantOfIssue")] - public virtual NewsletterNewsletterIssue? IssueVariantOfIssue { get; set; } - - [InverseProperty("TestIssue")] - public virtual NewsletterAbtest? NewsletterAbtestTestIssue { get; set; } - - [InverseProperty("TestWinnerIssue")] - public virtual ICollection NewsletterAbtestTestWinnerIssues { get; set; } = new List(); - - [InverseProperty("EmailNewsletterIssue")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("LinkIssue")] - public virtual ICollection NewsletterLinks { get; set; } = new List(); - - [InverseProperty("OpenedEmailIssue")] - public virtual ICollection NewsletterOpenedEmails { get; set; } = new List(); - - [InverseProperty("UnsubscriptionFromIssue")] - public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterOpenedEmail.cs b/Migration.Toolkit.KX12/Models/NewsletterOpenedEmail.cs deleted file mode 100644 index 430ffcbf..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterOpenedEmail.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_OpenedEmail")] -[Index("OpenedEmailIssueId", Name = "IX_Newsletter_OpenedEmail_OpenedEmailIssueID")] -public class NewsletterOpenedEmail -{ - [Key] - [Column("OpenedEmailID")] - public int OpenedEmailId { get; set; } - - [StringLength(254)] - public string OpenedEmailEmail { get; set; } = null!; - - public Guid OpenedEmailGuid { get; set; } - - public DateTime? OpenedEmailTime { get; set; } - - [Column("OpenedEmailIssueID")] - public int OpenedEmailIssueId { get; set; } - - [ForeignKey("OpenedEmailIssueId")] - [InverseProperty("NewsletterOpenedEmails")] - public virtual NewsletterNewsletterIssue OpenedEmailIssue { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterSubscriber.cs b/Migration.Toolkit.KX12/Models/NewsletterSubscriber.cs deleted file mode 100644 index cb248d03..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterSubscriber.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_Subscriber")] -[Index("SubscriberEmail", Name = "IX_Newsletter_Subscriber_SubscriberEmail")] -[Index("SubscriberType", "SubscriberRelatedId", Name = "IX_Newsletter_Subscriber_SubscriberType_SubscriberRelatedID")] -public class NewsletterSubscriber -{ - [Key] - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [StringLength(254)] - public string? SubscriberEmail { get; set; } - - [StringLength(200)] - public string? SubscriberFirstName { get; set; } - - [StringLength(200)] - public string? SubscriberLastName { get; set; } - - [Column("SubscriberSiteID")] - public int SubscriberSiteId { get; set; } - - [Column("SubscriberGUID")] - public Guid SubscriberGuid { get; set; } - - public string? SubscriberCustomData { get; set; } - - [StringLength(100)] - public string? SubscriberType { get; set; } - - [Column("SubscriberRelatedID")] - public int SubscriberRelatedId { get; set; } - - public DateTime SubscriberLastModified { get; set; } - - [StringLength(440)] - public string? SubscriberFullName { get; set; } - - public int? SubscriberBounces { get; set; } - - [InverseProperty("EmailSubscriber")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("Subscriber")] - public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); - - [ForeignKey("SubscriberSiteId")] - [InverseProperty("NewsletterSubscribers")] - public virtual CmsSite SubscriberSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterSubscriberNewsletter.cs b/Migration.Toolkit.KX12/Models/NewsletterSubscriberNewsletter.cs deleted file mode 100644 index 5f303806..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterSubscriberNewsletter.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_SubscriberNewsletter")] -[Index("NewsletterId", "SubscriptionApproved", Name = "IX_Newsletter_SubscriberNewsletter_NewsletterID_SubscriptionApproved")] -[Index("SubscriberId", "NewsletterId", Name = "UQ_Newsletter_SubscriberNewsletter", IsUnique = true)] -public class NewsletterSubscriberNewsletter -{ - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - public DateTime SubscribedWhen { get; set; } - - public bool? SubscriptionApproved { get; set; } - - public DateTime? SubscriptionApprovedWhen { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [Key] - [Column("SubscriberNewsletterID")] - public int SubscriberNewsletterId { get; set; } - - [ForeignKey("NewsletterId")] - [InverseProperty("NewsletterSubscriberNewsletters")] - public virtual NewsletterNewsletter Newsletter { get; set; } = null!; - - [ForeignKey("SubscriberId")] - [InverseProperty("NewsletterSubscriberNewsletters")] - public virtual NewsletterSubscriber Subscriber { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/NewsletterUnsubscription.cs b/Migration.Toolkit.KX12/Models/NewsletterUnsubscription.cs deleted file mode 100644 index e9467fdf..00000000 --- a/Migration.Toolkit.KX12/Models/NewsletterUnsubscription.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_Unsubscription")] -[Index("UnsubscriptionEmail", "UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_Email_NewsletterID")] -[Index("UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_NewsletterID")] -[Index("UnsubscriptionFromIssueId", Name = "IX_Newsletter_Unsubscription_UnsubscriptionFromIssueID")] -public class NewsletterUnsubscription -{ - [Key] - [Column("UnsubscriptionID")] - public int UnsubscriptionId { get; set; } - - [StringLength(254)] - public string UnsubscriptionEmail { get; set; } = null!; - - public DateTime UnsubscriptionCreated { get; set; } - - [Column("UnsubscriptionNewsletterID")] - public int? UnsubscriptionNewsletterId { get; set; } - - [Column("UnsubscriptionFromIssueID")] - public int? UnsubscriptionFromIssueId { get; set; } - - [Column("UnsubscriptionGUID")] - public Guid UnsubscriptionGuid { get; set; } - - [ForeignKey("UnsubscriptionFromIssueId")] - [InverseProperty("NewsletterUnsubscriptions")] - public virtual NewsletterNewsletterIssue? UnsubscriptionFromIssue { get; set; } - - [ForeignKey("UnsubscriptionNewsletterId")] - [InverseProperty("NewsletterUnsubscriptions")] - public virtual NewsletterNewsletter? UnsubscriptionNewsletter { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/NotificationGateway.cs b/Migration.Toolkit.KX12/Models/NotificationGateway.cs deleted file mode 100644 index 134829bc..00000000 --- a/Migration.Toolkit.KX12/Models/NotificationGateway.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Notification_Gateway")] -public class NotificationGateway -{ - [Key] - [Column("GatewayID")] - public int GatewayId { get; set; } - - [StringLength(200)] - public string GatewayName { get; set; } = null!; - - [StringLength(200)] - public string GatewayDisplayName { get; set; } = null!; - - [StringLength(200)] - public string GatewayAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string GatewayClassName { get; set; } = null!; - - public string? GatewayDescription { get; set; } - - public bool? GatewaySupportsEmail { get; set; } - - public bool? GatewaySupportsPlainText { get; set; } - - [Column("GatewaySupportsHTMLText")] - public bool? GatewaySupportsHtmltext { get; set; } - - public DateTime GatewayLastModified { get; set; } - - [Column("GatewayGUID")] - public Guid GatewayGuid { get; set; } - - public bool? GatewayEnabled { get; set; } - - [InverseProperty("SubscriptionGateway")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("Gateway")] - public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/NotificationSubscription.cs b/Migration.Toolkit.KX12/Models/NotificationSubscription.cs deleted file mode 100644 index 31111c7a..00000000 --- a/Migration.Toolkit.KX12/Models/NotificationSubscription.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Notification_Subscription")] -[Index("SubscriptionEventSource", "SubscriptionEventCode", "SubscriptionEventObjectId", Name = "IX_Notification_Subscription_SubscriptionEventSource_SubscriptionEventCode_SubscriptionEventObjectID")] -[Index("SubscriptionGatewayId", Name = "IX_Notification_Subscription_SubscriptionGatewayID")] -[Index("SubscriptionSiteId", Name = "IX_Notification_Subscription_SubscriptionSiteID")] -[Index("SubscriptionTemplateId", Name = "IX_Notification_Subscription_SubscriptionTemplateID")] -[Index("SubscriptionUserId", Name = "IX_Notification_Subscription_SubscriptionUserID")] -public class NotificationSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionGatewayID")] - public int SubscriptionGatewayId { get; set; } - - [Column("SubscriptionTemplateID")] - public int SubscriptionTemplateId { get; set; } - - [StringLength(100)] - public string? SubscriptionEventSource { get; set; } - - [StringLength(100)] - public string? SubscriptionEventCode { get; set; } - - [StringLength(250)] - public string SubscriptionEventDisplayName { get; set; } = null!; - - [Column("SubscriptionEventObjectID")] - public int? SubscriptionEventObjectId { get; set; } - - public DateTime SubscriptionTime { get; set; } - - [Column("SubscriptionUserID")] - public int SubscriptionUserId { get; set; } - - [StringLength(250)] - public string SubscriptionTarget { get; set; } = null!; - - public DateTime SubscriptionLastModified { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public string? SubscriptionEventData1 { get; set; } - - public string? SubscriptionEventData2 { get; set; } - - [Column("SubscriptionUseHTML")] - public bool? SubscriptionUseHtml { get; set; } - - [Column("SubscriptionSiteID")] - public int? SubscriptionSiteId { get; set; } - - [ForeignKey("SubscriptionGatewayId")] - [InverseProperty("NotificationSubscriptions")] - public virtual NotificationGateway SubscriptionGateway { get; set; } = null!; - - [ForeignKey("SubscriptionSiteId")] - [InverseProperty("NotificationSubscriptions")] - public virtual CmsSite? SubscriptionSite { get; set; } - - [ForeignKey("SubscriptionTemplateId")] - [InverseProperty("NotificationSubscriptions")] - public virtual NotificationTemplate SubscriptionTemplate { get; set; } = null!; - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("NotificationSubscriptions")] - public virtual CmsUser SubscriptionUser { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/NotificationTemplate.cs b/Migration.Toolkit.KX12/Models/NotificationTemplate.cs deleted file mode 100644 index c58de4d0..00000000 --- a/Migration.Toolkit.KX12/Models/NotificationTemplate.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Notification_Template")] -[Index("TemplateSiteId", Name = "IX_Notification_Template_TemplateSiteID")] -public class NotificationTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(200)] - public string TemplateName { get; set; } = null!; - - [StringLength(200)] - public string TemplateDisplayName { get; set; } = null!; - - [Column("TemplateSiteID")] - public int? TemplateSiteId { get; set; } - - public DateTime TemplateLastModified { get; set; } - - [Column("TemplateGUID")] - public Guid TemplateGuid { get; set; } - - [InverseProperty("SubscriptionTemplate")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("Template")] - public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); - - [ForeignKey("TemplateSiteId")] - [InverseProperty("NotificationTemplates")] - public virtual CmsSite? TemplateSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/NotificationTemplateText.cs b/Migration.Toolkit.KX12/Models/NotificationTemplateText.cs deleted file mode 100644 index a3d7e31f..00000000 --- a/Migration.Toolkit.KX12/Models/NotificationTemplateText.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Notification_TemplateText")] -[Index("GatewayId", Name = "IX_Notification_TemplateText_GatewayID")] -[Index("TemplateId", Name = "IX_Notification_TemplateText_TemplateID")] -public class NotificationTemplateText -{ - [Key] - [Column("TemplateTextID")] - public int TemplateTextId { get; set; } - - [Column("TemplateID")] - public int TemplateId { get; set; } - - [Column("GatewayID")] - public int GatewayId { get; set; } - - [StringLength(250)] - public string TemplateSubject { get; set; } = null!; - - [Column("TemplateHTMLText")] - public string TemplateHtmltext { get; set; } = null!; - - public string TemplatePlainText { get; set; } = null!; - - [Column("TemplateTextGUID")] - public Guid TemplateTextGuid { get; set; } - - public DateTime TemplateTextLastModified { get; set; } - - [ForeignKey("GatewayId")] - [InverseProperty("NotificationTemplateTexts")] - public virtual NotificationGateway Gateway { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("NotificationTemplateTexts")] - public virtual NotificationTemplate Template { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/OmAbtest.cs b/Migration.Toolkit.KX12/Models/OmAbtest.cs deleted file mode 100644 index aa099383..00000000 --- a/Migration.Toolkit.KX12/Models/OmAbtest.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ABTest")] -[Index("AbtestSiteId", Name = "IX_OM_ABTest_SiteID")] -public class OmAbtest -{ - [Key] - [Column("ABTestID")] - public int AbtestId { get; set; } - - [Column("ABTestName")] - [StringLength(50)] - public string AbtestName { get; set; } = null!; - - [Column("ABTestDescription")] - public string? AbtestDescription { get; set; } - - [Column("ABTestCulture")] - [StringLength(50)] - public string? AbtestCulture { get; set; } - - [Column("ABTestOriginalPage")] - [StringLength(450)] - public string AbtestOriginalPage { get; set; } = null!; - - [Column("ABTestOpenFrom")] - public DateTime? AbtestOpenFrom { get; set; } - - [Column("ABTestOpenTo")] - public DateTime? AbtestOpenTo { get; set; } - - [Column("ABTestSiteID")] - public int AbtestSiteId { get; set; } - - [Column("ABTestGUID")] - public Guid AbtestGuid { get; set; } - - [Column("ABTestLastModified")] - public DateTime AbtestLastModified { get; set; } - - [Column("ABTestDisplayName")] - [StringLength(100)] - public string AbtestDisplayName { get; set; } = null!; - - [Column("ABTestIncludedTraffic")] - public int AbtestIncludedTraffic { get; set; } - - [Column("ABTestVisitorTargeting")] - public string? AbtestVisitorTargeting { get; set; } - - [Column("ABTestConversions")] - public string? AbtestConversions { get; set; } - - [Column("ABTestWinnerGUID")] - public Guid? AbtestWinnerGuid { get; set; } - - [ForeignKey("AbtestSiteId")] - [InverseProperty("OmAbtests")] - public virtual CmsSite AbtestSite { get; set; } = null!; - - [InverseProperty("AbvariantTest")] - public virtual ICollection OmAbvariantData { get; set; } = new List(); - - [InverseProperty("AbvariantTest")] - public virtual ICollection OmAbvariants { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/OmAbvariant.cs b/Migration.Toolkit.KX12/Models/OmAbvariant.cs deleted file mode 100644 index 74a3614e..00000000 --- a/Migration.Toolkit.KX12/Models/OmAbvariant.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ABVariant")] -[Index("AbvariantSiteId", Name = "IX_OM_ABVariant_ABVariantSiteID")] -[Index("AbvariantTestId", Name = "IX_OM_ABVariant_ABVariantTestID")] -public class OmAbvariant -{ - [Key] - [Column("ABVariantID")] - public int AbvariantId { get; set; } - - [Column("ABVariantDisplayName")] - [StringLength(110)] - public string AbvariantDisplayName { get; set; } = null!; - - [Column("ABVariantName")] - [StringLength(50)] - public string AbvariantName { get; set; } = null!; - - [Column("ABVariantTestID")] - public int AbvariantTestId { get; set; } - - [Column("ABVariantPath")] - [StringLength(450)] - public string AbvariantPath { get; set; } = null!; - - [Column("ABVariantGUID")] - public Guid AbvariantGuid { get; set; } - - [Column("ABVariantLastModified")] - public DateTime AbvariantLastModified { get; set; } - - [Column("ABVariantSiteID")] - public int AbvariantSiteId { get; set; } - - [ForeignKey("AbvariantSiteId")] - [InverseProperty("OmAbvariants")] - public virtual CmsSite AbvariantSite { get; set; } = null!; - - [ForeignKey("AbvariantTestId")] - [InverseProperty("OmAbvariants")] - public virtual OmAbtest AbvariantTest { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/OmAbvariantDatum.cs b/Migration.Toolkit.KX12/Models/OmAbvariantDatum.cs deleted file mode 100644 index 9f648b2b..00000000 --- a/Migration.Toolkit.KX12/Models/OmAbvariantDatum.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ABVariantData")] -[Index("AbvariantTestId", "AbvariantGuid", Name = "IX_OM_ABVariantData_ABVariantTestID_ABVariantGUID")] -public class OmAbvariantDatum -{ - [Key] - [Column("ABVariantID")] - public int AbvariantId { get; set; } - - [Column("ABVariantDisplayName")] - [StringLength(100)] - public string AbvariantDisplayName { get; set; } = null!; - - [Column("ABVariantGUID")] - public Guid AbvariantGuid { get; set; } - - [Column("ABVariantTestID")] - public int AbvariantTestId { get; set; } - - [Column("ABVariantIsOriginal")] - public bool AbvariantIsOriginal { get; set; } - - [ForeignKey("AbvariantTestId")] - [InverseProperty("OmAbvariantData")] - public virtual OmAbtest AbvariantTest { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/OmAccount.cs b/Migration.Toolkit.KX12/Models/OmAccount.cs deleted file mode 100644 index a5a3cf2a..00000000 --- a/Migration.Toolkit.KX12/Models/OmAccount.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_Account")] -[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] -[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] -[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] -[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] -[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] -[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] -[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] -public class OmAccount -{ - [Key] - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [ForeignKey("AccountCountryId")] - [InverseProperty("OmAccounts")] - public virtual CmsCountry? AccountCountry { get; set; } - - [ForeignKey("AccountOwnerUserId")] - [InverseProperty("OmAccounts")] - public virtual CmsUser? AccountOwnerUser { get; set; } - - [ForeignKey("AccountPrimaryContactId")] - [InverseProperty("OmAccountAccountPrimaryContacts")] - public virtual OmContact? AccountPrimaryContact { get; set; } - - [ForeignKey("AccountSecondaryContactId")] - [InverseProperty("OmAccountAccountSecondaryContacts")] - public virtual OmContact? AccountSecondaryContact { get; set; } - - [ForeignKey("AccountStateId")] - [InverseProperty("OmAccounts")] - public virtual CmsState? AccountState { get; set; } - - [ForeignKey("AccountStatusId")] - [InverseProperty("OmAccounts")] - public virtual OmAccountStatus? AccountStatus { get; set; } - - [ForeignKey("AccountSubsidiaryOfId")] - [InverseProperty("InverseAccountSubsidiaryOf")] - public virtual OmAccount? AccountSubsidiaryOf { get; set; } - - [InverseProperty("AccountSubsidiaryOf")] - public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); - - [InverseProperty("Account")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/OmAccountContact.cs b/Migration.Toolkit.KX12/Models/OmAccountContact.cs deleted file mode 100644 index 2352813c..00000000 --- a/Migration.Toolkit.KX12/Models/OmAccountContact.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_AccountContact")] -[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] -[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] -[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] -public class OmAccountContact -{ - [Key] - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("AccountId")] - [InverseProperty("OmAccountContacts")] - public virtual OmAccount Account { get; set; } = null!; - - [ForeignKey("ContactId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("ContactRoleId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContactRole? ContactRole { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/OmAccountStatus.cs b/Migration.Toolkit.KX12/Models/OmAccountStatus.cs deleted file mode 100644 index 14a7a6c2..00000000 --- a/Migration.Toolkit.KX12/Models/OmAccountStatus.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_AccountStatus")] -public class OmAccountStatus -{ - [Key] - [Column("AccountStatusID")] - public int AccountStatusId { get; set; } - - [StringLength(200)] - public string AccountStatusName { get; set; } = null!; - - [StringLength(200)] - public string AccountStatusDisplayName { get; set; } = null!; - - public string? AccountStatusDescription { get; set; } - - [InverseProperty("AccountStatus")] - public virtual ICollection OmAccounts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/OmActivity.cs b/Migration.Toolkit.KX12/Models/OmActivity.cs deleted file mode 100644 index 2bc32eee..00000000 --- a/Migration.Toolkit.KX12/Models/OmActivity.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_Activity")] -[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] -[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] -[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] -[Index("ActivitySiteId", Name = "IX_OM_Activity_ActivitySiteID")] -[Index("ActivityType", "ActivityItemId", "ActivityNodeId", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityNodeID_ActivityUTMSource_ActivityUTMContent_ActivityCampaign")] -public class OmActivity -{ - [Key] - [Column("ActivityID")] - public int ActivityId { get; set; } - - [Column("ActivityContactID")] - public int ActivityContactId { get; set; } - - public DateTime? ActivityCreated { get; set; } - - [StringLength(250)] - public string ActivityType { get; set; } = null!; - - [Column("ActivityItemID")] - public int? ActivityItemId { get; set; } - - [Column("ActivityItemDetailID")] - public int? ActivityItemDetailId { get; set; } - - [StringLength(250)] - public string? ActivityValue { get; set; } - - [Column("ActivityURL")] - public string? ActivityUrl { get; set; } - - [StringLength(250)] - public string? ActivityTitle { get; set; } - - [Column("ActivitySiteID")] - public int ActivitySiteId { get; set; } - - public string? ActivityComment { get; set; } - - [StringLength(200)] - public string? ActivityCampaign { get; set; } - - [Column("ActivityURLReferrer")] - public string? ActivityUrlreferrer { get; set; } - - [StringLength(10)] - public string? ActivityCulture { get; set; } - - [Column("ActivityNodeID")] - public int? ActivityNodeId { get; set; } - - [Column("ActivityUTMSource")] - [StringLength(200)] - public string? ActivityUtmsource { get; set; } - - [Column("ActivityABVariantName")] - [StringLength(200)] - public string? ActivityAbvariantName { get; set; } - - [Column("ActivityMVTCombinationName")] - [StringLength(200)] - public string? ActivityMvtcombinationName { get; set; } - - [Column("ActivityURLHash")] - public long ActivityUrlhash { get; set; } - - [Column("ActivityUTMContent")] - [StringLength(200)] - public string? ActivityUtmcontent { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/OmActivityRecalculationQueue.cs b/Migration.Toolkit.KX12/Models/OmActivityRecalculationQueue.cs deleted file mode 100644 index 6b42c68e..00000000 --- a/Migration.Toolkit.KX12/Models/OmActivityRecalculationQueue.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ActivityRecalculationQueue")] -public class OmActivityRecalculationQueue -{ - [Key] - [Column("ActivityRecalculationQueueID")] - public int ActivityRecalculationQueueId { get; set; } - - [Column("ActivityRecalculationQueueActivityID")] - public int ActivityRecalculationQueueActivityId { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/OmActivityType.cs b/Migration.Toolkit.KX12/Models/OmActivityType.cs deleted file mode 100644 index 1e953ff5..00000000 --- a/Migration.Toolkit.KX12/Models/OmActivityType.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ActivityType")] -public class OmActivityType -{ - [Key] - [Column("ActivityTypeID")] - public int ActivityTypeId { get; set; } - - [StringLength(250)] - public string ActivityTypeDisplayName { get; set; } = null!; - - [StringLength(250)] - public string ActivityTypeName { get; set; } = null!; - - public bool? ActivityTypeEnabled { get; set; } - - public bool? ActivityTypeIsCustom { get; set; } - - public string? ActivityTypeDescription { get; set; } - - public bool? ActivityTypeManualCreationAllowed { get; set; } - - [StringLength(200)] - public string? ActivityTypeMainFormControl { get; set; } - - [StringLength(200)] - public string? ActivityTypeDetailFormControl { get; set; } - - public bool ActivityTypeIsHiddenInContentOnly { get; set; } - - [StringLength(7)] - public string? ActivityTypeColor { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/OmContact.cs b/Migration.Toolkit.KX12/Models/OmContact.cs deleted file mode 100644 index 7d3aa539..00000000 --- a/Migration.Toolkit.KX12/Models/OmContact.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_Contact")] -[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] -[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] -[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] -[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] -[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] -[Index("ContactPersonaId", "ContactLastName", Name = "IX_OM_Contact_ContactPersonaID_ContactLastName")] -[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] -[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] -public class OmContact -{ - [Key] - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(50)] - public string? ContactJobTitle { get; set; } - - [StringLength(100)] - public string? ContactAddress1 { get; set; } - - [StringLength(100)] - public string? ContactCity { get; set; } - - [Column("ContactZIP")] - [StringLength(100)] - public string? ContactZip { get; set; } - - [Column("ContactStateID")] - public int? ContactStateId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [StringLength(26)] - public string? ContactMobilePhone { get; set; } - - [StringLength(26)] - public string? ContactBusinessPhone { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - public DateTime? ContactBirthday { get; set; } - - public int? ContactGender { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - public string? ContactNotes { get; set; } - - [Column("ContactOwnerUserID")] - public int? ContactOwnerUserId { get; set; } - - public bool? ContactMonitored { get; set; } - - [Column("ContactGUID")] - public Guid ContactGuid { get; set; } - - public DateTime ContactLastModified { get; set; } - - public DateTime ContactCreated { get; set; } - - public int? ContactBounces { get; set; } - - [StringLength(200)] - public string? ContactCampaign { get; set; } - - [Column("ContactSalesForceLeadID")] - [StringLength(18)] - public string? ContactSalesForceLeadId { get; set; } - - public bool? ContactSalesForceLeadReplicationDisabled { get; set; } - - public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } - - public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } - - [StringLength(100)] - public string? ContactCompanyName { get; set; } - - public bool? ContactSalesForceLeadReplicationRequired { get; set; } - - [Column("ContactPersonaID")] - public int? ContactPersonaId { get; set; } - - [InverseProperty("ConsentAgreementContact")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [ForeignKey("ContactCountryId")] - [InverseProperty("OmContacts")] - public virtual CmsCountry? ContactCountry { get; set; } - - [ForeignKey("ContactOwnerUserId")] - [InverseProperty("OmContacts")] - public virtual CmsUser? ContactOwnerUser { get; set; } - - [ForeignKey("ContactStateId")] - [InverseProperty("OmContacts")] - public virtual CmsState? ContactState { get; set; } - - [ForeignKey("ContactStatusId")] - [InverseProperty("OmContacts")] - public virtual OmContactStatus? ContactStatus { get; set; } - - [InverseProperty("AccountPrimaryContact")] - public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); - - [InverseProperty("AccountSecondaryContact")] - public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmMemberships { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [InverseProperty("VisitorToContactContact")] - public virtual ICollection OmVisitorToContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/OmContactChangeRecalculationQueue.cs b/Migration.Toolkit.KX12/Models/OmContactChangeRecalculationQueue.cs deleted file mode 100644 index c0218ee4..00000000 --- a/Migration.Toolkit.KX12/Models/OmContactChangeRecalculationQueue.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ContactChangeRecalculationQueue")] -public class OmContactChangeRecalculationQueue -{ - [Key] - [Column("ContactChangeRecalculationQueueID")] - public int ContactChangeRecalculationQueueId { get; set; } - - [Column("ContactChangeRecalculationQueueContactID")] - public int ContactChangeRecalculationQueueContactId { get; set; } - - public string? ContactChangeRecalculationQueueChangedColumns { get; set; } - - public bool ContactChangeRecalculationQueueContactIsNew { get; set; } - - public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/OmContactGroup.cs b/Migration.Toolkit.KX12/Models/OmContactGroup.cs deleted file mode 100644 index 091710c2..00000000 --- a/Migration.Toolkit.KX12/Models/OmContactGroup.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ContactGroup")] -public class OmContactGroup -{ - [Key] - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [StringLength(200)] - public string ContactGroupName { get; set; } = null!; - - [StringLength(200)] - public string ContactGroupDisplayName { get; set; } = null!; - - public string? ContactGroupDescription { get; set; } - - public string? ContactGroupDynamicCondition { get; set; } - - public bool? ContactGroupEnabled { get; set; } - - public DateTime? ContactGroupLastModified { get; set; } - - [Column("ContactGroupGUID")] - public Guid? ContactGroupGuid { get; set; } - - public int? ContactGroupStatus { get; set; } - - [InverseProperty("ContactGroup")] - public virtual ICollection NewsletterIssueContactGroups { get; set; } = new List(); - - [InverseProperty("ContactGroupMemberContactGroup")] - public virtual ICollection OmContactGroupMembers { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/OmContactGroupMember.cs b/Migration.Toolkit.KX12/Models/OmContactGroupMember.cs deleted file mode 100644 index 3cbd38cc..00000000 --- a/Migration.Toolkit.KX12/Models/OmContactGroupMember.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ContactGroupMember")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] -[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] -public class OmContactGroupMember -{ - [Key] - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - public int ContactGroupMemberType { get; set; } - - [Column("ContactGroupMemberRelatedID")] - public int ContactGroupMemberRelatedId { get; set; } - - public bool? ContactGroupMemberFromCondition { get; set; } - - public bool? ContactGroupMemberFromAccount { get; set; } - - public bool? ContactGroupMemberFromManual { get; set; } - - [ForeignKey("ContactGroupMemberContactGroupId")] - [InverseProperty("OmContactGroupMembers")] - public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/OmContactRole.cs b/Migration.Toolkit.KX12/Models/OmContactRole.cs deleted file mode 100644 index c375bdd1..00000000 --- a/Migration.Toolkit.KX12/Models/OmContactRole.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ContactRole")] -public class OmContactRole -{ - [Key] - [Column("ContactRoleID")] - public int ContactRoleId { get; set; } - - [StringLength(200)] - public string ContactRoleName { get; set; } = null!; - - [StringLength(200)] - public string ContactRoleDisplayName { get; set; } = null!; - - public string? ContactRoleDescription { get; set; } - - [InverseProperty("ContactRole")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/OmContactStatus.cs b/Migration.Toolkit.KX12/Models/OmContactStatus.cs deleted file mode 100644 index cddd6ee9..00000000 --- a/Migration.Toolkit.KX12/Models/OmContactStatus.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ContactStatus")] -public class OmContactStatus -{ - [Key] - [Column("ContactStatusID")] - public int ContactStatusId { get; set; } - - [StringLength(200)] - public string ContactStatusName { get; set; } = null!; - - [StringLength(200)] - public string ContactStatusDisplayName { get; set; } = null!; - - public string? ContactStatusDescription { get; set; } - - [InverseProperty("ContactStatus")] - public virtual ICollection OmContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/OmMembership.cs b/Migration.Toolkit.KX12/Models/OmMembership.cs deleted file mode 100644 index 102abce9..00000000 --- a/Migration.Toolkit.KX12/Models/OmMembership.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_Membership")] -[Index("ContactId", Name = "IX_OM_Membership_ContactID")] -[Index("RelatedId", Name = "IX_OM_Membership_RelatedID")] -public class OmMembership -{ - [Key] - [Column("MembershipID")] - public int MembershipId { get; set; } - - [Column("RelatedID")] - public int RelatedId { get; set; } - - public int MemberType { get; set; } - - [Column("MembershipGUID")] - public Guid MembershipGuid { get; set; } - - public DateTime MembershipCreated { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("ContactId")] - [InverseProperty("OmMemberships")] - public virtual OmContact Contact { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/OmMvtcombination.cs b/Migration.Toolkit.KX12/Models/OmMvtcombination.cs deleted file mode 100644 index c978ae98..00000000 --- a/Migration.Toolkit.KX12/Models/OmMvtcombination.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_MVTCombination")] -[Index("MvtcombinationPageTemplateId", Name = "IX_OM_MVTCombination_MVTCombinationPageTemplateID")] -public class OmMvtcombination -{ - [Key] - [Column("MVTCombinationID")] - public int MvtcombinationId { get; set; } - - [Column("MVTCombinationName")] - [StringLength(200)] - public string MvtcombinationName { get; set; } = null!; - - [Column("MVTCombinationCustomName")] - [StringLength(200)] - public string? MvtcombinationCustomName { get; set; } - - [Column("MVTCombinationPageTemplateID")] - public int MvtcombinationPageTemplateId { get; set; } - - [Column("MVTCombinationEnabled")] - public bool MvtcombinationEnabled { get; set; } - - [Column("MVTCombinationGUID")] - public Guid MvtcombinationGuid { get; set; } - - [Column("MVTCombinationLastModified")] - public DateTime MvtcombinationLastModified { get; set; } - - [Column("MVTCombinationIsDefault")] - public bool? MvtcombinationIsDefault { get; set; } - - [Column("MVTCombinationConversions")] - public int? MvtcombinationConversions { get; set; } - - [Column("MVTCombinationDocumentID")] - public int? MvtcombinationDocumentId { get; set; } - - [ForeignKey("MvtcombinationId")] - [InverseProperty("Mvtcombinations")] - public virtual ICollection Mvtvariants { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/OmMvtest.cs b/Migration.Toolkit.KX12/Models/OmMvtest.cs deleted file mode 100644 index ff7a874d..00000000 --- a/Migration.Toolkit.KX12/Models/OmMvtest.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_MVTest")] -[Index("MvtestSiteId", Name = "IX_OM_MVTest_MVTestSiteID")] -public class OmMvtest -{ - [Key] - [Column("MVTestID")] - public int MvtestId { get; set; } - - [Column("MVTestName")] - [StringLength(50)] - public string MvtestName { get; set; } = null!; - - [Column("MVTestDescription")] - public string? MvtestDescription { get; set; } - - [Column("MVTestPage")] - [StringLength(450)] - public string MvtestPage { get; set; } = null!; - - [Column("MVTestSiteID")] - public int MvtestSiteId { get; set; } - - [Column("MVTestCulture")] - [StringLength(50)] - public string? MvtestCulture { get; set; } - - [Column("MVTestOpenFrom")] - public DateTime? MvtestOpenFrom { get; set; } - - [Column("MVTestOpenTo")] - public DateTime? MvtestOpenTo { get; set; } - - [Column("MVTestMaxConversions")] - public int? MvtestMaxConversions { get; set; } - - [Column("MVTestConversions")] - public int? MvtestConversions { get; set; } - - [Column("MVTestTargetConversionType")] - [StringLength(100)] - public string? MvtestTargetConversionType { get; set; } - - [Column("MVTestGUID")] - public Guid MvtestGuid { get; set; } - - [Column("MVTestLastModified")] - public DateTime MvtestLastModified { get; set; } - - [Column("MVTestEnabled")] - public bool MvtestEnabled { get; set; } - - [Column("MVTestDisplayName")] - [StringLength(100)] - public string MvtestDisplayName { get; set; } = null!; - - [ForeignKey("MvtestSiteId")] - [InverseProperty("OmMvtests")] - public virtual CmsSite MvtestSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/OmMvtvariant.cs b/Migration.Toolkit.KX12/Models/OmMvtvariant.cs deleted file mode 100644 index 34f13480..00000000 --- a/Migration.Toolkit.KX12/Models/OmMvtvariant.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_MVTVariant")] -[Index("MvtvariantPageTemplateId", Name = "IX_OM_MVTVariant_MVTVariantPageTemplateID")] -public class OmMvtvariant -{ - [Key] - [Column("MVTVariantID")] - public int MvtvariantId { get; set; } - - [Column("MVTVariantName")] - [StringLength(100)] - public string MvtvariantName { get; set; } = null!; - - [Column("MVTVariantDisplayName")] - [StringLength(200)] - public string MvtvariantDisplayName { get; set; } = null!; - - [Column("MVTVariantInstanceGUID")] - public Guid? MvtvariantInstanceGuid { get; set; } - - [Column("MVTVariantZoneID")] - [StringLength(200)] - public string? MvtvariantZoneId { get; set; } - - [Column("MVTVariantPageTemplateID")] - public int MvtvariantPageTemplateId { get; set; } - - [Required] - [Column("MVTVariantEnabled")] - public bool? MvtvariantEnabled { get; set; } - - [Column("MVTVariantWebParts")] - public string? MvtvariantWebParts { get; set; } - - [Column("MVTVariantGUID")] - public Guid MvtvariantGuid { get; set; } - - [Column("MVTVariantLastModified")] - public DateTime MvtvariantLastModified { get; set; } - - [Column("MVTVariantDescription")] - public string? MvtvariantDescription { get; set; } - - [Column("MVTVariantDocumentID")] - public int? MvtvariantDocumentId { get; set; } - - [ForeignKey("MvtvariantPageTemplateId")] - [InverseProperty("OmMvtvariants")] - public virtual CmsPageTemplate MvtvariantPageTemplate { get; set; } = null!; - - [ForeignKey("MvtvariantId")] - [InverseProperty("Mvtvariants")] - public virtual ICollection Mvtcombinations { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/OmPersonalizationVariant.cs b/Migration.Toolkit.KX12/Models/OmPersonalizationVariant.cs deleted file mode 100644 index 1aac027d..00000000 --- a/Migration.Toolkit.KX12/Models/OmPersonalizationVariant.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_PersonalizationVariant")] -[Index("VariantPageTemplateId", Name = "IX_OM_PersonalizationVariant_VariantDocumentID")] -[Index("VariantDocumentId", Name = "IX_OM_PersonalizationVariant_VariantPageTemplateID")] -public class OmPersonalizationVariant -{ - [Key] - [Column("VariantID")] - public int VariantId { get; set; } - - [Required] - public bool? VariantEnabled { get; set; } - - [StringLength(200)] - public string VariantName { get; set; } = null!; - - [StringLength(200)] - public string VariantDisplayName { get; set; } = null!; - - [Column("VariantInstanceGUID")] - public Guid? VariantInstanceGuid { get; set; } - - [Column("VariantZoneID")] - [StringLength(200)] - public string? VariantZoneId { get; set; } - - [Column("VariantPageTemplateID")] - public int VariantPageTemplateId { get; set; } - - public string VariantWebParts { get; set; } = null!; - - public int? VariantPosition { get; set; } - - [Column("VariantGUID")] - public Guid VariantGuid { get; set; } - - public DateTime VariantLastModified { get; set; } - - public string? VariantDescription { get; set; } - - [Column("VariantDocumentID")] - public int? VariantDocumentId { get; set; } - - public string VariantDisplayCondition { get; set; } = null!; - - [ForeignKey("VariantDocumentId")] - [InverseProperty("OmPersonalizationVariants")] - public virtual CmsDocument? VariantDocument { get; set; } - - [ForeignKey("VariantPageTemplateId")] - [InverseProperty("OmPersonalizationVariants")] - public virtual CmsPageTemplate VariantPageTemplate { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/OmRule.cs b/Migration.Toolkit.KX12/Models/OmRule.cs deleted file mode 100644 index 508929c7..00000000 --- a/Migration.Toolkit.KX12/Models/OmRule.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_Rule")] -[Index("RuleScoreId", Name = "IX_OM_Rule_RuleScoreID")] -public class OmRule -{ - [Key] - [Column("RuleID")] - public int RuleId { get; set; } - - [Column("RuleScoreID")] - public int RuleScoreId { get; set; } - - [StringLength(200)] - public string RuleDisplayName { get; set; } = null!; - - [StringLength(200)] - public string RuleName { get; set; } = null!; - - public int RuleValue { get; set; } - - public bool? RuleIsRecurring { get; set; } - - public int? RuleMaxPoints { get; set; } - - public DateTime? RuleValidUntil { get; set; } - - [StringLength(50)] - public string? RuleValidity { get; set; } - - public int? RuleValidFor { get; set; } - - public int RuleType { get; set; } - - [StringLength(250)] - public string? RuleParameter { get; set; } - - public string RuleCondition { get; set; } = null!; - - public DateTime RuleLastModified { get; set; } - - [Column("RuleGUID")] - public Guid RuleGuid { get; set; } - - public bool RuleBelongsToPersona { get; set; } - - [InverseProperty("Rule")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [ForeignKey("RuleScoreId")] - [InverseProperty("OmRules")] - public virtual OmScore RuleScore { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/OmScore.cs b/Migration.Toolkit.KX12/Models/OmScore.cs deleted file mode 100644 index 4652def2..00000000 --- a/Migration.Toolkit.KX12/Models/OmScore.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_Score")] -public class OmScore -{ - [Key] - [Column("ScoreID")] - public int ScoreId { get; set; } - - [StringLength(200)] - public string ScoreName { get; set; } = null!; - - [StringLength(200)] - public string ScoreDisplayName { get; set; } = null!; - - public string? ScoreDescription { get; set; } - - public bool ScoreEnabled { get; set; } - - public int? ScoreEmailAtScore { get; set; } - - [StringLength(998)] - public string? ScoreNotificationEmail { get; set; } - - public DateTime ScoreLastModified { get; set; } - - [Column("ScoreGUID")] - public Guid ScoreGuid { get; set; } - - public int? ScoreStatus { get; set; } - - [Column("ScoreScheduledTaskID")] - public int? ScoreScheduledTaskId { get; set; } - - public bool ScoreBelongsToPersona { get; set; } - - [InverseProperty("RuleScore")] - public virtual ICollection OmRules { get; set; } = new List(); - - [InverseProperty("Score")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/OmScoreContactRule.cs b/Migration.Toolkit.KX12/Models/OmScoreContactRule.cs deleted file mode 100644 index a38690c6..00000000 --- a/Migration.Toolkit.KX12/Models/OmScoreContactRule.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ScoreContactRule")] -[Index("ContactId", Name = "IX_OM_ScoreContactRule_ContactID")] -[Index("RuleId", Name = "IX_OM_ScoreContactRule_RuleID")] -[Index("ScoreId", Name = "IX_OM_ScoreContactRule_ScoreID_ContactID_Value_Expiration")] -[Index("ScoreId", "ContactId", "RuleId", Name = "UQ_OM_ScoreContactRule", IsUnique = true)] -public class OmScoreContactRule -{ - [Column("ScoreID")] - public int ScoreId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("RuleID")] - public int RuleId { get; set; } - - public int Value { get; set; } - - public DateTime? Expiration { get; set; } - - [Key] - [Column("ScoreContactRuleID")] - public int ScoreContactRuleId { get; set; } - - [ForeignKey("ContactId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("RuleId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmRule Rule { get; set; } = null!; - - [ForeignKey("ScoreId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmScore Score { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/OmVisitorToContact.cs b/Migration.Toolkit.KX12/Models/OmVisitorToContact.cs deleted file mode 100644 index cf5422f5..00000000 --- a/Migration.Toolkit.KX12/Models/OmVisitorToContact.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_VisitorToContact")] -[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] -[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] -public class OmVisitorToContact -{ - [Key] - [Column("VisitorToContactID")] - public int VisitorToContactId { get; set; } - - [Column("VisitorToContactVisitorGUID")] - public Guid VisitorToContactVisitorGuid { get; set; } - - [Column("VisitorToContactContactID")] - public int VisitorToContactContactId { get; set; } - - [ForeignKey("VisitorToContactContactId")] - [InverseProperty("OmVisitorToContacts")] - public virtual OmContact VisitorToContactContact { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/PersonasPersona.cs b/Migration.Toolkit.KX12/Models/PersonasPersona.cs deleted file mode 100644 index 93727922..00000000 --- a/Migration.Toolkit.KX12/Models/PersonasPersona.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Personas_Persona")] -[Index("PersonaScoreId", Name = "IX_Personas_Persona_PersonaScoreID")] -public class PersonasPersona -{ - [Key] - [Column("PersonaID")] - public int PersonaId { get; set; } - - [StringLength(200)] - public string PersonaDisplayName { get; set; } = null!; - - [StringLength(200)] - public string PersonaName { get; set; } = null!; - - public string? PersonaDescription { get; set; } - - [Required] - public bool? PersonaEnabled { get; set; } - - [Column("PersonaGUID")] - public Guid PersonaGuid { get; set; } - - [Column("PersonaScoreID")] - public int PersonaScoreId { get; set; } - - [Column("PersonaPictureMetafileGUID")] - public Guid? PersonaPictureMetafileGuid { get; set; } - - public int PersonaPointsThreshold { get; set; } - - [InverseProperty("PersonaContactHistoryPersona")] - public virtual ICollection PersonasPersonaContactHistories { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/PersonasPersonaContactHistory.cs b/Migration.Toolkit.KX12/Models/PersonasPersonaContactHistory.cs deleted file mode 100644 index 2217d947..00000000 --- a/Migration.Toolkit.KX12/Models/PersonasPersonaContactHistory.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Personas_PersonaContactHistory")] -[Index("PersonaContactHistoryPersonaId", Name = "IX_Personas_PersonaContactHistoryPersonaID")] -public class PersonasPersonaContactHistory -{ - [Key] - [Column("PersonaContactHistoryID")] - public int PersonaContactHistoryId { get; set; } - - [Column("PersonaContactHistoryPersonaID")] - public int? PersonaContactHistoryPersonaId { get; set; } - - [Column(TypeName = "date")] - public DateTime PersonaContactHistoryDate { get; set; } - - public int PersonaContactHistoryContacts { get; set; } - - [ForeignKey("PersonaContactHistoryPersonaId")] - [InverseProperty("PersonasPersonaContactHistories")] - public virtual PersonasPersona? PersonaContactHistoryPersona { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/PersonasPersonaNode.cs b/Migration.Toolkit.KX12/Models/PersonasPersonaNode.cs deleted file mode 100644 index 9cda840c..00000000 --- a/Migration.Toolkit.KX12/Models/PersonasPersonaNode.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("PersonaId", "NodeId")] -[Table("Personas_PersonaNode")] -[Index("NodeId", Name = "IX_Personas_PersonaNode_NodeID")] -[Index("PersonaId", Name = "IX_Personas_PersonaNode_PersonaID")] -public class PersonasPersonaNode -{ - [Key] - [Column("PersonaID")] - public int PersonaId { get; set; } - - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - [ForeignKey("NodeId")] - [InverseProperty("PersonasPersonaNodes")] - public virtual CmsTree Node { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/PollsPoll.cs b/Migration.Toolkit.KX12/Models/PollsPoll.cs deleted file mode 100644 index 6aeeba43..00000000 --- a/Migration.Toolkit.KX12/Models/PollsPoll.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Polls_Poll")] -[Index("PollGroupId", Name = "IX_Polls_Poll_PollGroupID")] -[Index("PollSiteId", "PollCodeName", Name = "IX_Polls_Poll_PollSiteID_PollCodeName")] -public class PollsPoll -{ - [Key] - [Column("PollID")] - public int PollId { get; set; } - - [StringLength(200)] - public string PollCodeName { get; set; } = null!; - - [StringLength(200)] - public string PollDisplayName { get; set; } = null!; - - [StringLength(100)] - public string? PollTitle { get; set; } - - public DateTime? PollOpenFrom { get; set; } - - public DateTime? PollOpenTo { get; set; } - - public bool PollAllowMultipleAnswers { get; set; } - - [StringLength(450)] - public string PollQuestion { get; set; } = null!; - - public int PollAccess { get; set; } - - [StringLength(450)] - public string? PollResponseMessage { get; set; } - - [Column("PollGUID")] - public Guid PollGuid { get; set; } - - public DateTime PollLastModified { get; set; } - - [Column("PollGroupID")] - public int? PollGroupId { get; set; } - - [Column("PollSiteID")] - public int? PollSiteId { get; set; } - - public bool? PollLogActivity { get; set; } - - [ForeignKey("PollGroupId")] - [InverseProperty("PollsPolls")] - public virtual CommunityGroup? PollGroup { get; set; } - - [ForeignKey("PollSiteId")] - [InverseProperty("PollsPolls")] - public virtual CmsSite? PollSite { get; set; } - - [InverseProperty("AnswerPoll")] - public virtual ICollection PollsPollAnswers { get; set; } = new List(); - - [ForeignKey("PollId")] - [InverseProperty("Polls")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("PollId")] - [InverseProperty("Polls")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/PollsPollAnswer.cs b/Migration.Toolkit.KX12/Models/PollsPollAnswer.cs deleted file mode 100644 index b0c38236..00000000 --- a/Migration.Toolkit.KX12/Models/PollsPollAnswer.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Polls_PollAnswer")] -[Index("AnswerPollId", Name = "IX_Polls_PollAnswer_AnswerPollID")] -public class PollsPollAnswer -{ - [Key] - [Column("AnswerID")] - public int AnswerId { get; set; } - - [StringLength(200)] - public string AnswerText { get; set; } = null!; - - public int? AnswerOrder { get; set; } - - public int? AnswerCount { get; set; } - - public bool? AnswerEnabled { get; set; } - - [Column("AnswerPollID")] - public int AnswerPollId { get; set; } - - [Column("AnswerGUID")] - public Guid AnswerGuid { get; set; } - - public DateTime AnswerLastModified { get; set; } - - [StringLength(100)] - public string? AnswerForm { get; set; } - - [StringLength(100)] - public string? AnswerAlternativeForm { get; set; } - - public bool? AnswerHideForm { get; set; } - - [ForeignKey("AnswerPollId")] - [InverseProperty("PollsPollAnswers")] - public virtual PollsPoll AnswerPoll { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ReportingReport.cs b/Migration.Toolkit.KX12/Models/ReportingReport.cs deleted file mode 100644 index 7503a998..00000000 --- a/Migration.Toolkit.KX12/Models/ReportingReport.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_Report")] -[Index("ReportCategoryId", Name = "IX_Reporting_Report_ReportCategoryID")] -[Index("ReportGuid", "ReportName", Name = "IX_Reporting_Report_ReportGUID_ReportName")] -[Index("ReportName", Name = "IX_Reporting_Report_ReportName", IsUnique = true)] -public class ReportingReport -{ - [Key] - [Column("ReportID")] - public int ReportId { get; set; } - - [StringLength(200)] - public string ReportName { get; set; } = null!; - - [StringLength(440)] - public string ReportDisplayName { get; set; } = null!; - - public string? ReportLayout { get; set; } - - public string? ReportParameters { get; set; } - - [Column("ReportCategoryID")] - public int ReportCategoryId { get; set; } - - public int ReportAccess { get; set; } - - [Column("ReportGUID")] - public Guid ReportGuid { get; set; } - - public DateTime ReportLastModified { get; set; } - - public bool? ReportEnableSubscription { get; set; } - - [StringLength(100)] - public string? ReportConnectionString { get; set; } - - [ForeignKey("ReportCategoryId")] - [InverseProperty("ReportingReports")] - public virtual ReportingReportCategory ReportCategory { get; set; } = null!; - - [InverseProperty("GraphReport")] - public virtual ICollection ReportingReportGraphs { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionReport")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("TableReport")] - public virtual ICollection ReportingReportTables { get; set; } = new List(); - - [InverseProperty("ValueReport")] - public virtual ICollection ReportingReportValues { get; set; } = new List(); - - [InverseProperty("SavedReportReport")] - public virtual ICollection ReportingSavedReports { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/ReportingReportCategory.cs b/Migration.Toolkit.KX12/Models/ReportingReportCategory.cs deleted file mode 100644 index 3b4dea64..00000000 --- a/Migration.Toolkit.KX12/Models/ReportingReportCategory.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_ReportCategory")] -[Index("CategoryParentId", Name = "IX_Reporting_ReportCategory_CategoryParentID")] -public class ReportingReportCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryCodeName { get; set; } = null!; - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public string CategoryPath { get; set; } = null!; - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryReportChildCount { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual ReportingReportCategory? CategoryParent { get; set; } - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); - - [InverseProperty("ReportCategory")] - public virtual ICollection ReportingReports { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/ReportingReportGraph.cs b/Migration.Toolkit.KX12/Models/ReportingReportGraph.cs deleted file mode 100644 index 46c2302c..00000000 --- a/Migration.Toolkit.KX12/Models/ReportingReportGraph.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_ReportGraph")] -[Index("GraphGuid", Name = "IX_Reporting_ReportGraph_GraphGUID", IsUnique = true)] -[Index("GraphReportId", "GraphName", Name = "IX_Reporting_ReportGraph_GraphReportID_GraphName", IsUnique = true)] -public class ReportingReportGraph -{ - [Key] - [Column("GraphID")] - public int GraphId { get; set; } - - [StringLength(100)] - public string GraphName { get; set; } = null!; - - [StringLength(450)] - public string GraphDisplayName { get; set; } = null!; - - public string GraphQuery { get; set; } = null!; - - public bool GraphQueryIsStoredProcedure { get; set; } - - [StringLength(50)] - public string GraphType { get; set; } = null!; - - [Column("GraphReportID")] - public int GraphReportId { get; set; } - - [StringLength(200)] - public string? GraphTitle { get; set; } - - [Column("GraphXAxisTitle")] - [StringLength(200)] - public string? GraphXaxisTitle { get; set; } - - [Column("GraphYAxisTitle")] - [StringLength(200)] - public string? GraphYaxisTitle { get; set; } - - public int? GraphWidth { get; set; } - - public int? GraphHeight { get; set; } - - public int? GraphLegendPosition { get; set; } - - public string? GraphSettings { get; set; } - - [Column("GraphGUID")] - public Guid GraphGuid { get; set; } - - public DateTime GraphLastModified { get; set; } - - public bool? GraphIsHtml { get; set; } - - [StringLength(100)] - public string? GraphConnectionString { get; set; } - - [ForeignKey("GraphReportId")] - [InverseProperty("ReportingReportGraphs")] - public virtual ReportingReport GraphReport { get; set; } = null!; - - [InverseProperty("ReportSubscriptionGraph")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/ReportingReportSubscription.cs b/Migration.Toolkit.KX12/Models/ReportingReportSubscription.cs deleted file mode 100644 index 5810ecaf..00000000 --- a/Migration.Toolkit.KX12/Models/ReportingReportSubscription.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_ReportSubscription")] -[Index("ReportSubscriptionGraphId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionGraphID")] -[Index("ReportSubscriptionReportId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionReportID")] -[Index("ReportSubscriptionSiteId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionSiteID")] -[Index("ReportSubscriptionTableId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionTableID")] -[Index("ReportSubscriptionUserId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionUserID")] -[Index("ReportSubscriptionValueId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionValueID")] -public class ReportingReportSubscription -{ - [Key] - [Column("ReportSubscriptionID")] - public int ReportSubscriptionId { get; set; } - - [Column("ReportSubscriptionReportID")] - public int ReportSubscriptionReportId { get; set; } - - [StringLength(1000)] - public string ReportSubscriptionInterval { get; set; } = null!; - - public string? ReportSubscriptionCondition { get; set; } - - [Required] - public bool? ReportSubscriptionEnabled { get; set; } - - public string? ReportSubscriptionParameters { get; set; } - - [Column("ReportSubscriptionGUID")] - public Guid ReportSubscriptionGuid { get; set; } - - public DateTime ReportSubscriptionLastModified { get; set; } - - [StringLength(200)] - public string? ReportSubscriptionSubject { get; set; } - - [Column("ReportSubscriptionGraphID")] - public int? ReportSubscriptionGraphId { get; set; } - - [Column("ReportSubscriptionTableID")] - public int? ReportSubscriptionTableId { get; set; } - - [Column("ReportSubscriptionValueID")] - public int? ReportSubscriptionValueId { get; set; } - - [Column("ReportSubscriptionUserID")] - public int ReportSubscriptionUserId { get; set; } - - [StringLength(400)] - public string ReportSubscriptionEmail { get; set; } = null!; - - [Required] - public bool? ReportSubscriptionOnlyNonEmpty { get; set; } - - public DateTime? ReportSubscriptionLastPostDate { get; set; } - - public DateTime? ReportSubscriptionNextPostDate { get; set; } - - [Column("ReportSubscriptionSiteID")] - public int ReportSubscriptionSiteId { get; set; } - - public string? ReportSubscriptionSettings { get; set; } - - [ForeignKey("ReportSubscriptionGraphId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportGraph? ReportSubscriptionGraph { get; set; } - - [ForeignKey("ReportSubscriptionReportId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReport ReportSubscriptionReport { get; set; } = null!; - - [ForeignKey("ReportSubscriptionSiteId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual CmsSite ReportSubscriptionSite { get; set; } = null!; - - [ForeignKey("ReportSubscriptionTableId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportTable? ReportSubscriptionTable { get; set; } - - [ForeignKey("ReportSubscriptionUserId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual CmsUser ReportSubscriptionUser { get; set; } = null!; - - [ForeignKey("ReportSubscriptionValueId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportValue? ReportSubscriptionValue { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ReportingReportTable.cs b/Migration.Toolkit.KX12/Models/ReportingReportTable.cs deleted file mode 100644 index 703f7a95..00000000 --- a/Migration.Toolkit.KX12/Models/ReportingReportTable.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_ReportTable")] -[Index("TableReportId", Name = "IX_Reporting_ReportTable_TableReportID")] -[Index("TableName", "TableReportId", Name = "IX_Reporting_ReportTable_TableReportID_TableName", IsUnique = true)] -public class ReportingReportTable -{ - [Key] - [Column("TableID")] - public int TableId { get; set; } - - [StringLength(100)] - public string TableName { get; set; } = null!; - - [StringLength(450)] - public string TableDisplayName { get; set; } = null!; - - public string TableQuery { get; set; } = null!; - - public bool TableQueryIsStoredProcedure { get; set; } - - [Column("TableReportID")] - public int TableReportId { get; set; } - - public string? TableSettings { get; set; } - - [Column("TableGUID")] - public Guid TableGuid { get; set; } - - public DateTime TableLastModified { get; set; } - - [StringLength(100)] - public string? TableConnectionString { get; set; } - - [InverseProperty("ReportSubscriptionTable")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [ForeignKey("TableReportId")] - [InverseProperty("ReportingReportTables")] - public virtual ReportingReport TableReport { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ReportingReportValue.cs b/Migration.Toolkit.KX12/Models/ReportingReportValue.cs deleted file mode 100644 index b4954544..00000000 --- a/Migration.Toolkit.KX12/Models/ReportingReportValue.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_ReportValue")] -[Index("ValueName", "ValueReportId", Name = "IX_Reporting_ReportValue_ValueName_ValueReportID")] -[Index("ValueReportId", Name = "IX_Reporting_ReportValue_ValueReportID")] -public class ReportingReportValue -{ - [Key] - [Column("ValueID")] - public int ValueId { get; set; } - - [StringLength(100)] - public string ValueName { get; set; } = null!; - - [StringLength(450)] - public string ValueDisplayName { get; set; } = null!; - - public string ValueQuery { get; set; } = null!; - - public bool ValueQueryIsStoredProcedure { get; set; } - - [StringLength(200)] - public string? ValueFormatString { get; set; } - - [Column("ValueReportID")] - public int ValueReportId { get; set; } - - [Column("ValueGUID")] - public Guid ValueGuid { get; set; } - - public DateTime ValueLastModified { get; set; } - - public string? ValueSettings { get; set; } - - [StringLength(100)] - public string? ValueConnectionString { get; set; } - - [InverseProperty("ReportSubscriptionValue")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [ForeignKey("ValueReportId")] - [InverseProperty("ReportingReportValues")] - public virtual ReportingReport ValueReport { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ReportingSavedGraph.cs b/Migration.Toolkit.KX12/Models/ReportingSavedGraph.cs deleted file mode 100644 index 379e6a1d..00000000 --- a/Migration.Toolkit.KX12/Models/ReportingSavedGraph.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_SavedGraph")] -[Index("SavedGraphGuid", Name = "IX_Reporting_SavedGraph_SavedGraphGUID")] -[Index("SavedGraphSavedReportId", Name = "IX_Reporting_SavedGraph_SavedGraphSavedReportID")] -public class ReportingSavedGraph -{ - [Key] - [Column("SavedGraphID")] - public int SavedGraphId { get; set; } - - [Column("SavedGraphSavedReportID")] - public int SavedGraphSavedReportId { get; set; } - - [Column("SavedGraphGUID")] - public Guid SavedGraphGuid { get; set; } - - public byte[] SavedGraphBinary { get; set; } = null!; - - [StringLength(100)] - public string SavedGraphMimeType { get; set; } = null!; - - public DateTime SavedGraphLastModified { get; set; } - - [ForeignKey("SavedGraphSavedReportId")] - [InverseProperty("ReportingSavedGraphs")] - public virtual ReportingSavedReport SavedGraphSavedReport { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ReportingSavedReport.cs b/Migration.Toolkit.KX12/Models/ReportingSavedReport.cs deleted file mode 100644 index f9a8c1fd..00000000 --- a/Migration.Toolkit.KX12/Models/ReportingSavedReport.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_SavedReport")] -[Index("SavedReportCreatedByUserId", Name = "IX_Reporting_SavedReport_SavedReportCreatedByUserID")] -public class ReportingSavedReport -{ - [Key] - [Column("SavedReportID")] - public int SavedReportId { get; set; } - - [Column("SavedReportReportID")] - public int SavedReportReportId { get; set; } - - [Column("SavedReportGUID")] - public Guid SavedReportGuid { get; set; } - - [StringLength(200)] - public string? SavedReportTitle { get; set; } - - public DateTime SavedReportDate { get; set; } - - [Column("SavedReportHTML")] - public string SavedReportHtml { get; set; } = null!; - - public string SavedReportParameters { get; set; } = null!; - - [Column("SavedReportCreatedByUserID")] - public int? SavedReportCreatedByUserId { get; set; } - - public DateTime SavedReportLastModified { get; set; } - - [InverseProperty("SavedGraphSavedReport")] - public virtual ICollection ReportingSavedGraphs { get; set; } = new List(); - - [ForeignKey("SavedReportCreatedByUserId")] - [InverseProperty("ReportingSavedReports")] - public virtual CmsUser? SavedReportCreatedByUser { get; set; } - - [ForeignKey("SavedReportReportId")] - [InverseProperty("ReportingSavedReports")] - public virtual ReportingReport SavedReportReport { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/SharePointSharePointConnection.cs b/Migration.Toolkit.KX12/Models/SharePointSharePointConnection.cs deleted file mode 100644 index 4d21f004..00000000 --- a/Migration.Toolkit.KX12/Models/SharePointSharePointConnection.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SharePoint_SharePointConnection")] -[Index("SharePointConnectionSiteId", Name = "IX_SharePoint_SharePointConnection_SharePointConnectionSiteID")] -public class SharePointSharePointConnection -{ - [Key] - [Column("SharePointConnectionID")] - public int SharePointConnectionId { get; set; } - - [Column("SharePointConnectionGUID")] - public Guid SharePointConnectionGuid { get; set; } - - [Column("SharePointConnectionSiteID")] - public int SharePointConnectionSiteId { get; set; } - - [StringLength(512)] - public string SharePointConnectionSiteUrl { get; set; } = null!; - - [StringLength(30)] - public string SharePointConnectionAuthMode { get; set; } = null!; - - [StringLength(100)] - public string SharePointConnectionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string SharePointConnectionName { get; set; } = null!; - - [StringLength(30)] - public string SharePointConnectionSharePointVersion { get; set; } = null!; - - [StringLength(100)] - public string? SharePointConnectionUserName { get; set; } - - [StringLength(100)] - public string? SharePointConnectionPassword { get; set; } - - [StringLength(100)] - public string? SharePointConnectionDomain { get; set; } - - public DateTime SharePointConnectionLastModified { get; set; } - - [ForeignKey("SharePointConnectionSiteId")] - [InverseProperty("SharePointSharePointConnections")] - public virtual CmsSite SharePointConnectionSite { get; set; } = null!; - - [InverseProperty("SharePointLibrarySharePointConnection")] - public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/SharePointSharePointFile.cs b/Migration.Toolkit.KX12/Models/SharePointSharePointFile.cs deleted file mode 100644 index 76c0b033..00000000 --- a/Migration.Toolkit.KX12/Models/SharePointSharePointFile.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SharePoint_SharePointFile")] -[Index("SharePointFileSiteId", Name = "IX_SharePoint_SharePointFile_SharePointFileSiteID")] -[Index("SharePointFileSharePointLibraryId", "SharePointFileServerRelativeUrl", Name = "UQ_SharePoint_SharePointFile_LibraryID_ServerRelativeURL", IsUnique = true)] -public class SharePointSharePointFile -{ - [Key] - [Column("SharePointFileID")] - public int SharePointFileId { get; set; } - - [Column("SharePointFileGUID")] - public Guid SharePointFileGuid { get; set; } - - [Column("SharePointFileSiteID")] - public int SharePointFileSiteId { get; set; } - - [StringLength(150)] - public string SharePointFileName { get; set; } = null!; - - [StringLength(150)] - public string? SharePointFileExtension { get; set; } - - [StringLength(255)] - public string? SharePointFileMimeType { get; set; } - - [Column("SharePointFileETag")] - [StringLength(255)] - public string? SharePointFileEtag { get; set; } - - public long SharePointFileSize { get; set; } - - public DateTime SharePointFileServerLastModified { get; set; } - - [Column("SharePointFileServerRelativeURL")] - [StringLength(300)] - public string SharePointFileServerRelativeUrl { get; set; } = null!; - - [Column("SharePointFileSharePointLibraryID")] - public int SharePointFileSharePointLibraryId { get; set; } - - public byte[]? SharePointFileBinary { get; set; } - - [ForeignKey("SharePointFileSharePointLibraryId")] - [InverseProperty("SharePointSharePointFiles")] - public virtual SharePointSharePointLibrary SharePointFileSharePointLibrary { get; set; } = null!; - - [ForeignKey("SharePointFileSiteId")] - [InverseProperty("SharePointSharePointFiles")] - public virtual CmsSite SharePointFileSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/SharePointSharePointLibrary.cs b/Migration.Toolkit.KX12/Models/SharePointSharePointLibrary.cs deleted file mode 100644 index 726bbd38..00000000 --- a/Migration.Toolkit.KX12/Models/SharePointSharePointLibrary.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SharePoint_SharePointLibrary")] -[Index("SharePointLibrarySharePointConnectionId", Name = "IX_SharePoint_SharePointLibrary_SharePointLibrarySharepointConnectionID")] -[Index("SharePointLibrarySiteId", Name = "IX_SharePoint_SharePointLibrary_SharePointlibrarySiteID")] -public class SharePointSharePointLibrary -{ - [Key] - [Column("SharePointLibraryID")] - public int SharePointLibraryId { get; set; } - - [StringLength(100)] - public string SharePointLibraryName { get; set; } = null!; - - [Column("SharePointLibrarySharePointConnectionID")] - public int? SharePointLibrarySharePointConnectionId { get; set; } - - [StringLength(100)] - public string SharePointLibraryListTitle { get; set; } = null!; - - public int SharePointLibrarySynchronizationPeriod { get; set; } - - [Column("SharePointLibraryGUID")] - public Guid SharePointLibraryGuid { get; set; } - - [Column("SharePointLibrarySiteID")] - public int SharePointLibrarySiteId { get; set; } - - [StringLength(100)] - public string SharePointLibraryDisplayName { get; set; } = null!; - - public DateTime SharePointLibraryLastModified { get; set; } - - public int SharePointLibraryListType { get; set; } - - [ForeignKey("SharePointLibrarySharePointConnectionId")] - [InverseProperty("SharePointSharePointLibraries")] - public virtual SharePointSharePointConnection? SharePointLibrarySharePointConnection { get; set; } - - [ForeignKey("SharePointLibrarySiteId")] - [InverseProperty("SharePointSharePointLibraries")] - public virtual CmsSite SharePointLibrarySite { get; set; } = null!; - - [InverseProperty("SharePointFileSharePointLibrary")] - public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/SmFacebookAccount.cs b/Migration.Toolkit.KX12/Models/SmFacebookAccount.cs deleted file mode 100644 index e1531034..00000000 --- a/Migration.Toolkit.KX12/Models/SmFacebookAccount.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_FacebookAccount")] -[Index("FacebookAccountFacebookApplicationId", Name = "IX_SM_FacebookAccount_FacebookAccountFacebookApplicationID")] -[Index("FacebookAccountSiteId", Name = "IX_SM_FacebookAccount_FacebookAccountSiteID")] -public class SmFacebookAccount -{ - [Key] - [Column("FacebookAccountID")] - public int FacebookAccountId { get; set; } - - [Column("FacebookAccountGUID")] - public Guid FacebookAccountGuid { get; set; } - - public DateTime FacebookAccountLastModified { get; set; } - - [Column("FacebookAccountSiteID")] - public int FacebookAccountSiteId { get; set; } - - [StringLength(200)] - public string FacebookAccountName { get; set; } = null!; - - [StringLength(200)] - public string FacebookAccountDisplayName { get; set; } = null!; - - [Column("FacebookAccountPageID")] - [StringLength(500)] - public string FacebookAccountPageId { get; set; } = null!; - - public string FacebookAccountPageAccessToken { get; set; } = null!; - - [Column("FacebookAccountFacebookApplicationID")] - public int FacebookAccountFacebookApplicationId { get; set; } - - public DateTime? FacebookAccountPageAccessTokenExpiration { get; set; } - - public bool? FacebookAccountIsDefault { get; set; } - - [ForeignKey("FacebookAccountFacebookApplicationId")] - [InverseProperty("SmFacebookAccounts")] - public virtual SmFacebookApplication FacebookAccountFacebookApplication { get; set; } = null!; - - [ForeignKey("FacebookAccountSiteId")] - [InverseProperty("SmFacebookAccounts")] - public virtual CmsSite FacebookAccountSite { get; set; } = null!; - - [InverseProperty("FacebookPostFacebookAccount")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/SmFacebookApplication.cs b/Migration.Toolkit.KX12/Models/SmFacebookApplication.cs deleted file mode 100644 index a33eb45e..00000000 --- a/Migration.Toolkit.KX12/Models/SmFacebookApplication.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_FacebookApplication")] -[Index("FacebookApplicationSiteId", Name = "IX_SM_FacebookApplication_FacebookApplicationSiteID")] -public class SmFacebookApplication -{ - [Key] - [Column("FacebookApplicationID")] - public int FacebookApplicationId { get; set; } - - [StringLength(500)] - public string FacebookApplicationConsumerKey { get; set; } = null!; - - [StringLength(500)] - public string FacebookApplicationConsumerSecret { get; set; } = null!; - - [StringLength(200)] - public string FacebookApplicationName { get; set; } = null!; - - [StringLength(200)] - public string FacebookApplicationDisplayName { get; set; } = null!; - - [Column("FacebookApplicationGUID")] - public Guid FacebookApplicationGuid { get; set; } - - public DateTime FacebookApplicationLastModified { get; set; } - - [Column("FacebookApplicationSiteID")] - public int FacebookApplicationSiteId { get; set; } - - [ForeignKey("FacebookApplicationSiteId")] - [InverseProperty("SmFacebookApplications")] - public virtual CmsSite FacebookApplicationSite { get; set; } = null!; - - [InverseProperty("FacebookAccountFacebookApplication")] - public virtual ICollection SmFacebookAccounts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/SmFacebookPost.cs b/Migration.Toolkit.KX12/Models/SmFacebookPost.cs deleted file mode 100644 index 18304c2c..00000000 --- a/Migration.Toolkit.KX12/Models/SmFacebookPost.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_FacebookPost")] -[Index("FacebookPostCampaignId", Name = "IX_SM_FacebookPost_FacebookPostCampaignID")] -[Index("FacebookPostFacebookAccountId", Name = "IX_SM_FacebookPost_FacebookPostFacebookAccountID")] -[Index("FacebookPostSiteId", Name = "IX_SM_FacebookPost_FacebookPostSiteID")] -public class SmFacebookPost -{ - [Key] - [Column("FacebookPostID")] - public int FacebookPostId { get; set; } - - [Column("FacebookPostGUID")] - public Guid FacebookPostGuid { get; set; } - - public DateTime FacebookPostLastModified { get; set; } - - [Column("FacebookPostSiteID")] - public int FacebookPostSiteId { get; set; } - - [Column("FacebookPostFacebookAccountID")] - public int FacebookPostFacebookAccountId { get; set; } - - public string FacebookPostText { get; set; } = null!; - - [Column("FacebookPostURLShortenerType")] - public int? FacebookPostUrlshortenerType { get; set; } - - public int? FacebookPostErrorCode { get; set; } - - public int? FacebookPostErrorSubcode { get; set; } - - [Column("FacebookPostExternalID")] - public string? FacebookPostExternalId { get; set; } - - public DateTime? FacebookPostPublishedDateTime { get; set; } - - public DateTime? FacebookPostScheduledPublishDateTime { get; set; } - - [Column("FacebookPostCampaignID")] - public int? FacebookPostCampaignId { get; set; } - - public bool? FacebookPostPostAfterDocumentPublish { get; set; } - - public int? FacebookPostInsightPeopleReached { get; set; } - - public int? FacebookPostInsightLikesFromPage { get; set; } - - public int? FacebookPostInsightCommentsFromPage { get; set; } - - public int? FacebookPostInsightSharesFromPage { get; set; } - - public int? FacebookPostInsightLikesTotal { get; set; } - - public int? FacebookPostInsightCommentsTotal { get; set; } - - public int? FacebookPostInsightNegativeHidePost { get; set; } - - public int? FacebookPostInsightNegativeHideAllPosts { get; set; } - - public int? FacebookPostInsightNegativeReportSpam { get; set; } - - public int? FacebookPostInsightNegativeUnlikePage { get; set; } - - public DateTime? FacebookPostInsightsLastUpdated { get; set; } - - [Column("FacebookPostDocumentGUID")] - public Guid? FacebookPostDocumentGuid { get; set; } - - public bool? FacebookPostIsCreatedByUser { get; set; } - - [ForeignKey("FacebookPostCampaignId")] - [InverseProperty("SmFacebookPosts")] - public virtual AnalyticsCampaign? FacebookPostCampaign { get; set; } - - [ForeignKey("FacebookPostFacebookAccountId")] - [InverseProperty("SmFacebookPosts")] - public virtual SmFacebookAccount FacebookPostFacebookAccount { get; set; } = null!; - - [ForeignKey("FacebookPostSiteId")] - [InverseProperty("SmFacebookPosts")] - public virtual CmsSite FacebookPostSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/SmInsight.cs b/Migration.Toolkit.KX12/Models/SmInsight.cs deleted file mode 100644 index 50465a82..00000000 --- a/Migration.Toolkit.KX12/Models/SmInsight.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_Insight")] -[Index("InsightCodeName", "InsightPeriodType", Name = "IX_SM_Insight_InsightCodeName_InsightPeriodType")] -public class SmInsight -{ - [Key] - [Column("InsightID")] - public int InsightId { get; set; } - - [StringLength(200)] - public string InsightCodeName { get; set; } = null!; - - [Column("InsightExternalID")] - public string InsightExternalId { get; set; } = null!; - - [StringLength(20)] - public string InsightPeriodType { get; set; } = null!; - - public string? InsightValueName { get; set; } - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitDays { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitMonths { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitWeeks { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitYears { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/SmInsightHitDay.cs b/Migration.Toolkit.KX12/Models/SmInsightHitDay.cs deleted file mode 100644 index 446cd192..00000000 --- a/Migration.Toolkit.KX12/Models/SmInsightHitDay.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_InsightHit_Day")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Day_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public class SmInsightHitDay -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitDays")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/SmInsightHitMonth.cs b/Migration.Toolkit.KX12/Models/SmInsightHitMonth.cs deleted file mode 100644 index cabfe51b..00000000 --- a/Migration.Toolkit.KX12/Models/SmInsightHitMonth.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_InsightHit_Month")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Month_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public class SmInsightHitMonth -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitMonths")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/SmInsightHitWeek.cs b/Migration.Toolkit.KX12/Models/SmInsightHitWeek.cs deleted file mode 100644 index 526c46e2..00000000 --- a/Migration.Toolkit.KX12/Models/SmInsightHitWeek.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_InsightHit_Week")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Week_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public class SmInsightHitWeek -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitWeeks")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/SmInsightHitYear.cs b/Migration.Toolkit.KX12/Models/SmInsightHitYear.cs deleted file mode 100644 index 3e6240f6..00000000 --- a/Migration.Toolkit.KX12/Models/SmInsightHitYear.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_InsightHit_Year")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Year_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public class SmInsightHitYear -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitYears")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/SmLinkedInAccount.cs b/Migration.Toolkit.KX12/Models/SmLinkedInAccount.cs deleted file mode 100644 index 1d204344..00000000 --- a/Migration.Toolkit.KX12/Models/SmLinkedInAccount.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_LinkedInAccount")] -public class SmLinkedInAccount -{ - [Key] - [Column("LinkedInAccountID")] - public int LinkedInAccountId { get; set; } - - [StringLength(200)] - public string LinkedInAccountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string LinkedInAccountName { get; set; } = null!; - - public bool? LinkedInAccountIsDefault { get; set; } - - [StringLength(500)] - public string LinkedInAccountAccessToken { get; set; } = null!; - - public DateTime LinkedInAccountLastModified { get; set; } - - [Column("LinkedInAccountGUID")] - public Guid LinkedInAccountGuid { get; set; } - - [Column("LinkedInAccountSiteID")] - public int LinkedInAccountSiteId { get; set; } - - [Column("LinkedInAccountProfileID")] - [StringLength(50)] - public string LinkedInAccountProfileId { get; set; } = null!; - - [Column("LinkedInAccountLinkedInApplicationID")] - public int LinkedInAccountLinkedInApplicationId { get; set; } - - [StringLength(200)] - public string? LinkedInAccountProfileName { get; set; } - - public DateTime? LinkedInAccountAccessTokenExpiration { get; set; } - - [InverseProperty("LinkedInPostLinkedInAccount")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/SmLinkedInApplication.cs b/Migration.Toolkit.KX12/Models/SmLinkedInApplication.cs deleted file mode 100644 index f755eb77..00000000 --- a/Migration.Toolkit.KX12/Models/SmLinkedInApplication.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_LinkedInApplication")] -[Index("LinkedInApplicationSiteId", Name = "IX_SM_LinkedInApplication_LinkedInApplicationSiteID")] -public class SmLinkedInApplication -{ - [Key] - [Column("LinkedInApplicationID")] - public int LinkedInApplicationId { get; set; } - - [StringLength(200)] - public string LinkedInApplicationDisplayName { get; set; } = null!; - - [StringLength(200)] - public string LinkedInApplicationName { get; set; } = null!; - - [StringLength(500)] - public string LinkedInApplicationConsumerSecret { get; set; } = null!; - - [StringLength(500)] - public string LinkedInApplicationConsumerKey { get; set; } = null!; - - public DateTime LinkedInApplicationLastModified { get; set; } - - [Column("LinkedInApplicationGUID")] - public Guid LinkedInApplicationGuid { get; set; } - - [Column("LinkedInApplicationSiteID")] - public int LinkedInApplicationSiteId { get; set; } - - [ForeignKey("LinkedInApplicationSiteId")] - [InverseProperty("SmLinkedInApplications")] - public virtual CmsSite LinkedInApplicationSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/SmLinkedInPost.cs b/Migration.Toolkit.KX12/Models/SmLinkedInPost.cs deleted file mode 100644 index 64beec81..00000000 --- a/Migration.Toolkit.KX12/Models/SmLinkedInPost.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_LinkedInPost")] -[Index("LinkedInPostCampaignId", Name = "IX_SM_LinkedInPost_LinkedInPostCampaignID")] -[Index("LinkedInPostLinkedInAccountId", Name = "IX_SM_LinkedInPost_LinkedInPostLinkedInAccountID")] -[Index("LinkedInPostSiteId", Name = "IX_SM_LinkedInPost_LinkedInPostSiteID")] -public class SmLinkedInPost -{ - [Key] - [Column("LinkedInPostID")] - public int LinkedInPostId { get; set; } - - [Column("LinkedInPostLinkedInAccountID")] - public int LinkedInPostLinkedInAccountId { get; set; } - - [StringLength(700)] - public string LinkedInPostComment { get; set; } = null!; - - [Column("LinkedInPostSiteID")] - public int LinkedInPostSiteId { get; set; } - - [Column("LinkedInPostGUID")] - public Guid LinkedInPostGuid { get; set; } - - public DateTime? LinkedInPostLastModified { get; set; } - - [StringLength(200)] - public string? LinkedInPostUpdateKey { get; set; } - - [Column("LinkedInPostURLShortenerType")] - public int? LinkedInPostUrlshortenerType { get; set; } - - public DateTime? LinkedInPostScheduledPublishDateTime { get; set; } - - [Column("LinkedInPostCampaignID")] - public int? LinkedInPostCampaignId { get; set; } - - public DateTime? LinkedInPostPublishedDateTime { get; set; } - - [Column("LinkedInPostHTTPStatusCode")] - public int? LinkedInPostHttpstatusCode { get; set; } - - public int? LinkedInPostErrorCode { get; set; } - - public string? LinkedInPostErrorMessage { get; set; } - - [Column("LinkedInPostDocumentGUID")] - public Guid? LinkedInPostDocumentGuid { get; set; } - - public bool? LinkedInPostIsCreatedByUser { get; set; } - - public bool? LinkedInPostPostAfterDocumentPublish { get; set; } - - public DateTime? LinkedInPostInsightsLastUpdated { get; set; } - - public int? LinkedInPostCommentCount { get; set; } - - public int? LinkedInPostImpressionCount { get; set; } - - public int? LinkedInPostLikeCount { get; set; } - - public int? LinkedInPostShareCount { get; set; } - - public int? LinkedInPostClickCount { get; set; } - - public double? LinkedInPostEngagement { get; set; } - - [ForeignKey("LinkedInPostCampaignId")] - [InverseProperty("SmLinkedInPosts")] - public virtual AnalyticsCampaign? LinkedInPostCampaign { get; set; } - - [ForeignKey("LinkedInPostLinkedInAccountId")] - [InverseProperty("SmLinkedInPosts")] - public virtual SmLinkedInAccount LinkedInPostLinkedInAccount { get; set; } = null!; - - [ForeignKey("LinkedInPostSiteId")] - [InverseProperty("SmLinkedInPosts")] - public virtual CmsSite LinkedInPostSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/SmTwitterAccount.cs b/Migration.Toolkit.KX12/Models/SmTwitterAccount.cs deleted file mode 100644 index c657173f..00000000 --- a/Migration.Toolkit.KX12/Models/SmTwitterAccount.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_TwitterAccount")] -[Index("TwitterAccountSiteId", Name = "IX_SM_TwitterAccount_TwitterAccountSiteID")] -[Index("TwitterAccountTwitterApplicationId", Name = "IX_SM_TwitterAccount_TwitterAccountTwitterApplicationID")] -public class SmTwitterAccount -{ - [Key] - [Column("TwitterAccountID")] - public int TwitterAccountId { get; set; } - - [StringLength(200)] - public string TwitterAccountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TwitterAccountName { get; set; } = null!; - - public DateTime TwitterAccountLastModified { get; set; } - - [Column("TwitterAccountGUID")] - public Guid TwitterAccountGuid { get; set; } - - [Column("TwitterAccountSiteID")] - public int TwitterAccountSiteId { get; set; } - - [StringLength(500)] - public string TwitterAccountAccessToken { get; set; } = null!; - - [StringLength(500)] - public string TwitterAccountAccessTokenSecret { get; set; } = null!; - - [Column("TwitterAccountTwitterApplicationID")] - public int TwitterAccountTwitterApplicationId { get; set; } - - public int? TwitterAccountFollowers { get; set; } - - public int? TwitterAccountMentions { get; set; } - - [StringLength(40)] - public string? TwitterAccountMentionsRange { get; set; } - - [Column("TwitterAccountUserID")] - [StringLength(20)] - public string? TwitterAccountUserId { get; set; } - - public bool? TwitterAccountIsDefault { get; set; } - - [InverseProperty("TwitterPostTwitterAccount")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); - - [ForeignKey("TwitterAccountSiteId")] - [InverseProperty("SmTwitterAccounts")] - public virtual CmsSite TwitterAccountSite { get; set; } = null!; - - [ForeignKey("TwitterAccountTwitterApplicationId")] - [InverseProperty("SmTwitterAccounts")] - public virtual SmTwitterApplication TwitterAccountTwitterApplication { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/SmTwitterApplication.cs b/Migration.Toolkit.KX12/Models/SmTwitterApplication.cs deleted file mode 100644 index 869fd08e..00000000 --- a/Migration.Toolkit.KX12/Models/SmTwitterApplication.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_TwitterApplication")] -[Index("TwitterApplicationSiteId", Name = "IX_SM_TwitterApplication_TwitterApplicationSiteID")] -public class SmTwitterApplication -{ - [Key] - [Column("TwitterApplicationID")] - public int TwitterApplicationId { get; set; } - - [StringLength(200)] - public string TwitterApplicationDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TwitterApplicationName { get; set; } = null!; - - public DateTime TwitterApplicationLastModified { get; set; } - - [Column("TwitterApplicationGUID")] - public Guid TwitterApplicationGuid { get; set; } - - [Column("TwitterApplicationSiteID")] - public int TwitterApplicationSiteId { get; set; } - - [StringLength(500)] - public string TwitterApplicationConsumerKey { get; set; } = null!; - - [StringLength(500)] - public string TwitterApplicationConsumerSecret { get; set; } = null!; - - [InverseProperty("TwitterAccountTwitterApplication")] - public virtual ICollection SmTwitterAccounts { get; set; } = new List(); - - [ForeignKey("TwitterApplicationSiteId")] - [InverseProperty("SmTwitterApplications")] - public virtual CmsSite TwitterApplicationSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/SmTwitterPost.cs b/Migration.Toolkit.KX12/Models/SmTwitterPost.cs deleted file mode 100644 index c7ed0162..00000000 --- a/Migration.Toolkit.KX12/Models/SmTwitterPost.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_TwitterPost")] -[Index("TwitterPostCampaignId", Name = "IX_SM_TwitterPost_TwitterPostCampaignID")] -[Index("TwitterPostSiteId", Name = "IX_SM_TwitterPost_TwitterPostSiteID")] -[Index("TwitterPostTwitterAccountId", Name = "IX_SM_TwitterPost_TwitterPostTwitterAccountID")] -public class SmTwitterPost -{ - [Key] - [Column("TwitterPostID")] - public int TwitterPostId { get; set; } - - [Column("TwitterPostGUID")] - public Guid TwitterPostGuid { get; set; } - - public DateTime TwitterPostLastModified { get; set; } - - [Column("TwitterPostSiteID")] - public int TwitterPostSiteId { get; set; } - - [Column("TwitterPostTwitterAccountID")] - public int TwitterPostTwitterAccountId { get; set; } - - public string TwitterPostText { get; set; } = null!; - - [Column("TwitterPostURLShortenerType")] - public int? TwitterPostUrlshortenerType { get; set; } - - [Column("TwitterPostExternalID")] - public string? TwitterPostExternalId { get; set; } - - public int? TwitterPostErrorCode { get; set; } - - public DateTime? TwitterPostPublishedDateTime { get; set; } - - public DateTime? TwitterPostScheduledPublishDateTime { get; set; } - - [Column("TwitterPostCampaignID")] - public int? TwitterPostCampaignId { get; set; } - - public int? TwitterPostFavorites { get; set; } - - public int? TwitterPostRetweets { get; set; } - - public bool? TwitterPostPostAfterDocumentPublish { get; set; } - - public DateTime? TwitterPostInsightsUpdateDateTime { get; set; } - - [Column("TwitterPostDocumentGUID")] - public Guid? TwitterPostDocumentGuid { get; set; } - - public bool? TwitterPostIsCreatedByUser { get; set; } - - [ForeignKey("TwitterPostCampaignId")] - [InverseProperty("SmTwitterPosts")] - public virtual AnalyticsCampaign? TwitterPostCampaign { get; set; } - - [ForeignKey("TwitterPostSiteId")] - [InverseProperty("SmTwitterPosts")] - public virtual CmsSite TwitterPostSite { get; set; } = null!; - - [ForeignKey("TwitterPostTwitterAccountId")] - [InverseProperty("SmTwitterPosts")] - public virtual SmTwitterAccount TwitterPostTwitterAccount { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/StagingServer.cs b/Migration.Toolkit.KX12/Models/StagingServer.cs deleted file mode 100644 index f397e81b..00000000 --- a/Migration.Toolkit.KX12/Models/StagingServer.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Staging_Server")] -[Index("ServerEnabled", Name = "IX_Staging_Server_ServerEnabled")] -[Index("ServerSiteId", Name = "IX_Staging_Server_ServerSiteID")] -public class StagingServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(100)] - public string ServerName { get; set; } = null!; - - [StringLength(440)] - public string ServerDisplayName { get; set; } = null!; - - [Column("ServerSiteID")] - public int ServerSiteId { get; set; } - - [Column("ServerURL")] - [StringLength(450)] - public string ServerUrl { get; set; } = null!; - - [Required] - public bool? ServerEnabled { get; set; } - - [StringLength(20)] - public string ServerAuthentication { get; set; } = null!; - - [StringLength(100)] - public string? ServerUsername { get; set; } - - [StringLength(100)] - public string? ServerPassword { get; set; } - - [Column("ServerX509ClientKeyID")] - [StringLength(200)] - public string? ServerX509clientKeyId { get; set; } - - [Column("ServerX509ServerKeyID")] - [StringLength(200)] - public string? ServerX509serverKeyId { get; set; } - - [Column("ServerGUID")] - public Guid ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - [ForeignKey("ServerSiteId")] - [InverseProperty("StagingServers")] - public virtual CmsSite ServerSite { get; set; } = null!; - - [InverseProperty("SynchronizationServer")] - public virtual ICollection StagingSynchronizations { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/StagingSynchronization.cs b/Migration.Toolkit.KX12/Models/StagingSynchronization.cs deleted file mode 100644 index bf145fc7..00000000 --- a/Migration.Toolkit.KX12/Models/StagingSynchronization.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Staging_Synchronization")] -[Index("SynchronizationServerId", Name = "IX_Staging_Synchronization_SynchronizationServerID")] -[Index("SynchronizationTaskId", Name = "IX_Staging_Synchronization_SynchronizationTaskID")] -public class StagingSynchronization -{ - [Key] - [Column("SynchronizationID")] - public int SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int SynchronizationTaskId { get; set; } - - [Column("SynchronizationServerID")] - public int SynchronizationServerId { get; set; } - - public DateTime? SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - [ForeignKey("SynchronizationServerId")] - [InverseProperty("StagingSynchronizations")] - public virtual StagingServer SynchronizationServer { get; set; } = null!; - - [ForeignKey("SynchronizationTaskId")] - [InverseProperty("StagingSynchronizations")] - public virtual StagingTask SynchronizationTask { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/StagingTask.cs b/Migration.Toolkit.KX12/Models/StagingTask.cs deleted file mode 100644 index 6b7539b7..00000000 --- a/Migration.Toolkit.KX12/Models/StagingTask.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Staging_Task")] -[Index("TaskDocumentId", "TaskNodeId", "TaskRunning", Name = "IX_Staging_Task_TaskDocumentID_TaskNodeID_TaskRunning")] -[Index("TaskObjectType", "TaskObjectId", "TaskRunning", Name = "IX_Staging_Task_TaskObjectType_TaskObjectID_TaskRunning")] -[Index("TaskSiteId", Name = "IX_Staging_Task_TaskSiteID")] -[Index("TaskType", Name = "IX_Staging_Task_TaskType")] -public class StagingTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - [StringLength(450)] - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool? TaskRunning { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - public string? TaskServers { get; set; } - - [InverseProperty("SynchronizationTask")] - public virtual ICollection StagingSynchronizations { get; set; } = new List(); - - [InverseProperty("Task")] - public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); - - [InverseProperty("Task")] - public virtual ICollection StagingTaskUsers { get; set; } = new List(); - - [ForeignKey("TaskSiteId")] - [InverseProperty("StagingTasks")] - public virtual CmsSite? TaskSite { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/StagingTaskGroup.cs b/Migration.Toolkit.KX12/Models/StagingTaskGroup.cs deleted file mode 100644 index 0922cfa8..00000000 --- a/Migration.Toolkit.KX12/Models/StagingTaskGroup.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("staging_TaskGroup")] -public class StagingTaskGroup -{ - [Key] - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [StringLength(50)] - public string TaskGroupCodeName { get; set; } = null!; - - public Guid TaskGroupGuid { get; set; } - - public string? TaskGroupDescription { get; set; } - - [InverseProperty("TaskGroup")] - public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); - - [InverseProperty("TaskGroup")] - public virtual ICollection StagingTaskGroupUsers { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX12/Models/StagingTaskGroupTask.cs b/Migration.Toolkit.KX12/Models/StagingTaskGroupTask.cs deleted file mode 100644 index 89e27d07..00000000 --- a/Migration.Toolkit.KX12/Models/StagingTaskGroupTask.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("staging_TaskGroupTask")] -[Index("TaskGroupId", Name = "IX_Staging_TaskGroupTask_TaskGroupID")] -[Index("TaskId", Name = "IX_Staging_TaskGroupTask_TaskID")] -public class StagingTaskGroupTask -{ - [Key] - [Column("TaskGroupTaskID")] - public int TaskGroupTaskId { get; set; } - - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [ForeignKey("TaskId")] - [InverseProperty("StagingTaskGroupTasks")] - public virtual StagingTask Task { get; set; } = null!; - - [ForeignKey("TaskGroupId")] - [InverseProperty("StagingTaskGroupTasks")] - public virtual StagingTaskGroup TaskGroup { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/StagingTaskGroupUser.cs b/Migration.Toolkit.KX12/Models/StagingTaskGroupUser.cs deleted file mode 100644 index c4ab0e10..00000000 --- a/Migration.Toolkit.KX12/Models/StagingTaskGroupUser.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("staging_TaskGroupUser")] -[Index("TaskGroupId", Name = "IX_Staging_TaskGroupUser_TaskGroup_ID")] -[Index("UserId", Name = "IX_Staging_TaskGroupUser_UserID", IsUnique = true)] -public class StagingTaskGroupUser -{ - [Key] - [Column("TaskGroupUserID")] - public int TaskGroupUserId { get; set; } - - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("TaskGroupId")] - [InverseProperty("StagingTaskGroupUsers")] - public virtual StagingTaskGroup TaskGroup { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("StagingTaskGroupUser")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/StagingTaskUser.cs b/Migration.Toolkit.KX12/Models/StagingTaskUser.cs deleted file mode 100644 index 0e5bdd05..00000000 --- a/Migration.Toolkit.KX12/Models/StagingTaskUser.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Staging_TaskUser")] -[Index("TaskId", Name = "IX_Staging_TaskUser_TaskID")] -[Index("UserId", Name = "IX_Staging_TaskUser_UserID")] -public class StagingTaskUser -{ - [Key] - [Column("TaskUserID")] - public int TaskUserId { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("TaskId")] - [InverseProperty("StagingTaskUsers")] - public virtual StagingTask Task { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("StagingTaskUsers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/TempFile.cs b/Migration.Toolkit.KX12/Models/TempFile.cs deleted file mode 100644 index a385ed49..00000000 --- a/Migration.Toolkit.KX12/Models/TempFile.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Temp_File")] -public class TempFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileParentGUID")] - public Guid FileParentGuid { get; set; } - - public int FileNumber { get; set; } - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - public long FileSize { get; set; } - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - public byte[]? FileBinary { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - public DateTime FileLastModified { get; set; } - - [StringLength(200)] - public string FileDirectory { get; set; } = null!; - - [StringLength(200)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string? FileTitle { get; set; } - - public string? FileDescription { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/TempPageBuilderWidget.cs b/Migration.Toolkit.KX12/Models/TempPageBuilderWidget.cs deleted file mode 100644 index 495a3691..00000000 --- a/Migration.Toolkit.KX12/Models/TempPageBuilderWidget.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Temp_PageBuilderWidgets")] -public class TempPageBuilderWidget -{ - [Key] - [Column("PageBuilderWidgetsID")] - public int PageBuilderWidgetsId { get; set; } - - public string? PageBuilderWidgetsConfiguration { get; set; } - - public Guid PageBuilderWidgetsGuid { get; set; } - - public DateTime PageBuilderWidgetsLastModified { get; set; } - - public string? PageBuilderTemplateConfiguration { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewBoardsBoardMessageJoined.cs b/Migration.Toolkit.KX12/Models/ViewBoardsBoardMessageJoined.cs deleted file mode 100644 index 6b715d91..00000000 --- a/Migration.Toolkit.KX12/Models/ViewBoardsBoardMessageJoined.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewBoardsBoardMessageJoined -{ - [Column("BoardID")] - public int BoardId { get; set; } - - [StringLength(250)] - public string BoardName { get; set; } = null!; - - [StringLength(250)] - public string BoardDisplayName { get; set; } = null!; - - public string BoardDescription { get; set; } = null!; - - public DateTime? BoardOpenedFrom { get; set; } - - public bool BoardOpened { get; set; } - - public DateTime? BoardOpenedTo { get; set; } - - public bool BoardEnabled { get; set; } - - public bool BoardModerated { get; set; } - - public int BoardAccess { get; set; } - - public bool BoardUseCaptcha { get; set; } - - public DateTime BoardLastModified { get; set; } - - public int BoardMessages { get; set; } - - [Column("BoardDocumentID")] - public int BoardDocumentId { get; set; } - - [Column("BoardGUID")] - public Guid BoardGuid { get; set; } - - [Column("BoardUserID")] - public int? BoardUserId { get; set; } - - [Column("BoardGroupID")] - public int? BoardGroupId { get; set; } - - public DateTime? BoardLastMessageTime { get; set; } - - [StringLength(250)] - public string? BoardLastMessageUserName { get; set; } - - [Column("BoardUnsubscriptionURL")] - [StringLength(450)] - public string? BoardUnsubscriptionUrl { get; set; } - - public bool? BoardRequireEmails { get; set; } - - [Column("BoardSiteID")] - public int BoardSiteId { get; set; } - - public bool BoardEnableSubscriptions { get; set; } - - [Column("BoardBaseURL")] - [StringLength(450)] - public string? BoardBaseUrl { get; set; } - - [Column("MessageID")] - public int MessageId { get; set; } - - [StringLength(250)] - public string MessageUserName { get; set; } = null!; - - public string MessageText { get; set; } = null!; - - [StringLength(254)] - public string MessageEmail { get; set; } = null!; - - [Column("MessageURL")] - [StringLength(450)] - public string MessageUrl { get; set; } = null!; - - public bool MessageIsSpam { get; set; } - - [Column("MessageBoardID")] - public int MessageBoardId { get; set; } - - public bool MessageApproved { get; set; } - - [Column("MessageUserID")] - public int? MessageUserId { get; set; } - - [Column("MessageApprovedByUserID")] - public int? MessageApprovedByUserId { get; set; } - - public string MessageUserInfo { get; set; } = null!; - - [Column("MessageAvatarGUID")] - public Guid? MessageAvatarGuid { get; set; } - - public DateTime MessageInserted { get; set; } - - public DateTime MessageLastModified { get; set; } - - [Column("MessageGUID")] - public Guid MessageGuid { get; set; } - - public double? MessageRatingValue { get; set; } - - [Column("GroupID")] - public int? GroupId { get; set; } - - [Column("GroupGUID")] - public Guid? GroupGuid { get; set; } - - public DateTime? GroupLastModified { get; set; } - - [Column("GroupSiteID")] - public int? GroupSiteId { get; set; } - - [StringLength(200)] - public string? GroupDisplayName { get; set; } - - [StringLength(100)] - public string? GroupName { get; set; } - - public string? GroupDescription { get; set; } - - [Column("GroupNodeGUID")] - public Guid? GroupNodeGuid { get; set; } - - public int? GroupApproveMembers { get; set; } - - public int? GroupAccess { get; set; } - - [Column("GroupCreatedByUserID")] - public int? GroupCreatedByUserId { get; set; } - - [Column("GroupApprovedByUserID")] - public int? GroupApprovedByUserId { get; set; } - - [Column("GroupAvatarID")] - public int? GroupAvatarId { get; set; } - - public bool? GroupApproved { get; set; } - - public DateTime? GroupCreatedWhen { get; set; } - - public bool? GroupSendJoinLeaveNotification { get; set; } - - public bool? GroupSendWaitingForApprovalNotification { get; set; } - - public int? GroupSecurity { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsAclitemItemsAndOperator.cs b/Migration.Toolkit.KX12/Models/ViewCmsAclitemItemsAndOperator.cs deleted file mode 100644 index 897ac4d0..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsAclitemItemsAndOperator.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsAclitemItemsAndOperator -{ - [Column("ACLOwnerNodeID")] - public int AclownerNodeId { get; set; } - - [Column("ACLItemID")] - public int AclitemId { get; set; } - - public int Allowed { get; set; } - - public int Denied { get; set; } - - [StringLength(51)] - public string? Operator { get; set; } - - [StringLength(100)] - public string? OperatorName { get; set; } - - [Column("ACLID")] - public int Aclid { get; set; } - - [StringLength(450)] - public string? OperatorFullName { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [Column("RoleID")] - public int? RoleId { get; set; } - - [Column("RoleGroupID")] - public int? RoleGroupId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs deleted file mode 100644 index 2fc43cac..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsObjectVersionHistoryUserJoined -{ - [Column("VersionID")] - public int VersionId { get; set; } - - [Column("VersionObjectID")] - public int? VersionObjectId { get; set; } - - [StringLength(100)] - public string VersionObjectType { get; set; } = null!; - - [Column("VersionObjectSiteID")] - public int? VersionObjectSiteId { get; set; } - - [StringLength(450)] - public string VersionObjectDisplayName { get; set; } = null!; - - [Column("VersionXML")] - public string VersionXml { get; set; } = null!; - - [Column("VersionBinaryDataXML")] - public string? VersionBinaryDataXml { get; set; } - - [Column("VersionModifiedByUserID")] - public int? VersionModifiedByUserId { get; set; } - - public DateTime VersionModifiedWhen { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [StringLength(50)] - public string VersionNumber { get; set; } = null!; - - [Column("VersionSiteBindingIDs")] - public string? VersionSiteBindingIds { get; set; } - - public string? VersionComment { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(100)] - public string? UserName { get; set; } - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string? UserPassword { get; set; } - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool? UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid? UserGuid { get; set; } - - public DateTime? UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int? UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs deleted file mode 100644 index 6f30d28f..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsPageTemplateCategoryPageTemplateJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(200)] - public string? CodeName { get; set; } - - [StringLength(200)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryTemplateChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [StringLength(20)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; - - public bool? Parameter { get; set; } - - public int? PageTemplateForAllPages { get; set; } - - [StringLength(10)] - public string? PageTemplateType { get; set; } - - public int? PageTemplateIsReusable { get; set; } - - [StringLength(200)] - public string? PageTemplateIconClass { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsRelationshipJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsRelationshipJoined.cs deleted file mode 100644 index 187cae57..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsRelationshipJoined.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsRelationshipJoined -{ - [Column("LeftNodeID")] - public int LeftNodeId { get; set; } - - [Column("LeftNodeGUID")] - public Guid LeftNodeGuid { get; set; } - - [StringLength(100)] - public string LeftNodeName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipName { get; set; } = null!; - - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - [Column("RightNodeID")] - public int RightNodeId { get; set; } - - [Column("RightNodeGUID")] - public Guid RightNodeGuid { get; set; } - - [StringLength(100)] - public string RightNodeName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipDisplayName { get; set; } = null!; - - public string? RelationshipCustomData { get; set; } - - [Column("LeftClassID")] - public int LeftClassId { get; set; } - - [Column("RightClassID")] - public int RightClassId { get; set; } - - [Column("RelationshipID")] - public int RelationshipId { get; set; } - - public int? RelationshipOrder { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsResourceStringJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsResourceStringJoined.cs deleted file mode 100644 index 800adb75..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsResourceStringJoined.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsResourceStringJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("TranslationID")] - public int? TranslationId { get; set; } - - [Column("TranslationStringID")] - public int? TranslationStringId { get; set; } - - [Column("TranslationCultureID")] - public int? TranslationCultureId { get; set; } - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int? CultureId { get; set; } - - [StringLength(200)] - public string? CultureName { get; set; } - - [StringLength(50)] - public string? CultureCode { get; set; } - - [Column("CultureGUID")] - public Guid? CultureGuid { get; set; } - - public DateTime? CultureLastModified { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsResourceTranslatedJoined.cs deleted file mode 100644 index 245bafe0..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsResourceTranslatedJoined.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsResourceTranslatedJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs deleted file mode 100644 index eff53eab..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsRoleResourcePermissionJoined -{ - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - [StringLength(100)] - public string PermissionName { get; set; } = null!; - - [Column("PermissionID")] - public int PermissionId { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsSiteDocumentCount.cs b/Migration.Toolkit.KX12/Models/ViewCmsSiteDocumentCount.cs deleted file mode 100644 index f5179061..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsSiteDocumentCount.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsSiteDocumentCount -{ - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - [StringLength(200)] - public string SiteDisplayName { get; set; } = null!; - - public string? SiteDescription { get; set; } - - [StringLength(20)] - public string SiteStatus { get; set; } = null!; - - [StringLength(400)] - public string SiteDomainName { get; set; } = null!; - - [Column("SiteDefaultStylesheetID")] - public int? SiteDefaultStylesheetId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - public int? SiteDefaultEditorStylesheet { get; set; } - - [Column("SiteGUID")] - public Guid SiteGuid { get; set; } - - public DateTime SiteLastModified { get; set; } - - public bool? SiteIsContentOnly { get; set; } - - public int? Documents { get; set; } - - public bool? SiteIsOffline { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs deleted file mode 100644 index 1b4296ec..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsSiteRoleResourceUielementJoined -{ - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(200)] - public string ElementName { get; set; } = null!; - - [StringLength(100)] - public string? SiteName { get; set; } - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - [Column("RoleSiteID")] - public int? RoleSiteId { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsTreeJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsTreeJoined.cs deleted file mode 100644 index 080db2ae..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsTreeJoined.cs +++ /dev/null @@ -1,298 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsTreeJoined -{ - [StringLength(100)] - public string ClassName { get; set; } = null!; - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [Column("NodeID")] - public int NodeId { get; set; } - - [StringLength(450)] - public string NodeAliasPath { get; set; } = null!; - - [StringLength(100)] - public string NodeName { get; set; } = null!; - - [StringLength(50)] - public string NodeAlias { get; set; } = null!; - - [Column("NodeClassID")] - public int NodeClassId { get; set; } - - [Column("NodeParentID")] - public int? NodeParentId { get; set; } - - public int NodeLevel { get; set; } - - [Column("NodeACLID")] - public int? NodeAclid { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeGUID")] - public Guid NodeGuid { get; set; } - - public int? NodeOrder { get; set; } - - public bool? IsSecuredNode { get; set; } - - public int? NodeCacheMinutes { get; set; } - - [Column("NodeSKUID")] - public int? NodeSkuid { get; set; } - - public string? NodeDocType { get; set; } - - public string? NodeHeadTags { get; set; } - - public string? NodeBodyElementAttributes { get; set; } - - [StringLength(200)] - public string? NodeInheritPageLevels { get; set; } - - [Column("RequiresSSL")] - public int? RequiresSsl { get; set; } - - [Column("NodeLinkedNodeID")] - public int? NodeLinkedNodeId { get; set; } - - public int? NodeOwner { get; set; } - - public string? NodeCustomData { get; set; } - - [Column("NodeGroupID")] - public int? NodeGroupId { get; set; } - - [Column("NodeLinkedNodeSiteID")] - public int? NodeLinkedNodeSiteId { get; set; } - - [Column("NodeTemplateID")] - public int? NodeTemplateId { get; set; } - - public bool? NodeTemplateForAllCultures { get; set; } - - public bool? NodeInheritPageTemplate { get; set; } - - public bool? NodeAllowCacheInFileSystem { get; set; } - - public bool? NodeHasChildren { get; set; } - - public bool? NodeHasLinks { get; set; } - - [Column("NodeOriginalNodeID")] - public int? NodeOriginalNodeId { get; set; } - - public bool NodeIsContentOnly { get; set; } - - [Column("NodeIsACLOwner")] - public bool NodeIsAclowner { get; set; } - - public string? NodeBodyScripts { get; set; } - - [Column("DocumentID")] - public int DocumentId { get; set; } - - [StringLength(100)] - public string DocumentName { get; set; } = null!; - - [StringLength(1500)] - public string? DocumentNamePath { get; set; } - - public DateTime? DocumentModifiedWhen { get; set; } - - [Column("DocumentModifiedByUserID")] - public int? DocumentModifiedByUserId { get; set; } - - public int? DocumentForeignKeyValue { get; set; } - - [Column("DocumentCreatedByUserID")] - public int? DocumentCreatedByUserId { get; set; } - - public DateTime? DocumentCreatedWhen { get; set; } - - [Column("DocumentCheckedOutByUserID")] - public int? DocumentCheckedOutByUserId { get; set; } - - public DateTime? DocumentCheckedOutWhen { get; set; } - - [Column("DocumentCheckedOutVersionHistoryID")] - public int? DocumentCheckedOutVersionHistoryId { get; set; } - - [Column("DocumentPublishedVersionHistoryID")] - public int? DocumentPublishedVersionHistoryId { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - public DateTime? DocumentPublishFrom { get; set; } - - public DateTime? DocumentPublishTo { get; set; } - - [StringLength(450)] - public string? DocumentUrlPath { get; set; } - - [StringLength(10)] - public string DocumentCulture { get; set; } = null!; - - [Column("DocumentNodeID")] - public int DocumentNodeId { get; set; } - - public string? DocumentPageTitle { get; set; } - - public string? DocumentPageKeyWords { get; set; } - - public string? DocumentPageDescription { get; set; } - - public bool DocumentShowInSiteMap { get; set; } - - public bool DocumentMenuItemHideInNavigation { get; set; } - - [StringLength(200)] - public string? DocumentMenuCaption { get; set; } - - [StringLength(100)] - public string? DocumentMenuStyle { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImage { get; set; } - - [Column("DocumentPageTemplateID")] - public int? DocumentPageTemplateId { get; set; } - - [StringLength(450)] - public string? DocumentMenuJavascript { get; set; } - - [StringLength(450)] - public string? DocumentMenuRedirectUrl { get; set; } - - public bool? DocumentUseNamePathForUrlPath { get; set; } - - [Column("DocumentStylesheetID")] - public int? DocumentStylesheetId { get; set; } - - public string? DocumentContent { get; set; } - - [StringLength(100)] - public string? DocumentMenuClass { get; set; } - - [StringLength(200)] - public string? DocumentMenuStyleHighlighted { get; set; } - - [StringLength(100)] - public string? DocumentMenuClassHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImageHighlighted { get; set; } - - public bool? DocumentMenuItemInactive { get; set; } - - public string? DocumentCustomData { get; set; } - - [StringLength(100)] - public string? DocumentExtensions { get; set; } - - public string? DocumentTags { get; set; } - - [Column("DocumentTagGroupID")] - public int? DocumentTagGroupId { get; set; } - - [StringLength(440)] - public string? DocumentWildcardRule { get; set; } - - public string? DocumentWebParts { get; set; } - - public double? DocumentRatingValue { get; set; } - - public int? DocumentRatings { get; set; } - - public int? DocumentPriority { get; set; } - - [StringLength(50)] - public string? DocumentType { get; set; } - - public DateTime? DocumentLastPublished { get; set; } - - public bool? DocumentUseCustomExtensions { get; set; } - - public string? DocumentGroupWebParts { get; set; } - - public bool? DocumentCheckedOutAutomatically { get; set; } - - [StringLength(200)] - public string? DocumentTrackConversionName { get; set; } - - [StringLength(100)] - public string? DocumentConversionValue { get; set; } - - public bool? DocumentSearchExcluded { get; set; } - - [StringLength(50)] - public string? DocumentLastVersionNumber { get; set; } - - public bool? DocumentIsArchived { get; set; } - - [StringLength(32)] - public string? DocumentHash { get; set; } - - public bool? DocumentLogVisitActivity { get; set; } - - [Column("DocumentGUID")] - public Guid? DocumentGuid { get; set; } - - [Column("DocumentWorkflowCycleGUID")] - public Guid? DocumentWorkflowCycleGuid { get; set; } - - [StringLength(100)] - public string? DocumentSitemapSettings { get; set; } - - public bool? DocumentIsWaitingForTranslation { get; set; } - - [Column("DocumentSKUName")] - [StringLength(440)] - public string? DocumentSkuname { get; set; } - - [Column("DocumentSKUDescription")] - public string? DocumentSkudescription { get; set; } - - [Column("DocumentSKUShortDescription")] - public string? DocumentSkushortDescription { get; set; } - - [StringLength(450)] - public string? DocumentWorkflowActionStatus { get; set; } - - public bool? DocumentMenuRedirectToFirstChild { get; set; } - - public bool DocumentCanBePublished { get; set; } - - public bool DocumentInheritsStylesheet { get; set; } - - public string? DocumentPageBuilderWidgets { get; set; } - - public string? DocumentPageTemplateConfiguration { get; set; } - - [Column("DocumentABTestConfiguration")] - public string? DocumentAbtestConfiguration { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUser.cs b/Migration.Toolkit.KX12/Models/ViewCmsUser.cs deleted file mode 100644 index bdbf827c..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsUser.cs +++ /dev/null @@ -1,214 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsUser -{ - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [Column("UserSettingsID")] - public int? UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid? UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int? UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarFileName { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserDocument.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserDocument.cs deleted file mode 100644 index 4b538876..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserDocument.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsUserDocument -{ - [StringLength(450)] - public string DocumentName { get; set; } = null!; - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeID")] - public int NodeId { get; set; } - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [StringLength(1500)] - public string? DocumentNamePath { get; set; } - - public DateTime? DocumentModifiedWhen { get; set; } - - [StringLength(10)] - public string DocumentCulture { get; set; } = null!; - - [StringLength(200)] - public string? CultureName { get; set; } - - [Column("UserID1")] - public int? UserId1 { get; set; } - - [Column("UserID2")] - public int? UserId2 { get; set; } - - [Column("UserID3")] - public int? UserId3 { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - [StringLength(450)] - public string NodeAliasPath { get; set; } = null!; - - [StringLength(12)] - [Unicode(false)] - public string Type { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleJoined.cs deleted file mode 100644 index 53c3c05b..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleJoined.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsUserRoleJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(450)] - public string? FullName { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - [Column("RoleGroupID")] - public int? RoleGroupId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [StringLength(100)] - public string? SiteName { get; set; } - - [Column("SiteGUID")] - public Guid? SiteGuid { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRole.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRole.cs deleted file mode 100644 index 1d57ae5b..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRole.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsUserRoleMembershipRole -{ - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - public DateTime? ValidTo { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs deleted file mode 100644 index 36b03f2c..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsUserRoleMembershipRoleValidOnlyJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserSettingsRoleJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserSettingsRoleJoined.cs deleted file mode 100644 index c22f8a54..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserSettingsRoleJoined.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsUserSettingsRoleJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - public bool UserEnabled { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs deleted file mode 100644 index 8b6d350a..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsWebPartCategoryWebpartJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(100)] - public string CodeName { get; set; } = null!; - - [StringLength(100)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryWebPartChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [Column("WebPartParentID")] - public int? WebPartParentId { get; set; } - - [StringLength(100)] - public string? WebPartFileName { get; set; } - - [Column("WebPartGUID")] - public Guid? WebPartGuid { get; set; } - - public int? WebPartType { get; set; } - - [StringLength(1000)] - public string? WebPartDescription { get; set; } - - [StringLength(15)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; - - [Column("ThumbnailGUID")] - public Guid? ThumbnailGuid { get; set; } - - [StringLength(200)] - public string? IconClass { get; set; } - - public bool? WebPartSkipInsertProperties { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs deleted file mode 100644 index c6325de5..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCmsWidgetCategoryWidgetJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(100)] - public string CodeName { get; set; } = null!; - - [StringLength(100)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? WidgetCategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? WidgetCategoryChildCount { get; set; } - - public int? WidgetCategoryWidgetChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [Column("WidgetWebPartID")] - public int? WidgetWebPartId { get; set; } - - public int WidgetSecurity { get; set; } - - public bool? WidgetForGroup { get; set; } - - public bool? WidgetForInline { get; set; } - - public bool? WidgetForUser { get; set; } - - public bool? WidgetForEditor { get; set; } - - public bool? WidgetForDashboard { get; set; } - - [Column("WidgetGUID")] - public Guid? WidgetGuid { get; set; } - - [StringLength(14)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs b/Migration.Toolkit.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs deleted file mode 100644 index 2290cc5d..00000000 --- a/Migration.Toolkit.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewComSkuoptionCategoryOptionCategoryJoined -{ - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("CategoryID")] - public int CategoryId { get; set; } - - public bool? AllowAllOptions { get; set; } - - [Column("SKUCategoryID")] - public int SkucategoryId { get; set; } - - [Column("SKUCategoryOrder")] - public int? SkucategoryOrder { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryName { get; set; } = null!; - - [StringLength(200)] - public string CategorySelectionType { get; set; } = null!; - - [StringLength(200)] - public string? CategoryDefaultOptions { get; set; } - - public string? CategoryDescription { get; set; } - - [StringLength(200)] - public string? CategoryDefaultRecord { get; set; } - - public bool CategoryEnabled { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - public bool? CategoryDisplayPrice { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - public int? CategoryTextMaxLength { get; set; } - - [StringLength(20)] - public string? CategoryType { get; set; } - - public int? CategoryTextMinLength { get; set; } - - [StringLength(200)] - public string? CategoryLiveSiteDisplayName { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCommunityGroup.cs b/Migration.Toolkit.KX12/Models/ViewCommunityGroup.cs deleted file mode 100644 index ff233687..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCommunityGroup.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCommunityGroup -{ - [Column("GroupID")] - public int GroupId { get; set; } - - [Column("GroupGUID")] - public Guid GroupGuid { get; set; } - - public DateTime GroupLastModified { get; set; } - - [Column("GroupSiteID")] - public int GroupSiteId { get; set; } - - [StringLength(200)] - public string GroupDisplayName { get; set; } = null!; - - [StringLength(100)] - public string GroupName { get; set; } = null!; - - public string GroupDescription { get; set; } = null!; - - [Column("GroupNodeGUID")] - public Guid? GroupNodeGuid { get; set; } - - public int GroupApproveMembers { get; set; } - - public int GroupAccess { get; set; } - - [Column("GroupCreatedByUserID")] - public int? GroupCreatedByUserId { get; set; } - - [Column("GroupApprovedByUserID")] - public int? GroupApprovedByUserId { get; set; } - - [Column("GroupAvatarID")] - public int? GroupAvatarId { get; set; } - - public bool? GroupApproved { get; set; } - - public DateTime GroupCreatedWhen { get; set; } - - public bool? GroupSendJoinLeaveNotification { get; set; } - - public bool? GroupSendWaitingForApprovalNotification { get; set; } - - public int? GroupSecurity { get; set; } - - public bool? GroupLogActivity { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarFileName { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewCommunityMember.cs b/Migration.Toolkit.KX12/Models/ViewCommunityMember.cs deleted file mode 100644 index aec483bc..00000000 --- a/Migration.Toolkit.KX12/Models/ViewCommunityMember.cs +++ /dev/null @@ -1,245 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewCommunityMember -{ - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [Column("UserSettingsID")] - public int? UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid? UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int? UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [Column("MemberID")] - public int? MemberId { get; set; } - - [Column("MemberGUID")] - public Guid? MemberGuid { get; set; } - - [Column("MemberUserID")] - public int? MemberUserId { get; set; } - - [Column("MemberGroupID")] - public int? MemberGroupId { get; set; } - - public DateTime? MemberJoined { get; set; } - - public DateTime? MemberApprovedWhen { get; set; } - - public DateTime? MemberRejectedWhen { get; set; } - - [Column("MemberApprovedByUserID")] - public int? MemberApprovedByUserId { get; set; } - - public string? MemberComment { get; set; } - - [Column("MemberInvitedByUserID")] - public int? MemberInvitedByUserId { get; set; } - - public int? MemberStatus { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } - - [StringLength(200)] - public string? AvatarName { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewForumsGroupForumPostJoined.cs b/Migration.Toolkit.KX12/Models/ViewForumsGroupForumPostJoined.cs deleted file mode 100644 index 19649d18..00000000 --- a/Migration.Toolkit.KX12/Models/ViewForumsGroupForumPostJoined.cs +++ /dev/null @@ -1,227 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewForumsGroupForumPostJoined -{ - [Column("ForumID")] - public int? ForumId { get; set; } - - [Column("ForumGroupID")] - public int? ForumGroupId { get; set; } - - [StringLength(200)] - public string? ForumName { get; set; } - - [StringLength(200)] - public string? ForumDisplayName { get; set; } - - public string? ForumDescription { get; set; } - - public int? ForumOrder { get; set; } - - [Column("ForumDocumentID")] - public int? ForumDocumentId { get; set; } - - public bool? ForumOpen { get; set; } - - public bool? ForumModerated { get; set; } - - public bool? ForumDisplayEmails { get; set; } - - public bool? ForumRequireEmail { get; set; } - - public int? ForumAccess { get; set; } - - public int? ForumThreads { get; set; } - - public int? ForumPosts { get; set; } - - public DateTime? ForumLastPostTime { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserName { get; set; } - - [StringLength(200)] - public string? ForumBaseUrl { get; set; } - - public bool? ForumAllowChangeName { get; set; } - - [Column("ForumHTMLEditor")] - public bool? ForumHtmleditor { get; set; } - - [Column("ForumUseCAPTCHA")] - public bool? ForumUseCaptcha { get; set; } - - [Column("ForumGUID")] - public Guid? ForumGuid { get; set; } - - public DateTime? ForumLastModified { get; set; } - - [StringLength(200)] - public string? ForumUnsubscriptionUrl { get; set; } - - public bool? ForumIsLocked { get; set; } - - public string? ForumSettings { get; set; } - - public bool? ForumAuthorEdit { get; set; } - - public bool? ForumAuthorDelete { get; set; } - - public int? ForumType { get; set; } - - public int? ForumIsAnswerLimit { get; set; } - - public int? ForumImageMaxSideSize { get; set; } - - public DateTime? ForumLastPostTimeAbsolute { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserNameAbsolute { get; set; } - - public int? ForumPostsAbsolute { get; set; } - - public int? ForumThreadsAbsolute { get; set; } - - public int? ForumAttachmentMaxFileSize { get; set; } - - public int? ForumDiscussionActions { get; set; } - - [Column("ForumSiteID")] - public int? ForumSiteId { get; set; } - - [Column("GroupID")] - public int? GroupId { get; set; } - - [Column("GroupSiteID")] - public int? GroupSiteId { get; set; } - - [StringLength(200)] - public string? GroupName { get; set; } - - [StringLength(200)] - public string? GroupDisplayName { get; set; } - - public int? GroupOrder { get; set; } - - public string? GroupDescription { get; set; } - - [Column("GroupGUID")] - public Guid? GroupGuid { get; set; } - - public DateTime? GroupLastModified { get; set; } - - [StringLength(200)] - public string? GroupBaseUrl { get; set; } - - [StringLength(200)] - public string? GroupUnsubscriptionUrl { get; set; } - - [Column("GroupGroupID")] - public int? GroupGroupId { get; set; } - - public bool? GroupAuthorEdit { get; set; } - - public bool? GroupAuthorDelete { get; set; } - - public int? GroupType { get; set; } - - public int? GroupIsAnswerLimit { get; set; } - - public int? GroupImageMaxSideSize { get; set; } - - public bool? GroupDisplayEmails { get; set; } - - public bool? GroupRequireEmail { get; set; } - - [Column("GroupHTMLEditor")] - public bool? GroupHtmleditor { get; set; } - - [Column("GroupUseCAPTCHA")] - public bool? GroupUseCaptcha { get; set; } - - public int? GroupAttachmentMaxFileSize { get; set; } - - public int? GroupDiscussionActions { get; set; } - - public int PostId { get; set; } - - [Column("PostForumID")] - public int PostForumId { get; set; } - - [Column("PostParentID")] - public int? PostParentId { get; set; } - - [Column("PostIDPath")] - [StringLength(450)] - public string PostIdpath { get; set; } = null!; - - public int PostLevel { get; set; } - - [StringLength(450)] - public string PostSubject { get; set; } = null!; - - [Column("PostUserID")] - public int? PostUserId { get; set; } - - [StringLength(200)] - public string PostUserName { get; set; } = null!; - - [StringLength(254)] - public string? PostUserMail { get; set; } - - public string? PostText { get; set; } - - public DateTime PostTime { get; set; } - - [Column("PostApprovedByUserID")] - public int? PostApprovedByUserId { get; set; } - - public int? PostThreadPosts { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserName { get; set; } - - public DateTime? PostThreadLastPostTime { get; set; } - - public string? PostUserSignature { get; set; } - - [Column("PostGUID")] - public Guid PostGuid { get; set; } - - public DateTime PostLastModified { get; set; } - - public bool? PostApproved { get; set; } - - public bool? PostIsLocked { get; set; } - - public int? PostIsAnswer { get; set; } - - public int PostStickOrder { get; set; } - - public int? PostViews { get; set; } - - public DateTime? PostLastEdit { get; set; } - - public string? PostInfo { get; set; } - - public int? PostAttachmentCount { get; set; } - - public int? PostType { get; set; } - - public int? PostThreadPostsAbsolute { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserNameAbsolute { get; set; } - - public DateTime? PostThreadLastPostTimeAbsolute { get; set; } - - public bool? PostQuestionSolved { get; set; } - - public int? PostIsNotAnswer { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewIntegrationTaskJoined.cs b/Migration.Toolkit.KX12/Models/ViewIntegrationTaskJoined.cs deleted file mode 100644 index 36aae62c..00000000 --- a/Migration.Toolkit.KX12/Models/ViewIntegrationTaskJoined.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewIntegrationTaskJoined -{ - [Column("SynchronizationID")] - public int? SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int? SynchronizationTaskId { get; set; } - - [Column("SynchronizationConnectorID")] - public int? SynchronizationConnectorId { get; set; } - - public DateTime? SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - public bool? SynchronizationIsRunning { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - [StringLength(450)] - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool TaskIsInbound { get; set; } - - [StringLength(50)] - public string? TaskProcessType { get; set; } - - public string TaskData { get; set; } = null!; - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(50)] - public string? TaskDataType { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewMembershipMembershipUserJoined.cs b/Migration.Toolkit.KX12/Models/ViewMembershipMembershipUserJoined.cs deleted file mode 100644 index 3d5c312a..00000000 --- a/Migration.Toolkit.KX12/Models/ViewMembershipMembershipUserJoined.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewMembershipMembershipUserJoined -{ - [StringLength(200)] - public string MembershipDisplayName { get; set; } = null!; - - [Column("MembershipID")] - public int MembershipId { get; set; } - - public DateTime? ValidTo { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [Column("MembershipSiteID")] - public int? MembershipSiteId { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewNewsletterSubscriptionsJoined.cs b/Migration.Toolkit.KX12/Models/ViewNewsletterSubscriptionsJoined.cs deleted file mode 100644 index ad0929aa..00000000 --- a/Migration.Toolkit.KX12/Models/ViewNewsletterSubscriptionsJoined.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewNewsletterSubscriptionsJoined -{ - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [StringLength(440)] - public string? SubscriberFullName { get; set; } - - [StringLength(254)] - public string? SubscriberEmail { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - [StringLength(100)] - public string? SubscriberType { get; set; } - - public int? SubscriberBounces { get; set; } - - [StringLength(250)] - public string NewsletterDisplayName { get; set; } = null!; - - [Column("SubscriberRelatedID")] - public int SubscriberRelatedId { get; set; } - - [Column("SubscriberNewsletterID")] - public int SubscriberNewsletterId { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Toolkit.KX12/Models/ViewOmAccountContactAccountJoined.cs deleted file mode 100644 index 77550d8d..00000000 --- a/Migration.Toolkit.KX12/Models/ViewOmAccountContactAccountJoined.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewOmAccountContactAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewOmAccountContactContactJoined.cs b/Migration.Toolkit.KX12/Models/ViewOmAccountContactContactJoined.cs deleted file mode 100644 index a848ad6b..00000000 --- a/Migration.Toolkit.KX12/Models/ViewOmAccountContactContactJoined.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewOmAccountContactContactJoined -{ - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewOmAccountJoined.cs b/Migration.Toolkit.KX12/Models/ViewOmAccountJoined.cs deleted file mode 100644 index fef7d016..00000000 --- a/Migration.Toolkit.KX12/Models/ViewOmAccountJoined.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewOmAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [StringLength(100)] - public string? PrimaryContactFirstName { get; set; } - - [StringLength(100)] - public string? PrimaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? PrimaryContactLastName { get; set; } - - [StringLength(100)] - public string? SecondaryContactFirstName { get; set; } - - [StringLength(100)] - public string? SecondaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? SecondaryContactLastName { get; set; } - - [StringLength(200)] - public string? SubsidiaryOfName { get; set; } - - [StringLength(302)] - public string PrimaryContactFullName { get; set; } = null!; - - [StringLength(302)] - public string SecondaryContactFullName { get; set; } = null!; - - [StringLength(201)] - public string AccountFullAddress { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Toolkit.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs deleted file mode 100644 index 4234a4b1..00000000 --- a/Migration.Toolkit.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewOmContactGroupMemberAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewPollAnswerCount.cs b/Migration.Toolkit.KX12/Models/ViewPollAnswerCount.cs deleted file mode 100644 index f15e3c36..00000000 --- a/Migration.Toolkit.KX12/Models/ViewPollAnswerCount.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewPollAnswerCount -{ - [Column("PollID")] - public int PollId { get; set; } - - [StringLength(200)] - public string PollCodeName { get; set; } = null!; - - [StringLength(200)] - public string PollDisplayName { get; set; } = null!; - - [StringLength(100)] - public string? PollTitle { get; set; } - - public DateTime? PollOpenFrom { get; set; } - - public DateTime? PollOpenTo { get; set; } - - public bool PollAllowMultipleAnswers { get; set; } - - [StringLength(450)] - public string PollQuestion { get; set; } = null!; - - public int PollAccess { get; set; } - - [StringLength(450)] - public string? PollResponseMessage { get; set; } - - [Column("PollGUID")] - public Guid PollGuid { get; set; } - - public DateTime PollLastModified { get; set; } - - [Column("PollGroupID")] - public int? PollGroupId { get; set; } - - [Column("PollSiteID")] - public int? PollSiteId { get; set; } - - public bool? PollLogActivity { get; set; } - - public int? AnswerCount { get; set; } -} diff --git a/Migration.Toolkit.KX12/Models/ViewReportingCategoryReportJoined.cs b/Migration.Toolkit.KX12/Models/ViewReportingCategoryReportJoined.cs deleted file mode 100644 index e0ff7d7f..00000000 --- a/Migration.Toolkit.KX12/Models/ViewReportingCategoryReportJoined.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public class ViewReportingCategoryReportJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(200)] - public string CodeName { get; set; } = null!; - - [StringLength(440)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(651)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryReportChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - public string? ReportLayout { get; set; } - - public string? ReportParameters { get; set; } - - public int? ReportAccess { get; set; } - - [StringLength(14)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX12/SettingsKeys.cs b/Migration.Toolkit.KX12/SettingsKeys.cs deleted file mode 100644 index 25a57748..00000000 --- a/Migration.Toolkit.KX12/SettingsKeys.cs +++ /dev/null @@ -1,749 +0,0 @@ -// ReSharper disable InconsistentNaming -// ReSharper disable IdentifierTypo -namespace Migration.Toolkit.KX12; - -public static class SettingsKeys -{ - public const string CMSABTestingEnabled = "CMSABTestingEnabled"; - public const string CMSAccessDeniedPageURL = "CMSAccessDeniedPageURL"; - public const string CMSActivityPointsForBlogCommentPost = "CMSActivityPointsForBlogCommentPost"; - public const string CMSActivityPointsForBlogPost = "CMSActivityPointsForBlogPost"; - public const string CMSActivityPointsForForumPost = "CMSActivityPointsForForumPost"; - public const string CMSActivityPointsForMessageBoardPost = "CMSActivityPointsForMessageBoardPost"; - public const string CMSActivityTrackedExtensions = "CMSActivityTrackedExtensions"; - public const string CMSAdminEmailAddress = "CMSAdminEmailAddress"; - public const string CMSAllowAttachmentTranslation = "CMSAllowAttachmentTranslation"; - public const string CMSAllowComponentsCSS = "CMSAllowComponentsCSS"; - public const string CMSAllowDynamicNewsletters = "CMSAllowDynamicNewsletters"; - public const string CMSAllowedURLCharacters = "CMSAllowedURLCharacters"; - public const string CMSAllowGlobalCategories = "CMSAllowGlobalCategories"; - public const string CMSAllowGZip = "CMSAllowGZip"; - public const string CMSAllowOnSiteEditing = "CMSAllowOnSiteEditing"; - public const string CMSAllowPermanentPreviewLink = "CMSAllowPermanentPreviewLink"; - public const string CMSAllowPreviewMode = "CMSAllowPreviewMode"; - public const string CMSAllowUrlsWithoutLanguagePrefixes = "CMSAllowUrlsWithoutLanguagePrefixes"; - public const string CMSAlternativeURLsConstraint = "CMSAlternativeURLsConstraint"; - public const string CMSAlternativeURLsErrorMessage = "CMSAlternativeURLsErrorMessage"; - public const string CMSAlternativeURLsExcludedURLs = "CMSAlternativeURLsExcludedURLs"; - public const string CMSAlternativeURLsMode = "CMSAlternativeURLsMode"; - public const string CMSAlternativeUrlUIEnabled = "CMSAlternativeUrlUIEnabled"; - public const string CMSAnalyticsEnabled = "CMSAnalyticsEnabled"; - public const string CMSAnalyticsExcludedFileExtensions = "CMSAnalyticsExcludedFileExtensions"; - public const string CMSAnalyticsExcludedIPs = "CMSAnalyticsExcludedIPs"; - public const string CMSAnalyticsExcludedURLs = "CMSAnalyticsExcludedURLs"; - public const string CMSAnalyticsExcludeSearchEngines = "CMSAnalyticsExcludeSearchEngines"; - public const string CMSAnalyticsTrackAggregatedViews = "CMSAnalyticsTrackAggregatedViews"; - public const string CMSAnalyticsTrackBrowserTypes = "CMSAnalyticsTrackBrowserTypes"; - public const string CMSAnalyticsTrackCountries = "CMSAnalyticsTrackCountries"; - public const string CMSAnalyticsTrackFileDownloads = "CMSAnalyticsTrackFileDownloads"; - public const string CMSAnalyticsTrackInvalidPages = "CMSAnalyticsTrackInvalidPages"; - public const string CMSAnalyticsTrackPageViews = "CMSAnalyticsTrackPageViews"; - public const string CMSAnalyticsTrackReferrals = "CMSAnalyticsTrackReferrals"; - public const string CMSAnalyticsTrackRegisteredUsers = "CMSAnalyticsTrackRegisteredUsers"; - public const string CMSAnalyticsTrackVisits = "CMSAnalyticsTrackVisits"; - public const string CMSAnalyticsVisitorsSmartCheck = "CMSAnalyticsVisitorsSmartCheck"; - public const string CMSApplicationHealthMonitoringInterval = "CMSApplicationHealthMonitoringInterval"; - public const string CMSApplicationID = "CMSApplicationID"; - public const string CMSApplicationSecret = "CMSApplicationSecret"; - public const string CMSApplicationState = "CMSApplicationState"; - public const string CMSArchiveEmails = "CMSArchiveEmails"; - public const string CMSAuthorizeNETAPILogin = "CMSAuthorizeNETAPILogin"; - public const string CMSAuthorizeNETTransactionKey = "CMSAuthorizeNETTransactionKey"; - public const string CMSAuthorizeNETTransactionType = "CMSAuthorizeNETTransactionType"; - public const string CMSAutocompleteEnableForLogin = "CMSAutocompleteEnableForLogin"; - public const string CMSAutomaticallySignInUser = "CMSAutomaticallySignInUser"; - public const string CMSAutoResizeImageHeight = "CMSAutoResizeImageHeight"; - public const string CMSAutoResizeImageMaxSideSize = "CMSAutoResizeImageMaxSideSize"; - public const string CMSAutoResizeImageWidth = "CMSAutoResizeImageWidth"; - public const string CMSAvatarHeight = "CMSAvatarHeight"; - public const string CMSAvatarMaxSideSize = "CMSAvatarMaxSideSize"; - public const string CMSAvatarType = "CMSAvatarType"; - public const string CMSAvatarWidth = "CMSAvatarWidth"; - public const string CMSBadWordsAction = "CMSBadWordsAction"; - public const string CMSBadWordsReplacement = "CMSBadWordsReplacement"; - public const string CMSBannedIPEnabled = "CMSBannedIPEnabled"; - public const string CMSBannedIPRedirectURL = "CMSBannedIPRedirectURL"; - public const string CMSBitlyAPIKey = "CMSBitlyAPIKey"; - public const string CMSBitlyLogin = "CMSBitlyLogin"; - public const string CMSBizFormFilesFolder = "CMSBizFormFilesFolder"; - public const string CMSBlockSubscribersGlobally = "CMSBlockSubscribersGlobally"; - public const string CMSBlogEnableOptIn = "CMSBlogEnableOptIn"; - public const string CMSBlogEnableOptInConfirmation = "CMSBlogEnableOptInConfirmation"; - public const string CMSBlogOptInApprovalPath = "CMSBlogOptInApprovalPath"; - public const string CMSBlogOptInInterval = "CMSBlogOptInInterval"; - public const string CMSBlogsUnsubscriptionUrl = "CMSBlogsUnsubscriptionUrl"; - public const string CMSBoardBaseUrl = "CMSBoardBaseUrl"; - public const string CMSBoardEnableOptIn = "CMSBoardEnableOptIn"; - public const string CMSBoardEnableOptInConfirmation = "CMSBoardEnableOptInConfirmation"; - public const string CMSBoardOptInApprovalPath = "CMSBoardOptInApprovalPath"; - public const string CMSBoardOptInInterval = "CMSBoardOptInInterval"; - public const string CMSBoardUnsubsriptionURL = "CMSBoardUnsubsriptionURL"; - public const string CMSBouncedEmailAddress = "CMSBouncedEmailAddress"; - public const string CMSBouncedEmailsLimit = "CMSBouncedEmailsLimit"; - public const string CMSCacheImages = "CMSCacheImages"; - public const string CMSCacheMinutes = "CMSCacheMinutes"; - public const string CMSCachePageInfo = "CMSCachePageInfo"; - public const string CMSCampaignNewPageLocation = "CMSCampaignNewPageLocation"; - public const string CMSCaptchaControl = "CMSCaptchaControl"; - public const string CMSChatAllowAnonymGlobally = "CMSChatAllowAnonymGlobally"; - public const string CMSChatDaysNeededToDeleteRecods = "CMSChatDaysNeededToDeleteRecods"; - public const string CMSChatDisplayAnnouncementAtFirstLoad = "CMSChatDisplayAnnouncementAtFirstLoad"; - public const string CMSChatDisplayChangeNicknameAtFirstLoad = "CMSChatDisplayChangeNicknameAtFirstLoad"; - public const string CMSChatDisplayEnterAtFirstLoad = "CMSChatDisplayEnterAtFirstLoad"; - public const string CMSChatDisplayInvitedAtFirstLoad = "CMSChatDisplayInvitedAtFirstLoad"; - public const string CMSChatDisplayKickAtFirstLoad = "CMSChatDisplayKickAtFirstLoad"; - public const string CMSChatDisplayLeaveAtFirstLoad = "CMSChatDisplayLeaveAtFirstLoad"; - public const string CMSChatDisplaySupportGreetingAtFirstLoad = "CMSChatDisplaySupportGreetingAtFirstLoad"; - public const string CMSChatEnableBBCode = "CMSChatEnableBBCode"; - public const string CMSChatEnableFloodProtection = "CMSChatEnableFloodProtection"; - public const string CMSChatEnableSmileys = "CMSChatEnableSmileys"; - public const string CMSChatEnableSoundLiveChat = "CMSChatEnableSoundLiveChat"; - public const string CMSChatEnableSoundSupportChat = "CMSChatEnableSoundSupportChat"; - public const string CMSChatErrorDeleteAllTrans = "CMSChatErrorDeleteAllTrans"; - public const string CMSChatErrorTrans = "CMSChatErrorTrans"; - public const string CMSChatFirstLoadMessagesCount = "CMSChatFirstLoadMessagesCount"; - public const string CMSChatFloodProtectionChangeNickname = "CMSChatFloodProtectionChangeNickname"; - public const string CMSChatFloodProtectionCreateRoom = "CMSChatFloodProtectionCreateRoom"; - public const string CMSChatFloodProtectionJoinRoom = "CMSChatFloodProtectionJoinRoom"; - public const string CMSChatFloodProtectionPostMessage = "CMSChatFloodProtectionPostMessage"; - public const string CMSChatForceAnonymUniqueNicknames = "CMSChatForceAnonymUniqueNicknames"; - public const string CMSChatGlobalPingInterval = "CMSChatGlobalPingInterval"; - public const string CMSChatGuestPrefix = "CMSChatGuestPrefix"; - public const string CMSChatInitiatedChatTrans = "CMSChatInitiatedChatTrans"; - public const string CMSChatKickLastingTime = "CMSChatKickLastingTime"; - public const string CMSChatMaximumMessageLength = "CMSChatMaximumMessageLength"; - public const string CMSChatNotificationTrans = "CMSChatNotificationTrans"; - public const string CMSChatOnlineUserTrans = "CMSChatOnlineUserTrans"; - public const string CMSChatRedirectURLJoin = "CMSChatRedirectURLJoin"; - public const string CMSChatRedirectURLLeave = "CMSChatRedirectURLLeave"; - public const string CMSChatRedirectURLLogin = "CMSChatRedirectURLLogin"; - public const string CMSChatRedirectURLLogout = "CMSChatRedirectURLLogout"; - public const string CMSChatResolveURLEnabled = "CMSChatResolveURLEnabled"; - public const string CMSChatRoomMessageTrans = "CMSChatRoomMessageTrans"; - public const string CMSChatRoomNameTrans = "CMSChatRoomNameTrans"; - public const string CMSChatRoomPingInterval = "CMSChatRoomPingInterval"; - public const string CMSChatRoomPopupWindow = "CMSChatRoomPopupWindow"; - public const string CMSChatRoomTrans = "CMSChatRoomTrans"; - public const string CMSChatRoomUserTrans = "CMSChatRoomUserTrans"; - public const string CMSChatSendSupportMessagesTo = "CMSChatSendSupportMessagesTo"; - public const string CMSChatSupportEnabled = "CMSChatSupportEnabled"; - public const string CMSChatSupportEngineerLogoutTimeout = "CMSChatSupportEngineerLogoutTimeout"; - public const string CMSChatSupportRequestTrans = "CMSChatSupportRequestTrans"; - public const string CMSChatSupportTakenRoomReleaseTimeout = "CMSChatSupportTakenRoomReleaseTimeout"; - public const string CMSChatUserLogoutTimeout = "CMSChatUserLogoutTimeout"; - public const string CMSChatWPDefaultGroupPagesBy = "CMSChatWPDefaultGroupPagesBy"; - public const string CMSChatWPDefaultInviteModePagingItems = "CMSChatWPDefaultInviteModePagingItems"; - public const string CMSChatWPDefaultInviteModeSearchMode = "CMSChatWPDefaultInviteModeSearchMode"; - public const string CMSChatWPDefaultPagingItems = "CMSChatWPDefaultPagingItems"; - public const string CMSChatWPDefaultSearchOnlineMaxUsers = "CMSChatWPDefaultSearchOnlineMaxUsers"; - public const string CMSChatWPDefaultShowFilterLimit = "CMSChatWPDefaultShowFilterLimit"; - public const string CMSCheapestVariantAdvertising = "CMSCheapestVariantAdvertising"; - public const string CMSCheckBadWords = "CMSCheckBadWords"; - public const string CMSCheckDocumentPermissions = "CMSCheckDocumentPermissions"; - public const string CMSCheckFilesPermissions = "CMSCheckFilesPermissions"; - public const string CMSCheckMediaFilePermissions = "CMSCheckMediaFilePermissions"; - public const string CMSCheckPagePermissions = "CMSCheckPagePermissions"; - public const string CMSCheckPublishedFiles = "CMSCheckPublishedFiles"; - public const string CMSClientCacheMinutes = "CMSClientCacheMinutes"; - public const string CMSCMActivitiesEnabled = "CMSCMActivitiesEnabled"; - public const string CMSCMAddingProductToSC = "CMSCMAddingProductToSC"; - public const string CMSCMAddingProductToWL = "CMSCMAddingProductToWL"; - public const string CMSCMBizFormSubmission = "CMSCMBizFormSubmission"; - public const string CMSCMBlogPostComments = "CMSCMBlogPostComments"; - public const string CMSCMBlogPostSubscription = "CMSCMBlogPostSubscription"; - public const string CMSCMClickthroughTracking = "CMSCMClickthroughTracking"; - public const string CMSCMContentRating = "CMSCMContentRating"; - public const string CMSCMCustomActivities = "CMSCMCustomActivities"; - public const string CMSCMCustomTableForm = "CMSCMCustomTableForm"; - public const string CMSCMEmailOpening = "CMSCMEmailOpening"; - public const string CMSCMEnableGeolocation = "CMSCMEnableGeolocation"; - public const string CMSCMEventBooking = "CMSCMEventBooking"; - public const string CMSCMExternalSearch = "CMSCMExternalSearch"; - public const string CMSCMForumPosts = "CMSCMForumPosts"; - public const string CMSCMForumPostSubscription = "CMSCMForumPostSubscription"; - public const string CMSCMGeoCity = "CMSCMGeoCity"; - public const string CMSCMGeoCountry = "CMSCMGeoCountry"; - public const string CMSCMGeoLatitude = "CMSCMGeoLatitude"; - public const string CMSCMGeoLongitude = "CMSCMGeoLongitude"; - public const string CMSCMGeoMetro = "CMSCMGeoMetro"; - public const string CMSCMGeoNewDB = "CMSCMGeoNewDB"; - public const string CMSCMGeoOrganization = "CMSCMGeoOrganization"; - public const string CMSCMGeoPostal = "CMSCMGeoPostal"; - public const string CMSCMGeoState = "CMSCMGeoState"; - public const string CMSCMGeoSuffix = "CMSCMGeoSuffix"; - public const string CMSCMLandingPage = "CMSCMLandingPage"; - public const string CMSCMMessageBoardPosts = "CMSCMMessageBoardPosts"; - public const string CMSCMMessageBoardSubscription = "CMSCMMessageBoardSubscription"; - public const string CMSCMNewsletterSubscribe = "CMSCMNewsletterSubscribe"; - public const string CMSCMNewsletterUnsubscribe = "CMSCMNewsletterUnsubscribe"; - public const string CMSCMNewsletterUnsubscribedFromAll = "CMSCMNewsletterUnsubscribedFromAll"; - public const string CMSCMPageVisits = "CMSCMPageVisits"; - public const string CMSCMPollVoting = "CMSCMPollVoting"; - public const string CMSCMPurchase = "CMSCMPurchase"; - public const string CMSCMPurchasedProduct = "CMSCMPurchasedProduct"; - public const string CMSCMRemovingProductFromSC = "CMSCMRemovingProductFromSC"; - public const string CMSCMSearch = "CMSCMSearch"; - public const string CMSCMStamp = "CMSCMStamp"; - public const string CMSCMUserLogin = "CMSCMUserLogin"; - public const string CMSCMUserRegistration = "CMSCMUserRegistration"; - public const string CMSCodeNamePrefix = "CMSCodeNamePrefix"; - public const string CMSCombineComponentsCSS = "CMSCombineComponentsCSS"; - public const string CMSCombineImagesWithDefaultCulture = "CMSCombineImagesWithDefaultCulture"; - public const string CMSCombineWithDefaultCulture = "CMSCombineWithDefaultCulture"; - public const string CMSConfirmChanges = "CMSConfirmChanges"; - public const string CMSContentImageWatermark = "CMSContentImageWatermark"; - public const string CMSContentPersonalizationEnabled = "CMSContentPersonalizationEnabled"; - public const string CMSControlElement = "CMSControlElement"; - public const string CMSConvertTablesToDivs = "CMSConvertTablesToDivs"; - public const string CMSDataVersion = "CMSDataVersion"; - public const string CMSDBSeparationStartedByServer = "CMSDBSeparationStartedByServer"; - public const string CMSDBVersion = "CMSDBVersion"; - public const string CMSDebugAllCache = "CMSDebugAllCache"; - public const string CMSDebugAllFiles = "CMSDebugAllFiles"; - public const string CMSDebugAllForEverything = "CMSDebugAllForEverything"; - public const string CMSDebugAllHandlers = "CMSDebugAllHandlers"; - public const string CMSDebugAllMacros = "CMSDebugAllMacros"; - public const string CMSDebugAllOutput = "CMSDebugAllOutput"; - public const string CMSDebugAllRequests = "CMSDebugAllRequests"; - public const string CMSDebugAllSecurity = "CMSDebugAllSecurity"; - public const string CMSDebugAllSQLQueries = "CMSDebugAllSQLQueries"; - public const string CMSDebugAllViewState = "CMSDebugAllViewState"; - public const string CMSDebugAllWebFarm = "CMSDebugAllWebFarm"; - public const string CMSDebugAnalytics = "CMSDebugAnalytics"; - public const string CMSDebugAnalyticsLive = "CMSDebugAnalyticsLive"; - public const string CMSDebugAnalyticsLogLength = "CMSDebugAnalyticsLogLength"; - public const string CMSDebugAnalyticsStack = "CMSDebugAnalyticsStack"; - public const string CMSDebugCache = "CMSDebugCache"; - public const string CMSDebugCacheLive = "CMSDebugCacheLive"; - public const string CMSDebugCacheLogLength = "CMSDebugCacheLogLength"; - public const string CMSDebugCacheStack = "CMSDebugCacheStack"; - public const string CMSDebugEverything = "CMSDebugEverything"; - public const string CMSDebugEverythingEverywhere = "CMSDebugEverythingEverywhere"; - public const string CMSDebugEverythingLive = "CMSDebugEverythingLive"; - public const string CMSDebugEverythingLogLength = "CMSDebugEverythingLogLength"; - public const string CMSDebugFiles = "CMSDebugFiles"; - public const string CMSDebugFilesLive = "CMSDebugFilesLive"; - public const string CMSDebugFilesLogLength = "CMSDebugFilesLogLength"; - public const string CMSDebugFilesStack = "CMSDebugFilesStack"; - public const string CMSDebugHandlers = "CMSDebugHandlers"; - public const string CMSDebugHandlersLive = "CMSDebugHandlersLive"; - public const string CMSDebugHandlersLogLength = "CMSDebugHandlersLogLength"; - public const string CMSDebugHandlersStack = "CMSDebugHandlersStack"; - public const string CMSDebugImportExport = "CMSDebugImportExport"; - public const string CMSDebugMacros = "CMSDebugMacros"; - public const string CMSDebugMacrosDetailed = "CMSDebugMacrosDetailed"; - public const string CMSDebugMacrosLive = "CMSDebugMacrosLive"; - public const string CMSDebugMacrosLogLength = "CMSDebugMacrosLogLength"; - public const string CMSDebugMacrosStack = "CMSDebugMacrosStack"; - public const string CMSDebugOutput = "CMSDebugOutput"; - public const string CMSDebugOutputLive = "CMSDebugOutputLive"; - public const string CMSDebugOutputLogLength = "CMSDebugOutputLogLength"; - public const string CMSDebugRequests = "CMSDebugRequests"; - public const string CMSDebugRequestsLive = "CMSDebugRequestsLive"; - public const string CMSDebugRequestsLogLength = "CMSDebugRequestsLogLength"; - public const string CMSDebugRequestsStack = "CMSDebugRequestsStack"; - public const string CMSDebugResources = "CMSDebugResources"; - public const string CMSDebugScheduler = "CMSDebugScheduler"; - public const string CMSDebugSecurity = "CMSDebugSecurity"; - public const string CMSDebugSecurityLive = "CMSDebugSecurityLive"; - public const string CMSDebugSecurityLogLength = "CMSDebugSecurityLogLength"; - public const string CMSDebugSecurityStack = "CMSDebugSecurityStack"; - public const string CMSDebugSQLConnections = "CMSDebugSQLConnections"; - public const string CMSDebugSQLQueries = "CMSDebugSQLQueries"; - public const string CMSDebugSQLQueriesLive = "CMSDebugSQLQueriesLive"; - public const string CMSDebugSQLQueriesLogLength = "CMSDebugSQLQueriesLogLength"; - public const string CMSDebugSQLQueriesStack = "CMSDebugSQLQueriesStack"; - public const string CMSDebugStackForEverything = "CMSDebugStackForEverything"; - public const string CMSDebugViewState = "CMSDebugViewState"; - public const string CMSDebugViewStateLive = "CMSDebugViewStateLive"; - public const string CMSDebugViewStateLogLength = "CMSDebugViewStateLogLength"; - public const string CMSDebugWebFarm = "CMSDebugWebFarm"; - public const string CMSDebugWebFarmLive = "CMSDebugWebFarmLive"; - public const string CMSDebugWebFarmLogLength = "CMSDebugWebFarmLogLength"; - public const string CMSDebugWebFarmStack = "CMSDebugWebFarmStack"; - public const string CMSDefaulPage = "CMSDefaulPage"; - public const string CMSDefaultAliasPath = "CMSDefaultAliasPath"; - public const string CMSDefaultControlForBoolean = "CMSDefaultControlForBoolean"; - public const string CMSDefaultControlForDateTime = "CMSDefaultControlForDateTime"; - public const string CMSDefaultControlForDecimal = "CMSDefaultControlForDecimal"; - public const string CMSDefaultControlForDocAttachments = "CMSDefaultControlForDocAttachments"; - public const string CMSDefaultControlForDocRelationships = "CMSDefaultControlForDocRelationships"; - public const string CMSDefaultControlForFile = "CMSDefaultControlForFile"; - public const string CMSDefaultControlForGUID = "CMSDefaultControlForGUID"; - public const string CMSDefaultControlForInteger = "CMSDefaultControlForInteger"; - public const string CMSDefaultControlForLongText = "CMSDefaultControlForLongText"; - public const string CMSDefaultControlForText = "CMSDefaultControlForText"; - public const string CMSDefaultCookieLevel = "CMSDefaultCookieLevel"; - public const string CMSDefaultCultureCode = "CMSDefaultCultureCode"; - public const string CMSDefaultDeletedNodePath = "CMSDefaultDeletedNodePath"; - public const string CMSDefaultProductImageUrl = "CMSDefaultProductImageUrl"; - public const string CMSDefaultReportConnectionString = "CMSDefaultReportConnectionString"; - public const string CMSDefaultUrlPathPrefix = "CMSDefaultUrlPathPrefix"; - public const string CMSDefaultUserID = "CMSDefaultUserID"; - public const string CMSDeleteInactiveContactsLastXDays = "CMSDeleteInactiveContactsLastXDays"; - public const string CMSDeleteInactiveContactsMethod = "CMSDeleteInactiveContactsMethod"; - public const string CMSDeleteNonActivatedUserAfter = "CMSDeleteNonActivatedUserAfter"; - public const string CMSDenyLoginInterval = "CMSDenyLoginInterval"; - public const string CMSDepartmentTemplatePath = "CMSDepartmentTemplatePath"; - public const string CMSDeploymentMode = "CMSDeploymentMode"; - public const string CMSDeviceProfilesEnable = "CMSDeviceProfilesEnable"; - public const string CMSDisableDebug = "CMSDisableDebug"; - public const string CMSDisplayAccountLockInformation = "CMSDisplayAccountLockInformation"; - public const string CMSDisplayArchivedIcon = "CMSDisplayArchivedIcon"; - public const string CMSDisplayCheckedOutIcon = "CMSDisplayCheckedOutIcon"; - public const string CMSDisplayLinkedIcon = "CMSDisplayLinkedIcon"; - public const string CMSDisplayNotPublishedIcon = "CMSDisplayNotPublishedIcon"; - public const string CMSDisplayNotTranslatedIcon = "CMSDisplayNotTranslatedIcon"; - public const string CMSDisplayPublishedIcon = "CMSDisplayPublishedIcon"; - public const string CMSDisplayRedirectedIcon = "CMSDisplayRedirectedIcon"; - public const string CMSDisplayVersionNotPublishedIcon = "CMSDisplayVersionNotPublishedIcon"; - public const string CMSEmailBatchSize = "CMSEmailBatchSize"; - public const string CMSEmailEncoding = "CMSEmailEncoding"; - public const string CMSEmailFormat = "CMSEmailFormat"; - public const string CMSEmailQueueEnabled = "CMSEmailQueueEnabled"; - public const string CMSEmailsEnabled = "CMSEmailsEnabled"; - public const string CMSEmailTranslationFrom = "CMSEmailTranslationFrom"; - public const string CMSEmailTranslationRecipients = "CMSEmailTranslationRecipients"; - public const string CMSEnableCI = "CMSEnableCI"; - public const string CMSEnableCodeEditSiteAdministrators = "CMSEnableCodeEditSiteAdministrators"; - public const string CMSEnableDefaultAvatars = "CMSEnableDefaultAvatars"; - public const string CMSEnableFacebookConnect = "CMSEnableFacebookConnect"; - public const string CMSEnableHealthMonitoring = "CMSEnableHealthMonitoring"; - public const string CMSEnableLinkedIn = "CMSEnableLinkedIn"; - public const string CMSEnableObjectsVersioning = "CMSEnableObjectsVersioning"; - public const string CMSEnableOnlineMarketing = "CMSEnableOnlineMarketing"; - public const string CMSEnableOpenID = "CMSEnableOpenID"; - public const string CMSEnableOutputCache = "CMSEnableOutputCache"; - public const string CMSEnablePartialCache = "CMSEnablePartialCache"; - public const string CMSEnableSiteCounters = "CMSEnableSiteCounters"; - public const string CMSEnableTranlsationRESTService = "CMSEnableTranlsationRESTService"; - public const string CMSEnableTranslations = "CMSEnableTranslations"; - public const string CMSEnableUserCounts = "CMSEnableUserCounts"; - public const string CMSEnableVersioningCMSAlternativeForm = "CMSEnableVersioningCMSAlternativeForm"; - public const string CMSEnableVersioningCMSCssStylesheet = "CMSEnableVersioningCMSCssStylesheet"; - public const string CMSEnableVersioningCMSCustomTable = "CMSEnableVersioningCMSCustomTable"; - public const string CMSEnableVersioningCMSDocumentType = "CMSEnableVersioningCMSDocumentType"; - public const string CMSEnableVersioningCMSEmailTemplate = "CMSEnableVersioningCMSEmailTemplate"; - public const string CMSEnableVersioningCMSForm = "CMSEnableVersioningCMSForm"; - public const string CMSEnableVersioningCMSLayout = "CMSEnableVersioningCMSLayout"; - public const string CMSEnableVersioningCMSPageTemplate = "CMSEnableVersioningCMSPageTemplate"; - public const string CMSEnableVersioningCMSQuery = "CMSEnableVersioningCMSQuery"; - public const string CMSEnableVersioningCMSTemplateDeviceLayout = "CMSEnableVersioningCMSTemplateDeviceLayout"; - public const string CMSEnableVersioningCMSTransformation = "CMSEnableVersioningCMSTransformation"; - public const string CMSEnableVersioningCMSUIElement = "CMSEnableVersioningCMSUIElement"; - public const string CMSEnableVersioningCMSWebPartContainer = "CMSEnableVersioningCMSWebPartContainer"; - public const string CMSEnableVersioningCMSWebPartLayout = "CMSEnableVersioningCMSWebPartLayout"; - public const string CMSEnableVersioningCMSWorkflow = "CMSEnableVersioningCMSWorkflow"; - public const string CMSEnableVersioningMAAutomationProcess = "CMSEnableVersioningMAAutomationProcess"; - public const string CMSEnableVersioningMediaFile = "CMSEnableVersioningMediaFile"; - public const string CMSEnableVersioningNewsletterEmailTemplate = "CMSEnableVersioningNewsletterEmailTemplate"; - public const string CMSEnableVersioningNewsletterEmailWidget = "CMSEnableVersioningNewsletterEmailWidget"; - public const string CMSEnableVersioningNewsletterIssue = "CMSEnableVersioningNewsletterIssue"; - public const string CMSEnableVersioningReportingReport = "CMSEnableVersioningReportingReport"; - public const string CMSEnableVersioningReportingReportGraph = "CMSEnableVersioningReportingReportGraph"; - public const string CMSEnableVersioningReportingReportTable = "CMSEnableVersioningReportingReportTable"; - public const string CMSEnableVersioningReportingReportValue = "CMSEnableVersioningReportingReportValue"; - public const string CMSEnableWebDAV = "CMSEnableWebDAV"; - public const string CMSEnableWindowsLiveID = "CMSEnableWindowsLiveID"; - public const string CMSEventManagerInvitationFrom = "CMSEventManagerInvitationFrom"; - public const string CMSEventManagerInvitationSubject = "CMSEventManagerInvitationSubject"; - public const string CMSEventManagerSenderName = "CMSEventManagerSenderName"; - public const string CMSExcludedAttributesFilterURLs = "CMSExcludedAttributesFilterURLs"; - public const string CMSExcludedFormFilterURLs = "CMSExcludedFormFilterURLs"; - public const string CMSExcludedHTML5FilterURLs = "CMSExcludedHTML5FilterURLs"; - public const string CMSExcludedJavascriptFilterURLs = "CMSExcludedJavascriptFilterURLs"; - public const string CMSExcludedLowercaseFilterURLs = "CMSExcludedLowercaseFilterURLs"; - public const string CMSExcludeDocumentsFromSearch = "CMSExcludeDocumentsFromSearch"; - public const string CMSExcludeDocumentTypesFromSearch = "CMSExcludeDocumentTypesFromSearch"; - public const string CMSExcludedResolveFilterURLs = "CMSExcludedResolveFilterURLs"; - public const string CMSExcludedSelfcloseFilterURLs = "CMSExcludedSelfcloseFilterURLs"; - public const string CMSExcludedURLs = "CMSExcludedURLs"; - public const string CMSExcludedXHTMLFilterURLs = "CMSExcludedXHTMLFilterURLs"; - public const string CMSExportLogObjectChanges = "CMSExportLogObjectChanges"; - public const string CMSFacebookApplicationSecret = "CMSFacebookApplicationSecret"; - public const string CMSFacebookConnectApiKey = "CMSFacebookConnectApiKey"; - public const string CMSFacebookMapUserProfile = "CMSFacebookMapUserProfile"; - public const string CMSFacebookRoles = "CMSFacebookRoles"; - public const string CMSFacebookUserMapping = "CMSFacebookUserMapping"; - public const string CMSFaviconPath = "CMSFaviconPath"; - public const string CMSFilesFolder = "CMSFilesFolder"; - public const string CMSFilesFriendlyURLExtension = "CMSFilesFriendlyURLExtension"; - public const string CMSFilesLocationType = "CMSFilesLocationType"; - public const string CMSFileSystemOutputCacheMinutes = "CMSFileSystemOutputCacheMinutes"; - public const string CMSFloodInterval = "CMSFloodInterval"; - public const string CMSFloodProtectionEnabled = "CMSFloodProtectionEnabled"; - public const string CMSForbiddenCharactersReplacement = "CMSForbiddenCharactersReplacement"; - public const string CMSForbiddenURLCharacters = "CMSForbiddenURLCharacters"; - public const string CMSForumAttachmentExtensions = "CMSForumAttachmentExtensions"; - public const string CMSForumBaseUrl = "CMSForumBaseUrl"; - public const string CMSForumEnableOptIn = "CMSForumEnableOptIn"; - public const string CMSForumEnableOptInConfirmation = "CMSForumEnableOptInConfirmation"; - public const string CMSForumMaxPostNode = "CMSForumMaxPostNode"; - public const string CMSForumOptInApprovalPath = "CMSForumOptInApprovalPath"; - public const string CMSForumOptInInterval = "CMSForumOptInInterval"; - public const string CMSForumUnsubscriptionUrl = "CMSForumUnsubscriptionUrl"; - public const string CMSFriendlyURLExtension = "CMSFriendlyURLExtension"; - public const string CMSGenerateNewsletters = "CMSGenerateNewsletters"; - public const string CMSGenerateThumbnails = "CMSGenerateThumbnails"; - public const string CMSGoogleSitemapURL = "CMSGoogleSitemapURL"; - public const string CMSGoogleTranslateAPIKey = "CMSGoogleTranslateAPIKey"; - public const string CMSGravatarDefaultImage = "CMSGravatarDefaultImage"; - public const string CMSGravatarRating = "CMSGravatarRating"; - public const string CMSGroupAvatarHeight = "CMSGroupAvatarHeight"; - public const string CMSGroupAvatarMaxSideSize = "CMSGroupAvatarMaxSideSize"; - public const string CMSGroupAvatarWidth = "CMSGroupAvatarWidth"; - public const string CMSGroupManagementPath = "CMSGroupManagementPath"; - public const string CMSGroupProfilePath = "CMSGroupProfilePath"; - public const string CMSGroupsSecurityAccessPath = "CMSGroupsSecurityAccessPath"; - public const string CMSGroupTemplatePath = "CMSGroupTemplatePath"; - public const string CMSHideUnavailableUserInterface = "CMSHideUnavailableUserInterface"; - public const string CMSHotfixDataVersion = "CMSHotfixDataVersion"; - public const string CMSHotfixProcedureInProgress = "CMSHotfixProcedureInProgress"; - public const string CMSHotfixVersion = "CMSHotfixVersion"; - public const string CMSImageWatermark = "CMSImageWatermark"; - public const string CMSImageWatermarkPosition = "CMSImageWatermarkPosition"; - public const string CMSIncludeTaxInPrices = "CMSIncludeTaxInPrices"; - public const string CMSIndentOutputHtml = "CMSIndentOutputHtml"; - public const string CMSIntegrationEnabled = "CMSIntegrationEnabled"; - public const string CMSIntegrationLogExternal = "CMSIntegrationLogExternal"; - public const string CMSIntegrationLogInternal = "CMSIntegrationLogInternal"; - public const string CMSIntegrationProcessExternal = "CMSIntegrationProcessExternal"; - public const string CMSIntegrationProcessInternal = "CMSIntegrationProcessInternal"; - public const string CMSInvitationAcceptationPath = "CMSInvitationAcceptationPath"; - public const string CMSInvitationValidity = "CMSInvitationValidity"; - public const string CMSKeepChangedDocumentAccesible = "CMSKeepChangedDocumentAccesible"; - public const string CMSKeepNewCheckedOut = "CMSKeepNewCheckedOut"; - public const string CMSLayoutMappingEnable = "CMSLayoutMappingEnable"; - public const string CMSLinkedInAccessToken = "CMSLinkedInAccessToken"; - public const string CMSLinkedInApiKey = "CMSLinkedInApiKey"; - public const string CMSLinkedInApplicationSecret = "CMSLinkedInApplicationSecret"; - public const string CMSLinkedInRoles = "CMSLinkedInRoles"; - public const string CMSLinkedInSignInPermissionScope = "CMSLinkedInSignInPermissionScope"; - public const string CMSLiveIDRequiredUserDataPage = "CMSLiveIDRequiredUserDataPage"; - public const string CMSLiveIDRoles = "CMSLiveIDRoles"; - public const string CMSLogAnalytics = "CMSLogAnalytics"; - public const string CMSLogCache = "CMSLogCache"; - public const string CMSLogEverythingToFile = "CMSLogEverythingToFile"; - public const string CMSLogFiles = "CMSLogFiles"; - public const string CMSLogHandlers = "CMSLogHandlers"; - public const string CMSLogMacros = "CMSLogMacros"; - public const string CMSLogMetadata = "CMSLogMetadata"; - public const string CMSLogOutput = "CMSLogOutput"; - public const string CMSLogPageNotFoundException = "CMSLogPageNotFoundException"; - public const string CMSLogRequests = "CMSLogRequests"; - public const string CMSLogSecurity = "CMSLogSecurity"; - public const string CMSLogSize = "CMSLogSize"; - public const string CMSLogSQLQueries = "CMSLogSQLQueries"; - public const string CMSLogToDatabase = "CMSLogToDatabase"; - public const string CMSLogToFileSystem = "CMSLogToFileSystem"; - public const string CMSLogToTrace = "CMSLogToTrace"; - public const string CMSLogViewState = "CMSLogViewState"; - public const string CMSLogWebFarm = "CMSLogWebFarm"; - public const string CMSManualTranslationDeleteSuccessfulSubmissions = "CMSManualTranslationDeleteSuccessfulSubmissions"; - public const string CMSManualTranslationExportFolder = "CMSManualTranslationExportFolder"; - public const string CMSManualTranslationImportFolder = "CMSManualTranslationImportFolder"; - public const string CMSMarkShoppingCartAsAbandonedPeriod = "CMSMarkShoppingCartAsAbandonedPeriod"; - public const string CMSMaxCacheFileSize = "CMSMaxCacheFileSize"; - public const string CMSMaximumInvalidLogonAttempts = "CMSMaximumInvalidLogonAttempts"; - public const string CMSMaxTreeNodes = "CMSMaxTreeNodes"; - public const string CMSMaxUITreeNodes = "CMSMaxUITreeNodes"; - public const string CMSMediaFileAllowedExtensions = "CMSMediaFileAllowedExtensions"; - public const string CMSMediaFileHiddenFolder = "CMSMediaFileHiddenFolder"; - public const string CMSMediaFilePreviewSuffix = "CMSMediaFilePreviewSuffix"; - public const string CMSMediaImageWatermark = "CMSMediaImageWatermark"; - public const string CMSMediaLibrariesFolder = "CMSMediaLibrariesFolder"; - public const string CMSMediaLibraryMaxSubFolders = "CMSMediaLibraryMaxSubFolders"; - public const string CMSMediaUsePermanentURLs = "CMSMediaUsePermanentURLs"; - public const string CMSMemberManagementPath = "CMSMemberManagementPath"; - public const string CMSMemberProfilePath = "CMSMemberProfilePath"; - public const string CMSMembershipReminder = "CMSMembershipReminder"; - public const string CMSMetaImageWatermark = "CMSMetaImageWatermark"; - public const string CMSMFDisplayInitToken = "CMSMFDisplayInitToken"; - public const string CMSMFEnabled = "CMSMFEnabled"; - public const string CMSMFRequired = "CMSMFRequired"; - public const string CMSMinWatermarkImageHeight = "CMSMinWatermarkImageHeight"; - public const string CMSMinWatermarkImageWidth = "CMSMinWatermarkImageWidth"; - public const string CMSModuleUsageTrackingEnabled = "CMSModuleUsageTrackingEnabled"; - public const string CMSModuleUsageTrackingIdentity = "CMSModuleUsageTrackingIdentity"; - public const string CMSMonitorBouncedEmails = "CMSMonitorBouncedEmails"; - public const string CMSMoveViewStateToEnd = "CMSMoveViewStateToEnd"; - public const string CMSMSTranslatorTextAPISubscriptionKey = "CMSMSTranslatorTextAPISubscriptionKey"; - public const string CMSMVTEnabled = "CMSMVTEnabled"; - public const string CMSMyAccountURL = "CMSMyAccountURL"; - public const string CMSNewDocumentOrder = "CMSNewDocumentOrder"; - public const string CMSNewsletterUnsubscriptionURL = "CMSNewsletterUnsubscriptionURL"; - public const string CMSNewsletterUseExternalService = "CMSNewsletterUseExternalService"; - public const string CMSNoreplyEmailAddress = "CMSNoreplyEmailAddress"; - public const string CMSObjectVersionHistoryLength = "CMSObjectVersionHistoryLength"; - public const string CMSObjectVersionHistoryMajorVersionsLength = "CMSObjectVersionHistoryMajorVersionsLength"; - public const string CMSObjectVersionHistoryPromoteToMajorTimeInterval = "CMSObjectVersionHistoryPromoteToMajorTimeInterval"; - public const string CMSObjectVersionHistoryUseLastVersionInterval = "CMSObjectVersionHistoryUseLastVersionInterval"; - public const string CMSOnSiteEditButton = "CMSOnSiteEditButton"; - public const string CMSOpenIDRoles = "CMSOpenIDRoles"; - public const string CMSOptInApprovalURL = "CMSOptInApprovalURL"; - public const string CMSOptInInterval = "CMSOptInInterval"; - public const string CMSOutputCacheItems = "CMSOutputCacheItems"; - public const string CMSPageDescriptionPrefix = "CMSPageDescriptionPrefix"; - public const string CMSPageKeyWordsPrefix = "CMSPageKeyWordsPrefix"; - public const string CMSPageNotFoundForNonPublished = "CMSPageNotFoundForNonPublished"; - public const string CMSPageNotFoundUrl = "CMSPageNotFoundUrl"; - public const string CMSPageTitleFormat = "CMSPageTitleFormat"; - public const string CMSPageTitlePrefix = "CMSPageTitlePrefix"; - public const string CMSPartialCacheItems = "CMSPartialCacheItems"; - public const string CMSPasswordExpiration = "CMSPasswordExpiration"; - public const string CMSPasswordExpirationBehaviour = "CMSPasswordExpirationBehaviour"; - public const string CMSPasswordExpirationEmail = "CMSPasswordExpirationEmail"; - public const string CMSPasswordExpirationPeriod = "CMSPasswordExpirationPeriod"; - public const string CMSPasswordExpirationWarningPeriod = "CMSPasswordExpirationWarningPeriod"; - public const string CMSPasswordFormat = "CMSPasswordFormat"; - public const string CMSPaypalCancelReturnUrl = "CMSPaypalCancelReturnUrl"; - public const string CMSPayPalCredentialsAccountType = "CMSPayPalCredentialsAccountType"; - public const string CMSPayPalCredentialsClientId = "CMSPayPalCredentialsClientId"; - public const string CMSPayPalCredentialsClientSecret = "CMSPayPalCredentialsClientSecret"; - public const string CMSPayPalReturnUrl = "CMSPayPalReturnUrl"; - public const string CMSPayPalTransactionType = "CMSPayPalTransactionType"; - public const string CMSPersonalizeUserInterface = "CMSPersonalizeUserInterface"; - public const string CMSPolicyForcePolicyOnLogon = "CMSPolicyForcePolicyOnLogon"; - public const string CMSPolicyMinimalLength = "CMSPolicyMinimalLength"; - public const string CMSPolicyNumberOfNonAlphaNumChars = "CMSPolicyNumberOfNonAlphaNumChars"; - public const string CMSPolicyRegularExpression = "CMSPolicyRegularExpression"; - public const string CMSPolicyViolationMessage = "CMSPolicyViolationMessage"; - public const string CMSPollsAllowGlobal = "CMSPollsAllowGlobal"; - public const string CMSPOP3AuthenticationMethod = "CMSPOP3AuthenticationMethod"; - public const string CMSPOP3Password = "CMSPOP3Password"; - public const string CMSPOP3ServerName = "CMSPOP3ServerName"; - public const string CMSPOP3ServerPort = "CMSPOP3ServerPort"; - public const string CMSPOP3UserName = "CMSPOP3UserName"; - public const string CMSPOP3UseSSL = "CMSPOP3UseSSL"; - public const string CMSPriceRounding = "CMSPriceRounding"; - public const string CMSProcessDomainPrefix = "CMSProcessDomainPrefix"; - public const string CMSReCaptchaPrivateKey = "CMSReCaptchaPrivateKey"; - public const string CMSReCaptchaPublicKey = "CMSReCaptchaPublicKey"; - public const string CMSRedirectAliasesToMainURL = "CMSRedirectAliasesToMainURL"; - public const string CMSRedirectFilesToDisk = "CMSRedirectFilesToDisk"; - public const string CMSRedirectInvalidCasePages = "CMSRedirectInvalidCasePages"; - public const string CMSRedirectToMainExtension = "CMSRedirectToMainExtension"; - public const string CMSRegistrationAdministratorApproval = "CMSRegistrationAdministratorApproval"; - public const string CMSRegistrationApprovalPath = "CMSRegistrationApprovalPath"; - public const string CMSRegistrationEmailConfirmation = "CMSRegistrationEmailConfirmation"; - public const string CMSRememberUniGridState = "CMSRememberUniGridState"; - public const string CMSRequiredLinkedInPage = "CMSRequiredLinkedInPage"; - public const string CMSRequiredOpenIDPage = "CMSRequiredOpenIDPage"; - public const string CMSReservedUserNames = "CMSReservedUserNames"; - public const string CMSResetPasswordInterval = "CMSResetPasswordInterval"; - public const string CMSResetPasswordURL = "CMSResetPasswordURL"; - public const string CMSResizeImagesToDevice = "CMSResizeImagesToDevice"; - public const string CMSResolveMacrosInCSS = "CMSResolveMacrosInCSS"; - public const string CMSResourceCompressionEnabled = "CMSResourceCompressionEnabled"; - public const string CMSRESTAllowedDocTypes = "CMSRESTAllowedDocTypes"; - public const string CMSRESTAllowedObjectTypes = "CMSRESTAllowedObjectTypes"; - public const string CMSRESTAllowSensitiveFields = "CMSRESTAllowSensitiveFields"; - public const string CMSRESTDefaultEncoding = "CMSRESTDefaultEncoding"; - public const string CMSRESTDocumentsReadOnly = "CMSRESTDocumentsReadOnly"; - public const string CMSRESTDocumentsSecurityCheck = "CMSRESTDocumentsSecurityCheck"; - public const string CMSRESTGenerateHash = "CMSRESTGenerateHash"; - public const string CMSRESTObjectsReadOnly = "CMSRESTObjectsReadOnly"; - public const string CMSRestoreObjects = "CMSRestoreObjects"; - public const string CMSRESTServiceEnabled = "CMSRESTServiceEnabled"; - public const string CMSRESTServiceTypeEnabled = "CMSRESTServiceTypeEnabled"; - public const string CMSRevalidateClientCache = "CMSRevalidateClientCache"; - public const string CMSRobotsPath = "CMSRobotsPath"; - public const string CMSSalesForceCredentials = "CMSSalesForceCredentials"; - public const string CMSSalesForceLeadReplicationBatchSize = "CMSSalesForceLeadReplicationBatchSize"; - public const string CMSSalesForceLeadReplicationDefaultCompanyName = "CMSSalesForceLeadReplicationDefaultCompanyName"; - public const string CMSSalesForceLeadReplicationEnabled = "CMSSalesForceLeadReplicationEnabled"; - public const string CMSSalesForceLeadReplicationLeadDescription = "CMSSalesForceLeadReplicationLeadDescription"; - public const string CMSSalesForceLeadReplicationMapping = "CMSSalesForceLeadReplicationMapping"; - public const string CMSSalesForceLeadReplicationMappingDateTime = "CMSSalesForceLeadReplicationMappingDateTime"; - public const string CMSSalesForceLeadReplicationMinScoreValue = "CMSSalesForceLeadReplicationMinScoreValue"; - public const string CMSSalesForceLeadReplicationScoreID = "CMSSalesForceLeadReplicationScoreID"; - public const string CMSSalesForceLeadReplicationUpdateEnabled = "CMSSalesForceLeadReplicationUpdateEnabled"; - public const string CMSSchedulerInterval = "CMSSchedulerInterval"; - public const string CMSSchedulerServiceInterval = "CMSSchedulerServiceInterval"; - public const string CMSSchedulerTasksEnabled = "CMSSchedulerTasksEnabled"; - public const string CMSSchedulerUseExternalService = "CMSSchedulerUseExternalService"; - public const string CMSScreenLockEnabled = "CMSScreenLockEnabled"; - public const string CMSScreenLockInterval = "CMSScreenLockInterval"; - public const string CMSScreenLockWarningInterval = "CMSScreenLockWarningInterval"; - public const string CMSScriptMinificationEnabled = "CMSScriptMinificationEnabled"; - public const string CMSSearchAllowedFileTypes = "CMSSearchAllowedFileTypes"; - public const string CMSSearchIndexingEnabled = "CMSSearchIndexingEnabled"; - public const string CMSSecuredAreasLogonPage = "CMSSecuredAreasLogonPage"; - public const string CMSSendAccountUnlockEmail = "CMSSendAccountUnlockEmail"; - public const string CMSSendBlogEmailsFrom = "CMSSendBlogEmailsFrom"; - public const string CMSSendBoardEmailsFrom = "CMSSendBoardEmailsFrom"; - public const string CMSSendEmailNotificationsFrom = "CMSSendEmailNotificationsFrom"; - public const string CMSSendErrorNotificationTo = "CMSSendErrorNotificationTo"; - public const string CMSSendForumEmailsFrom = "CMSSendForumEmailsFrom"; - public const string CMSSendPasswordEmailsFrom = "CMSSendPasswordEmailsFrom"; - public const string CMSSendPasswordResetConfirmation = "CMSSendPasswordResetConfirmation"; - public const string CMSSendWorkflowEmails = "CMSSendWorkflowEmails"; - public const string CMSSendWorkflowEmailsFrom = "CMSSendWorkflowEmailsFrom"; - public const string CMSServerTimeZone = "CMSServerTimeZone"; - public const string CMSServiceHealthMonitoringInterval = "CMSServiceHealthMonitoringInterval"; - public const string CMSSessionManagerSchedulerInterval = "CMSSessionManagerSchedulerInterval"; - public const string CMSSessionUseDBRepository = "CMSSessionUseDBRepository"; - public const string CMSSharePointCache = "CMSSharePointCache"; - public const string CMSSharePointCacheSizeLimit = "CMSSharePointCacheSizeLimit"; - public const string CMSShoppingCartExpirationPeriod = "CMSShoppingCartExpirationPeriod"; - public const string CMSShoppingCartURL = "CMSShoppingCartURL"; - public const string CMSSitemapPath = "CMSSitemapPath"; - public const string CMSSiteSharedAccounts = "CMSSiteSharedAccounts"; - public const string CMSSiteTimeZone = "CMSSiteTimeZone"; - public const string CMSSMTPServer = "CMSSMTPServer"; - public const string CMSSMTPServerPassword = "CMSSMTPServerPassword"; - public const string CMSSMTPServerTip = "CMSSMTPServerTip"; - public const string CMSSMTPServerUser = "CMSSMTPServerUser"; - public const string CMSSocialMarketingURLShorteningFacebook = "CMSSocialMarketingURLShorteningFacebook"; - public const string CMSSocialMarketingURLShorteningLinkedIn = "CMSSocialMarketingURLShorteningLinkedIn"; - public const string CMSSocialMarketingURLShorteningTwitter = "CMSSocialMarketingURLShorteningTwitter"; - public const string CMSStagingLogChanges = "CMSStagingLogChanges"; - public const string CMSStagingLogDataChanges = "CMSStagingLogDataChanges"; - public const string CMSStagingLogObjectChanges = "CMSStagingLogObjectChanges"; - public const string CMSStagingLogStagingChanges = "CMSStagingLogStagingChanges"; - public const string CMSStagingServiceAuthentication = "CMSStagingServiceAuthentication"; - public const string CMSStagingServiceEnabled = "CMSStagingServiceEnabled"; - public const string CMSStagingServicePassword = "CMSStagingServicePassword"; - public const string CMSStagingServiceUsername = "CMSStagingServiceUsername"; - public const string CMSStagingServiceX509ClientBase64KeyId = "CMSStagingServiceX509ClientBase64KeyId"; - public const string CMSStagingServiceX509ServerBase64KeyId = "CMSStagingServiceX509ServerBase64KeyId"; - public const string CMSStoreAddToShoppingCartConversionName = "CMSStoreAddToShoppingCartConversionName"; - public const string CMSStoreAddToShoppingCartConversionValue = "CMSStoreAddToShoppingCartConversionValue"; - public const string CMSStoreAllowAnonymousCustomers = "CMSStoreAllowAnonymousCustomers"; - public const string CMSStoreAllowGlobalDepartments = "CMSStoreAllowGlobalDepartments"; - public const string CMSStoreAllowGlobalManufacturers = "CMSStoreAllowGlobalManufacturers"; - public const string CMSStoreAllowGlobalPaymentMethods = "CMSStoreAllowGlobalPaymentMethods"; - public const string CMSStoreAllowGlobalProductOptions = "CMSStoreAllowGlobalProductOptions"; - public const string CMSStoreAllowGlobalProducts = "CMSStoreAllowGlobalProducts"; - public const string CMSStoreAllowGlobalSuppliers = "CMSStoreAllowGlobalSuppliers"; - public const string CMSStoreAllowProductsWithoutDocuments = "CMSStoreAllowProductsWithoutDocuments"; - public const string CMSStoreAltFormLayoutsInFS = "CMSStoreAltFormLayoutsInFS"; - public const string CMSStoreApplyTaxesBasedOn = "CMSStoreApplyTaxesBasedOn"; - public const string CMSStoreAutoRegisterCustomer = "CMSStoreAutoRegisterCustomer"; - public const string CMSStoreAutoRegistrationEmailTemplate = "CMSStoreAutoRegistrationEmailTemplate"; - public const string CMSStoreCheckoutProcess = "CMSStoreCheckoutProcess"; - public const string CMSStoreCSSStylesheetsInFS = "CMSStoreCSSStylesheetsInFS"; - public const string CMSStoreDefaultCountryName = "CMSStoreDefaultCountryName"; - public const string CMSStoreDisplayProductsInSectionsTree = "CMSStoreDisplayProductsInSectionsTree"; - public const string CMSStoreEProductsReminder = "CMSStoreEProductsReminder"; - public const string CMSStoreFormLayoutsInFS = "CMSStoreFormLayoutsInFS"; - public const string CMSStoreInvoiceNumberPattern = "CMSStoreInvoiceNumberPattern"; - public const string CMSStoreInvoiceTemplate = "CMSStoreInvoiceTemplate"; - public const string CMSStoreLayoutsInFS = "CMSStoreLayoutsInFS"; - public const string CMSStoreMassUnit = "CMSStoreMassUnit"; - public const string CMSStoreNewProductStatus = "CMSStoreNewProductStatus"; - public const string CMSStoreOrderConversionName = "CMSStoreOrderConversionName"; - public const string CMSStoreOrderConversionValue = "CMSStoreOrderConversionValue"; - public const string CMSStorePageTemplatesInFS = "CMSStorePageTemplatesInFS"; - public const string CMSStoreProductsAreNewFor = "CMSStoreProductsAreNewFor"; - public const string CMSStoreProductsStartingPath = "CMSStoreProductsStartingPath"; - public const string CMSStoreProductsTree = "CMSStoreProductsTree"; - public const string CMSStoreRedirectToShoppingCart = "CMSStoreRedirectToShoppingCart"; - public const string CMSStoreRegistrationConversionName = "CMSStoreRegistrationConversionName"; - public const string CMSStoreRegistrationConversionValue = "CMSStoreRegistrationConversionValue"; - public const string CMSStoreRelatedProductsRelationshipName = "CMSStoreRelatedProductsRelationshipName"; - public const string CMSStoreRequireCompanyInfo = "CMSStoreRequireCompanyInfo"; - public const string CMSStoreSendEmailsFrom = "CMSStoreSendEmailsFrom"; - public const string CMSStoreSendEmailsTo = "CMSStoreSendEmailsTo"; - public const string CMSStoreSendOrderNotification = "CMSStoreSendOrderNotification"; - public const string CMSStoreSendPaymentNotification = "CMSStoreSendPaymentNotification"; - public const string CMSStoreShowOrganizationID = "CMSStoreShowOrganizationID"; - public const string CMSStoreShowTaxRegistrationID = "CMSStoreShowTaxRegistrationID"; - public const string CMSStoreTransformationsInFS = "CMSStoreTransformationsInFS"; - public const string CMSStoreUseCustomerCultureForEmails = "CMSStoreUseCustomerCultureForEmails"; - public const string CMSStoreUseExtraCompanyAddress = "CMSStoreUseExtraCompanyAddress"; - public const string CMSStoreUseGlobalCredit = "CMSStoreUseGlobalCredit"; - public const string CMSStoreUseGlobalCurrencies = "CMSStoreUseGlobalCurrencies"; - public const string CMSStoreUseGlobalExchangeRates = "CMSStoreUseGlobalExchangeRates"; - public const string CMSStoreUseGlobalInternalStatus = "CMSStoreUseGlobalInternalStatus"; - public const string CMSStoreUseGlobalInvoice = "CMSStoreUseGlobalInvoice"; - public const string CMSStoreUseGlobalOrderStatus = "CMSStoreUseGlobalOrderStatus"; - public const string CMSStoreUseGlobalPublicStatus = "CMSStoreUseGlobalPublicStatus"; - public const string CMSStoreUseGlobalTaxClasses = "CMSStoreUseGlobalTaxClasses"; - public const string CMSStoreWebpartContainersInFS = "CMSStoreWebpartContainersInFS"; - public const string CMSStoreWebPartLayoutsInFS = "CMSStoreWebPartLayoutsInFS"; - public const string CMSStoreWeightFormattingString = "CMSStoreWeightFormattingString"; - public const string CMSStrandsAPIID = "CMSStrandsAPIID"; - public const string CMSStrandsAutomaticCatalogUploadEnabled = "CMSStrandsAutomaticCatalogUploadEnabled"; - public const string CMSStrandsAutomaticUploadFrequency = "CMSStrandsAutomaticUploadFrequency"; - public const string CMSStrandsCatalogFeedPassword = "CMSStrandsCatalogFeedPassword"; - public const string CMSStrandsCatalogFeedUsername = "CMSStrandsCatalogFeedUsername"; - public const string CMSStrandsCatalogTransformation = "CMSStrandsCatalogTransformation"; - public const string CMSStrandsCatalogWhereCondition = "CMSStrandsCatalogWhereCondition"; - public const string CMSStrandsDocumentTypes = "CMSStrandsDocumentTypes"; - public const string CMSStrandsPath = "CMSStrandsPath"; - public const string CMSStrandsValidationToken = "CMSStrandsValidationToken"; - public const string CMSStylesheetMinificationEnabled = "CMSStylesheetMinificationEnabled"; - public const string CMSTimeZonesEnable = "CMSTimeZonesEnable"; - public const string CMSTrackAverageTimeOnPage = "CMSTrackAverageTimeOnPage"; - public const string CMSTrackExitPages = "CMSTrackExitPages"; - public const string CMSTrackLandingPages = "CMSTrackLandingPages"; - public const string CMSTrackMobileDevices = "CMSTrackMobileDevices"; - public const string CMSTrackOnSiteKeywords = "CMSTrackOnSiteKeywords"; - public const string CMSTrackReferringSitesDirect = "CMSTrackReferringSitesDirect"; - public const string CMSTrackReferringSitesLocal = "CMSTrackReferringSitesLocal"; - public const string CMSTrackReferringSitesReferring = "CMSTrackReferringSitesReferring"; - public const string CMSTrackSearchCrawlers = "CMSTrackSearchCrawlers"; - public const string CMSTrackSearchEngines = "CMSTrackSearchEngines"; - public const string CMSTrackSearchKeywords = "CMSTrackSearchKeywords"; - public const string CMSTranslateFileTypes = "CMSTranslateFileTypes"; - public const string CMSTranslateWebpartProperties = "CMSTranslateWebpartProperties"; - public const string CMSTranslationsAutoImport = "CMSTranslationsAutoImport"; - public const string CMSTranslationsComPassword = "CMSTranslationsComPassword"; - public const string CMSTranslationsComProjectCode = "CMSTranslationsComProjectCode"; - public const string CMSTranslationsComURL = "CMSTranslationsComURL"; - public const string CMSTranslationsComUserName = "CMSTranslationsComUserName"; - public const string CMSTranslationsEncoding = "CMSTranslationsEncoding"; - public const string CMSTranslationsLastStatusCheck = "CMSTranslationsLastStatusCheck"; - public const string CMSUpdateDocumentAlias = "CMSUpdateDocumentAlias"; - public const string CMSUploadExtensions = "CMSUploadExtensions"; - public const string CMSUseAutomaticVersionNumbering = "CMSUseAutomaticVersionNumbering"; - public const string CMSUseBizFormsSiteFolder = "CMSUseBizFormsSiteFolder"; - public const string CMSUseCheckinCheckout = "CMSUseCheckinCheckout"; - public const string CMSUseDomainForCulture = "CMSUseDomainForCulture"; - public const string CMSUseEventLogListener = "CMSUseEventLogListener"; - public const string CMSUseExternalService = "CMSUseExternalService"; - public const string CMSUseFilesSiteFolder = "CMSUseFilesSiteFolder"; - public const string CMSUseLangPrefixForUrls = "CMSUseLangPrefixForUrls"; - public const string CMSUseMediaLibrariesSiteFolder = "CMSUseMediaLibrariesSiteFolder"; - public const string CMSUseNamePathForUrlPath = "CMSUseNamePathForUrlPath"; - public const string CMSUseNoFollowForUsersLinks = "CMSUseNoFollowForUsersLinks"; - public const string CMSUseObjectCheckinCheckout = "CMSUseObjectCheckinCheckout"; - public const string CMSUseParentGroupIDForNewDocuments = "CMSUseParentGroupIDForNewDocuments"; - public const string CMSUsePasswordPolicy = "CMSUsePasswordPolicy"; - public const string CMSUsePermanentRedirect = "CMSUsePermanentRedirect"; - public const string CMSUsePermanentURLs = "CMSUsePermanentURLs"; - public const string CMSUserAccountUnlockPath = "CMSUserAccountUnlockPath"; - public const string CMSUserUniqueEmail = "CMSUserUniqueEmail"; - public const string CMSUseSessionManagement = "CMSUseSessionManagement"; - public const string CMSUseSitePrefixForUserName = "CMSUseSitePrefixForUserName"; - public const string CMSUseSSL = "CMSUseSSL"; - public const string CMSUseSSLForAdministrationInterface = "CMSUseSSLForAdministrationInterface"; - public const string CMSUseURLsWithTrailingSlash = "CMSUseURLsWithTrailingSlash"; - public const string CMSVersionHistoryLength = "CMSVersionHistoryLength"; - public const string CMSVersioningExtensionsMediaFile = "CMSVersioningExtensionsMediaFile"; - public const string CMSVisitorStatusIdle = "CMSVisitorStatusIdle"; - public const string CMSWebAnalyticsUseJavascriptLogging = "CMSWebAnalyticsUseJavascriptLogging"; - public const string CMSWebDAVExtensions = "CMSWebDAVExtensions"; - public const string CMSWebFarmMaxFileSize = "CMSWebFarmMaxFileSize"; - public const string CMSWebFarmMode = "CMSWebFarmMode"; - public const string CMSWebFarmSynchronizeAttachments = "CMSWebFarmSynchronizeAttachments"; - public const string CMSWebFarmSynchronizeAvatars = "CMSWebFarmSynchronizeAvatars"; - public const string CMSWebFarmSynchronizeBizFormFiles = "CMSWebFarmSynchronizeBizFormFiles"; - public const string CMSWebFarmSynchronizeCache = "CMSWebFarmSynchronizeCache"; - public const string CMSWebFarmSynchronizeDeleteFiles = "CMSWebFarmSynchronizeDeleteFiles"; - public const string CMSWebFarmSynchronizeFiles = "CMSWebFarmSynchronizeFiles"; - public const string CMSWebFarmSynchronizeForumAttachments = "CMSWebFarmSynchronizeForumAttachments"; - public const string CMSWebFarmSynchronizeMediaFiles = "CMSWebFarmSynchronizeMediaFiles"; - public const string CMSWebFarmSynchronizeMetaFiles = "CMSWebFarmSynchronizeMetaFiles"; - public const string CMSWebFarmSynchronizePhysicalFiles = "CMSWebFarmSynchronizePhysicalFiles"; - public const string CMSWebFarmSynchronizeSmartSearch = "CMSWebFarmSynchronizeSmartSearch"; - public const string CMSWebFarmSyncInterval = "CMSWebFarmSyncInterval"; - public const string CMSWIFAllowedAudienceUris = "CMSWIFAllowedAudienceUris"; - public const string CMSWIFCertificateValidator = "CMSWIFCertificateValidator"; - public const string CMSWIFEnabled = "CMSWIFEnabled"; - public const string CMSWIFIdentityProviderURL = "CMSWIFIdentityProviderURL"; - public const string CMSWIFRealm = "CMSWIFRealm"; - public const string CMSWIFTrustedCertificateThumbprint = "CMSWIFTrustedCertificateThumbprint"; - public const string CMSWishlistURL = "CMSWishlistURL"; -} diff --git a/Migration.Toolkit.KX12/SettingsKeys.tt b/Migration.Toolkit.KX12/SettingsKeys.tt deleted file mode 100644 index 79807a48..00000000 --- a/Migration.Toolkit.KX12/SettingsKeys.tt +++ /dev/null @@ -1,28 +0,0 @@ -<#@ template language="C#" #> -<#@ import namespace="System.Data.SqlClient" #> -// ReSharper disable InconsistentNaming -// ReSharper disable IdentifierTypo -namespace Migration.Toolkit.KX12; - -public static class SettingsKeys { -<# - var connectionString = Environment.GetEnvironmentVariable("KENTICO_MT_DEV_KX12_CONNECTION_STRING"); - using var connection = new SqlConnection(connectionString); - using var cmd = connection.CreateCommand(); - cmd.CommandText = """ - SELECT KeyName - FROM CMS_SettingsKey - WHERE KeyName LIKE 'CMS%' - GROUP BY KeyName - ORDER BY KeyName - """; - connection.Open(); - using var reader = cmd.ExecuteReader(); - while (reader.Read()) - { - WriteLine($""" - public const string {reader[0]} = "{reader[0]}"; - """); - } -#> -} \ No newline at end of file diff --git a/Migration.Toolkit.KX13/DependencyInjectionExtensions.cs b/Migration.Toolkit.KX13/DependencyInjectionExtensions.cs deleted file mode 100644 index fa4afefb..00000000 --- a/Migration.Toolkit.KX13/DependencyInjectionExtensions.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; - -using Migration.Toolkit.Common; -using Migration.Toolkit.KX13.Context; - -namespace Migration.Toolkit.KX13; - -public static class DependencyInjectionExtensions -{ - public static IServiceCollection UseKx13DbContext(this IServiceCollection services, ToolkitConfiguration toolkitConfiguration) - { - services.AddDbContextFactory(options => options.UseSqlServer(toolkitConfiguration.KxConnectionString)); - return services; - } -} diff --git a/Migration.Toolkit.KX13/Migration.Toolkit.KX13.csproj b/Migration.Toolkit.KX13/Migration.Toolkit.KX13.csproj deleted file mode 100644 index eb80c2f2..00000000 --- a/Migration.Toolkit.KX13/Migration.Toolkit.KX13.csproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - TextTemplatingFileGenerator - SettingsKeys.cs - - - - - - True - True - SettingsKeys.tt - - - - - - - - diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaign.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaign.cs deleted file mode 100644 index fb66e010..00000000 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaign.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_Campaign")] -[Index("CampaignScheduledTaskId", Name = "IX_Analytics_Campaign_CampaignScheduledTaskID")] -[Index("CampaignSiteId", Name = "IX_Analytics_Campaign_CampaignSiteID")] -public class AnalyticsCampaign -{ - [Key] - [Column("CampaignID")] - public int CampaignId { get; set; } - - [StringLength(200)] - public string CampaignName { get; set; } = null!; - - [StringLength(100)] - public string CampaignDisplayName { get; set; } = null!; - - public string? CampaignDescription { get; set; } - - [Column("CampaignSiteID")] - public int CampaignSiteId { get; set; } - - public DateTime? CampaignOpenFrom { get; set; } - - public DateTime? CampaignOpenTo { get; set; } - - [Column("CampaignGUID")] - public Guid CampaignGuid { get; set; } - - public DateTime CampaignLastModified { get; set; } - - [Column("CampaignUTMCode")] - [StringLength(200)] - public string? CampaignUtmcode { get; set; } - - public DateTime? CampaignCalculatedTo { get; set; } - - [Column("CampaignScheduledTaskID")] - public int? CampaignScheduledTaskId { get; set; } - - public int? CampaignVisitors { get; set; } - - [InverseProperty("CampaignAssetCampaign")] - public virtual ICollection AnalyticsCampaignAssets { get; set; } = new List(); - - [InverseProperty("CampaignConversionCampaign")] - public virtual ICollection AnalyticsCampaignConversions { get; set; } = new List(); - - [InverseProperty("CampaignObjectiveCampaign")] - public virtual AnalyticsCampaignObjective? AnalyticsCampaignObjective { get; set; } - - [ForeignKey("CampaignScheduledTaskId")] - [InverseProperty("AnalyticsCampaigns")] - public virtual CmsScheduledTask? CampaignScheduledTask { get; set; } - - [ForeignKey("CampaignSiteId")] - [InverseProperty("AnalyticsCampaigns")] - public virtual CmsSite CampaignSite { get; set; } = null!; - - [InverseProperty("FacebookPostCampaign")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); - - [InverseProperty("LinkedInPostCampaign")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); - - [InverseProperty("TwitterPostCampaign")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignAsset.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignAsset.cs deleted file mode 100644 index d7631156..00000000 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignAsset.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_CampaignAsset")] -[Index("CampaignAssetCampaignId", Name = "IX_Analytics_CampaignAsset_CampaignAssetCampaignID")] -public class AnalyticsCampaignAsset -{ - [Key] - [Column("CampaignAssetID")] - public int CampaignAssetId { get; set; } - - public Guid CampaignAssetGuid { get; set; } - - public DateTime CampaignAssetLastModified { get; set; } - - public Guid CampaignAssetAssetGuid { get; set; } - - [Column("CampaignAssetCampaignID")] - public int CampaignAssetCampaignId { get; set; } - - [StringLength(200)] - public string CampaignAssetType { get; set; } = null!; - - [InverseProperty("CampaignAssetUrlCampaignAsset")] - public virtual ICollection AnalyticsCampaignAssetUrls { get; set; } = new List(); - - [ForeignKey("CampaignAssetCampaignId")] - [InverseProperty("AnalyticsCampaignAssets")] - public virtual AnalyticsCampaign CampaignAssetCampaign { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignAssetUrl.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignAssetUrl.cs deleted file mode 100644 index c4a339fd..00000000 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignAssetUrl.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_CampaignAssetUrl")] -[Index("CampaignAssetUrlCampaignAssetId", Name = "IX_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID")] -public class AnalyticsCampaignAssetUrl -{ - [Key] - [Column("CampaignAssetUrlID")] - public int CampaignAssetUrlId { get; set; } - - public Guid CampaignAssetUrlGuid { get; set; } - - public string CampaignAssetUrlTarget { get; set; } = null!; - - [StringLength(200)] - public string CampaignAssetUrlPageTitle { get; set; } = null!; - - [Column("CampaignAssetUrlCampaignAssetID")] - public int CampaignAssetUrlCampaignAssetId { get; set; } - - [ForeignKey("CampaignAssetUrlCampaignAssetId")] - [InverseProperty("AnalyticsCampaignAssetUrls")] - public virtual AnalyticsCampaignAsset CampaignAssetUrlCampaignAsset { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversion.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversion.cs deleted file mode 100644 index b7a97851..00000000 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversion.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_CampaignConversion")] -[Index("CampaignConversionCampaignId", Name = "IX_Analytics_CampaignConversion_CampaignConversionCampaignID")] -public class AnalyticsCampaignConversion -{ - [Key] - [Column("CampaignConversionID")] - public int CampaignConversionId { get; set; } - - public Guid CampaignConversionGuid { get; set; } - - public DateTime CampaignConversionLastModified { get; set; } - - [StringLength(100)] - public string CampaignConversionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string CampaignConversionName { get; set; } = null!; - - [Column("CampaignConversionCampaignID")] - public int CampaignConversionCampaignId { get; set; } - - public int CampaignConversionOrder { get; set; } - - [StringLength(250)] - public string CampaignConversionActivityType { get; set; } = null!; - - public int CampaignConversionHits { get; set; } - - [Column("CampaignConversionItemID")] - public int? CampaignConversionItemId { get; set; } - - public double CampaignConversionValue { get; set; } - - public bool CampaignConversionIsFunnelStep { get; set; } - - [Column("CampaignConversionURL")] - public string? CampaignConversionUrl { get; set; } - - [InverseProperty("CampaignConversionHitsConversion")] - public virtual ICollection AnalyticsCampaignConversionHits { get; set; } = new List(); - - [InverseProperty("CampaignObjectiveCampaignConversion")] - public virtual ICollection AnalyticsCampaignObjectives { get; set; } = new List(); - - [ForeignKey("CampaignConversionCampaignId")] - [InverseProperty("AnalyticsCampaignConversions")] - public virtual AnalyticsCampaign CampaignConversionCampaign { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversionHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversionHit.cs deleted file mode 100644 index f382813d..00000000 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversionHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_CampaignConversionHits")] -[Index("CampaignConversionHitsConversionId", Name = "IX_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID")] -public class AnalyticsCampaignConversionHit -{ - [Key] - [Column("CampaignConversionHitsID")] - public int CampaignConversionHitsId { get; set; } - - [Column("CampaignConversionHitsConversionID")] - public int CampaignConversionHitsConversionId { get; set; } - - public int CampaignConversionHitsCount { get; set; } - - [StringLength(200)] - public string CampaignConversionHitsSourceName { get; set; } = null!; - - [StringLength(200)] - public string? CampaignConversionHitsContentName { get; set; } - - [ForeignKey("CampaignConversionHitsConversionId")] - [InverseProperty("AnalyticsCampaignConversionHits")] - public virtual AnalyticsCampaignConversion CampaignConversionHitsConversion { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignObjective.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignObjective.cs deleted file mode 100644 index 70dd9951..00000000 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignObjective.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_CampaignObjective")] -[Index("CampaignObjectiveCampaignId", Name = "CK_Analytics_CampaignObjective_CampaignObjectiveCampaignID", IsUnique = true)] -[Index("CampaignObjectiveCampaignConversionId", Name = "IX_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID")] -public class AnalyticsCampaignObjective -{ - [Key] - [Column("CampaignObjectiveID")] - public int CampaignObjectiveId { get; set; } - - public Guid CampaignObjectiveGuid { get; set; } - - public DateTime CampaignObjectiveLastModified { get; set; } - - [Column("CampaignObjectiveCampaignID")] - public int CampaignObjectiveCampaignId { get; set; } - - public int? CampaignObjectiveValue { get; set; } - - [Column("CampaignObjectiveCampaignConversionID")] - public int CampaignObjectiveCampaignConversionId { get; set; } - - [ForeignKey("CampaignObjectiveCampaignId")] - [InverseProperty("AnalyticsCampaignObjective")] - public virtual AnalyticsCampaign CampaignObjectiveCampaign { get; set; } = null!; - - [ForeignKey("CampaignObjectiveCampaignConversionId")] - [InverseProperty("AnalyticsCampaignObjectives")] - public virtual AnalyticsCampaignConversion CampaignObjectiveCampaignConversion { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsDayHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsDayHit.cs deleted file mode 100644 index 90788703..00000000 --- a/Migration.Toolkit.KX13/Models/AnalyticsDayHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_DayHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_DayHits_HitsStatisticsID")] -public class AnalyticsDayHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsDayHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsExitPage.cs b/Migration.Toolkit.KX13/Models/AnalyticsExitPage.cs deleted file mode 100644 index cc850a22..00000000 --- a/Migration.Toolkit.KX13/Models/AnalyticsExitPage.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_ExitPages")] -[Index("ExitPageLastModified", Name = "IX_Analytics_ExitPages_ExitPageLastModified")] -[Index("ExitPageSessionIdentifier", Name = "UQ_Analytics_ExitPages_ExitPageSessionIdentifier", IsUnique = true)] -public class AnalyticsExitPage -{ - public DateTime ExitPageLastModified { get; set; } - - [Column("ExitPageSiteID")] - public int ExitPageSiteId { get; set; } - - [StringLength(50)] - public string? ExitPageCulture { get; set; } - - [Key] - public int ExitPageId { get; set; } - - [StringLength(1000)] - public string ExitPageUrl { get; set; } = null!; - - public Guid ExitPageSessionIdentifier { get; set; } - - [ForeignKey("ExitPageSiteId")] - [InverseProperty("AnalyticsExitPages")] - public virtual CmsSite ExitPageSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsHourHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsHourHit.cs deleted file mode 100644 index 21652c4c..00000000 --- a/Migration.Toolkit.KX13/Models/AnalyticsHourHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_HourHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_HourHits_HitsStatisticsID")] -public class AnalyticsHourHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsHourHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsMonthHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsMonthHit.cs deleted file mode 100644 index 2d4a1323..00000000 --- a/Migration.Toolkit.KX13/Models/AnalyticsMonthHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_MonthHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_MonthHits_HitsStatisticsID")] -public class AnalyticsMonthHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsMonthHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsStatistic.cs b/Migration.Toolkit.KX13/Models/AnalyticsStatistic.cs deleted file mode 100644 index 2eb6060d..00000000 --- a/Migration.Toolkit.KX13/Models/AnalyticsStatistic.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_Statistics")] -[Index("StatisticsSiteId", Name = "IX_Analytics_Statistics_StatisticsSiteID")] -public class AnalyticsStatistic -{ - [Key] - [Column("StatisticsID")] - public int StatisticsId { get; set; } - - [Column("StatisticsSiteID")] - public int? StatisticsSiteId { get; set; } - - [StringLength(400)] - public string StatisticsCode { get; set; } = null!; - - [StringLength(1000)] - public string? StatisticsObjectName { get; set; } - - [Column("StatisticsObjectID")] - public int? StatisticsObjectId { get; set; } - - [StringLength(50)] - public string? StatisticsObjectCulture { get; set; } - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsDayHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsHourHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsMonthHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsWeekHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsYearHits { get; set; } = new List(); - - [ForeignKey("StatisticsSiteId")] - [InverseProperty("AnalyticsStatistics")] - public virtual CmsSite? StatisticsSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsWeekHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsWeekHit.cs deleted file mode 100644 index 81dfa741..00000000 --- a/Migration.Toolkit.KX13/Models/AnalyticsWeekHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_WeekHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_WeekHits_HitsStatisticsID")] -public class AnalyticsWeekHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsWeekHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsYearHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsYearHit.cs deleted file mode 100644 index 16fca8eb..00000000 --- a/Migration.Toolkit.KX13/Models/AnalyticsYearHit.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_YearHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_WeekYearHits_HitsStatisticsID")] -public class AnalyticsYearHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsYearHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CiFileMetadatum.cs b/Migration.Toolkit.KX13/Models/CiFileMetadatum.cs deleted file mode 100644 index e8abfa86..00000000 --- a/Migration.Toolkit.KX13/Models/CiFileMetadatum.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CI_FileMetadata")] -[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] -public class CiFileMetadatum -{ - [Key] - [Column("FileMetadataID")] - public int FileMetadataId { get; set; } - - [StringLength(260)] - public string FileLocation { get; set; } = null!; - - [StringLength(32)] - public string FileHash { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CiMigration.cs b/Migration.Toolkit.KX13/Models/CiMigration.cs deleted file mode 100644 index 14eaaf79..00000000 --- a/Migration.Toolkit.KX13/Models/CiMigration.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CI_Migration")] -[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] -public class CiMigration -{ - [Key] - [Column("MigrationID")] - public int MigrationId { get; set; } - - [StringLength(255)] - public string MigrationName { get; set; } = null!; - - [Precision(3)] - public DateTime DateApplied { get; set; } - - public int? RowsAffected { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsAcl.cs b/Migration.Toolkit.KX13/Models/CmsAcl.cs deleted file mode 100644 index 63206d32..00000000 --- a/Migration.Toolkit.KX13/Models/CmsAcl.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ACL")] -[Index("AclinheritedAcls", Name = "IX_CMS_ACL_ACLInheritedACLs")] -[Index("AclsiteId", Name = "IX_CMS_ACL_ACLSiteID")] -public class CmsAcl -{ - [Key] - [Column("ACLID")] - public int Aclid { get; set; } - - [Column("ACLInheritedACLs")] - public string AclinheritedAcls { get; set; } = null!; - - [Column("ACLGUID")] - public Guid Aclguid { get; set; } - - [Column("ACLLastModified")] - public DateTime AcllastModified { get; set; } - - [Column("ACLSiteID")] - public int? AclsiteId { get; set; } - - [ForeignKey("AclsiteId")] - [InverseProperty("CmsAcls")] - public virtual CmsSite? Aclsite { get; set; } - - [InverseProperty("Acl")] - public virtual ICollection CmsAclitems { get; set; } = new List(); - - [InverseProperty("NodeAcl")] - public virtual ICollection CmsTrees { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsAclitem.cs b/Migration.Toolkit.KX13/Models/CmsAclitem.cs deleted file mode 100644 index 8144ecab..00000000 --- a/Migration.Toolkit.KX13/Models/CmsAclitem.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ACLItem")] -[Index("Aclid", Name = "IX_CMS_ACLItem_ACLID")] -[Index("LastModifiedByUserId", Name = "IX_CMS_ACLItem_LastModifiedByUserID")] -[Index("RoleId", Name = "IX_CMS_ACLItem_RoleID")] -[Index("UserId", Name = "IX_CMS_ACLItem_UserID")] -public class CmsAclitem -{ - [Key] - [Column("ACLItemID")] - public int AclitemId { get; set; } - - [Column("ACLID")] - public int Aclid { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [Column("RoleID")] - public int? RoleId { get; set; } - - public int Allowed { get; set; } - - public int Denied { get; set; } - - public DateTime LastModified { get; set; } - - [Column("LastModifiedByUserID")] - public int? LastModifiedByUserId { get; set; } - - [Column("ACLItemGUID")] - public Guid AclitemGuid { get; set; } - - [ForeignKey("Aclid")] - [InverseProperty("CmsAclitems")] - public virtual CmsAcl Acl { get; set; } = null!; - - [ForeignKey("LastModifiedByUserId")] - [InverseProperty("CmsAclitemLastModifiedByUsers")] - public virtual CmsUser? LastModifiedByUser { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsAclitems")] - public virtual CmsRole? Role { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsAclitemUsers")] - public virtual CmsUser? User { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsAlternativeForm.cs b/Migration.Toolkit.KX13/Models/CmsAlternativeForm.cs deleted file mode 100644 index ed831120..00000000 --- a/Migration.Toolkit.KX13/Models/CmsAlternativeForm.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_AlternativeForm")] -[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] -[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] -public class CmsAlternativeForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(50)] - public string FormName { get; set; } = null!; - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public string? FormDefinition { get; set; } - - public string? FormLayout { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - [Column("FormCoupledClassID")] - public int? FormCoupledClassId { get; set; } - - public bool? FormHideNewParentFields { get; set; } - - [StringLength(50)] - public string? FormLayoutType { get; set; } - - [Column("FormVersionGUID")] - [StringLength(50)] - public string? FormVersionGuid { get; set; } - - [StringLength(400)] - public string? FormCustomizedColumns { get; set; } - - public bool? FormIsCustom { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsAlternativeFormFormClasses")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormCoupledClassId")] - [InverseProperty("CmsAlternativeFormFormCoupledClasses")] - public virtual CmsClass? FormCoupledClass { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsAlternativeUrl.cs b/Migration.Toolkit.KX13/Models/CmsAlternativeUrl.cs deleted file mode 100644 index 404dfa74..00000000 --- a/Migration.Toolkit.KX13/Models/CmsAlternativeUrl.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_AlternativeUrl")] -[Index("AlternativeUrlDocumentId", Name = "IX_CMS_AlternativeUrl_AlternativeUrlDocumentID")] -[Index("AlternativeUrlSiteId", "AlternativeUrlUrl", Name = "IX_CMS_AlternativeUrl_AlternativeUrlSiteID_AlternativeUrlUrl", IsUnique = true)] -public class CmsAlternativeUrl -{ - [Key] - [Column("AlternativeUrlID")] - public int AlternativeUrlId { get; set; } - - [Column("AlternativeUrlGUID")] - public Guid AlternativeUrlGuid { get; set; } - - [Column("AlternativeUrlDocumentID")] - public int AlternativeUrlDocumentId { get; set; } - - [Column("AlternativeUrlSiteID")] - public int AlternativeUrlSiteId { get; set; } - - [StringLength(400)] - public string AlternativeUrlUrl { get; set; } = null!; - - public DateTime AlternativeUrlLastModified { get; set; } - - [ForeignKey("AlternativeUrlDocumentId")] - [InverseProperty("CmsAlternativeUrls")] - public virtual CmsDocument AlternativeUrlDocument { get; set; } = null!; - - [ForeignKey("AlternativeUrlSiteId")] - [InverseProperty("CmsAlternativeUrls")] - public virtual CmsSite AlternativeUrlSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsAttachment.cs b/Migration.Toolkit.KX13/Models/CmsAttachment.cs deleted file mode 100644 index 3e723479..00000000 --- a/Migration.Toolkit.KX13/Models/CmsAttachment.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Attachment")] -[Index("AttachmentDocumentId", Name = "IX_CMS_Attachment_AttachmentDocumentID")] -[Index("AttachmentGuid", "AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentGUID_AttachmentSiteID")] -[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentFormGuid", "AttachmentOrder", Name = "IX_CMS_Attachment_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentFormGUID_AttachmentOrder")] -[Index("AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentSiteID")] -[Index("AttachmentVariantParentId", Name = "IX_CMS_Attachment_AttachmentVariantParentID")] -public class CmsAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - public int? AttachmentImageWidth { get; set; } - - public int? AttachmentImageHeight { get; set; } - - [Column("AttachmentDocumentID")] - public int? AttachmentDocumentId { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - public bool? AttachmentIsUnsorted { get; set; } - - public int? AttachmentOrder { get; set; } - - [Column("AttachmentGroupGUID")] - public Guid? AttachmentGroupGuid { get; set; } - - [Column("AttachmentFormGUID")] - public Guid? AttachmentFormGuid { get; set; } - - [StringLength(32)] - public string? AttachmentHash { get; set; } - - [StringLength(250)] - public string? AttachmentTitle { get; set; } - - public string? AttachmentDescription { get; set; } - - public string? AttachmentCustomData { get; set; } - - public string? AttachmentSearchContent { get; set; } - - [StringLength(50)] - public string? AttachmentVariantDefinitionIdentifier { get; set; } - - [Column("AttachmentVariantParentID")] - public int? AttachmentVariantParentId { get; set; } - - [ForeignKey("AttachmentDocumentId")] - [InverseProperty("CmsAttachments")] - public virtual CmsDocument? AttachmentDocument { get; set; } - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("CmsAttachments")] - public virtual CmsSite AttachmentSite { get; set; } = null!; - - [ForeignKey("AttachmentVariantParentId")] - [InverseProperty("InverseAttachmentVariantParent")] - public virtual CmsAttachment? AttachmentVariantParent { get; set; } - - [InverseProperty("AttachmentVariantParent")] - public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsAttachmentHistory.cs b/Migration.Toolkit.KX13/Models/CmsAttachmentHistory.cs deleted file mode 100644 index b602ae76..00000000 --- a/Migration.Toolkit.KX13/Models/CmsAttachmentHistory.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_AttachmentHistory")] -[Index("AttachmentGuid", Name = "IX_CMS_AttachmentHistory_AttachmentGUID")] -[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentOrder", Name = "IX_CMS_AttachmentHistory_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentOrder")] -[Index("AttachmentSiteId", Name = "IX_CMS_AttachmentHistory_AttachmentSiteID")] -[Index("AttachmentVariantParentId", Name = "IX_CMS_AttachmentHistory_AttachmentVariantParentID")] -public class CmsAttachmentHistory -{ - [Key] - [Column("AttachmentHistoryID")] - public int AttachmentHistoryId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - public int? AttachmentImageWidth { get; set; } - - public int? AttachmentImageHeight { get; set; } - - [Column("AttachmentDocumentID")] - public int AttachmentDocumentId { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public bool? AttachmentIsUnsorted { get; set; } - - public int? AttachmentOrder { get; set; } - - [Column("AttachmentGroupGUID")] - public Guid? AttachmentGroupGuid { get; set; } - - [StringLength(32)] - public string? AttachmentHash { get; set; } - - [StringLength(250)] - public string? AttachmentTitle { get; set; } - - public string? AttachmentDescription { get; set; } - - public string? AttachmentCustomData { get; set; } - - public DateTime? AttachmentLastModified { get; set; } - - [Column("AttachmentHistoryGUID")] - public Guid AttachmentHistoryGuid { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - public string? AttachmentSearchContent { get; set; } - - [StringLength(50)] - public string? AttachmentVariantDefinitionIdentifier { get; set; } - - [Column("AttachmentVariantParentID")] - public int? AttachmentVariantParentId { get; set; } - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("CmsAttachmentHistories")] - public virtual CmsSite AttachmentSite { get; set; } = null!; - - [ForeignKey("AttachmentVariantParentId")] - [InverseProperty("InverseAttachmentVariantParent")] - public virtual CmsAttachmentHistory? AttachmentVariantParent { get; set; } - - [InverseProperty("AttachmentVariantParent")] - public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); - - [ForeignKey("AttachmentHistoryId")] - [InverseProperty("AttachmentHistories")] - public virtual ICollection VersionHistories { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsAutomationHistory.cs b/Migration.Toolkit.KX13/Models/CmsAutomationHistory.cs deleted file mode 100644 index 972ff973..00000000 --- a/Migration.Toolkit.KX13/Models/CmsAutomationHistory.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_AutomationHistory")] -[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] -[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] -[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] -[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] -[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] -[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] -public class CmsAutomationHistory -{ - [Key] - [Column("HistoryID")] - public int HistoryId { get; set; } - - [Column("HistoryStepID")] - public int? HistoryStepId { get; set; } - - [StringLength(440)] - public string? HistoryStepName { get; set; } - - [StringLength(450)] - public string HistoryStepDisplayName { get; set; } = null!; - - public int? HistoryStepType { get; set; } - - [Column("HistoryTargetStepID")] - public int? HistoryTargetStepId { get; set; } - - [StringLength(440)] - public string? HistoryTargetStepName { get; set; } - - [StringLength(450)] - public string? HistoryTargetStepDisplayName { get; set; } - - public int? HistoryTargetStepType { get; set; } - - [Column("HistoryApprovedByUserID")] - public int? HistoryApprovedByUserId { get; set; } - - public DateTime? HistoryApprovedWhen { get; set; } - - public string? HistoryComment { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - public bool HistoryWasRejected { get; set; } - - [Column("HistoryStateID")] - public int HistoryStateId { get; set; } - - [ForeignKey("HistoryApprovedByUserId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsUser? HistoryApprovedByUser { get; set; } - - [ForeignKey("HistoryStateId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsAutomationState HistoryState { get; set; } = null!; - - [ForeignKey("HistoryStepId")] - [InverseProperty("CmsAutomationHistoryHistorySteps")] - public virtual CmsWorkflowStep? HistoryStep { get; set; } - - [ForeignKey("HistoryTargetStepId")] - [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] - public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsAutomationState.cs b/Migration.Toolkit.KX13/Models/CmsAutomationState.cs deleted file mode 100644 index 8e480c36..00000000 --- a/Migration.Toolkit.KX13/Models/CmsAutomationState.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_AutomationState")] -[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] -[Index("StateSiteId", Name = "IX_CMS_AutomationState_StateSiteID")] -[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] -[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] -[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] -public class CmsAutomationState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [Column("StateStepID")] - public int StateStepId { get; set; } - - [Column("StateObjectID")] - public int StateObjectId { get; set; } - - [StringLength(100)] - public string StateObjectType { get; set; } = null!; - - [StringLength(450)] - public string? StateActionStatus { get; set; } - - public DateTime? StateCreated { get; set; } - - public DateTime? StateLastModified { get; set; } - - [Column("StateWorkflowID")] - public int StateWorkflowId { get; set; } - - public int? StateStatus { get; set; } - - [Column("StateSiteID")] - public int? StateSiteId { get; set; } - - [Column("StateUserID")] - public int? StateUserId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public string? StateCustomData { get; set; } - - [InverseProperty("HistoryState")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [ForeignKey("StateSiteId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsSite? StateSite { get; set; } - - [ForeignKey("StateStepId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflowStep StateStep { get; set; } = null!; - - [ForeignKey("StateUserId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsUser? StateUser { get; set; } - - [ForeignKey("StateWorkflowId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflow StateWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsAutomationTemplate.cs b/Migration.Toolkit.KX13/Models/CmsAutomationTemplate.cs deleted file mode 100644 index 2b3b406c..00000000 --- a/Migration.Toolkit.KX13/Models/CmsAutomationTemplate.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_AutomationTemplate")] -[Index("TemplateDisplayName", Name = "IX_CMS_AutomationTemplate_TemplateDisplayName")] -public class CmsAutomationTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(250)] - public string TemplateDisplayName { get; set; } = null!; - - public string? TemplateDescription { get; set; } - - [StringLength(200)] - public string? TemplateIconClass { get; set; } - - public string? TemplateConfiguration { get; set; } - - public Guid TemplateGuid { get; set; } - - public DateTime TemplateLastModified { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsAvatar.cs b/Migration.Toolkit.KX13/Models/CmsAvatar.cs deleted file mode 100644 index 1b400271..00000000 --- a/Migration.Toolkit.KX13/Models/CmsAvatar.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Avatar")] -[Index("AvatarGuid", Name = "IX_CMS_Avatar_AvatarGUID")] -public class CmsAvatar -{ - [Key] - [Column("AvatarID")] - public int AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarName { get; set; } - - [StringLength(200)] - public string AvatarFileName { get; set; } = null!; - - [StringLength(10)] - public string AvatarFileExtension { get; set; } = null!; - - public byte[]? AvatarBinary { get; set; } - - [Column("AvatarGUID")] - public Guid AvatarGuid { get; set; } - - public DateTime AvatarLastModified { get; set; } - - [StringLength(100)] - public string AvatarMimeType { get; set; } = null!; - - public int AvatarFileSize { get; set; } - - public int? AvatarImageHeight { get; set; } - - public int? AvatarImageWidth { get; set; } - - [InverseProperty("UserAvatar")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsCategory.cs b/Migration.Toolkit.KX13/Models/CmsCategory.cs deleted file mode 100644 index 976603c2..00000000 --- a/Migration.Toolkit.KX13/Models/CmsCategory.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Category")] -[Index("CategorySiteId", Name = "IX_CMS_Category_CategorySiteID")] -[Index("CategoryUserId", Name = "IX_CMS_Category_CategoryUserID")] -public class CmsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(250)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(250)] - public string? CategoryName { get; set; } - - public string? CategoryDescription { get; set; } - - public int? CategoryCount { get; set; } - - [Required] - public bool? CategoryEnabled { get; set; } - - [Column("CategoryUserID")] - public int? CategoryUserId { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - [StringLength(1500)] - public string? CategoryNamePath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryOrder { get; set; } - - [ForeignKey("CategorySiteId")] - [InverseProperty("CmsCategories")] - public virtual CmsSite? CategorySite { get; set; } - - [ForeignKey("CategoryUserId")] - [InverseProperty("CmsCategories")] - public virtual CmsUser? CategoryUser { get; set; } - - [ForeignKey("CategoryId")] - [InverseProperty("Categories")] - public virtual ICollection Documents { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsClass.cs b/Migration.Toolkit.KX13/Models/CmsClass.cs deleted file mode 100644 index 82c5ee8a..00000000 --- a/Migration.Toolkit.KX13/Models/CmsClass.cs +++ /dev/null @@ -1,195 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Class")] -[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] -[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] -[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] -[Index("ClassShowAsSystemTable", "ClassIsCustomTable", "ClassIsCoupledClass", "ClassIsDocumentType", Name = "IX_CMS_Class_ClassShowAsSystemTable_ClassIsCustomTable_ClassIsCoupledClass_ClassIsDocumentType")] -public class CmsClass -{ - [Key] - [Column("ClassID")] - public int ClassId { get; set; } - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - public bool ClassUsesVersioning { get; set; } - - public bool ClassIsDocumentType { get; set; } - - public bool ClassIsCoupledClass { get; set; } - - public string ClassXmlSchema { get; set; } = null!; - - public string ClassFormDefinition { get; set; } = null!; - - [StringLength(100)] - public string ClassNodeNameSource { get; set; } = null!; - - [StringLength(100)] - public string? ClassTableName { get; set; } - - public string? ClassFormLayout { get; set; } - - public bool? ClassShowAsSystemTable { get; set; } - - public bool? ClassUsePublishFromTo { get; set; } - - public bool? ClassShowTemplateSelection { get; set; } - - [Column("ClassSKUMappings")] - public string? ClassSkumappings { get; set; } - - public bool? ClassIsMenuItemType { get; set; } - - [StringLength(100)] - public string? ClassNodeAliasSource { get; set; } - - public DateTime ClassLastModified { get; set; } - - [Column("ClassGUID")] - public Guid ClassGuid { get; set; } - - [Column("ClassCreateSKU")] - public bool? ClassCreateSku { get; set; } - - public bool? ClassIsProduct { get; set; } - - public bool ClassIsCustomTable { get; set; } - - [StringLength(1000)] - public string? ClassShowColumns { get; set; } - - [StringLength(200)] - public string? ClassSearchTitleColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchContentColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchImageColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchCreationDateColumn { get; set; } - - public string? ClassSearchSettings { get; set; } - - [Column("ClassInheritsFromClassID")] - public int? ClassInheritsFromClassId { get; set; } - - public bool? ClassSearchEnabled { get; set; } - - [Column("ClassSKUDefaultDepartmentName")] - [StringLength(200)] - public string? ClassSkudefaultDepartmentName { get; set; } - - [Column("ClassSKUDefaultDepartmentID")] - public int? ClassSkudefaultDepartmentId { get; set; } - - public string? ClassContactMapping { get; set; } - - public bool? ClassContactOverwriteEnabled { get; set; } - - [Column("ClassSKUDefaultProductType")] - [StringLength(50)] - public string? ClassSkudefaultProductType { get; set; } - - [StringLength(100)] - public string? ClassConnectionString { get; set; } - - public bool? ClassIsProductSection { get; set; } - - [StringLength(50)] - public string? ClassFormLayoutType { get; set; } - - [Column("ClassVersionGUID")] - [StringLength(50)] - public string? ClassVersionGuid { get; set; } - - [StringLength(100)] - public string? ClassDefaultObjectType { get; set; } - - public bool? ClassIsForm { get; set; } - - [Column("ClassResourceID")] - public int? ClassResourceId { get; set; } - - [StringLength(400)] - public string? ClassCustomizedColumns { get; set; } - - public string? ClassCodeGenerationSettings { get; set; } - - [StringLength(200)] - public string? ClassIconClass { get; set; } - - [Column("ClassURLPattern")] - [StringLength(200)] - public string? ClassUrlpattern { get; set; } - - public bool ClassUsesPageBuilder { get; set; } - - public bool ClassIsNavigationItem { get; set; } - - [Column("ClassHasURL")] - public bool ClassHasUrl { get; set; } - - public bool ClassHasMetadata { get; set; } - - public int? ClassSearchIndexDataSource { get; set; } - - [ForeignKey("ClassResourceId")] - [InverseProperty("CmsClasses")] - public virtual CmsResource? ClassResource { get; set; } - - [InverseProperty("FormClass")] - public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); - - [InverseProperty("FormCoupledClass")] - public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); - - [InverseProperty("FormClass")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsPermissions { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsQueries { get; set; } = new List(); - - [InverseProperty("TransformationClass")] - public virtual ICollection CmsTransformations { get; set; } = new List(); - - [InverseProperty("NodeClass")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("VersionClass")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("ScopeClass")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [ForeignKey("ParentClassId")] - [InverseProperty("ParentClasses")] - public virtual ICollection ChildClasses { get; set; } = new List(); - - [ForeignKey("ChildClassId")] - [InverseProperty("ChildClasses")] - public virtual ICollection ParentClasses { get; set; } = new List(); - - [ForeignKey("ClassId")] - [InverseProperty("Classes")] - public virtual ICollection Scopes { get; set; } = new List(); - - [ForeignKey("ClassId")] - [InverseProperty("Classes")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsConsent.cs b/Migration.Toolkit.KX13/Models/CmsConsent.cs deleted file mode 100644 index aa737033..00000000 --- a/Migration.Toolkit.KX13/Models/CmsConsent.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Consent")] -public class CmsConsent -{ - [Key] - [Column("ConsentID")] - public int ConsentId { get; set; } - - [StringLength(200)] - public string ConsentDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ConsentName { get; set; } = null!; - - public string ConsentContent { get; set; } = null!; - - public Guid ConsentGuid { get; set; } - - public DateTime ConsentLastModified { get; set; } - - [StringLength(100)] - public string ConsentHash { get; set; } = null!; - - [InverseProperty("ConsentAgreementConsent")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [InverseProperty("ConsentArchiveConsent")] - public virtual ICollection CmsConsentArchives { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsConsentAgreement.cs b/Migration.Toolkit.KX13/Models/CmsConsentAgreement.cs deleted file mode 100644 index a5cc26df..00000000 --- a/Migration.Toolkit.KX13/Models/CmsConsentAgreement.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ConsentAgreement")] -[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] -public class CmsConsentAgreement -{ - [Key] - [Column("ConsentAgreementID")] - public int ConsentAgreementId { get; set; } - - public Guid ConsentAgreementGuid { get; set; } - - public bool ConsentAgreementRevoked { get; set; } - - [Column("ConsentAgreementContactID")] - public int ConsentAgreementContactId { get; set; } - - [Column("ConsentAgreementConsentID")] - public int ConsentAgreementConsentId { get; set; } - - [StringLength(100)] - public string? ConsentAgreementConsentHash { get; set; } - - public DateTime ConsentAgreementTime { get; set; } - - [ForeignKey("ConsentAgreementConsentId")] - [InverseProperty("CmsConsentAgreements")] - public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; - - [ForeignKey("ConsentAgreementContactId")] - [InverseProperty("CmsConsentAgreements")] - public virtual OmContact ConsentAgreementContact { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsConsentArchive.cs b/Migration.Toolkit.KX13/Models/CmsConsentArchive.cs deleted file mode 100644 index 2482109f..00000000 --- a/Migration.Toolkit.KX13/Models/CmsConsentArchive.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ConsentArchive")] -[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] -public class CmsConsentArchive -{ - [Key] - [Column("ConsentArchiveID")] - public int ConsentArchiveId { get; set; } - - public Guid ConsentArchiveGuid { get; set; } - - public DateTime ConsentArchiveLastModified { get; set; } - - [Column("ConsentArchiveConsentID")] - public int ConsentArchiveConsentId { get; set; } - - [StringLength(100)] - public string ConsentArchiveHash { get; set; } = null!; - - public string ConsentArchiveContent { get; set; } = null!; - - [ForeignKey("ConsentArchiveConsentId")] - [InverseProperty("CmsConsentArchives")] - public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsCountry.cs b/Migration.Toolkit.KX13/Models/CmsCountry.cs deleted file mode 100644 index 6b8f4f09..00000000 --- a/Migration.Toolkit.KX13/Models/CmsCountry.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Country")] -public class CmsCountry -{ - [Key] - [Column("CountryID")] - public int CountryId { get; set; } - - [StringLength(200)] - public string CountryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CountryName { get; set; } = null!; - - [Column("CountryGUID")] - public Guid CountryGuid { get; set; } - - public DateTime CountryLastModified { get; set; } - - [StringLength(2)] - public string? CountryTwoLetterCode { get; set; } - - [StringLength(3)] - public string? CountryThreeLetterCode { get; set; } - - [InverseProperty("Country")] - public virtual ICollection CmsStates { get; set; } = new List(); - - [InverseProperty("AddressCountry")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("AddressCountry")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("Country")] - public virtual ICollection ComTaxClassCountries { get; set; } = new List(); - - [InverseProperty("AccountCountry")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactCountry")] - public virtual ICollection OmContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsCulture.cs b/Migration.Toolkit.KX13/Models/CmsCulture.cs deleted file mode 100644 index 9c89ab8b..00000000 --- a/Migration.Toolkit.KX13/Models/CmsCulture.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Culture")] -[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] -[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] -public class CmsCulture -{ - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; - - [StringLength(200)] - public string CultureShortName { get; set; } = null!; - - [Column("CultureGUID")] - public Guid CultureGuid { get; set; } - - public DateTime CultureLastModified { get; set; } - - [StringLength(100)] - public string? CultureAlias { get; set; } - - [Column("CultureIsUICulture")] - public bool? CultureIsUiculture { get; set; } - - [InverseProperty("TranslationCulture")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); - - [InverseProperty("Culture")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("ScopeCulture")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [ForeignKey("IndexCultureId")] - [InverseProperty("IndexCultures")] - public virtual ICollection Indices { get; set; } = new List(); - - [ForeignKey("CultureId")] - [InverseProperty("Cultures")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsDocument.cs b/Migration.Toolkit.KX13/Models/CmsDocument.cs deleted file mode 100644 index 1f39f3b7..00000000 --- a/Migration.Toolkit.KX13/Models/CmsDocument.cs +++ /dev/null @@ -1,166 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Document")] -[Index("DocumentCheckedOutByUserId", Name = "IX_CMS_Document_DocumentCheckedOutByUserID")] -[Index("DocumentCheckedOutVersionHistoryId", Name = "IX_CMS_Document_DocumentCheckedOutVersionHistoryID")] -[Index("DocumentCreatedByUserId", Name = "IX_CMS_Document_DocumentCreatedByUserID")] -[Index("DocumentCulture", Name = "IX_CMS_Document_DocumentCulture")] -[Index("DocumentForeignKeyValue", "DocumentId", "DocumentNodeId", Name = "IX_CMS_Document_DocumentForeignKeyValue_DocumentID_DocumentNodeID")] -[Index("DocumentModifiedByUserId", Name = "IX_CMS_Document_DocumentModifiedByUserID")] -[Index("DocumentNodeId", "DocumentId", "DocumentCulture", Name = "IX_CMS_Document_DocumentNodeID_DocumentID_DocumentCulture", IsUnique = true)] -[Index("DocumentPublishedVersionHistoryId", Name = "IX_CMS_Document_DocumentPublishedVersionHistoryID")] -[Index("DocumentTagGroupId", Name = "IX_CMS_Document_DocumentTagGroupID")] -[Index("DocumentWorkflowStepId", Name = "IX_CMS_Document_DocumentWorkflowStepID")] -public class CmsDocument -{ - [Key] - [Column("DocumentID")] - public int DocumentId { get; set; } - - [StringLength(100)] - public string DocumentName { get; set; } = null!; - - public DateTime? DocumentModifiedWhen { get; set; } - - [Column("DocumentModifiedByUserID")] - public int? DocumentModifiedByUserId { get; set; } - - public int? DocumentForeignKeyValue { get; set; } - - [Column("DocumentCreatedByUserID")] - public int? DocumentCreatedByUserId { get; set; } - - public DateTime? DocumentCreatedWhen { get; set; } - - [Column("DocumentCheckedOutByUserID")] - public int? DocumentCheckedOutByUserId { get; set; } - - public DateTime? DocumentCheckedOutWhen { get; set; } - - [Column("DocumentCheckedOutVersionHistoryID")] - public int? DocumentCheckedOutVersionHistoryId { get; set; } - - [Column("DocumentPublishedVersionHistoryID")] - public int? DocumentPublishedVersionHistoryId { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - public DateTime? DocumentPublishFrom { get; set; } - - public DateTime? DocumentPublishTo { get; set; } - - [StringLength(50)] - public string DocumentCulture { get; set; } = null!; - - [Column("DocumentNodeID")] - public int DocumentNodeId { get; set; } - - public string? DocumentPageTitle { get; set; } - - public string? DocumentPageKeyWords { get; set; } - - public string? DocumentPageDescription { get; set; } - - public string? DocumentContent { get; set; } - - public string? DocumentCustomData { get; set; } - - public string? DocumentTags { get; set; } - - [Column("DocumentTagGroupID")] - public int? DocumentTagGroupId { get; set; } - - public DateTime? DocumentLastPublished { get; set; } - - public bool? DocumentSearchExcluded { get; set; } - - [StringLength(50)] - public string? DocumentLastVersionNumber { get; set; } - - public bool? DocumentIsArchived { get; set; } - - [Column("DocumentGUID")] - public Guid? DocumentGuid { get; set; } - - [Column("DocumentWorkflowCycleGUID")] - public Guid? DocumentWorkflowCycleGuid { get; set; } - - public bool? DocumentIsWaitingForTranslation { get; set; } - - [Column("DocumentSKUName")] - [StringLength(440)] - public string? DocumentSkuname { get; set; } - - [Column("DocumentSKUDescription")] - public string? DocumentSkudescription { get; set; } - - [Column("DocumentSKUShortDescription")] - public string? DocumentSkushortDescription { get; set; } - - [StringLength(450)] - public string? DocumentWorkflowActionStatus { get; set; } - - [Required] - public bool? DocumentCanBePublished { get; set; } - - public string? DocumentPageBuilderWidgets { get; set; } - - public string? DocumentPageTemplateConfiguration { get; set; } - - [Column("DocumentABTestConfiguration")] - public string? DocumentAbtestConfiguration { get; set; } - - public bool DocumentShowInMenu { get; set; } - - [InverseProperty("AlternativeUrlDocument")] - public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); - - [InverseProperty("AttachmentDocument")] - public virtual ICollection CmsAttachments { get; set; } = new List(); - - [ForeignKey("DocumentCheckedOutByUserId")] - [InverseProperty("CmsDocumentDocumentCheckedOutByUsers")] - public virtual CmsUser? DocumentCheckedOutByUser { get; set; } - - [ForeignKey("DocumentCheckedOutVersionHistoryId")] - [InverseProperty("CmsDocumentDocumentCheckedOutVersionHistories")] - public virtual CmsVersionHistory? DocumentCheckedOutVersionHistory { get; set; } - - [ForeignKey("DocumentCreatedByUserId")] - [InverseProperty("CmsDocumentDocumentCreatedByUsers")] - public virtual CmsUser? DocumentCreatedByUser { get; set; } - - [ForeignKey("DocumentModifiedByUserId")] - [InverseProperty("CmsDocumentDocumentModifiedByUsers")] - public virtual CmsUser? DocumentModifiedByUser { get; set; } - - [ForeignKey("DocumentNodeId")] - [InverseProperty("CmsDocuments")] - public virtual CmsTree DocumentNode { get; set; } = null!; - - [ForeignKey("DocumentPublishedVersionHistoryId")] - [InverseProperty("CmsDocumentDocumentPublishedVersionHistories")] - public virtual CmsVersionHistory? DocumentPublishedVersionHistory { get; set; } - - [ForeignKey("DocumentTagGroupId")] - [InverseProperty("CmsDocuments")] - public virtual CmsTagGroup? DocumentTagGroup { get; set; } - - [ForeignKey("DocumentWorkflowStepId")] - [InverseProperty("CmsDocuments")] - public virtual CmsWorkflowStep? DocumentWorkflowStep { get; set; } - - [ForeignKey("DocumentId")] - [InverseProperty("Documents")] - public virtual ICollection Categories { get; set; } = new List(); - - [ForeignKey("DocumentId")] - [InverseProperty("Documents")] - public virtual ICollection Tags { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsDocumentTypeScope.cs b/Migration.Toolkit.KX13/Models/CmsDocumentTypeScope.cs deleted file mode 100644 index 504cf013..00000000 --- a/Migration.Toolkit.KX13/Models/CmsDocumentTypeScope.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_DocumentTypeScope")] -[Index("ScopeSiteId", Name = "IX_CMS_DocumentTypeScope_ScopeSiteID")] -public class CmsDocumentTypeScope -{ - [Key] - [Column("ScopeID")] - public int ScopeId { get; set; } - - public string ScopePath { get; set; } = null!; - - [Column("ScopeSiteID")] - public int? ScopeSiteId { get; set; } - - public DateTime ScopeLastModified { get; set; } - - [Column("ScopeGUID")] - public Guid? ScopeGuid { get; set; } - - public bool? ScopeIncludeChildren { get; set; } - - public bool? ScopeAllowAllTypes { get; set; } - - public bool? ScopeAllowLinks { get; set; } - - public string? ScopeMacroCondition { get; set; } - - [ForeignKey("ScopeSiteId")] - [InverseProperty("CmsDocumentTypeScopes")] - public virtual CmsSite? ScopeSite { get; set; } - - [ForeignKey("ScopeId")] - [InverseProperty("Scopes")] - public virtual ICollection Classes { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsEmail.cs b/Migration.Toolkit.KX13/Models/CmsEmail.cs deleted file mode 100644 index 92315eb1..00000000 --- a/Migration.Toolkit.KX13/Models/CmsEmail.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Email")] -[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] -public class CmsEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [StringLength(254)] - public string EmailFrom { get; set; } = null!; - - [StringLength(998)] - public string? EmailTo { get; set; } - - [StringLength(998)] - public string? EmailCc { get; set; } - - [StringLength(998)] - public string? EmailBcc { get; set; } - - [StringLength(450)] - public string EmailSubject { get; set; } = null!; - - public string? EmailBody { get; set; } - - public string? EmailPlainTextBody { get; set; } - - public int EmailFormat { get; set; } - - public int EmailPriority { get; set; } - - [Column("EmailSiteID")] - public int? EmailSiteId { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - public DateTime EmailLastModified { get; set; } - - public int? EmailStatus { get; set; } - - public bool? EmailIsMass { get; set; } - - [StringLength(254)] - public string? EmailReplyTo { get; set; } - - public string? EmailHeaders { get; set; } - - public DateTime? EmailCreated { get; set; } - - [InverseProperty("Email")] - public virtual ICollection CmsEmailUsers { get; set; } = new List(); - - [ForeignKey("EmailId")] - [InverseProperty("Emails")] - public virtual ICollection Attachments { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsEmailAttachment.cs b/Migration.Toolkit.KX13/Models/CmsEmailAttachment.cs deleted file mode 100644 index ca006388..00000000 --- a/Migration.Toolkit.KX13/Models/CmsEmailAttachment.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_EmailAttachment")] -public class CmsEmailAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[] AttachmentBinary { get; set; } = null!; - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - [Column("AttachmentContentID")] - [StringLength(255)] - public string? AttachmentContentId { get; set; } - - [Column("AttachmentSiteID")] - public int? AttachmentSiteId { get; set; } - - [ForeignKey("AttachmentId")] - [InverseProperty("Attachments")] - public virtual ICollection Emails { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsEmailTemplate.cs b/Migration.Toolkit.KX13/Models/CmsEmailTemplate.cs deleted file mode 100644 index 329a7dec..00000000 --- a/Migration.Toolkit.KX13/Models/CmsEmailTemplate.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_EmailTemplate")] -[Index("EmailTemplateName", "EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateName_EmailTemplateSiteID")] -[Index("EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateSiteID")] -public class CmsEmailTemplate -{ - [Key] - [Column("EmailTemplateID")] - public int EmailTemplateId { get; set; } - - [StringLength(200)] - public string EmailTemplateName { get; set; } = null!; - - [StringLength(200)] - public string EmailTemplateDisplayName { get; set; } = null!; - - public string? EmailTemplateText { get; set; } - - [Column("EmailTemplateSiteID")] - public int? EmailTemplateSiteId { get; set; } - - [Column("EmailTemplateGUID")] - public Guid EmailTemplateGuid { get; set; } - - public DateTime EmailTemplateLastModified { get; set; } - - public string? EmailTemplatePlainText { get; set; } - - [StringLength(250)] - public string? EmailTemplateSubject { get; set; } - - [StringLength(254)] - public string? EmailTemplateFrom { get; set; } - - [StringLength(998)] - public string? EmailTemplateCc { get; set; } - - [StringLength(998)] - public string? EmailTemplateBcc { get; set; } - - [StringLength(100)] - public string? EmailTemplateType { get; set; } - - public string? EmailTemplateDescription { get; set; } - - [StringLength(254)] - public string? EmailTemplateReplyTo { get; set; } - - [ForeignKey("EmailTemplateSiteId")] - [InverseProperty("CmsEmailTemplates")] - public virtual CmsSite? EmailTemplateSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsEmailUser.cs b/Migration.Toolkit.KX13/Models/CmsEmailUser.cs deleted file mode 100644 index f116ce1e..00000000 --- a/Migration.Toolkit.KX13/Models/CmsEmailUser.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("EmailId", "UserId")] -[Table("CMS_EmailUser")] -[Index("Status", Name = "IX_CMS_EmailUser_Status")] -[Index("UserId", Name = "IX_CMS_EmailUser_UserID")] -public class CmsEmailUser -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [Key] - [Column("UserID")] - public int UserId { get; set; } - - public string? LastSendResult { get; set; } - - public DateTime? LastSendAttempt { get; set; } - - public int? Status { get; set; } - - [ForeignKey("EmailId")] - [InverseProperty("CmsEmailUsers")] - public virtual CmsEmail Email { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsEmailUsers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsEventLog.cs b/Migration.Toolkit.KX13/Models/CmsEventLog.cs deleted file mode 100644 index 7aa81ace..00000000 --- a/Migration.Toolkit.KX13/Models/CmsEventLog.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_EventLog")] -[Index("SiteId", Name = "IX_CMS_EventLog_SiteID")] -public class CmsEventLog -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(5)] - public string EventType { get; set; } = null!; - - public DateTime EventTime { get; set; } - - [StringLength(100)] - public string Source { get; set; } = null!; - - [StringLength(100)] - public string EventCode { get; set; } = null!; - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(250)] - public string? UserName { get; set; } - - [Column("IPAddress")] - [StringLength(100)] - public string? Ipaddress { get; set; } - - [Column("NodeID")] - public int? NodeId { get; set; } - - [StringLength(100)] - public string? DocumentName { get; set; } - - public string? EventDescription { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - public string? EventUrl { get; set; } - - [StringLength(100)] - public string? EventMachineName { get; set; } - - public string? EventUserAgent { get; set; } - - public string? EventUrlReferrer { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsExternalLogin.cs b/Migration.Toolkit.KX13/Models/CmsExternalLogin.cs deleted file mode 100644 index 3c562d6a..00000000 --- a/Migration.Toolkit.KX13/Models/CmsExternalLogin.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ExternalLogin")] -[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] -public class CmsExternalLogin -{ - [Key] - [Column("ExternalLoginID")] - public int ExternalLoginId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(200)] - public string? LoginProvider { get; set; } - - [StringLength(200)] - public string? IdentityKey { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsExternalLogins")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsForm.cs b/Migration.Toolkit.KX13/Models/CmsForm.cs deleted file mode 100644 index 364a9ff5..00000000 --- a/Migration.Toolkit.KX13/Models/CmsForm.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Form")] -[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] -[Index("FormSiteId", Name = "IX_CMS_Form_FormSiteID")] -public class CmsForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(100)] - public string FormName { get; set; } = null!; - - [StringLength(998)] - public string? FormSendToEmail { get; set; } - - [StringLength(254)] - public string? FormSendFromEmail { get; set; } - - [StringLength(250)] - public string? FormEmailSubject { get; set; } - - public string? FormEmailTemplate { get; set; } - - public bool? FormEmailAttachUploadedDocs { get; set; } - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public int FormItems { get; set; } - - public string? FormReportFields { get; set; } - - [StringLength(400)] - public string? FormRedirectToUrl { get; set; } - - public string? FormDisplayText { get; set; } - - public bool FormClearAfterSave { get; set; } - - [StringLength(400)] - public string? FormSubmitButtonText { get; set; } - - [Column("FormSiteID")] - public int FormSiteId { get; set; } - - [StringLength(254)] - public string? FormConfirmationEmailField { get; set; } - - public string? FormConfirmationTemplate { get; set; } - - [StringLength(254)] - public string? FormConfirmationSendFromEmail { get; set; } - - [StringLength(250)] - public string? FormConfirmationEmailSubject { get; set; } - - public int? FormAccess { get; set; } - - [StringLength(255)] - public string? FormSubmitButtonImage { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - [Required] - public bool? FormLogActivity { get; set; } - - public string? FormBuilderLayout { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsForms")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormSiteId")] - [InverseProperty("CmsForms")] - public virtual CmsSite FormSite { get; set; } = null!; - - [ForeignKey("FormId")] - [InverseProperty("Forms")] - public virtual ICollection Roles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsFormUserControl.cs b/Migration.Toolkit.KX13/Models/CmsFormUserControl.cs deleted file mode 100644 index 2080ad41..00000000 --- a/Migration.Toolkit.KX13/Models/CmsFormUserControl.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_FormUserControl")] -[Index("UserControlCodeName", Name = "IX_CMS_FormUserControl_UserControlCodeName", IsUnique = true)] -[Index("UserControlParentId", Name = "IX_CMS_FormUserControl_UserControlParentID")] -[Index("UserControlResourceId", Name = "IX_CMS_FormUserControl_UserControlResourceID")] -public class CmsFormUserControl -{ - [Key] - [Column("UserControlID")] - public int UserControlId { get; set; } - - [StringLength(200)] - public string UserControlDisplayName { get; set; } = null!; - - [StringLength(200)] - public string UserControlCodeName { get; set; } = null!; - - [StringLength(400)] - public string UserControlFileName { get; set; } = null!; - - public bool UserControlForText { get; set; } - - public bool UserControlForLongText { get; set; } - - public bool UserControlForInteger { get; set; } - - public bool UserControlForDecimal { get; set; } - - public bool UserControlForDateTime { get; set; } - - public bool UserControlForBoolean { get; set; } - - public bool UserControlForFile { get; set; } - - public bool? UserControlShowInDocumentTypes { get; set; } - - public bool? UserControlShowInSystemTables { get; set; } - - public bool? UserControlShowInWebParts { get; set; } - - public bool? UserControlShowInReports { get; set; } - - [Column("UserControlGUID")] - public Guid UserControlGuid { get; set; } - - public DateTime UserControlLastModified { get; set; } - - public bool UserControlForGuid { get; set; } - - public bool? UserControlShowInCustomTables { get; set; } - - public string? UserControlParameters { get; set; } - - public bool UserControlForDocAttachments { get; set; } - - [Column("UserControlResourceID")] - public int? UserControlResourceId { get; set; } - - [Column("UserControlParentID")] - public int? UserControlParentId { get; set; } - - public string? UserControlDescription { get; set; } - - public int? UserControlPriority { get; set; } - - public bool? UserControlIsSystem { get; set; } - - public bool UserControlForBinary { get; set; } - - public bool UserControlForDocRelationships { get; set; } - - [StringLength(200)] - public string? UserControlAssemblyName { get; set; } - - [StringLength(200)] - public string? UserControlClassName { get; set; } - - [InverseProperty("UserControlParent")] - public virtual ICollection InverseUserControlParent { get; set; } = new List(); - - [ForeignKey("UserControlParentId")] - [InverseProperty("InverseUserControlParent")] - public virtual CmsFormUserControl? UserControlParent { get; set; } - - [ForeignKey("UserControlResourceId")] - [InverseProperty("CmsFormUserControls")] - public virtual CmsResource? UserControlResource { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsHelpTopic.cs b/Migration.Toolkit.KX13/Models/CmsHelpTopic.cs deleted file mode 100644 index b99ba3c2..00000000 --- a/Migration.Toolkit.KX13/Models/CmsHelpTopic.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_HelpTopic")] -[Index("HelpTopicUielementId", Name = "IX_CMS_HelpTopic_HelpTopicUIElementID")] -public class CmsHelpTopic -{ - [Key] - [Column("HelpTopicID")] - public int HelpTopicId { get; set; } - - [Column("HelpTopicUIElementID")] - public int HelpTopicUielementId { get; set; } - - [StringLength(200)] - public string HelpTopicName { get; set; } = null!; - - [StringLength(1023)] - public string HelpTopicLink { get; set; } = null!; - - public DateTime HelpTopicLastModified { get; set; } - - [Column("HelpTopicGUID")] - public Guid HelpTopicGuid { get; set; } - - public int? HelpTopicOrder { get; set; } - - public string? HelpTopicVisibilityCondition { get; set; } - - [ForeignKey("HelpTopicUielementId")] - [InverseProperty("CmsHelpTopics")] - public virtual CmsUielement HelpTopicUielement { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsLayout.cs b/Migration.Toolkit.KX13/Models/CmsLayout.cs deleted file mode 100644 index 6eb54d0a..00000000 --- a/Migration.Toolkit.KX13/Models/CmsLayout.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Layout")] -[Index("LayoutDisplayName", Name = "IX_CMS_Layout_LayoutDisplayName")] -public class CmsLayout -{ - [Key] - [Column("LayoutID")] - public int LayoutId { get; set; } - - [StringLength(100)] - public string LayoutCodeName { get; set; } = null!; - - [StringLength(200)] - public string LayoutDisplayName { get; set; } = null!; - - public string? LayoutDescription { get; set; } - - public string LayoutCode { get; set; } = null!; - - [Column("LayoutVersionGUID")] - [StringLength(50)] - public string? LayoutVersionGuid { get; set; } - - [Column("LayoutGUID")] - public Guid LayoutGuid { get; set; } - - public DateTime LayoutLastModified { get; set; } - - [StringLength(50)] - public string? LayoutType { get; set; } - - [Column("LayoutCSS")] - public string? LayoutCss { get; set; } - - [InverseProperty("PageTemplateLayoutNavigation")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsLicenseKey.cs b/Migration.Toolkit.KX13/Models/CmsLicenseKey.cs deleted file mode 100644 index 522fb68f..00000000 --- a/Migration.Toolkit.KX13/Models/CmsLicenseKey.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_LicenseKey")] -public class CmsLicenseKey -{ - [Key] - [Column("LicenseKeyID")] - public int LicenseKeyId { get; set; } - - [StringLength(255)] - public string? LicenseDomain { get; set; } - - public string? LicenseKey { get; set; } - - [StringLength(200)] - public string? LicenseEdition { get; set; } - - [StringLength(200)] - public string? LicenseExpiration { get; set; } - - public int? LicenseServers { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsMacroIdentity.cs b/Migration.Toolkit.KX13/Models/CmsMacroIdentity.cs deleted file mode 100644 index c9ab83ec..00000000 --- a/Migration.Toolkit.KX13/Models/CmsMacroIdentity.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_MacroIdentity")] -[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] -public class CmsMacroIdentity -{ - [Key] - [Column("MacroIdentityID")] - public int MacroIdentityId { get; set; } - - public Guid MacroIdentityGuid { get; set; } - - public DateTime MacroIdentityLastModified { get; set; } - - [StringLength(200)] - public string MacroIdentityName { get; set; } = null!; - - [Column("MacroIdentityEffectiveUserID")] - public int? MacroIdentityEffectiveUserId { get; set; } - - [InverseProperty("UserMacroIdentityMacroIdentity")] - public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); - - [ForeignKey("MacroIdentityEffectiveUserId")] - [InverseProperty("CmsMacroIdentities")] - public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsMacroRule.cs b/Migration.Toolkit.KX13/Models/CmsMacroRule.cs deleted file mode 100644 index 487129df..00000000 --- a/Migration.Toolkit.KX13/Models/CmsMacroRule.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_MacroRule")] -public class CmsMacroRule -{ - [Key] - [Column("MacroRuleID")] - public int MacroRuleId { get; set; } - - [StringLength(200)] - public string MacroRuleName { get; set; } = null!; - - [StringLength(1000)] - public string MacroRuleText { get; set; } = null!; - - public string? MacroRuleParameters { get; set; } - - [StringLength(100)] - public string? MacroRuleResourceName { get; set; } - - public DateTime MacroRuleLastModified { get; set; } - - [Column("MacroRuleGUID")] - public Guid MacroRuleGuid { get; set; } - - public string MacroRuleCondition { get; set; } = null!; - - [StringLength(500)] - public string MacroRuleDisplayName { get; set; } = null!; - - public bool? MacroRuleIsCustom { get; set; } - - public bool MacroRuleRequiresContext { get; set; } - - [StringLength(450)] - public string? MacroRuleDescription { get; set; } - - [StringLength(2500)] - public string? MacroRuleRequiredData { get; set; } - - public bool? MacroRuleEnabled { get; set; } - - public int? MacroRuleAvailability { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsMembership.cs b/Migration.Toolkit.KX13/Models/CmsMembership.cs deleted file mode 100644 index 3bf124b1..00000000 --- a/Migration.Toolkit.KX13/Models/CmsMembership.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Membership")] -[Index("MembershipSiteId", Name = "IX_CMS_Membership_MembershipSiteID")] -public class CmsMembership -{ - [Key] - [Column("MembershipID")] - public int MembershipId { get; set; } - - [StringLength(200)] - public string MembershipName { get; set; } = null!; - - [StringLength(200)] - public string MembershipDisplayName { get; set; } = null!; - - public string? MembershipDescription { get; set; } - - public DateTime MembershipLastModified { get; set; } - - [Column("MembershipGUID")] - public Guid MembershipGuid { get; set; } - - [Column("MembershipSiteID")] - public int? MembershipSiteId { get; set; } - - [InverseProperty("Membership")] - public virtual ICollection CmsMembershipUsers { get; set; } = new List(); - - [ForeignKey("MembershipSiteId")] - [InverseProperty("CmsMemberships")] - public virtual CmsSite? MembershipSite { get; set; } - - [ForeignKey("MembershipId")] - [InverseProperty("Memberships")] - public virtual ICollection Roles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsMembershipUser.cs b/Migration.Toolkit.KX13/Models/CmsMembershipUser.cs deleted file mode 100644 index e80dcbf3..00000000 --- a/Migration.Toolkit.KX13/Models/CmsMembershipUser.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_MembershipUser")] -[Index("MembershipId", "UserId", Name = "IX_CMS_MembershipUser_MembershipID_UserID", IsUnique = true)] -[Index("UserId", Name = "IX_CMS_MembershipUser_UserID")] -public class CmsMembershipUser -{ - [Key] - [Column("MembershipUserID")] - public int MembershipUserId { get; set; } - - [Column("MembershipID")] - public int MembershipId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - public DateTime? ValidTo { get; set; } - - public bool? SendNotification { get; set; } - - [ForeignKey("MembershipId")] - [InverseProperty("CmsMembershipUsers")] - public virtual CmsMembership Membership { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsMembershipUsers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsMetaFile.cs b/Migration.Toolkit.KX13/Models/CmsMetaFile.cs deleted file mode 100644 index e6df9f68..00000000 --- a/Migration.Toolkit.KX13/Models/CmsMetaFile.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_MetaFile")] -[Index("MetaFileGuid", "MetaFileSiteId", "MetaFileObjectType", "MetaFileObjectId", "MetaFileGroupName", Name = "IX_CMS_MetaFile_MetaFileGUID_MetaFileSiteID_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName")] -[Index("MetaFileSiteId", Name = "IX_CMS_MetaFile_MetaFileSiteID")] -public class CmsMetaFile -{ - [Key] - [Column("MetaFileID")] - public int MetaFileId { get; set; } - - [Column("MetaFileObjectID")] - public int MetaFileObjectId { get; set; } - - [StringLength(100)] - public string MetaFileObjectType { get; set; } = null!; - - [StringLength(100)] - public string? MetaFileGroupName { get; set; } - - [StringLength(250)] - public string MetaFileName { get; set; } = null!; - - [StringLength(50)] - public string MetaFileExtension { get; set; } = null!; - - public int MetaFileSize { get; set; } - - [StringLength(100)] - public string MetaFileMimeType { get; set; } = null!; - - public byte[]? MetaFileBinary { get; set; } - - public int? MetaFileImageWidth { get; set; } - - public int? MetaFileImageHeight { get; set; } - - [Column("MetaFileGUID")] - public Guid MetaFileGuid { get; set; } - - public DateTime MetaFileLastModified { get; set; } - - [Column("MetaFileSiteID")] - public int? MetaFileSiteId { get; set; } - - [StringLength(250)] - public string? MetaFileTitle { get; set; } - - public string? MetaFileDescription { get; set; } - - public string? MetaFileCustomData { get; set; } - - [ForeignKey("MetaFileSiteId")] - [InverseProperty("CmsMetaFiles")] - public virtual CmsSite? MetaFileSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsModuleLicenseKey.cs b/Migration.Toolkit.KX13/Models/CmsModuleLicenseKey.cs deleted file mode 100644 index 416f81d6..00000000 --- a/Migration.Toolkit.KX13/Models/CmsModuleLicenseKey.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ModuleLicenseKey")] -[Index("ModuleLicenseKeyResourceId", Name = "IX_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID")] -public class CmsModuleLicenseKey -{ - [Key] - [Column("ModuleLicenseKeyID")] - public int ModuleLicenseKeyId { get; set; } - - public Guid ModuleLicenseKeyGuid { get; set; } - - public DateTime ModuleLicenseKeyLastModified { get; set; } - - public string ModuleLicenseKeyLicense { get; set; } = null!; - - [Column("ModuleLicenseKeyResourceID")] - public int ModuleLicenseKeyResourceId { get; set; } - - [ForeignKey("ModuleLicenseKeyResourceId")] - [InverseProperty("CmsModuleLicenseKeys")] - public virtual CmsResource ModuleLicenseKeyResource { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsModuleUsageCounter.cs b/Migration.Toolkit.KX13/Models/CmsModuleUsageCounter.cs deleted file mode 100644 index 185eebc1..00000000 --- a/Migration.Toolkit.KX13/Models/CmsModuleUsageCounter.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -[Table("CMS_ModuleUsageCounter")] -public class CmsModuleUsageCounter -{ - [Column("ModuleUsageCounterID")] - public int ModuleUsageCounterId { get; set; } - - [StringLength(200)] - public string ModuleUsageCounterName { get; set; } = null!; - - public long ModuleUsageCounterValue { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsObjectSetting.cs b/Migration.Toolkit.KX13/Models/CmsObjectSetting.cs deleted file mode 100644 index 91aade8f..00000000 --- a/Migration.Toolkit.KX13/Models/CmsObjectSetting.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ObjectSettings")] -[Index("ObjectCheckedOutByUserId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutByUserID")] -[Index("ObjectCheckedOutVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID")] -[Index("ObjectPublishedVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectPublishedVersionHistoryID")] -[Index("ObjectSettingsObjectId", "ObjectSettingsObjectType", Name = "IX_CMS_ObjectSettings_ObjectSettingsObjectType_ObjectSettingsObjectID", IsUnique = true)] -[Index("ObjectWorkflowStepId", Name = "IX_CMS_ObjectSettings_ObjectWorkflowStepID")] -public class CmsObjectSetting -{ - [Key] - [Column("ObjectSettingsID")] - public int ObjectSettingsId { get; set; } - - public string? ObjectTags { get; set; } - - [Column("ObjectCheckedOutByUserID")] - public int? ObjectCheckedOutByUserId { get; set; } - - public DateTime? ObjectCheckedOutWhen { get; set; } - - [Column("ObjectCheckedOutVersionHistoryID")] - public int? ObjectCheckedOutVersionHistoryId { get; set; } - - [Column("ObjectWorkflowStepID")] - public int? ObjectWorkflowStepId { get; set; } - - [Column("ObjectPublishedVersionHistoryID")] - public int? ObjectPublishedVersionHistoryId { get; set; } - - [Column("ObjectSettingsObjectID")] - public int ObjectSettingsObjectId { get; set; } - - [StringLength(100)] - public string ObjectSettingsObjectType { get; set; } = null!; - - public string? ObjectComments { get; set; } - - public bool? ObjectWorkflowSendEmails { get; set; } - - [ForeignKey("ObjectCheckedOutByUserId")] - [InverseProperty("CmsObjectSettings")] - public virtual CmsUser? ObjectCheckedOutByUser { get; set; } - - [ForeignKey("ObjectCheckedOutVersionHistoryId")] - [InverseProperty("CmsObjectSettingObjectCheckedOutVersionHistories")] - public virtual CmsObjectVersionHistory? ObjectCheckedOutVersionHistory { get; set; } - - [ForeignKey("ObjectPublishedVersionHistoryId")] - [InverseProperty("CmsObjectSettingObjectPublishedVersionHistories")] - public virtual CmsObjectVersionHistory? ObjectPublishedVersionHistory { get; set; } - - [ForeignKey("ObjectWorkflowStepId")] - [InverseProperty("CmsObjectSettings")] - public virtual CmsWorkflowStep? ObjectWorkflowStep { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsObjectVersionHistory.cs b/Migration.Toolkit.KX13/Models/CmsObjectVersionHistory.cs deleted file mode 100644 index 628ebf96..00000000 --- a/Migration.Toolkit.KX13/Models/CmsObjectVersionHistory.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ObjectVersionHistory")] -[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionModifiedByUserId", Name = "IX_CMS_ObjectVersionHistory_VersionModifiedByUserID")] -[Index("VersionObjectSiteId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectSiteID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionObjectType", "VersionObjectId", "VersionModifiedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectType_VersionObjectID_VersionModifiedWhen", IsDescending = new[] { false, false, true })] -public class CmsObjectVersionHistory -{ - [Key] - [Column("VersionID")] - public int VersionId { get; set; } - - [Column("VersionObjectID")] - public int? VersionObjectId { get; set; } - - [StringLength(100)] - public string VersionObjectType { get; set; } = null!; - - [Column("VersionObjectSiteID")] - public int? VersionObjectSiteId { get; set; } - - [StringLength(450)] - public string VersionObjectDisplayName { get; set; } = null!; - - [Column("VersionXML")] - public string VersionXml { get; set; } = null!; - - [Column("VersionBinaryDataXML")] - public string? VersionBinaryDataXml { get; set; } - - [Column("VersionModifiedByUserID")] - public int? VersionModifiedByUserId { get; set; } - - public DateTime VersionModifiedWhen { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [StringLength(50)] - public string VersionNumber { get; set; } = null!; - - [Column("VersionSiteBindingIDs")] - public string? VersionSiteBindingIds { get; set; } - - public string? VersionComment { get; set; } - - [InverseProperty("ObjectCheckedOutVersionHistory")] - public virtual ICollection CmsObjectSettingObjectCheckedOutVersionHistories { get; set; } = new List(); - - [InverseProperty("ObjectPublishedVersionHistory")] - public virtual ICollection CmsObjectSettingObjectPublishedVersionHistories { get; set; } = new List(); - - [ForeignKey("VersionDeletedByUserId")] - [InverseProperty("CmsObjectVersionHistoryVersionDeletedByUsers")] - public virtual CmsUser? VersionDeletedByUser { get; set; } - - [ForeignKey("VersionModifiedByUserId")] - [InverseProperty("CmsObjectVersionHistoryVersionModifiedByUsers")] - public virtual CmsUser? VersionModifiedByUser { get; set; } - - [ForeignKey("VersionObjectSiteId")] - [InverseProperty("CmsObjectVersionHistories")] - public virtual CmsSite? VersionObjectSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsObjectWorkflowTrigger.cs b/Migration.Toolkit.KX13/Models/CmsObjectWorkflowTrigger.cs deleted file mode 100644 index 4f5b5daa..00000000 --- a/Migration.Toolkit.KX13/Models/CmsObjectWorkflowTrigger.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ObjectWorkflowTrigger")] -[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] -public class CmsObjectWorkflowTrigger -{ - [Key] - [Column("TriggerID")] - public int TriggerId { get; set; } - - [Column("TriggerGUID")] - public Guid TriggerGuid { get; set; } - - public DateTime TriggerLastModified { get; set; } - - public int TriggerType { get; set; } - - public string? TriggerMacroCondition { get; set; } - - [Column("TriggerWorkflowID")] - public int TriggerWorkflowId { get; set; } - - [StringLength(450)] - public string TriggerDisplayName { get; set; } = null!; - - [StringLength(100)] - public string TriggerObjectType { get; set; } = null!; - - public string? TriggerParameters { get; set; } - - [StringLength(100)] - public string? TriggerTargetObjectType { get; set; } - - [Column("TriggerTargetObjectID")] - public int? TriggerTargetObjectId { get; set; } - - [ForeignKey("TriggerWorkflowId")] - [InverseProperty("CmsObjectWorkflowTriggers")] - public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsPageFormerUrlPath.cs b/Migration.Toolkit.KX13/Models/CmsPageFormerUrlPath.cs deleted file mode 100644 index 8cf4fba7..00000000 --- a/Migration.Toolkit.KX13/Models/CmsPageFormerUrlPath.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_PageFormerUrlPath")] -[Index("PageFormerUrlPathNodeId", Name = "IX_CMS_PageFormerUrlPath_PageFormerUrlPathNodeID")] -[Index("PageFormerUrlPathSiteId", Name = "IX_CMS_PageFormerUrlPath_PageFormerUrlPathSiteID")] -[Index("PageFormerUrlPathUrlPathHash", "PageFormerUrlPathCulture", "PageFormerUrlPathSiteId", Name = "IX_CMS_PageFormerUrlPath_UrlPathHash_Culture_SiteID", IsUnique = true)] -public class CmsPageFormerUrlPath -{ - [Key] - [Column("PageFormerUrlPathID")] - public int PageFormerUrlPathId { get; set; } - - [StringLength(2000)] - public string PageFormerUrlPathUrlPath { get; set; } = null!; - - [StringLength(64)] - public string PageFormerUrlPathUrlPathHash { get; set; } = null!; - - [StringLength(50)] - public string PageFormerUrlPathCulture { get; set; } = null!; - - [Column("PageFormerUrlPathNodeID")] - public int PageFormerUrlPathNodeId { get; set; } - - [Column("PageFormerUrlPathSiteID")] - public int PageFormerUrlPathSiteId { get; set; } - - public DateTime PageFormerUrlPathLastModified { get; set; } - - [ForeignKey("PageFormerUrlPathNodeId")] - [InverseProperty("CmsPageFormerUrlPaths")] - public virtual CmsTree PageFormerUrlPathNode { get; set; } = null!; - - [ForeignKey("PageFormerUrlPathSiteId")] - [InverseProperty("CmsPageFormerUrlPaths")] - public virtual CmsSite PageFormerUrlPathSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsPageTemplate.cs b/Migration.Toolkit.KX13/Models/CmsPageTemplate.cs deleted file mode 100644 index 252dee39..00000000 --- a/Migration.Toolkit.KX13/Models/CmsPageTemplate.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_PageTemplate")] -[Index("PageTemplateCodeName", "PageTemplateDisplayName", Name = "IX_CMS_PageTemplate_PageTemplateCodeName_PageTemplateDisplayName")] -[Index("PageTemplateLayoutId", Name = "IX_CMS_PageTemplate_PageTemplateLayoutID")] -public class CmsPageTemplate -{ - [Key] - [Column("PageTemplateID")] - public int PageTemplateId { get; set; } - - [StringLength(200)] - public string PageTemplateDisplayName { get; set; } = null!; - - [StringLength(100)] - public string PageTemplateCodeName { get; set; } = null!; - - public string? PageTemplateDescription { get; set; } - - [Column("PageTemplateCategoryID")] - public int? PageTemplateCategoryId { get; set; } - - [Column("PageTemplateLayoutID")] - public int? PageTemplateLayoutId { get; set; } - - public string? PageTemplateWebParts { get; set; } - - public string? PageTemplateLayout { get; set; } - - [Column("PageTemplateVersionGUID")] - [StringLength(200)] - public string? PageTemplateVersionGuid { get; set; } - - [Column("PageTemplateGUID")] - public Guid PageTemplateGuid { get; set; } - - public DateTime PageTemplateLastModified { get; set; } - - [StringLength(10)] - public string PageTemplateType { get; set; } = null!; - - [StringLength(50)] - public string? PageTemplateLayoutType { get; set; } - - [Column("PageTemplateCSS")] - public string? PageTemplateCss { get; set; } - - [Column("PageTemplateThumbnailGUID")] - public Guid? PageTemplateThumbnailGuid { get; set; } - - public string? PageTemplateProperties { get; set; } - - public bool? PageTemplateIsLayout { get; set; } - - [StringLength(200)] - public string? PageTemplateIconClass { get; set; } - - [InverseProperty("ElementPageTemplate")] - public virtual ICollection CmsUielements { get; set; } = new List(); - - [ForeignKey("PageTemplateCategoryId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsPageTemplateCategory? PageTemplateCategory { get; set; } - - [ForeignKey("PageTemplateLayoutId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsLayout? PageTemplateLayoutNavigation { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsPageTemplateCategory.cs b/Migration.Toolkit.KX13/Models/CmsPageTemplateCategory.cs deleted file mode 100644 index e1e5fc01..00000000 --- a/Migration.Toolkit.KX13/Models/CmsPageTemplateCategory.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_PageTemplateCategory")] -[Index("CategoryLevel", Name = "IX_CMS_PageTemplateCategory_CategoryLevel")] -[Index("CategoryParentId", Name = "IX_CMS_PageTemplateCategory_CategoryParentID")] -public class CmsPageTemplateCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(200)] - public string? CategoryName { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryTemplateChildCount { get; set; } - - public string? CategoryPath { get; set; } - - public int? CategoryLevel { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsPageTemplateCategory? CategoryParent { get; set; } - - [InverseProperty("PageTemplateCategory")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsPageTemplateConfiguration.cs b/Migration.Toolkit.KX13/Models/CmsPageTemplateConfiguration.cs deleted file mode 100644 index 52c39233..00000000 --- a/Migration.Toolkit.KX13/Models/CmsPageTemplateConfiguration.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_PageTemplateConfiguration")] -[Index("PageTemplateConfigurationSiteId", Name = "IX_CMS_PageTemplateConfiguration_PageTemplateConfigurationSiteID")] -public class CmsPageTemplateConfiguration -{ - [Key] - [Column("PageTemplateConfigurationID")] - public int PageTemplateConfigurationId { get; set; } - - [Column("PageTemplateConfigurationGUID")] - public Guid PageTemplateConfigurationGuid { get; set; } - - [Column("PageTemplateConfigurationSiteID")] - public int PageTemplateConfigurationSiteId { get; set; } - - public DateTime PageTemplateConfigurationLastModified { get; set; } - - [StringLength(200)] - public string PageTemplateConfigurationName { get; set; } = null!; - - public string? PageTemplateConfigurationDescription { get; set; } - - [Column("PageTemplateConfigurationThumbnailGUID")] - public Guid? PageTemplateConfigurationThumbnailGuid { get; set; } - - public string PageTemplateConfigurationTemplate { get; set; } = null!; - - public string? PageTemplateConfigurationWidgets { get; set; } - - [ForeignKey("PageTemplateConfigurationSiteId")] - [InverseProperty("CmsPageTemplateConfigurations")] - public virtual CmsSite PageTemplateConfigurationSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsPageUrlPath.cs b/Migration.Toolkit.KX13/Models/CmsPageUrlPath.cs deleted file mode 100644 index 21331870..00000000 --- a/Migration.Toolkit.KX13/Models/CmsPageUrlPath.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_PageUrlPath")] -[Index("PageUrlPathNodeId", Name = "IX_CMS_PageUrlPath_PageUrlPathNodeID")] -[Index("PageUrlPathSiteId", Name = "IX_CMS_PageUrlPath_PageUrlPathSiteID")] -[Index("PageUrlPathUrlPathHash", "PageUrlPathCulture", "PageUrlPathSiteId", Name = "IX_CMS_PageUrlPath_PageUrlPathUrlPathHash_PageUrlPathCulture_PageUrlPathSiteID", IsUnique = true)] -public class CmsPageUrlPath -{ - [Key] - [Column("PageUrlPathID")] - public int PageUrlPathId { get; set; } - - [Column("PageUrlPathGUID")] - public Guid PageUrlPathGuid { get; set; } - - [StringLength(50)] - public string PageUrlPathCulture { get; set; } = null!; - - [Column("PageUrlPathNodeID")] - public int PageUrlPathNodeId { get; set; } - - [StringLength(2000)] - public string PageUrlPathUrlPath { get; set; } = null!; - - [StringLength(64)] - public string PageUrlPathUrlPathHash { get; set; } = null!; - - [Column("PageUrlPathSiteID")] - public int PageUrlPathSiteId { get; set; } - - public DateTime PageUrlPathLastModified { get; set; } - - [ForeignKey("PageUrlPathNodeId")] - [InverseProperty("CmsPageUrlPaths")] - public virtual CmsTree PageUrlPathNode { get; set; } = null!; - - [ForeignKey("PageUrlPathSiteId")] - [InverseProperty("CmsPageUrlPaths")] - public virtual CmsSite PageUrlPathSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsPermission.cs b/Migration.Toolkit.KX13/Models/CmsPermission.cs deleted file mode 100644 index 4b0bffde..00000000 --- a/Migration.Toolkit.KX13/Models/CmsPermission.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Permission")] -[Index("ClassId", "PermissionName", Name = "IX_CMS_Permission_ClassID_PermissionName")] -[Index("ResourceId", "PermissionName", Name = "IX_CMS_Permission_ResourceID_PermissionName")] -public class CmsPermission -{ - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [StringLength(100)] - public string PermissionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string PermissionName { get; set; } = null!; - - [Column("ClassID")] - public int? ClassId { get; set; } - - [Column("ResourceID")] - public int? ResourceId { get; set; } - - [Column("PermissionGUID")] - public Guid PermissionGuid { get; set; } - - public DateTime PermissionLastModified { get; set; } - - public string? PermissionDescription { get; set; } - - public bool? PermissionDisplayInMatrix { get; set; } - - public int? PermissionOrder { get; set; } - - public bool? PermissionEditableByGlobalAdmin { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsPermissions")] - public virtual CmsClass? Class { get; set; } - - [InverseProperty("Permission")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); - - [ForeignKey("ResourceId")] - [InverseProperty("CmsPermissions")] - public virtual CmsResource? Resource { get; set; } - - [ForeignKey("PermissionId")] - [InverseProperty("Permissions")] - public virtual ICollection Roles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsPersonalization.cs b/Migration.Toolkit.KX13/Models/CmsPersonalization.cs deleted file mode 100644 index 7950b1ae..00000000 --- a/Migration.Toolkit.KX13/Models/CmsPersonalization.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Personalization")] -[Index("PersonalizationSiteId", Name = "IX_CMS_Personalization_PersonalizationSiteID_SiteID")] -[Index("PersonalizationUserId", Name = "IX_CMS_Personalization_PersonalizationUserID")] -public class CmsPersonalization -{ - [Key] - [Column("PersonalizationID")] - public int PersonalizationId { get; set; } - - [Column("PersonalizationGUID")] - public Guid PersonalizationGuid { get; set; } - - public DateTime PersonalizationLastModified { get; set; } - - [Column("PersonalizationUserID")] - public int? PersonalizationUserId { get; set; } - - public string? PersonalizationWebParts { get; set; } - - [StringLength(200)] - public string? PersonalizationDashboardName { get; set; } - - [Column("PersonalizationSiteID")] - public int? PersonalizationSiteId { get; set; } - - [ForeignKey("PersonalizationSiteId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsSite? PersonalizationSite { get; set; } - - [ForeignKey("PersonalizationUserId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsUser? PersonalizationUser { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsQuery.cs b/Migration.Toolkit.KX13/Models/CmsQuery.cs deleted file mode 100644 index deafbba8..00000000 --- a/Migration.Toolkit.KX13/Models/CmsQuery.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Query")] -[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] -public class CmsQuery -{ - [Key] - [Column("QueryID")] - public int QueryId { get; set; } - - [StringLength(100)] - public string QueryName { get; set; } = null!; - - [Column("QueryTypeID")] - public int QueryTypeId { get; set; } - - public string QueryText { get; set; } = null!; - - public bool QueryRequiresTransaction { get; set; } - - [Column("ClassID")] - public int? ClassId { get; set; } - - public bool QueryIsLocked { get; set; } - - public DateTime QueryLastModified { get; set; } - - [Column("QueryGUID")] - public Guid QueryGuid { get; set; } - - public bool? QueryIsCustom { get; set; } - - [StringLength(100)] - public string? QueryConnectionString { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsQueries")] - public virtual CmsClass? Class { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsRelationship.cs b/Migration.Toolkit.KX13/Models/CmsRelationship.cs deleted file mode 100644 index 1931440c..00000000 --- a/Migration.Toolkit.KX13/Models/CmsRelationship.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Relationship")] -[Index("LeftNodeId", Name = "IX_CMS_Relationship_LeftNodeID")] -[Index("RelationshipNameId", Name = "IX_CMS_Relationship_RelationshipNameID")] -[Index("RightNodeId", Name = "IX_CMS_Relationship_RightNodeID")] -public class CmsRelationship -{ - [Key] - [Column("RelationshipID")] - public int RelationshipId { get; set; } - - [Column("LeftNodeID")] - public int LeftNodeId { get; set; } - - [Column("RightNodeID")] - public int RightNodeId { get; set; } - - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - public string? RelationshipCustomData { get; set; } - - public int? RelationshipOrder { get; set; } - - public bool? RelationshipIsAdHoc { get; set; } - - [ForeignKey("LeftNodeId")] - [InverseProperty("CmsRelationshipLeftNodes")] - public virtual CmsTree LeftNode { get; set; } = null!; - - [ForeignKey("RelationshipNameId")] - [InverseProperty("CmsRelationships")] - public virtual CmsRelationshipName RelationshipName { get; set; } = null!; - - [ForeignKey("RightNodeId")] - [InverseProperty("CmsRelationshipRightNodes")] - public virtual CmsTree RightNode { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsRelationshipName.cs b/Migration.Toolkit.KX13/Models/CmsRelationshipName.cs deleted file mode 100644 index f63cf485..00000000 --- a/Migration.Toolkit.KX13/Models/CmsRelationshipName.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_RelationshipName")] -[Index("RelationshipAllowedObjects", Name = "IX_CMS_RelationshipName_RelationshipAllowedObjects")] -[Index("RelationshipName", "RelationshipDisplayName", Name = "IX_CMS_RelationshipName_RelationshipName_RelationshipDisplayName")] -public class CmsRelationshipName -{ - [Key] - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - [StringLength(200)] - public string RelationshipDisplayName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipName { get; set; } = null!; - - public string? RelationshipAllowedObjects { get; set; } - - [Column("RelationshipGUID")] - public Guid RelationshipGuid { get; set; } - - public DateTime RelationshipLastModified { get; set; } - - public bool? RelationshipNameIsAdHoc { get; set; } - - [InverseProperty("RelationshipName")] - public virtual ICollection CmsRelationships { get; set; } = new List(); - - [ForeignKey("RelationshipNameId")] - [InverseProperty("RelationshipNames")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsResource.cs b/Migration.Toolkit.KX13/Models/CmsResource.cs deleted file mode 100644 index 692847db..00000000 --- a/Migration.Toolkit.KX13/Models/CmsResource.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Resource")] -[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] -public class CmsResource -{ - [Key] - [Column("ResourceID")] - public int ResourceId { get; set; } - - [StringLength(100)] - public string ResourceDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - public string? ResourceDescription { get; set; } - - public bool? ShowInDevelopment { get; set; } - - [Column("ResourceURL")] - [StringLength(1000)] - public string? ResourceUrl { get; set; } - - [Column("ResourceGUID")] - public Guid ResourceGuid { get; set; } - - public DateTime ResourceLastModified { get; set; } - - public bool? ResourceIsInDevelopment { get; set; } - - public bool? ResourceHasFiles { get; set; } - - [StringLength(200)] - public string? ResourceVersion { get; set; } - - [StringLength(200)] - public string? ResourceAuthor { get; set; } - - [StringLength(50)] - public string? ResourceInstallationState { get; set; } - - [StringLength(50)] - public string? ResourceInstalledVersion { get; set; } - - [InverseProperty("ClassResource")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("UserControlResource")] - public virtual ICollection CmsFormUserControls { get; set; } = new List(); - - [InverseProperty("ModuleLicenseKeyResource")] - public virtual ICollection CmsModuleLicenseKeys { get; set; } = new List(); - - [InverseProperty("Resource")] - public virtual ICollection CmsPermissions { get; set; } = new List(); - - [InverseProperty("ResourceLibraryResource")] - public virtual ICollection CmsResourceLibraries { get; set; } = new List(); - - [InverseProperty("TaskResource")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("CategoryResource")] - public virtual ICollection CmsSettingsCategories { get; set; } = new List(); - - [InverseProperty("ElementResource")] - public virtual ICollection CmsUielements { get; set; } = new List(); - - [InverseProperty("WebPartResource")] - public virtual ICollection CmsWebParts { get; set; } = new List(); - - [InverseProperty("ActionResource")] - public virtual ICollection CmsWorkflowActions { get; set; } = new List(); - - [ForeignKey("ResourceId")] - [InverseProperty("Resources")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsResourceLibrary.cs b/Migration.Toolkit.KX13/Models/CmsResourceLibrary.cs deleted file mode 100644 index 84ceb3b2..00000000 --- a/Migration.Toolkit.KX13/Models/CmsResourceLibrary.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ResourceLibrary")] -[Index("ResourceLibraryResourceId", Name = "IX_CMS_ResourceLibrary")] -public class CmsResourceLibrary -{ - [Key] - [Column("ResourceLibraryID")] - public int ResourceLibraryId { get; set; } - - [Column("ResourceLibraryResourceID")] - public int ResourceLibraryResourceId { get; set; } - - [StringLength(200)] - public string ResourceLibraryPath { get; set; } = null!; - - [ForeignKey("ResourceLibraryResourceId")] - [InverseProperty("CmsResourceLibraries")] - public virtual CmsResource ResourceLibraryResource { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsResourceString.cs b/Migration.Toolkit.KX13/Models/CmsResourceString.cs deleted file mode 100644 index 761d3b81..00000000 --- a/Migration.Toolkit.KX13/Models/CmsResourceString.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ResourceString")] -[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] -public class CmsResourceString -{ - [Key] - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("StringGUID")] - public Guid StringGuid { get; set; } - - [InverseProperty("TranslationString")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsResourceTranslation.cs b/Migration.Toolkit.KX13/Models/CmsResourceTranslation.cs deleted file mode 100644 index ceaa3cfc..00000000 --- a/Migration.Toolkit.KX13/Models/CmsResourceTranslation.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ResourceTranslation")] -[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] -[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] -public class CmsResourceTranslation -{ - [Key] - [Column("TranslationID")] - public int TranslationId { get; set; } - - [Column("TranslationStringID")] - public int TranslationStringId { get; set; } - - public string? TranslationText { get; set; } - - [Column("TranslationCultureID")] - public int TranslationCultureId { get; set; } - - [ForeignKey("TranslationCultureId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsCulture TranslationCulture { get; set; } = null!; - - [ForeignKey("TranslationStringId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsResourceString TranslationString { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsRole.cs b/Migration.Toolkit.KX13/Models/CmsRole.cs deleted file mode 100644 index 6bb47832..00000000 --- a/Migration.Toolkit.KX13/Models/CmsRole.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Role")] -[Index("SiteId", "RoleId", Name = "IX_CMS_Role_SiteID_RoleID")] -public class CmsRole -{ - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - public DateTime RoleLastModified { get; set; } - - public bool? RoleIsDomain { get; set; } - - [InverseProperty("Role")] - public virtual ICollection CmsAclitems { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("CmsRoles")] - public virtual CmsSite? Site { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Elements { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("RolesNavigation")] - public virtual ICollection ElementsNavigation { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Forms { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Memberships { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Permissions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsScheduledTask.cs b/Migration.Toolkit.KX13/Models/CmsScheduledTask.cs deleted file mode 100644 index 266457bd..00000000 --- a/Migration.Toolkit.KX13/Models/CmsScheduledTask.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ScheduledTask")] -[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] -[Index("TaskResourceId", Name = "IX_CMS_ScheduledTask_TaskResourceID")] -[Index("TaskSiteId", "TaskDisplayName", Name = "IX_CMS_ScheduledTask_TaskSiteID_TaskDisplayName")] -[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] -public class CmsScheduledTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(200)] - public string TaskName { get; set; } = null!; - - [StringLength(200)] - public string TaskDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TaskAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string? TaskClass { get; set; } - - [StringLength(1000)] - public string TaskInterval { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime? TaskLastRunTime { get; set; } - - public DateTime? TaskNextRunTime { get; set; } - - public string? TaskLastResult { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - public bool? TaskDeleteAfterLastRun { get; set; } - - [StringLength(100)] - public string? TaskServerName { get; set; } - - [Column("TaskGUID")] - public Guid TaskGuid { get; set; } - - public DateTime TaskLastModified { get; set; } - - public int? TaskExecutions { get; set; } - - [Column("TaskResourceID")] - public int? TaskResourceId { get; set; } - - public bool? TaskRunInSeparateThread { get; set; } - - public bool? TaskUseExternalService { get; set; } - - public bool? TaskAllowExternalService { get; set; } - - public DateTime? TaskLastExecutionReset { get; set; } - - [StringLength(400)] - public string? TaskCondition { get; set; } - - public bool? TaskRunIndividually { get; set; } - - [Column("TaskUserID")] - public int? TaskUserId { get; set; } - - public int? TaskType { get; set; } - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [StringLength(200)] - public string? TaskExecutingServerName { get; set; } - - public bool TaskEnabled { get; set; } - - public bool TaskIsRunning { get; set; } - - public int TaskAvailability { get; set; } - - [InverseProperty("CampaignScheduledTask")] - public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); - - [InverseProperty("TestWinnerScheduledTask")] - public virtual ICollection NewsletterAbtests { get; set; } = new List(); - - [InverseProperty("NewsletterDynamicScheduledTask")] - public virtual ICollection NewsletterNewsletters { get; set; } = new List(); - - [ForeignKey("TaskResourceId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsResource? TaskResource { get; set; } - - [ForeignKey("TaskSiteId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsSite? TaskSite { get; set; } - - [ForeignKey("TaskUserId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsUser? TaskUser { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsSearchEngine.cs b/Migration.Toolkit.KX13/Models/CmsSearchEngine.cs deleted file mode 100644 index 40f37e19..00000000 --- a/Migration.Toolkit.KX13/Models/CmsSearchEngine.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SearchEngine")] -public class CmsSearchEngine -{ - [Key] - [Column("SearchEngineID")] - public int SearchEngineId { get; set; } - - [StringLength(200)] - public string SearchEngineDisplayName { get; set; } = null!; - - [StringLength(200)] - public string SearchEngineName { get; set; } = null!; - - [StringLength(450)] - public string SearchEngineDomainRule { get; set; } = null!; - - [StringLength(200)] - public string? SearchEngineKeywordParameter { get; set; } - - [Column("SearchEngineGUID")] - public Guid SearchEngineGuid { get; set; } - - public DateTime SearchEngineLastModified { get; set; } - - [StringLength(200)] - public string? SearchEngineCrawler { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsSearchIndex.cs b/Migration.Toolkit.KX13/Models/CmsSearchIndex.cs deleted file mode 100644 index 1845b4c1..00000000 --- a/Migration.Toolkit.KX13/Models/CmsSearchIndex.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SearchIndex")] -public class CmsSearchIndex -{ - [Key] - [Column("IndexID")] - public int IndexId { get; set; } - - [StringLength(200)] - public string IndexName { get; set; } = null!; - - [StringLength(200)] - public string IndexDisplayName { get; set; } = null!; - - [StringLength(200)] - public string? IndexAnalyzerType { get; set; } - - public string? IndexSettings { get; set; } - - [Column("IndexGUID")] - public Guid IndexGuid { get; set; } - - public DateTime IndexLastModified { get; set; } - - public DateTime? IndexLastRebuildTime { get; set; } - - [StringLength(200)] - public string IndexType { get; set; } = null!; - - [StringLength(200)] - public string? IndexStopWordsFile { get; set; } - - [StringLength(200)] - public string? IndexCustomAnalyzerAssemblyName { get; set; } - - [StringLength(200)] - public string? IndexCustomAnalyzerClassName { get; set; } - - public int? IndexBatchSize { get; set; } - - [StringLength(10)] - public string? IndexStatus { get; set; } - - public DateTime? IndexLastUpdate { get; set; } - - public bool? IndexIsOutdated { get; set; } - - [StringLength(200)] - public string IndexProvider { get; set; } = null!; - - [StringLength(200)] - public string? IndexSearchServiceName { get; set; } - - [StringLength(200)] - public string? IndexAdminKey { get; set; } - - [StringLength(200)] - public string? IndexQueryKey { get; set; } - - [StringLength(200)] - public string? IndexCrawlerUser { get; set; } - - [ForeignKey("IndexId")] - [InverseProperty("Indices")] - public virtual ICollection IndexCultures { get; set; } = new List(); - - [ForeignKey("IndexId")] - [InverseProperty("Indices")] - public virtual ICollection IndexSites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsSearchTask.cs b/Migration.Toolkit.KX13/Models/CmsSearchTask.cs deleted file mode 100644 index 2ebccb40..00000000 --- a/Migration.Toolkit.KX13/Models/CmsSearchTask.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SearchTask")] -public class CmsSearchTask -{ - [Key] - [Column("SearchTaskID")] - public int SearchTaskId { get; set; } - - [StringLength(100)] - public string SearchTaskType { get; set; } = null!; - - [StringLength(100)] - public string? SearchTaskObjectType { get; set; } - - [StringLength(200)] - public string? SearchTaskField { get; set; } - - [StringLength(600)] - public string SearchTaskValue { get; set; } = null!; - - [StringLength(200)] - public string? SearchTaskServerName { get; set; } - - [StringLength(100)] - public string SearchTaskStatus { get; set; } = null!; - - public int SearchTaskPriority { get; set; } - - public DateTime SearchTaskCreated { get; set; } - - public string? SearchTaskErrorMessage { get; set; } - - [Column("SearchTaskRelatedObjectID")] - public int? SearchTaskRelatedObjectId { get; set; } - - [StringLength(100)] - public string? SearchTaskIndexerName { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsSearchTaskAzure.cs b/Migration.Toolkit.KX13/Models/CmsSearchTaskAzure.cs deleted file mode 100644 index 25281979..00000000 --- a/Migration.Toolkit.KX13/Models/CmsSearchTaskAzure.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SearchTaskAzure")] -[Index("SearchTaskAzurePriority", Name = "IX_CMS_SearchTaskAzure_SearchTaskAzurePriority", AllDescending = true)] -public class CmsSearchTaskAzure -{ - [Key] - [Column("SearchTaskAzureID")] - public int SearchTaskAzureId { get; set; } - - [StringLength(100)] - public string SearchTaskAzureType { get; set; } = null!; - - [StringLength(100)] - public string? SearchTaskAzureObjectType { get; set; } - - [StringLength(200)] - public string? SearchTaskAzureMetadata { get; set; } - - [StringLength(600)] - public string SearchTaskAzureAdditionalData { get; set; } = null!; - - [Column("SearchTaskAzureInitiatorObjectID")] - public int? SearchTaskAzureInitiatorObjectId { get; set; } - - public int SearchTaskAzurePriority { get; set; } - - public string? SearchTaskAzureErrorMessage { get; set; } - - public DateTime SearchTaskAzureCreated { get; set; } - - [StringLength(100)] - public string? SearchTaskAzureIndexerName { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsSettingsCategory.cs b/Migration.Toolkit.KX13/Models/CmsSettingsCategory.cs deleted file mode 100644 index dfc27e04..00000000 --- a/Migration.Toolkit.KX13/Models/CmsSettingsCategory.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SettingsCategory")] -[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] -[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] -public class CmsSettingsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - public int? CategoryOrder { get; set; } - - [StringLength(100)] - public string? CategoryName { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - [StringLength(200)] - public string? CategoryIconPath { get; set; } - - public bool? CategoryIsGroup { get; set; } - - public bool? CategoryIsCustom { get; set; } - - [Column("CategoryResourceID")] - public int? CategoryResourceId { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsSettingsCategory? CategoryParent { get; set; } - - [ForeignKey("CategoryResourceId")] - [InverseProperty("CmsSettingsCategories")] - public virtual CmsResource? CategoryResource { get; set; } - - [InverseProperty("KeyCategory")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsSettingsKey.cs b/Migration.Toolkit.KX13/Models/CmsSettingsKey.cs deleted file mode 100644 index faea7229..00000000 --- a/Migration.Toolkit.KX13/Models/CmsSettingsKey.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SettingsKey")] -[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] -[Index("SiteId", "KeyName", Name = "IX_CMS_SettingsKey_SiteID_KeyName")] -public class CmsSettingsKey -{ - [Key] - [Column("KeyID")] - public int KeyId { get; set; } - - [StringLength(100)] - public string KeyName { get; set; } = null!; - - [StringLength(200)] - public string KeyDisplayName { get; set; } = null!; - - public string? KeyDescription { get; set; } - - public string? KeyValue { get; set; } - - [StringLength(50)] - public string KeyType { get; set; } = null!; - - [Column("KeyCategoryID")] - public int? KeyCategoryId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("KeyGUID")] - public Guid KeyGuid { get; set; } - - public DateTime KeyLastModified { get; set; } - - public int? KeyOrder { get; set; } - - public string? KeyDefaultValue { get; set; } - - [StringLength(255)] - public string? KeyValidation { get; set; } - - [StringLength(200)] - public string? KeyEditingControlPath { get; set; } - - public bool? KeyIsGlobal { get; set; } - - public bool? KeyIsCustom { get; set; } - - public bool? KeyIsHidden { get; set; } - - public string? KeyFormControlSettings { get; set; } - - public string? KeyExplanationText { get; set; } - - [ForeignKey("KeyCategoryId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSettingsCategory? KeyCategory { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSite? Site { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsSite.cs b/Migration.Toolkit.KX13/Models/CmsSite.cs deleted file mode 100644 index f04cc503..00000000 --- a/Migration.Toolkit.KX13/Models/CmsSite.cs +++ /dev/null @@ -1,310 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Site")] -[Index("SiteDomainName", "SiteStatus", Name = "IX_CMS_Site_SiteDomainName_SiteStatus")] -[Index("SiteName", Name = "IX_CMS_Site_SiteName")] -public class CmsSite -{ - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - [StringLength(200)] - public string SiteDisplayName { get; set; } = null!; - - public string? SiteDescription { get; set; } - - [StringLength(20)] - public string SiteStatus { get; set; } = null!; - - [StringLength(400)] - public string SiteDomainName { get; set; } = null!; - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - [Column("SiteGUID")] - public Guid SiteGuid { get; set; } - - public DateTime SiteLastModified { get; set; } - - [Column("SitePresentationURL")] - [StringLength(400)] - public string SitePresentationUrl { get; set; } = null!; - - [InverseProperty("CampaignSite")] - public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); - - [InverseProperty("ExitPageSite")] - public virtual ICollection AnalyticsExitPages { get; set; } = new List(); - - [InverseProperty("StatisticsSite")] - public virtual ICollection AnalyticsStatistics { get; set; } = new List(); - - [InverseProperty("Aclsite")] - public virtual ICollection CmsAcls { get; set; } = new List(); - - [InverseProperty("AlternativeUrlSite")] - public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection CmsAttachmentHistories { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection CmsAttachments { get; set; } = new List(); - - [InverseProperty("StateSite")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("CategorySite")] - public virtual ICollection CmsCategories { get; set; } = new List(); - - [InverseProperty("ScopeSite")] - public virtual ICollection CmsDocumentTypeScopes { get; set; } = new List(); - - [InverseProperty("EmailTemplateSite")] - public virtual ICollection CmsEmailTemplates { get; set; } = new List(); - - [InverseProperty("FormSite")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("MembershipSite")] - public virtual ICollection CmsMemberships { get; set; } = new List(); - - [InverseProperty("MetaFileSite")] - public virtual ICollection CmsMetaFiles { get; set; } = new List(); - - [InverseProperty("VersionObjectSite")] - public virtual ICollection CmsObjectVersionHistories { get; set; } = new List(); - - [InverseProperty("PageFormerUrlPathSite")] - public virtual ICollection CmsPageFormerUrlPaths { get; set; } = new List(); - - [InverseProperty("PageTemplateConfigurationSite")] - public virtual ICollection CmsPageTemplateConfigurations { get; set; } = new List(); - - [InverseProperty("PageUrlPathSite")] - public virtual ICollection CmsPageUrlPaths { get; set; } = new List(); - - [InverseProperty("PersonalizationSite")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsRoles { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsSiteDomainAliases { get; set; } = new List(); - - [InverseProperty("TagGroupSite")] - public virtual ICollection CmsTagGroups { get; set; } = new List(); - - [InverseProperty("NodeLinkedNodeSite")] - public virtual ICollection CmsTreeNodeLinkedNodeSites { get; set; } = new List(); - - [InverseProperty("NodeSite")] - public virtual ICollection CmsTreeNodeSites { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsUserSites { get; set; } = new List(); - - [InverseProperty("NodeSite")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("ScopeSite")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [InverseProperty("BrandSite")] - public virtual ICollection ComBrands { get; set; } = new List(); - - [InverseProperty("CarrierSite")] - public virtual ICollection ComCarriers { get; set; } = new List(); - - [InverseProperty("CollectionSite")] - public virtual ICollection ComCollections { get; set; } = new List(); - - [InverseProperty("CurrencySite")] - public virtual ICollection ComCurrencies { get; set; } = new List(); - - [InverseProperty("EventSite")] - public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); - - [InverseProperty("CustomerSite")] - public virtual ICollection ComCustomers { get; set; } = new List(); - - [InverseProperty("DepartmentSite")] - public virtual ICollection ComDepartments { get; set; } = new List(); - - [InverseProperty("DiscountSite")] - public virtual ICollection ComDiscounts { get; set; } = new List(); - - [InverseProperty("ExchangeTableSite")] - public virtual ICollection ComExchangeTables { get; set; } = new List(); - - [InverseProperty("GiftCardSite")] - public virtual ICollection ComGiftCards { get; set; } = new List(); - - [InverseProperty("InternalStatusSite")] - public virtual ICollection ComInternalStatuses { get; set; } = new List(); - - [InverseProperty("ManufacturerSite")] - public virtual ICollection ComManufacturers { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscountSite")] - public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); - - [InverseProperty("CategorySite")] - public virtual ICollection ComOptionCategories { get; set; } = new List(); - - [InverseProperty("StatusSite")] - public virtual ICollection ComOrderStatuses { get; set; } = new List(); - - [InverseProperty("OrderSite")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("PaymentOptionSite")] - public virtual ICollection ComPaymentOptions { get; set; } = new List(); - - [InverseProperty("PublicStatusSite")] - public virtual ICollection ComPublicStatuses { get; set; } = new List(); - - [InverseProperty("ShippingOptionSite")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); - - [InverseProperty("ShoppingCartSite")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [InverseProperty("Skusite")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [InverseProperty("SupplierSite")] - public virtual ICollection ComSuppliers { get; set; } = new List(); - - [InverseProperty("TaxClassSite")] - public virtual ICollection ComTaxClasses { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("ExportSite")] - public virtual ICollection ExportHistories { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection ExportTasks { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection IntegrationTasks { get; set; } = new List(); - - [InverseProperty("FileSite")] - public virtual ICollection MediaFiles { get; set; } = new List(); - - [InverseProperty("LibrarySite")] - public virtual ICollection MediaLibraries { get; set; } = new List(); - - [InverseProperty("TemplateSite")] - public virtual ICollection NewsletterEmailTemplates { get; set; } = new List(); - - [InverseProperty("EmailWidgetSite")] - public virtual ICollection NewsletterEmailWidgets { get; set; } = new List(); - - [InverseProperty("EmailSite")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("IssueSite")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [InverseProperty("NewsletterSite")] - public virtual ICollection NewsletterNewsletters { get; set; } = new List(); - - [InverseProperty("SubscriberSite")] - public virtual ICollection NewsletterSubscribers { get; set; } = new List(); - - [InverseProperty("AbtestSite")] - public virtual ICollection OmAbtests { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionSite")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("SharePointConnectionSite")] - public virtual ICollection SharePointSharePointConnections { get; set; } = new List(); - - [InverseProperty("SharePointFileSite")] - public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); - - [InverseProperty("SharePointLibrarySite")] - public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); - - [InverseProperty("FacebookAccountSite")] - public virtual ICollection SmFacebookAccounts { get; set; } = new List(); - - [InverseProperty("FacebookApplicationSite")] - public virtual ICollection SmFacebookApplications { get; set; } = new List(); - - [InverseProperty("FacebookPostSite")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); - - [InverseProperty("LinkedInApplicationSite")] - public virtual ICollection SmLinkedInApplications { get; set; } = new List(); - - [InverseProperty("LinkedInPostSite")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); - - [InverseProperty("TwitterAccountSite")] - public virtual ICollection SmTwitterAccounts { get; set; } = new List(); - - [InverseProperty("TwitterApplicationSite")] - public virtual ICollection SmTwitterApplications { get; set; } = new List(); - - [InverseProperty("TwitterPostSite")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); - - [InverseProperty("ServerSite")] - public virtual ICollection StagingServers { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection StagingTasks { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Classes { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Containers { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Cultures { get; set; } = new List(); - - [ForeignKey("IndexSiteId")] - [InverseProperty("IndexSites")] - public virtual ICollection Indices { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection RelationshipNames { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Resources { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Servers { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsSiteDomainAlias.cs b/Migration.Toolkit.KX13/Models/CmsSiteDomainAlias.cs deleted file mode 100644 index cb2c3057..00000000 --- a/Migration.Toolkit.KX13/Models/CmsSiteDomainAlias.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SiteDomainAlias")] -[Index("SiteDomainAliasName", Name = "IX_CMS_SiteDomainAlias_SiteDomainAliasName")] -[Index("SiteId", Name = "IX_CMS_SiteDomainAlias_SiteID")] -public class CmsSiteDomainAlias -{ - [Key] - [Column("SiteDomainAliasID")] - public int SiteDomainAliasId { get; set; } - - [StringLength(400)] - public string? SiteDomainAliasName { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - [Column("SiteDomainGUID")] - public Guid? SiteDomainGuid { get; set; } - - public DateTime SiteDomainLastModified { get; set; } - - [StringLength(400)] - public string? SiteDomainPresentationUrl { get; set; } - - public int SiteDomainAliasType { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsSiteDomainAliases")] - public virtual CmsSite Site { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsSmtpserver.cs b/Migration.Toolkit.KX13/Models/CmsSmtpserver.cs deleted file mode 100644 index 54dca9a6..00000000 --- a/Migration.Toolkit.KX13/Models/CmsSmtpserver.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SMTPServer")] -public class CmsSmtpserver -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(200)] - public string ServerName { get; set; } = null!; - - [StringLength(50)] - public string? ServerUserName { get; set; } - - [StringLength(200)] - public string? ServerPassword { get; set; } - - [Column("ServerUseSSL")] - public bool ServerUseSsl { get; set; } - - public bool ServerEnabled { get; set; } - - public bool ServerIsGlobal { get; set; } - - [Column("ServerGUID")] - public Guid ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public int? ServerPriority { get; set; } - - public int? ServerDeliveryMethod { get; set; } - - [StringLength(450)] - public string? ServerPickupDirectory { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("Servers")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsState.cs b/Migration.Toolkit.KX13/Models/CmsState.cs deleted file mode 100644 index 1cd891a2..00000000 --- a/Migration.Toolkit.KX13/Models/CmsState.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_State")] -[Index("CountryId", Name = "IX_CMS_State_CountryID")] -[Index("StateCode", Name = "IX_CMS_State_StateCode")] -public class CmsState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [StringLength(200)] - public string StateDisplayName { get; set; } = null!; - - [StringLength(200)] - public string StateName { get; set; } = null!; - - [StringLength(100)] - public string? StateCode { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public DateTime StateLastModified { get; set; } - - [InverseProperty("AddressState")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("AddressState")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("State")] - public virtual ICollection ComTaxClassStates { get; set; } = new List(); - - [ForeignKey("CountryId")] - [InverseProperty("CmsStates")] - public virtual CmsCountry Country { get; set; } = null!; - - [InverseProperty("AccountState")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactState")] - public virtual ICollection OmContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsTag.cs b/Migration.Toolkit.KX13/Models/CmsTag.cs deleted file mode 100644 index e2737d6a..00000000 --- a/Migration.Toolkit.KX13/Models/CmsTag.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Tag")] -[Index("TagGroupId", Name = "IX_CMS_Tag_TagGroupID")] -public class CmsTag -{ - [Key] - [Column("TagID")] - public int TagId { get; set; } - - [StringLength(250)] - public string TagName { get; set; } = null!; - - public int TagCount { get; set; } - - [Column("TagGroupID")] - public int TagGroupId { get; set; } - - [Column("TagGUID")] - public Guid TagGuid { get; set; } - - [ForeignKey("TagGroupId")] - [InverseProperty("CmsTags")] - public virtual CmsTagGroup TagGroup { get; set; } = null!; - - [ForeignKey("TagId")] - [InverseProperty("Tags")] - public virtual ICollection Documents { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsTagGroup.cs b/Migration.Toolkit.KX13/Models/CmsTagGroup.cs deleted file mode 100644 index efe1458b..00000000 --- a/Migration.Toolkit.KX13/Models/CmsTagGroup.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_TagGroup")] -[Index("TagGroupSiteId", Name = "IX_CMS_TagGroup_TagGroupSiteID")] -public class CmsTagGroup -{ - [Key] - [Column("TagGroupID")] - public int TagGroupId { get; set; } - - [StringLength(250)] - public string TagGroupDisplayName { get; set; } = null!; - - [StringLength(250)] - public string TagGroupName { get; set; } = null!; - - public string? TagGroupDescription { get; set; } - - [Column("TagGroupSiteID")] - public int TagGroupSiteId { get; set; } - - public bool TagGroupIsAdHoc { get; set; } - - public DateTime TagGroupLastModified { get; set; } - - [Column("TagGroupGUID")] - public Guid TagGroupGuid { get; set; } - - [InverseProperty("DocumentTagGroup")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("TagGroup")] - public virtual ICollection CmsTags { get; set; } = new List(); - - [ForeignKey("TagGroupSiteId")] - [InverseProperty("CmsTagGroups")] - public virtual CmsSite TagGroupSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsTimeZone.cs b/Migration.Toolkit.KX13/Models/CmsTimeZone.cs deleted file mode 100644 index 3c48c350..00000000 --- a/Migration.Toolkit.KX13/Models/CmsTimeZone.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_TimeZone")] -public class CmsTimeZone -{ - [Key] - [Column("TimeZoneID")] - public int TimeZoneId { get; set; } - - [StringLength(200)] - public string TimeZoneName { get; set; } = null!; - - [StringLength(200)] - public string TimeZoneDisplayName { get; set; } = null!; - - [Column("TimeZoneGMT")] - public double TimeZoneGmt { get; set; } - - public bool? TimeZoneDaylight { get; set; } - - public DateTime TimeZoneRuleStartIn { get; set; } - - [StringLength(200)] - public string TimeZoneRuleStartRule { get; set; } = null!; - - public DateTime TimeZoneRuleEndIn { get; set; } - - [StringLength(200)] - public string TimeZoneRuleEndRule { get; set; } = null!; - - [Column("TimeZoneGUID")] - public Guid TimeZoneGuid { get; set; } - - public DateTime TimeZoneLastModified { get; set; } - - [InverseProperty("UserTimeZone")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsTransformation.cs b/Migration.Toolkit.KX13/Models/CmsTransformation.cs deleted file mode 100644 index 4412abe7..00000000 --- a/Migration.Toolkit.KX13/Models/CmsTransformation.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Transformation")] -[Index("TransformationClassId", Name = "IX_CMS_Transformation_TransformationClassID")] -public class CmsTransformation -{ - [Key] - [Column("TransformationID")] - public int TransformationId { get; set; } - - [StringLength(100)] - public string TransformationName { get; set; } = null!; - - public string TransformationCode { get; set; } = null!; - - [StringLength(50)] - public string TransformationType { get; set; } = null!; - - [Column("TransformationClassID")] - public int TransformationClassId { get; set; } - - [Column("TransformationVersionGUID")] - [StringLength(50)] - public string? TransformationVersionGuid { get; set; } - - [Column("TransformationGUID")] - public Guid TransformationGuid { get; set; } - - public DateTime TransformationLastModified { get; set; } - - [ForeignKey("TransformationClassId")] - [InverseProperty("CmsTransformations")] - public virtual CmsClass TransformationClass { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsTranslationService.cs b/Migration.Toolkit.KX13/Models/CmsTranslationService.cs deleted file mode 100644 index d668a1e0..00000000 --- a/Migration.Toolkit.KX13/Models/CmsTranslationService.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_TranslationService")] -public class CmsTranslationService -{ - [Key] - [Column("TranslationServiceID")] - public int TranslationServiceId { get; set; } - - [StringLength(200)] - public string TranslationServiceAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceClassName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceDisplayName { get; set; } = null!; - - public bool TranslationServiceIsMachine { get; set; } - - public DateTime TranslationServiceLastModified { get; set; } - - [Column("TranslationServiceGUID")] - public Guid TranslationServiceGuid { get; set; } - - public bool TranslationServiceEnabled { get; set; } - - public bool? TranslationServiceSupportsInstructions { get; set; } - - public bool? TranslationServiceSupportsPriority { get; set; } - - public bool? TranslationServiceSupportsDeadline { get; set; } - - [StringLength(1000)] - public string? TranslationServiceParameter { get; set; } - - public bool? TranslationServiceSupportsStatusUpdate { get; set; } - - public bool? TranslationServiceSupportsCancel { get; set; } - - [InverseProperty("SubmissionService")] - public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsTranslationSubmission.cs b/Migration.Toolkit.KX13/Models/CmsTranslationSubmission.cs deleted file mode 100644 index bed35bd7..00000000 --- a/Migration.Toolkit.KX13/Models/CmsTranslationSubmission.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_TranslationSubmission")] -[Index("SubmissionServiceId", Name = "IX_CMS_TranslationSubmission_SubmissionServiceID")] -[Index("SubmissionSubmittedByUserId", Name = "IX_CMS_TranslationSubmission_SubmissionSubmittedByUserID")] -public class CmsTranslationSubmission -{ - [Key] - [Column("SubmissionID")] - public int SubmissionId { get; set; } - - [StringLength(200)] - public string SubmissionName { get; set; } = null!; - - [StringLength(200)] - public string? SubmissionTicket { get; set; } - - public int SubmissionStatus { get; set; } - - [Column("SubmissionServiceID")] - public int SubmissionServiceId { get; set; } - - [StringLength(50)] - public string SubmissionSourceCulture { get; set; } = null!; - - public string SubmissionTargetCulture { get; set; } = null!; - - public int SubmissionPriority { get; set; } - - public DateTime? SubmissionDeadline { get; set; } - - [StringLength(500)] - public string? SubmissionInstructions { get; set; } - - public DateTime SubmissionLastModified { get; set; } - - [Column("SubmissionGUID")] - public Guid SubmissionGuid { get; set; } - - [Column("SubmissionSiteID")] - public int? SubmissionSiteId { get; set; } - - public double? SubmissionPrice { get; set; } - - public string? SubmissionStatusMessage { get; set; } - - public bool? SubmissionTranslateAttachments { get; set; } - - public int SubmissionItemCount { get; set; } - - public DateTime SubmissionDate { get; set; } - - public int? SubmissionWordCount { get; set; } - - public int? SubmissionCharCount { get; set; } - - [Column("SubmissionSubmittedByUserID")] - public int? SubmissionSubmittedByUserId { get; set; } - - [InverseProperty("SubmissionItemSubmission")] - public virtual ICollection CmsTranslationSubmissionItems { get; set; } = new List(); - - [ForeignKey("SubmissionServiceId")] - [InverseProperty("CmsTranslationSubmissions")] - public virtual CmsTranslationService SubmissionService { get; set; } = null!; - - [ForeignKey("SubmissionSubmittedByUserId")] - [InverseProperty("CmsTranslationSubmissions")] - public virtual CmsUser? SubmissionSubmittedByUser { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsTranslationSubmissionItem.cs b/Migration.Toolkit.KX13/Models/CmsTranslationSubmissionItem.cs deleted file mode 100644 index 724e3082..00000000 --- a/Migration.Toolkit.KX13/Models/CmsTranslationSubmissionItem.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_TranslationSubmissionItem")] -[Index("SubmissionItemSubmissionId", Name = "IX_CMS_TranslationSubmissionItem_SubmissionItemSubmissionID")] -public class CmsTranslationSubmissionItem -{ - [Key] - [Column("SubmissionItemID")] - public int SubmissionItemId { get; set; } - - [Column("SubmissionItemSubmissionID")] - public int SubmissionItemSubmissionId { get; set; } - - [Column("SubmissionItemSourceXLIFF")] - public string? SubmissionItemSourceXliff { get; set; } - - [Column("SubmissionItemTargetXLIFF")] - public string? SubmissionItemTargetXliff { get; set; } - - [StringLength(100)] - public string SubmissionItemObjectType { get; set; } = null!; - - [Column("SubmissionItemObjectID")] - public int SubmissionItemObjectId { get; set; } - - [Column("SubmissionItemGUID")] - public Guid SubmissionItemGuid { get; set; } - - public DateTime SubmissionItemLastModified { get; set; } - - [StringLength(200)] - public string SubmissionItemName { get; set; } = null!; - - public int? SubmissionItemWordCount { get; set; } - - public int? SubmissionItemCharCount { get; set; } - - public string? SubmissionItemCustomData { get; set; } - - [Column("SubmissionItemTargetObjectID")] - public int SubmissionItemTargetObjectId { get; set; } - - [StringLength(50)] - public string? SubmissionItemType { get; set; } - - [StringLength(50)] - public string? SubmissionItemTargetCulture { get; set; } - - [ForeignKey("SubmissionItemSubmissionId")] - [InverseProperty("CmsTranslationSubmissionItems")] - public virtual CmsTranslationSubmission SubmissionItemSubmission { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsTree.cs b/Migration.Toolkit.KX13/Models/CmsTree.cs deleted file mode 100644 index 224cba69..00000000 --- a/Migration.Toolkit.KX13/Models/CmsTree.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Tree")] -[Index("NodeAclid", Name = "IX_CMS_Tree_NodeACLID")] -[Index("NodeAliasPath", Name = "IX_CMS_Tree_NodeAliasPath")] -[Index("NodeClassId", Name = "IX_CMS_Tree_NodeClassID")] -[Index("NodeLevel", Name = "IX_CMS_Tree_NodeLevel")] -[Index("NodeLinkedNodeId", Name = "IX_CMS_Tree_NodeLinkedNodeID")] -[Index("NodeLinkedNodeSiteId", Name = "IX_CMS_Tree_NodeLinkedNodeSiteID")] -[Index("NodeOriginalNodeId", Name = "IX_CMS_Tree_NodeOriginalNodeID")] -[Index("NodeOwner", Name = "IX_CMS_Tree_NodeOwner")] -[Index("NodeParentId", "NodeAlias", "NodeName", Name = "IX_CMS_Tree_NodeParentID_NodeAlias_NodeName")] -[Index("NodeSkuid", Name = "IX_CMS_Tree_NodeSKUID")] -[Index("NodeSiteId", "NodeGuid", Name = "IX_CMS_Tree_NodeSiteID_NodeGUID", IsUnique = true)] -public class CmsTree -{ - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - public string NodeAliasPath { get; set; } = null!; - - [StringLength(100)] - public string NodeName { get; set; } = null!; - - [StringLength(50)] - public string NodeAlias { get; set; } = null!; - - [Column("NodeClassID")] - public int NodeClassId { get; set; } - - [Column("NodeParentID")] - public int? NodeParentId { get; set; } - - public int NodeLevel { get; set; } - - [Column("NodeACLID")] - public int? NodeAclid { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeGUID")] - public Guid NodeGuid { get; set; } - - public int? NodeOrder { get; set; } - - public bool? IsSecuredNode { get; set; } - - [Column("NodeSKUID")] - public int? NodeSkuid { get; set; } - - [Column("NodeLinkedNodeID")] - public int? NodeLinkedNodeId { get; set; } - - public int? NodeOwner { get; set; } - - public string? NodeCustomData { get; set; } - - [Column("NodeLinkedNodeSiteID")] - public int? NodeLinkedNodeSiteId { get; set; } - - public bool? NodeHasChildren { get; set; } - - public bool? NodeHasLinks { get; set; } - - [Column("NodeOriginalNodeID")] - public int? NodeOriginalNodeId { get; set; } - - [Column("NodeIsACLOwner")] - public bool NodeIsAclowner { get; set; } - - [InverseProperty("DocumentNode")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("PageFormerUrlPathNode")] - public virtual ICollection CmsPageFormerUrlPaths { get; set; } = new List(); - - [InverseProperty("PageUrlPathNode")] - public virtual ICollection CmsPageUrlPaths { get; set; } = new List(); - - [InverseProperty("LeftNode")] - public virtual ICollection CmsRelationshipLeftNodes { get; set; } = new List(); - - [InverseProperty("RightNode")] - public virtual ICollection CmsRelationshipRightNodes { get; set; } = new List(); - - [InverseProperty("Node")] - public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); - - [InverseProperty("NodeLinkedNode")] - public virtual ICollection InverseNodeLinkedNode { get; set; } = new List(); - - [InverseProperty("NodeOriginalNode")] - public virtual ICollection InverseNodeOriginalNode { get; set; } = new List(); - - [InverseProperty("NodeParent")] - public virtual ICollection InverseNodeParent { get; set; } = new List(); - - [ForeignKey("NodeAclid")] - [InverseProperty("CmsTrees")] - public virtual CmsAcl? NodeAcl { get; set; } - - [ForeignKey("NodeClassId")] - [InverseProperty("CmsTrees")] - public virtual CmsClass NodeClass { get; set; } = null!; - - [ForeignKey("NodeLinkedNodeId")] - [InverseProperty("InverseNodeLinkedNode")] - public virtual CmsTree? NodeLinkedNode { get; set; } - - [ForeignKey("NodeLinkedNodeSiteId")] - [InverseProperty("CmsTreeNodeLinkedNodeSites")] - public virtual CmsSite? NodeLinkedNodeSite { get; set; } - - [ForeignKey("NodeOriginalNodeId")] - [InverseProperty("InverseNodeOriginalNode")] - public virtual CmsTree? NodeOriginalNode { get; set; } - - [ForeignKey("NodeOwner")] - [InverseProperty("CmsTrees")] - public virtual CmsUser? NodeOwnerNavigation { get; set; } - - [ForeignKey("NodeParentId")] - [InverseProperty("InverseNodeParent")] - public virtual CmsTree? NodeParent { get; set; } - - [ForeignKey("NodeSiteId")] - [InverseProperty("CmsTreeNodeSites")] - public virtual CmsSite NodeSite { get; set; } = null!; - - [ForeignKey("NodeSkuid")] - [InverseProperty("CmsTrees")] - public virtual ComSku? NodeSku { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsUielement.cs b/Migration.Toolkit.KX13/Models/CmsUielement.cs deleted file mode 100644 index 427a63a2..00000000 --- a/Migration.Toolkit.KX13/Models/CmsUielement.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_UIElement")] -[Index("ElementGuid", Name = "IX_CMS_UIElement_ElementGUID", IsUnique = true)] -[Index("ElementPageTemplateId", Name = "IX_CMS_UIElement_ElementPageTemplateID")] -[Index("ElementParentId", Name = "IX_CMS_UIElement_ElementParentID")] -public class CmsUielement -{ - [Key] - [Column("ElementID")] - public int ElementId { get; set; } - - [StringLength(200)] - public string ElementDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ElementName { get; set; } = null!; - - [StringLength(200)] - public string? ElementCaption { get; set; } - - [Column("ElementTargetURL")] - [StringLength(650)] - public string? ElementTargetUrl { get; set; } - - [Column("ElementResourceID")] - public int ElementResourceId { get; set; } - - [Column("ElementParentID")] - public int? ElementParentId { get; set; } - - public int ElementChildCount { get; set; } - - public int? ElementOrder { get; set; } - - public int ElementLevel { get; set; } - - [Column("ElementIDPath")] - [StringLength(450)] - public string ElementIdpath { get; set; } = null!; - - [StringLength(200)] - public string? ElementIconPath { get; set; } - - public bool? ElementIsCustom { get; set; } - - public DateTime ElementLastModified { get; set; } - - [Column("ElementGUID")] - public Guid ElementGuid { get; set; } - - public int? ElementSize { get; set; } - - public string? ElementDescription { get; set; } - - [StringLength(20)] - public string? ElementFromVersion { get; set; } - - [Column("ElementPageTemplateID")] - public int? ElementPageTemplateId { get; set; } - - [StringLength(50)] - public string? ElementType { get; set; } - - public string? ElementProperties { get; set; } - - public bool? ElementIsMenu { get; set; } - - [StringLength(200)] - public string? ElementFeature { get; set; } - - [StringLength(100)] - public string? ElementIconClass { get; set; } - - public bool? ElementIsGlobalApplication { get; set; } - - public bool? ElementCheckModuleReadPermission { get; set; } - - public string? ElementAccessCondition { get; set; } - - public string? ElementVisibilityCondition { get; set; } - - public bool ElementRequiresGlobalAdminPriviligeLevel { get; set; } - - [InverseProperty("HelpTopicUielement")] - public virtual ICollection CmsHelpTopics { get; set; } = new List(); - - [ForeignKey("ElementPageTemplateId")] - [InverseProperty("CmsUielements")] - public virtual CmsPageTemplate? ElementPageTemplate { get; set; } - - [ForeignKey("ElementParentId")] - [InverseProperty("InverseElementParent")] - public virtual CmsUielement? ElementParent { get; set; } - - [ForeignKey("ElementResourceId")] - [InverseProperty("CmsUielements")] - public virtual CmsResource ElementResource { get; set; } = null!; - - [InverseProperty("ElementParent")] - public virtual ICollection InverseElementParent { get; set; } = new List(); - - [ForeignKey("ElementId")] - [InverseProperty("Elements")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("ElementId")] - [InverseProperty("ElementsNavigation")] - public virtual ICollection RolesNavigation { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsUser.cs b/Migration.Toolkit.KX13/Models/CmsUser.cs deleted file mode 100644 index 82167098..00000000 --- a/Migration.Toolkit.KX13/Models/CmsUser.cs +++ /dev/null @@ -1,223 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_User")] -[Index("Email", Name = "IX_CMS_User_Email")] -[Index("FullName", Name = "IX_CMS_User_FullName")] -[Index("UserEnabled", "UserIsHidden", Name = "IX_CMS_User_UserEnabled_UserIsHidden")] -[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] -[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] -[Index("UserPrivilegeLevel", Name = "IX_CMS_User_UserPrivilegeLevel")] -public class CmsUser -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(50)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(50)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [InverseProperty("LastModifiedByUser")] - public virtual ICollection CmsAclitemLastModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsAclitemUsers { get; set; } = new List(); - - [InverseProperty("HistoryApprovedByUser")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateUser")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("CategoryUser")] - public virtual ICollection CmsCategories { get; set; } = new List(); - - [InverseProperty("DocumentCheckedOutByUser")] - public virtual ICollection CmsDocumentDocumentCheckedOutByUsers { get; set; } = new List(); - - [InverseProperty("DocumentCreatedByUser")] - public virtual ICollection CmsDocumentDocumentCreatedByUsers { get; set; } = new List(); - - [InverseProperty("DocumentModifiedByUser")] - public virtual ICollection CmsDocumentDocumentModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsEmailUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsExternalLogins { get; set; } = new List(); - - [InverseProperty("MacroIdentityEffectiveUser")] - public virtual ICollection CmsMacroIdentities { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsMembershipUsers { get; set; } = new List(); - - [InverseProperty("ObjectCheckedOutByUser")] - public virtual ICollection CmsObjectSettings { get; set; } = new List(); - - [InverseProperty("VersionDeletedByUser")] - public virtual ICollection CmsObjectVersionHistoryVersionDeletedByUsers { get; set; } = new List(); - - [InverseProperty("VersionModifiedByUser")] - public virtual ICollection CmsObjectVersionHistoryVersionModifiedByUsers { get; set; } = new List(); - - [InverseProperty("PersonalizationUser")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [InverseProperty("TaskUser")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("SubmissionSubmittedByUser")] - public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); - - [InverseProperty("NodeOwnerNavigation")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("UserMacroIdentityUser")] - public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } - - [InverseProperty("User")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("UserActivatedByUser")] - public virtual ICollection CmsUserSettingUserActivatedByUsers { get; set; } = new List(); - - [InverseProperty("UserSettingsUserNavigation")] - public virtual CmsUserSetting? CmsUserSettingUserSettingsUserNavigation { get; set; } - - public virtual ICollection CmsUserSettingUserSettingsUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsUserSites { get; set; } = new List(); - - [InverseProperty("ModifiedByUser")] - public virtual ICollection CmsVersionHistoryModifiedByUsers { get; set; } = new List(); - - [InverseProperty("VersionDeletedByUser")] - public virtual ICollection CmsVersionHistoryVersionDeletedByUsers { get; set; } = new List(); - - [InverseProperty("ApprovedByUser")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); - - [InverseProperty("CustomerUser")] - public virtual ICollection ComCustomers { get; set; } = new List(); - - [InverseProperty("ChangedByUser")] - public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); - - [InverseProperty("OrderCreatedByUser")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartUser")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("ExportUser")] - public virtual ICollection ExportHistories { get; set; } = new List(); - - [InverseProperty("FileCreatedByUser")] - public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); - - [InverseProperty("FileModifiedByUser")] - public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); - - [InverseProperty("AccountOwnerUser")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactOwnerUser")] - public virtual ICollection OmContacts { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionUser")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("SavedReportCreatedByUser")] - public virtual ICollection ReportingSavedReports { get; set; } = new List(); - - [InverseProperty("User")] - public virtual StagingTaskGroupUser? StagingTaskGroupUser { get; set; } - - [InverseProperty("User")] - public virtual ICollection StagingTaskUsers { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Workflows { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsUserCulture.cs b/Migration.Toolkit.KX13/Models/CmsUserCulture.cs deleted file mode 100644 index 0a356757..00000000 --- a/Migration.Toolkit.KX13/Models/CmsUserCulture.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("UserId", "CultureId", "SiteId")] -[Table("CMS_UserCulture")] -[Index("CultureId", Name = "IX_CMS_UserCulture_CultureID")] -[Index("SiteId", Name = "IX_CMS_UserCulture_SiteID")] -public class CmsUserCulture -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("CultureId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsCulture Culture { get; set; } = null!; - - [ForeignKey("SiteId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsUserMacroIdentity.cs b/Migration.Toolkit.KX13/Models/CmsUserMacroIdentity.cs deleted file mode 100644 index cf105e4d..00000000 --- a/Migration.Toolkit.KX13/Models/CmsUserMacroIdentity.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_UserMacroIdentity")] -[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] -[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] -public class CmsUserMacroIdentity -{ - [Key] - [Column("UserMacroIdentityID")] - public int UserMacroIdentityId { get; set; } - - public DateTime UserMacroIdentityLastModified { get; set; } - - [Column("UserMacroIdentityUserID")] - public int UserMacroIdentityUserId { get; set; } - - [Column("UserMacroIdentityMacroIdentityID")] - public int? UserMacroIdentityMacroIdentityId { get; set; } - - public Guid UserMacroIdentityUserGuid { get; set; } - - [ForeignKey("UserMacroIdentityMacroIdentityId")] - [InverseProperty("CmsUserMacroIdentities")] - public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } - - [ForeignKey("UserMacroIdentityUserId")] - [InverseProperty("CmsUserMacroIdentity")] - public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsUserRole.cs b/Migration.Toolkit.KX13/Models/CmsUserRole.cs deleted file mode 100644 index 8fb7235b..00000000 --- a/Migration.Toolkit.KX13/Models/CmsUserRole.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_UserRole")] -[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] -[Index("RoleId", "ValidTo", "UserId", Name = "IX_CMS_UserRole_UserID")] -[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] -public class CmsUserRole -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } - - [Key] - [Column("UserRoleID")] - public int UserRoleId { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsUserSetting.cs b/Migration.Toolkit.KX13/Models/CmsUserSetting.cs deleted file mode 100644 index 973a2419..00000000 --- a/Migration.Toolkit.KX13/Models/CmsUserSetting.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_UserSettings")] -[Index("UserActivatedByUserId", Name = "IX_CMS_UserSettings_UserActivatedByUserID")] -[Index("UserAuthenticationGuid", Name = "IX_CMS_UserSettings_UserAuthenticationGUID")] -[Index("UserAvatarId", Name = "IX_CMS_UserSettings_UserAvatarID")] -[Index("UserGender", Name = "IX_CMS_UserSettings_UserGender")] -[Index("UserNickName", Name = "IX_CMS_UserSettings_UserNickName")] -[Index("UserPasswordRequestHash", Name = "IX_CMS_UserSettings_UserPasswordRequestHash")] -[Index("UserSettingsUserGuid", Name = "IX_CMS_UserSettings_UserSettingsUserGUID")] -[Index("UserSettingsUserId", Name = "IX_CMS_UserSettings_UserSettingsUserID", IsUnique = true)] -[Index("UserTimeZoneId", Name = "IX_CMS_UserSettings_UserTimeZoneID")] -[Index("UserWaitingForApproval", Name = "IX_CMS_UserSettings_UserWaitingForApproval")] -public class CmsUserSetting -{ - [Key] - [Column("UserSettingsID")] - public int UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int UserSettingsUserId { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [ForeignKey("UserActivatedByUserId")] - [InverseProperty("CmsUserSettingUserActivatedByUsers")] - public virtual CmsUser? UserActivatedByUser { get; set; } - - [ForeignKey("UserAvatarId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsAvatar? UserAvatar { get; set; } - - public virtual CmsUser UserSettingsUser { get; set; } = null!; - - [ForeignKey("UserSettingsUserId")] - [InverseProperty("CmsUserSettingUserSettingsUserNavigation")] - public virtual CmsUser UserSettingsUserNavigation { get; set; } = null!; - - [ForeignKey("UserTimeZoneId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsTimeZone? UserTimeZone { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsUserSite.cs b/Migration.Toolkit.KX13/Models/CmsUserSite.cs deleted file mode 100644 index e67d1e77..00000000 --- a/Migration.Toolkit.KX13/Models/CmsUserSite.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_UserSite")] -[Index("SiteId", Name = "IX_CMS_UserSite_SiteID")] -[Index("UserId", "SiteId", Name = "IX_CMS_UserSite_UserID_SiteID", IsUnique = true)] -public class CmsUserSite -{ - [Key] - [Column("UserSiteID")] - public int UserSiteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsUserSites")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserSites")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsVersionHistory.cs b/Migration.Toolkit.KX13/Models/CmsVersionHistory.cs deleted file mode 100644 index c54d5f57..00000000 --- a/Migration.Toolkit.KX13/Models/CmsVersionHistory.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_VersionHistory")] -[Index("ModifiedByUserId", Name = "IX_CMS_VersionHistory_ModifiedByUserID")] -[Index("NodeSiteId", Name = "IX_CMS_VersionHistory_NodeSiteID")] -[Index("ToBePublished", "PublishFrom", "PublishTo", Name = "IX_CMS_VersionHistory_ToBePublished_PublishFrom_PublishTo")] -[Index("VersionClassId", Name = "IX_CMS_VersionHistory_VersionClassID")] -[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_VersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionWorkflowId", Name = "IX_CMS_VersionHistory_VersionWorkflowID")] -[Index("VersionWorkflowStepId", Name = "IX_CMS_VersionHistory_VersionWorkflowStepID")] -public class CmsVersionHistory -{ - [Key] - [Column("VersionHistoryID")] - public int VersionHistoryId { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("DocumentID")] - public int? DocumentId { get; set; } - - [Column("NodeXML")] - public string NodeXml { get; set; } = null!; - - [Column("ModifiedByUserID")] - public int? ModifiedByUserId { get; set; } - - public DateTime ModifiedWhen { get; set; } - - [StringLength(50)] - public string? VersionNumber { get; set; } - - public string? VersionComment { get; set; } - - public bool ToBePublished { get; set; } - - public DateTime? PublishFrom { get; set; } - - public DateTime? PublishTo { get; set; } - - public DateTime? WasPublishedFrom { get; set; } - - public DateTime? WasPublishedTo { get; set; } - - [StringLength(100)] - public string? VersionDocumentName { get; set; } - - [Column("VersionClassID")] - public int? VersionClassId { get; set; } - - [Column("VersionWorkflowID")] - public int? VersionWorkflowId { get; set; } - - [Column("VersionWorkflowStepID")] - public int? VersionWorkflowStepId { get; set; } - - [StringLength(450)] - public string? VersionNodeAliasPath { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [InverseProperty("DocumentCheckedOutVersionHistory")] - public virtual ICollection CmsDocumentDocumentCheckedOutVersionHistories { get; set; } = new List(); - - [InverseProperty("DocumentPublishedVersionHistory")] - public virtual ICollection CmsDocumentDocumentPublishedVersionHistories { get; set; } = new List(); - - [InverseProperty("VersionHistory")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [ForeignKey("ModifiedByUserId")] - [InverseProperty("CmsVersionHistoryModifiedByUsers")] - public virtual CmsUser? ModifiedByUser { get; set; } - - [ForeignKey("NodeSiteId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsSite NodeSite { get; set; } = null!; - - [ForeignKey("VersionClassId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsClass? VersionClass { get; set; } - - [ForeignKey("VersionDeletedByUserId")] - [InverseProperty("CmsVersionHistoryVersionDeletedByUsers")] - public virtual CmsUser? VersionDeletedByUser { get; set; } - - [ForeignKey("VersionWorkflowId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsWorkflow? VersionWorkflow { get; set; } - - [ForeignKey("VersionWorkflowStepId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsWorkflowStep? VersionWorkflowStep { get; set; } - - [ForeignKey("VersionHistoryId")] - [InverseProperty("VersionHistories")] - public virtual ICollection AttachmentHistories { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmServer.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmServer.cs deleted file mode 100644 index 4499b2e9..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmServer.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebFarmServer")] -[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] -public class CmsWebFarmServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(300)] - public string ServerDisplayName { get; set; } = null!; - - [StringLength(300)] - public string ServerName { get; set; } = null!; - - [Column("ServerGUID")] - public Guid? ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public bool ServerEnabled { get; set; } - - public bool IsExternalWebAppServer { get; set; } - - [InverseProperty("Server")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmServerLog.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmServerLog.cs deleted file mode 100644 index 9e19ed80..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmServerLog.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebFarmServerLog")] -public class CmsWebFarmServerLog -{ - [Key] - [Column("WebFarmServerLogID")] - public int WebFarmServerLogId { get; set; } - - public DateTime LogTime { get; set; } - - [StringLength(200)] - public string LogCode { get; set; } = null!; - - [Column("ServerID")] - public int ServerId { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmServerMonitoring.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmServerMonitoring.cs deleted file mode 100644 index 0fbc8931..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmServerMonitoring.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebFarmServerMonitoring")] -public class CmsWebFarmServerMonitoring -{ - [Key] - [Column("WebFarmServerMonitoringID")] - public int WebFarmServerMonitoringId { get; set; } - - [Column("ServerID")] - public int ServerId { get; set; } - - public DateTime? ServerPing { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmServerTask.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmServerTask.cs deleted file mode 100644 index 6de89769..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmServerTask.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("ServerId", "TaskId")] -[Table("CMS_WebFarmServerTask")] -[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] -public class CmsWebFarmServerTask -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - public string? ErrorMessage { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmServer Server { get; set; } = null!; - - [ForeignKey("TaskId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmTask Task { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmTask.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmTask.cs deleted file mode 100644 index 8e51ea89..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmTask.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebFarmTask")] -[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] -public class CmsWebFarmTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(100)] - public string TaskType { get; set; } = null!; - - public string? TaskTextData { get; set; } - - public byte[]? TaskBinaryData { get; set; } - - public DateTime? TaskCreated { get; set; } - - public string? TaskTarget { get; set; } - - [StringLength(450)] - public string? TaskMachineName { get; set; } - - [Column("TaskGUID")] - public Guid? TaskGuid { get; set; } - - public bool? TaskIsAnonymous { get; set; } - - public string? TaskErrorMessage { get; set; } - - public bool? TaskIsMemory { get; set; } - - [InverseProperty("Task")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsWebPart.cs b/Migration.Toolkit.KX13/Models/CmsWebPart.cs deleted file mode 100644 index 575d4c50..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWebPart.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebPart")] -[Index("WebPartCategoryId", Name = "IX_CMS_WebPart_WebPartCategoryID")] -[Index("WebPartName", Name = "IX_CMS_WebPart_WebPartName")] -[Index("WebPartParentId", Name = "IX_CMS_WebPart_WebPartParentID")] -[Index("WebPartResourceId", Name = "IX_CMS_WebPart_WebPartResourceID")] -public class CmsWebPart -{ - [Key] - [Column("WebPartID")] - public int WebPartId { get; set; } - - [StringLength(100)] - public string WebPartName { get; set; } = null!; - - [StringLength(100)] - public string WebPartDisplayName { get; set; } = null!; - - public string? WebPartDescription { get; set; } - - [StringLength(100)] - public string WebPartFileName { get; set; } = null!; - - public string WebPartProperties { get; set; } = null!; - - [Column("WebPartCategoryID")] - public int WebPartCategoryId { get; set; } - - [Column("WebPartParentID")] - public int? WebPartParentId { get; set; } - - public string? WebPartDocumentation { get; set; } - - [Column("WebPartGUID")] - public Guid WebPartGuid { get; set; } - - public DateTime WebPartLastModified { get; set; } - - public int? WebPartType { get; set; } - - public string? WebPartDefaultValues { get; set; } - - [Column("WebPartResourceID")] - public int? WebPartResourceId { get; set; } - - [Column("WebPartCSS")] - public string? WebPartCss { get; set; } - - public bool? WebPartSkipInsertProperties { get; set; } - - [Column("WebPartThumbnailGUID")] - public Guid? WebPartThumbnailGuid { get; set; } - - [StringLength(200)] - public string? WebPartIconClass { get; set; } - - [InverseProperty("WebPartLayoutWebPart")] - public virtual ICollection CmsWebPartLayouts { get; set; } = new List(); - - [InverseProperty("WidgetWebPart")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [InverseProperty("WebPartParent")] - public virtual ICollection InverseWebPartParent { get; set; } = new List(); - - [ForeignKey("WebPartCategoryId")] - [InverseProperty("CmsWebParts")] - public virtual CmsWebPartCategory WebPartCategory { get; set; } = null!; - - [ForeignKey("WebPartParentId")] - [InverseProperty("InverseWebPartParent")] - public virtual CmsWebPart? WebPartParent { get; set; } - - [ForeignKey("WebPartResourceId")] - [InverseProperty("CmsWebParts")] - public virtual CmsResource? WebPartResource { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsWebPartCategory.cs b/Migration.Toolkit.KX13/Models/CmsWebPartCategory.cs deleted file mode 100644 index 72568cef..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWebPartCategory.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebPartCategory")] -[Index("CategoryParentId", Name = "IX_CMS_WebPartCategory_CategoryParentID")] -public class CmsWebPartCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(100)] - public string CategoryDisplayName { get; set; } = null!; - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(100)] - public string CategoryName { get; set; } = null!; - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public string CategoryPath { get; set; } = null!; - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryWebPartChildCount { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsWebPartCategory? CategoryParent { get; set; } - - [InverseProperty("WebPartCategory")] - public virtual ICollection CmsWebParts { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsWebPartContainer.cs b/Migration.Toolkit.KX13/Models/CmsWebPartContainer.cs deleted file mode 100644 index 53644484..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWebPartContainer.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebPartContainer")] -[Index("ContainerName", Name = "IX_CMS_WebPartContainer_ContainerName")] -public class CmsWebPartContainer -{ - [Key] - [Column("ContainerID")] - public int ContainerId { get; set; } - - [StringLength(200)] - public string ContainerDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ContainerName { get; set; } = null!; - - public string? ContainerTextBefore { get; set; } - - public string? ContainerTextAfter { get; set; } - - [Column("ContainerGUID")] - public Guid ContainerGuid { get; set; } - - public DateTime ContainerLastModified { get; set; } - - [Column("ContainerCSS")] - public string? ContainerCss { get; set; } - - [ForeignKey("ContainerId")] - [InverseProperty("Containers")] - public virtual ICollection Sites { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsWebPartLayout.cs b/Migration.Toolkit.KX13/Models/CmsWebPartLayout.cs deleted file mode 100644 index 99a2da6d..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWebPartLayout.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebPartLayout")] -[Index("WebPartLayoutWebPartId", Name = "IX_CMS_WebPartLayout_WebPartLayoutWebPartID")] -public class CmsWebPartLayout -{ - [Key] - [Column("WebPartLayoutID")] - public int WebPartLayoutId { get; set; } - - [StringLength(200)] - public string WebPartLayoutCodeName { get; set; } = null!; - - [StringLength(200)] - public string WebPartLayoutDisplayName { get; set; } = null!; - - public string? WebPartLayoutDescription { get; set; } - - public string? WebPartLayoutCode { get; set; } - - [Column("WebPartLayoutVersionGUID")] - [StringLength(100)] - public string? WebPartLayoutVersionGuid { get; set; } - - [Column("WebPartLayoutWebPartID")] - public int WebPartLayoutWebPartId { get; set; } - - [Column("WebPartLayoutGUID")] - public Guid WebPartLayoutGuid { get; set; } - - public DateTime WebPartLayoutLastModified { get; set; } - - [Column("WebPartLayoutCSS")] - public string? WebPartLayoutCss { get; set; } - - public bool? WebPartLayoutIsDefault { get; set; } - - [InverseProperty("WidgetLayout")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [ForeignKey("WebPartLayoutWebPartId")] - [InverseProperty("CmsWebPartLayouts")] - public virtual CmsWebPart WebPartLayoutWebPart { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsWidget.cs b/Migration.Toolkit.KX13/Models/CmsWidget.cs deleted file mode 100644 index 361f386e..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWidget.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Widget")] -[Index("WidgetCategoryId", Name = "IX_CMS_Widget_WidgetCategoryID")] -[Index("WidgetLayoutId", Name = "IX_CMS_Widget_WidgetLayoutID")] -[Index("WidgetWebPartId", Name = "IX_CMS_Widget_WidgetWebPartID")] -public class CmsWidget -{ - [Key] - [Column("WidgetID")] - public int WidgetId { get; set; } - - [Column("WidgetWebPartID")] - public int WidgetWebPartId { get; set; } - - [StringLength(100)] - public string WidgetDisplayName { get; set; } = null!; - - [StringLength(100)] - public string WidgetName { get; set; } = null!; - - public string? WidgetDescription { get; set; } - - [Column("WidgetCategoryID")] - public int WidgetCategoryId { get; set; } - - public string? WidgetProperties { get; set; } - - public int WidgetSecurity { get; set; } - - [Column("WidgetGUID")] - public Guid WidgetGuid { get; set; } - - public DateTime WidgetLastModified { get; set; } - - public bool WidgetIsEnabled { get; set; } - - public string? WidgetDocumentation { get; set; } - - public string? WidgetDefaultValues { get; set; } - - [Column("WidgetLayoutID")] - public int? WidgetLayoutId { get; set; } - - public bool? WidgetSkipInsertProperties { get; set; } - - [Column("WidgetThumbnailGUID")] - public Guid? WidgetThumbnailGuid { get; set; } - - [StringLength(200)] - public string? WidgetIconClass { get; set; } - - [InverseProperty("Widget")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [ForeignKey("WidgetCategoryId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWidgetCategory WidgetCategory { get; set; } = null!; - - [ForeignKey("WidgetLayoutId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWebPartLayout? WidgetLayout { get; set; } - - [ForeignKey("WidgetWebPartId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWebPart WidgetWebPart { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsWidgetCategory.cs b/Migration.Toolkit.KX13/Models/CmsWidgetCategory.cs deleted file mode 100644 index 3bb04dd8..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWidgetCategory.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WidgetCategory")] -[Index("WidgetCategoryParentId", Name = "IX_CMS_WidgetCategory_WidgetCategoryParentID")] -public class CmsWidgetCategory -{ - [Key] - [Column("WidgetCategoryID")] - public int WidgetCategoryId { get; set; } - - [StringLength(100)] - public string WidgetCategoryName { get; set; } = null!; - - [StringLength(100)] - public string WidgetCategoryDisplayName { get; set; } = null!; - - [Column("WidgetCategoryParentID")] - public int? WidgetCategoryParentId { get; set; } - - public string WidgetCategoryPath { get; set; } = null!; - - public int WidgetCategoryLevel { get; set; } - - public int? WidgetCategoryChildCount { get; set; } - - public int? WidgetCategoryWidgetChildCount { get; set; } - - [StringLength(450)] - public string? WidgetCategoryImagePath { get; set; } - - [Column("WidgetCategoryGUID")] - public Guid WidgetCategoryGuid { get; set; } - - public DateTime WidgetCategoryLastModified { get; set; } - - [InverseProperty("WidgetCategory")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [InverseProperty("WidgetCategoryParent")] - public virtual ICollection InverseWidgetCategoryParent { get; set; } = new List(); - - [ForeignKey("WidgetCategoryParentId")] - [InverseProperty("InverseWidgetCategoryParent")] - public virtual CmsWidgetCategory? WidgetCategoryParent { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/CmsWidgetRole.cs b/Migration.Toolkit.KX13/Models/CmsWidgetRole.cs deleted file mode 100644 index aa4252b7..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWidgetRole.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("WidgetId", "RoleId", "PermissionId")] -[Table("CMS_WidgetRole")] -[Index("PermissionId", Name = "IX_CMS_WidgetRole_PermissionID")] -[Index("RoleId", Name = "IX_CMS_WidgetRole_RoleID")] -public class CmsWidgetRole -{ - [Key] - [Column("WidgetID")] - public int WidgetId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("PermissionId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("WidgetId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsWidget Widget { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflow.cs b/Migration.Toolkit.KX13/Models/CmsWorkflow.cs deleted file mode 100644 index 8ca44e6b..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWorkflow.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Workflow")] -public class CmsWorkflow -{ - [Key] - [Column("WorkflowID")] - public int WorkflowId { get; set; } - - public string WorkflowDisplayName { get; set; } = null!; - - [StringLength(450)] - public string WorkflowName { get; set; } = null!; - - [Column("WorkflowGUID")] - public Guid WorkflowGuid { get; set; } - - public DateTime WorkflowLastModified { get; set; } - - public bool? WorkflowAutoPublishChanges { get; set; } - - public bool? WorkflowUseCheckinCheckout { get; set; } - - public int? WorkflowType { get; set; } - - public bool? WorkflowSendEmails { get; set; } - - public bool? WorkflowSendApproveEmails { get; set; } - - public bool? WorkflowSendRejectEmails { get; set; } - - public bool? WorkflowSendPublishEmails { get; set; } - - public bool? WorkflowSendArchiveEmails { get; set; } - - [StringLength(200)] - public string? WorkflowApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowPublishedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowArchivedTemplateName { get; set; } - - public bool? WorkflowSendReadyForApprovalEmails { get; set; } - - [StringLength(200)] - public string? WorkflowReadyForApprovalTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowNotificationTemplateName { get; set; } - - public string? WorkflowAllowedObjects { get; set; } - - public int? WorkflowRecurrenceType { get; set; } - - [Required] - public bool? WorkflowEnabled { get; set; } - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateWorkflow")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("TriggerWorkflow")] - public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); - - [InverseProperty("VersionWorkflow")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [InverseProperty("ScopeWorkflow")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [InverseProperty("StepWorkflow")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); - - [InverseProperty("TransitionWorkflow")] - public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); - - [ForeignKey("WorkflowId")] - [InverseProperty("Workflows")] - public virtual ICollection Users { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowAction.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowAction.cs deleted file mode 100644 index 38ef5704..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowAction.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowAction")] -[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] -public class CmsWorkflowAction -{ - [Key] - [Column("ActionID")] - public int ActionId { get; set; } - - [StringLength(200)] - public string ActionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ActionName { get; set; } = null!; - - public string? ActionParameters { get; set; } - - public string? ActionDescription { get; set; } - - [StringLength(200)] - public string ActionAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string ActionClass { get; set; } = null!; - - [Column("ActionResourceID")] - public int? ActionResourceId { get; set; } - - [Column("ActionThumbnailGUID")] - public Guid? ActionThumbnailGuid { get; set; } - - [Column("ActionGUID")] - public Guid ActionGuid { get; set; } - - public DateTime ActionLastModified { get; set; } - - [Required] - public bool? ActionEnabled { get; set; } - - public string? ActionAllowedObjects { get; set; } - - [Column("ActionIconGUID")] - public Guid? ActionIconGuid { get; set; } - - public int? ActionWorkflowType { get; set; } - - [StringLength(200)] - public string? ActionIconClass { get; set; } - - [StringLength(200)] - public string? ActionThumbnailClass { get; set; } - - [StringLength(200)] - public string? ActionDataProviderClass { get; set; } - - [StringLength(200)] - public string? ActionDataProviderAssemblyName { get; set; } - - [ForeignKey("ActionResourceId")] - [InverseProperty("CmsWorkflowActions")] - public virtual CmsResource? ActionResource { get; set; } - - [InverseProperty("StepAction")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowHistory.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowHistory.cs deleted file mode 100644 index 823a8962..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowHistory.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowHistory")] -[Index("ApprovedByUserId", Name = "IX_CMS_WorkflowHistory_ApprovedByUserID")] -[Index("ApprovedWhen", Name = "IX_CMS_WorkflowHistory_ApprovedWhen")] -[Index("HistoryWorkflowId", Name = "IX_CMS_WorkflowHistory_HistoryWorkflowID")] -[Index("StepId", Name = "IX_CMS_WorkflowHistory_StepID")] -[Index("TargetStepId", Name = "IX_CMS_WorkflowHistory_TargetStepID")] -[Index("VersionHistoryId", Name = "IX_CMS_WorkflowHistory_VersionHistoryID")] -public class CmsWorkflowHistory -{ - [Key] - [Column("WorkflowHistoryID")] - public int WorkflowHistoryId { get; set; } - - [Column("VersionHistoryID")] - public int VersionHistoryId { get; set; } - - [Column("StepID")] - public int? StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [Column("ApprovedByUserID")] - public int? ApprovedByUserId { get; set; } - - public DateTime? ApprovedWhen { get; set; } - - public string? Comment { get; set; } - - public bool WasRejected { get; set; } - - [StringLength(440)] - public string? StepName { get; set; } - - [Column("TargetStepID")] - public int? TargetStepId { get; set; } - - [StringLength(440)] - public string? TargetStepName { get; set; } - - [StringLength(450)] - public string? TargetStepDisplayName { get; set; } - - public int? StepType { get; set; } - - public int? TargetStepType { get; set; } - - [StringLength(100)] - public string? HistoryObjectType { get; set; } - - [Column("HistoryObjectID")] - public int? HistoryObjectId { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int? HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - [ForeignKey("ApprovedByUserId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsUser? ApprovedByUser { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsWorkflow? HistoryWorkflow { get; set; } - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowHistorySteps")] - public virtual CmsWorkflowStep? Step { get; set; } - - [ForeignKey("TargetStepId")] - [InverseProperty("CmsWorkflowHistoryTargetSteps")] - public virtual CmsWorkflowStep? TargetStep { get; set; } - - [ForeignKey("VersionHistoryId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsVersionHistory VersionHistory { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowScope.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowScope.cs deleted file mode 100644 index 79559a9d..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowScope.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowScope")] -[Index("ScopeClassId", Name = "IX_CMS_WorkflowScope_ScopeClassID")] -[Index("ScopeCultureId", Name = "IX_CMS_WorkflowScope_ScopeCultureID")] -[Index("ScopeSiteId", Name = "IX_CMS_WorkflowScope_ScopeSiteID")] -[Index("ScopeWorkflowId", Name = "IX_CMS_WorkflowScope_ScopeWorkflowID")] -public class CmsWorkflowScope -{ - [Key] - [Column("ScopeID")] - public int ScopeId { get; set; } - - public string ScopeStartingPath { get; set; } = null!; - - [Column("ScopeWorkflowID")] - public int ScopeWorkflowId { get; set; } - - [Column("ScopeClassID")] - public int? ScopeClassId { get; set; } - - [Column("ScopeSiteID")] - public int ScopeSiteId { get; set; } - - [Column("ScopeGUID")] - public Guid ScopeGuid { get; set; } - - public DateTime ScopeLastModified { get; set; } - - [Column("ScopeCultureID")] - public int? ScopeCultureId { get; set; } - - public bool? ScopeExcludeChildren { get; set; } - - public bool ScopeExcluded { get; set; } - - public string? ScopeMacroCondition { get; set; } - - [ForeignKey("ScopeClassId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsClass? ScopeClass { get; set; } - - [ForeignKey("ScopeCultureId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsCulture? ScopeCulture { get; set; } - - [ForeignKey("ScopeSiteId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsSite ScopeSite { get; set; } = null!; - - [ForeignKey("ScopeWorkflowId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsWorkflow ScopeWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowStep.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowStep.cs deleted file mode 100644 index 971aebe3..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowStep.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowStep")] -[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] -[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] -[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] -[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] -public class CmsWorkflowStep -{ - [Key] - [Column("StepID")] - public int StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [StringLength(440)] - public string? StepName { get; set; } - - public int? StepOrder { get; set; } - - [Column("StepWorkflowID")] - public int StepWorkflowId { get; set; } - - [Column("StepGUID")] - public Guid StepGuid { get; set; } - - public DateTime StepLastModified { get; set; } - - public int? StepType { get; set; } - - public bool? StepAllowReject { get; set; } - - public string? StepDefinition { get; set; } - - public int? StepRolesSecurity { get; set; } - - public int? StepUsersSecurity { get; set; } - - [StringLength(200)] - public string? StepApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? StepRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? StepReadyforApprovalTemplateName { get; set; } - - public bool? StepSendApproveEmails { get; set; } - - public bool? StepSendRejectEmails { get; set; } - - public bool? StepSendReadyForApprovalEmails { get; set; } - - public bool? StepSendEmails { get; set; } - - public bool? StepAllowPublish { get; set; } - - [Column("StepActionID")] - public int? StepActionId { get; set; } - - public string? StepActionParameters { get; set; } - - public int? StepWorkflowType { get; set; } - - [InverseProperty("HistoryStep")] - public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); - - [InverseProperty("HistoryTargetStep")] - public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("StateStep")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("DocumentWorkflowStep")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("ObjectWorkflowStep")] - public virtual ICollection CmsObjectSettings { get; set; } = new List(); - - [InverseProperty("VersionWorkflowStep")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowHistorySteps { get; set; } = new List(); - - [InverseProperty("TargetStep")] - public virtual ICollection CmsWorkflowHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); - - [InverseProperty("TransitionEndStep")] - public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); - - [InverseProperty("TransitionStartStep")] - public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); - - [ForeignKey("StepActionId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflowAction? StepAction { get; set; } - - [ForeignKey("StepWorkflowId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflow StepWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowStepRole.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowStepRole.cs deleted file mode 100644 index 3aa228fc..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowStepRole.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowStepRoles")] -[Index("RoleId", Name = "IX_CMS_WorkflowStepRoles_RoleID")] -public class CmsWorkflowStepRole -{ - [Key] - [Column("WorkflowStepRoleID")] - public int WorkflowStepRoleId { get; set; } - - [Column("StepID")] - public int StepId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [Column("StepSourcePointGUID")] - public Guid? StepSourcePointGuid { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsWorkflowStepRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowStepRoles")] - public virtual CmsWorkflowStep Step { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowStepUser.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowStepUser.cs deleted file mode 100644 index 910ecc9c..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowStepUser.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowStepUser")] -[Index("UserId", Name = "IX_CMS_WorkflowStepUser_UserID")] -public class CmsWorkflowStepUser -{ - [Key] - [Column("WorkflowStepUserID")] - public int WorkflowStepUserId { get; set; } - - [Column("StepID")] - public int StepId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("StepSourcePointGUID")] - public Guid? StepSourcePointGuid { get; set; } - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowStepUsers")] - public virtual CmsWorkflowStep Step { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsWorkflowStepUsers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowTransition.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowTransition.cs deleted file mode 100644 index 047ee75a..00000000 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowTransition.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowTransition")] -[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] -[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] -[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] -public class CmsWorkflowTransition -{ - [Key] - [Column("TransitionID")] - public int TransitionId { get; set; } - - [Column("TransitionStartStepID")] - public int TransitionStartStepId { get; set; } - - [Column("TransitionEndStepID")] - public int TransitionEndStepId { get; set; } - - public int TransitionType { get; set; } - - public DateTime TransitionLastModified { get; set; } - - [Column("TransitionSourcePointGUID")] - public Guid? TransitionSourcePointGuid { get; set; } - - [Column("TransitionWorkflowID")] - public int TransitionWorkflowId { get; set; } - - [ForeignKey("TransitionEndStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] - public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; - - [ForeignKey("TransitionStartStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] - public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; - - [ForeignKey("TransitionWorkflowId")] - [InverseProperty("CmsWorkflowTransitions")] - public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComAddress.cs b/Migration.Toolkit.KX13/Models/ComAddress.cs deleted file mode 100644 index c5f7ca25..00000000 --- a/Migration.Toolkit.KX13/Models/ComAddress.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Address")] -[Index("AddressCountryId", Name = "IX_COM_Address_AddressCountryID")] -[Index("AddressCustomerId", Name = "IX_COM_Address_AddressCustomerID")] -[Index("AddressStateId", Name = "IX_COM_Address_AddressStateID")] -public class ComAddress -{ - [Key] - [Column("AddressID")] - public int AddressId { get; set; } - - [StringLength(200)] - public string AddressName { get; set; } = null!; - - [StringLength(100)] - public string AddressLine1 { get; set; } = null!; - - [StringLength(100)] - public string? AddressLine2 { get; set; } - - [StringLength(100)] - public string AddressCity { get; set; } = null!; - - [StringLength(20)] - public string AddressZip { get; set; } = null!; - - [StringLength(26)] - public string? AddressPhone { get; set; } - - [Column("AddressCustomerID")] - public int AddressCustomerId { get; set; } - - [Column("AddressCountryID")] - public int AddressCountryId { get; set; } - - [Column("AddressStateID")] - public int? AddressStateId { get; set; } - - [StringLength(200)] - public string AddressPersonalName { get; set; } = null!; - - [Column("AddressGUID")] - public Guid? AddressGuid { get; set; } - - public DateTime AddressLastModified { get; set; } - - [ForeignKey("AddressCountryId")] - [InverseProperty("ComAddresses")] - public virtual CmsCountry AddressCountry { get; set; } = null!; - - [ForeignKey("AddressCustomerId")] - [InverseProperty("ComAddresses")] - public virtual ComCustomer AddressCustomer { get; set; } = null!; - - [ForeignKey("AddressStateId")] - [InverseProperty("ComAddresses")] - public virtual CmsState? AddressState { get; set; } - - [InverseProperty("ShoppingCartBillingAddress")] - public virtual ICollection ComShoppingCartShoppingCartBillingAddresses { get; set; } = new List(); - - [InverseProperty("ShoppingCartCompanyAddress")] - public virtual ICollection ComShoppingCartShoppingCartCompanyAddresses { get; set; } = new List(); - - [InverseProperty("ShoppingCartShippingAddress")] - public virtual ICollection ComShoppingCartShoppingCartShippingAddresses { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/ComBrand.cs b/Migration.Toolkit.KX13/Models/ComBrand.cs deleted file mode 100644 index be00c224..00000000 --- a/Migration.Toolkit.KX13/Models/ComBrand.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Brand")] -[Index("BrandDisplayName", Name = "IX_COM_Brand_BrandDisplayName")] -[Index("BrandSiteId", "BrandEnabled", Name = "IX_COM_Brand_BrandSiteID_BrandEnabled")] -public class ComBrand -{ - [Key] - [Column("BrandID")] - public int BrandId { get; set; } - - [StringLength(200)] - public string BrandDisplayName { get; set; } = null!; - - [StringLength(200)] - public string BrandName { get; set; } = null!; - - public string? BrandDescription { get; set; } - - [StringLength(400)] - public string? BrandHomepage { get; set; } - - [Column("BrandThumbnailGUID")] - public Guid? BrandThumbnailGuid { get; set; } - - [Column("BrandSiteID")] - public int BrandSiteId { get; set; } - - [Required] - public bool? BrandEnabled { get; set; } - - public Guid BrandGuid { get; set; } - - public DateTime BrandLastModified { get; set; } - - [ForeignKey("BrandSiteId")] - [InverseProperty("ComBrands")] - public virtual CmsSite BrandSite { get; set; } = null!; - - [InverseProperty("Brand")] - public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); - - [InverseProperty("Skubrand")] - public virtual ICollection ComSkus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/ComCarrier.cs b/Migration.Toolkit.KX13/Models/ComCarrier.cs deleted file mode 100644 index 3db33acf..00000000 --- a/Migration.Toolkit.KX13/Models/ComCarrier.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Carrier")] -[Index("CarrierSiteId", Name = "IX_COM_Carrier_CarrierSiteID")] -public class ComCarrier -{ - [Key] - [Column("CarrierID")] - public int CarrierId { get; set; } - - [StringLength(200)] - public string CarrierDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CarrierName { get; set; } = null!; - - [Column("CarrierSiteID")] - public int CarrierSiteId { get; set; } - - [Column("CarrierGUID")] - public Guid CarrierGuid { get; set; } - - [StringLength(200)] - public string CarrierAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string CarrierClassName { get; set; } = null!; - - public DateTime CarrierLastModified { get; set; } - - [ForeignKey("CarrierSiteId")] - [InverseProperty("ComCarriers")] - public virtual CmsSite CarrierSite { get; set; } = null!; - - [InverseProperty("ShippingOptionCarrier")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/ComCollection.cs b/Migration.Toolkit.KX13/Models/ComCollection.cs deleted file mode 100644 index e9d3bcc6..00000000 --- a/Migration.Toolkit.KX13/Models/ComCollection.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Collection")] -[Index("CollectionDisplayName", Name = "IX_COM_Collection_CollectionDisplayName")] -[Index("CollectionSiteId", "CollectionEnabled", Name = "IX_COM_Collection_CollectionSiteID_CollectionEnabled")] -public class ComCollection -{ - [Key] - [Column("CollectionID")] - public int CollectionId { get; set; } - - [StringLength(200)] - public string CollectionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CollectionName { get; set; } = null!; - - public string? CollectionDescription { get; set; } - - [Column("CollectionSiteID")] - public int CollectionSiteId { get; set; } - - [Required] - public bool? CollectionEnabled { get; set; } - - public Guid CollectionGuid { get; set; } - - public DateTime CollectionLastModified { get; set; } - - [ForeignKey("CollectionSiteId")] - [InverseProperty("ComCollections")] - public virtual CmsSite CollectionSite { get; set; } = null!; - - [InverseProperty("Collection")] - public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); - - [InverseProperty("Skucollection")] - public virtual ICollection ComSkus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/ComCouponCode.cs b/Migration.Toolkit.KX13/Models/ComCouponCode.cs deleted file mode 100644 index 84eafe87..00000000 --- a/Migration.Toolkit.KX13/Models/ComCouponCode.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_CouponCode")] -[Index("CouponCodeDiscountId", Name = "IX_COM_CouponCode_CouponCodeDiscountID")] -public class ComCouponCode -{ - [Key] - [Column("CouponCodeID")] - public int CouponCodeId { get; set; } - - [StringLength(200)] - public string CouponCodeCode { get; set; } = null!; - - public int? CouponCodeUseCount { get; set; } - - public int? CouponCodeUseLimit { get; set; } - - [Column("CouponCodeDiscountID")] - public int CouponCodeDiscountId { get; set; } - - public DateTime CouponCodeLastModified { get; set; } - - [Column("CouponCodeGUID")] - public Guid CouponCodeGuid { get; set; } - - [ForeignKey("CouponCodeDiscountId")] - [InverseProperty("ComCouponCodes")] - public virtual ComDiscount CouponCodeDiscount { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComCurrency.cs b/Migration.Toolkit.KX13/Models/ComCurrency.cs deleted file mode 100644 index 9f2dde9f..00000000 --- a/Migration.Toolkit.KX13/Models/ComCurrency.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Currency")] -[Index("CurrencyDisplayName", Name = "IX_COM_Currency_CurrencyDisplayName")] -[Index("CurrencySiteId", Name = "IX_COM_Currency_CurrencySiteID")] -public class ComCurrency -{ - [Key] - [Column("CurrencyID")] - public int CurrencyId { get; set; } - - [StringLength(200)] - public string CurrencyName { get; set; } = null!; - - [StringLength(200)] - public string CurrencyDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CurrencyCode { get; set; } = null!; - - public int? CurrencyRoundTo { get; set; } - - public bool CurrencyEnabled { get; set; } - - [StringLength(200)] - public string CurrencyFormatString { get; set; } = null!; - - public bool CurrencyIsMain { get; set; } - - [Column("CurrencyGUID")] - public Guid? CurrencyGuid { get; set; } - - public DateTime CurrencyLastModified { get; set; } - - [Column("CurrencySiteID")] - public int? CurrencySiteId { get; set; } - - [InverseProperty("ExchangeRateToCurrency")] - public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); - - [InverseProperty("OrderCurrency")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartCurrency")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("CurrencySiteId")] - [InverseProperty("ComCurrencies")] - public virtual CmsSite? CurrencySite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComCurrencyExchangeRate.cs b/Migration.Toolkit.KX13/Models/ComCurrencyExchangeRate.cs deleted file mode 100644 index c876abed..00000000 --- a/Migration.Toolkit.KX13/Models/ComCurrencyExchangeRate.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_CurrencyExchangeRate")] -[Index("ExchangeRateToCurrencyId", Name = "IX_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID")] -[Index("ExchangeTableId", Name = "IX_COM_CurrencyExchangeRate_ExchangeTableID")] -public class ComCurrencyExchangeRate -{ - [Key] - [Column("ExchagneRateID")] - public int ExchagneRateId { get; set; } - - [Column("ExchangeRateToCurrencyID")] - public int ExchangeRateToCurrencyId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal ExchangeRateValue { get; set; } - - [Column("ExchangeTableID")] - public int ExchangeTableId { get; set; } - - [Column("ExchangeRateGUID")] - public Guid ExchangeRateGuid { get; set; } - - public DateTime ExchangeRateLastModified { get; set; } - - [ForeignKey("ExchangeRateToCurrencyId")] - [InverseProperty("ComCurrencyExchangeRates")] - public virtual ComCurrency ExchangeRateToCurrency { get; set; } = null!; - - [ForeignKey("ExchangeTableId")] - [InverseProperty("ComCurrencyExchangeRates")] - public virtual ComExchangeTable ExchangeTable { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComCustomer.cs b/Migration.Toolkit.KX13/Models/ComCustomer.cs deleted file mode 100644 index 290fef21..00000000 --- a/Migration.Toolkit.KX13/Models/ComCustomer.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Customer")] -[Index("CustomerEmail", Name = "IX_COM_Customer_CustomerEmail")] -[Index("CustomerFirstName", Name = "IX_COM_Customer_CustomerFirstName")] -[Index("CustomerLastName", Name = "IX_COM_Customer_CustomerLastName")] -[Index("CustomerSiteId", Name = "IX_COM_Customer_CustomerSiteID")] -[Index("CustomerUserId", Name = "IX_COM_Customer_CustomerUserID")] -public class ComCustomer -{ - [Key] - [Column("CustomerID")] - public int CustomerId { get; set; } - - [StringLength(200)] - public string CustomerFirstName { get; set; } = null!; - - [StringLength(200)] - public string CustomerLastName { get; set; } = null!; - - [StringLength(254)] - public string? CustomerEmail { get; set; } - - [StringLength(26)] - public string? CustomerPhone { get; set; } - - [StringLength(50)] - public string? CustomerFax { get; set; } - - [StringLength(200)] - public string? CustomerCompany { get; set; } - - [Column("CustomerUserID")] - public int? CustomerUserId { get; set; } - - [Column("CustomerGUID")] - public Guid CustomerGuid { get; set; } - - [Column("CustomerTaxRegistrationID")] - [StringLength(50)] - public string? CustomerTaxRegistrationId { get; set; } - - [Column("CustomerOrganizationID")] - [StringLength(50)] - public string? CustomerOrganizationId { get; set; } - - public DateTime CustomerLastModified { get; set; } - - [Column("CustomerSiteID")] - public int? CustomerSiteId { get; set; } - - public DateTime? CustomerCreated { get; set; } - - [InverseProperty("AddressCustomer")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("EventCustomer")] - public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); - - [InverseProperty("OrderCustomer")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartCustomer")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("CustomerSiteId")] - [InverseProperty("ComCustomers")] - public virtual CmsSite? CustomerSite { get; set; } - - [ForeignKey("CustomerUserId")] - [InverseProperty("ComCustomers")] - public virtual CmsUser? CustomerUser { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComCustomerCreditHistory.cs b/Migration.Toolkit.KX13/Models/ComCustomerCreditHistory.cs deleted file mode 100644 index d32cbf50..00000000 --- a/Migration.Toolkit.KX13/Models/ComCustomerCreditHistory.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_CustomerCreditHistory")] -[Index("EventCustomerId", "EventDate", Name = "IX_COM_CustomerCreditHistory_EventCustomerID_EventDate", IsDescending = new[] { false, true })] -[Index("EventSiteId", Name = "IX_COM_CustomerCreditHistory_EventSiteID")] -public class ComCustomerCreditHistory -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(200)] - public string EventName { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal EventCreditChange { get; set; } - - public DateTime EventDate { get; set; } - - public string? EventDescription { get; set; } - - [Column("EventCustomerID")] - public int EventCustomerId { get; set; } - - [Column("EventCreditGUID")] - public Guid? EventCreditGuid { get; set; } - - public DateTime EventCreditLastModified { get; set; } - - [Column("EventSiteID")] - public int? EventSiteId { get; set; } - - [ForeignKey("EventCustomerId")] - [InverseProperty("ComCustomerCreditHistories")] - public virtual ComCustomer EventCustomer { get; set; } = null!; - - [ForeignKey("EventSiteId")] - [InverseProperty("ComCustomerCreditHistories")] - public virtual CmsSite? EventSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComDepartment.cs b/Migration.Toolkit.KX13/Models/ComDepartment.cs deleted file mode 100644 index 71f629a0..00000000 --- a/Migration.Toolkit.KX13/Models/ComDepartment.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Department")] -[Index("DepartmentDefaultTaxClassId", Name = "IX_COM_Department_DepartmentDefaultTaxClassID")] -[Index("DepartmentDisplayName", Name = "IX_COM_Department_DepartmentDisplayName")] -[Index("DepartmentName", "DepartmentSiteId", Name = "IX_COM_Department_DepartmentName_DepartmentSiteID", IsUnique = true)] -[Index("DepartmentSiteId", Name = "IX_COM_Department_DepartmentSiteID")] -public class ComDepartment -{ - [Key] - [Column("DepartmentID")] - public int DepartmentId { get; set; } - - [StringLength(200)] - public string DepartmentName { get; set; } = null!; - - [StringLength(200)] - public string DepartmentDisplayName { get; set; } = null!; - - [Column("DepartmentDefaultTaxClassID")] - public int? DepartmentDefaultTaxClassId { get; set; } - - [Column("DepartmentGUID")] - public Guid DepartmentGuid { get; set; } - - public DateTime DepartmentLastModified { get; set; } - - [Column("DepartmentSiteID")] - public int? DepartmentSiteId { get; set; } - - [InverseProperty("Skudepartment")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("DepartmentDefaultTaxClassId")] - [InverseProperty("ComDepartments")] - public virtual ComTaxClass? DepartmentDefaultTaxClass { get; set; } - - [ForeignKey("DepartmentSiteId")] - [InverseProperty("ComDepartments")] - public virtual CmsSite? DepartmentSite { get; set; } - - [ForeignKey("DepartmentId")] - [InverseProperty("Departments")] - public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/ComDiscount.cs b/Migration.Toolkit.KX13/Models/ComDiscount.cs deleted file mode 100644 index 517a5a43..00000000 --- a/Migration.Toolkit.KX13/Models/ComDiscount.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Discount")] -[Index("DiscountSiteId", Name = "IX_COM_Discount_DiscountSiteID")] -public class ComDiscount -{ - [Key] - [Column("DiscountID")] - public int DiscountId { get; set; } - - [StringLength(200)] - public string DiscountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string DiscountName { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal DiscountValue { get; set; } - - [Required] - public bool? DiscountEnabled { get; set; } - - [Column("DiscountGUID")] - public Guid DiscountGuid { get; set; } - - public DateTime DiscountLastModified { get; set; } - - [Column("DiscountSiteID")] - public int DiscountSiteId { get; set; } - - public string? DiscountDescription { get; set; } - - public DateTime? DiscountValidFrom { get; set; } - - public DateTime? DiscountValidTo { get; set; } - - public double DiscountOrder { get; set; } - - public string? DiscountProductCondition { get; set; } - - [StringLength(400)] - public string? DiscountRoles { get; set; } - - [StringLength(200)] - public string? DiscountCustomerRestriction { get; set; } - - public bool DiscountIsFlat { get; set; } - - public string? DiscountCartCondition { get; set; } - - [StringLength(100)] - public string DiscountApplyTo { get; set; } = null!; - - [Required] - public bool? DiscountApplyFurtherDiscounts { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? DiscountOrderAmount { get; set; } - - public bool DiscountUsesCoupons { get; set; } - - [InverseProperty("CouponCodeDiscount")] - public virtual ICollection ComCouponCodes { get; set; } = new List(); - - [ForeignKey("DiscountSiteId")] - [InverseProperty("ComDiscounts")] - public virtual CmsSite DiscountSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComExchangeTable.cs b/Migration.Toolkit.KX13/Models/ComExchangeTable.cs deleted file mode 100644 index 5e0f314b..00000000 --- a/Migration.Toolkit.KX13/Models/ComExchangeTable.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_ExchangeTable")] -[Index("ExchangeTableSiteId", Name = "IX_COM_ExchangeTable_ExchangeTableSiteID")] -public class ComExchangeTable -{ - [Key] - [Column("ExchangeTableID")] - public int ExchangeTableId { get; set; } - - [StringLength(200)] - public string ExchangeTableDisplayName { get; set; } = null!; - - public DateTime? ExchangeTableValidFrom { get; set; } - - public DateTime? ExchangeTableValidTo { get; set; } - - [Column("ExchangeTableGUID")] - public Guid ExchangeTableGuid { get; set; } - - public DateTime ExchangeTableLastModified { get; set; } - - [Column("ExchangeTableSiteID")] - public int? ExchangeTableSiteId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? ExchangeTableRateFromGlobalCurrency { get; set; } - - [InverseProperty("ExchangeTable")] - public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); - - [ForeignKey("ExchangeTableSiteId")] - [InverseProperty("ComExchangeTables")] - public virtual CmsSite? ExchangeTableSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComGiftCard.cs b/Migration.Toolkit.KX13/Models/ComGiftCard.cs deleted file mode 100644 index efb4a40e..00000000 --- a/Migration.Toolkit.KX13/Models/ComGiftCard.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_GiftCard")] -[Index("GiftCardSiteId", Name = "IX_COM_GiftCard_GiftCardSiteID")] -public class ComGiftCard -{ - [Key] - [Column("GiftCardID")] - public int GiftCardId { get; set; } - - public Guid GiftCardGuid { get; set; } - - [StringLength(200)] - public string GiftCardDisplayName { get; set; } = null!; - - [StringLength(200)] - public string GiftCardName { get; set; } = null!; - - public string? GiftCardDescription { get; set; } - - [Required] - public bool? GiftCardEnabled { get; set; } - - public DateTime GiftCardLastModified { get; set; } - - [Column("GiftCardSiteID")] - public int GiftCardSiteId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal GiftCardValue { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? GiftCardMinimumOrderPrice { get; set; } - - public string? GiftCardCartCondition { get; set; } - - public DateTime? GiftCardValidFrom { get; set; } - - public DateTime? GiftCardValidTo { get; set; } - - [StringLength(200)] - public string? GiftCardCustomerRestriction { get; set; } - - [StringLength(400)] - public string? GiftCardRoles { get; set; } - - [InverseProperty("GiftCardCouponCodeGiftCard")] - public virtual ICollection ComGiftCardCouponCodes { get; set; } = new List(); - - [ForeignKey("GiftCardSiteId")] - [InverseProperty("ComGiftCards")] - public virtual CmsSite GiftCardSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComGiftCardCouponCode.cs b/Migration.Toolkit.KX13/Models/ComGiftCardCouponCode.cs deleted file mode 100644 index 40663c1f..00000000 --- a/Migration.Toolkit.KX13/Models/ComGiftCardCouponCode.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_GiftCardCouponCode")] -[Index("GiftCardCouponCodeGiftCardId", Name = "IX_COM_GiftCardCouponCodeGiftCardID")] -public class ComGiftCardCouponCode -{ - [Key] - [Column("GiftCardCouponCodeID")] - public int GiftCardCouponCodeId { get; set; } - - [StringLength(200)] - public string GiftCardCouponCodeCode { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal GiftCardCouponCodeRemainingValue { get; set; } - - [Column("GiftCardCouponCodeGiftCardID")] - public int GiftCardCouponCodeGiftCardId { get; set; } - - public Guid GiftCardCouponCodeGuid { get; set; } - - public DateTime GiftCardCouponCodeLastModified { get; set; } - - [ForeignKey("GiftCardCouponCodeGiftCardId")] - [InverseProperty("ComGiftCardCouponCodes")] - public virtual ComGiftCard GiftCardCouponCodeGiftCard { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComInternalStatus.cs b/Migration.Toolkit.KX13/Models/ComInternalStatus.cs deleted file mode 100644 index 9f567fc5..00000000 --- a/Migration.Toolkit.KX13/Models/ComInternalStatus.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_InternalStatus")] -[Index("InternalStatusSiteId", "InternalStatusDisplayName", "InternalStatusEnabled", Name = "IX_COM_InternalStatus_InternalStatusSiteID_InternalStatusDisplayName_InternalStatusEnabled")] -public class ComInternalStatus -{ - [Key] - [Column("InternalStatusID")] - public int InternalStatusId { get; set; } - - [StringLength(200)] - public string InternalStatusName { get; set; } = null!; - - [StringLength(200)] - public string InternalStatusDisplayName { get; set; } = null!; - - [Required] - public bool? InternalStatusEnabled { get; set; } - - [Column("InternalStatusGUID")] - public Guid InternalStatusGuid { get; set; } - - public DateTime InternalStatusLastModified { get; set; } - - [Column("InternalStatusSiteID")] - public int? InternalStatusSiteId { get; set; } - - [InverseProperty("SkuinternalStatus")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("InternalStatusSiteId")] - [InverseProperty("ComInternalStatuses")] - public virtual CmsSite? InternalStatusSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComManufacturer.cs b/Migration.Toolkit.KX13/Models/ComManufacturer.cs deleted file mode 100644 index 543016c2..00000000 --- a/Migration.Toolkit.KX13/Models/ComManufacturer.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Manufacturer")] -[Index("ManufacturerSiteId", Name = "IX_COM_Manufacturer_ManufacturerSiteID")] -public class ComManufacturer -{ - [Key] - [Column("ManufacturerID")] - public int ManufacturerId { get; set; } - - [StringLength(200)] - public string ManufacturerDisplayName { get; set; } = null!; - - [StringLength(400)] - public string? ManufactureHomepage { get; set; } - - [Required] - public bool? ManufacturerEnabled { get; set; } - - [Column("ManufacturerGUID")] - public Guid ManufacturerGuid { get; set; } - - public DateTime ManufacturerLastModified { get; set; } - - [Column("ManufacturerSiteID")] - public int? ManufacturerSiteId { get; set; } - - [Column("ManufacturerThumbnailGUID")] - public Guid? ManufacturerThumbnailGuid { get; set; } - - public string? ManufacturerDescription { get; set; } - - [StringLength(200)] - public string? ManufacturerName { get; set; } - - [InverseProperty("Skumanufacturer")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("ManufacturerSiteId")] - [InverseProperty("ComManufacturers")] - public virtual CmsSite? ManufacturerSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyCouponCode.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyCouponCode.cs deleted file mode 100644 index 31d5af00..00000000 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyCouponCode.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_MultiBuyCouponCode")] -[Index("MultiBuyCouponCodeMultiBuyDiscountId", Name = "IX_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID")] -public class ComMultiBuyCouponCode -{ - [Key] - [Column("MultiBuyCouponCodeID")] - public int MultiBuyCouponCodeId { get; set; } - - [StringLength(200)] - public string MultiBuyCouponCodeCode { get; set; } = null!; - - public int? MultiBuyCouponCodeUseLimit { get; set; } - - public int? MultiBuyCouponCodeUseCount { get; set; } - - [Column("MultiBuyCouponCodeMultiBuyDiscountID")] - public int MultiBuyCouponCodeMultiBuyDiscountId { get; set; } - - public DateTime MultiBuyCouponCodeLastModified { get; set; } - - [Column("MultiBuyCouponCodeGUID")] - public Guid MultiBuyCouponCodeGuid { get; set; } - - [ForeignKey("MultiBuyCouponCodeMultiBuyDiscountId")] - [InverseProperty("ComMultiBuyCouponCodes")] - public virtual ComMultiBuyDiscount MultiBuyCouponCodeMultiBuyDiscount { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscount.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscount.cs deleted file mode 100644 index 93570e44..00000000 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscount.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_MultiBuyDiscount")] -[Index("MultiBuyDiscountApplyToSkuid", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID")] -[Index("MultiBuyDiscountSiteId", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountSiteID")] -public class ComMultiBuyDiscount -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [StringLength(200)] - public string MultiBuyDiscountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string MultiBuyDiscountName { get; set; } = null!; - - public string? MultiBuyDiscountDescription { get; set; } - - [Required] - public bool? MultiBuyDiscountEnabled { get; set; } - - [Column("MultiBuyDiscountGUID")] - public Guid MultiBuyDiscountGuid { get; set; } - - public DateTime MultiBuyDiscountLastModified { get; set; } - - [Column("MultiBuyDiscountSiteID")] - public int MultiBuyDiscountSiteId { get; set; } - - [Required] - public bool? MultiBuyDiscountApplyFurtherDiscounts { get; set; } - - public int MultiBuyDiscountMinimumBuyCount { get; set; } - - public DateTime? MultiBuyDiscountValidFrom { get; set; } - - public DateTime? MultiBuyDiscountValidTo { get; set; } - - [StringLength(200)] - public string MultiBuyDiscountCustomerRestriction { get; set; } = null!; - - [StringLength(400)] - public string? MultiBuyDiscountRoles { get; set; } - - [Column("MultiBuyDiscountApplyToSKUID")] - public int? MultiBuyDiscountApplyToSkuid { get; set; } - - public int? MultiBuyDiscountLimitPerOrder { get; set; } - - public bool? MultiBuyDiscountUsesCoupons { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? MultiBuyDiscountValue { get; set; } - - public bool? MultiBuyDiscountIsFlat { get; set; } - - [Required] - public bool? MultiBuyDiscountAutoAddEnabled { get; set; } - - public int? MultiBuyDiscountPriority { get; set; } - - public bool MultiBuyDiscountIsProductCoupon { get; set; } - - [InverseProperty("MultiBuyCouponCodeMultiBuyDiscount")] - public virtual ICollection ComMultiBuyCouponCodes { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscount")] - public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); - - [InverseProperty("MultibuyDiscount")] - public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscount")] - public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); - - [ForeignKey("MultiBuyDiscountApplyToSkuid")] - [InverseProperty("ComMultiBuyDiscounts")] - public virtual ComSku? MultiBuyDiscountApplyToSku { get; set; } - - [ForeignKey("MultiBuyDiscountSiteId")] - [InverseProperty("ComMultiBuyDiscounts")] - public virtual CmsSite MultiBuyDiscountSite { get; set; } = null!; - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("MultiBuyDiscounts")] - public virtual ICollection Departments { get; set; } = new List(); - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("MultiBuyDiscounts")] - public virtual ICollection Skus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountBrand.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountBrand.cs deleted file mode 100644 index 2914ac66..00000000 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountBrand.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("MultiBuyDiscountId", "BrandId")] -[Table("COM_MultiBuyDiscountBrand")] -[Index("BrandId", Name = "IX_COM_MultiBuyDiscountBrand_BrandID")] -public class ComMultiBuyDiscountBrand -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [Key] - [Column("BrandID")] - public int BrandId { get; set; } - - [Required] - public bool? BrandIncluded { get; set; } - - [ForeignKey("BrandId")] - [InverseProperty("ComMultiBuyDiscountBrands")] - public virtual ComBrand Brand { get; set; } = null!; - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountBrands")] - public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountCollection.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountCollection.cs deleted file mode 100644 index 0519743c..00000000 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountCollection.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("MultibuyDiscountId", "CollectionId")] -[Table("COM_MultiBuyDiscountCollection")] -[Index("CollectionId", Name = "IX_COM_MultiBuyDiscountCollection_CollectionID")] -public class ComMultiBuyDiscountCollection -{ - [Key] - [Column("MultibuyDiscountID")] - public int MultibuyDiscountId { get; set; } - - [Key] - [Column("CollectionID")] - public int CollectionId { get; set; } - - [Required] - public bool? CollectionIncluded { get; set; } - - [ForeignKey("CollectionId")] - [InverseProperty("ComMultiBuyDiscountCollections")] - public virtual ComCollection Collection { get; set; } = null!; - - [ForeignKey("MultibuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountCollections")] - public virtual ComMultiBuyDiscount MultibuyDiscount { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountTree.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountTree.cs deleted file mode 100644 index e4a5af62..00000000 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountTree.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("MultiBuyDiscountId", "NodeId")] -[Table("COM_MultiBuyDiscountTree")] -[Index("NodeId", Name = "IX_COM_MultiBuyDiscountTree_NodeID")] -public class ComMultiBuyDiscountTree -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - [Required] - public bool? NodeIncluded { get; set; } - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountTrees")] - public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; - - [ForeignKey("NodeId")] - [InverseProperty("ComMultiBuyDiscountTrees")] - public virtual CmsTree Node { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComOptionCategory.cs b/Migration.Toolkit.KX13/Models/ComOptionCategory.cs deleted file mode 100644 index fd3f3e94..00000000 --- a/Migration.Toolkit.KX13/Models/ComOptionCategory.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_OptionCategory")] -[Index("CategorySiteId", Name = "IX_COM_OptionCategory_CategorySiteID")] -public class ComOptionCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryName { get; set; } = null!; - - [StringLength(200)] - public string CategorySelectionType { get; set; } = null!; - - [StringLength(200)] - public string? CategoryDefaultOptions { get; set; } - - public string? CategoryDescription { get; set; } - - [StringLength(200)] - public string? CategoryDefaultRecord { get; set; } - - [Required] - public bool? CategoryEnabled { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - public bool? CategoryDisplayPrice { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - public int? CategoryTextMaxLength { get; set; } - - [StringLength(20)] - public string? CategoryType { get; set; } - - public int? CategoryTextMinLength { get; set; } - - [StringLength(200)] - public string? CategoryLiveSiteDisplayName { get; set; } - - [ForeignKey("CategorySiteId")] - [InverseProperty("ComOptionCategories")] - public virtual CmsSite? CategorySite { get; set; } - - [InverseProperty("Category")] - public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); - - [InverseProperty("SkuoptionCategory")] - public virtual ICollection ComSkus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/ComOrder.cs b/Migration.Toolkit.KX13/Models/ComOrder.cs deleted file mode 100644 index 0a8a4f88..00000000 --- a/Migration.Toolkit.KX13/Models/ComOrder.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Order")] -[Index("OrderCreatedByUserId", Name = "IX_COM_Order_OrderCreatedByUserID")] -[Index("OrderCurrencyId", Name = "IX_COM_Order_OrderCurrencyID")] -[Index("OrderCustomerId", Name = "IX_COM_Order_OrderCustomerID")] -[Index("OrderPaymentOptionId", Name = "IX_COM_Order_OrderPaymentOptionID")] -[Index("OrderShippingOptionId", Name = "IX_COM_Order_OrderShippingOptionID")] -[Index("OrderSiteId", "OrderDate", Name = "IX_COM_Order_OrderSiteID_OrderDate", IsDescending = new[] { false, true })] -[Index("OrderStatusId", Name = "IX_COM_Order_OrderStatusID")] -public class ComOrder -{ - [Key] - [Column("OrderID")] - public int OrderId { get; set; } - - [Column("OrderShippingOptionID")] - public int? OrderShippingOptionId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderTotalShipping { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderTotalPrice { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderTotalTax { get; set; } - - public DateTime OrderDate { get; set; } - - [Column("OrderStatusID")] - public int? OrderStatusId { get; set; } - - [Column("OrderCurrencyID")] - public int? OrderCurrencyId { get; set; } - - [Column("OrderCustomerID")] - public int OrderCustomerId { get; set; } - - [Column("OrderCreatedByUserID")] - public int? OrderCreatedByUserId { get; set; } - - public string? OrderNote { get; set; } - - [Column("OrderSiteID")] - public int OrderSiteId { get; set; } - - [Column("OrderPaymentOptionID")] - public int? OrderPaymentOptionId { get; set; } - - public string? OrderInvoice { get; set; } - - [StringLength(200)] - public string? OrderInvoiceNumber { get; set; } - - [StringLength(100)] - public string? OrderTrackingNumber { get; set; } - - public string? OrderCustomData { get; set; } - - public string? OrderPaymentResult { get; set; } - - [Column("OrderGUID")] - public Guid OrderGuid { get; set; } - - public DateTime OrderLastModified { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderTotalPriceInMainCurrency { get; set; } - - public bool? OrderIsPaid { get; set; } - - [StringLength(50)] - public string? OrderCulture { get; set; } - - public string? OrderDiscounts { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderGrandTotal { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderGrandTotalInMainCurrency { get; set; } - - public string? OrderOtherPayments { get; set; } - - public string? OrderTaxSummary { get; set; } - - public string? OrderCouponCodes { get; set; } - - [InverseProperty("AddressOrder")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("OrderItemOrder")] - public virtual ICollection ComOrderItems { get; set; } = new List(); - - [InverseProperty("Order")] - public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); - - [ForeignKey("OrderCreatedByUserId")] - [InverseProperty("ComOrders")] - public virtual CmsUser? OrderCreatedByUser { get; set; } - - [ForeignKey("OrderCurrencyId")] - [InverseProperty("ComOrders")] - public virtual ComCurrency? OrderCurrency { get; set; } - - [ForeignKey("OrderCustomerId")] - [InverseProperty("ComOrders")] - public virtual ComCustomer OrderCustomer { get; set; } = null!; - - [ForeignKey("OrderPaymentOptionId")] - [InverseProperty("ComOrders")] - public virtual ComPaymentOption? OrderPaymentOption { get; set; } - - [ForeignKey("OrderShippingOptionId")] - [InverseProperty("ComOrders")] - public virtual ComShippingOption? OrderShippingOption { get; set; } - - [ForeignKey("OrderSiteId")] - [InverseProperty("ComOrders")] - public virtual CmsSite OrderSite { get; set; } = null!; - - [ForeignKey("OrderStatusId")] - [InverseProperty("ComOrders")] - public virtual ComOrderStatus? OrderStatus { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComOrderAddress.cs b/Migration.Toolkit.KX13/Models/ComOrderAddress.cs deleted file mode 100644 index 3de60688..00000000 --- a/Migration.Toolkit.KX13/Models/ComOrderAddress.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_OrderAddress")] -[Index("AddressCountryId", Name = "IX_COM_OrderAddress_AddressCountryID")] -[Index("AddressOrderId", "AddressType", Name = "IX_COM_OrderAddress_AddressOrderID_AddressType", IsUnique = true)] -[Index("AddressStateId", Name = "IX_COM_OrderAddress_AddressStateID")] -public class ComOrderAddress -{ - [Key] - [Column("AddressID")] - public int AddressId { get; set; } - - [StringLength(100)] - public string AddressLine1 { get; set; } = null!; - - [StringLength(100)] - public string? AddressLine2 { get; set; } - - [StringLength(100)] - public string AddressCity { get; set; } = null!; - - [StringLength(20)] - public string AddressZip { get; set; } = null!; - - [StringLength(26)] - public string? AddressPhone { get; set; } - - [Column("AddressCountryID")] - public int AddressCountryId { get; set; } - - [Column("AddressStateID")] - public int? AddressStateId { get; set; } - - [StringLength(200)] - public string AddressPersonalName { get; set; } = null!; - - [Column("AddressGUID")] - public Guid? AddressGuid { get; set; } - - public DateTime AddressLastModified { get; set; } - - [Column("AddressOrderID")] - public int AddressOrderId { get; set; } - - public int AddressType { get; set; } - - [ForeignKey("AddressCountryId")] - [InverseProperty("ComOrderAddresses")] - public virtual CmsCountry AddressCountry { get; set; } = null!; - - [ForeignKey("AddressOrderId")] - [InverseProperty("ComOrderAddresses")] - public virtual ComOrder AddressOrder { get; set; } = null!; - - [ForeignKey("AddressStateId")] - [InverseProperty("ComOrderAddresses")] - public virtual CmsState? AddressState { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComOrderItem.cs b/Migration.Toolkit.KX13/Models/ComOrderItem.cs deleted file mode 100644 index c9be49bc..00000000 --- a/Migration.Toolkit.KX13/Models/ComOrderItem.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_OrderItem")] -[Index("OrderItemOrderId", Name = "IX_COM_OrderItem_OrderItemOrderID")] -[Index("OrderItemSkuid", Name = "IX_COM_OrderItem_OrderItemSKUID")] -public class ComOrderItem -{ - [Key] - [Column("OrderItemID")] - public int OrderItemId { get; set; } - - [Column("OrderItemOrderID")] - public int OrderItemOrderId { get; set; } - - [Column("OrderItemSKUID")] - public int OrderItemSkuid { get; set; } - - [Column("OrderItemSKUName")] - [StringLength(450)] - public string OrderItemSkuname { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderItemUnitPrice { get; set; } - - public int OrderItemUnitCount { get; set; } - - public string? OrderItemCustomData { get; set; } - - public Guid OrderItemGuid { get; set; } - - public Guid? OrderItemParentGuid { get; set; } - - public DateTime OrderItemLastModified { get; set; } - - public DateTime? OrderItemValidTo { get; set; } - - [Column("OrderItemBundleGUID")] - public Guid? OrderItemBundleGuid { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderItemTotalPriceInMainCurrency { get; set; } - - public bool? OrderItemSendNotification { get; set; } - - public string? OrderItemText { get; set; } - - public string? OrderItemProductDiscounts { get; set; } - - public string? OrderItemDiscountSummary { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderItemTotalPrice { get; set; } - - [InverseProperty("OrderItem")] - public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); - - [ForeignKey("OrderItemOrderId")] - [InverseProperty("ComOrderItems")] - public virtual ComOrder OrderItemOrder { get; set; } = null!; - - [ForeignKey("OrderItemSkuid")] - [InverseProperty("ComOrderItems")] - public virtual ComSku OrderItemSku { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComOrderItemSkufile.cs b/Migration.Toolkit.KX13/Models/ComOrderItemSkufile.cs deleted file mode 100644 index 0dfec3eb..00000000 --- a/Migration.Toolkit.KX13/Models/ComOrderItemSkufile.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_OrderItemSKUFile")] -[Index("FileId", Name = "IX_COM_OrderItemSKUFile_FileID")] -[Index("OrderItemId", Name = "IX_COM_OrderItemSKUFile_OrderItemID")] -public class ComOrderItemSkufile -{ - [Key] - [Column("OrderItemSKUFileID")] - public int OrderItemSkufileId { get; set; } - - public Guid Token { get; set; } - - [Column("OrderItemID")] - public int OrderItemId { get; set; } - - [Column("FileID")] - public int FileId { get; set; } - - [ForeignKey("FileId")] - [InverseProperty("ComOrderItemSkufiles")] - public virtual ComSkufile File { get; set; } = null!; - - [ForeignKey("OrderItemId")] - [InverseProperty("ComOrderItemSkufiles")] - public virtual ComOrderItem OrderItem { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComOrderStatus.cs b/Migration.Toolkit.KX13/Models/ComOrderStatus.cs deleted file mode 100644 index a23e3412..00000000 --- a/Migration.Toolkit.KX13/Models/ComOrderStatus.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_OrderStatus")] -[Index("StatusSiteId", "StatusOrder", Name = "IX_COM_OrderStatus_StatusSiteID_StatusOrder")] -public class ComOrderStatus -{ - [Key] - [Column("StatusID")] - public int StatusId { get; set; } - - [StringLength(200)] - public string StatusName { get; set; } = null!; - - [StringLength(200)] - public string StatusDisplayName { get; set; } = null!; - - public int? StatusOrder { get; set; } - - [Required] - public bool? StatusEnabled { get; set; } - - [StringLength(7)] - public string? StatusColor { get; set; } - - [Column("StatusGUID")] - public Guid StatusGuid { get; set; } - - public DateTime StatusLastModified { get; set; } - - public bool? StatusSendNotification { get; set; } - - [Column("StatusSiteID")] - public int? StatusSiteId { get; set; } - - public bool? StatusOrderIsPaid { get; set; } - - [InverseProperty("FromStatus")] - public virtual ICollection ComOrderStatusUserFromStatuses { get; set; } = new List(); - - [InverseProperty("ToStatus")] - public virtual ICollection ComOrderStatusUserToStatuses { get; set; } = new List(); - - [InverseProperty("OrderStatus")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("PaymentOptionAuthorizedOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionAuthorizedOrderStatuses { get; set; } = new List(); - - [InverseProperty("PaymentOptionFailedOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionFailedOrderStatuses { get; set; } = new List(); - - [InverseProperty("PaymentOptionSucceededOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionSucceededOrderStatuses { get; set; } = new List(); - - [ForeignKey("StatusSiteId")] - [InverseProperty("ComOrderStatuses")] - public virtual CmsSite? StatusSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComOrderStatusUser.cs b/Migration.Toolkit.KX13/Models/ComOrderStatusUser.cs deleted file mode 100644 index 64749710..00000000 --- a/Migration.Toolkit.KX13/Models/ComOrderStatusUser.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_OrderStatusUser")] -[Index("ChangedByUserId", Name = "IX_COM_OrderStatusUser_ChangedByUserID")] -[Index("FromStatusId", Name = "IX_COM_OrderStatusUser_FromStatusID")] -[Index("OrderId", "Date", Name = "IX_COM_OrderStatusUser_OrderID_Date")] -[Index("ToStatusId", Name = "IX_COM_OrderStatusUser_ToStatusID")] -public class ComOrderStatusUser -{ - [Key] - [Column("OrderStatusUserID")] - public int OrderStatusUserId { get; set; } - - [Column("OrderID")] - public int OrderId { get; set; } - - [Column("FromStatusID")] - public int? FromStatusId { get; set; } - - [Column("ToStatusID")] - public int ToStatusId { get; set; } - - [Column("ChangedByUserID")] - public int? ChangedByUserId { get; set; } - - public DateTime Date { get; set; } - - public string? Note { get; set; } - - [ForeignKey("ChangedByUserId")] - [InverseProperty("ComOrderStatusUsers")] - public virtual CmsUser? ChangedByUser { get; set; } - - [ForeignKey("FromStatusId")] - [InverseProperty("ComOrderStatusUserFromStatuses")] - public virtual ComOrderStatus? FromStatus { get; set; } - - [ForeignKey("OrderId")] - [InverseProperty("ComOrderStatusUsers")] - public virtual ComOrder Order { get; set; } = null!; - - [ForeignKey("ToStatusId")] - [InverseProperty("ComOrderStatusUserToStatuses")] - public virtual ComOrderStatus ToStatus { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComPaymentOption.cs b/Migration.Toolkit.KX13/Models/ComPaymentOption.cs deleted file mode 100644 index 4c2d03e6..00000000 --- a/Migration.Toolkit.KX13/Models/ComPaymentOption.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_PaymentOption")] -[Index("PaymentOptionAuthorizedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID")] -[Index("PaymentOptionFailedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionFailedOrderStatusID")] -[Index("PaymentOptionSiteId", Name = "IX_COM_PaymentOption_PaymentOptionSiteID")] -[Index("PaymentOptionSucceededOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionSucceededOrderStatusID")] -public class ComPaymentOption -{ - [Key] - [Column("PaymentOptionID")] - public int PaymentOptionId { get; set; } - - [StringLength(200)] - public string PaymentOptionName { get; set; } = null!; - - [StringLength(200)] - public string PaymentOptionDisplayName { get; set; } = null!; - - [Required] - public bool? PaymentOptionEnabled { get; set; } - - [Column("PaymentOptionSiteID")] - public int? PaymentOptionSiteId { get; set; } - - [StringLength(500)] - public string? PaymentOptionPaymentGateUrl { get; set; } - - [StringLength(200)] - public string? PaymentOptionAssemblyName { get; set; } - - [StringLength(200)] - public string? PaymentOptionClassName { get; set; } - - [Column("PaymentOptionSucceededOrderStatusID")] - public int? PaymentOptionSucceededOrderStatusId { get; set; } - - [Column("PaymentOptionFailedOrderStatusID")] - public int? PaymentOptionFailedOrderStatusId { get; set; } - - [Column("PaymentOptionGUID")] - public Guid PaymentOptionGuid { get; set; } - - public DateTime PaymentOptionLastModified { get; set; } - - public bool? PaymentOptionAllowIfNoShipping { get; set; } - - [Column("PaymentOptionThumbnailGUID")] - public Guid? PaymentOptionThumbnailGuid { get; set; } - - public string? PaymentOptionDescription { get; set; } - - [Column("PaymentOptionAuthorizedOrderStatusID")] - public int? PaymentOptionAuthorizedOrderStatusId { get; set; } - - [InverseProperty("OrderPaymentOption")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartPaymentOption")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("PaymentOptionAuthorizedOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionAuthorizedOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionAuthorizedOrderStatus { get; set; } - - [ForeignKey("PaymentOptionFailedOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionFailedOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionFailedOrderStatus { get; set; } - - [ForeignKey("PaymentOptionSiteId")] - [InverseProperty("ComPaymentOptions")] - public virtual CmsSite? PaymentOptionSite { get; set; } - - [ForeignKey("PaymentOptionSucceededOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionSucceededOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionSucceededOrderStatus { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComPublicStatus.cs b/Migration.Toolkit.KX13/Models/ComPublicStatus.cs deleted file mode 100644 index 699cb5e6..00000000 --- a/Migration.Toolkit.KX13/Models/ComPublicStatus.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_PublicStatus")] -[Index("PublicStatusSiteId", Name = "IX_COM_PublicStatus_PublicStatusSiteID")] -public class ComPublicStatus -{ - [Key] - [Column("PublicStatusID")] - public int PublicStatusId { get; set; } - - [StringLength(200)] - public string PublicStatusName { get; set; } = null!; - - [StringLength(200)] - public string PublicStatusDisplayName { get; set; } = null!; - - [Required] - public bool? PublicStatusEnabled { get; set; } - - [Column("PublicStatusGUID")] - public Guid? PublicStatusGuid { get; set; } - - public DateTime PublicStatusLastModified { get; set; } - - [Column("PublicStatusSiteID")] - public int? PublicStatusSiteId { get; set; } - - [InverseProperty("SkupublicStatus")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("PublicStatusSiteId")] - [InverseProperty("ComPublicStatuses")] - public virtual CmsSite? PublicStatusSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComShippingCost.cs b/Migration.Toolkit.KX13/Models/ComShippingCost.cs deleted file mode 100644 index e29a7a47..00000000 --- a/Migration.Toolkit.KX13/Models/ComShippingCost.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_ShippingCost")] -[Index("ShippingCostShippingOptionId", Name = "IX_COM_ShippingCost_ShippingCostShippingOptionID")] -public class ComShippingCost -{ - [Key] - [Column("ShippingCostID")] - public int ShippingCostId { get; set; } - - [Column("ShippingCostShippingOptionID")] - public int ShippingCostShippingOptionId { get; set; } - - public double ShippingCostMinWeight { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal ShippingCostValue { get; set; } - - [Column("ShippingCostGUID")] - public Guid ShippingCostGuid { get; set; } - - public DateTime ShippingCostLastModified { get; set; } - - [ForeignKey("ShippingCostShippingOptionId")] - [InverseProperty("ComShippingCosts")] - public virtual ComShippingOption ShippingCostShippingOption { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComShippingOption.cs b/Migration.Toolkit.KX13/Models/ComShippingOption.cs deleted file mode 100644 index c3e02ba0..00000000 --- a/Migration.Toolkit.KX13/Models/ComShippingOption.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_ShippingOption")] -[Index("ShippingOptionCarrierId", Name = "IX_COM_ShippingOption_ShippingOptionCarrierID")] -[Index("ShippingOptionSiteId", Name = "IX_COM_ShippingOption_ShippingOptionSiteID_ShippingOptionDisplayName_ShippingOptionEnabled")] -[Index("ShippingOptionTaxClassId", Name = "IX_COM_ShippingOption_ShippingOptionTaxClassID")] -public class ComShippingOption -{ - [Key] - [Column("ShippingOptionID")] - public int ShippingOptionId { get; set; } - - [StringLength(200)] - public string ShippingOptionName { get; set; } = null!; - - [StringLength(200)] - public string ShippingOptionDisplayName { get; set; } = null!; - - [Required] - public bool? ShippingOptionEnabled { get; set; } - - [Column("ShippingOptionSiteID")] - public int? ShippingOptionSiteId { get; set; } - - [Column("ShippingOptionGUID")] - public Guid ShippingOptionGuid { get; set; } - - public DateTime ShippingOptionLastModified { get; set; } - - [Column("ShippingOptionThumbnailGUID")] - public Guid? ShippingOptionThumbnailGuid { get; set; } - - public string? ShippingOptionDescription { get; set; } - - [Column("ShippingOptionCarrierID")] - public int? ShippingOptionCarrierId { get; set; } - - [StringLength(200)] - public string? ShippingOptionCarrierServiceName { get; set; } - - [Column("ShippingOptionTaxClassID")] - public int? ShippingOptionTaxClassId { get; set; } - - [InverseProperty("OrderShippingOption")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShippingCostShippingOption")] - public virtual ICollection ComShippingCosts { get; set; } = new List(); - - [InverseProperty("ShoppingCartShippingOption")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("ShippingOptionCarrierId")] - [InverseProperty("ComShippingOptions")] - public virtual ComCarrier? ShippingOptionCarrier { get; set; } - - [ForeignKey("ShippingOptionSiteId")] - [InverseProperty("ComShippingOptions")] - public virtual CmsSite? ShippingOptionSite { get; set; } - - [ForeignKey("ShippingOptionTaxClassId")] - [InverseProperty("ComShippingOptions")] - public virtual ComTaxClass? ShippingOptionTaxClass { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComShoppingCart.cs b/Migration.Toolkit.KX13/Models/ComShoppingCart.cs deleted file mode 100644 index 3b4b6761..00000000 --- a/Migration.Toolkit.KX13/Models/ComShoppingCart.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_ShoppingCart")] -[Index("ShoppingCartBillingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartBillingAddressID")] -[Index("ShoppingCartCompanyAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartCompanyAddressID")] -[Index("ShoppingCartCurrencyId", Name = "IX_COM_ShoppingCart_ShoppingCartCurrencyID")] -[Index("ShoppingCartCustomerId", Name = "IX_COM_ShoppingCart_ShoppingCartCustomerID")] -[Index("ShoppingCartLastUpdate", Name = "IX_COM_ShoppingCart_ShoppingCartLastUpdate")] -[Index("ShoppingCartPaymentOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartPaymentOptionID")] -[Index("ShoppingCartShippingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingAddressID")] -[Index("ShoppingCartShippingOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingOptionID")] -[Index("ShoppingCartSiteId", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID")] -[Index("ShoppingCartGuid", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID_ShoppingCartGUID")] -[Index("ShoppingCartUserId", Name = "IX_COM_ShoppingCart_ShoppingCartUserID")] -public class ComShoppingCart -{ - [Key] - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [Column("ShoppingCartGUID")] - public Guid ShoppingCartGuid { get; set; } - - [Column("ShoppingCartUserID")] - public int? ShoppingCartUserId { get; set; } - - [Column("ShoppingCartSiteID")] - public int ShoppingCartSiteId { get; set; } - - public DateTime ShoppingCartLastUpdate { get; set; } - - [Column("ShoppingCartCurrencyID")] - public int? ShoppingCartCurrencyId { get; set; } - - [Column("ShoppingCartPaymentOptionID")] - public int? ShoppingCartPaymentOptionId { get; set; } - - [Column("ShoppingCartShippingOptionID")] - public int? ShoppingCartShippingOptionId { get; set; } - - [Column("ShoppingCartBillingAddressID")] - public int? ShoppingCartBillingAddressId { get; set; } - - [Column("ShoppingCartShippingAddressID")] - public int? ShoppingCartShippingAddressId { get; set; } - - [Column("ShoppingCartCustomerID")] - public int? ShoppingCartCustomerId { get; set; } - - public string? ShoppingCartNote { get; set; } - - [Column("ShoppingCartCompanyAddressID")] - public int? ShoppingCartCompanyAddressId { get; set; } - - public string? ShoppingCartCustomData { get; set; } - - [Column("ShoppingCartContactID")] - public int? ShoppingCartContactId { get; set; } - - [InverseProperty("ShoppingCart")] - public virtual ICollection ComShoppingCartCouponCodes { get; set; } = new List(); - - [InverseProperty("ShoppingCart")] - public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); - - [ForeignKey("ShoppingCartBillingAddressId")] - [InverseProperty("ComShoppingCartShoppingCartBillingAddresses")] - public virtual ComAddress? ShoppingCartBillingAddress { get; set; } - - [ForeignKey("ShoppingCartCompanyAddressId")] - [InverseProperty("ComShoppingCartShoppingCartCompanyAddresses")] - public virtual ComAddress? ShoppingCartCompanyAddress { get; set; } - - [ForeignKey("ShoppingCartCurrencyId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComCurrency? ShoppingCartCurrency { get; set; } - - [ForeignKey("ShoppingCartCustomerId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComCustomer? ShoppingCartCustomer { get; set; } - - [ForeignKey("ShoppingCartPaymentOptionId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComPaymentOption? ShoppingCartPaymentOption { get; set; } - - [ForeignKey("ShoppingCartShippingAddressId")] - [InverseProperty("ComShoppingCartShoppingCartShippingAddresses")] - public virtual ComAddress? ShoppingCartShippingAddress { get; set; } - - [ForeignKey("ShoppingCartShippingOptionId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComShippingOption? ShoppingCartShippingOption { get; set; } - - [ForeignKey("ShoppingCartSiteId")] - [InverseProperty("ComShoppingCarts")] - public virtual CmsSite ShoppingCartSite { get; set; } = null!; - - [ForeignKey("ShoppingCartUserId")] - [InverseProperty("ComShoppingCarts")] - public virtual CmsUser? ShoppingCartUser { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComShoppingCartCouponCode.cs b/Migration.Toolkit.KX13/Models/ComShoppingCartCouponCode.cs deleted file mode 100644 index d856c7a3..00000000 --- a/Migration.Toolkit.KX13/Models/ComShoppingCartCouponCode.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_ShoppingCartCouponCode")] -[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartCouponCode_ShoppingCartID")] -public class ComShoppingCartCouponCode -{ - [Key] - [Column("ShoppingCartCouponCodeID")] - public int ShoppingCartCouponCodeId { get; set; } - - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [StringLength(200)] - public string CouponCode { get; set; } = null!; - - [ForeignKey("ShoppingCartId")] - [InverseProperty("ComShoppingCartCouponCodes")] - public virtual ComShoppingCart ShoppingCart { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComShoppingCartSku.cs b/Migration.Toolkit.KX13/Models/ComShoppingCartSku.cs deleted file mode 100644 index a97e43b8..00000000 --- a/Migration.Toolkit.KX13/Models/ComShoppingCartSku.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_ShoppingCartSKU")] -[Index("Skuid", Name = "IX_COM_ShoppingCartSKU_SKUID")] -[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartSKU_ShoppingCartID")] -public class ComShoppingCartSku -{ - [Key] - [Column("CartItemID")] - public int CartItemId { get; set; } - - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("SKUUnits")] - public int Skuunits { get; set; } - - public string? CartItemCustomData { get; set; } - - public Guid? CartItemGuid { get; set; } - - public Guid? CartItemParentGuid { get; set; } - - public DateTime? CartItemValidTo { get; set; } - - [Column("CartItemBundleGUID")] - public Guid? CartItemBundleGuid { get; set; } - - public string? CartItemText { get; set; } - - public int? CartItemAutoAddedUnits { get; set; } - - [ForeignKey("ShoppingCartId")] - [InverseProperty("ComShoppingCartSkus")] - public virtual ComShoppingCart ShoppingCart { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComShoppingCartSkus")] - public virtual ComSku Sku { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComSku.cs b/Migration.Toolkit.KX13/Models/ComSku.cs deleted file mode 100644 index b573e5c9..00000000 --- a/Migration.Toolkit.KX13/Models/ComSku.cs +++ /dev/null @@ -1,269 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_SKU")] -[Index("SkubrandId", Name = "IX_COM_SKU_SKUBrandID")] -[Index("SkucollectionId", Name = "IX_COM_SKU_SKUCollectionID")] -[Index("SkudepartmentId", Name = "IX_COM_SKU_SKUDepartmentID")] -[Index("SkuinternalStatusId", Name = "IX_COM_SKU_SKUInternalStatusID")] -[Index("SkumanufacturerId", Name = "IX_COM_SKU_SKUManufacturerID")] -[Index("Skuname", Name = "IX_COM_SKU_SKUName")] -[Index("SkuoptionCategoryId", Name = "IX_COM_SKU_SKUOptionCategoryID")] -[Index("SkuparentSkuid", Name = "IX_COM_SKU_SKUParentSKUID")] -[Index("Skuprice", Name = "IX_COM_SKU_SKUPrice")] -[Index("SkupublicStatusId", Name = "IX_COM_SKU_SKUPublicStatusID")] -[Index("SkusiteId", Name = "IX_COM_SKU_SKUSiteID")] -[Index("SkusupplierId", Name = "IX_COM_SKU_SKUSupplierID")] -[Index("SkutaxClassId", Name = "IX_COM_SKU_SKUTaxClassID")] -public class ComSku -{ - [Key] - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("SKUNumber")] - [StringLength(200)] - public string? Skunumber { get; set; } - - [Column("SKUName")] - [StringLength(440)] - public string Skuname { get; set; } = null!; - - [Column("SKUDescription")] - public string? Skudescription { get; set; } - - [Column("SKUPrice", TypeName = "decimal(18, 9)")] - public decimal Skuprice { get; set; } - - [Required] - [Column("SKUEnabled")] - public bool? Skuenabled { get; set; } - - [Column("SKUDepartmentID")] - public int? SkudepartmentId { get; set; } - - [Column("SKUManufacturerID")] - public int? SkumanufacturerId { get; set; } - - [Column("SKUInternalStatusID")] - public int? SkuinternalStatusId { get; set; } - - [Column("SKUPublicStatusID")] - public int? SkupublicStatusId { get; set; } - - [Column("SKUSupplierID")] - public int? SkusupplierId { get; set; } - - [Column("SKUAvailableInDays")] - public int? SkuavailableInDays { get; set; } - - [Column("SKUGUID")] - public Guid Skuguid { get; set; } - - [Column("SKUImagePath")] - [StringLength(450)] - public string? SkuimagePath { get; set; } - - [Column("SKUWeight")] - public double? Skuweight { get; set; } - - [Column("SKUWidth")] - public double? Skuwidth { get; set; } - - [Column("SKUDepth")] - public double? Skudepth { get; set; } - - [Column("SKUHeight")] - public double? Skuheight { get; set; } - - [Column("SKUAvailableItems")] - public int? SkuavailableItems { get; set; } - - [Column("SKUSellOnlyAvailable")] - public bool? SkusellOnlyAvailable { get; set; } - - [Column("SKUCustomData")] - public string? SkucustomData { get; set; } - - [Column("SKUOptionCategoryID")] - public int? SkuoptionCategoryId { get; set; } - - [Column("SKUOrder")] - public int? Skuorder { get; set; } - - [Column("SKULastModified")] - public DateTime SkulastModified { get; set; } - - [Column("SKUCreated")] - public DateTime? Skucreated { get; set; } - - [Column("SKUSiteID")] - public int? SkusiteId { get; set; } - - [Column("SKUNeedsShipping")] - public bool? SkuneedsShipping { get; set; } - - [Column("SKUValidUntil")] - public DateTime? SkuvalidUntil { get; set; } - - [Column("SKUProductType")] - [StringLength(50)] - public string? SkuproductType { get; set; } - - [Column("SKUMaxItemsInOrder")] - public int? SkumaxItemsInOrder { get; set; } - - [Column("SKUValidity")] - [StringLength(50)] - public string? Skuvalidity { get; set; } - - [Column("SKUValidFor")] - public int? SkuvalidFor { get; set; } - - [Column("SKUMembershipGUID")] - public Guid? SkumembershipGuid { get; set; } - - [Column("SKUBundleInventoryType")] - [StringLength(50)] - public string? SkubundleInventoryType { get; set; } - - [Column("SKUMinItemsInOrder")] - public int? SkuminItemsInOrder { get; set; } - - [Column("SKURetailPrice", TypeName = "decimal(18, 9)")] - public decimal? SkuretailPrice { get; set; } - - [Column("SKUParentSKUID")] - public int? SkuparentSkuid { get; set; } - - [Column("SKUShortDescription")] - public string? SkushortDescription { get; set; } - - [Column("SKUEproductFilesCount")] - public int? SkueproductFilesCount { get; set; } - - [Column("SKUBundleItemsCount")] - public int? SkubundleItemsCount { get; set; } - - [Column("SKUInStoreFrom")] - public DateTime? SkuinStoreFrom { get; set; } - - [Column("SKUReorderAt")] - public int? SkureorderAt { get; set; } - - [Column("SKUTrackInventory")] - [StringLength(50)] - public string? SkutrackInventory { get; set; } - - [Column("SKUTaxClassID")] - public int? SkutaxClassId { get; set; } - - [Column("SKUBrandID")] - public int? SkubrandId { get; set; } - - [Column("SKUCollectionID")] - public int? SkucollectionId { get; set; } - - [InverseProperty("NodeSku")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscountApplyToSku")] - public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); - - [InverseProperty("OrderItemSku")] - public virtual ICollection ComOrderItems { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); - - [InverseProperty("FileSku")] - public virtual ICollection ComSkufiles { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); - - [InverseProperty("VolumeDiscountSku")] - public virtual ICollection ComVolumeDiscounts { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("SkuparentSku")] - public virtual ICollection InverseSkuparentSku { get; set; } = new List(); - - [ForeignKey("SkubrandId")] - [InverseProperty("ComSkus")] - public virtual ComBrand? Skubrand { get; set; } - - [ForeignKey("SkucollectionId")] - [InverseProperty("ComSkus")] - public virtual ComCollection? Skucollection { get; set; } - - [ForeignKey("SkudepartmentId")] - [InverseProperty("ComSkus")] - public virtual ComDepartment? Skudepartment { get; set; } - - [ForeignKey("SkuinternalStatusId")] - [InverseProperty("ComSkus")] - public virtual ComInternalStatus? SkuinternalStatus { get; set; } - - [ForeignKey("SkumanufacturerId")] - [InverseProperty("ComSkus")] - public virtual ComManufacturer? Skumanufacturer { get; set; } - - [ForeignKey("SkuoptionCategoryId")] - [InverseProperty("ComSkus")] - public virtual ComOptionCategory? SkuoptionCategory { get; set; } - - [ForeignKey("SkuparentSkuid")] - [InverseProperty("InverseSkuparentSku")] - public virtual ComSku? SkuparentSku { get; set; } - - [ForeignKey("SkupublicStatusId")] - [InverseProperty("ComSkus")] - public virtual ComPublicStatus? SkupublicStatus { get; set; } - - [ForeignKey("SkusiteId")] - [InverseProperty("ComSkus")] - public virtual CmsSite? Skusite { get; set; } - - [ForeignKey("SkusupplierId")] - [InverseProperty("ComSkus")] - public virtual ComSupplier? Skusupplier { get; set; } - - [ForeignKey("SkutaxClassId")] - [InverseProperty("ComSkus")] - public virtual ComTaxClass? SkutaxClass { get; set; } - - [ForeignKey("Skuid")] - [InverseProperty("Skus")] - public virtual ICollection Bundles { get; set; } = new List(); - - [ForeignKey("Skuid")] - [InverseProperty("Skus")] - public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); - - [ForeignKey("Skuid")] - [InverseProperty("SkusNavigation")] - public virtual ICollection OptionSkus { get; set; } = new List(); - - [ForeignKey("VariantSkuid")] - [InverseProperty("VariantSkus")] - public virtual ICollection OptionSkusNavigation { get; set; } = new List(); - - [ForeignKey("BundleId")] - [InverseProperty("Bundles")] - public virtual ICollection Skus { get; set; } = new List(); - - [ForeignKey("OptionSkuid")] - [InverseProperty("OptionSkus")] - public virtual ICollection SkusNavigation { get; set; } = new List(); - - [ForeignKey("OptionSkuid")] - [InverseProperty("OptionSkusNavigation")] - public virtual ICollection VariantSkus { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/ComSkufile.cs b/Migration.Toolkit.KX13/Models/ComSkufile.cs deleted file mode 100644 index 21e2e885..00000000 --- a/Migration.Toolkit.KX13/Models/ComSkufile.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_SKUFile")] -[Index("FileSkuid", Name = "IX_COM_SKUFile_FileSKUID")] -public class ComSkufile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileSKUID")] - public int FileSkuid { get; set; } - - [StringLength(450)] - public string FilePath { get; set; } = null!; - - [StringLength(50)] - public string FileType { get; set; } = null!; - - public DateTime FileLastModified { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [Column("FileMetaFileGUID")] - public Guid? FileMetaFileGuid { get; set; } - - [InverseProperty("File")] - public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); - - [ForeignKey("FileSkuid")] - [InverseProperty("ComSkufiles")] - public virtual ComSku FileSku { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComSkuoptionCategory.cs b/Migration.Toolkit.KX13/Models/ComSkuoptionCategory.cs deleted file mode 100644 index 4f7b56dc..00000000 --- a/Migration.Toolkit.KX13/Models/ComSkuoptionCategory.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_SKUOptionCategory")] -[Index("CategoryId", Name = "IX_COM_SKUOptionCategory_CategoryID")] -[Index("Skuid", Name = "IX_COM_SKUOptionCategory_SKUID")] -public class ComSkuoptionCategory -{ - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("CategoryID")] - public int CategoryId { get; set; } - - public bool? AllowAllOptions { get; set; } - - [Key] - [Column("SKUCategoryID")] - public int SkucategoryId { get; set; } - - [Column("SKUCategoryOrder")] - public int? SkucategoryOrder { get; set; } - - [ForeignKey("CategoryId")] - [InverseProperty("ComSkuoptionCategories")] - public virtual ComOptionCategory Category { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComSkuoptionCategories")] - public virtual ComSku Sku { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComSupplier.cs b/Migration.Toolkit.KX13/Models/ComSupplier.cs deleted file mode 100644 index 474c27eb..00000000 --- a/Migration.Toolkit.KX13/Models/ComSupplier.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Supplier")] -[Index("SupplierSiteId", Name = "IX_COM_Supplier_SupplierSiteID")] -public class ComSupplier -{ - [Key] - [Column("SupplierID")] - public int SupplierId { get; set; } - - [StringLength(200)] - public string SupplierDisplayName { get; set; } = null!; - - [StringLength(50)] - public string? SupplierPhone { get; set; } - - [StringLength(254)] - public string? SupplierEmail { get; set; } - - [StringLength(50)] - public string? SupplierFax { get; set; } - - [Required] - public bool? SupplierEnabled { get; set; } - - [Column("SupplierGUID")] - public Guid SupplierGuid { get; set; } - - public DateTime SupplierLastModified { get; set; } - - [Column("SupplierSiteID")] - public int? SupplierSiteId { get; set; } - - [StringLength(200)] - public string? SupplierName { get; set; } - - [InverseProperty("Skusupplier")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("SupplierSiteId")] - [InverseProperty("ComSuppliers")] - public virtual CmsSite? SupplierSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComTaxClass.cs b/Migration.Toolkit.KX13/Models/ComTaxClass.cs deleted file mode 100644 index bec4989c..00000000 --- a/Migration.Toolkit.KX13/Models/ComTaxClass.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_TaxClass")] -[Index("TaxClassSiteId", Name = "IX_COM_TaxClass_TaxClassSiteID")] -public class ComTaxClass -{ - [Key] - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [StringLength(200)] - public string TaxClassName { get; set; } = null!; - - [StringLength(200)] - public string TaxClassDisplayName { get; set; } = null!; - - [Column("TaxClassZeroIfIDSupplied")] - public bool? TaxClassZeroIfIdsupplied { get; set; } - - [Column("TaxClassGUID")] - public Guid TaxClassGuid { get; set; } - - public DateTime TaxClassLastModified { get; set; } - - [Column("TaxClassSiteID")] - public int? TaxClassSiteId { get; set; } - - [InverseProperty("DepartmentDefaultTaxClass")] - public virtual ICollection ComDepartments { get; set; } = new List(); - - [InverseProperty("ShippingOptionTaxClass")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); - - [InverseProperty("SkutaxClass")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [InverseProperty("TaxClass")] - public virtual ICollection ComTaxClassCountries { get; set; } = new List(); - - [InverseProperty("TaxClass")] - public virtual ICollection ComTaxClassStates { get; set; } = new List(); - - [ForeignKey("TaxClassSiteId")] - [InverseProperty("ComTaxClasses")] - public virtual CmsSite? TaxClassSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ComTaxClassCountry.cs b/Migration.Toolkit.KX13/Models/ComTaxClassCountry.cs deleted file mode 100644 index f73bf6af..00000000 --- a/Migration.Toolkit.KX13/Models/ComTaxClassCountry.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_TaxClassCountry")] -[Index("CountryId", Name = "IX_COM_TaxClassCountry_CountryID")] -[Index("TaxClassId", "CountryId", Name = "IX_COM_TaxClassCountry_TaxClassID_CountryID", IsUnique = true)] -public class ComTaxClassCountry -{ - [Key] - [Column("TaxClassCountryID")] - public int TaxClassCountryId { get; set; } - - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal TaxValue { get; set; } - - [ForeignKey("CountryId")] - [InverseProperty("ComTaxClassCountries")] - public virtual CmsCountry Country { get; set; } = null!; - - [ForeignKey("TaxClassId")] - [InverseProperty("ComTaxClassCountries")] - public virtual ComTaxClass TaxClass { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComTaxClassState.cs b/Migration.Toolkit.KX13/Models/ComTaxClassState.cs deleted file mode 100644 index 3d442359..00000000 --- a/Migration.Toolkit.KX13/Models/ComTaxClassState.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_TaxClassState")] -[Index("StateId", Name = "IX_COM_TaxClassState_StateID")] -[Index("TaxClassId", "StateId", Name = "IX_COM_TaxClassState_TaxClassID_StateID", IsUnique = true)] -public class ComTaxClassState -{ - [Key] - [Column("TaxClassStateID")] - public int TaxClassStateId { get; set; } - - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [Column("StateID")] - public int StateId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal TaxValue { get; set; } - - [ForeignKey("StateId")] - [InverseProperty("ComTaxClassStates")] - public virtual CmsState State { get; set; } = null!; - - [ForeignKey("TaxClassId")] - [InverseProperty("ComTaxClassStates")] - public virtual ComTaxClass TaxClass { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComVolumeDiscount.cs b/Migration.Toolkit.KX13/Models/ComVolumeDiscount.cs deleted file mode 100644 index e4146abd..00000000 --- a/Migration.Toolkit.KX13/Models/ComVolumeDiscount.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_VolumeDiscount")] -[Index("VolumeDiscountSkuid", Name = "IX_COM_VolumeDiscount_VolumeDiscountSKUID")] -public class ComVolumeDiscount -{ - [Key] - [Column("VolumeDiscountID")] - public int VolumeDiscountId { get; set; } - - [Column("VolumeDiscountSKUID")] - public int VolumeDiscountSkuid { get; set; } - - public int VolumeDiscountMinCount { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal VolumeDiscountValue { get; set; } - - public bool VolumeDiscountIsFlatValue { get; set; } - - [Column("VolumeDiscountGUID")] - public Guid VolumeDiscountGuid { get; set; } - - public DateTime VolumeDiscountLastModified { get; set; } - - [ForeignKey("VolumeDiscountSkuid")] - [InverseProperty("ComVolumeDiscounts")] - public virtual ComSku VolumeDiscountSku { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ComWishlist.cs b/Migration.Toolkit.KX13/Models/ComWishlist.cs deleted file mode 100644 index 5b0f92d2..00000000 --- a/Migration.Toolkit.KX13/Models/ComWishlist.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("UserId", "Skuid", "SiteId")] -[Table("COM_Wishlist")] -[Index("Skuid", Name = "IX_COM_Wishlist_SKUID")] -[Index("SiteId", "UserId", Name = "IX_COM_Wishlist_SiteID_UserID")] -public class ComWishlist -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [Key] - [Column("SKUID")] - public int Skuid { get; set; } - - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("ComWishlists")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComWishlists")] - public virtual ComSku Sku { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("ComWishlists")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ExportHistory.cs b/Migration.Toolkit.KX13/Models/ExportHistory.cs deleted file mode 100644 index 00dac957..00000000 --- a/Migration.Toolkit.KX13/Models/ExportHistory.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Export_History")] -[Index("ExportSiteId", Name = "IX_Export_History_ExportSiteID")] -[Index("ExportUserId", Name = "IX_Export_History_ExportUserID")] -public class ExportHistory -{ - [Key] - [Column("ExportID")] - public int ExportId { get; set; } - - public DateTime ExportDateTime { get; set; } - - [StringLength(450)] - public string ExportFileName { get; set; } = null!; - - [Column("ExportSiteID")] - public int? ExportSiteId { get; set; } - - [Column("ExportUserID")] - public int? ExportUserId { get; set; } - - public string? ExportSettings { get; set; } - - [ForeignKey("ExportSiteId")] - [InverseProperty("ExportHistories")] - public virtual CmsSite? ExportSite { get; set; } - - [ForeignKey("ExportUserId")] - [InverseProperty("ExportHistories")] - public virtual CmsUser? ExportUser { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ExportTask.cs b/Migration.Toolkit.KX13/Models/ExportTask.cs deleted file mode 100644 index 85cf0580..00000000 --- a/Migration.Toolkit.KX13/Models/ExportTask.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Export_Task")] -[Index("TaskSiteId", "TaskObjectType", Name = "IX_Export_Task_TaskSiteID_TaskObjectType")] -public class ExportTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [ForeignKey("TaskSiteId")] - [InverseProperty("ExportTasks")] - public virtual CmsSite? TaskSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/IntegrationConnector.cs b/Migration.Toolkit.KX13/Models/IntegrationConnector.cs deleted file mode 100644 index f11e3ee5..00000000 --- a/Migration.Toolkit.KX13/Models/IntegrationConnector.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Integration_Connector")] -[Index("ConnectorEnabled", Name = "IX_Integration_Connector_ConnectorEnabled")] -public class IntegrationConnector -{ - [Key] - [Column("ConnectorID")] - public int ConnectorId { get; set; } - - [StringLength(100)] - public string ConnectorName { get; set; } = null!; - - [StringLength(440)] - public string ConnectorDisplayName { get; set; } = null!; - - [StringLength(400)] - public string ConnectorAssemblyName { get; set; } = null!; - - [StringLength(400)] - public string ConnectorClassName { get; set; } = null!; - - [Required] - public bool? ConnectorEnabled { get; set; } - - public DateTime ConnectorLastModified { get; set; } - - [InverseProperty("SynchronizationConnector")] - public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/IntegrationSyncLog.cs b/Migration.Toolkit.KX13/Models/IntegrationSyncLog.cs deleted file mode 100644 index ccbd0df8..00000000 --- a/Migration.Toolkit.KX13/Models/IntegrationSyncLog.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Integration_SyncLog")] -[Index("SyncLogSynchronizationId", Name = "IX_Integration_SyncLog_SyncLogTaskID")] -public class IntegrationSyncLog -{ - [Key] - [Column("SyncLogID")] - public int SyncLogId { get; set; } - - [Column("SyncLogSynchronizationID")] - public int SyncLogSynchronizationId { get; set; } - - public DateTime SyncLogTime { get; set; } - - public string? SyncLogErrorMessage { get; set; } - - [ForeignKey("SyncLogSynchronizationId")] - [InverseProperty("IntegrationSyncLogs")] - public virtual IntegrationSynchronization SyncLogSynchronization { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/IntegrationSynchronization.cs b/Migration.Toolkit.KX13/Models/IntegrationSynchronization.cs deleted file mode 100644 index 88251326..00000000 --- a/Migration.Toolkit.KX13/Models/IntegrationSynchronization.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Integration_Synchronization")] -[Index("SynchronizationConnectorId", Name = "IX_Integration_Synchronization_SynchronizationConnectorID")] -[Index("SynchronizationTaskId", Name = "IX_Integration_Synchronization_SynchronizationTaskID")] -public class IntegrationSynchronization -{ - [Key] - [Column("SynchronizationID")] - public int SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int SynchronizationTaskId { get; set; } - - [Column("SynchronizationConnectorID")] - public int SynchronizationConnectorId { get; set; } - - public DateTime SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - public bool? SynchronizationIsRunning { get; set; } - - [InverseProperty("SyncLogSynchronization")] - public virtual ICollection IntegrationSyncLogs { get; set; } = new List(); - - [ForeignKey("SynchronizationConnectorId")] - [InverseProperty("IntegrationSynchronizations")] - public virtual IntegrationConnector SynchronizationConnector { get; set; } = null!; - - [ForeignKey("SynchronizationTaskId")] - [InverseProperty("IntegrationSynchronizations")] - public virtual IntegrationTask SynchronizationTask { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/IntegrationTask.cs b/Migration.Toolkit.KX13/Models/IntegrationTask.cs deleted file mode 100644 index e84853ec..00000000 --- a/Migration.Toolkit.KX13/Models/IntegrationTask.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Integration_Task")] -[Index("TaskIsInbound", Name = "IX_Integration_Task_TaskIsInbound")] -[Index("TaskSiteId", Name = "IX_Integration_Task_TaskSiteID")] -[Index("TaskType", Name = "IX_Integration_Task_TaskType")] -public class IntegrationTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool TaskIsInbound { get; set; } - - [StringLength(50)] - public string? TaskProcessType { get; set; } - - public string TaskData { get; set; } = null!; - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(50)] - public string? TaskDataType { get; set; } - - [InverseProperty("SynchronizationTask")] - public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); - - [ForeignKey("TaskSiteId")] - [InverseProperty("IntegrationTasks")] - public virtual CmsSite? TaskSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/MediaFile.cs b/Migration.Toolkit.KX13/Models/MediaFile.cs deleted file mode 100644 index fc931df3..00000000 --- a/Migration.Toolkit.KX13/Models/MediaFile.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Media_File")] -[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] -[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] -[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] -[Index("FileSiteId", "FileGuid", Name = "IX_Media_File_FileSiteID_FileGUID")] -public class MediaFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string FileTitle { get; set; } = null!; - - public string FileDescription { get; set; } = null!; - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public string FilePath { get; set; } = null!; - - public long FileSize { get; set; } - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileLibraryID")] - public int FileLibraryId { get; set; } - - [Column("FileSiteID")] - public int FileSiteId { get; set; } - - [Column("FileCreatedByUserID")] - public int? FileCreatedByUserId { get; set; } - - public DateTime FileCreatedWhen { get; set; } - - [Column("FileModifiedByUserID")] - public int? FileModifiedByUserId { get; set; } - - public DateTime FileModifiedWhen { get; set; } - - public string? FileCustomData { get; set; } - - [ForeignKey("FileCreatedByUserId")] - [InverseProperty("MediaFileFileCreatedByUsers")] - public virtual CmsUser? FileCreatedByUser { get; set; } - - [ForeignKey("FileLibraryId")] - [InverseProperty("MediaFiles")] - public virtual MediaLibrary FileLibrary { get; set; } = null!; - - [ForeignKey("FileModifiedByUserId")] - [InverseProperty("MediaFileFileModifiedByUsers")] - public virtual CmsUser? FileModifiedByUser { get; set; } - - [ForeignKey("FileSiteId")] - [InverseProperty("MediaFiles")] - public virtual CmsSite FileSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/MediaLibrary.cs b/Migration.Toolkit.KX13/Models/MediaLibrary.cs deleted file mode 100644 index dccb5df1..00000000 --- a/Migration.Toolkit.KX13/Models/MediaLibrary.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Media_Library")] -[Index("LibrarySiteId", "LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] -public class MediaLibrary -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [StringLength(250)] - public string LibraryName { get; set; } = null!; - - [StringLength(250)] - public string LibraryDisplayName { get; set; } = null!; - - public string? LibraryDescription { get; set; } - - [StringLength(250)] - public string LibraryFolder { get; set; } = null!; - - public int? LibraryAccess { get; set; } - - [Column("LibrarySiteID")] - public int LibrarySiteId { get; set; } - - [Column("LibraryGUID")] - public Guid? LibraryGuid { get; set; } - - public DateTime? LibraryLastModified { get; set; } - - [StringLength(450)] - public string? LibraryTeaserPath { get; set; } - - [Column("LibraryTeaserGUID")] - public Guid? LibraryTeaserGuid { get; set; } - - public bool? LibraryUseDirectPathForContent { get; set; } - - [ForeignKey("LibrarySiteId")] - [InverseProperty("MediaLibraries")] - public virtual CmsSite LibrarySite { get; set; } = null!; - - [InverseProperty("FileLibrary")] - public virtual ICollection MediaFiles { get; set; } = new List(); - - [InverseProperty("Library")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/MediaLibraryRolePermission.cs b/Migration.Toolkit.KX13/Models/MediaLibraryRolePermission.cs deleted file mode 100644 index 3c0b3408..00000000 --- a/Migration.Toolkit.KX13/Models/MediaLibraryRolePermission.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("LibraryId", "RoleId", "PermissionId")] -[Table("Media_LibraryRolePermission")] -[Index("PermissionId", Name = "IX_Media_LibraryRolePermission_PermissionID")] -[Index("RoleId", Name = "IX_Media_LibraryRolePermission_RoleID")] -public class MediaLibraryRolePermission -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("LibraryId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual MediaLibrary Library { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual CmsRole Role { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterAbtest.cs b/Migration.Toolkit.KX13/Models/NewsletterAbtest.cs deleted file mode 100644 index 320d1644..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterAbtest.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_ABTest")] -[Index("TestIssueId", Name = "IX_Newsletter_ABTest_TestIssueID", IsUnique = true)] -[Index("TestWinnerIssueId", Name = "IX_Newsletter_ABTest_TestWinnerIssueID")] -[Index("TestWinnerScheduledTaskId", Name = "IX_Newsletter_ABTest_TestWinnerScheduledTaskID")] -public class NewsletterAbtest -{ - [Key] - [Column("TestID")] - public int TestId { get; set; } - - [Column("TestIssueID")] - public int TestIssueId { get; set; } - - public int TestWinnerOption { get; set; } - - public int? TestSelectWinnerAfter { get; set; } - - [Column("TestWinnerIssueID")] - public int? TestWinnerIssueId { get; set; } - - public DateTime? TestWinnerSelected { get; set; } - - public DateTime TestLastModified { get; set; } - - [Column("TestGUID")] - public Guid TestGuid { get; set; } - - [Column("TestWinnerScheduledTaskID")] - public int? TestWinnerScheduledTaskId { get; set; } - - public int TestSizePercentage { get; set; } - - public int? TestNumberPerVariantEmails { get; set; } - - [ForeignKey("TestIssueId")] - [InverseProperty("NewsletterAbtestTestIssue")] - public virtual NewsletterNewsletterIssue TestIssue { get; set; } = null!; - - [ForeignKey("TestWinnerIssueId")] - [InverseProperty("NewsletterAbtestTestWinnerIssues")] - public virtual NewsletterNewsletterIssue? TestWinnerIssue { get; set; } - - [ForeignKey("TestWinnerScheduledTaskId")] - [InverseProperty("NewsletterAbtests")] - public virtual CmsScheduledTask? TestWinnerScheduledTask { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterClickedLink.cs b/Migration.Toolkit.KX13/Models/NewsletterClickedLink.cs deleted file mode 100644 index 638cc13f..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterClickedLink.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_ClickedLink")] -[Index("ClickedLinkNewsletterLinkId", Name = "IX_Newsletter_ClickedLink_ClickedLinkNewsletterLinkID")] -public class NewsletterClickedLink -{ - [Key] - [Column("ClickedLinkID")] - public int ClickedLinkId { get; set; } - - public Guid ClickedLinkGuid { get; set; } - - [StringLength(254)] - public string ClickedLinkEmail { get; set; } = null!; - - [Column("ClickedLinkNewsletterLinkID")] - public int ClickedLinkNewsletterLinkId { get; set; } - - public DateTime? ClickedLinkTime { get; set; } - - [ForeignKey("ClickedLinkNewsletterLinkId")] - [InverseProperty("NewsletterClickedLinks")] - public virtual NewsletterLink ClickedLinkNewsletterLink { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterEmail.cs b/Migration.Toolkit.KX13/Models/NewsletterEmail.cs deleted file mode 100644 index 4dbc1100..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterEmail.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_Emails")] -[Index("EmailGuid", Name = "IX_Newsletter_Emails_EmailGUID", IsUnique = true)] -[Index("EmailNewsletterIssueId", Name = "IX_Newsletter_Emails_EmailNewsletterIssueID")] -[Index("EmailSending", Name = "IX_Newsletter_Emails_EmailSending")] -[Index("EmailSiteId", Name = "IX_Newsletter_Emails_EmailSiteID")] -[Index("EmailSubscriberId", Name = "IX_Newsletter_Emails_EmailSubscriberID")] -public class NewsletterEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [Column("EmailNewsletterIssueID")] - public int EmailNewsletterIssueId { get; set; } - - [Column("EmailSubscriberID")] - public int? EmailSubscriberId { get; set; } - - [Column("EmailSiteID")] - public int EmailSiteId { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - public bool? EmailSending { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - [Column("EmailContactID")] - public int? EmailContactId { get; set; } - - [StringLength(254)] - public string? EmailAddress { get; set; } - - [ForeignKey("EmailNewsletterIssueId")] - [InverseProperty("NewsletterEmails")] - public virtual NewsletterNewsletterIssue EmailNewsletterIssue { get; set; } = null!; - - [ForeignKey("EmailSiteId")] - [InverseProperty("NewsletterEmails")] - public virtual CmsSite EmailSite { get; set; } = null!; - - [ForeignKey("EmailSubscriberId")] - [InverseProperty("NewsletterEmails")] - public virtual NewsletterSubscriber? EmailSubscriber { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterEmailTemplate.cs b/Migration.Toolkit.KX13/Models/NewsletterEmailTemplate.cs deleted file mode 100644 index 221ccc0c..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterEmailTemplate.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_EmailTemplate")] -[Index("TemplateSiteId", "TemplateName", Name = "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateName", IsUnique = true)] -public class NewsletterEmailTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(250)] - public string TemplateDisplayName { get; set; } = null!; - - [StringLength(250)] - public string TemplateName { get; set; } = null!; - - [Column("TemplateSiteID")] - public int TemplateSiteId { get; set; } - - [StringLength(50)] - public string TemplateType { get; set; } = null!; - - [Column("TemplateGUID")] - public Guid TemplateGuid { get; set; } - - public DateTime TemplateLastModified { get; set; } - - [StringLength(450)] - public string? TemplateSubject { get; set; } - - [Column("TemplateThumbnailGUID")] - public Guid? TemplateThumbnailGuid { get; set; } - - public string? TemplateDescription { get; set; } - - [StringLength(200)] - public string? TemplateIconClass { get; set; } - - public string? TemplateCode { get; set; } - - [Column("TemplateInlineCSS")] - public bool TemplateInlineCss { get; set; } - - [InverseProperty("Template")] - public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); - - [InverseProperty("IssueTemplate")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [InverseProperty("NewsletterOptInTemplate")] - public virtual ICollection NewsletterNewsletterNewsletterOptInTemplates { get; set; } = new List(); - - [InverseProperty("NewsletterUnsubscriptionTemplate")] - public virtual ICollection NewsletterNewsletterNewsletterUnsubscriptionTemplates { get; set; } = new List(); - - [ForeignKey("TemplateSiteId")] - [InverseProperty("NewsletterEmailTemplates")] - public virtual CmsSite TemplateSite { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("Templates")] - public virtual ICollection Newsletters { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterEmailWidget.cs b/Migration.Toolkit.KX13/Models/NewsletterEmailWidget.cs deleted file mode 100644 index 42213b05..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterEmailWidget.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_EmailWidget")] -[Index("EmailWidgetSiteId", Name = "IX_Newsletter_EmailWidget_EmailWidgetSiteID")] -public class NewsletterEmailWidget -{ - [Key] - [Column("EmailWidgetID")] - public int EmailWidgetId { get; set; } - - public Guid EmailWidgetGuid { get; set; } - - public DateTime EmailWidgetLastModified { get; set; } - - [StringLength(250)] - public string EmailWidgetDisplayName { get; set; } = null!; - - [StringLength(250)] - public string EmailWidgetName { get; set; } = null!; - - public string? EmailWidgetDescription { get; set; } - - public string? EmailWidgetCode { get; set; } - - [Column("EmailWidgetSiteID")] - public int EmailWidgetSiteId { get; set; } - - [Column("EmailWidgetThumbnailGUID")] - public Guid? EmailWidgetThumbnailGuid { get; set; } - - [StringLength(200)] - public string? EmailWidgetIconCssClass { get; set; } - - public string? EmailWidgetProperties { get; set; } - - [ForeignKey("EmailWidgetSiteId")] - [InverseProperty("NewsletterEmailWidgets")] - public virtual CmsSite EmailWidgetSite { get; set; } = null!; - - [InverseProperty("EmailWidget")] - public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterEmailWidgetTemplate.cs b/Migration.Toolkit.KX13/Models/NewsletterEmailWidgetTemplate.cs deleted file mode 100644 index 05f97bd6..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterEmailWidgetTemplate.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_EmailWidgetTemplate")] -[Index("EmailWidgetId", Name = "IX_Newsletter_EmailWidgetTemplate_EmailWidgetID")] -[Index("TemplateId", Name = "IX_Newsletter_EmailWidgetTemplate_TemplateID")] -public class NewsletterEmailWidgetTemplate -{ - [Key] - [Column("EmailWidgetTemplateID")] - public int EmailWidgetTemplateId { get; set; } - - [Column("EmailWidgetID")] - public int EmailWidgetId { get; set; } - - [Column("TemplateID")] - public int TemplateId { get; set; } - - [ForeignKey("EmailWidgetId")] - [InverseProperty("NewsletterEmailWidgetTemplates")] - public virtual NewsletterEmailWidget EmailWidget { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("NewsletterEmailWidgetTemplates")] - public virtual NewsletterEmailTemplate Template { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterIssueContactGroup.cs b/Migration.Toolkit.KX13/Models/NewsletterIssueContactGroup.cs deleted file mode 100644 index 4c9fe19b..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterIssueContactGroup.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_IssueContactGroup")] -[Index("ContactGroupId", Name = "IX_Newsletter_IssueContactGroup_ContactGroupID")] -public class NewsletterIssueContactGroup -{ - [Key] - [Column("IssueContactGroupID")] - public int IssueContactGroupId { get; set; } - - [Column("IssueID")] - public int IssueId { get; set; } - - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [ForeignKey("ContactGroupId")] - [InverseProperty("NewsletterIssueContactGroups")] - public virtual OmContactGroup ContactGroup { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterLink.cs b/Migration.Toolkit.KX13/Models/NewsletterLink.cs deleted file mode 100644 index f70d9e39..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterLink.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_Link")] -[Index("LinkIssueId", Name = "IX_Newsletter_Link_LinkIssueID")] -public class NewsletterLink -{ - [Key] - [Column("LinkID")] - public int LinkId { get; set; } - - [Column("LinkIssueID")] - public int LinkIssueId { get; set; } - - public string LinkTarget { get; set; } = null!; - - [StringLength(450)] - public string LinkDescription { get; set; } = null!; - - [Column("LinkGUID")] - public Guid LinkGuid { get; set; } - - [ForeignKey("LinkIssueId")] - [InverseProperty("NewsletterLinks")] - public virtual NewsletterNewsletterIssue LinkIssue { get; set; } = null!; - - [InverseProperty("ClickedLinkNewsletterLink")] - public virtual ICollection NewsletterClickedLinks { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterNewsletter.cs b/Migration.Toolkit.KX13/Models/NewsletterNewsletter.cs deleted file mode 100644 index a341d59a..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterNewsletter.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_Newsletter")] -[Index("NewsletterDynamicScheduledTaskId", Name = "IX_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID")] -[Index("NewsletterOptInTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterOptInTemplateID")] -[Index("NewsletterSiteId", "NewsletterName", Name = "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterName", IsUnique = true)] -[Index("NewsletterSubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterSubscriptionTemplateID")] -[Index("NewsletterUnsubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID")] -public class NewsletterNewsletter -{ - [Key] - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - [StringLength(250)] - public string NewsletterDisplayName { get; set; } = null!; - - [StringLength(250)] - public string NewsletterName { get; set; } = null!; - - [Column("NewsletterSubscriptionTemplateID")] - public int? NewsletterSubscriptionTemplateId { get; set; } - - [Column("NewsletterUnsubscriptionTemplateID")] - public int NewsletterUnsubscriptionTemplateId { get; set; } - - [StringLength(200)] - public string NewsletterSenderName { get; set; } = null!; - - [StringLength(254)] - public string NewsletterSenderEmail { get; set; } = null!; - - [StringLength(100)] - public string? NewsletterDynamicSubject { get; set; } - - [Column("NewsletterDynamicURL")] - [StringLength(500)] - public string? NewsletterDynamicUrl { get; set; } - - [Column("NewsletterDynamicScheduledTaskID")] - public int? NewsletterDynamicScheduledTaskId { get; set; } - - [Column("NewsletterSiteID")] - public int NewsletterSiteId { get; set; } - - [Column("NewsletterGUID")] - public Guid NewsletterGuid { get; set; } - - [StringLength(1000)] - public string? NewsletterUnsubscribeUrl { get; set; } - - [StringLength(500)] - public string? NewsletterBaseUrl { get; set; } - - public DateTime NewsletterLastModified { get; set; } - - public bool? NewsletterEnableOptIn { get; set; } - - [Column("NewsletterOptInTemplateID")] - public int? NewsletterOptInTemplateId { get; set; } - - public bool? NewsletterSendOptInConfirmation { get; set; } - - [Column("NewsletterOptInApprovalURL")] - [StringLength(450)] - public string? NewsletterOptInApprovalUrl { get; set; } - - public bool? NewsletterTrackOpenEmails { get; set; } - - public bool? NewsletterTrackClickedLinks { get; set; } - - [StringLength(998)] - public string? NewsletterDraftEmails { get; set; } - - public bool? NewsletterLogActivity { get; set; } - - [StringLength(5)] - public string NewsletterSource { get; set; } = null!; - - public int NewsletterType { get; set; } - - [ForeignKey("NewsletterDynamicScheduledTaskId")] - [InverseProperty("NewsletterNewsletters")] - public virtual CmsScheduledTask? NewsletterDynamicScheduledTask { get; set; } - - [InverseProperty("IssueNewsletter")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [ForeignKey("NewsletterOptInTemplateId")] - [InverseProperty("NewsletterNewsletterNewsletterOptInTemplates")] - public virtual NewsletterEmailTemplate? NewsletterOptInTemplate { get; set; } - - [ForeignKey("NewsletterSiteId")] - [InverseProperty("NewsletterNewsletters")] - public virtual CmsSite NewsletterSite { get; set; } = null!; - - [InverseProperty("Newsletter")] - public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); - - [ForeignKey("NewsletterUnsubscriptionTemplateId")] - [InverseProperty("NewsletterNewsletterNewsletterUnsubscriptionTemplates")] - public virtual NewsletterEmailTemplate NewsletterUnsubscriptionTemplate { get; set; } = null!; - - [InverseProperty("UnsubscriptionNewsletter")] - public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); - - [ForeignKey("NewsletterId")] - [InverseProperty("Newsletters")] - public virtual ICollection Templates { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterNewsletterIssue.cs b/Migration.Toolkit.KX13/Models/NewsletterNewsletterIssue.cs deleted file mode 100644 index 4de3934c..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterNewsletterIssue.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_NewsletterIssue")] -[Index("IssueNewsletterId", Name = "IX_Newsletter_NewsletterIssue_IssueNewsletterID")] -[Index("IssueScheduledTaskId", Name = "IX_Newsletter_NewsletterIssue_IssueScheduledTaskID")] -[Index("IssueSiteId", Name = "IX_Newsletter_NewsletterIssue_IssueSiteID")] -[Index("IssueTemplateId", Name = "IX_Newsletter_NewsletterIssue_IssueTemplateID")] -[Index("IssueVariantOfIssueId", Name = "IX_Newsletter_NewsletterIssue_IssueVariantOfIssueID")] -public class NewsletterNewsletterIssue -{ - [Key] - [Column("IssueID")] - public int IssueId { get; set; } - - [StringLength(450)] - public string IssueSubject { get; set; } = null!; - - public string IssueText { get; set; } = null!; - - public int IssueUnsubscribed { get; set; } - - [Column("IssueNewsletterID")] - public int IssueNewsletterId { get; set; } - - [Column("IssueTemplateID")] - public int? IssueTemplateId { get; set; } - - public int IssueSentEmails { get; set; } - - public DateTime? IssueMailoutTime { get; set; } - - [Column("IssueGUID")] - public Guid IssueGuid { get; set; } - - public DateTime IssueLastModified { get; set; } - - [Column("IssueSiteID")] - public int IssueSiteId { get; set; } - - public int? IssueOpenedEmails { get; set; } - - public int? IssueBounces { get; set; } - - public int? IssueStatus { get; set; } - - [Column("IssueIsABTest")] - public bool? IssueIsAbtest { get; set; } - - [Column("IssueVariantOfIssueID")] - public int? IssueVariantOfIssueId { get; set; } - - [StringLength(200)] - public string? IssueVariantName { get; set; } - - [StringLength(200)] - public string? IssueSenderName { get; set; } - - [StringLength(254)] - public string? IssueSenderEmail { get; set; } - - [Column("IssueScheduledTaskID")] - public int? IssueScheduledTaskId { get; set; } - - [Column("IssueUTMSource")] - [StringLength(200)] - public string? IssueUtmsource { get; set; } - - [Column("IssueUseUTM")] - public bool IssueUseUtm { get; set; } - - [Column("IssueUTMCampaign")] - [StringLength(200)] - public string? IssueUtmcampaign { get; set; } - - [StringLength(200)] - public string IssueDisplayName { get; set; } = null!; - - public string? IssueWidgets { get; set; } - - public string? IssuePreheader { get; set; } - - public string? IssuePlainText { get; set; } - - public bool IssueForAutomation { get; set; } - - [InverseProperty("IssueVariantOfIssue")] - public virtual ICollection InverseIssueVariantOfIssue { get; set; } = new List(); - - [ForeignKey("IssueNewsletterId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual NewsletterNewsletter IssueNewsletter { get; set; } = null!; - - [ForeignKey("IssueSiteId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual CmsSite IssueSite { get; set; } = null!; - - [ForeignKey("IssueTemplateId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual NewsletterEmailTemplate? IssueTemplate { get; set; } - - [ForeignKey("IssueVariantOfIssueId")] - [InverseProperty("InverseIssueVariantOfIssue")] - public virtual NewsletterNewsletterIssue? IssueVariantOfIssue { get; set; } - - [InverseProperty("TestIssue")] - public virtual NewsletterAbtest? NewsletterAbtestTestIssue { get; set; } - - [InverseProperty("TestWinnerIssue")] - public virtual ICollection NewsletterAbtestTestWinnerIssues { get; set; } = new List(); - - [InverseProperty("EmailNewsletterIssue")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("LinkIssue")] - public virtual ICollection NewsletterLinks { get; set; } = new List(); - - [InverseProperty("OpenedEmailIssue")] - public virtual ICollection NewsletterOpenedEmails { get; set; } = new List(); - - [InverseProperty("UnsubscriptionFromIssue")] - public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterOpenedEmail.cs b/Migration.Toolkit.KX13/Models/NewsletterOpenedEmail.cs deleted file mode 100644 index f451d949..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterOpenedEmail.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_OpenedEmail")] -[Index("OpenedEmailIssueId", Name = "IX_Newsletter_OpenedEmail_OpenedEmailIssueID")] -public class NewsletterOpenedEmail -{ - [Key] - [Column("OpenedEmailID")] - public int OpenedEmailId { get; set; } - - [StringLength(254)] - public string OpenedEmailEmail { get; set; } = null!; - - public Guid OpenedEmailGuid { get; set; } - - public DateTime? OpenedEmailTime { get; set; } - - [Column("OpenedEmailIssueID")] - public int OpenedEmailIssueId { get; set; } - - [ForeignKey("OpenedEmailIssueId")] - [InverseProperty("NewsletterOpenedEmails")] - public virtual NewsletterNewsletterIssue OpenedEmailIssue { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterSubscriber.cs b/Migration.Toolkit.KX13/Models/NewsletterSubscriber.cs deleted file mode 100644 index 5084ef2b..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterSubscriber.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_Subscriber")] -[Index("SubscriberEmail", Name = "IX_Newsletter_Subscriber_SubscriberEmail")] -[Index("SubscriberType", "SubscriberRelatedId", Name = "IX_Newsletter_Subscriber_SubscriberType_SubscriberRelatedID")] -public class NewsletterSubscriber -{ - [Key] - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [StringLength(254)] - public string? SubscriberEmail { get; set; } - - [StringLength(200)] - public string? SubscriberFirstName { get; set; } - - [StringLength(200)] - public string? SubscriberLastName { get; set; } - - [Column("SubscriberSiteID")] - public int SubscriberSiteId { get; set; } - - [Column("SubscriberGUID")] - public Guid SubscriberGuid { get; set; } - - public string? SubscriberCustomData { get; set; } - - [StringLength(100)] - public string? SubscriberType { get; set; } - - [Column("SubscriberRelatedID")] - public int SubscriberRelatedId { get; set; } - - public DateTime SubscriberLastModified { get; set; } - - [StringLength(440)] - public string? SubscriberFullName { get; set; } - - public int? SubscriberBounces { get; set; } - - [InverseProperty("EmailSubscriber")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("Subscriber")] - public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); - - [ForeignKey("SubscriberSiteId")] - [InverseProperty("NewsletterSubscribers")] - public virtual CmsSite SubscriberSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterSubscriberNewsletter.cs b/Migration.Toolkit.KX13/Models/NewsletterSubscriberNewsletter.cs deleted file mode 100644 index 7bf93904..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterSubscriberNewsletter.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_SubscriberNewsletter")] -[Index("NewsletterId", "SubscriptionApproved", Name = "IX_Newsletter_SubscriberNewsletter_NewsletterID_SubscriptionApproved")] -[Index("SubscriberId", "NewsletterId", Name = "UQ_Newsletter_SubscriberNewsletter", IsUnique = true)] -public class NewsletterSubscriberNewsletter -{ - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - public DateTime SubscribedWhen { get; set; } - - public bool? SubscriptionApproved { get; set; } - - public DateTime? SubscriptionApprovedWhen { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [Key] - [Column("SubscriberNewsletterID")] - public int SubscriberNewsletterId { get; set; } - - [ForeignKey("NewsletterId")] - [InverseProperty("NewsletterSubscriberNewsletters")] - public virtual NewsletterNewsletter Newsletter { get; set; } = null!; - - [ForeignKey("SubscriberId")] - [InverseProperty("NewsletterSubscriberNewsletters")] - public virtual NewsletterSubscriber Subscriber { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/NewsletterUnsubscription.cs b/Migration.Toolkit.KX13/Models/NewsletterUnsubscription.cs deleted file mode 100644 index 6ae293e0..00000000 --- a/Migration.Toolkit.KX13/Models/NewsletterUnsubscription.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_Unsubscription")] -[Index("UnsubscriptionEmail", "UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_Email_NewsletterID")] -[Index("UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_NewsletterID")] -[Index("UnsubscriptionFromIssueId", Name = "IX_Newsletter_Unsubscription_UnsubscriptionFromIssueID")] -public class NewsletterUnsubscription -{ - [Key] - [Column("UnsubscriptionID")] - public int UnsubscriptionId { get; set; } - - [StringLength(254)] - public string UnsubscriptionEmail { get; set; } = null!; - - public DateTime UnsubscriptionCreated { get; set; } - - [Column("UnsubscriptionNewsletterID")] - public int? UnsubscriptionNewsletterId { get; set; } - - [Column("UnsubscriptionFromIssueID")] - public int? UnsubscriptionFromIssueId { get; set; } - - [Column("UnsubscriptionGUID")] - public Guid UnsubscriptionGuid { get; set; } - - [ForeignKey("UnsubscriptionFromIssueId")] - [InverseProperty("NewsletterUnsubscriptions")] - public virtual NewsletterNewsletterIssue? UnsubscriptionFromIssue { get; set; } - - [ForeignKey("UnsubscriptionNewsletterId")] - [InverseProperty("NewsletterUnsubscriptions")] - public virtual NewsletterNewsletter? UnsubscriptionNewsletter { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/OmAbtest.cs b/Migration.Toolkit.KX13/Models/OmAbtest.cs deleted file mode 100644 index ca40d2e7..00000000 --- a/Migration.Toolkit.KX13/Models/OmAbtest.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ABTest")] -[Index("AbtestSiteId", Name = "IX_OM_ABTest_SiteID")] -public class OmAbtest -{ - [Key] - [Column("ABTestID")] - public int AbtestId { get; set; } - - [Column("ABTestName")] - [StringLength(50)] - public string AbtestName { get; set; } = null!; - - [Column("ABTestDescription")] - public string? AbtestDescription { get; set; } - - [Column("ABTestCulture")] - [StringLength(50)] - public string? AbtestCulture { get; set; } - - [Column("ABTestOriginalPage")] - [StringLength(450)] - public string AbtestOriginalPage { get; set; } = null!; - - [Column("ABTestOpenFrom")] - public DateTime? AbtestOpenFrom { get; set; } - - [Column("ABTestOpenTo")] - public DateTime? AbtestOpenTo { get; set; } - - [Column("ABTestSiteID")] - public int AbtestSiteId { get; set; } - - [Column("ABTestGUID")] - public Guid AbtestGuid { get; set; } - - [Column("ABTestLastModified")] - public DateTime AbtestLastModified { get; set; } - - [Column("ABTestDisplayName")] - [StringLength(100)] - public string AbtestDisplayName { get; set; } = null!; - - [Column("ABTestIncludedTraffic")] - public int AbtestIncludedTraffic { get; set; } - - [Column("ABTestVisitorTargeting")] - public string? AbtestVisitorTargeting { get; set; } - - [Column("ABTestConversions")] - public string? AbtestConversions { get; set; } - - [Column("ABTestWinnerGUID")] - public Guid? AbtestWinnerGuid { get; set; } - - [ForeignKey("AbtestSiteId")] - [InverseProperty("OmAbtests")] - public virtual CmsSite AbtestSite { get; set; } = null!; - - [InverseProperty("AbvariantTest")] - public virtual ICollection OmAbvariantData { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/OmAbvariantDatum.cs b/Migration.Toolkit.KX13/Models/OmAbvariantDatum.cs deleted file mode 100644 index 3987b1ba..00000000 --- a/Migration.Toolkit.KX13/Models/OmAbvariantDatum.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ABVariantData")] -[Index("AbvariantTestId", "AbvariantGuid", Name = "IX_OM_ABVariantData_ABVariantTestID_ABVariantGUID")] -public class OmAbvariantDatum -{ - [Key] - [Column("ABVariantID")] - public int AbvariantId { get; set; } - - [Column("ABVariantDisplayName")] - [StringLength(100)] - public string AbvariantDisplayName { get; set; } = null!; - - [Column("ABVariantGUID")] - public Guid AbvariantGuid { get; set; } - - [Column("ABVariantTestID")] - public int AbvariantTestId { get; set; } - - [Column("ABVariantIsOriginal")] - public bool AbvariantIsOriginal { get; set; } - - [ForeignKey("AbvariantTestId")] - [InverseProperty("OmAbvariantData")] - public virtual OmAbtest AbvariantTest { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/OmAccount.cs b/Migration.Toolkit.KX13/Models/OmAccount.cs deleted file mode 100644 index 9fa3d49a..00000000 --- a/Migration.Toolkit.KX13/Models/OmAccount.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_Account")] -[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] -[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] -[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] -[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] -[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] -[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] -[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] -public class OmAccount -{ - [Key] - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [ForeignKey("AccountCountryId")] - [InverseProperty("OmAccounts")] - public virtual CmsCountry? AccountCountry { get; set; } - - [ForeignKey("AccountOwnerUserId")] - [InverseProperty("OmAccounts")] - public virtual CmsUser? AccountOwnerUser { get; set; } - - [ForeignKey("AccountPrimaryContactId")] - [InverseProperty("OmAccountAccountPrimaryContacts")] - public virtual OmContact? AccountPrimaryContact { get; set; } - - [ForeignKey("AccountSecondaryContactId")] - [InverseProperty("OmAccountAccountSecondaryContacts")] - public virtual OmContact? AccountSecondaryContact { get; set; } - - [ForeignKey("AccountStateId")] - [InverseProperty("OmAccounts")] - public virtual CmsState? AccountState { get; set; } - - [ForeignKey("AccountStatusId")] - [InverseProperty("OmAccounts")] - public virtual OmAccountStatus? AccountStatus { get; set; } - - [ForeignKey("AccountSubsidiaryOfId")] - [InverseProperty("InverseAccountSubsidiaryOf")] - public virtual OmAccount? AccountSubsidiaryOf { get; set; } - - [InverseProperty("AccountSubsidiaryOf")] - public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); - - [InverseProperty("Account")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/OmAccountContact.cs b/Migration.Toolkit.KX13/Models/OmAccountContact.cs deleted file mode 100644 index de62cc81..00000000 --- a/Migration.Toolkit.KX13/Models/OmAccountContact.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_AccountContact")] -[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] -[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] -[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] -public class OmAccountContact -{ - [Key] - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("AccountId")] - [InverseProperty("OmAccountContacts")] - public virtual OmAccount Account { get; set; } = null!; - - [ForeignKey("ContactId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("ContactRoleId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContactRole? ContactRole { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/OmAccountStatus.cs b/Migration.Toolkit.KX13/Models/OmAccountStatus.cs deleted file mode 100644 index b4d27360..00000000 --- a/Migration.Toolkit.KX13/Models/OmAccountStatus.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_AccountStatus")] -public class OmAccountStatus -{ - [Key] - [Column("AccountStatusID")] - public int AccountStatusId { get; set; } - - [StringLength(200)] - public string AccountStatusName { get; set; } = null!; - - [StringLength(200)] - public string AccountStatusDisplayName { get; set; } = null!; - - public string? AccountStatusDescription { get; set; } - - [InverseProperty("AccountStatus")] - public virtual ICollection OmAccounts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/OmActivity.cs b/Migration.Toolkit.KX13/Models/OmActivity.cs deleted file mode 100644 index b7d2fcd9..00000000 --- a/Migration.Toolkit.KX13/Models/OmActivity.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_Activity")] -[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] -[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] -[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] -[Index("ActivitySiteId", Name = "IX_OM_Activity_ActivitySiteID")] -[Index("ActivityType", "ActivityItemId", "ActivityNodeId", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityNodeID_ActivityUTMSource_ActivityUTMContent_ActivityCampaign")] -public class OmActivity -{ - [Key] - [Column("ActivityID")] - public int ActivityId { get; set; } - - [Column("ActivityContactID")] - public int ActivityContactId { get; set; } - - public DateTime? ActivityCreated { get; set; } - - [StringLength(250)] - public string ActivityType { get; set; } = null!; - - [Column("ActivityItemID")] - public int? ActivityItemId { get; set; } - - [Column("ActivityItemDetailID")] - public int? ActivityItemDetailId { get; set; } - - [StringLength(250)] - public string? ActivityValue { get; set; } - - [Column("ActivityURL")] - public string? ActivityUrl { get; set; } - - [StringLength(250)] - public string? ActivityTitle { get; set; } - - [Column("ActivitySiteID")] - public int ActivitySiteId { get; set; } - - public string? ActivityComment { get; set; } - - [StringLength(200)] - public string? ActivityCampaign { get; set; } - - [Column("ActivityURLReferrer")] - public string? ActivityUrlreferrer { get; set; } - - [StringLength(50)] - public string? ActivityCulture { get; set; } - - [Column("ActivityNodeID")] - public int? ActivityNodeId { get; set; } - - [Column("ActivityUTMSource")] - [StringLength(200)] - public string? ActivityUtmsource { get; set; } - - [Column("ActivityABVariantName")] - [StringLength(200)] - public string? ActivityAbvariantName { get; set; } - - [Column("ActivityURLHash")] - public long ActivityUrlhash { get; set; } - - [Column("ActivityUTMContent")] - [StringLength(200)] - public string? ActivityUtmcontent { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/OmActivityRecalculationQueue.cs b/Migration.Toolkit.KX13/Models/OmActivityRecalculationQueue.cs deleted file mode 100644 index 7902e50f..00000000 --- a/Migration.Toolkit.KX13/Models/OmActivityRecalculationQueue.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ActivityRecalculationQueue")] -public class OmActivityRecalculationQueue -{ - [Key] - [Column("ActivityRecalculationQueueID")] - public int ActivityRecalculationQueueId { get; set; } - - [Column("ActivityRecalculationQueueActivityID")] - public int ActivityRecalculationQueueActivityId { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/OmActivityType.cs b/Migration.Toolkit.KX13/Models/OmActivityType.cs deleted file mode 100644 index 8ee0cb68..00000000 --- a/Migration.Toolkit.KX13/Models/OmActivityType.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ActivityType")] -public class OmActivityType -{ - [Key] - [Column("ActivityTypeID")] - public int ActivityTypeId { get; set; } - - [StringLength(250)] - public string ActivityTypeDisplayName { get; set; } = null!; - - [StringLength(250)] - public string ActivityTypeName { get; set; } = null!; - - public bool? ActivityTypeEnabled { get; set; } - - public bool? ActivityTypeIsCustom { get; set; } - - public string? ActivityTypeDescription { get; set; } - - public bool? ActivityTypeManualCreationAllowed { get; set; } - - [StringLength(200)] - public string? ActivityTypeMainFormControl { get; set; } - - [StringLength(200)] - public string? ActivityTypeDetailFormControl { get; set; } - - [StringLength(7)] - public string? ActivityTypeColor { get; set; } - - [StringLength(200)] - public string? ActivityTypeItemObjectType { get; set; } - - [StringLength(200)] - public string? ActivityTypeItemDetailObjectType { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/OmContact.cs b/Migration.Toolkit.KX13/Models/OmContact.cs deleted file mode 100644 index c6a4c413..00000000 --- a/Migration.Toolkit.KX13/Models/OmContact.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_Contact")] -[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] -[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] -[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] -[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] -[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] -[Index("ContactPersonaId", "ContactLastName", Name = "IX_OM_Contact_ContactPersonaID_ContactLastName")] -[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] -[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] -public class OmContact -{ - [Key] - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(50)] - public string? ContactJobTitle { get; set; } - - [StringLength(100)] - public string? ContactAddress1 { get; set; } - - [StringLength(100)] - public string? ContactCity { get; set; } - - [Column("ContactZIP")] - [StringLength(100)] - public string? ContactZip { get; set; } - - [Column("ContactStateID")] - public int? ContactStateId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [StringLength(26)] - public string? ContactMobilePhone { get; set; } - - [StringLength(26)] - public string? ContactBusinessPhone { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - public DateTime? ContactBirthday { get; set; } - - public int? ContactGender { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - public string? ContactNotes { get; set; } - - [Column("ContactOwnerUserID")] - public int? ContactOwnerUserId { get; set; } - - public bool? ContactMonitored { get; set; } - - [Column("ContactGUID")] - public Guid ContactGuid { get; set; } - - public DateTime ContactLastModified { get; set; } - - public DateTime ContactCreated { get; set; } - - public int? ContactBounces { get; set; } - - [StringLength(200)] - public string? ContactCampaign { get; set; } - - [Column("ContactSalesForceLeadID")] - [StringLength(18)] - public string? ContactSalesForceLeadId { get; set; } - - public bool? ContactSalesForceLeadReplicationDisabled { get; set; } - - public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } - - public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } - - [StringLength(100)] - public string? ContactCompanyName { get; set; } - - public bool? ContactSalesForceLeadReplicationRequired { get; set; } - - [Column("ContactPersonaID")] - public int? ContactPersonaId { get; set; } - - [InverseProperty("ConsentAgreementContact")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [ForeignKey("ContactCountryId")] - [InverseProperty("OmContacts")] - public virtual CmsCountry? ContactCountry { get; set; } - - [ForeignKey("ContactOwnerUserId")] - [InverseProperty("OmContacts")] - public virtual CmsUser? ContactOwnerUser { get; set; } - - [ForeignKey("ContactStateId")] - [InverseProperty("OmContacts")] - public virtual CmsState? ContactState { get; set; } - - [ForeignKey("ContactStatusId")] - [InverseProperty("OmContacts")] - public virtual OmContactStatus? ContactStatus { get; set; } - - [InverseProperty("AccountPrimaryContact")] - public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); - - [InverseProperty("AccountSecondaryContact")] - public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmMemberships { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [InverseProperty("VisitorToContactContact")] - public virtual ICollection OmVisitorToContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/OmContactChangeRecalculationQueue.cs b/Migration.Toolkit.KX13/Models/OmContactChangeRecalculationQueue.cs deleted file mode 100644 index f3777af9..00000000 --- a/Migration.Toolkit.KX13/Models/OmContactChangeRecalculationQueue.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ContactChangeRecalculationQueue")] -public class OmContactChangeRecalculationQueue -{ - [Key] - [Column("ContactChangeRecalculationQueueID")] - public int ContactChangeRecalculationQueueId { get; set; } - - [Column("ContactChangeRecalculationQueueContactID")] - public int ContactChangeRecalculationQueueContactId { get; set; } - - public string? ContactChangeRecalculationQueueChangedColumns { get; set; } - - public bool ContactChangeRecalculationQueueContactIsNew { get; set; } - - public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/OmContactGroup.cs b/Migration.Toolkit.KX13/Models/OmContactGroup.cs deleted file mode 100644 index fd12786b..00000000 --- a/Migration.Toolkit.KX13/Models/OmContactGroup.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ContactGroup")] -public class OmContactGroup -{ - [Key] - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [StringLength(200)] - public string ContactGroupName { get; set; } = null!; - - [StringLength(200)] - public string ContactGroupDisplayName { get; set; } = null!; - - public string? ContactGroupDescription { get; set; } - - public string? ContactGroupDynamicCondition { get; set; } - - public bool? ContactGroupEnabled { get; set; } - - public DateTime? ContactGroupLastModified { get; set; } - - [Column("ContactGroupGUID")] - public Guid? ContactGroupGuid { get; set; } - - public int? ContactGroupStatus { get; set; } - - [InverseProperty("ContactGroup")] - public virtual ICollection NewsletterIssueContactGroups { get; set; } = new List(); - - [InverseProperty("ContactGroupMemberContactGroup")] - public virtual ICollection OmContactGroupMembers { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/OmContactGroupMember.cs b/Migration.Toolkit.KX13/Models/OmContactGroupMember.cs deleted file mode 100644 index 90ac7e30..00000000 --- a/Migration.Toolkit.KX13/Models/OmContactGroupMember.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ContactGroupMember")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] -[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] -public class OmContactGroupMember -{ - [Key] - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - public int ContactGroupMemberType { get; set; } - - [Column("ContactGroupMemberRelatedID")] - public int ContactGroupMemberRelatedId { get; set; } - - public bool? ContactGroupMemberFromCondition { get; set; } - - public bool? ContactGroupMemberFromAccount { get; set; } - - public bool? ContactGroupMemberFromManual { get; set; } - - [ForeignKey("ContactGroupMemberContactGroupId")] - [InverseProperty("OmContactGroupMembers")] - public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/OmContactRole.cs b/Migration.Toolkit.KX13/Models/OmContactRole.cs deleted file mode 100644 index 9394c1c8..00000000 --- a/Migration.Toolkit.KX13/Models/OmContactRole.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ContactRole")] -public class OmContactRole -{ - [Key] - [Column("ContactRoleID")] - public int ContactRoleId { get; set; } - - [StringLength(200)] - public string ContactRoleName { get; set; } = null!; - - [StringLength(200)] - public string ContactRoleDisplayName { get; set; } = null!; - - public string? ContactRoleDescription { get; set; } - - [InverseProperty("ContactRole")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/OmContactStatus.cs b/Migration.Toolkit.KX13/Models/OmContactStatus.cs deleted file mode 100644 index 78608376..00000000 --- a/Migration.Toolkit.KX13/Models/OmContactStatus.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ContactStatus")] -public class OmContactStatus -{ - [Key] - [Column("ContactStatusID")] - public int ContactStatusId { get; set; } - - [StringLength(200)] - public string ContactStatusName { get; set; } = null!; - - [StringLength(200)] - public string ContactStatusDisplayName { get; set; } = null!; - - public string? ContactStatusDescription { get; set; } - - [InverseProperty("ContactStatus")] - public virtual ICollection OmContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/OmMembership.cs b/Migration.Toolkit.KX13/Models/OmMembership.cs deleted file mode 100644 index a18914cc..00000000 --- a/Migration.Toolkit.KX13/Models/OmMembership.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_Membership")] -[Index("ContactId", Name = "IX_OM_Membership_ContactID")] -[Index("RelatedId", Name = "IX_OM_Membership_RelatedID")] -public class OmMembership -{ - [Key] - [Column("MembershipID")] - public int MembershipId { get; set; } - - [Column("RelatedID")] - public int RelatedId { get; set; } - - public int MemberType { get; set; } - - [Column("MembershipGUID")] - public Guid MembershipGuid { get; set; } - - public DateTime MembershipCreated { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("ContactId")] - [InverseProperty("OmMemberships")] - public virtual OmContact Contact { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/OmRule.cs b/Migration.Toolkit.KX13/Models/OmRule.cs deleted file mode 100644 index 6b134706..00000000 --- a/Migration.Toolkit.KX13/Models/OmRule.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_Rule")] -[Index("RuleScoreId", Name = "IX_OM_Rule_RuleScoreID")] -public class OmRule -{ - [Key] - [Column("RuleID")] - public int RuleId { get; set; } - - [Column("RuleScoreID")] - public int RuleScoreId { get; set; } - - [StringLength(200)] - public string RuleDisplayName { get; set; } = null!; - - [StringLength(200)] - public string RuleName { get; set; } = null!; - - public int RuleValue { get; set; } - - public bool? RuleIsRecurring { get; set; } - - public int? RuleMaxPoints { get; set; } - - public DateTime? RuleValidUntil { get; set; } - - [StringLength(50)] - public string? RuleValidity { get; set; } - - public int? RuleValidFor { get; set; } - - public int RuleType { get; set; } - - [StringLength(250)] - public string? RuleParameter { get; set; } - - public string RuleCondition { get; set; } = null!; - - public DateTime RuleLastModified { get; set; } - - [Column("RuleGUID")] - public Guid RuleGuid { get; set; } - - public bool RuleBelongsToPersona { get; set; } - - [Column("RuleActivityItemID")] - public int? RuleActivityItemId { get; set; } - - [StringLength(200)] - public string? RuleActivityItemObjectType { get; set; } - - [Column("RuleActivityItemDetailID")] - public int? RuleActivityItemDetailId { get; set; } - - [StringLength(200)] - public string? RuleActivityItemDetailObjectType { get; set; } - - [InverseProperty("Rule")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [ForeignKey("RuleScoreId")] - [InverseProperty("OmRules")] - public virtual OmScore RuleScore { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/OmScore.cs b/Migration.Toolkit.KX13/Models/OmScore.cs deleted file mode 100644 index 89cf0cef..00000000 --- a/Migration.Toolkit.KX13/Models/OmScore.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_Score")] -public class OmScore -{ - [Key] - [Column("ScoreID")] - public int ScoreId { get; set; } - - [StringLength(200)] - public string ScoreName { get; set; } = null!; - - [StringLength(200)] - public string ScoreDisplayName { get; set; } = null!; - - public string? ScoreDescription { get; set; } - - public bool ScoreEnabled { get; set; } - - public int? ScoreEmailAtScore { get; set; } - - [StringLength(998)] - public string? ScoreNotificationEmail { get; set; } - - public DateTime ScoreLastModified { get; set; } - - [Column("ScoreGUID")] - public Guid ScoreGuid { get; set; } - - public int? ScoreStatus { get; set; } - - [Column("ScoreScheduledTaskID")] - public int? ScoreScheduledTaskId { get; set; } - - [Column("ScorePersonaID")] - public int? ScorePersonaId { get; set; } - - [InverseProperty("RuleScore")] - public virtual ICollection OmRules { get; set; } = new List(); - - [InverseProperty("Score")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [ForeignKey("ScorePersonaId")] - [InverseProperty("OmScore")] - public virtual PersonasPersona? ScorePersona { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/OmScoreContactRule.cs b/Migration.Toolkit.KX13/Models/OmScoreContactRule.cs deleted file mode 100644 index 0ec22655..00000000 --- a/Migration.Toolkit.KX13/Models/OmScoreContactRule.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ScoreContactRule")] -[Index("ContactId", Name = "IX_OM_ScoreContactRule_ContactID")] -[Index("RuleId", Name = "IX_OM_ScoreContactRule_RuleID")] -[Index("ScoreId", Name = "IX_OM_ScoreContactRule_ScoreID_ContactID_Value_Expiration")] -[Index("ScoreId", "ContactId", "RuleId", Name = "UQ_OM_ScoreContactRule", IsUnique = true)] -public class OmScoreContactRule -{ - [Column("ScoreID")] - public int ScoreId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("RuleID")] - public int RuleId { get; set; } - - public int Value { get; set; } - - public DateTime? Expiration { get; set; } - - [Key] - [Column("ScoreContactRuleID")] - public int ScoreContactRuleId { get; set; } - - [ForeignKey("ContactId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("RuleId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmRule Rule { get; set; } = null!; - - [ForeignKey("ScoreId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmScore Score { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/OmVisitorToContact.cs b/Migration.Toolkit.KX13/Models/OmVisitorToContact.cs deleted file mode 100644 index 70ae870c..00000000 --- a/Migration.Toolkit.KX13/Models/OmVisitorToContact.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_VisitorToContact")] -[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] -[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] -public class OmVisitorToContact -{ - [Key] - [Column("VisitorToContactID")] - public int VisitorToContactId { get; set; } - - [Column("VisitorToContactVisitorGUID")] - public Guid VisitorToContactVisitorGuid { get; set; } - - [Column("VisitorToContactContactID")] - public int VisitorToContactContactId { get; set; } - - [ForeignKey("VisitorToContactContactId")] - [InverseProperty("OmVisitorToContacts")] - public virtual OmContact VisitorToContactContact { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/PersonasPersona.cs b/Migration.Toolkit.KX13/Models/PersonasPersona.cs deleted file mode 100644 index 60b5319a..00000000 --- a/Migration.Toolkit.KX13/Models/PersonasPersona.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Personas_Persona")] -public class PersonasPersona -{ - [Key] - [Column("PersonaID")] - public int PersonaId { get; set; } - - [StringLength(200)] - public string PersonaDisplayName { get; set; } = null!; - - [StringLength(200)] - public string PersonaName { get; set; } = null!; - - public string? PersonaDescription { get; set; } - - [Required] - public bool? PersonaEnabled { get; set; } - - [Column("PersonaGUID")] - public Guid PersonaGuid { get; set; } - - [Column("PersonaPictureMetafileGUID")] - public Guid? PersonaPictureMetafileGuid { get; set; } - - public int PersonaPointsThreshold { get; set; } - - [InverseProperty("ScorePersona")] - public virtual OmScore? OmScore { get; set; } - - [InverseProperty("PersonaContactHistoryPersona")] - public virtual ICollection PersonasPersonaContactHistories { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/PersonasPersonaContactHistory.cs b/Migration.Toolkit.KX13/Models/PersonasPersonaContactHistory.cs deleted file mode 100644 index bac1db08..00000000 --- a/Migration.Toolkit.KX13/Models/PersonasPersonaContactHistory.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Personas_PersonaContactHistory")] -[Index("PersonaContactHistoryPersonaId", Name = "IX_Personas_PersonaContactHistoryPersonaID")] -public class PersonasPersonaContactHistory -{ - [Key] - [Column("PersonaContactHistoryID")] - public int PersonaContactHistoryId { get; set; } - - [Column("PersonaContactHistoryPersonaID")] - public int? PersonaContactHistoryPersonaId { get; set; } - - [Column(TypeName = "date")] - public DateTime PersonaContactHistoryDate { get; set; } - - public int PersonaContactHistoryContacts { get; set; } - - [ForeignKey("PersonaContactHistoryPersonaId")] - [InverseProperty("PersonasPersonaContactHistories")] - public virtual PersonasPersona? PersonaContactHistoryPersona { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ReportingReport.cs b/Migration.Toolkit.KX13/Models/ReportingReport.cs deleted file mode 100644 index 90f06d5a..00000000 --- a/Migration.Toolkit.KX13/Models/ReportingReport.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_Report")] -[Index("ReportCategoryId", Name = "IX_Reporting_Report_ReportCategoryID")] -[Index("ReportGuid", "ReportName", Name = "IX_Reporting_Report_ReportGUID_ReportName")] -[Index("ReportName", Name = "IX_Reporting_Report_ReportName", IsUnique = true)] -public class ReportingReport -{ - [Key] - [Column("ReportID")] - public int ReportId { get; set; } - - [StringLength(200)] - public string ReportName { get; set; } = null!; - - [StringLength(440)] - public string ReportDisplayName { get; set; } = null!; - - public string? ReportLayout { get; set; } - - public string? ReportParameters { get; set; } - - [Column("ReportCategoryID")] - public int ReportCategoryId { get; set; } - - public int ReportAccess { get; set; } - - [Column("ReportGUID")] - public Guid ReportGuid { get; set; } - - public DateTime ReportLastModified { get; set; } - - public bool? ReportEnableSubscription { get; set; } - - [StringLength(100)] - public string? ReportConnectionString { get; set; } - - [ForeignKey("ReportCategoryId")] - [InverseProperty("ReportingReports")] - public virtual ReportingReportCategory ReportCategory { get; set; } = null!; - - [InverseProperty("GraphReport")] - public virtual ICollection ReportingReportGraphs { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionReport")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("TableReport")] - public virtual ICollection ReportingReportTables { get; set; } = new List(); - - [InverseProperty("ValueReport")] - public virtual ICollection ReportingReportValues { get; set; } = new List(); - - [InverseProperty("SavedReportReport")] - public virtual ICollection ReportingSavedReports { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/ReportingReportCategory.cs b/Migration.Toolkit.KX13/Models/ReportingReportCategory.cs deleted file mode 100644 index 0b3e1d2c..00000000 --- a/Migration.Toolkit.KX13/Models/ReportingReportCategory.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_ReportCategory")] -[Index("CategoryParentId", Name = "IX_Reporting_ReportCategory_CategoryParentID")] -public class ReportingReportCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryCodeName { get; set; } = null!; - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public string CategoryPath { get; set; } = null!; - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryReportChildCount { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual ReportingReportCategory? CategoryParent { get; set; } - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); - - [InverseProperty("ReportCategory")] - public virtual ICollection ReportingReports { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/ReportingReportGraph.cs b/Migration.Toolkit.KX13/Models/ReportingReportGraph.cs deleted file mode 100644 index a3a75c8e..00000000 --- a/Migration.Toolkit.KX13/Models/ReportingReportGraph.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_ReportGraph")] -[Index("GraphGuid", Name = "IX_Reporting_ReportGraph_GraphGUID", IsUnique = true)] -[Index("GraphReportId", "GraphName", Name = "IX_Reporting_ReportGraph_GraphReportID_GraphName", IsUnique = true)] -public class ReportingReportGraph -{ - [Key] - [Column("GraphID")] - public int GraphId { get; set; } - - [StringLength(100)] - public string GraphName { get; set; } = null!; - - [StringLength(450)] - public string GraphDisplayName { get; set; } = null!; - - public string GraphQuery { get; set; } = null!; - - public bool GraphQueryIsStoredProcedure { get; set; } - - [StringLength(50)] - public string GraphType { get; set; } = null!; - - [Column("GraphReportID")] - public int GraphReportId { get; set; } - - [StringLength(200)] - public string? GraphTitle { get; set; } - - [Column("GraphXAxisTitle")] - [StringLength(200)] - public string? GraphXaxisTitle { get; set; } - - [Column("GraphYAxisTitle")] - [StringLength(200)] - public string? GraphYaxisTitle { get; set; } - - public int? GraphWidth { get; set; } - - public int? GraphHeight { get; set; } - - public int? GraphLegendPosition { get; set; } - - public string? GraphSettings { get; set; } - - [Column("GraphGUID")] - public Guid GraphGuid { get; set; } - - public DateTime GraphLastModified { get; set; } - - public bool? GraphIsHtml { get; set; } - - [StringLength(100)] - public string? GraphConnectionString { get; set; } - - [ForeignKey("GraphReportId")] - [InverseProperty("ReportingReportGraphs")] - public virtual ReportingReport GraphReport { get; set; } = null!; - - [InverseProperty("ReportSubscriptionGraph")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/ReportingReportSubscription.cs b/Migration.Toolkit.KX13/Models/ReportingReportSubscription.cs deleted file mode 100644 index 81a686c6..00000000 --- a/Migration.Toolkit.KX13/Models/ReportingReportSubscription.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_ReportSubscription")] -[Index("ReportSubscriptionGraphId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionGraphID")] -[Index("ReportSubscriptionReportId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionReportID")] -[Index("ReportSubscriptionSiteId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionSiteID")] -[Index("ReportSubscriptionTableId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionTableID")] -[Index("ReportSubscriptionUserId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionUserID")] -[Index("ReportSubscriptionValueId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionValueID")] -public class ReportingReportSubscription -{ - [Key] - [Column("ReportSubscriptionID")] - public int ReportSubscriptionId { get; set; } - - [Column("ReportSubscriptionReportID")] - public int ReportSubscriptionReportId { get; set; } - - [StringLength(1000)] - public string ReportSubscriptionInterval { get; set; } = null!; - - public string? ReportSubscriptionCondition { get; set; } - - [Required] - public bool? ReportSubscriptionEnabled { get; set; } - - public string? ReportSubscriptionParameters { get; set; } - - [Column("ReportSubscriptionGUID")] - public Guid ReportSubscriptionGuid { get; set; } - - public DateTime ReportSubscriptionLastModified { get; set; } - - [StringLength(200)] - public string? ReportSubscriptionSubject { get; set; } - - [Column("ReportSubscriptionGraphID")] - public int? ReportSubscriptionGraphId { get; set; } - - [Column("ReportSubscriptionTableID")] - public int? ReportSubscriptionTableId { get; set; } - - [Column("ReportSubscriptionValueID")] - public int? ReportSubscriptionValueId { get; set; } - - [Column("ReportSubscriptionUserID")] - public int ReportSubscriptionUserId { get; set; } - - [StringLength(400)] - public string ReportSubscriptionEmail { get; set; } = null!; - - [Required] - public bool? ReportSubscriptionOnlyNonEmpty { get; set; } - - public DateTime? ReportSubscriptionLastPostDate { get; set; } - - public DateTime? ReportSubscriptionNextPostDate { get; set; } - - [Column("ReportSubscriptionSiteID")] - public int ReportSubscriptionSiteId { get; set; } - - public string? ReportSubscriptionSettings { get; set; } - - [ForeignKey("ReportSubscriptionGraphId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportGraph? ReportSubscriptionGraph { get; set; } - - [ForeignKey("ReportSubscriptionReportId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReport ReportSubscriptionReport { get; set; } = null!; - - [ForeignKey("ReportSubscriptionSiteId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual CmsSite ReportSubscriptionSite { get; set; } = null!; - - [ForeignKey("ReportSubscriptionTableId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportTable? ReportSubscriptionTable { get; set; } - - [ForeignKey("ReportSubscriptionUserId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual CmsUser ReportSubscriptionUser { get; set; } = null!; - - [ForeignKey("ReportSubscriptionValueId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportValue? ReportSubscriptionValue { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ReportingReportTable.cs b/Migration.Toolkit.KX13/Models/ReportingReportTable.cs deleted file mode 100644 index 9697f2ee..00000000 --- a/Migration.Toolkit.KX13/Models/ReportingReportTable.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_ReportTable")] -[Index("TableReportId", Name = "IX_Reporting_ReportTable_TableReportID")] -[Index("TableName", "TableReportId", Name = "IX_Reporting_ReportTable_TableReportID_TableName", IsUnique = true)] -public class ReportingReportTable -{ - [Key] - [Column("TableID")] - public int TableId { get; set; } - - [StringLength(100)] - public string TableName { get; set; } = null!; - - [StringLength(450)] - public string TableDisplayName { get; set; } = null!; - - public string TableQuery { get; set; } = null!; - - public bool TableQueryIsStoredProcedure { get; set; } - - [Column("TableReportID")] - public int TableReportId { get; set; } - - public string? TableSettings { get; set; } - - [Column("TableGUID")] - public Guid TableGuid { get; set; } - - public DateTime TableLastModified { get; set; } - - [StringLength(100)] - public string? TableConnectionString { get; set; } - - [InverseProperty("ReportSubscriptionTable")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [ForeignKey("TableReportId")] - [InverseProperty("ReportingReportTables")] - public virtual ReportingReport TableReport { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ReportingReportValue.cs b/Migration.Toolkit.KX13/Models/ReportingReportValue.cs deleted file mode 100644 index be55812b..00000000 --- a/Migration.Toolkit.KX13/Models/ReportingReportValue.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_ReportValue")] -[Index("ValueName", "ValueReportId", Name = "IX_Reporting_ReportValue_ValueName_ValueReportID")] -[Index("ValueReportId", Name = "IX_Reporting_ReportValue_ValueReportID")] -public class ReportingReportValue -{ - [Key] - [Column("ValueID")] - public int ValueId { get; set; } - - [StringLength(100)] - public string ValueName { get; set; } = null!; - - [StringLength(450)] - public string ValueDisplayName { get; set; } = null!; - - public string ValueQuery { get; set; } = null!; - - public bool ValueQueryIsStoredProcedure { get; set; } - - [StringLength(200)] - public string? ValueFormatString { get; set; } - - [Column("ValueReportID")] - public int ValueReportId { get; set; } - - [Column("ValueGUID")] - public Guid ValueGuid { get; set; } - - public DateTime ValueLastModified { get; set; } - - public string? ValueSettings { get; set; } - - [StringLength(100)] - public string? ValueConnectionString { get; set; } - - [InverseProperty("ReportSubscriptionValue")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [ForeignKey("ValueReportId")] - [InverseProperty("ReportingReportValues")] - public virtual ReportingReport ValueReport { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ReportingSavedGraph.cs b/Migration.Toolkit.KX13/Models/ReportingSavedGraph.cs deleted file mode 100644 index da97cbeb..00000000 --- a/Migration.Toolkit.KX13/Models/ReportingSavedGraph.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_SavedGraph")] -[Index("SavedGraphGuid", Name = "IX_Reporting_SavedGraph_SavedGraphGUID")] -[Index("SavedGraphSavedReportId", Name = "IX_Reporting_SavedGraph_SavedGraphSavedReportID")] -public class ReportingSavedGraph -{ - [Key] - [Column("SavedGraphID")] - public int SavedGraphId { get; set; } - - [Column("SavedGraphSavedReportID")] - public int SavedGraphSavedReportId { get; set; } - - [Column("SavedGraphGUID")] - public Guid SavedGraphGuid { get; set; } - - public byte[] SavedGraphBinary { get; set; } = null!; - - [StringLength(100)] - public string SavedGraphMimeType { get; set; } = null!; - - public DateTime SavedGraphLastModified { get; set; } - - [ForeignKey("SavedGraphSavedReportId")] - [InverseProperty("ReportingSavedGraphs")] - public virtual ReportingSavedReport SavedGraphSavedReport { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ReportingSavedReport.cs b/Migration.Toolkit.KX13/Models/ReportingSavedReport.cs deleted file mode 100644 index d65c06e5..00000000 --- a/Migration.Toolkit.KX13/Models/ReportingSavedReport.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_SavedReport")] -[Index("SavedReportCreatedByUserId", Name = "IX_Reporting_SavedReport_SavedReportCreatedByUserID")] -public class ReportingSavedReport -{ - [Key] - [Column("SavedReportID")] - public int SavedReportId { get; set; } - - [Column("SavedReportReportID")] - public int SavedReportReportId { get; set; } - - [Column("SavedReportGUID")] - public Guid SavedReportGuid { get; set; } - - [StringLength(200)] - public string? SavedReportTitle { get; set; } - - public DateTime SavedReportDate { get; set; } - - [Column("SavedReportHTML")] - public string SavedReportHtml { get; set; } = null!; - - public string SavedReportParameters { get; set; } = null!; - - [Column("SavedReportCreatedByUserID")] - public int? SavedReportCreatedByUserId { get; set; } - - public DateTime SavedReportLastModified { get; set; } - - [InverseProperty("SavedGraphSavedReport")] - public virtual ICollection ReportingSavedGraphs { get; set; } = new List(); - - [ForeignKey("SavedReportCreatedByUserId")] - [InverseProperty("ReportingSavedReports")] - public virtual CmsUser? SavedReportCreatedByUser { get; set; } - - [ForeignKey("SavedReportReportId")] - [InverseProperty("ReportingSavedReports")] - public virtual ReportingReport SavedReportReport { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/SharePointSharePointConnection.cs b/Migration.Toolkit.KX13/Models/SharePointSharePointConnection.cs deleted file mode 100644 index dee17a43..00000000 --- a/Migration.Toolkit.KX13/Models/SharePointSharePointConnection.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SharePoint_SharePointConnection")] -[Index("SharePointConnectionSiteId", Name = "IX_SharePoint_SharePointConnection_SharePointConnectionSiteID")] -public class SharePointSharePointConnection -{ - [Key] - [Column("SharePointConnectionID")] - public int SharePointConnectionId { get; set; } - - [Column("SharePointConnectionGUID")] - public Guid SharePointConnectionGuid { get; set; } - - [Column("SharePointConnectionSiteID")] - public int SharePointConnectionSiteId { get; set; } - - [StringLength(512)] - public string SharePointConnectionSiteUrl { get; set; } = null!; - - [StringLength(100)] - public string SharePointConnectionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string SharePointConnectionName { get; set; } = null!; - - [StringLength(100)] - public string? SharePointConnectionUserName { get; set; } - - [StringLength(100)] - public string? SharePointConnectionPassword { get; set; } - - public DateTime SharePointConnectionLastModified { get; set; } - - [ForeignKey("SharePointConnectionSiteId")] - [InverseProperty("SharePointSharePointConnections")] - public virtual CmsSite SharePointConnectionSite { get; set; } = null!; - - [InverseProperty("SharePointLibrarySharePointConnection")] - public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/SharePointSharePointFile.cs b/Migration.Toolkit.KX13/Models/SharePointSharePointFile.cs deleted file mode 100644 index 7aaf52da..00000000 --- a/Migration.Toolkit.KX13/Models/SharePointSharePointFile.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SharePoint_SharePointFile")] -[Index("SharePointFileSiteId", Name = "IX_SharePoint_SharePointFile_SharePointFileSiteID")] -[Index("SharePointFileSharePointLibraryId", "SharePointFileServerRelativeUrl", Name = "UQ_SharePoint_SharePointFile_LibraryID_ServerRelativeURL", IsUnique = true)] -public class SharePointSharePointFile -{ - [Key] - [Column("SharePointFileID")] - public int SharePointFileId { get; set; } - - [Column("SharePointFileGUID")] - public Guid SharePointFileGuid { get; set; } - - [Column("SharePointFileSiteID")] - public int SharePointFileSiteId { get; set; } - - [StringLength(150)] - public string SharePointFileName { get; set; } = null!; - - [StringLength(150)] - public string? SharePointFileExtension { get; set; } - - [StringLength(255)] - public string? SharePointFileMimeType { get; set; } - - [Column("SharePointFileETag")] - [StringLength(255)] - public string? SharePointFileEtag { get; set; } - - public long SharePointFileSize { get; set; } - - public DateTime SharePointFileServerLastModified { get; set; } - - [Column("SharePointFileServerRelativeURL")] - [StringLength(300)] - public string SharePointFileServerRelativeUrl { get; set; } = null!; - - [Column("SharePointFileSharePointLibraryID")] - public int SharePointFileSharePointLibraryId { get; set; } - - public byte[]? SharePointFileBinary { get; set; } - - [ForeignKey("SharePointFileSharePointLibraryId")] - [InverseProperty("SharePointSharePointFiles")] - public virtual SharePointSharePointLibrary SharePointFileSharePointLibrary { get; set; } = null!; - - [ForeignKey("SharePointFileSiteId")] - [InverseProperty("SharePointSharePointFiles")] - public virtual CmsSite SharePointFileSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/SharePointSharePointLibrary.cs b/Migration.Toolkit.KX13/Models/SharePointSharePointLibrary.cs deleted file mode 100644 index 3aa94dfa..00000000 --- a/Migration.Toolkit.KX13/Models/SharePointSharePointLibrary.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SharePoint_SharePointLibrary")] -[Index("SharePointLibrarySharePointConnectionId", Name = "IX_SharePoint_SharePointLibrary_SharePointLibrarySharepointConnectionID")] -[Index("SharePointLibrarySiteId", Name = "IX_SharePoint_SharePointLibrary_SharePointlibrarySiteID")] -public class SharePointSharePointLibrary -{ - [Key] - [Column("SharePointLibraryID")] - public int SharePointLibraryId { get; set; } - - [StringLength(100)] - public string SharePointLibraryName { get; set; } = null!; - - [Column("SharePointLibrarySharePointConnectionID")] - public int? SharePointLibrarySharePointConnectionId { get; set; } - - [StringLength(100)] - public string SharePointLibraryListTitle { get; set; } = null!; - - public int SharePointLibrarySynchronizationPeriod { get; set; } - - [Column("SharePointLibraryGUID")] - public Guid SharePointLibraryGuid { get; set; } - - [Column("SharePointLibrarySiteID")] - public int SharePointLibrarySiteId { get; set; } - - [StringLength(100)] - public string SharePointLibraryDisplayName { get; set; } = null!; - - public DateTime SharePointLibraryLastModified { get; set; } - - public int SharePointLibraryListType { get; set; } - - [ForeignKey("SharePointLibrarySharePointConnectionId")] - [InverseProperty("SharePointSharePointLibraries")] - public virtual SharePointSharePointConnection? SharePointLibrarySharePointConnection { get; set; } - - [ForeignKey("SharePointLibrarySiteId")] - [InverseProperty("SharePointSharePointLibraries")] - public virtual CmsSite SharePointLibrarySite { get; set; } = null!; - - [InverseProperty("SharePointFileSharePointLibrary")] - public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/SmFacebookAccount.cs b/Migration.Toolkit.KX13/Models/SmFacebookAccount.cs deleted file mode 100644 index 3f2f6f20..00000000 --- a/Migration.Toolkit.KX13/Models/SmFacebookAccount.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_FacebookAccount")] -[Index("FacebookAccountFacebookApplicationId", Name = "IX_SM_FacebookAccount_FacebookAccountFacebookApplicationID")] -[Index("FacebookAccountSiteId", Name = "IX_SM_FacebookAccount_FacebookAccountSiteID")] -public class SmFacebookAccount -{ - [Key] - [Column("FacebookAccountID")] - public int FacebookAccountId { get; set; } - - [Column("FacebookAccountGUID")] - public Guid FacebookAccountGuid { get; set; } - - public DateTime FacebookAccountLastModified { get; set; } - - [Column("FacebookAccountSiteID")] - public int FacebookAccountSiteId { get; set; } - - [StringLength(200)] - public string FacebookAccountName { get; set; } = null!; - - [StringLength(200)] - public string FacebookAccountDisplayName { get; set; } = null!; - - [Column("FacebookAccountPageID")] - [StringLength(500)] - public string FacebookAccountPageId { get; set; } = null!; - - public string FacebookAccountPageAccessToken { get; set; } = null!; - - [Column("FacebookAccountFacebookApplicationID")] - public int FacebookAccountFacebookApplicationId { get; set; } - - public DateTime? FacebookAccountPageAccessTokenExpiration { get; set; } - - public bool? FacebookAccountIsDefault { get; set; } - - [ForeignKey("FacebookAccountFacebookApplicationId")] - [InverseProperty("SmFacebookAccounts")] - public virtual SmFacebookApplication FacebookAccountFacebookApplication { get; set; } = null!; - - [ForeignKey("FacebookAccountSiteId")] - [InverseProperty("SmFacebookAccounts")] - public virtual CmsSite FacebookAccountSite { get; set; } = null!; - - [InverseProperty("FacebookPostFacebookAccount")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/SmFacebookApplication.cs b/Migration.Toolkit.KX13/Models/SmFacebookApplication.cs deleted file mode 100644 index 35511549..00000000 --- a/Migration.Toolkit.KX13/Models/SmFacebookApplication.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_FacebookApplication")] -[Index("FacebookApplicationSiteId", Name = "IX_SM_FacebookApplication_FacebookApplicationSiteID")] -public class SmFacebookApplication -{ - [Key] - [Column("FacebookApplicationID")] - public int FacebookApplicationId { get; set; } - - [StringLength(500)] - public string FacebookApplicationConsumerKey { get; set; } = null!; - - [StringLength(500)] - public string FacebookApplicationConsumerSecret { get; set; } = null!; - - [StringLength(200)] - public string FacebookApplicationName { get; set; } = null!; - - [StringLength(200)] - public string FacebookApplicationDisplayName { get; set; } = null!; - - [Column("FacebookApplicationGUID")] - public Guid FacebookApplicationGuid { get; set; } - - public DateTime FacebookApplicationLastModified { get; set; } - - [Column("FacebookApplicationSiteID")] - public int FacebookApplicationSiteId { get; set; } - - [ForeignKey("FacebookApplicationSiteId")] - [InverseProperty("SmFacebookApplications")] - public virtual CmsSite FacebookApplicationSite { get; set; } = null!; - - [InverseProperty("FacebookAccountFacebookApplication")] - public virtual ICollection SmFacebookAccounts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/SmFacebookPost.cs b/Migration.Toolkit.KX13/Models/SmFacebookPost.cs deleted file mode 100644 index 69c3dac7..00000000 --- a/Migration.Toolkit.KX13/Models/SmFacebookPost.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_FacebookPost")] -[Index("FacebookPostCampaignId", Name = "IX_SM_FacebookPost_FacebookPostCampaignID")] -[Index("FacebookPostFacebookAccountId", Name = "IX_SM_FacebookPost_FacebookPostFacebookAccountID")] -[Index("FacebookPostSiteId", Name = "IX_SM_FacebookPost_FacebookPostSiteID")] -public class SmFacebookPost -{ - [Key] - [Column("FacebookPostID")] - public int FacebookPostId { get; set; } - - [Column("FacebookPostGUID")] - public Guid FacebookPostGuid { get; set; } - - public DateTime FacebookPostLastModified { get; set; } - - [Column("FacebookPostSiteID")] - public int FacebookPostSiteId { get; set; } - - [Column("FacebookPostFacebookAccountID")] - public int FacebookPostFacebookAccountId { get; set; } - - public string FacebookPostText { get; set; } = null!; - - [Column("FacebookPostURLShortenerType")] - public int? FacebookPostUrlshortenerType { get; set; } - - public int? FacebookPostErrorCode { get; set; } - - public int? FacebookPostErrorSubcode { get; set; } - - [Column("FacebookPostExternalID")] - public string? FacebookPostExternalId { get; set; } - - public DateTime? FacebookPostPublishedDateTime { get; set; } - - public DateTime? FacebookPostScheduledPublishDateTime { get; set; } - - [Column("FacebookPostCampaignID")] - public int? FacebookPostCampaignId { get; set; } - - public bool? FacebookPostPostAfterDocumentPublish { get; set; } - - public int? FacebookPostInsightPeopleReached { get; set; } - - public int? FacebookPostInsightLikesFromPage { get; set; } - - public int? FacebookPostInsightCommentsFromPage { get; set; } - - public int? FacebookPostInsightSharesFromPage { get; set; } - - public int? FacebookPostInsightLikesTotal { get; set; } - - public int? FacebookPostInsightCommentsTotal { get; set; } - - public int? FacebookPostInsightNegativeHidePost { get; set; } - - public int? FacebookPostInsightNegativeHideAllPosts { get; set; } - - public int? FacebookPostInsightNegativeReportSpam { get; set; } - - public int? FacebookPostInsightNegativeUnlikePage { get; set; } - - public DateTime? FacebookPostInsightsLastUpdated { get; set; } - - [Column("FacebookPostDocumentGUID")] - public Guid? FacebookPostDocumentGuid { get; set; } - - public bool? FacebookPostIsCreatedByUser { get; set; } - - [ForeignKey("FacebookPostCampaignId")] - [InverseProperty("SmFacebookPosts")] - public virtual AnalyticsCampaign? FacebookPostCampaign { get; set; } - - [ForeignKey("FacebookPostFacebookAccountId")] - [InverseProperty("SmFacebookPosts")] - public virtual SmFacebookAccount FacebookPostFacebookAccount { get; set; } = null!; - - [ForeignKey("FacebookPostSiteId")] - [InverseProperty("SmFacebookPosts")] - public virtual CmsSite FacebookPostSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/SmInsight.cs b/Migration.Toolkit.KX13/Models/SmInsight.cs deleted file mode 100644 index 71868dba..00000000 --- a/Migration.Toolkit.KX13/Models/SmInsight.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_Insight")] -[Index("InsightCodeName", "InsightPeriodType", Name = "IX_SM_Insight_InsightCodeName_InsightPeriodType")] -public class SmInsight -{ - [Key] - [Column("InsightID")] - public int InsightId { get; set; } - - [StringLength(200)] - public string InsightCodeName { get; set; } = null!; - - [Column("InsightExternalID")] - public string InsightExternalId { get; set; } = null!; - - [StringLength(20)] - public string InsightPeriodType { get; set; } = null!; - - public string? InsightValueName { get; set; } - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitDays { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitMonths { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitWeeks { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitYears { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/SmInsightHitDay.cs b/Migration.Toolkit.KX13/Models/SmInsightHitDay.cs deleted file mode 100644 index a28f2ba8..00000000 --- a/Migration.Toolkit.KX13/Models/SmInsightHitDay.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_InsightHit_Day")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Day_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public class SmInsightHitDay -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitDays")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/SmInsightHitMonth.cs b/Migration.Toolkit.KX13/Models/SmInsightHitMonth.cs deleted file mode 100644 index 6237d884..00000000 --- a/Migration.Toolkit.KX13/Models/SmInsightHitMonth.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_InsightHit_Month")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Month_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public class SmInsightHitMonth -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitMonths")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/SmInsightHitWeek.cs b/Migration.Toolkit.KX13/Models/SmInsightHitWeek.cs deleted file mode 100644 index f06ebd62..00000000 --- a/Migration.Toolkit.KX13/Models/SmInsightHitWeek.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_InsightHit_Week")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Week_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public class SmInsightHitWeek -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitWeeks")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/SmInsightHitYear.cs b/Migration.Toolkit.KX13/Models/SmInsightHitYear.cs deleted file mode 100644 index 02539f39..00000000 --- a/Migration.Toolkit.KX13/Models/SmInsightHitYear.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_InsightHit_Year")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Year_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public class SmInsightHitYear -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitYears")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/SmLinkedInAccount.cs b/Migration.Toolkit.KX13/Models/SmLinkedInAccount.cs deleted file mode 100644 index 2c9c7b36..00000000 --- a/Migration.Toolkit.KX13/Models/SmLinkedInAccount.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_LinkedInAccount")] -public class SmLinkedInAccount -{ - [Key] - [Column("LinkedInAccountID")] - public int LinkedInAccountId { get; set; } - - [StringLength(200)] - public string LinkedInAccountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string LinkedInAccountName { get; set; } = null!; - - public bool? LinkedInAccountIsDefault { get; set; } - - [StringLength(500)] - public string LinkedInAccountAccessToken { get; set; } = null!; - - public DateTime LinkedInAccountLastModified { get; set; } - - [Column("LinkedInAccountGUID")] - public Guid LinkedInAccountGuid { get; set; } - - [Column("LinkedInAccountSiteID")] - public int LinkedInAccountSiteId { get; set; } - - [Column("LinkedInAccountProfileID")] - [StringLength(50)] - public string LinkedInAccountProfileId { get; set; } = null!; - - [Column("LinkedInAccountLinkedInApplicationID")] - public int LinkedInAccountLinkedInApplicationId { get; set; } - - [StringLength(200)] - public string? LinkedInAccountProfileName { get; set; } - - public DateTime? LinkedInAccountAccessTokenExpiration { get; set; } - - [InverseProperty("LinkedInPostLinkedInAccount")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/SmLinkedInApplication.cs b/Migration.Toolkit.KX13/Models/SmLinkedInApplication.cs deleted file mode 100644 index 3783c570..00000000 --- a/Migration.Toolkit.KX13/Models/SmLinkedInApplication.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_LinkedInApplication")] -[Index("LinkedInApplicationSiteId", Name = "IX_SM_LinkedInApplication_LinkedInApplicationSiteID")] -public class SmLinkedInApplication -{ - [Key] - [Column("LinkedInApplicationID")] - public int LinkedInApplicationId { get; set; } - - [StringLength(200)] - public string LinkedInApplicationDisplayName { get; set; } = null!; - - [StringLength(200)] - public string LinkedInApplicationName { get; set; } = null!; - - [StringLength(500)] - public string LinkedInApplicationConsumerSecret { get; set; } = null!; - - [StringLength(500)] - public string LinkedInApplicationConsumerKey { get; set; } = null!; - - public DateTime LinkedInApplicationLastModified { get; set; } - - [Column("LinkedInApplicationGUID")] - public Guid LinkedInApplicationGuid { get; set; } - - [Column("LinkedInApplicationSiteID")] - public int LinkedInApplicationSiteId { get; set; } - - [ForeignKey("LinkedInApplicationSiteId")] - [InverseProperty("SmLinkedInApplications")] - public virtual CmsSite LinkedInApplicationSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/SmLinkedInPost.cs b/Migration.Toolkit.KX13/Models/SmLinkedInPost.cs deleted file mode 100644 index 80644944..00000000 --- a/Migration.Toolkit.KX13/Models/SmLinkedInPost.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_LinkedInPost")] -[Index("LinkedInPostCampaignId", Name = "IX_SM_LinkedInPost_LinkedInPostCampaignID")] -[Index("LinkedInPostLinkedInAccountId", Name = "IX_SM_LinkedInPost_LinkedInPostLinkedInAccountID")] -[Index("LinkedInPostSiteId", Name = "IX_SM_LinkedInPost_LinkedInPostSiteID")] -public class SmLinkedInPost -{ - [Key] - [Column("LinkedInPostID")] - public int LinkedInPostId { get; set; } - - [Column("LinkedInPostLinkedInAccountID")] - public int LinkedInPostLinkedInAccountId { get; set; } - - [StringLength(700)] - public string LinkedInPostComment { get; set; } = null!; - - [Column("LinkedInPostSiteID")] - public int LinkedInPostSiteId { get; set; } - - [Column("LinkedInPostGUID")] - public Guid LinkedInPostGuid { get; set; } - - public DateTime? LinkedInPostLastModified { get; set; } - - [StringLength(200)] - public string? LinkedInPostUpdateKey { get; set; } - - [Column("LinkedInPostURLShortenerType")] - public int? LinkedInPostUrlshortenerType { get; set; } - - public DateTime? LinkedInPostScheduledPublishDateTime { get; set; } - - [Column("LinkedInPostCampaignID")] - public int? LinkedInPostCampaignId { get; set; } - - public DateTime? LinkedInPostPublishedDateTime { get; set; } - - [Column("LinkedInPostHTTPStatusCode")] - public int? LinkedInPostHttpstatusCode { get; set; } - - public int? LinkedInPostErrorCode { get; set; } - - public string? LinkedInPostErrorMessage { get; set; } - - [Column("LinkedInPostDocumentGUID")] - public Guid? LinkedInPostDocumentGuid { get; set; } - - public bool? LinkedInPostIsCreatedByUser { get; set; } - - public bool? LinkedInPostPostAfterDocumentPublish { get; set; } - - public DateTime? LinkedInPostInsightsLastUpdated { get; set; } - - public int? LinkedInPostCommentCount { get; set; } - - public int? LinkedInPostImpressionCount { get; set; } - - public int? LinkedInPostLikeCount { get; set; } - - public int? LinkedInPostShareCount { get; set; } - - public int? LinkedInPostClickCount { get; set; } - - public double? LinkedInPostEngagement { get; set; } - - [ForeignKey("LinkedInPostCampaignId")] - [InverseProperty("SmLinkedInPosts")] - public virtual AnalyticsCampaign? LinkedInPostCampaign { get; set; } - - [ForeignKey("LinkedInPostLinkedInAccountId")] - [InverseProperty("SmLinkedInPosts")] - public virtual SmLinkedInAccount LinkedInPostLinkedInAccount { get; set; } = null!; - - [ForeignKey("LinkedInPostSiteId")] - [InverseProperty("SmLinkedInPosts")] - public virtual CmsSite LinkedInPostSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/SmTwitterAccount.cs b/Migration.Toolkit.KX13/Models/SmTwitterAccount.cs deleted file mode 100644 index 2e920ef8..00000000 --- a/Migration.Toolkit.KX13/Models/SmTwitterAccount.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_TwitterAccount")] -[Index("TwitterAccountSiteId", Name = "IX_SM_TwitterAccount_TwitterAccountSiteID")] -[Index("TwitterAccountTwitterApplicationId", Name = "IX_SM_TwitterAccount_TwitterAccountTwitterApplicationID")] -public class SmTwitterAccount -{ - [Key] - [Column("TwitterAccountID")] - public int TwitterAccountId { get; set; } - - [StringLength(200)] - public string TwitterAccountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TwitterAccountName { get; set; } = null!; - - public DateTime TwitterAccountLastModified { get; set; } - - [Column("TwitterAccountGUID")] - public Guid TwitterAccountGuid { get; set; } - - [Column("TwitterAccountSiteID")] - public int TwitterAccountSiteId { get; set; } - - [StringLength(500)] - public string TwitterAccountAccessToken { get; set; } = null!; - - [StringLength(500)] - public string TwitterAccountAccessTokenSecret { get; set; } = null!; - - [Column("TwitterAccountTwitterApplicationID")] - public int TwitterAccountTwitterApplicationId { get; set; } - - public int? TwitterAccountFollowers { get; set; } - - public int? TwitterAccountMentions { get; set; } - - [StringLength(40)] - public string? TwitterAccountMentionsRange { get; set; } - - [Column("TwitterAccountUserID")] - [StringLength(20)] - public string? TwitterAccountUserId { get; set; } - - public bool? TwitterAccountIsDefault { get; set; } - - [InverseProperty("TwitterPostTwitterAccount")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); - - [ForeignKey("TwitterAccountSiteId")] - [InverseProperty("SmTwitterAccounts")] - public virtual CmsSite TwitterAccountSite { get; set; } = null!; - - [ForeignKey("TwitterAccountTwitterApplicationId")] - [InverseProperty("SmTwitterAccounts")] - public virtual SmTwitterApplication TwitterAccountTwitterApplication { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/SmTwitterApplication.cs b/Migration.Toolkit.KX13/Models/SmTwitterApplication.cs deleted file mode 100644 index 6d451e34..00000000 --- a/Migration.Toolkit.KX13/Models/SmTwitterApplication.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_TwitterApplication")] -[Index("TwitterApplicationSiteId", Name = "IX_SM_TwitterApplication_TwitterApplicationSiteID")] -public class SmTwitterApplication -{ - [Key] - [Column("TwitterApplicationID")] - public int TwitterApplicationId { get; set; } - - [StringLength(200)] - public string TwitterApplicationDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TwitterApplicationName { get; set; } = null!; - - public DateTime TwitterApplicationLastModified { get; set; } - - [Column("TwitterApplicationGUID")] - public Guid TwitterApplicationGuid { get; set; } - - [Column("TwitterApplicationSiteID")] - public int TwitterApplicationSiteId { get; set; } - - [StringLength(500)] - public string TwitterApplicationConsumerKey { get; set; } = null!; - - [StringLength(500)] - public string TwitterApplicationConsumerSecret { get; set; } = null!; - - [InverseProperty("TwitterAccountTwitterApplication")] - public virtual ICollection SmTwitterAccounts { get; set; } = new List(); - - [ForeignKey("TwitterApplicationSiteId")] - [InverseProperty("SmTwitterApplications")] - public virtual CmsSite TwitterApplicationSite { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/SmTwitterPost.cs b/Migration.Toolkit.KX13/Models/SmTwitterPost.cs deleted file mode 100644 index ccf0838e..00000000 --- a/Migration.Toolkit.KX13/Models/SmTwitterPost.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_TwitterPost")] -[Index("TwitterPostCampaignId", Name = "IX_SM_TwitterPost_TwitterPostCampaignID")] -[Index("TwitterPostSiteId", Name = "IX_SM_TwitterPost_TwitterPostSiteID")] -[Index("TwitterPostTwitterAccountId", Name = "IX_SM_TwitterPost_TwitterPostTwitterAccountID")] -public class SmTwitterPost -{ - [Key] - [Column("TwitterPostID")] - public int TwitterPostId { get; set; } - - [Column("TwitterPostGUID")] - public Guid TwitterPostGuid { get; set; } - - public DateTime TwitterPostLastModified { get; set; } - - [Column("TwitterPostSiteID")] - public int TwitterPostSiteId { get; set; } - - [Column("TwitterPostTwitterAccountID")] - public int TwitterPostTwitterAccountId { get; set; } - - public string TwitterPostText { get; set; } = null!; - - [Column("TwitterPostURLShortenerType")] - public int? TwitterPostUrlshortenerType { get; set; } - - [Column("TwitterPostExternalID")] - public string? TwitterPostExternalId { get; set; } - - public int? TwitterPostErrorCode { get; set; } - - public DateTime? TwitterPostPublishedDateTime { get; set; } - - public DateTime? TwitterPostScheduledPublishDateTime { get; set; } - - [Column("TwitterPostCampaignID")] - public int? TwitterPostCampaignId { get; set; } - - public int? TwitterPostFavorites { get; set; } - - public int? TwitterPostRetweets { get; set; } - - public bool? TwitterPostPostAfterDocumentPublish { get; set; } - - public DateTime? TwitterPostInsightsUpdateDateTime { get; set; } - - [Column("TwitterPostDocumentGUID")] - public Guid? TwitterPostDocumentGuid { get; set; } - - public bool? TwitterPostIsCreatedByUser { get; set; } - - [ForeignKey("TwitterPostCampaignId")] - [InverseProperty("SmTwitterPosts")] - public virtual AnalyticsCampaign? TwitterPostCampaign { get; set; } - - [ForeignKey("TwitterPostSiteId")] - [InverseProperty("SmTwitterPosts")] - public virtual CmsSite TwitterPostSite { get; set; } = null!; - - [ForeignKey("TwitterPostTwitterAccountId")] - [InverseProperty("SmTwitterPosts")] - public virtual SmTwitterAccount TwitterPostTwitterAccount { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/StagingServer.cs b/Migration.Toolkit.KX13/Models/StagingServer.cs deleted file mode 100644 index 018b5bcb..00000000 --- a/Migration.Toolkit.KX13/Models/StagingServer.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Staging_Server")] -[Index("ServerEnabled", Name = "IX_Staging_Server_ServerEnabled")] -[Index("ServerSiteId", Name = "IX_Staging_Server_ServerSiteID")] -public class StagingServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(100)] - public string ServerName { get; set; } = null!; - - [StringLength(440)] - public string ServerDisplayName { get; set; } = null!; - - [Column("ServerSiteID")] - public int ServerSiteId { get; set; } - - [Column("ServerURL")] - [StringLength(450)] - public string ServerUrl { get; set; } = null!; - - [Required] - public bool? ServerEnabled { get; set; } - - [StringLength(20)] - public string ServerAuthentication { get; set; } = null!; - - [StringLength(100)] - public string? ServerUsername { get; set; } - - [StringLength(100)] - public string? ServerPassword { get; set; } - - [Column("ServerX509ClientKeyID")] - [StringLength(200)] - public string? ServerX509clientKeyId { get; set; } - - [Column("ServerX509ServerKeyID")] - [StringLength(200)] - public string? ServerX509serverKeyId { get; set; } - - [Column("ServerGUID")] - public Guid ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - [ForeignKey("ServerSiteId")] - [InverseProperty("StagingServers")] - public virtual CmsSite ServerSite { get; set; } = null!; - - [InverseProperty("SynchronizationServer")] - public virtual ICollection StagingSynchronizations { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/StagingSynchronization.cs b/Migration.Toolkit.KX13/Models/StagingSynchronization.cs deleted file mode 100644 index d9f8ded1..00000000 --- a/Migration.Toolkit.KX13/Models/StagingSynchronization.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Staging_Synchronization")] -[Index("SynchronizationServerId", Name = "IX_Staging_Synchronization_SynchronizationServerID")] -[Index("SynchronizationTaskId", Name = "IX_Staging_Synchronization_SynchronizationTaskID")] -public class StagingSynchronization -{ - [Key] - [Column("SynchronizationID")] - public int SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int SynchronizationTaskId { get; set; } - - [Column("SynchronizationServerID")] - public int SynchronizationServerId { get; set; } - - public DateTime? SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - [ForeignKey("SynchronizationServerId")] - [InverseProperty("StagingSynchronizations")] - public virtual StagingServer SynchronizationServer { get; set; } = null!; - - [ForeignKey("SynchronizationTaskId")] - [InverseProperty("StagingSynchronizations")] - public virtual StagingTask SynchronizationTask { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/StagingTask.cs b/Migration.Toolkit.KX13/Models/StagingTask.cs deleted file mode 100644 index 1d291cd1..00000000 --- a/Migration.Toolkit.KX13/Models/StagingTask.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Staging_Task")] -[Index("TaskDocumentId", "TaskNodeId", "TaskRunning", Name = "IX_Staging_Task_TaskDocumentID_TaskNodeID_TaskRunning")] -[Index("TaskObjectType", "TaskObjectId", "TaskRunning", Name = "IX_Staging_Task_TaskObjectType_TaskObjectID_TaskRunning")] -[Index("TaskSiteId", Name = "IX_Staging_Task_TaskSiteID")] -[Index("TaskType", Name = "IX_Staging_Task_TaskType")] -public class StagingTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - [StringLength(450)] - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool? TaskRunning { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - public string? TaskServers { get; set; } - - [InverseProperty("SynchronizationTask")] - public virtual ICollection StagingSynchronizations { get; set; } = new List(); - - [InverseProperty("Task")] - public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); - - [InverseProperty("Task")] - public virtual ICollection StagingTaskUsers { get; set; } = new List(); - - [ForeignKey("TaskSiteId")] - [InverseProperty("StagingTasks")] - public virtual CmsSite? TaskSite { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/StagingTaskGroup.cs b/Migration.Toolkit.KX13/Models/StagingTaskGroup.cs deleted file mode 100644 index 182c2598..00000000 --- a/Migration.Toolkit.KX13/Models/StagingTaskGroup.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("staging_TaskGroup")] -public class StagingTaskGroup -{ - [Key] - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [StringLength(50)] - public string TaskGroupCodeName { get; set; } = null!; - - public Guid TaskGroupGuid { get; set; } - - public string? TaskGroupDescription { get; set; } - - [InverseProperty("TaskGroup")] - public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); - - [InverseProperty("TaskGroup")] - public virtual ICollection StagingTaskGroupUsers { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KX13/Models/StagingTaskGroupTask.cs b/Migration.Toolkit.KX13/Models/StagingTaskGroupTask.cs deleted file mode 100644 index 3c37eb80..00000000 --- a/Migration.Toolkit.KX13/Models/StagingTaskGroupTask.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("staging_TaskGroupTask")] -[Index("TaskGroupId", Name = "IX_Staging_TaskGroupTask_TaskGroupID")] -[Index("TaskId", Name = "IX_Staging_TaskGroupTask_TaskID")] -public class StagingTaskGroupTask -{ - [Key] - [Column("TaskGroupTaskID")] - public int TaskGroupTaskId { get; set; } - - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [ForeignKey("TaskId")] - [InverseProperty("StagingTaskGroupTasks")] - public virtual StagingTask Task { get; set; } = null!; - - [ForeignKey("TaskGroupId")] - [InverseProperty("StagingTaskGroupTasks")] - public virtual StagingTaskGroup TaskGroup { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/StagingTaskGroupUser.cs b/Migration.Toolkit.KX13/Models/StagingTaskGroupUser.cs deleted file mode 100644 index 40c9024c..00000000 --- a/Migration.Toolkit.KX13/Models/StagingTaskGroupUser.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("staging_TaskGroupUser")] -[Index("TaskGroupId", Name = "IX_Staging_TaskGroupUser_TaskGroup_ID")] -[Index("UserId", Name = "IX_Staging_TaskGroupUser_UserID", IsUnique = true)] -public class StagingTaskGroupUser -{ - [Key] - [Column("TaskGroupUserID")] - public int TaskGroupUserId { get; set; } - - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("TaskGroupId")] - [InverseProperty("StagingTaskGroupUsers")] - public virtual StagingTaskGroup TaskGroup { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("StagingTaskGroupUser")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/StagingTaskUser.cs b/Migration.Toolkit.KX13/Models/StagingTaskUser.cs deleted file mode 100644 index 358f10f7..00000000 --- a/Migration.Toolkit.KX13/Models/StagingTaskUser.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Staging_TaskUser")] -[Index("TaskId", Name = "IX_Staging_TaskUser_TaskID")] -[Index("UserId", Name = "IX_Staging_TaskUser_UserID")] -public class StagingTaskUser -{ - [Key] - [Column("TaskUserID")] - public int TaskUserId { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("TaskId")] - [InverseProperty("StagingTaskUsers")] - public virtual StagingTask Task { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("StagingTaskUsers")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/TempFile.cs b/Migration.Toolkit.KX13/Models/TempFile.cs deleted file mode 100644 index ff2d5722..00000000 --- a/Migration.Toolkit.KX13/Models/TempFile.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Temp_File")] -public class TempFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileParentGUID")] - public Guid FileParentGuid { get; set; } - - public int FileNumber { get; set; } - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - public long FileSize { get; set; } - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - public byte[]? FileBinary { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - public DateTime FileLastModified { get; set; } - - [StringLength(200)] - public string FileDirectory { get; set; } = null!; - - [StringLength(200)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string? FileTitle { get; set; } - - public string? FileDescription { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/TempPageBuilderWidget.cs b/Migration.Toolkit.KX13/Models/TempPageBuilderWidget.cs deleted file mode 100644 index 0894e4f9..00000000 --- a/Migration.Toolkit.KX13/Models/TempPageBuilderWidget.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Temp_PageBuilderWidgets")] -public class TempPageBuilderWidget -{ - [Key] - [Column("PageBuilderWidgetsID")] - public int PageBuilderWidgetsId { get; set; } - - public string? PageBuilderWidgetsConfiguration { get; set; } - - public Guid PageBuilderWidgetsGuid { get; set; } - - public DateTime PageBuilderWidgetsLastModified { get; set; } - - public string? PageBuilderTemplateConfiguration { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsAclitemItemsAndOperator.cs b/Migration.Toolkit.KX13/Models/ViewCmsAclitemItemsAndOperator.cs deleted file mode 100644 index 03cd666f..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsAclitemItemsAndOperator.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsAclitemItemsAndOperator -{ - [Column("ACLOwnerNodeID")] - public int AclownerNodeId { get; set; } - - [Column("ACLItemID")] - public int AclitemId { get; set; } - - public int Allowed { get; set; } - - public int Denied { get; set; } - - [StringLength(51)] - public string? Operator { get; set; } - - [StringLength(100)] - public string? OperatorName { get; set; } - - [Column("ACLID")] - public int Aclid { get; set; } - - [StringLength(450)] - public string? OperatorFullName { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [Column("RoleID")] - public int? RoleId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs deleted file mode 100644 index c86109f8..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsObjectVersionHistoryUserJoined -{ - [Column("VersionID")] - public int VersionId { get; set; } - - [Column("VersionObjectID")] - public int? VersionObjectId { get; set; } - - [StringLength(100)] - public string VersionObjectType { get; set; } = null!; - - [Column("VersionObjectSiteID")] - public int? VersionObjectSiteId { get; set; } - - [StringLength(450)] - public string VersionObjectDisplayName { get; set; } = null!; - - [Column("VersionXML")] - public string VersionXml { get; set; } = null!; - - [Column("VersionBinaryDataXML")] - public string? VersionBinaryDataXml { get; set; } - - [Column("VersionModifiedByUserID")] - public int? VersionModifiedByUserId { get; set; } - - public DateTime VersionModifiedWhen { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [StringLength(50)] - public string VersionNumber { get; set; } = null!; - - [Column("VersionSiteBindingIDs")] - public string? VersionSiteBindingIds { get; set; } - - public string? VersionComment { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(100)] - public string? UserName { get; set; } - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string? UserPassword { get; set; } - - [StringLength(50)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(50)] - public string? PreferredUicultureCode { get; set; } - - public bool? UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid? UserGuid { get; set; } - - public DateTime? UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int? UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs deleted file mode 100644 index 047f1150..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsPageTemplateCategoryPageTemplateJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(200)] - public string? CodeName { get; set; } - - [StringLength(200)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryTemplateChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [StringLength(20)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; - - [StringLength(10)] - public string? PageTemplateType { get; set; } - - [StringLength(200)] - public string? PageTemplateIconClass { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsRelationshipJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsRelationshipJoined.cs deleted file mode 100644 index 0621665e..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsRelationshipJoined.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsRelationshipJoined -{ - [Column("LeftNodeID")] - public int LeftNodeId { get; set; } - - [Column("LeftNodeGUID")] - public Guid LeftNodeGuid { get; set; } - - [StringLength(100)] - public string LeftNodeName { get; set; } = null!; - - [Column("LeftNodeSiteID")] - public int LeftNodeSiteId { get; set; } - - [StringLength(200)] - public string RelationshipName { get; set; } = null!; - - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - [Column("RightNodeID")] - public int RightNodeId { get; set; } - - [Column("RightNodeGUID")] - public Guid RightNodeGuid { get; set; } - - [StringLength(100)] - public string RightNodeName { get; set; } = null!; - - [Column("RightNodeSiteID")] - public int RightNodeSiteId { get; set; } - - [StringLength(200)] - public string RelationshipDisplayName { get; set; } = null!; - - public string? RelationshipCustomData { get; set; } - - [Column("LeftClassID")] - public int LeftClassId { get; set; } - - [Column("RightClassID")] - public int RightClassId { get; set; } - - [Column("RelationshipID")] - public int RelationshipId { get; set; } - - public int? RelationshipOrder { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsResourceStringJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsResourceStringJoined.cs deleted file mode 100644 index 27255935..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsResourceStringJoined.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsResourceStringJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("TranslationID")] - public int? TranslationId { get; set; } - - [Column("TranslationStringID")] - public int? TranslationStringId { get; set; } - - [Column("TranslationCultureID")] - public int? TranslationCultureId { get; set; } - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int? CultureId { get; set; } - - [StringLength(200)] - public string? CultureName { get; set; } - - [StringLength(50)] - public string? CultureCode { get; set; } - - [Column("CultureGUID")] - public Guid? CultureGuid { get; set; } - - public DateTime? CultureLastModified { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsResourceTranslatedJoined.cs deleted file mode 100644 index 79765c88..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsResourceTranslatedJoined.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsResourceTranslatedJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs deleted file mode 100644 index a888854c..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsRoleResourcePermissionJoined -{ - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - [StringLength(100)] - public string PermissionName { get; set; } = null!; - - [Column("PermissionID")] - public int PermissionId { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsSiteDocumentCount.cs b/Migration.Toolkit.KX13/Models/ViewCmsSiteDocumentCount.cs deleted file mode 100644 index 1375f4a7..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsSiteDocumentCount.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsSiteDocumentCount -{ - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - [StringLength(200)] - public string SiteDisplayName { get; set; } = null!; - - public string? SiteDescription { get; set; } - - [StringLength(20)] - public string SiteStatus { get; set; } = null!; - - [StringLength(400)] - public string SiteDomainName { get; set; } = null!; - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - [Column("SiteGUID")] - public Guid SiteGuid { get; set; } - - public DateTime SiteLastModified { get; set; } - - [StringLength(400)] - public string SitePresentationUrl { get; set; } = null!; - - public int? Documents { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs deleted file mode 100644 index 6eaf84bd..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsSiteRoleResourceUielementJoined -{ - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(200)] - public string ElementName { get; set; } = null!; - - [StringLength(100)] - public string? SiteName { get; set; } - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - [Column("RoleSiteID")] - public int? RoleSiteId { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsTreeJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsTreeJoined.cs deleted file mode 100644 index 6cf9a512..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsTreeJoined.cs +++ /dev/null @@ -1,170 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsTreeJoined -{ - [StringLength(100)] - public string ClassName { get; set; } = null!; - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [Column("NodeID")] - public int NodeId { get; set; } - - [StringLength(450)] - public string NodeAliasPath { get; set; } = null!; - - [StringLength(100)] - public string NodeName { get; set; } = null!; - - [StringLength(50)] - public string NodeAlias { get; set; } = null!; - - [Column("NodeClassID")] - public int NodeClassId { get; set; } - - [Column("NodeParentID")] - public int? NodeParentId { get; set; } - - public int NodeLevel { get; set; } - - [Column("NodeACLID")] - public int? NodeAclid { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeGUID")] - public Guid NodeGuid { get; set; } - - public int? NodeOrder { get; set; } - - public bool? IsSecuredNode { get; set; } - - [Column("NodeSKUID")] - public int? NodeSkuid { get; set; } - - [Column("NodeLinkedNodeID")] - public int? NodeLinkedNodeId { get; set; } - - public int? NodeOwner { get; set; } - - public string? NodeCustomData { get; set; } - - [Column("NodeLinkedNodeSiteID")] - public int? NodeLinkedNodeSiteId { get; set; } - - public bool? NodeHasChildren { get; set; } - - public bool? NodeHasLinks { get; set; } - - [Column("NodeOriginalNodeID")] - public int? NodeOriginalNodeId { get; set; } - - [Column("NodeIsACLOwner")] - public bool NodeIsAclowner { get; set; } - - [Column("DocumentID")] - public int DocumentId { get; set; } - - [StringLength(100)] - public string DocumentName { get; set; } = null!; - - public DateTime? DocumentModifiedWhen { get; set; } - - [Column("DocumentModifiedByUserID")] - public int? DocumentModifiedByUserId { get; set; } - - public int? DocumentForeignKeyValue { get; set; } - - [Column("DocumentCreatedByUserID")] - public int? DocumentCreatedByUserId { get; set; } - - public DateTime? DocumentCreatedWhen { get; set; } - - [Column("DocumentCheckedOutByUserID")] - public int? DocumentCheckedOutByUserId { get; set; } - - public DateTime? DocumentCheckedOutWhen { get; set; } - - [Column("DocumentCheckedOutVersionHistoryID")] - public int? DocumentCheckedOutVersionHistoryId { get; set; } - - [Column("DocumentPublishedVersionHistoryID")] - public int? DocumentPublishedVersionHistoryId { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - public DateTime? DocumentPublishFrom { get; set; } - - public DateTime? DocumentPublishTo { get; set; } - - [StringLength(50)] - public string DocumentCulture { get; set; } = null!; - - [Column("DocumentNodeID")] - public int DocumentNodeId { get; set; } - - public string? DocumentPageTitle { get; set; } - - public string? DocumentPageKeyWords { get; set; } - - public string? DocumentPageDescription { get; set; } - - public string? DocumentContent { get; set; } - - public string? DocumentCustomData { get; set; } - - public string? DocumentTags { get; set; } - - [Column("DocumentTagGroupID")] - public int? DocumentTagGroupId { get; set; } - - public DateTime? DocumentLastPublished { get; set; } - - public bool? DocumentSearchExcluded { get; set; } - - [StringLength(50)] - public string? DocumentLastVersionNumber { get; set; } - - public bool? DocumentIsArchived { get; set; } - - [Column("DocumentGUID")] - public Guid? DocumentGuid { get; set; } - - [Column("DocumentWorkflowCycleGUID")] - public Guid? DocumentWorkflowCycleGuid { get; set; } - - public bool? DocumentIsWaitingForTranslation { get; set; } - - [Column("DocumentSKUName")] - [StringLength(440)] - public string? DocumentSkuname { get; set; } - - [Column("DocumentSKUDescription")] - public string? DocumentSkudescription { get; set; } - - [Column("DocumentSKUShortDescription")] - public string? DocumentSkushortDescription { get; set; } - - [StringLength(450)] - public string? DocumentWorkflowActionStatus { get; set; } - - public bool DocumentCanBePublished { get; set; } - - public string? DocumentPageBuilderWidgets { get; set; } - - public string? DocumentPageTemplateConfiguration { get; set; } - - [Column("DocumentABTestConfiguration")] - public string? DocumentAbtestConfiguration { get; set; } - - public bool DocumentShowInMenu { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUser.cs b/Migration.Toolkit.KX13/Models/ViewCmsUser.cs deleted file mode 100644 index d804da2f..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsUser.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsUser -{ - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(50)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(50)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [Column("UserSettingsID")] - public int? UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid? UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int? UserSettingsUserId { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarFileName { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserDocument.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserDocument.cs deleted file mode 100644 index 56f6cbeb..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserDocument.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsUserDocument -{ - [StringLength(100)] - public string? DocumentName { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeID")] - public int NodeId { get; set; } - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - public DateTime? DocumentModifiedWhen { get; set; } - - [StringLength(50)] - public string DocumentCulture { get; set; } = null!; - - [StringLength(200)] - public string? CultureName { get; set; } - - [Column("UserID1")] - public int? UserId1 { get; set; } - - [Column("UserID2")] - public int? UserId2 { get; set; } - - [Column("UserID3")] - public int? UserId3 { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - [StringLength(450)] - public string NodeAliasPath { get; set; } = null!; - - [StringLength(12)] - [Unicode(false)] - public string Type { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleJoined.cs deleted file mode 100644 index d0a9cf27..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleJoined.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsUserRoleJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(450)] - public string? FullName { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [StringLength(100)] - public string? SiteName { get; set; } - - [Column("SiteGUID")] - public Guid? SiteGuid { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRole.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRole.cs deleted file mode 100644 index 37f72e34..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRole.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsUserRoleMembershipRole -{ - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - public DateTime? ValidTo { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs deleted file mode 100644 index eedac5c0..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsUserRoleMembershipRoleValidOnlyJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserSettingsRoleJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserSettingsRoleJoined.cs deleted file mode 100644 index 88b85558..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserSettingsRoleJoined.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsUserSettingsRoleJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - public bool UserEnabled { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs deleted file mode 100644 index a4c2d2db..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsWebPartCategoryWebpartJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(100)] - public string CodeName { get; set; } = null!; - - [StringLength(100)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryWebPartChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [Column("WebPartParentID")] - public int? WebPartParentId { get; set; } - - [StringLength(100)] - public string? WebPartFileName { get; set; } - - [Column("WebPartGUID")] - public Guid? WebPartGuid { get; set; } - - public int? WebPartType { get; set; } - - [StringLength(1000)] - public string? WebPartDescription { get; set; } - - [StringLength(15)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; - - [Column("ThumbnailGUID")] - public Guid? ThumbnailGuid { get; set; } - - [StringLength(200)] - public string? IconClass { get; set; } - - public bool? WebPartSkipInsertProperties { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs deleted file mode 100644 index 28e6b0b9..00000000 --- a/Migration.Toolkit.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewCmsWidgetCategoryWidgetJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(100)] - public string CodeName { get; set; } = null!; - - [StringLength(100)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? WidgetCategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? WidgetCategoryChildCount { get; set; } - - public int? WidgetCategoryWidgetChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [Column("WidgetWebPartID")] - public int? WidgetWebPartId { get; set; } - - public int WidgetSecurity { get; set; } - - [Column("WidgetGUID")] - public Guid? WidgetGuid { get; set; } - - [StringLength(14)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs b/Migration.Toolkit.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs deleted file mode 100644 index 711fcab9..00000000 --- a/Migration.Toolkit.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewComSkuoptionCategoryOptionCategoryJoined -{ - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("CategoryID")] - public int CategoryId { get; set; } - - public bool? AllowAllOptions { get; set; } - - [Column("SKUCategoryID")] - public int SkucategoryId { get; set; } - - [Column("SKUCategoryOrder")] - public int? SkucategoryOrder { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryName { get; set; } = null!; - - [StringLength(200)] - public string CategorySelectionType { get; set; } = null!; - - [StringLength(200)] - public string? CategoryDefaultOptions { get; set; } - - public string? CategoryDescription { get; set; } - - [StringLength(200)] - public string? CategoryDefaultRecord { get; set; } - - public bool CategoryEnabled { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - public bool? CategoryDisplayPrice { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - public int? CategoryTextMaxLength { get; set; } - - [StringLength(20)] - public string? CategoryType { get; set; } - - public int? CategoryTextMinLength { get; set; } - - [StringLength(200)] - public string? CategoryLiveSiteDisplayName { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewIntegrationTaskJoined.cs b/Migration.Toolkit.KX13/Models/ViewIntegrationTaskJoined.cs deleted file mode 100644 index 58eb3ad5..00000000 --- a/Migration.Toolkit.KX13/Models/ViewIntegrationTaskJoined.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewIntegrationTaskJoined -{ - [Column("SynchronizationID")] - public int? SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int? SynchronizationTaskId { get; set; } - - [Column("SynchronizationConnectorID")] - public int? SynchronizationConnectorId { get; set; } - - public DateTime? SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - public bool? SynchronizationIsRunning { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - [StringLength(450)] - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool TaskIsInbound { get; set; } - - [StringLength(50)] - public string? TaskProcessType { get; set; } - - public string TaskData { get; set; } = null!; - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(50)] - public string? TaskDataType { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewMembershipMembershipUserJoined.cs b/Migration.Toolkit.KX13/Models/ViewMembershipMembershipUserJoined.cs deleted file mode 100644 index fb0c0702..00000000 --- a/Migration.Toolkit.KX13/Models/ViewMembershipMembershipUserJoined.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewMembershipMembershipUserJoined -{ - [StringLength(200)] - public string MembershipDisplayName { get; set; } = null!; - - [Column("MembershipID")] - public int MembershipId { get; set; } - - public DateTime? ValidTo { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [Column("MembershipSiteID")] - public int? MembershipSiteId { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewNewsletterSubscriptionsJoined.cs b/Migration.Toolkit.KX13/Models/ViewNewsletterSubscriptionsJoined.cs deleted file mode 100644 index afbbe77b..00000000 --- a/Migration.Toolkit.KX13/Models/ViewNewsletterSubscriptionsJoined.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewNewsletterSubscriptionsJoined -{ - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [StringLength(440)] - public string? SubscriberFullName { get; set; } - - [StringLength(254)] - public string? SubscriberEmail { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - [StringLength(100)] - public string? SubscriberType { get; set; } - - public int? SubscriberBounces { get; set; } - - [StringLength(250)] - public string NewsletterDisplayName { get; set; } = null!; - - [Column("SubscriberRelatedID")] - public int SubscriberRelatedId { get; set; } - - [Column("SubscriberNewsletterID")] - public int SubscriberNewsletterId { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Toolkit.KX13/Models/ViewOmAccountContactAccountJoined.cs deleted file mode 100644 index 2ba5828d..00000000 --- a/Migration.Toolkit.KX13/Models/ViewOmAccountContactAccountJoined.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewOmAccountContactAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewOmAccountContactContactJoined.cs b/Migration.Toolkit.KX13/Models/ViewOmAccountContactContactJoined.cs deleted file mode 100644 index 7e675184..00000000 --- a/Migration.Toolkit.KX13/Models/ViewOmAccountContactContactJoined.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewOmAccountContactContactJoined -{ - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewOmAccountJoined.cs b/Migration.Toolkit.KX13/Models/ViewOmAccountJoined.cs deleted file mode 100644 index 65e520e7..00000000 --- a/Migration.Toolkit.KX13/Models/ViewOmAccountJoined.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewOmAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [StringLength(100)] - public string? PrimaryContactFirstName { get; set; } - - [StringLength(100)] - public string? PrimaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? PrimaryContactLastName { get; set; } - - [StringLength(100)] - public string? SecondaryContactFirstName { get; set; } - - [StringLength(100)] - public string? SecondaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? SecondaryContactLastName { get; set; } - - [StringLength(200)] - public string? SubsidiaryOfName { get; set; } - - [StringLength(302)] - public string PrimaryContactFullName { get; set; } = null!; - - [StringLength(302)] - public string SecondaryContactFullName { get; set; } = null!; - - [StringLength(201)] - public string AccountFullAddress { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Toolkit.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs deleted file mode 100644 index f4de7652..00000000 --- a/Migration.Toolkit.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewOmContactGroupMemberAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } -} diff --git a/Migration.Toolkit.KX13/Models/ViewReportingCategoryReportJoined.cs b/Migration.Toolkit.KX13/Models/ViewReportingCategoryReportJoined.cs deleted file mode 100644 index 984638a0..00000000 --- a/Migration.Toolkit.KX13/Models/ViewReportingCategoryReportJoined.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public class ViewReportingCategoryReportJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(200)] - public string CodeName { get; set; } = null!; - - [StringLength(440)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(651)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryReportChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - public string? ReportLayout { get; set; } - - public string? ReportParameters { get; set; } - - public int? ReportAccess { get; set; } - - [StringLength(14)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; -} diff --git a/Migration.Toolkit.KX13/SettingsKeys.cs b/Migration.Toolkit.KX13/SettingsKeys.cs deleted file mode 100644 index 97e7489d..00000000 --- a/Migration.Toolkit.KX13/SettingsKeys.cs +++ /dev/null @@ -1,479 +0,0 @@ -// ReSharper disable InconsistentNaming -// ReSharper disable IdentifierTypo -namespace Migration.Toolkit.KX13; - -public static class SettingsKeys -{ - public const string CMSABTestingEnabled = "CMSABTestingEnabled"; - public const string CMSAdminEmailAddress = "CMSAdminEmailAddress"; - public const string CMSAllowAttachmentTranslation = "CMSAllowAttachmentTranslation"; - public const string CMSAllowDynamicNewsletters = "CMSAllowDynamicNewsletters"; - public const string CMSAllowedURLCharacters = "CMSAllowedURLCharacters"; - public const string CMSAllowGlobalCategories = "CMSAllowGlobalCategories"; - public const string CMSAllowPermanentPreviewLink = "CMSAllowPermanentPreviewLink"; - public const string CMSAlternativeURLsConstraint = "CMSAlternativeURLsConstraint"; - public const string CMSAlternativeURLsErrorMessage = "CMSAlternativeURLsErrorMessage"; - public const string CMSAlternativeURLsExcludedURLs = "CMSAlternativeURLsExcludedURLs"; - public const string CMSAlternativeURLsMode = "CMSAlternativeURLsMode"; - public const string CMSAlternativeUrlUIEnabled = "CMSAlternativeUrlUIEnabled"; - public const string CMSAnalyticsEnabled = "CMSAnalyticsEnabled"; - public const string CMSAnalyticsExcludedIPs = "CMSAnalyticsExcludedIPs"; - public const string CMSAnalyticsExcludedURLs = "CMSAnalyticsExcludedURLs"; - public const string CMSAnalyticsExcludeSearchEngines = "CMSAnalyticsExcludeSearchEngines"; - public const string CMSAnalyticsTrackBrowserTypes = "CMSAnalyticsTrackBrowserTypes"; - public const string CMSAnalyticsTrackCountries = "CMSAnalyticsTrackCountries"; - public const string CMSAnalyticsTrackInvalidPages = "CMSAnalyticsTrackInvalidPages"; - public const string CMSAnalyticsTrackPageViews = "CMSAnalyticsTrackPageViews"; - public const string CMSAnalyticsTrackReferrals = "CMSAnalyticsTrackReferrals"; - public const string CMSAnalyticsTrackVisits = "CMSAnalyticsTrackVisits"; - public const string CMSApplicationState = "CMSApplicationState"; - public const string CMSArchiveEmails = "CMSArchiveEmails"; - public const string CMSAuthorizeNETAPILogin = "CMSAuthorizeNETAPILogin"; - public const string CMSAuthorizeNETTransactionKey = "CMSAuthorizeNETTransactionKey"; - public const string CMSAuthorizeNETTransactionType = "CMSAuthorizeNETTransactionType"; - public const string CMSAutocompleteEnableForLogin = "CMSAutocompleteEnableForLogin"; - public const string CMSAutomaticallySignInUser = "CMSAutomaticallySignInUser"; - public const string CMSAutoResizeImageHeight = "CMSAutoResizeImageHeight"; - public const string CMSAutoResizeImageMaxSideSize = "CMSAutoResizeImageMaxSideSize"; - public const string CMSAutoResizeImageWidth = "CMSAutoResizeImageWidth"; - public const string CMSAvatarHeight = "CMSAvatarHeight"; - public const string CMSAvatarMaxSideSize = "CMSAvatarMaxSideSize"; - public const string CMSAvatarWidth = "CMSAvatarWidth"; - public const string CMSAzureComputerVisionAPIEndpoint = "CMSAzureComputerVisionAPIEndpoint"; - public const string CMSAzureComputerVisionAPIKey = "CMSAzureComputerVisionAPIKey"; - public const string CMSAzureComputerVisionConfidence = "CMSAzureComputerVisionConfidence"; - public const string CMSAzureTextAnalyticsAPIEndpoint = "CMSAzureTextAnalyticsAPIEndpoint"; - public const string CMSAzureTextAnalyticsAPIKey = "CMSAzureTextAnalyticsAPIKey"; - public const string CMSBitlyAPIKey = "CMSBitlyAPIKey"; - public const string CMSBitlyLogin = "CMSBitlyLogin"; - public const string CMSBizFormFilesFolder = "CMSBizFormFilesFolder"; - public const string CMSBlockSubscribersGlobally = "CMSBlockSubscribersGlobally"; - public const string CMSBouncedEmailAddress = "CMSBouncedEmailAddress"; - public const string CMSBouncedEmailsLimit = "CMSBouncedEmailsLimit"; - public const string CMSCacheImages = "CMSCacheImages"; - public const string CMSCacheMinutes = "CMSCacheMinutes"; - public const string CMSCheapestVariantAdvertising = "CMSCheapestVariantAdvertising"; - public const string CMSCheckDocumentPermissions = "CMSCheckDocumentPermissions"; - public const string CMSCheckFilesPermissions = "CMSCheckFilesPermissions"; - public const string CMSCheckMediaFilePermissions = "CMSCheckMediaFilePermissions"; - public const string CMSCheckPagePermissions = "CMSCheckPagePermissions"; - public const string CMSCheckPublishedFiles = "CMSCheckPublishedFiles"; - public const string CMSClientCacheMinutes = "CMSClientCacheMinutes"; - public const string CMSCMActivitiesEnabled = "CMSCMActivitiesEnabled"; - public const string CMSCMAddingProductToSC = "CMSCMAddingProductToSC"; - public const string CMSCMAddingProductToWL = "CMSCMAddingProductToWL"; - public const string CMSCMBizFormSubmission = "CMSCMBizFormSubmission"; - public const string CMSCMClickthroughTracking = "CMSCMClickthroughTracking"; - public const string CMSCMCustomActivities = "CMSCMCustomActivities"; - public const string CMSCMCustomTableForm = "CMSCMCustomTableForm"; - public const string CMSCMEmailOpening = "CMSCMEmailOpening"; - public const string CMSCMEnableGeolocation = "CMSCMEnableGeolocation"; - public const string CMSCMExternalSearch = "CMSCMExternalSearch"; - public const string CMSCMGeoCity = "CMSCMGeoCity"; - public const string CMSCMGeoCountry = "CMSCMGeoCountry"; - public const string CMSCMGeoLatitude = "CMSCMGeoLatitude"; - public const string CMSCMGeoLongitude = "CMSCMGeoLongitude"; - public const string CMSCMGeoMetro = "CMSCMGeoMetro"; - public const string CMSCMGeoNewDB = "CMSCMGeoNewDB"; - public const string CMSCMGeoOrganization = "CMSCMGeoOrganization"; - public const string CMSCMGeoPostal = "CMSCMGeoPostal"; - public const string CMSCMGeoState = "CMSCMGeoState"; - public const string CMSCMGeoSuffix = "CMSCMGeoSuffix"; - public const string CMSCMLandingPage = "CMSCMLandingPage"; - public const string CMSCMLegitimateInterestActivitiesEnabled = "CMSCMLegitimateInterestActivitiesEnabled"; - public const string CMSCMNewsletterSubscribe = "CMSCMNewsletterSubscribe"; - public const string CMSCMNewsletterUnsubscribe = "CMSCMNewsletterUnsubscribe"; - public const string CMSCMNewsletterUnsubscribedFromAll = "CMSCMNewsletterUnsubscribedFromAll"; - public const string CMSCMPageVisits = "CMSCMPageVisits"; - public const string CMSCMPurchase = "CMSCMPurchase"; - public const string CMSCMPurchasedProduct = "CMSCMPurchasedProduct"; - public const string CMSCMRemovingProductFromSC = "CMSCMRemovingProductFromSC"; - public const string CMSCMSearch = "CMSCMSearch"; - public const string CMSCMStamp = "CMSCMStamp"; - public const string CMSCMUserLogin = "CMSCMUserLogin"; - public const string CMSCMUserRegistration = "CMSCMUserRegistration"; - public const string CMSCodeNamePrefix = "CMSCodeNamePrefix"; - public const string CMSCombineWithDefaultCulture = "CMSCombineWithDefaultCulture"; - public const string CMSConfirmChanges = "CMSConfirmChanges"; - public const string CMSContentPersonalizationEnabled = "CMSContentPersonalizationEnabled"; - public const string CMSDataVersion = "CMSDataVersion"; - public const string CMSDBSeparationStartedByServer = "CMSDBSeparationStartedByServer"; - public const string CMSDBVersion = "CMSDBVersion"; - public const string CMSDebugAllCache = "CMSDebugAllCache"; - public const string CMSDebugAllFiles = "CMSDebugAllFiles"; - public const string CMSDebugAllForEverything = "CMSDebugAllForEverything"; - public const string CMSDebugAllHandlers = "CMSDebugAllHandlers"; - public const string CMSDebugAllMacros = "CMSDebugAllMacros"; - public const string CMSDebugAllSecurity = "CMSDebugAllSecurity"; - public const string CMSDebugAllSQLQueries = "CMSDebugAllSQLQueries"; - public const string CMSDebugAllWebFarm = "CMSDebugAllWebFarm"; - public const string CMSDebugCache = "CMSDebugCache"; - public const string CMSDebugCacheLogLength = "CMSDebugCacheLogLength"; - public const string CMSDebugCacheStack = "CMSDebugCacheStack"; - public const string CMSDebugEverything = "CMSDebugEverything"; - public const string CMSDebugEverythingEverywhere = "CMSDebugEverythingEverywhere"; - public const string CMSDebugEverythingLogLength = "CMSDebugEverythingLogLength"; - public const string CMSDebugFiles = "CMSDebugFiles"; - public const string CMSDebugFilesLogLength = "CMSDebugFilesLogLength"; - public const string CMSDebugFilesStack = "CMSDebugFilesStack"; - public const string CMSDebugHandlers = "CMSDebugHandlers"; - public const string CMSDebugHandlersLogLength = "CMSDebugHandlersLogLength"; - public const string CMSDebugHandlersStack = "CMSDebugHandlersStack"; - public const string CMSDebugImportExport = "CMSDebugImportExport"; - public const string CMSDebugMacros = "CMSDebugMacros"; - public const string CMSDebugMacrosDetailed = "CMSDebugMacrosDetailed"; - public const string CMSDebugMacrosLogLength = "CMSDebugMacrosLogLength"; - public const string CMSDebugMacrosStack = "CMSDebugMacrosStack"; - public const string CMSDebugResources = "CMSDebugResources"; - public const string CMSDebugScheduler = "CMSDebugScheduler"; - public const string CMSDebugSecurity = "CMSDebugSecurity"; - public const string CMSDebugSecurityLogLength = "CMSDebugSecurityLogLength"; - public const string CMSDebugSecurityStack = "CMSDebugSecurityStack"; - public const string CMSDebugSQLConnections = "CMSDebugSQLConnections"; - public const string CMSDebugSQLQueries = "CMSDebugSQLQueries"; - public const string CMSDebugSQLQueriesLogLength = "CMSDebugSQLQueriesLogLength"; - public const string CMSDebugSQLQueriesStack = "CMSDebugSQLQueriesStack"; - public const string CMSDebugStackForEverything = "CMSDebugStackForEverything"; - public const string CMSDebugWebFarm = "CMSDebugWebFarm"; - public const string CMSDebugWebFarmLogLength = "CMSDebugWebFarmLogLength"; - public const string CMSDebugWebFarmStack = "CMSDebugWebFarmStack"; - public const string CMSDefaultControlForBoolean = "CMSDefaultControlForBoolean"; - public const string CMSDefaultControlForDateTime = "CMSDefaultControlForDateTime"; - public const string CMSDefaultControlForDecimal = "CMSDefaultControlForDecimal"; - public const string CMSDefaultControlForDocAttachments = "CMSDefaultControlForDocAttachments"; - public const string CMSDefaultControlForDocRelationships = "CMSDefaultControlForDocRelationships"; - public const string CMSDefaultControlForFile = "CMSDefaultControlForFile"; - public const string CMSDefaultControlForGUID = "CMSDefaultControlForGUID"; - public const string CMSDefaultControlForInteger = "CMSDefaultControlForInteger"; - public const string CMSDefaultControlForLongText = "CMSDefaultControlForLongText"; - public const string CMSDefaultControlForText = "CMSDefaultControlForText"; - public const string CMSDefaultCookieLevel = "CMSDefaultCookieLevel"; - public const string CMSDefaultCultureCode = "CMSDefaultCultureCode"; - public const string CMSDefaultProductImageUrl = "CMSDefaultProductImageUrl"; - public const string CMSDefaultReportConnectionString = "CMSDefaultReportConnectionString"; - public const string CMSDefaultUserID = "CMSDefaultUserID"; - public const string CMSDeleteInactiveContactsLastXDays = "CMSDeleteInactiveContactsLastXDays"; - public const string CMSDeleteInactiveContactsMethod = "CMSDeleteInactiveContactsMethod"; - public const string CMSDeleteNonActivatedUserAfter = "CMSDeleteNonActivatedUserAfter"; - public const string CMSDeploymentMode = "CMSDeploymentMode"; - public const string CMSDisableDebug = "CMSDisableDebug"; - public const string CMSDisplayAccountLockInformation = "CMSDisplayAccountLockInformation"; - public const string CMSDisplayArchivedIcon = "CMSDisplayArchivedIcon"; - public const string CMSDisplayCheckedOutIcon = "CMSDisplayCheckedOutIcon"; - public const string CMSDisplayLinkedIcon = "CMSDisplayLinkedIcon"; - public const string CMSDisplayNotPublishedIcon = "CMSDisplayNotPublishedIcon"; - public const string CMSDisplayNotTranslatedIcon = "CMSDisplayNotTranslatedIcon"; - public const string CMSDisplayPublishedIcon = "CMSDisplayPublishedIcon"; - public const string CMSDisplayVersionNotPublishedIcon = "CMSDisplayVersionNotPublishedIcon"; - public const string CMSEmailBatchSize = "CMSEmailBatchSize"; - public const string CMSEmailEncoding = "CMSEmailEncoding"; - public const string CMSEmailFormat = "CMSEmailFormat"; - public const string CMSEmailQueueEnabled = "CMSEmailQueueEnabled"; - public const string CMSEmailsEnabled = "CMSEmailsEnabled"; - public const string CMSEmailTranslationFrom = "CMSEmailTranslationFrom"; - public const string CMSEmailTranslationRecipients = "CMSEmailTranslationRecipients"; - public const string CMSEnableCI = "CMSEnableCI"; - public const string CMSEnableCodeEditSiteAdministrators = "CMSEnableCodeEditSiteAdministrators"; - public const string CMSEnableImageRecognition = "CMSEnableImageRecognition"; - public const string CMSEnableObjectsVersioning = "CMSEnableObjectsVersioning"; - public const string CMSEnableOnlineMarketing = "CMSEnableOnlineMarketing"; - public const string CMSEnableSentimentAnalysis = "CMSEnableSentimentAnalysis"; - public const string CMSEnableTranlsationRESTService = "CMSEnableTranlsationRESTService"; - public const string CMSEnableTranslations = "CMSEnableTranslations"; - public const string CMSEnableVersioningCMSAlternativeForm = "CMSEnableVersioningCMSAlternativeForm"; - public const string CMSEnableVersioningCMSCustomTable = "CMSEnableVersioningCMSCustomTable"; - public const string CMSEnableVersioningCMSDocumentType = "CMSEnableVersioningCMSDocumentType"; - public const string CMSEnableVersioningCMSEmailTemplate = "CMSEnableVersioningCMSEmailTemplate"; - public const string CMSEnableVersioningCMSForm = "CMSEnableVersioningCMSForm"; - public const string CMSEnableVersioningCMSLayout = "CMSEnableVersioningCMSLayout"; - public const string CMSEnableVersioningCMSPageTemplate = "CMSEnableVersioningCMSPageTemplate"; - public const string CMSEnableVersioningCMSQuery = "CMSEnableVersioningCMSQuery"; - public const string CMSEnableVersioningCMSTransformation = "CMSEnableVersioningCMSTransformation"; - public const string CMSEnableVersioningCMSUIElement = "CMSEnableVersioningCMSUIElement"; - public const string CMSEnableVersioningCMSWebPartLayout = "CMSEnableVersioningCMSWebPartLayout"; - public const string CMSEnableVersioningCMSWorkflow = "CMSEnableVersioningCMSWorkflow"; - public const string CMSEnableVersioningMAAutomationProcess = "CMSEnableVersioningMAAutomationProcess"; - public const string CMSEnableVersioningMediaFile = "CMSEnableVersioningMediaFile"; - public const string CMSEnableVersioningNewsletterEmailTemplate = "CMSEnableVersioningNewsletterEmailTemplate"; - public const string CMSEnableVersioningNewsletterEmailWidget = "CMSEnableVersioningNewsletterEmailWidget"; - public const string CMSEnableVersioningNewsletterIssue = "CMSEnableVersioningNewsletterIssue"; - public const string CMSEnableVersioningReportingReport = "CMSEnableVersioningReportingReport"; - public const string CMSEnableVersioningReportingReportGraph = "CMSEnableVersioningReportingReportGraph"; - public const string CMSEnableVersioningReportingReportTable = "CMSEnableVersioningReportingReportTable"; - public const string CMSEnableVersioningReportingReportValue = "CMSEnableVersioningReportingReportValue"; - public const string CMSExcludeDocumentsFromSearch = "CMSExcludeDocumentsFromSearch"; - public const string CMSExcludeDocumentTypesFromSearch = "CMSExcludeDocumentTypesFromSearch"; - public const string CMSExportLogObjectChanges = "CMSExportLogObjectChanges"; - public const string CMSFilesFolder = "CMSFilesFolder"; - public const string CMSFilesLocationType = "CMSFilesLocationType"; - public const string CMSForbiddenCharactersReplacement = "CMSForbiddenCharactersReplacement"; - public const string CMSForbiddenURLCharacters = "CMSForbiddenURLCharacters"; - public const string CMSGenerateNewsletters = "CMSGenerateNewsletters"; - public const string CMSGenerateThumbnails = "CMSGenerateThumbnails"; - public const string CMSGoogleTranslateAPIKey = "CMSGoogleTranslateAPIKey"; - public const string CMSHideLanguagePrefixForDefaultCultureURL = "CMSHideLanguagePrefixForDefaultCultureURL"; - public const string CMSHideUnavailableUserInterface = "CMSHideUnavailableUserInterface"; - public const string CMSHomePagePath = "CMSHomePagePath"; - public const string CMSHomePageURLBehavior = "CMSHomePageURLBehavior"; - public const string CMSHotfixDataVersion = "CMSHotfixDataVersion"; - public const string CMSHotfixProcedureInProgress = "CMSHotfixProcedureInProgress"; - public const string CMSHotfixVersion = "CMSHotfixVersion"; - public const string CMSIncludeTaxInPrices = "CMSIncludeTaxInPrices"; - public const string CMSIntegrationEnabled = "CMSIntegrationEnabled"; - public const string CMSIntegrationLogExternal = "CMSIntegrationLogExternal"; - public const string CMSIntegrationLogInternal = "CMSIntegrationLogInternal"; - public const string CMSIntegrationProcessExternal = "CMSIntegrationProcessExternal"; - public const string CMSIntegrationProcessInternal = "CMSIntegrationProcessInternal"; - public const string CMSJwtTokenEncryptionKey = "CMSJwtTokenEncryptionKey"; - public const string CMSKeepNewCheckedOut = "CMSKeepNewCheckedOut"; - public const string CMSLogCache = "CMSLogCache"; - public const string CMSLogEverythingToFile = "CMSLogEverythingToFile"; - public const string CMSLogFiles = "CMSLogFiles"; - public const string CMSLogHandlers = "CMSLogHandlers"; - public const string CMSLogMacros = "CMSLogMacros"; - public const string CMSLogMetadata = "CMSLogMetadata"; - public const string CMSLogSecurity = "CMSLogSecurity"; - public const string CMSLogSize = "CMSLogSize"; - public const string CMSLogSQLQueries = "CMSLogSQLQueries"; - public const string CMSLogToDatabase = "CMSLogToDatabase"; - public const string CMSLogToFileSystem = "CMSLogToFileSystem"; - public const string CMSLogToTrace = "CMSLogToTrace"; - public const string CMSLogWebFarm = "CMSLogWebFarm"; - public const string CMSLowercaseURLs = "CMSLowercaseURLs"; - public const string CMSManualTranslationDeleteSuccessfulSubmissions = "CMSManualTranslationDeleteSuccessfulSubmissions"; - public const string CMSManualTranslationExportFolder = "CMSManualTranslationExportFolder"; - public const string CMSManualTranslationImportFolder = "CMSManualTranslationImportFolder"; - public const string CMSMarkShoppingCartAsAbandonedPeriod = "CMSMarkShoppingCartAsAbandonedPeriod"; - public const string CMSMaxCacheFileSize = "CMSMaxCacheFileSize"; - public const string CMSMaximumInvalidLogonAttempts = "CMSMaximumInvalidLogonAttempts"; - public const string CMSMaxTreeNodes = "CMSMaxTreeNodes"; - public const string CMSMaxUITreeNodes = "CMSMaxUITreeNodes"; - public const string CMSMediaFileAllowedExtensions = "CMSMediaFileAllowedExtensions"; - public const string CMSMediaFileHiddenFolder = "CMSMediaFileHiddenFolder"; - public const string CMSMediaFilePreviewSuffix = "CMSMediaFilePreviewSuffix"; - public const string CMSMediaLibrariesFolder = "CMSMediaLibrariesFolder"; - public const string CMSMediaLibraryMaxSubFolders = "CMSMediaLibraryMaxSubFolders"; - public const string CMSMembershipReminder = "CMSMembershipReminder"; - public const string CMSMFDisplayInitToken = "CMSMFDisplayInitToken"; - public const string CMSMFEnabled = "CMSMFEnabled"; - public const string CMSMFRequired = "CMSMFRequired"; - public const string CMSModuleUsageTrackingEnabled = "CMSModuleUsageTrackingEnabled"; - public const string CMSModuleUsageTrackingIdentity = "CMSModuleUsageTrackingIdentity"; - public const string CMSMonitorBouncedEmails = "CMSMonitorBouncedEmails"; - public const string CMSMSTranslatorTextAPISubscriptionKey = "CMSMSTranslatorTextAPISubscriptionKey"; - public const string CMSNewDocumentOrder = "CMSNewDocumentOrder"; - public const string CMSNewsletterUnsubscriptionURL = "CMSNewsletterUnsubscriptionURL"; - public const string CMSNewsletterUseExternalService = "CMSNewsletterUseExternalService"; - public const string CMSNoreplyEmailAddress = "CMSNoreplyEmailAddress"; - public const string CMSObjectVersionHistoryLength = "CMSObjectVersionHistoryLength"; - public const string CMSObjectVersionHistoryMajorVersionsLength = "CMSObjectVersionHistoryMajorVersionsLength"; - public const string CMSObjectVersionHistoryPromoteToMajorTimeInterval = "CMSObjectVersionHistoryPromoteToMajorTimeInterval"; - public const string CMSObjectVersionHistoryUseLastVersionInterval = "CMSObjectVersionHistoryUseLastVersionInterval"; - public const string CMSOptInApprovalURL = "CMSOptInApprovalURL"; - public const string CMSOptInInterval = "CMSOptInInterval"; - public const string CMSPageDescriptionPrefix = "CMSPageDescriptionPrefix"; - public const string CMSPageKeyWordsPrefix = "CMSPageKeyWordsPrefix"; - public const string CMSPageTitleFormat = "CMSPageTitleFormat"; - public const string CMSPageTitlePrefix = "CMSPageTitlePrefix"; - public const string CMSPasswordExpiration = "CMSPasswordExpiration"; - public const string CMSPasswordExpirationBehaviour = "CMSPasswordExpirationBehaviour"; - public const string CMSPasswordExpirationEmail = "CMSPasswordExpirationEmail"; - public const string CMSPasswordExpirationPeriod = "CMSPasswordExpirationPeriod"; - public const string CMSPasswordExpirationWarningPeriod = "CMSPasswordExpirationWarningPeriod"; - public const string CMSPasswordFormat = "CMSPasswordFormat"; - public const string CMSPaypalCancelReturnUrl = "CMSPaypalCancelReturnUrl"; - public const string CMSPayPalCredentialsAccountType = "CMSPayPalCredentialsAccountType"; - public const string CMSPayPalCredentialsClientId = "CMSPayPalCredentialsClientId"; - public const string CMSPayPalCredentialsClientSecret = "CMSPayPalCredentialsClientSecret"; - public const string CMSPayPalReturnUrl = "CMSPayPalReturnUrl"; - public const string CMSPayPalTransactionType = "CMSPayPalTransactionType"; - public const string CMSPersonalizeUserInterface = "CMSPersonalizeUserInterface"; - public const string CMSPolicyForcePolicyOnLogon = "CMSPolicyForcePolicyOnLogon"; - public const string CMSPolicyMinimalLength = "CMSPolicyMinimalLength"; - public const string CMSPolicyNumberOfNonAlphaNumChars = "CMSPolicyNumberOfNonAlphaNumChars"; - public const string CMSPolicyRegularExpression = "CMSPolicyRegularExpression"; - public const string CMSPolicyViolationMessage = "CMSPolicyViolationMessage"; - public const string CMSPOP3AuthenticationMethod = "CMSPOP3AuthenticationMethod"; - public const string CMSPOP3Password = "CMSPOP3Password"; - public const string CMSPOP3ServerName = "CMSPOP3ServerName"; - public const string CMSPOP3ServerPort = "CMSPOP3ServerPort"; - public const string CMSPOP3UserName = "CMSPOP3UserName"; - public const string CMSPOP3UseSSL = "CMSPOP3UseSSL"; - public const string CMSPriceRounding = "CMSPriceRounding"; - public const string CMSReCaptchaPrivateKey = "CMSReCaptchaPrivateKey"; - public const string CMSReCaptchaPublicKey = "CMSReCaptchaPublicKey"; - public const string CMSRedirectFilesToDisk = "CMSRedirectFilesToDisk"; - public const string CMSRegistrationAdministratorApproval = "CMSRegistrationAdministratorApproval"; - public const string CMSRememberUniGridState = "CMSRememberUniGridState"; - public const string CMSResetPasswordInterval = "CMSResetPasswordInterval"; - public const string CMSRESTAllowedDocTypes = "CMSRESTAllowedDocTypes"; - public const string CMSRESTAllowedObjectTypes = "CMSRESTAllowedObjectTypes"; - public const string CMSRESTAllowSensitiveFields = "CMSRESTAllowSensitiveFields"; - public const string CMSRESTDefaultEncoding = "CMSRESTDefaultEncoding"; - public const string CMSRESTDocumentsReadOnly = "CMSRESTDocumentsReadOnly"; - public const string CMSRESTDocumentsSecurityCheck = "CMSRESTDocumentsSecurityCheck"; - public const string CMSRESTGenerateHash = "CMSRESTGenerateHash"; - public const string CMSRESTObjectsReadOnly = "CMSRESTObjectsReadOnly"; - public const string CMSRestoreObjects = "CMSRestoreObjects"; - public const string CMSRESTServiceEnabled = "CMSRESTServiceEnabled"; - public const string CMSRESTServiceTypeEnabled = "CMSRESTServiceTypeEnabled"; - public const string CMSRESTUrlHashSalt = "CMSRESTUrlHashSalt"; - public const string CMSRevalidateClientCache = "CMSRevalidateClientCache"; - public const string CMSRichTextEditorLicense = "CMSRichTextEditorLicense"; - public const string CMSRichTextEditorStylesheetURL = "CMSRichTextEditorStylesheetURL"; - public const string CMSRoutingMode = "CMSRoutingMode"; - public const string CMSRoutingURLCultureFormat = "CMSRoutingURLCultureFormat"; - public const string CMSSalesForceCredentials = "CMSSalesForceCredentials"; - public const string CMSSalesForceLeadReplicationBatchSize = "CMSSalesForceLeadReplicationBatchSize"; - public const string CMSSalesForceLeadReplicationDefaultCompanyName = "CMSSalesForceLeadReplicationDefaultCompanyName"; - public const string CMSSalesForceLeadReplicationEnabled = "CMSSalesForceLeadReplicationEnabled"; - public const string CMSSalesForceLeadReplicationLeadDescription = "CMSSalesForceLeadReplicationLeadDescription"; - public const string CMSSalesForceLeadReplicationMapping = "CMSSalesForceLeadReplicationMapping"; - public const string CMSSalesForceLeadReplicationMappingDateTime = "CMSSalesForceLeadReplicationMappingDateTime"; - public const string CMSSalesForceLeadReplicationMinScoreValue = "CMSSalesForceLeadReplicationMinScoreValue"; - public const string CMSSalesForceLeadReplicationScoreID = "CMSSalesForceLeadReplicationScoreID"; - public const string CMSSalesForceLeadReplicationUpdateEnabled = "CMSSalesForceLeadReplicationUpdateEnabled"; - public const string CMSSchedulerInterval = "CMSSchedulerInterval"; - public const string CMSSchedulerServiceInterval = "CMSSchedulerServiceInterval"; - public const string CMSSchedulerTasksEnabled = "CMSSchedulerTasksEnabled"; - public const string CMSSchedulerUseExternalService = "CMSSchedulerUseExternalService"; - public const string CMSScreenLockEnabled = "CMSScreenLockEnabled"; - public const string CMSScreenLockInterval = "CMSScreenLockInterval"; - public const string CMSScreenLockWarningInterval = "CMSScreenLockWarningInterval"; - public const string CMSSearchAllowedFileTypes = "CMSSearchAllowedFileTypes"; - public const string CMSSearchIndexingEnabled = "CMSSearchIndexingEnabled"; - public const string CMSSendAccountUnlockEmail = "CMSSendAccountUnlockEmail"; - public const string CMSSendEmailNotificationsFrom = "CMSSendEmailNotificationsFrom"; - public const string CMSSendErrorNotificationTo = "CMSSendErrorNotificationTo"; - public const string CMSSendPasswordEmailsFrom = "CMSSendPasswordEmailsFrom"; - public const string CMSSendWorkflowEmails = "CMSSendWorkflowEmails"; - public const string CMSSendWorkflowEmailsFrom = "CMSSendWorkflowEmailsFrom"; - public const string CMSServerTimeZone = "CMSServerTimeZone"; - public const string CMSSharePointCache = "CMSSharePointCache"; - public const string CMSSharePointCacheSizeLimit = "CMSSharePointCacheSizeLimit"; - public const string CMSShoppingCartExpirationPeriod = "CMSShoppingCartExpirationPeriod"; - public const string CMSShoppingCartURL = "CMSShoppingCartURL"; - public const string CMSSiteSharedAccounts = "CMSSiteSharedAccounts"; - public const string CMSSiteTimeZone = "CMSSiteTimeZone"; - public const string CMSSMTPServer = "CMSSMTPServer"; - public const string CMSSMTPServerPassword = "CMSSMTPServerPassword"; - public const string CMSSMTPServerTip = "CMSSMTPServerTip"; - public const string CMSSMTPServerUser = "CMSSMTPServerUser"; - public const string CMSSocialMarketingURLShorteningFacebook = "CMSSocialMarketingURLShorteningFacebook"; - public const string CMSSocialMarketingURLShorteningLinkedIn = "CMSSocialMarketingURLShorteningLinkedIn"; - public const string CMSSocialMarketingURLShorteningTwitter = "CMSSocialMarketingURLShorteningTwitter"; - public const string CMSStagingLogChanges = "CMSStagingLogChanges"; - public const string CMSStagingLogDataChanges = "CMSStagingLogDataChanges"; - public const string CMSStagingLogObjectChanges = "CMSStagingLogObjectChanges"; - public const string CMSStagingLogStagingChanges = "CMSStagingLogStagingChanges"; - public const string CMSStagingServiceAuthentication = "CMSStagingServiceAuthentication"; - public const string CMSStagingServiceEnabled = "CMSStagingServiceEnabled"; - public const string CMSStagingServicePassword = "CMSStagingServicePassword"; - public const string CMSStagingServiceUsername = "CMSStagingServiceUsername"; - public const string CMSStagingServiceX509ClientBase64KeyId = "CMSStagingServiceX509ClientBase64KeyId"; - public const string CMSStagingServiceX509ServerBase64KeyId = "CMSStagingServiceX509ServerBase64KeyId"; - public const string CMSStoreAllowAnonymousCustomers = "CMSStoreAllowAnonymousCustomers"; - public const string CMSStoreAllowGlobalDepartments = "CMSStoreAllowGlobalDepartments"; - public const string CMSStoreAllowGlobalManufacturers = "CMSStoreAllowGlobalManufacturers"; - public const string CMSStoreAllowGlobalPaymentMethods = "CMSStoreAllowGlobalPaymentMethods"; - public const string CMSStoreAllowGlobalProductOptions = "CMSStoreAllowGlobalProductOptions"; - public const string CMSStoreAllowGlobalProducts = "CMSStoreAllowGlobalProducts"; - public const string CMSStoreAllowGlobalSuppliers = "CMSStoreAllowGlobalSuppliers"; - public const string CMSStoreAllowProductsWithoutDocuments = "CMSStoreAllowProductsWithoutDocuments"; - public const string CMSStoreAltFormLayoutsInFS = "CMSStoreAltFormLayoutsInFS"; - public const string CMSStoreApplyTaxesBasedOn = "CMSStoreApplyTaxesBasedOn"; - public const string CMSStoreAutoRegisterCustomer = "CMSStoreAutoRegisterCustomer"; - public const string CMSStoreAutoRegistrationEmailTemplate = "CMSStoreAutoRegistrationEmailTemplate"; - public const string CMSStoreCheckoutProcess = "CMSStoreCheckoutProcess"; - public const string CMSStoreDefaultCountryName = "CMSStoreDefaultCountryName"; - public const string CMSStoreDisplayProductsInSectionsTree = "CMSStoreDisplayProductsInSectionsTree"; - public const string CMSStoreEProductsReminder = "CMSStoreEProductsReminder"; - public const string CMSStoreFormerUrls = "CMSStoreFormerUrls"; - public const string CMSStoreFormLayoutsInFS = "CMSStoreFormLayoutsInFS"; - public const string CMSStoreInvoiceNumberPattern = "CMSStoreInvoiceNumberPattern"; - public const string CMSStoreInvoiceTemplate = "CMSStoreInvoiceTemplate"; - public const string CMSStoreLayoutsInFS = "CMSStoreLayoutsInFS"; - public const string CMSStoreMassUnit = "CMSStoreMassUnit"; - public const string CMSStoreNewProductStatus = "CMSStoreNewProductStatus"; - public const string CMSStorePageTemplatesInFS = "CMSStorePageTemplatesInFS"; - public const string CMSStoreProductsAreNewFor = "CMSStoreProductsAreNewFor"; - public const string CMSStoreProductsStartingPath = "CMSStoreProductsStartingPath"; - public const string CMSStoreProductsTree = "CMSStoreProductsTree"; - public const string CMSStoreRedirectToShoppingCart = "CMSStoreRedirectToShoppingCart"; - public const string CMSStoreRelatedProductsRelationshipName = "CMSStoreRelatedProductsRelationshipName"; - public const string CMSStoreRequireCompanyInfo = "CMSStoreRequireCompanyInfo"; - public const string CMSStoreSendEmailsFrom = "CMSStoreSendEmailsFrom"; - public const string CMSStoreSendEmailsTo = "CMSStoreSendEmailsTo"; - public const string CMSStoreSendOrderNotification = "CMSStoreSendOrderNotification"; - public const string CMSStoreSendPaymentNotification = "CMSStoreSendPaymentNotification"; - public const string CMSStoreShowOrganizationID = "CMSStoreShowOrganizationID"; - public const string CMSStoreShowTaxRegistrationID = "CMSStoreShowTaxRegistrationID"; - public const string CMSStoreTransformationsInFS = "CMSStoreTransformationsInFS"; - public const string CMSStoreUseCustomerCultureForEmails = "CMSStoreUseCustomerCultureForEmails"; - public const string CMSStoreUseExtraCompanyAddress = "CMSStoreUseExtraCompanyAddress"; - public const string CMSStoreUseGlobalCredit = "CMSStoreUseGlobalCredit"; - public const string CMSStoreUseGlobalCurrencies = "CMSStoreUseGlobalCurrencies"; - public const string CMSStoreUseGlobalExchangeRates = "CMSStoreUseGlobalExchangeRates"; - public const string CMSStoreUseGlobalInternalStatus = "CMSStoreUseGlobalInternalStatus"; - public const string CMSStoreUseGlobalInvoice = "CMSStoreUseGlobalInvoice"; - public const string CMSStoreUseGlobalOrderStatus = "CMSStoreUseGlobalOrderStatus"; - public const string CMSStoreUseGlobalPublicStatus = "CMSStoreUseGlobalPublicStatus"; - public const string CMSStoreUseGlobalTaxClasses = "CMSStoreUseGlobalTaxClasses"; - public const string CMSStoreWebpartContainersInFS = "CMSStoreWebpartContainersInFS"; - public const string CMSStoreWebPartLayoutsInFS = "CMSStoreWebPartLayoutsInFS"; - public const string CMSStoreWeightFormattingString = "CMSStoreWeightFormattingString"; - public const string CMSTimeZonesEnable = "CMSTimeZonesEnable"; - public const string CMSTrackAverageTimeOnPage = "CMSTrackAverageTimeOnPage"; - public const string CMSTrackExitPages = "CMSTrackExitPages"; - public const string CMSTrackLandingPages = "CMSTrackLandingPages"; - public const string CMSTrackMobileDevices = "CMSTrackMobileDevices"; - public const string CMSTrackOnSiteKeywords = "CMSTrackOnSiteKeywords"; - public const string CMSTrackReferringSitesDirect = "CMSTrackReferringSitesDirect"; - public const string CMSTrackReferringSitesLocal = "CMSTrackReferringSitesLocal"; - public const string CMSTrackReferringSitesReferring = "CMSTrackReferringSitesReferring"; - public const string CMSTrackSearchCrawlers = "CMSTrackSearchCrawlers"; - public const string CMSTrackSearchEngines = "CMSTrackSearchEngines"; - public const string CMSTrackSearchKeywords = "CMSTrackSearchKeywords"; - public const string CMSTranslateFileTypes = "CMSTranslateFileTypes"; - public const string CMSTranslationsAutoImport = "CMSTranslationsAutoImport"; - public const string CMSTranslationsEncoding = "CMSTranslationsEncoding"; - public const string CMSTranslationsLastStatusCheck = "CMSTranslationsLastStatusCheck"; - public const string CMSUpdateDocumentAlias = "CMSUpdateDocumentAlias"; - public const string CMSUploadExtensions = "CMSUploadExtensions"; - public const string CMSUseAutomaticVersionNumbering = "CMSUseAutomaticVersionNumbering"; - public const string CMSUseBizFormsSiteFolder = "CMSUseBizFormsSiteFolder"; - public const string CMSUseCheckinCheckout = "CMSUseCheckinCheckout"; - public const string CMSUseCultureAliasAsLanguagePrefixInUrl = "CMSUseCultureAliasAsLanguagePrefixInUrl"; - public const string CMSUseEventLogListener = "CMSUseEventLogListener"; - public const string CMSUseFilesSiteFolder = "CMSUseFilesSiteFolder"; - public const string CMSUseMediaLibrariesSiteFolder = "CMSUseMediaLibrariesSiteFolder"; - public const string CMSUseObjectCheckinCheckout = "CMSUseObjectCheckinCheckout"; - public const string CMSUsePasswordPolicy = "CMSUsePasswordPolicy"; - public const string CMSUserAccountUnlockPath = "CMSUserAccountUnlockPath"; - public const string CMSUserUniqueEmail = "CMSUserUniqueEmail"; - public const string CMSUseSSL = "CMSUseSSL"; - public const string CMSUseURLsWithTrailingSlash = "CMSUseURLsWithTrailingSlash"; - public const string CMSVersionHistoryLength = "CMSVersionHistoryLength"; - public const string CMSVersioningExtensionsMediaFile = "CMSVersioningExtensionsMediaFile"; - public const string CMSVisitorStatusIdle = "CMSVisitorStatusIdle"; - public const string CMSWebFarmMaxFileSize = "CMSWebFarmMaxFileSize"; - public const string CMSWebFarmMode = "CMSWebFarmMode"; - public const string CMSWebFarmSynchronizeAttachments = "CMSWebFarmSynchronizeAttachments"; - public const string CMSWebFarmSynchronizeAvatars = "CMSWebFarmSynchronizeAvatars"; - public const string CMSWebFarmSynchronizeBizFormFiles = "CMSWebFarmSynchronizeBizFormFiles"; - public const string CMSWebFarmSynchronizeCache = "CMSWebFarmSynchronizeCache"; - public const string CMSWebFarmSynchronizeDeleteFiles = "CMSWebFarmSynchronizeDeleteFiles"; - public const string CMSWebFarmSynchronizeFiles = "CMSWebFarmSynchronizeFiles"; - public const string CMSWebFarmSynchronizeMediaFiles = "CMSWebFarmSynchronizeMediaFiles"; - public const string CMSWebFarmSynchronizeMetaFiles = "CMSWebFarmSynchronizeMetaFiles"; - public const string CMSWebFarmSynchronizePhysicalFiles = "CMSWebFarmSynchronizePhysicalFiles"; - public const string CMSWebFarmSynchronizeSmartSearch = "CMSWebFarmSynchronizeSmartSearch"; - public const string CMSWebFarmSyncInterval = "CMSWebFarmSyncInterval"; - public const string CMSWIFAllowedAudienceUris = "CMSWIFAllowedAudienceUris"; - public const string CMSWIFCertificateValidator = "CMSWIFCertificateValidator"; - public const string CMSWIFEnabled = "CMSWIFEnabled"; - public const string CMSWIFIdentityProviderURL = "CMSWIFIdentityProviderURL"; - public const string CMSWIFRealm = "CMSWIFRealm"; - public const string CMSWIFTrustedCertificateThumbprint = "CMSWIFTrustedCertificateThumbprint"; - public const string CMSWishlistURL = "CMSWishlistURL"; -} diff --git a/Migration.Toolkit.KX13/SettingsKeys.tt b/Migration.Toolkit.KX13/SettingsKeys.tt deleted file mode 100644 index d9db544d..00000000 --- a/Migration.Toolkit.KX13/SettingsKeys.tt +++ /dev/null @@ -1,28 +0,0 @@ -<#@ template language="C#" #> -<#@ import namespace="System.Data.SqlClient" #> -// ReSharper disable InconsistentNaming -// ReSharper disable IdentifierTypo -namespace Migration.Toolkit.KX13; - -public static class SettingsKeys { -<# - var connectionString = Environment.GetEnvironmentVariable("KENTICO_MT_DEV_KX13_CONNECTION_STRING"); - using var connection = new SqlConnection(connectionString); - using var cmd = connection.CreateCommand(); - cmd.CommandText = """ - SELECT KeyName - FROM CMS_SettingsKey - WHERE KeyName LIKE 'CMS%' - GROUP BY KeyName - ORDER BY KeyName - """; - connection.Open(); - using var reader = cmd.ExecuteReader(); - while (reader.Read()) - { - WriteLine($""" - public const string {reader[0]} = "{reader[0]}"; - """); - } -#> -} \ No newline at end of file diff --git a/Migration.Toolkit.KXP.Api/DependencyInjectionExtensions.cs b/Migration.Toolkit.KXP.Api/DependencyInjectionExtensions.cs deleted file mode 100644 index ecfea274..00000000 --- a/Migration.Toolkit.KXP.Api/DependencyInjectionExtensions.cs +++ /dev/null @@ -1,29 +0,0 @@ -using CMS.Base; -using CMS.Core; - -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -using Migration.Toolkit.KXP.Api.Services.CmsClass; - -namespace Migration.Toolkit.KXP.Api; - -public static class DependencyInjectionExtensions -{ - public static IServiceCollection UseKxpApi(this IServiceCollection services, IConfiguration configuration, string? applicationPhysicalPath = null) - { - Service.Use(configuration); - if (applicationPhysicalPath != null && Directory.Exists(applicationPhysicalPath)) - { - SystemContext.WebApplicationPhysicalPath = applicationPhysicalPath; - } - - services.AddSingleton(); - services.AddSingleton(); - - services.AddSingleton(); - services.AddSingleton(); - - return services; - } -} diff --git a/Migration.Toolkit.KXP.Api/Migration.Toolkit.KXP.Api.csproj b/Migration.Toolkit.KXP.Api/Migration.Toolkit.KXP.Api.csproj deleted file mode 100644 index d86637fd..00000000 --- a/Migration.Toolkit.KXP.Api/Migration.Toolkit.KXP.Api.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - Migration.Toolkit.KXP.Api - Migration.Toolkit.KXP.Api - - - - - - - - - - - - - - - - diff --git a/Migration.Toolkit.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs b/Migration.Toolkit.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs deleted file mode 100644 index 90139650..00000000 --- a/Migration.Toolkit.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System.Text.RegularExpressions; -using CMS.DataEngine; -using CMS.OnlineForms; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.KXP.Api.Auxiliary; -using FcLongText = Migration.Toolkit.Common.Enumerations.Kx13FormControls.UserControlForLongText; -using FcText = Migration.Toolkit.Common.Enumerations.Kx13FormControls.UserControlForText; - -namespace Migration.Toolkit.KXP.Api.Services.CmsClass; - -public record FormComponentReplacement(string OldFormComponent, string NewFormComponent); - -public record DataTypeMigrationModel( - FieldMigration[] FieldMigrations, - FormComponentReplacement[] NotSupportedInKxpLegacyMode, - [property: Obsolete("Legacy mode is no longer supported")] string[] SupportedInKxpLegacyMode -); - -public record FieldMigration(string SourceDataType, string TargetDataType, string SourceFormControl, string? TargetFormComponent, string[]? Actions = null, Regex? FieldNameRegex = null); - -/// -/// Tca = target control action -/// -public static class TcaDirective -{ - public const string ClearSettings = "clear settings"; - public const string ClearMacroTable = "clear hashtable"; - public const string ConvertToAsset = "convert to asset"; - public const string ConvertToPages = "convert to pages"; - public const string ConvertToRichText = "convert to richtext"; -} - -/// -/// Tfc = Target form component -/// -public static class TfcDirective -{ - public const string CopySourceControl = "#copy-source-control#"; - public const string DoNothing = "#nothing#"; - public const string Clear = "#clear#"; -} - -/// -/// Sfc = source form control -/// -public static class SfcDirective -{ - public const string CatchAnyNonMatching = "#any#"; -} - -public static class FieldMappingInstance -{ - public static void PrepareFieldMigrations(ToolkitConfiguration configuration) - { - var m = new List(); - m.AddRange([ - new FieldMigration(KsFieldDataType.ALL, FieldDataType.ALL, SfcDirective.CatchAnyNonMatching, null, [TfcDirective.Clear]), - new FieldMigration(KsFieldDataType.Unknown, FieldDataType.Unknown, SfcDirective.CatchAnyNonMatching, null, [TfcDirective.Clear]), - new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.TextBoxControl, FormComponents.AdminTextInputComponent), - new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.DropDownListControl, FormComponents.AdminDropDownComponent), - new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.IconSelector, FormComponents.AdminIconSelectorComponent), - new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.Password, FormComponents.AdminPasswordComponent), - new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.RadioButtonsControl, FormComponents.AdminRadioGroupComponent), - new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.TextAreaControl, FormComponents.AdminTextAreaComponent), - new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextInputComponent), - new FieldMigration(KsFieldDataType.LongText, FieldDataType.RichTextHTML, FcLongText.HtmlAreaControl, FormComponents.AdminRichTextEditorComponent, [TcaDirective.ConvertToRichText]), - new FieldMigration(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.TextBoxControl, FormComponents.AdminTextInputComponent), - new FieldMigration(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.DropDownListControl, FormComponents.AdminDropDownComponent), - new FieldMigration(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.TextAreaControl, FormComponents.AdminTextAreaComponent), - new FieldMigration(KsFieldDataType.LongText, FieldDataType.LongText, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextAreaComponent), - new FieldMigration(KsFieldDataType.Integer, FieldDataType.Integer, SfcDirective.CatchAnyNonMatching, FormComponents.AdminNumberInputComponent), - new FieldMigration(KsFieldDataType.LongInteger, FieldDataType.LongInteger, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear, [TfcDirective.Clear]), //FormComponents.AdminNumberInputComponent), - new FieldMigration(KsFieldDataType.Double, FieldDataType.Double, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear, [TfcDirective.Clear]), // FormComponents.AdminNumberInputComponent), - new FieldMigration(KsFieldDataType.Decimal, FieldDataType.Decimal, SfcDirective.CatchAnyNonMatching, FormComponents.AdminDecimalNumberInputComponent), - new FieldMigration(KsFieldDataType.DateTime, FieldDataType.DateTime, SfcDirective.CatchAnyNonMatching, FormComponents.AdminDateTimeInputComponent), - new FieldMigration(KsFieldDataType.Date, FieldDataType.Date, SfcDirective.CatchAnyNonMatching, FormComponents.AdminDateInputComponent), - new FieldMigration(KsFieldDataType.TimeSpan, FieldDataType.TimeSpan, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextInputComponent), - new FieldMigration(KsFieldDataType.Boolean, FieldDataType.Boolean, SfcDirective.CatchAnyNonMatching, FormComponents.AdminCheckBoxComponent), - new FieldMigration(KsFieldDataType.Guid, FieldDataType.LongText, "RelatedDocuments", FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent, [TcaDirective.ConvertToPages]), - new FieldMigration(KsFieldDataType.Guid, FieldDataType.Guid, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear), - new FieldMigration(KsFieldDataType.Binary, FieldDataType.Binary, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear), - new FieldMigration(KsFieldDataType.Xml, FieldDataType.Xml, SfcDirective.CatchAnyNonMatching, FormComponents.AdminNumberWithLabelComponent), - new FieldMigration(KsFieldDataType.DocRelationships, FieldDataType.WebPages, SfcDirective.CatchAnyNonMatching, FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent, [TcaDirective.ConvertToPages]), - - new FieldMigration(KsFieldDataType.TimeSpan, FieldDataType.TimeSpan, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextInputComponent, [TcaDirective.ConvertToPages]), - new FieldMigration(KsFieldDataType.BizFormFile, BizFormUploadFile.DATATYPE_FORMFILE, SfcDirective.CatchAnyNonMatching, FormComponents.MvcFileUploaderComponent, []) - ]); - - if (configuration.MigrateMediaToMediaLibrary) - { - m.AddRange([ - new FieldMigration(KsFieldDataType.DocAttachments, FieldDataType.Assets, SfcDirective.CatchAnyNonMatching, FormComponents.AdminAssetSelectorComponent, [TcaDirective.ConvertToAsset]), - new FieldMigration(KsFieldDataType.File, FieldDataType.Assets, SfcDirective.CatchAnyNonMatching, FormComponents.AdminAssetSelectorComponent, [TcaDirective.ConvertToAsset]), - ]); - } - else - { - m.AddRange([ - new FieldMigration(KsFieldDataType.DocAttachments, FieldDataType.ContentItemReference, SfcDirective.CatchAnyNonMatching, FormComponents.AdminContentItemSelectorComponent, [TcaDirective.ConvertToAsset]), - new FieldMigration(KsFieldDataType.File, FieldDataType.ContentItemReference, SfcDirective.CatchAnyNonMatching, FormComponents.AdminContentItemSelectorComponent, [TcaDirective.ConvertToAsset]), - ]); - } - - BuiltInFieldMigrations = [.. m]; - } - - public static FieldMigration[] BuiltInFieldMigrations { get; private set; } = null!; - - public static DataTypeMigrationModel BuiltInModel => new( - BuiltInFieldMigrations, - [ - new FormComponentReplacement(Kx13FormComponents.Kentico_AttachmentSelector, FormComponents.AdminAssetSelectorComponent), - new FormComponentReplacement(Kx13FormComponents.Kentico_PageSelector, FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent), - new FormComponentReplacement(Kx13FormComponents.Kentico_PathSelector, FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent) - ], - [] // legacy mode is no more - ); -} diff --git a/Migration.Toolkit.KXP/DependencyInjectionExtensions.cs b/Migration.Toolkit.KXP/DependencyInjectionExtensions.cs deleted file mode 100644 index 2b36c575..00000000 --- a/Migration.Toolkit.KXP/DependencyInjectionExtensions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Diagnostics; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; - -using Migration.Toolkit.Common; -using Migration.Toolkit.KXP.Context; - -namespace Migration.Toolkit.KXP; - -public static class DependencyInjectionExtensions -{ - public static IServiceCollection UseKxpDbContext(this IServiceCollection services, ToolkitConfiguration toolkitConfiguration) - { - services.AddDbContextFactory(options => - { - Debug.Assert(toolkitConfiguration.XbKConnectionString != null, "toolkitConfiguration.XbKConnectionString != null"); - options.UseSqlServer(toolkitConfiguration.XbKConnectionString); - }); - return services; - } -} diff --git a/Migration.Toolkit.KXP/Migration.Toolkit.KXP.csproj b/Migration.Toolkit.KXP/Migration.Toolkit.KXP.csproj deleted file mode 100644 index 4e7ce462..00000000 --- a/Migration.Toolkit.KXP/Migration.Toolkit.KXP.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - Migration.Toolkit.KXP - Migration.Toolkit.KXP - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - diff --git a/Migration.Toolkit.KXP/Models/CiFileMetadatum.cs b/Migration.Toolkit.KXP/Models/CiFileMetadatum.cs deleted file mode 100644 index 353f55fc..00000000 --- a/Migration.Toolkit.KXP/Models/CiFileMetadatum.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CI_FileMetadata")] -[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] -public class CiFileMetadatum -{ - [Key] - [Column("FileMetadataID")] - public int FileMetadataId { get; set; } - - [StringLength(260)] - public string FileLocation { get; set; } = null!; - - [StringLength(32)] - public string FileHash { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CiMigration.cs b/Migration.Toolkit.KXP/Models/CiMigration.cs deleted file mode 100644 index 57cc9e0f..00000000 --- a/Migration.Toolkit.KXP/Models/CiMigration.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CI_Migration")] -[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] -public class CiMigration -{ - [Key] - [Column("MigrationID")] - public int MigrationId { get; set; } - - [StringLength(255)] - public string MigrationName { get; set; } = null!; - - [Precision(3)] - public DateTime DateApplied { get; set; } - - public int? RowsAffected { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/CmsAlternativeForm.cs b/Migration.Toolkit.KXP/Models/CmsAlternativeForm.cs deleted file mode 100644 index 0c9f22c4..00000000 --- a/Migration.Toolkit.KXP/Models/CmsAlternativeForm.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_AlternativeForm")] -[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] -[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] -public class CmsAlternativeForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(50)] - public string FormName { get; set; } = null!; - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public string? FormDefinition { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - [Column("FormCoupledClassID")] - public int? FormCoupledClassId { get; set; } - - [StringLength(400)] - public string? FormCustomizedColumns { get; set; } - - public bool? FormIsCustom { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsAlternativeFormFormClasses")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormCoupledClassId")] - [InverseProperty("CmsAlternativeFormFormCoupledClasses")] - public virtual CmsClass? FormCoupledClass { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/CmsAutomationHistory.cs b/Migration.Toolkit.KXP/Models/CmsAutomationHistory.cs deleted file mode 100644 index 6de0bc59..00000000 --- a/Migration.Toolkit.KXP/Models/CmsAutomationHistory.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_AutomationHistory")] -[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] -[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] -[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] -[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] -[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] -[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] -public class CmsAutomationHistory -{ - [Key] - [Column("HistoryID")] - public int HistoryId { get; set; } - - [Column("HistoryStepID")] - public int? HistoryStepId { get; set; } - - [StringLength(440)] - public string? HistoryStepName { get; set; } - - [StringLength(450)] - public string HistoryStepDisplayName { get; set; } = null!; - - public int? HistoryStepType { get; set; } - - [Column("HistoryTargetStepID")] - public int? HistoryTargetStepId { get; set; } - - [StringLength(440)] - public string? HistoryTargetStepName { get; set; } - - [StringLength(450)] - public string? HistoryTargetStepDisplayName { get; set; } - - public int? HistoryTargetStepType { get; set; } - - [Column("HistoryApprovedByUserID")] - public int? HistoryApprovedByUserId { get; set; } - - public DateTime? HistoryApprovedWhen { get; set; } - - public string? HistoryComment { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - public bool HistoryWasRejected { get; set; } - - [Column("HistoryStateID")] - public int HistoryStateId { get; set; } - - [ForeignKey("HistoryApprovedByUserId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsUser? HistoryApprovedByUser { get; set; } - - [ForeignKey("HistoryStateId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsAutomationState HistoryState { get; set; } = null!; - - [ForeignKey("HistoryStepId")] - [InverseProperty("CmsAutomationHistoryHistorySteps")] - public virtual CmsWorkflowStep? HistoryStep { get; set; } - - [ForeignKey("HistoryTargetStepId")] - [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] - public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CmsAutomationState.cs b/Migration.Toolkit.KXP/Models/CmsAutomationState.cs deleted file mode 100644 index 16c3f2b8..00000000 --- a/Migration.Toolkit.KXP/Models/CmsAutomationState.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_AutomationState")] -[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] -[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] -[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] -[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] -public class CmsAutomationState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [Column("StateStepID")] - public int StateStepId { get; set; } - - [Column("StateObjectID")] - public int StateObjectId { get; set; } - - [StringLength(100)] - public string StateObjectType { get; set; } = null!; - - [StringLength(450)] - public string? StateActionStatus { get; set; } - - public DateTime? StateCreated { get; set; } - - public DateTime? StateLastModified { get; set; } - - [Column("StateWorkflowID")] - public int StateWorkflowId { get; set; } - - public int? StateStatus { get; set; } - - [Column("StateUserID")] - public int? StateUserId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public string? StateCustomData { get; set; } - - [InverseProperty("HistoryState")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [ForeignKey("StateStepId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflowStep StateStep { get; set; } = null!; - - [ForeignKey("StateUserId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsUser? StateUser { get; set; } - - [ForeignKey("StateWorkflowId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflow StateWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CmsAutomationTemplate.cs b/Migration.Toolkit.KXP/Models/CmsAutomationTemplate.cs deleted file mode 100644 index 9dedb728..00000000 --- a/Migration.Toolkit.KXP/Models/CmsAutomationTemplate.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_AutomationTemplate")] -[Index("TemplateDisplayName", Name = "IX_CMS_AutomationTemplate_TemplateDisplayName")] -public class CmsAutomationTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(250)] - public string TemplateDisplayName { get; set; } = null!; - - public string? TemplateDescription { get; set; } - - [StringLength(200)] - public string? TemplateIconClass { get; set; } - - public string? TemplateConfiguration { get; set; } - - public Guid TemplateGuid { get; set; } - - public DateTime TemplateLastModified { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/CmsClass.cs b/Migration.Toolkit.KXP/Models/CmsClass.cs deleted file mode 100644 index c5c76abe..00000000 --- a/Migration.Toolkit.KXP/Models/CmsClass.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Class")] -[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] -[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] -[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] -public class CmsClass -{ - [Key] - [Column("ClassID")] - public int ClassId { get; set; } - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - public string ClassXmlSchema { get; set; } = null!; - - public string ClassFormDefinition { get; set; } = null!; - - [StringLength(100)] - public string? ClassTableName { get; set; } - - public bool? ClassShowTemplateSelection { get; set; } - - public DateTime ClassLastModified { get; set; } - - [Column("ClassGUID")] - public Guid ClassGuid { get; set; } - - public string? ClassContactMapping { get; set; } - - public bool? ClassContactOverwriteEnabled { get; set; } - - [StringLength(100)] - public string? ClassConnectionString { get; set; } - - [StringLength(100)] - public string? ClassDefaultObjectType { get; set; } - - [Column("ClassResourceID")] - public int? ClassResourceId { get; set; } - - public string? ClassCodeGenerationSettings { get; set; } - - [StringLength(200)] - public string? ClassIconClass { get; set; } - - public bool ClassHasUnmanagedDbSchema { get; set; } - - [StringLength(10)] - public string ClassType { get; set; } = null!; - - [StringLength(10)] - public string? ClassContentTypeType { get; set; } - - public bool? ClassWebPageHasUrl { get; set; } - - [StringLength(100)] - public string? ClassShortName { get; set; } - - [ForeignKey("ClassResourceId")] - [InverseProperty("CmsClasses")] - public virtual CmsResource? ClassResource { get; set; } - - [InverseProperty("FormClass")] - public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); - - [InverseProperty("FormCoupledClass")] - public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); - - [InverseProperty("ContentItemContentType")] - public virtual ICollection CmsContentItems { get; set; } = new List(); - - [InverseProperty("ContentTypeChannelContentType")] - public virtual ICollection CmsContentTypeChannels { get; set; } = new List(); - - [InverseProperty("ContentWorkflowContentTypeContentType")] - public virtual ICollection CmsContentWorkflowContentTypes { get; set; } = new List(); - - [InverseProperty("FormClass")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsQueries { get; set; } = new List(); - - [InverseProperty("EmailTemplateContentTypeContentType")] - public virtual ICollection EmailLibraryEmailTemplateContentTypes { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsConsent.cs b/Migration.Toolkit.KXP/Models/CmsConsent.cs deleted file mode 100644 index 1207aaa8..00000000 --- a/Migration.Toolkit.KXP/Models/CmsConsent.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Consent")] -public class CmsConsent -{ - [Key] - [Column("ConsentID")] - public int ConsentId { get; set; } - - [StringLength(200)] - public string ConsentDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ConsentName { get; set; } = null!; - - public string ConsentContent { get; set; } = null!; - - public Guid ConsentGuid { get; set; } - - public DateTime ConsentLastModified { get; set; } - - [StringLength(100)] - public string ConsentHash { get; set; } = null!; - - [InverseProperty("ConsentAgreementConsent")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [InverseProperty("ConsentArchiveConsent")] - public virtual ICollection CmsConsentArchives { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsConsentAgreement.cs b/Migration.Toolkit.KXP/Models/CmsConsentAgreement.cs deleted file mode 100644 index 09a47584..00000000 --- a/Migration.Toolkit.KXP/Models/CmsConsentAgreement.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ConsentAgreement")] -[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] -public class CmsConsentAgreement -{ - [Key] - [Column("ConsentAgreementID")] - public int ConsentAgreementId { get; set; } - - public Guid ConsentAgreementGuid { get; set; } - - public bool ConsentAgreementRevoked { get; set; } - - [Column("ConsentAgreementContactID")] - public int ConsentAgreementContactId { get; set; } - - [Column("ConsentAgreementConsentID")] - public int ConsentAgreementConsentId { get; set; } - - [StringLength(100)] - public string? ConsentAgreementConsentHash { get; set; } - - public DateTime ConsentAgreementTime { get; set; } - - [ForeignKey("ConsentAgreementConsentId")] - [InverseProperty("CmsConsentAgreements")] - public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; - - [ForeignKey("ConsentAgreementContactId")] - [InverseProperty("CmsConsentAgreements")] - public virtual OmContact ConsentAgreementContact { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CmsConsentArchive.cs b/Migration.Toolkit.KXP/Models/CmsConsentArchive.cs deleted file mode 100644 index 0de47344..00000000 --- a/Migration.Toolkit.KXP/Models/CmsConsentArchive.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ConsentArchive")] -[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] -public class CmsConsentArchive -{ - [Key] - [Column("ConsentArchiveID")] - public int ConsentArchiveId { get; set; } - - public Guid ConsentArchiveGuid { get; set; } - - public DateTime ConsentArchiveLastModified { get; set; } - - [Column("ConsentArchiveConsentID")] - public int ConsentArchiveConsentId { get; set; } - - [StringLength(100)] - public string ConsentArchiveHash { get; set; } = null!; - - public string ConsentArchiveContent { get; set; } = null!; - - [ForeignKey("ConsentArchiveConsentId")] - [InverseProperty("CmsConsentArchives")] - public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CmsCountry.cs b/Migration.Toolkit.KXP/Models/CmsCountry.cs deleted file mode 100644 index 017234f5..00000000 --- a/Migration.Toolkit.KXP/Models/CmsCountry.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Country")] -public class CmsCountry -{ - [Key] - [Column("CountryID")] - public int CountryId { get; set; } - - [StringLength(200)] - public string CountryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CountryName { get; set; } = null!; - - [Column("CountryGUID")] - public Guid CountryGuid { get; set; } - - public DateTime CountryLastModified { get; set; } - - [StringLength(2)] - public string? CountryTwoLetterCode { get; set; } - - [StringLength(3)] - public string? CountryThreeLetterCode { get; set; } - - [InverseProperty("Country")] - public virtual ICollection CmsStates { get; set; } = new List(); - - [InverseProperty("AccountCountry")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactCountry")] - public virtual ICollection OmContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsCulture.cs b/Migration.Toolkit.KXP/Models/CmsCulture.cs deleted file mode 100644 index a15c13f0..00000000 --- a/Migration.Toolkit.KXP/Models/CmsCulture.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Culture")] -[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] -[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] -public class CmsCulture -{ - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; - - [StringLength(200)] - public string CultureShortName { get; set; } = null!; - - [Column("CultureGUID")] - public Guid CultureGuid { get; set; } - - public DateTime CultureLastModified { get; set; } - - [StringLength(100)] - public string? CultureAlias { get; set; } - - [Column("CultureIsUICulture")] - public bool? CultureIsUiculture { get; set; } - - [InverseProperty("TranslationCulture")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsEmail.cs b/Migration.Toolkit.KXP/Models/CmsEmail.cs deleted file mode 100644 index c9aa77d1..00000000 --- a/Migration.Toolkit.KXP/Models/CmsEmail.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Email")] -[Index("EmailEmailConfigurationId", Name = "IX_CMS_Email_EmailEmailConfigurationID")] -[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] -public class CmsEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [StringLength(254)] - public string EmailFrom { get; set; } = null!; - - [StringLength(998)] - public string? EmailTo { get; set; } - - [StringLength(998)] - public string? EmailCc { get; set; } - - [StringLength(998)] - public string? EmailBcc { get; set; } - - [StringLength(450)] - public string EmailSubject { get; set; } = null!; - - public string? EmailBody { get; set; } - - public string? EmailPlainTextBody { get; set; } - - public int EmailFormat { get; set; } - - public int EmailPriority { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - public int? EmailStatus { get; set; } - - [StringLength(254)] - public string? EmailReplyTo { get; set; } - - public string? EmailHeaders { get; set; } - - public DateTime? EmailCreated { get; set; } - - [Column("EmailEmailConfigurationID")] - public int? EmailEmailConfigurationId { get; set; } - - public Guid? EmailMailoutGuid { get; set; } - - [ForeignKey("EmailEmailConfigurationId")] - [InverseProperty("CmsEmails")] - public virtual EmailLibraryEmailConfiguration? EmailEmailConfiguration { get; set; } - - [ForeignKey("EmailId")] - [InverseProperty("Emails")] - public virtual ICollection Attachments { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsEmailAttachment.cs b/Migration.Toolkit.KXP/Models/CmsEmailAttachment.cs deleted file mode 100644 index 61c34863..00000000 --- a/Migration.Toolkit.KXP/Models/CmsEmailAttachment.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_EmailAttachment")] -public class CmsEmailAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[] AttachmentBinary { get; set; } = null!; - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - [Column("AttachmentContentID")] - [StringLength(255)] - public string? AttachmentContentId { get; set; } - - [ForeignKey("AttachmentId")] - [InverseProperty("Attachments")] - public virtual ICollection Emails { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsEventLog.cs b/Migration.Toolkit.KXP/Models/CmsEventLog.cs deleted file mode 100644 index b1621124..00000000 --- a/Migration.Toolkit.KXP/Models/CmsEventLog.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_EventLog")] -public class CmsEventLog -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(5)] - public string EventType { get; set; } = null!; - - public DateTime EventTime { get; set; } - - [StringLength(100)] - public string Source { get; set; } = null!; - - [StringLength(100)] - public string EventCode { get; set; } = null!; - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(250)] - public string? UserName { get; set; } - - [Column("IPAddress")] - [StringLength(100)] - public string? Ipaddress { get; set; } - - public string? EventDescription { get; set; } - - public string? EventUrl { get; set; } - - [StringLength(100)] - public string? EventMachineName { get; set; } - - public string? EventUserAgent { get; set; } - - public string? EventUrlReferrer { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/CmsExternalLogin.cs b/Migration.Toolkit.KXP/Models/CmsExternalLogin.cs deleted file mode 100644 index 92901e85..00000000 --- a/Migration.Toolkit.KXP/Models/CmsExternalLogin.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ExternalLogin")] -[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] -public class CmsExternalLogin -{ - [Key] - [Column("ExternalLoginID")] - public int ExternalLoginId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string LoginProvider { get; set; } = null!; - - [StringLength(100)] - public string IdentityKey { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsExternalLogins")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CmsForm.cs b/Migration.Toolkit.KXP/Models/CmsForm.cs deleted file mode 100644 index 4dddb38f..00000000 --- a/Migration.Toolkit.KXP/Models/CmsForm.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Form")] -[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] -public class CmsForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(100)] - public string FormName { get; set; } = null!; - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public int FormItems { get; set; } - - public string? FormReportFields { get; set; } - - [StringLength(400)] - public string? FormSubmitButtonText { get; set; } - - public int? FormAccess { get; set; } - - [StringLength(255)] - public string? FormSubmitButtonImage { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - public bool FormLogActivity { get; set; } - - public string? FormBuilderLayout { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsForms")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormId")] - [InverseProperty("Forms")] - public virtual ICollection Roles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsLicenseKey.cs b/Migration.Toolkit.KXP/Models/CmsLicenseKey.cs deleted file mode 100644 index 13f68bdb..00000000 --- a/Migration.Toolkit.KXP/Models/CmsLicenseKey.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_LicenseKey")] -public class CmsLicenseKey -{ - [Key] - [Column("LicenseKeyID")] - public int LicenseKeyId { get; set; } - - [StringLength(255)] - public string? LicenseDomain { get; set; } - - public string? LicenseKey { get; set; } - - [StringLength(200)] - public string? LicenseEdition { get; set; } - - [StringLength(200)] - public string? LicenseExpiration { get; set; } - - public int? LicenseServers { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/CmsMacroIdentity.cs b/Migration.Toolkit.KXP/Models/CmsMacroIdentity.cs deleted file mode 100644 index 21388438..00000000 --- a/Migration.Toolkit.KXP/Models/CmsMacroIdentity.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_MacroIdentity")] -[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] -public class CmsMacroIdentity -{ - [Key] - [Column("MacroIdentityID")] - public int MacroIdentityId { get; set; } - - public Guid MacroIdentityGuid { get; set; } - - public DateTime MacroIdentityLastModified { get; set; } - - [StringLength(200)] - public string MacroIdentityName { get; set; } = null!; - - [Column("MacroIdentityEffectiveUserID")] - public int? MacroIdentityEffectiveUserId { get; set; } - - [InverseProperty("UserMacroIdentityMacroIdentity")] - public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); - - [ForeignKey("MacroIdentityEffectiveUserId")] - [InverseProperty("CmsMacroIdentities")] - public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/CmsMacroRule.cs b/Migration.Toolkit.KXP/Models/CmsMacroRule.cs deleted file mode 100644 index 1af2baa5..00000000 --- a/Migration.Toolkit.KXP/Models/CmsMacroRule.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_MacroRule")] -public class CmsMacroRule -{ - [Key] - [Column("MacroRuleID")] - public int MacroRuleId { get; set; } - - [StringLength(200)] - public string MacroRuleName { get; set; } = null!; - - [StringLength(1000)] - public string MacroRuleText { get; set; } = null!; - - public string? MacroRuleParameters { get; set; } - - public DateTime MacroRuleLastModified { get; set; } - - [Column("MacroRuleGUID")] - public Guid MacroRuleGuid { get; set; } - - public string MacroRuleCondition { get; set; } = null!; - - [StringLength(500)] - public string MacroRuleDisplayName { get; set; } = null!; - - public bool? MacroRuleIsCustom { get; set; } - - [StringLength(450)] - public string? MacroRuleDescription { get; set; } - - public bool? MacroRuleEnabled { get; set; } - - [InverseProperty("MacroRule")] - public virtual ICollection CmsMacroRuleMacroRuleCategories { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsObjectWorkflowTrigger.cs b/Migration.Toolkit.KXP/Models/CmsObjectWorkflowTrigger.cs deleted file mode 100644 index 92686b2b..00000000 --- a/Migration.Toolkit.KXP/Models/CmsObjectWorkflowTrigger.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ObjectWorkflowTrigger")] -[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] -public class CmsObjectWorkflowTrigger -{ - [Key] - [Column("TriggerID")] - public int TriggerId { get; set; } - - [Column("TriggerGUID")] - public Guid TriggerGuid { get; set; } - - public DateTime TriggerLastModified { get; set; } - - public int TriggerType { get; set; } - - public string? TriggerMacroCondition { get; set; } - - [Column("TriggerWorkflowID")] - public int TriggerWorkflowId { get; set; } - - [StringLength(450)] - public string TriggerDisplayName { get; set; } = null!; - - [StringLength(100)] - public string TriggerObjectType { get; set; } = null!; - - public string? TriggerParameters { get; set; } - - [StringLength(100)] - public string? TriggerTargetObjectType { get; set; } - - [Column("TriggerTargetObjectID")] - public int? TriggerTargetObjectId { get; set; } - - [ForeignKey("TriggerWorkflowId")] - [InverseProperty("CmsObjectWorkflowTriggers")] - public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CmsPageTemplateConfiguration.cs b/Migration.Toolkit.KXP/Models/CmsPageTemplateConfiguration.cs deleted file mode 100644 index e35748e7..00000000 --- a/Migration.Toolkit.KXP/Models/CmsPageTemplateConfiguration.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_PageTemplateConfiguration")] -public class CmsPageTemplateConfiguration -{ - [Key] - [Column("PageTemplateConfigurationID")] - public int PageTemplateConfigurationId { get; set; } - - [Column("PageTemplateConfigurationGUID")] - public Guid PageTemplateConfigurationGuid { get; set; } - - public DateTime PageTemplateConfigurationLastModified { get; set; } - - [StringLength(200)] - public string PageTemplateConfigurationName { get; set; } = null!; - - public string? PageTemplateConfigurationDescription { get; set; } - - public string PageTemplateConfigurationTemplate { get; set; } = null!; - - public string? PageTemplateConfigurationWidgets { get; set; } - - [StringLength(200)] - public string PageTemplateConfigurationIcon { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CmsQuery.cs b/Migration.Toolkit.KXP/Models/CmsQuery.cs deleted file mode 100644 index 18b1b8fe..00000000 --- a/Migration.Toolkit.KXP/Models/CmsQuery.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Query")] -[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] -public class CmsQuery -{ - [Key] - [Column("QueryID")] - public int QueryId { get; set; } - - [StringLength(100)] - public string QueryName { get; set; } = null!; - - [Column("QueryTypeID")] - public int QueryTypeId { get; set; } - - public string QueryText { get; set; } = null!; - - public bool QueryRequiresTransaction { get; set; } - - [Column("ClassID")] - public int? ClassId { get; set; } - - public DateTime QueryLastModified { get; set; } - - [Column("QueryGUID")] - public Guid QueryGuid { get; set; } - - public bool? QueryIsCustom { get; set; } - - [StringLength(100)] - public string? QueryConnectionString { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsQueries")] - public virtual CmsClass? Class { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/CmsResource.cs b/Migration.Toolkit.KXP/Models/CmsResource.cs deleted file mode 100644 index 25a160df..00000000 --- a/Migration.Toolkit.KXP/Models/CmsResource.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Resource")] -[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] -public class CmsResource -{ - [Key] - [Column("ResourceID")] - public int ResourceId { get; set; } - - [StringLength(100)] - public string ResourceDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - public string? ResourceDescription { get; set; } - - [Column("ResourceGUID")] - public Guid ResourceGuid { get; set; } - - public DateTime ResourceLastModified { get; set; } - - public bool? ResourceIsInDevelopment { get; set; } - - [InverseProperty("ClassResource")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("CategoryResource")] - public virtual ICollection CmsSettingsCategories { get; set; } = new List(); - - [InverseProperty("ActionResource")] - public virtual ICollection CmsWorkflowActions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsResourceString.cs b/Migration.Toolkit.KXP/Models/CmsResourceString.cs deleted file mode 100644 index dad6a202..00000000 --- a/Migration.Toolkit.KXP/Models/CmsResourceString.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ResourceString")] -[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] -public class CmsResourceString -{ - [Key] - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("StringGUID")] - public Guid StringGuid { get; set; } - - [InverseProperty("TranslationString")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsResourceTranslation.cs b/Migration.Toolkit.KXP/Models/CmsResourceTranslation.cs deleted file mode 100644 index f81e9cd2..00000000 --- a/Migration.Toolkit.KXP/Models/CmsResourceTranslation.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ResourceTranslation")] -[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] -[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] -public class CmsResourceTranslation -{ - [Key] - [Column("TranslationID")] - public int TranslationId { get; set; } - - [Column("TranslationStringID")] - public int TranslationStringId { get; set; } - - public string? TranslationText { get; set; } - - [Column("TranslationCultureID")] - public int TranslationCultureId { get; set; } - - [ForeignKey("TranslationCultureId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsCulture TranslationCulture { get; set; } = null!; - - [ForeignKey("TranslationStringId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsResourceString TranslationString { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CmsRole.cs b/Migration.Toolkit.KXP/Models/CmsRole.cs deleted file mode 100644 index f2a42502..00000000 --- a/Migration.Toolkit.KXP/Models/CmsRole.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Role")] -public class CmsRole -{ - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - public DateTime RoleLastModified { get; set; } - - [InverseProperty("Role")] - public virtual ICollection CmsApplicationPermissions { get; set; } = new List(); - - [InverseProperty("ContentWorkflowStepRoleRole")] - public virtual ICollection CmsContentWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Forms { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsScheduledTask.cs b/Migration.Toolkit.KXP/Models/CmsScheduledTask.cs deleted file mode 100644 index fd47d4f0..00000000 --- a/Migration.Toolkit.KXP/Models/CmsScheduledTask.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ScheduledTask")] -[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] -[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] -public class CmsScheduledTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(200)] - public string TaskName { get; set; } = null!; - - [StringLength(200)] - public string TaskDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TaskAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string? TaskClass { get; set; } - - [StringLength(1000)] - public string TaskInterval { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime? TaskLastRunTime { get; set; } - - public DateTime? TaskNextRunTime { get; set; } - - public string? TaskLastResult { get; set; } - - public bool? TaskDeleteAfterLastRun { get; set; } - - [StringLength(100)] - public string? TaskServerName { get; set; } - - [Column("TaskGUID")] - public Guid TaskGuid { get; set; } - - public DateTime TaskLastModified { get; set; } - - public int? TaskExecutions { get; set; } - - [Column("TaskUserID")] - public int? TaskUserId { get; set; } - - public int? TaskType { get; set; } - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [StringLength(200)] - public string? TaskExecutingServerName { get; set; } - - public bool TaskEnabled { get; set; } - - public bool TaskIsRunning { get; set; } - - [ForeignKey("TaskUserId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsUser? TaskUser { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/CmsSettingsCategory.cs b/Migration.Toolkit.KXP/Models/CmsSettingsCategory.cs deleted file mode 100644 index 44bed3b0..00000000 --- a/Migration.Toolkit.KXP/Models/CmsSettingsCategory.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_SettingsCategory")] -[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] -[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] -public class CmsSettingsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - public int? CategoryOrder { get; set; } - - [StringLength(100)] - public string? CategoryName { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - [StringLength(200)] - public string? CategoryIconPath { get; set; } - - public bool? CategoryIsGroup { get; set; } - - public bool? CategoryIsCustom { get; set; } - - [Column("CategoryResourceID")] - public int? CategoryResourceId { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsSettingsCategory? CategoryParent { get; set; } - - [ForeignKey("CategoryResourceId")] - [InverseProperty("CmsSettingsCategories")] - public virtual CmsResource? CategoryResource { get; set; } - - [InverseProperty("KeyCategory")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsSettingsKey.cs b/Migration.Toolkit.KXP/Models/CmsSettingsKey.cs deleted file mode 100644 index f3fc64da..00000000 --- a/Migration.Toolkit.KXP/Models/CmsSettingsKey.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_SettingsKey")] -[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] -[Index("KeyName", Name = "IX_CMS_SettingsKey_KeyName")] -public class CmsSettingsKey -{ - [Key] - [Column("KeyID")] - public int KeyId { get; set; } - - [StringLength(100)] - public string KeyName { get; set; } = null!; - - [StringLength(200)] - public string KeyDisplayName { get; set; } = null!; - - public string? KeyDescription { get; set; } - - public string? KeyValue { get; set; } - - [StringLength(50)] - public string KeyType { get; set; } = null!; - - [Column("KeyCategoryID")] - public int? KeyCategoryId { get; set; } - - [Column("KeyGUID")] - public Guid KeyGuid { get; set; } - - public DateTime KeyLastModified { get; set; } - - public int? KeyOrder { get; set; } - - [StringLength(255)] - public string? KeyValidation { get; set; } - - [StringLength(200)] - public string? KeyEditingControlPath { get; set; } - - public bool? KeyIsCustom { get; set; } - - public bool? KeyIsHidden { get; set; } - - public string? KeyFormControlSettings { get; set; } - - public string? KeyExplanationText { get; set; } - - [ForeignKey("KeyCategoryId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSettingsCategory? KeyCategory { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/CmsState.cs b/Migration.Toolkit.KXP/Models/CmsState.cs deleted file mode 100644 index 4e7d8c06..00000000 --- a/Migration.Toolkit.KXP/Models/CmsState.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_State")] -[Index("CountryId", Name = "IX_CMS_State_CountryID")] -[Index("StateCode", Name = "IX_CMS_State_StateCode")] -public class CmsState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [StringLength(200)] - public string StateDisplayName { get; set; } = null!; - - [StringLength(200)] - public string StateName { get; set; } = null!; - - [StringLength(100)] - public string? StateCode { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public DateTime StateLastModified { get; set; } - - [ForeignKey("CountryId")] - [InverseProperty("CmsStates")] - public virtual CmsCountry Country { get; set; } = null!; - - [InverseProperty("AccountState")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactState")] - public virtual ICollection OmContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsTag.cs b/Migration.Toolkit.KXP/Models/CmsTag.cs deleted file mode 100644 index 31a7e305..00000000 --- a/Migration.Toolkit.KXP/Models/CmsTag.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Tag")] -[Index("TagParentId", Name = "IX_CMS_Tag_TagParentID")] -[Index("TagTaxonomyId", Name = "IX_CMS_Tag_TagTaxonomyID")] -public class CmsTag -{ - [Key] - [Column("TagID")] - public int TagId { get; set; } - - [StringLength(200)] - public string TagName { get; set; } = null!; - - [Column("TagGUID")] - public Guid TagGuid { get; set; } - - [Column("TagTaxonomyID")] - public int TagTaxonomyId { get; set; } - - [Column("TagParentID")] - public int? TagParentId { get; set; } - - public int? TagOrder { get; set; } - - public string? TagMetadata { get; set; } - - public DateTime TagLastModified { get; set; } - - [StringLength(200)] - public string TagTitle { get; set; } = null!; - - public string? TagDescription { get; set; } - - [InverseProperty("TagParent")] - public virtual ICollection InverseTagParent { get; set; } = new List(); - - [ForeignKey("TagParentId")] - [InverseProperty("InverseTagParent")] - public virtual CmsTag? TagParent { get; set; } - - [ForeignKey("TagTaxonomyId")] - [InverseProperty("CmsTags")] - public virtual CmsTaxonomy TagTaxonomy { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CmsUser.cs b/Migration.Toolkit.KXP/Models/CmsUser.cs deleted file mode 100644 index dba8b27c..00000000 --- a/Migration.Toolkit.KXP/Models/CmsUser.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_User")] -[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] -[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] -public class CmsUser -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(254)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - public bool UserEnabled { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool UserIsPendingRegistration { get; set; } - - public DateTime? UserRegistrationLinkExpiration { get; set; } - - public bool UserAdministrationAccess { get; set; } - - public bool UserIsExternal { get; set; } - - [InverseProperty("HistoryApprovedByUser")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateUser")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("ContentFolderCreatedByUser")] - public virtual ICollection CmsContentFolderContentFolderCreatedByUsers { get; set; } = new List(); - - [InverseProperty("ContentFolderModifiedByUser")] - public virtual ICollection CmsContentFolderContentFolderModifiedByUsers { get; set; } = new List(); - - [InverseProperty("ContentItemLanguageMetadataCreatedByUser")] - public virtual ICollection CmsContentItemLanguageMetadatumContentItemLanguageMetadataCreatedByUsers { get; set; } = new List(); - - [InverseProperty("ContentItemLanguageMetadataModifiedByUser")] - public virtual ICollection CmsContentItemLanguageMetadatumContentItemLanguageMetadataModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsExternalLogins { get; set; } = new List(); - - [InverseProperty("HeadlessTokenCreatedByUser")] - public virtual ICollection CmsHeadlessTokenHeadlessTokenCreatedByUsers { get; set; } = new List(); - - [InverseProperty("HeadlessTokenModifiedByUser")] - public virtual ICollection CmsHeadlessTokenHeadlessTokenModifiedByUsers { get; set; } = new List(); - - [InverseProperty("MacroIdentityEffectiveUser")] - public virtual ICollection CmsMacroIdentities { get; set; } = new List(); - - [InverseProperty("TaskUser")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("SmartFolderCreatedByUser")] - public virtual ICollection CmsSmartFolderSmartFolderCreatedByUsers { get; set; } = new List(); - - [InverseProperty("SmartFolderModifiedByUser")] - public virtual ICollection CmsSmartFolderSmartFolderModifiedByUsers { get; set; } = new List(); - - [InverseProperty("UserMacroIdentityUser")] - public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } - - [InverseProperty("User")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("FileCreatedByUser")] - public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); - - [InverseProperty("FileModifiedByUser")] - public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); - - [InverseProperty("AccountOwnerUser")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactOwnerUser")] - public virtual ICollection OmContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsUserMacroIdentity.cs b/Migration.Toolkit.KXP/Models/CmsUserMacroIdentity.cs deleted file mode 100644 index d8aa716e..00000000 --- a/Migration.Toolkit.KXP/Models/CmsUserMacroIdentity.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_UserMacroIdentity")] -[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] -[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] -public class CmsUserMacroIdentity -{ - [Key] - [Column("UserMacroIdentityID")] - public int UserMacroIdentityId { get; set; } - - public DateTime UserMacroIdentityLastModified { get; set; } - - [Column("UserMacroIdentityUserID")] - public int UserMacroIdentityUserId { get; set; } - - [Column("UserMacroIdentityMacroIdentityID")] - public int? UserMacroIdentityMacroIdentityId { get; set; } - - public Guid UserMacroIdentityUserGuid { get; set; } - - [ForeignKey("UserMacroIdentityMacroIdentityId")] - [InverseProperty("CmsUserMacroIdentities")] - public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } - - [ForeignKey("UserMacroIdentityUserId")] - [InverseProperty("CmsUserMacroIdentity")] - public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CmsUserRole.cs b/Migration.Toolkit.KXP/Models/CmsUserRole.cs deleted file mode 100644 index 90659046..00000000 --- a/Migration.Toolkit.KXP/Models/CmsUserRole.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_UserRole")] -[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] -[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] -public class CmsUserRole -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("UserRoleID")] - public int UserRoleId { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsUser User { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmServer.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmServer.cs deleted file mode 100644 index 15fc5a70..00000000 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmServer.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WebFarmServer")] -[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] -public class CmsWebFarmServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(300)] - public string ServerDisplayName { get; set; } = null!; - - [StringLength(300)] - public string ServerName { get; set; } = null!; - - [Column("ServerGUID")] - public Guid? ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public bool ServerEnabled { get; set; } - - [InverseProperty("Server")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmServerLog.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmServerLog.cs deleted file mode 100644 index 59883950..00000000 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmServerLog.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WebFarmServerLog")] -public class CmsWebFarmServerLog -{ - [Key] - [Column("WebFarmServerLogID")] - public int WebFarmServerLogId { get; set; } - - public DateTime LogTime { get; set; } - - [StringLength(200)] - public string LogCode { get; set; } = null!; - - [Column("ServerID")] - public int ServerId { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmServerMonitoring.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmServerMonitoring.cs deleted file mode 100644 index 3b9e907a..00000000 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmServerMonitoring.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WebFarmServerMonitoring")] -public class CmsWebFarmServerMonitoring -{ - [Key] - [Column("WebFarmServerMonitoringID")] - public int WebFarmServerMonitoringId { get; set; } - - [Column("ServerID")] - public int ServerId { get; set; } - - public DateTime? ServerPing { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmServerTask.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmServerTask.cs deleted file mode 100644 index 9fdc5689..00000000 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmServerTask.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[PrimaryKey("ServerId", "TaskId")] -[Table("CMS_WebFarmServerTask")] -[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] -public class CmsWebFarmServerTask -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - public string? ErrorMessage { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmServer Server { get; set; } = null!; - - [ForeignKey("TaskId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmTask Task { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmTask.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmTask.cs deleted file mode 100644 index fc29c367..00000000 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmTask.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WebFarmTask")] -[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] -public class CmsWebFarmTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(100)] - public string TaskType { get; set; } = null!; - - public string? TaskTextData { get; set; } - - public byte[]? TaskBinaryData { get; set; } - - public DateTime? TaskCreated { get; set; } - - public string? TaskTarget { get; set; } - - [StringLength(450)] - public string? TaskMachineName { get; set; } - - [Column("TaskGUID")] - public Guid? TaskGuid { get; set; } - - public bool? TaskIsAnonymous { get; set; } - - public string? TaskErrorMessage { get; set; } - - public bool? TaskIsMemory { get; set; } - - [InverseProperty("Task")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsWorkflow.cs b/Migration.Toolkit.KXP/Models/CmsWorkflow.cs deleted file mode 100644 index 5110faf8..00000000 --- a/Migration.Toolkit.KXP/Models/CmsWorkflow.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Workflow")] -public class CmsWorkflow -{ - [Key] - [Column("WorkflowID")] - public int WorkflowId { get; set; } - - public string WorkflowDisplayName { get; set; } = null!; - - [StringLength(450)] - public string WorkflowName { get; set; } = null!; - - [Column("WorkflowGUID")] - public Guid WorkflowGuid { get; set; } - - public DateTime WorkflowLastModified { get; set; } - - public bool? WorkflowAutoPublishChanges { get; set; } - - public bool? WorkflowUseCheckinCheckout { get; set; } - - public int? WorkflowType { get; set; } - - public bool? WorkflowSendEmails { get; set; } - - public bool? WorkflowSendApproveEmails { get; set; } - - public bool? WorkflowSendRejectEmails { get; set; } - - public bool? WorkflowSendPublishEmails { get; set; } - - public bool? WorkflowSendArchiveEmails { get; set; } - - [StringLength(200)] - public string? WorkflowApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowPublishedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowArchivedTemplateName { get; set; } - - public bool? WorkflowSendReadyForApprovalEmails { get; set; } - - [StringLength(200)] - public string? WorkflowReadyForApprovalTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowNotificationTemplateName { get; set; } - - public string? WorkflowAllowedObjects { get; set; } - - public int? WorkflowRecurrenceType { get; set; } - - public bool WorkflowEnabled { get; set; } - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateWorkflow")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("TriggerWorkflow")] - public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); - - [InverseProperty("StepWorkflow")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); - - [InverseProperty("TransitionWorkflow")] - public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsWorkflowAction.cs b/Migration.Toolkit.KXP/Models/CmsWorkflowAction.cs deleted file mode 100644 index 6c2bf70a..00000000 --- a/Migration.Toolkit.KXP/Models/CmsWorkflowAction.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WorkflowAction")] -[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] -public class CmsWorkflowAction -{ - [Key] - [Column("ActionID")] - public int ActionId { get; set; } - - [StringLength(200)] - public string ActionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ActionName { get; set; } = null!; - - public string? ActionParameters { get; set; } - - public string? ActionDescription { get; set; } - - [StringLength(200)] - public string ActionAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string ActionClass { get; set; } = null!; - - [Column("ActionResourceID")] - public int? ActionResourceId { get; set; } - - [Column("ActionGUID")] - public Guid ActionGuid { get; set; } - - public DateTime ActionLastModified { get; set; } - - public bool ActionEnabled { get; set; } - - public string? ActionAllowedObjects { get; set; } - - public int? ActionWorkflowType { get; set; } - - [StringLength(200)] - public string? ActionIconClass { get; set; } - - [StringLength(200)] - public string? ActionThumbnailClass { get; set; } - - [StringLength(200)] - public string? ActionDataProviderClass { get; set; } - - [StringLength(200)] - public string? ActionDataProviderAssemblyName { get; set; } - - [ForeignKey("ActionResourceId")] - [InverseProperty("CmsWorkflowActions")] - public virtual CmsResource? ActionResource { get; set; } - - [InverseProperty("StepAction")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/CmsWorkflowStep.cs b/Migration.Toolkit.KXP/Models/CmsWorkflowStep.cs deleted file mode 100644 index 239dd3df..00000000 --- a/Migration.Toolkit.KXP/Models/CmsWorkflowStep.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WorkflowStep")] -[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] -[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] -[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] -[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] -public class CmsWorkflowStep -{ - [Key] - [Column("StepID")] - public int StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [StringLength(440)] - public string? StepName { get; set; } - - public int? StepOrder { get; set; } - - [Column("StepWorkflowID")] - public int StepWorkflowId { get; set; } - - [Column("StepGUID")] - public Guid StepGuid { get; set; } - - public DateTime StepLastModified { get; set; } - - public int? StepType { get; set; } - - public bool? StepAllowReject { get; set; } - - public string? StepDefinition { get; set; } - - public int? StepRolesSecurity { get; set; } - - public int? StepUsersSecurity { get; set; } - - [StringLength(200)] - public string? StepApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? StepRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? StepReadyforApprovalTemplateName { get; set; } - - public bool? StepSendApproveEmails { get; set; } - - public bool? StepSendRejectEmails { get; set; } - - public bool? StepSendReadyForApprovalEmails { get; set; } - - public bool? StepSendEmails { get; set; } - - public bool? StepAllowPublish { get; set; } - - [Column("StepActionID")] - public int? StepActionId { get; set; } - - public string? StepActionParameters { get; set; } - - public int? StepWorkflowType { get; set; } - - [InverseProperty("HistoryStep")] - public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); - - [InverseProperty("HistoryTargetStep")] - public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("StateStep")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("TransitionEndStep")] - public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); - - [InverseProperty("TransitionStartStep")] - public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); - - [ForeignKey("StepActionId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflowAction? StepAction { get; set; } - - [ForeignKey("StepWorkflowId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflow StepWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/CmsWorkflowTransition.cs b/Migration.Toolkit.KXP/Models/CmsWorkflowTransition.cs deleted file mode 100644 index a211e807..00000000 --- a/Migration.Toolkit.KXP/Models/CmsWorkflowTransition.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WorkflowTransition")] -[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] -[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] -[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] -public class CmsWorkflowTransition -{ - [Key] - [Column("TransitionID")] - public int TransitionId { get; set; } - - [Column("TransitionStartStepID")] - public int TransitionStartStepId { get; set; } - - [Column("TransitionEndStepID")] - public int TransitionEndStepId { get; set; } - - public int TransitionType { get; set; } - - public DateTime TransitionLastModified { get; set; } - - [Column("TransitionSourcePointGUID")] - public Guid? TransitionSourcePointGuid { get; set; } - - [Column("TransitionWorkflowID")] - public int TransitionWorkflowId { get; set; } - - [ForeignKey("TransitionEndStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] - public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; - - [ForeignKey("TransitionStartStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] - public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; - - [ForeignKey("TransitionWorkflowId")] - [InverseProperty("CmsWorkflowTransitions")] - public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/MediaFile.cs b/Migration.Toolkit.KXP/Models/MediaFile.cs deleted file mode 100644 index 9e2544de..00000000 --- a/Migration.Toolkit.KXP/Models/MediaFile.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("Media_File")] -[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] -[Index("FileGuid", Name = "IX_Media_File_FileGUID")] -[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] -[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] -public class MediaFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string FileTitle { get; set; } = null!; - - public string FileDescription { get; set; } = null!; - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public string FilePath { get; set; } = null!; - - public long FileSize { get; set; } - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileLibraryID")] - public int FileLibraryId { get; set; } - - [Column("FileCreatedByUserID")] - public int? FileCreatedByUserId { get; set; } - - public DateTime FileCreatedWhen { get; set; } - - [Column("FileModifiedByUserID")] - public int? FileModifiedByUserId { get; set; } - - public DateTime FileModifiedWhen { get; set; } - - public string? FileCustomData { get; set; } - - [ForeignKey("FileCreatedByUserId")] - [InverseProperty("MediaFileFileCreatedByUsers")] - public virtual CmsUser? FileCreatedByUser { get; set; } - - [ForeignKey("FileLibraryId")] - [InverseProperty("MediaFiles")] - public virtual MediaLibrary FileLibrary { get; set; } = null!; - - [ForeignKey("FileModifiedByUserId")] - [InverseProperty("MediaFileFileModifiedByUsers")] - public virtual CmsUser? FileModifiedByUser { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/MediaLibrary.cs b/Migration.Toolkit.KXP/Models/MediaLibrary.cs deleted file mode 100644 index 3d337beb..00000000 --- a/Migration.Toolkit.KXP/Models/MediaLibrary.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("Media_Library")] -[Index("LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] -public class MediaLibrary -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [StringLength(250)] - public string LibraryName { get; set; } = null!; - - [StringLength(250)] - public string LibraryDisplayName { get; set; } = null!; - - public string? LibraryDescription { get; set; } - - [StringLength(250)] - public string LibraryFolder { get; set; } = null!; - - public int? LibraryAccess { get; set; } - - [Column("LibraryGUID")] - public Guid? LibraryGuid { get; set; } - - public DateTime? LibraryLastModified { get; set; } - - [InverseProperty("FileLibrary")] - public virtual ICollection MediaFiles { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/OmAccount.cs b/Migration.Toolkit.KXP/Models/OmAccount.cs deleted file mode 100644 index e4d1039b..00000000 --- a/Migration.Toolkit.KXP/Models/OmAccount.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_Account")] -[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] -[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] -[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] -[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] -[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] -[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] -[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] -public class OmAccount -{ - [Key] - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [ForeignKey("AccountCountryId")] - [InverseProperty("OmAccounts")] - public virtual CmsCountry? AccountCountry { get; set; } - - [ForeignKey("AccountOwnerUserId")] - [InverseProperty("OmAccounts")] - public virtual CmsUser? AccountOwnerUser { get; set; } - - [ForeignKey("AccountPrimaryContactId")] - [InverseProperty("OmAccountAccountPrimaryContacts")] - public virtual OmContact? AccountPrimaryContact { get; set; } - - [ForeignKey("AccountSecondaryContactId")] - [InverseProperty("OmAccountAccountSecondaryContacts")] - public virtual OmContact? AccountSecondaryContact { get; set; } - - [ForeignKey("AccountStateId")] - [InverseProperty("OmAccounts")] - public virtual CmsState? AccountState { get; set; } - - [ForeignKey("AccountStatusId")] - [InverseProperty("OmAccounts")] - public virtual OmAccountStatus? AccountStatus { get; set; } - - [ForeignKey("AccountSubsidiaryOfId")] - [InverseProperty("InverseAccountSubsidiaryOf")] - public virtual OmAccount? AccountSubsidiaryOf { get; set; } - - [InverseProperty("AccountSubsidiaryOf")] - public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); - - [InverseProperty("Account")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/OmAccountContact.cs b/Migration.Toolkit.KXP/Models/OmAccountContact.cs deleted file mode 100644 index ffee7d57..00000000 --- a/Migration.Toolkit.KXP/Models/OmAccountContact.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_AccountContact")] -[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] -[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] -[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] -public class OmAccountContact -{ - [Key] - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("AccountId")] - [InverseProperty("OmAccountContacts")] - public virtual OmAccount Account { get; set; } = null!; - - [ForeignKey("ContactId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("ContactRoleId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContactRole? ContactRole { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/OmAccountStatus.cs b/Migration.Toolkit.KXP/Models/OmAccountStatus.cs deleted file mode 100644 index 7ef6da94..00000000 --- a/Migration.Toolkit.KXP/Models/OmAccountStatus.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_AccountStatus")] -public class OmAccountStatus -{ - [Key] - [Column("AccountStatusID")] - public int AccountStatusId { get; set; } - - [StringLength(200)] - public string AccountStatusName { get; set; } = null!; - - [StringLength(200)] - public string AccountStatusDisplayName { get; set; } = null!; - - public string? AccountStatusDescription { get; set; } - - [InverseProperty("AccountStatus")] - public virtual ICollection OmAccounts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/OmActivity.cs b/Migration.Toolkit.KXP/Models/OmActivity.cs deleted file mode 100644 index e6c76d3b..00000000 --- a/Migration.Toolkit.KXP/Models/OmActivity.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_Activity")] -[Index("ActivityChannelId", Name = "IX_OM_Activity_ActivityChannelID")] -[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] -[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] -[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] -[Index("ActivityLanguageId", Name = "IX_OM_Activity_ActivityLanguageID")] -[Index("ActivityType", "ActivityItemId", "ActivityWebPageItemGuid", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityWebPageItemGUID_ActivityUTMSource_ActivityUTMContent")] -public class OmActivity -{ - [Key] - [Column("ActivityID")] - public int ActivityId { get; set; } - - [Column("ActivityContactID")] - public int ActivityContactId { get; set; } - - public DateTime? ActivityCreated { get; set; } - - [StringLength(250)] - public string ActivityType { get; set; } = null!; - - [Column("ActivityItemID")] - public int? ActivityItemId { get; set; } - - [Column("ActivityItemDetailID")] - public int? ActivityItemDetailId { get; set; } - - [StringLength(250)] - public string? ActivityValue { get; set; } - - [Column("ActivityURL")] - public string? ActivityUrl { get; set; } - - [StringLength(250)] - public string? ActivityTitle { get; set; } - - public string? ActivityComment { get; set; } - - [Column("ActivityURLReferrer")] - public string? ActivityUrlreferrer { get; set; } - - [Column("ActivityUTMSource")] - [StringLength(200)] - public string? ActivityUtmsource { get; set; } - - [Column("ActivityUTMContent")] - [StringLength(200)] - public string? ActivityUtmcontent { get; set; } - - [Column("ActivityTrackedWebsiteID")] - public int? ActivityTrackedWebsiteId { get; set; } - - [Column("ActivityWebPageItemGUID")] - public Guid? ActivityWebPageItemGuid { get; set; } - - [Column("ActivityLanguageID")] - public int? ActivityLanguageId { get; set; } - - [Column("ActivityChannelID")] - public int? ActivityChannelId { get; set; } - - [ForeignKey("ActivityChannelId")] - [InverseProperty("OmActivities")] - public virtual CmsChannel? ActivityChannel { get; set; } - - [ForeignKey("ActivityLanguageId")] - [InverseProperty("OmActivities")] - public virtual CmsContentLanguage? ActivityLanguage { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/OmActivityRecalculationQueue.cs b/Migration.Toolkit.KXP/Models/OmActivityRecalculationQueue.cs deleted file mode 100644 index caf1179e..00000000 --- a/Migration.Toolkit.KXP/Models/OmActivityRecalculationQueue.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ActivityRecalculationQueue")] -public class OmActivityRecalculationQueue -{ - [Key] - [Column("ActivityRecalculationQueueID")] - public int ActivityRecalculationQueueId { get; set; } - - [Column("ActivityRecalculationQueueActivityID")] - public int ActivityRecalculationQueueActivityId { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/OmActivityType.cs b/Migration.Toolkit.KXP/Models/OmActivityType.cs deleted file mode 100644 index dccc96d8..00000000 --- a/Migration.Toolkit.KXP/Models/OmActivityType.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ActivityType")] -public class OmActivityType -{ - [Key] - [Column("ActivityTypeID")] - public int ActivityTypeId { get; set; } - - [StringLength(250)] - public string ActivityTypeDisplayName { get; set; } = null!; - - [StringLength(250)] - public string ActivityTypeName { get; set; } = null!; - - public bool? ActivityTypeEnabled { get; set; } - - public bool? ActivityTypeIsCustom { get; set; } - - public string? ActivityTypeDescription { get; set; } - - public bool? ActivityTypeManualCreationAllowed { get; set; } - - [StringLength(200)] - public string? ActivityTypeMainFormControl { get; set; } - - [StringLength(200)] - public string? ActivityTypeDetailFormControl { get; set; } - - [StringLength(7)] - public string? ActivityTypeColor { get; set; } - - [StringLength(200)] - public string? ActivityTypeItemObjectType { get; set; } - - [StringLength(200)] - public string? ActivityTypeItemDetailObjectType { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/OmContact.cs b/Migration.Toolkit.KXP/Models/OmContact.cs deleted file mode 100644 index 786f9c68..00000000 --- a/Migration.Toolkit.KXP/Models/OmContact.cs +++ /dev/null @@ -1,136 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_Contact")] -[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] -[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] -[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] -[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] -[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] -[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] -[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] -public class OmContact -{ - [Key] - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(50)] - public string? ContactJobTitle { get; set; } - - [StringLength(100)] - public string? ContactAddress1 { get; set; } - - [StringLength(100)] - public string? ContactCity { get; set; } - - [Column("ContactZIP")] - [StringLength(100)] - public string? ContactZip { get; set; } - - [Column("ContactStateID")] - public int? ContactStateId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [StringLength(26)] - public string? ContactMobilePhone { get; set; } - - [StringLength(26)] - public string? ContactBusinessPhone { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - public DateTime? ContactBirthday { get; set; } - - public int? ContactGender { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - public string? ContactNotes { get; set; } - - [Column("ContactOwnerUserID")] - public int? ContactOwnerUserId { get; set; } - - public bool? ContactMonitored { get; set; } - - [Column("ContactGUID")] - public Guid ContactGuid { get; set; } - - public DateTime ContactLastModified { get; set; } - - public DateTime ContactCreated { get; set; } - - public int? ContactBounces { get; set; } - - [StringLength(200)] - public string? ContactCampaign { get; set; } - - [Column("ContactSalesForceLeadID")] - [StringLength(18)] - public string? ContactSalesForceLeadId { get; set; } - - public bool? ContactSalesForceLeadReplicationDisabled { get; set; } - - public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } - - public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } - - [StringLength(100)] - public string? ContactCompanyName { get; set; } - - public bool? ContactSalesForceLeadReplicationRequired { get; set; } - - [InverseProperty("ConsentAgreementContact")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [ForeignKey("ContactCountryId")] - [InverseProperty("OmContacts")] - public virtual CmsCountry? ContactCountry { get; set; } - - [ForeignKey("ContactOwnerUserId")] - [InverseProperty("OmContacts")] - public virtual CmsUser? ContactOwnerUser { get; set; } - - [ForeignKey("ContactStateId")] - [InverseProperty("OmContacts")] - public virtual CmsState? ContactState { get; set; } - - [ForeignKey("ContactStatusId")] - [InverseProperty("OmContacts")] - public virtual OmContactStatus? ContactStatus { get; set; } - - [InverseProperty("EmailMarketingRecipientContact")] - public virtual ICollection EmailLibraryEmailMarketingRecipients { get; set; } = new List(); - - [InverseProperty("EmailSubscriptionConfirmationContact")] - public virtual ICollection EmailLibraryEmailSubscriptionConfirmations { get; set; } = new List(); - - [InverseProperty("AccountPrimaryContact")] - public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); - - [InverseProperty("AccountSecondaryContact")] - public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); - - [InverseProperty("VisitorToContactContact")] - public virtual ICollection OmVisitorToContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/OmContactChangeRecalculationQueue.cs b/Migration.Toolkit.KXP/Models/OmContactChangeRecalculationQueue.cs deleted file mode 100644 index f61627b5..00000000 --- a/Migration.Toolkit.KXP/Models/OmContactChangeRecalculationQueue.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ContactChangeRecalculationQueue")] -public class OmContactChangeRecalculationQueue -{ - [Key] - [Column("ContactChangeRecalculationQueueID")] - public int ContactChangeRecalculationQueueId { get; set; } - - [Column("ContactChangeRecalculationQueueContactID")] - public int ContactChangeRecalculationQueueContactId { get; set; } - - public string? ContactChangeRecalculationQueueChangedColumns { get; set; } - - public bool ContactChangeRecalculationQueueContactIsNew { get; set; } - - public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/OmContactGroup.cs b/Migration.Toolkit.KXP/Models/OmContactGroup.cs deleted file mode 100644 index e5619d41..00000000 --- a/Migration.Toolkit.KXP/Models/OmContactGroup.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ContactGroup")] -public class OmContactGroup -{ - [Key] - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [StringLength(200)] - public string ContactGroupName { get; set; } = null!; - - [StringLength(200)] - public string ContactGroupDisplayName { get; set; } = null!; - - public string? ContactGroupDescription { get; set; } - - public string? ContactGroupDynamicCondition { get; set; } - - public bool? ContactGroupEnabled { get; set; } - - public DateTime? ContactGroupLastModified { get; set; } - - [Column("ContactGroupGUID")] - public Guid? ContactGroupGuid { get; set; } - - public int? ContactGroupStatus { get; set; } - - public bool? ContactGroupIsRecipientList { get; set; } - - [InverseProperty("EmailSubscriptionConfirmationRecipientList")] - public virtual ICollection EmailLibraryEmailSubscriptionConfirmations { get; set; } = new List(); - - [InverseProperty("RecipientListSettingsRecipientList")] - public virtual ICollection EmailLibraryRecipientListSettings { get; set; } = new List(); - - [InverseProperty("SendConfigurationRecipientList")] - public virtual ICollection EmailLibrarySendConfigurations { get; set; } = new List(); - - [InverseProperty("ContactGroupMemberContactGroup")] - public virtual ICollection OmContactGroupMembers { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/OmContactGroupMember.cs b/Migration.Toolkit.KXP/Models/OmContactGroupMember.cs deleted file mode 100644 index 1142d0a6..00000000 --- a/Migration.Toolkit.KXP/Models/OmContactGroupMember.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ContactGroupMember")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] -[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] -public class OmContactGroupMember -{ - [Key] - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - public int ContactGroupMemberType { get; set; } - - [Column("ContactGroupMemberRelatedID")] - public int ContactGroupMemberRelatedId { get; set; } - - public bool? ContactGroupMemberFromCondition { get; set; } - - public bool? ContactGroupMemberFromAccount { get; set; } - - public bool? ContactGroupMemberFromManual { get; set; } - - [ForeignKey("ContactGroupMemberContactGroupId")] - [InverseProperty("OmContactGroupMembers")] - public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/OmContactRole.cs b/Migration.Toolkit.KXP/Models/OmContactRole.cs deleted file mode 100644 index efde5179..00000000 --- a/Migration.Toolkit.KXP/Models/OmContactRole.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ContactRole")] -public class OmContactRole -{ - [Key] - [Column("ContactRoleID")] - public int ContactRoleId { get; set; } - - [StringLength(200)] - public string ContactRoleName { get; set; } = null!; - - [StringLength(200)] - public string ContactRoleDisplayName { get; set; } = null!; - - public string? ContactRoleDescription { get; set; } - - [InverseProperty("ContactRole")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/OmContactStatus.cs b/Migration.Toolkit.KXP/Models/OmContactStatus.cs deleted file mode 100644 index 510a7ea6..00000000 --- a/Migration.Toolkit.KXP/Models/OmContactStatus.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ContactStatus")] -public class OmContactStatus -{ - [Key] - [Column("ContactStatusID")] - public int ContactStatusId { get; set; } - - [StringLength(200)] - public string ContactStatusName { get; set; } = null!; - - [StringLength(200)] - public string ContactStatusDisplayName { get; set; } = null!; - - public string? ContactStatusDescription { get; set; } - - [InverseProperty("ContactStatus")] - public virtual ICollection OmContacts { get; set; } = new List(); -} diff --git a/Migration.Toolkit.KXP/Models/OmVisitorToContact.cs b/Migration.Toolkit.KXP/Models/OmVisitorToContact.cs deleted file mode 100644 index a89494bf..00000000 --- a/Migration.Toolkit.KXP/Models/OmVisitorToContact.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_VisitorToContact")] -[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] -[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] -public class OmVisitorToContact -{ - [Key] - [Column("VisitorToContactID")] - public int VisitorToContactId { get; set; } - - [Column("VisitorToContactVisitorGUID")] - public Guid VisitorToContactVisitorGuid { get; set; } - - [Column("VisitorToContactContactID")] - public int VisitorToContactContactId { get; set; } - - [ForeignKey("VisitorToContactContactId")] - [InverseProperty("OmVisitorToContacts")] - public virtual OmContact VisitorToContactContact { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/TempFile.cs b/Migration.Toolkit.KXP/Models/TempFile.cs deleted file mode 100644 index 27644dc4..00000000 --- a/Migration.Toolkit.KXP/Models/TempFile.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("Temp_File")] -public class TempFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileParentGUID")] - public Guid FileParentGuid { get; set; } - - public int FileNumber { get; set; } - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - public long FileSize { get; set; } - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - public byte[]? FileBinary { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - public DateTime FileLastModified { get; set; } - - [StringLength(200)] - public string FileDirectory { get; set; } = null!; - - [StringLength(200)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string? FileTitle { get; set; } - - public string? FileDescription { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/TempPageBuilderWidget.cs b/Migration.Toolkit.KXP/Models/TempPageBuilderWidget.cs deleted file mode 100644 index 3c64a9a3..00000000 --- a/Migration.Toolkit.KXP/Models/TempPageBuilderWidget.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace Migration.Toolkit.KXP.Models; - -[Table("Temp_PageBuilderWidgets")] -public class TempPageBuilderWidget -{ - [Key] - [Column("PageBuilderWidgetsID")] - public int PageBuilderWidgetsId { get; set; } - - public string? PageBuilderWidgetsConfiguration { get; set; } - - public Guid PageBuilderWidgetsGuid { get; set; } - - public DateTime PageBuilderWidgetsLastModified { get; set; } - - public string? PageBuilderTemplateConfiguration { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/ViewCmsResourceStringJoined.cs b/Migration.Toolkit.KXP/Models/ViewCmsResourceStringJoined.cs deleted file mode 100644 index 1c48896c..00000000 --- a/Migration.Toolkit.KXP/Models/ViewCmsResourceStringJoined.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Keyless] -public class ViewCmsResourceStringJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("TranslationID")] - public int? TranslationId { get; set; } - - [Column("TranslationStringID")] - public int? TranslationStringId { get; set; } - - [Column("TranslationCultureID")] - public int? TranslationCultureId { get; set; } - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int? CultureId { get; set; } - - [StringLength(200)] - public string? CultureName { get; set; } - - [StringLength(50)] - public string? CultureCode { get; set; } - - [Column("CultureGUID")] - public Guid? CultureGuid { get; set; } - - public DateTime? CultureLastModified { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Toolkit.KXP/Models/ViewCmsResourceTranslatedJoined.cs deleted file mode 100644 index b6082023..00000000 --- a/Migration.Toolkit.KXP/Models/ViewCmsResourceTranslatedJoined.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Keyless] -public class ViewCmsResourceTranslatedJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Toolkit.KXP/Models/ViewOmAccountContactAccountJoined.cs deleted file mode 100644 index e00f2b47..00000000 --- a/Migration.Toolkit.KXP/Models/ViewOmAccountContactAccountJoined.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Keyless] -public class ViewOmAccountContactAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/ViewOmAccountContactContactJoined.cs b/Migration.Toolkit.KXP/Models/ViewOmAccountContactContactJoined.cs deleted file mode 100644 index 3ee15fa9..00000000 --- a/Migration.Toolkit.KXP/Models/ViewOmAccountContactContactJoined.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Keyless] -public class ViewOmAccountContactContactJoined -{ - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } -} diff --git a/Migration.Toolkit.KXP/Models/ViewOmAccountJoined.cs b/Migration.Toolkit.KXP/Models/ViewOmAccountJoined.cs deleted file mode 100644 index 7c466bc8..00000000 --- a/Migration.Toolkit.KXP/Models/ViewOmAccountJoined.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Keyless] -public class ViewOmAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [StringLength(100)] - public string? PrimaryContactFirstName { get; set; } - - [StringLength(100)] - public string? PrimaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? PrimaryContactLastName { get; set; } - - [StringLength(100)] - public string? SecondaryContactFirstName { get; set; } - - [StringLength(100)] - public string? SecondaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? SecondaryContactLastName { get; set; } - - [StringLength(200)] - public string? SubsidiaryOfName { get; set; } - - [StringLength(302)] - public string PrimaryContactFullName { get; set; } = null!; - - [StringLength(302)] - public string SecondaryContactFullName { get; set; } = null!; - - [StringLength(201)] - public string AccountFullAddress { get; set; } = null!; -} diff --git a/Migration.Toolkit.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Toolkit.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs deleted file mode 100644 index 23d00a33..00000000 --- a/Migration.Toolkit.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Keyless] -public class ViewOmContactGroupMemberAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } -} diff --git a/Migration.Toolkit.Model/DataClassModel.cs b/Migration.Toolkit.Model/DataClassModel.cs deleted file mode 100644 index 06b5d9d3..00000000 --- a/Migration.Toolkit.Model/DataClassModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Migration.Toolkit.Model; - -public class DataClassModel -{ - public virtual int ClassID { get; set; } - public virtual string ClassDisplayName { get; set; } - - public string ClassXmlSchema { get; set; } - public string ClassSearchSettings { get; set; } - public string ClassCodeGenerationSettings { get; set; } - public int ClassFormLayoutType { get; set; } -} \ No newline at end of file diff --git a/Migration.Toolkit.Tests/Migration.Toolkit.Tests.csproj b/Migration.Toolkit.Tests/Migration.Toolkit.Tests.csproj deleted file mode 100644 index 1613102e..00000000 --- a/Migration.Toolkit.Tests/Migration.Toolkit.Tests.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - false - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - diff --git a/Migration.Toolkit.sln b/Migration.Toolkit.sln deleted file mode 100644 index 705245a9..00000000 --- a/Migration.Toolkit.sln +++ /dev/null @@ -1,114 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.CLI", "Migration.Toolkit.CLI\Migration.Toolkit.CLI.csproj", "{EA5BB39B-9871-4C3B-ADCD-987D0C985E21}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.KX13", "Migration.Toolkit.KX13\Migration.Toolkit.KX13.csproj", "{C834C407-683B-4251-A4CD-52C135DCA518}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.KXP", "Migration.Toolkit.KXP\Migration.Toolkit.KXP.csproj", "{5F3DCE58-E1ED-4190-B3DA-610AA4F166A0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.Common", "Migration.Toolkit.Common\Migration.Toolkit.Common.csproj", "{CE8ED7D2-DA7B-4106-BADA-A70E2DFCCAAF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.Core.KX13", "Migration.Toolkit.Core.KX13\Migration.Toolkit.Core.KX13.csproj", "{1F7DC18B-CF87-4AB2-A5CC-094125246954}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.KXP.Api", "Migration.Toolkit.KXP.Api\Migration.Toolkit.KXP.Api.csproj", "{8E806DDF-6405-4386-B69E-B6FAA672A188}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.KXP.Extensions", "Migration.Toolkit.KXP.Extensions\Migration.Toolkit.KXP.Extensions.csproj", "{B601194D-192B-4539-8AB0-9813130EFAD7}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Instance.Extensions", "Instance.Extensions", "{D06721D3-6E2D-4235-B146-2BB80DF2DBA9}" - ProjectSection(SolutionItems) = preProject - KX13.Extensions\ToolkitApiController.cs = KX13.Extensions\ToolkitApiController.cs - KX13.NET48.Extensions\ToolkitApiController.NET48.cs = KX13.NET48.Extensions\ToolkitApiController.NET48.cs - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.Tests", "Migration.Toolkit.Tests\Migration.Toolkit.Tests.csproj", "{FEA68426-F772-419D-989D-C6ADDA757344}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.KX12", "Migration.Toolkit.KX12\Migration.Toolkit.KX12.csproj", "{CAC43720-697A-43C2-8F75-2D029AD2ABFD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.Core.KX12", "Migration.Toolkit.Core.KX12\Migration.Toolkit.Core.KX12.csproj", "{8094319D-85E5-430C-BBC0-345C9AA8CBF2}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KX13", "KX13", "{5695AAC9-FF68-4AC2-ABFC-0FD5A512D3C3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KX12", "KX12", "{F823E280-75D2-4C82-825E-CB6FB00E7067}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "K11", "K11", "{1EA44136-F86A-4545-9B77-E480EAB649A3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.Core.K11", "Migration.Toolkit.Core.K11\Migration.Toolkit.Core.K11.csproj", "{361EF54F-8043-467A-87AC-1F3E0461F1F5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.K11", "Migration.Toolkit.K11\Migration.Toolkit.K11.csproj", "{1829633A-CEF8-47F0-8588-1BE5E9307218}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KVA", "KVA", "{296DCE8F-D009-4DE5-997D-6BD51611C546}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.Source", "KVA\Migration.Toolkit.Source\Migration.Toolkit.Source.csproj", "{C565B800-032C-44E4-A913-659C24E9A3EC}" -EndProject - -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EA5BB39B-9871-4C3B-ADCD-987D0C985E21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EA5BB39B-9871-4C3B-ADCD-987D0C985E21}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EA5BB39B-9871-4C3B-ADCD-987D0C985E21}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EA5BB39B-9871-4C3B-ADCD-987D0C985E21}.Release|Any CPU.Build.0 = Release|Any CPU - {C834C407-683B-4251-A4CD-52C135DCA518}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C834C407-683B-4251-A4CD-52C135DCA518}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C834C407-683B-4251-A4CD-52C135DCA518}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C834C407-683B-4251-A4CD-52C135DCA518}.Release|Any CPU.Build.0 = Release|Any CPU - {5F3DCE58-E1ED-4190-B3DA-610AA4F166A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5F3DCE58-E1ED-4190-B3DA-610AA4F166A0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5F3DCE58-E1ED-4190-B3DA-610AA4F166A0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5F3DCE58-E1ED-4190-B3DA-610AA4F166A0}.Release|Any CPU.Build.0 = Release|Any CPU - {CE8ED7D2-DA7B-4106-BADA-A70E2DFCCAAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE8ED7D2-DA7B-4106-BADA-A70E2DFCCAAF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE8ED7D2-DA7B-4106-BADA-A70E2DFCCAAF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE8ED7D2-DA7B-4106-BADA-A70E2DFCCAAF}.Release|Any CPU.Build.0 = Release|Any CPU - {1F7DC18B-CF87-4AB2-A5CC-094125246954}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F7DC18B-CF87-4AB2-A5CC-094125246954}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F7DC18B-CF87-4AB2-A5CC-094125246954}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F7DC18B-CF87-4AB2-A5CC-094125246954}.Release|Any CPU.Build.0 = Release|Any CPU - {8E806DDF-6405-4386-B69E-B6FAA672A188}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E806DDF-6405-4386-B69E-B6FAA672A188}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E806DDF-6405-4386-B69E-B6FAA672A188}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E806DDF-6405-4386-B69E-B6FAA672A188}.Release|Any CPU.Build.0 = Release|Any CPU - {B601194D-192B-4539-8AB0-9813130EFAD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B601194D-192B-4539-8AB0-9813130EFAD7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B601194D-192B-4539-8AB0-9813130EFAD7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B601194D-192B-4539-8AB0-9813130EFAD7}.Release|Any CPU.Build.0 = Release|Any CPU - {FEA68426-F772-419D-989D-C6ADDA757344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FEA68426-F772-419D-989D-C6ADDA757344}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FEA68426-F772-419D-989D-C6ADDA757344}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FEA68426-F772-419D-989D-C6ADDA757344}.Release|Any CPU.Build.0 = Release|Any CPU - {95356D0D-5AC1-40DB-885F-901CF33AB532}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {95356D0D-5AC1-40DB-885F-901CF33AB532}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CAC43720-697A-43C2-8F75-2D029AD2ABFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CAC43720-697A-43C2-8F75-2D029AD2ABFD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CAC43720-697A-43C2-8F75-2D029AD2ABFD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CAC43720-697A-43C2-8F75-2D029AD2ABFD}.Release|Any CPU.Build.0 = Release|Any CPU - {8094319D-85E5-430C-BBC0-345C9AA8CBF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8094319D-85E5-430C-BBC0-345C9AA8CBF2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8094319D-85E5-430C-BBC0-345C9AA8CBF2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8094319D-85E5-430C-BBC0-345C9AA8CBF2}.Release|Any CPU.Build.0 = Release|Any CPU - {361EF54F-8043-467A-87AC-1F3E0461F1F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {361EF54F-8043-467A-87AC-1F3E0461F1F5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {361EF54F-8043-467A-87AC-1F3E0461F1F5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {361EF54F-8043-467A-87AC-1F3E0461F1F5}.Release|Any CPU.Build.0 = Release|Any CPU - {1829633A-CEF8-47F0-8588-1BE5E9307218}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1829633A-CEF8-47F0-8588-1BE5E9307218}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1829633A-CEF8-47F0-8588-1BE5E9307218}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1829633A-CEF8-47F0-8588-1BE5E9307218}.Release|Any CPU.Build.0 = Release|Any CPU - {C565B800-032C-44E4-A913-659C24E9A3EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C565B800-032C-44E4-A913-659C24E9A3EC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C565B800-032C-44E4-A913-659C24E9A3EC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C565B800-032C-44E4-A913-659C24E9A3EC}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {8094319D-85E5-430C-BBC0-345C9AA8CBF2} = {F823E280-75D2-4C82-825E-CB6FB00E7067} - {CAC43720-697A-43C2-8F75-2D029AD2ABFD} = {F823E280-75D2-4C82-825E-CB6FB00E7067} - {1F7DC18B-CF87-4AB2-A5CC-094125246954} = {5695AAC9-FF68-4AC2-ABFC-0FD5A512D3C3} - {C834C407-683B-4251-A4CD-52C135DCA518} = {5695AAC9-FF68-4AC2-ABFC-0FD5A512D3C3} - {361EF54F-8043-467A-87AC-1F3E0461F1F5} = {1EA44136-F86A-4545-9B77-E480EAB649A3} - {1829633A-CEF8-47F0-8588-1BE5E9307218} = {1EA44136-F86A-4545-9B77-E480EAB649A3} - {C565B800-032C-44E4-A913-659C24E9A3EC} = {296DCE8F-D009-4DE5-997D-6BD51611C546} - EndGlobalSection -EndGlobal diff --git a/README.md b/README.md index 26c62136..5dba5dae 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## Description -This repository is part of the [Xperience by Kentico Migration Toolkit](https://github.com/Kentico/xperience-by-kentico-migration-toolkit). +This repository is part of the [Xperience by Kentico Migration Tool](https://github.com/Kentico/xperience-by-kentico-migration-tool). The Kentico Migration Tool transfers content and other data from **Kentico Xperience 13**, **Kentico 12** or **Kentico 11** to **Xperience by Kentico**. @@ -28,27 +28,27 @@ The Kentico Migration Tool transfers content and other data from **Kentico Xperi Follow the steps below to run the Kentico Migration Tool: -1. Clone or download the Migration.Toolkit source code from this repository. -2. Open the `Migration.Toolkit.sln` solution in Visual Studio. -3. Configure the options in the `Migration.Toolkit.CLI/appsettings.json` configuration file. See [`Migration.Toolkit.CLI/README.md - Configuration`](./Migration.Toolkit.CLI/README.md#Configuration) for details. +1. Clone or download the Migration.Tool source code from this repository. +2. Open the `Migration.Tool.sln` solution in Visual Studio. +3. Configure the options in the `Migration.Tool.CLI/appsettings.json` configuration file. See [`Migration.Tool.CLI/README.md - Configuration`](./Migration.Tool.CLI/README.md#Configuration) for details. 4. Rebuild the solution and restore all required NuGet packages. 5. Open the command line prompt. -6. Navigate to the output directory of the `Migration.Toolkit.CLI` project. -7. Run the `Migration.Toolkit.CLI.exe migrate` command. +6. Navigate to the output directory of the `Migration.Tool.CLI` project. +7. Run the `Migration.Tool.CLI.exe migrate` command. - The following example shows the command with all parameters for complete migration: ```powershell - Migration.Toolkit.CLI.exe migrate --sites --custom-modules --users --settings-keys --page-types --pages --attachments --contact-management --forms --media-libraries --data-protection --countries + Migration.Tool.CLI.exe migrate --sites --custom-modules --users --settings-keys --page-types --pages --attachments --contact-management --forms --media-libraries --data-protection --countries ``` 8. Observe the command line output. The command output is also stored in a log file (`logs\log-.txt` under the output directory by default), which you can review later. 9. Review the migration protocol, which provides information about the result of the migration, lists required manual steps, etc. - You can find the protocol in the location specified by the `MigrationProtocolPath` key in the `appsettings.json` configuration file. - - For more information, see [`Migration.Toolkit.CLI/MIGRATION_PROTOCOL_REFERENCE.md`](./Migration.Toolkit.CLI/MIGRATION_PROTOCOL_REFERENCE.md). + - For more information, see [`Migration.Tool.CLI/MIGRATION_PROTOCOL_REFERENCE.md`](./Migration.Tool.CLI/MIGRATION_PROTOCOL_REFERENCE.md). -The data is now migrated to the target Xperience by Kentico instance according to your configuration. See [`Migration.Toolkit.CLI/README.md`](./Migration.Toolkit.CLI/README.md) for detailed information about the migration CLI, configuration options, instructions related to individual object types, and manual migration steps. +The data is now migrated to the target Xperience by Kentico instance according to your configuration. See [`Migration.Tool.CLI/README.md`](./Migration.Tool.CLI/README.md) for detailed information about the migration CLI, configuration options, instructions related to individual object types, and manual migration steps. ## Full Instructions diff --git a/Tests/autorun/run-test.ps1 b/Tests/autorun/run-test.ps1 index d1873495..35301bcf 100644 --- a/Tests/autorun/run-test.ps1 +++ b/Tests/autorun/run-test.ps1 @@ -32,8 +32,8 @@ function Get-ScriptDirectory { $runDate = Get-Date -Format "yyyyMMdd_HH-mm" $currentDir = Get-ScriptDirectory -$toolkitDir = Join-Path -Path $currentDir -ChildPath "../../Migration.Toolkit.CLI/" -$toolkitBuildDir = Join-Path -Path $currentDir -ChildPath "mt_build" +$toolDir = Join-Path -Path $currentDir -ChildPath "../../Migration.Tool.CLI/" +$toolBuildDir = Join-Path -Path $currentDir -ChildPath "mt_build" $commandOutputDir = Join-Path -Path $currentDir -ChildPath "run-$runDate/" $commandOutputLog = Join-Path -Path $currentDir -ChildPath "run-$runDate/run.log" $results = Join-Path -Path $currentDir -ChildPath "run-$runDate/results.log" @@ -50,15 +50,15 @@ if ($ProjectName -eq $null -or $ProjectName -eq '') { [System.IO.Directory]::CreateDirectory($commandOutputDir) | Out-Null; try { - Write-Output "Set location $toolkitDir" - set-location $toolkitDir + Write-Output "Set location $toolDir" + set-location $toolDir Write-Output "Starting transcript" Start-Transcript -Path $commandOutputLog -NoClobber -Append - # build toolkit - Write-Output "dotnet publish -c Release -f net6.0 --self-contained false --runtime win-x64 -o '$toolkitBuildDir'" - dotnet publish -c Release -f net6.0 --self-contained false --runtime win-x64 -o "$toolkitBuildDir" + # build tool + Write-Output "dotnet publish -c Release -f net6.0 --self-contained false --runtime win-x64 -o '$toolBuildDir'" + dotnet publish -c Release -f net6.0 --self-contained false --runtime win-x64 -o "$toolBuildDir" # install XbK if($InstallXbK -eq $true) { @@ -68,8 +68,8 @@ try { Invoke-Expression $installCmd } - set-location $toolkitBuildDir - .\Migration.Toolkit.CLI.exe migrate --nowait --siteId 1 --contact-management --custom-modules --settings-keys --page-types --pages --forms --attachments --culture en-US --sites --media-libraries --users | Out-Host # forcing transcript to pick up stream with Out-Host + set-location $toolBuildDir + .\Migration.Tool.CLI.exe migrate --nowait --siteId 1 --contact-management --custom-modules --settings-keys --page-types --pages --forms --attachments --culture en-US --sites --media-libraries --users | Out-Host # forcing transcript to pick up stream with Out-Host Write-Output "Reading log" diff --git a/docs/Contributing-Setup.md b/docs/Contributing-Setup.md index bf0c4549..ef3bf81e 100644 --- a/docs/Contributing-Setup.md +++ b/docs/Contributing-Setup.md @@ -1,3 +1,3 @@ # Contributing Setup -Please provide all available information about the problem or error when submitting issues. If possible, include the command line output log file and migration protocol generated by the `Migration.Toolkit.CLI.exe migrate` command. +Please provide all available information about the problem or error when submitting issues. If possible, include the command line output log file and migration protocol generated by the `Migration.Tool.CLI.exe migrate` command. diff --git a/docs/Supported-Data.md b/docs/Supported-Data.md index 91f7e30a..62a958e6 100644 --- a/docs/Supported-Data.md +++ b/docs/Supported-Data.md @@ -17,7 +17,7 @@ Currently, the Kentico Migration Tool supports the following types of data: - Macro expressions in page type field default values or other settings. Content type fields containing macros will not work correctly after the migration. - Categories for page type fields. Field categories are not migrated with page types. - Page type inheritance. Page types that inherit fields are migrated including all inherited fields but the binding to the parent page type is not preserved. - - However, you can create [reusable field schemas](../Migration.Toolkit.CLI/README.md#convert-page-types-to-reusable-field-schemas) for page types from which other page types inherit. + - However, you can create [reusable field schemas](../Migration.Tool.CLI/README.md#convert-page-types-to-reusable-field-schemas) for page types from which other page types inherit. - All migrated Content types have the **Include in routing** option enabled (the migration never creates pages without URL and routing). - **Pages** - The migration includes the following versions of pages: @@ -29,11 +29,11 @@ Currently, the Kentico Migration Tool supports the following types of data: - Page permissions (ACLs) are currently not supported in Xperience by Kentico and are not migrated. - Migration of Page Builder content is only available for Kentico Xperience 13. - **Page attachments** - - Page attachments are not supported in Xperience by Kentico. Attachments are migrated into media libraries. See [`Migration.Toolkit.CLI/README.md - Attachments`](../Migration.Toolkit.CLI/README.md#Attachments) for detailed information about the conversion process. + - Page attachments are not supported in Xperience by Kentico. Attachments are migrated into media libraries. See [`Migration.Tool.CLI/README.md - Attachments`](../Migration.Tool.CLI/README.md#Attachments) for detailed information about the conversion process. - **Preset page templates** (_Custom page templates_ in Kentico Xperience 13) - Migration of custom page templates is only available for Kentico Xperience 13. - **Categories** - - Xperience by Kentico uses a different approach to categorization. Categories are migrated to [taxonomies](https://docs.kentico.com/x/taxonomies_xp) and selected categories for each page are assigned to pages in the target instance via a [reusable field schema](https://docs.kentico.com/x/D4_OD). See [`Migration.Toolkit.CLI/README.md - Categories`](../Migration.Toolkit.CLI/README.md#categories). + - Xperience by Kentico uses a different approach to categorization. Categories are migrated to [taxonomies](https://docs.kentico.com/x/taxonomies_xp) and selected categories for each page are assigned to pages in the target instance via a [reusable field schema](https://docs.kentico.com/x/D4_OD). See [`Migration.Tool.CLI/README.md - Categories`](../Migration.Tool.CLI/README.md#categories). - [Categories stored as a field of pages](https://docs.kentico.com/x/wA_RBg) and [personal categories](https://docs.kentico.com/x/IgqRBg) are not supported. - **Media libraries and media files** - Media library permissions are currently not supported in Xperience by Kentico and are not migrated. diff --git a/docs/Usage-Guide.md b/docs/Usage-Guide.md index 9ef4ad1a..9b4b1b34 100644 --- a/docs/Usage-Guide.md +++ b/docs/Usage-Guide.md @@ -15,7 +15,7 @@ The migration currently supports the Kentico Xperience 13, Kentico 12 or Kentico - The source instance's database and file system must be accessible from the environment where you run the Kentico Migration Tool. - All features described in this repository are available for migration from Kentico Xperience 13. -[![Kentico Xperience 13 upgrade paths](/images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-kentico-xperience-13-embedded.jpg)](/images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-kentico-xperience-13-embedded.jpg) +[![Kentico Xperience 13 upgrade paths](/images/xperience-by-kentico-migration-tool-kentico-migration-tool-kentico-xperience-13-embedded.jpg)](/images/xperience-by-kentico-migration-tool-kentico-migration-tool-kentico-xperience-13-embedded.jpg) ### Kentico 12 MVC @@ -25,7 +25,7 @@ The migration currently supports the Kentico Xperience 13, Kentico 12 or Kentico - The source instance's database and file system must be accessible from the environment where you run the this tool. - This repository describes the migration of the Kentico Xperience 13 feature set, however only features relevant to Kentico 12 MVC are migrated for this version. -[![Kentico Xperience 12 MVC upgrade paths](/images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-kentico-12-mvc-embedded.jpg)](/images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-kentico-12-mvc-embedded.jpg) +[![Kentico Xperience 12 MVC upgrade paths](/images/xperience-by-kentico-migration-tool-kentico-migration-tool-kentico-12-mvc-embedded.jpg)](/images/xperience-by-kentico-migration-tool-kentico-migration-tool-kentico-12-mvc-embedded.jpg) ### Kentico 11 and 12 Portal Engine @@ -33,10 +33,10 @@ The migration currently supports the Kentico Xperience 13, Kentico 12 or Kentico - If you encounter any issues, it is recommended to update to the latest hotfix. - The source instance's database and file system must be accessible from the environment where you run the this tool. - Migration of Page Builder content is not supported. Only structured data of pages is migrated. - - As a result, [source instance API discovery](/Migration.Toolkit.CLI/README.md#source-instance-api-discovery) is also not available. + - As a result, [source instance API discovery](/Migration.Tool.CLI/README.md#source-instance-api-discovery) is also not available. - This repository describes the migration of the Kentico Xperience 13 feature set, however only features relevant to Kentico 11 and 12 Portal Engine are migrated for this version. -[![Kentico Xperience Portal Engine upgrade paths](/images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-kentico-10-12-portal-engine-embedded.jpg)](/images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-kentico-10-12-portal-engine-embedded.jpg) +[![Kentico Xperience Portal Engine upgrade paths](/images/xperience-by-kentico-migration-tool-kentico-migration-tool-kentico-10-12-portal-engine-embedded.jpg)](/images/xperience-by-kentico-migration-tool-kentico-migration-tool-kentico-10-12-portal-engine-embedded.jpg) ## Target @@ -49,7 +49,7 @@ The migration currently supports the Kentico Xperience 13, Kentico 12 or Kentico The full set of upgrade paths to Xperience by Kentico can be seen below. -[![Full Kentico upgrade paths to Xperience by Kentico](/images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-full-embedded.jpg)](/images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-full-embedded.jpg) +[![Full Kentico upgrade paths to Xperience by Kentico](/images/xperience-by-kentico-migration-tool-kentico-migration-tool-full-embedded.jpg)](/images/xperience-by-kentico-migration-tool-kentico-migration-tool-full-embedded.jpg) ## Migration paths review diff --git a/global.json b/global.json index 0a0c1515..72d38cd2 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ -{ - "sdk": { - "version": "8.0.100", - "rollForward": "latestMajor", - "allowPrerelease": false - } +{ + "sdk": { + "version": "8.0.100", + "rollForward": "latestMajor", + "allowPrerelease": false + } } \ No newline at end of file diff --git a/images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-full-embedded.jpg b/images/xperience-by-kentico-migration-tool-kentico-migration-tool-full-embedded.jpg similarity index 100% rename from images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-full-embedded.jpg rename to images/xperience-by-kentico-migration-tool-kentico-migration-tool-full-embedded.jpg diff --git a/images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-kentico-10-12-portal-engine-embedded.jpg b/images/xperience-by-kentico-migration-tool-kentico-migration-tool-kentico-10-12-portal-engine-embedded.jpg similarity index 100% rename from images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-kentico-10-12-portal-engine-embedded.jpg rename to images/xperience-by-kentico-migration-tool-kentico-migration-tool-kentico-10-12-portal-engine-embedded.jpg diff --git a/images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-kentico-12-mvc-embedded.jpg b/images/xperience-by-kentico-migration-tool-kentico-migration-tool-kentico-12-mvc-embedded.jpg similarity index 100% rename from images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-kentico-12-mvc-embedded.jpg rename to images/xperience-by-kentico-migration-tool-kentico-migration-tool-kentico-12-mvc-embedded.jpg diff --git a/images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-kentico-xperience-13-embedded.jpg b/images/xperience-by-kentico-migration-tool-kentico-migration-tool-kentico-xperience-13-embedded.jpg similarity index 100% rename from images/xperience-by-kentico-migration-toolkit-kentico-migration-tool-kentico-xperience-13-embedded.jpg rename to images/xperience-by-kentico-migration-tool-kentico-migration-tool-kentico-xperience-13-embedded.jpg