diff --git a/.github/ISSUE_TEMPLATE/02_feature_request.yml b/.github/ISSUE_TEMPLATE/02_feature_request.yml
deleted file mode 100644
index 5d53b2f12e..0000000000
--- a/.github/ISSUE_TEMPLATE/02_feature_request.yml
+++ /dev/null
@@ -1,33 +0,0 @@
----
-name: 📮 Feature Request
-description: Open a feature request, if you want to propose a new feature.
-labels: type/feature
-body:
-- type: dropdown
- id: version
- attributes:
- label: Umbraco version
- description: Which major Umbraco version are you proposing a feature for?
- options:
- - v8
- - v9
- validations:
- required: true
-- type: textarea
- id: summary
- attributes:
- label: Description
- description: Write a brief desciption of your proposed new feature.
- validations:
- required: true
-- type: textarea
- attributes:
- label: How can you help?
- id: help
- description: Umbraco''s core team has limited available time, but maybe you can help?
- placeholder: >
- If we can not work on your suggestion, please don't take it personally. Most likely, it's either:
-
- - We think your idea is valid, but we can't find the time to work on it.
-
- - Your idea might be better suited as a package, if it's not suitable for the majority of users.
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index d5418ad270..ecf10b8854 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,5 +1,8 @@
blank_issues_enabled: false
contact_links:
+ - name: 💡 Features and ideas
+ url: https://github.com/umbraco/Umbraco-CMS/discussions/new?category=features-and-ideas
+ about: Start a new discussion when you have ideas or feature requests, eventually discussions can turn into plans
- name: ⁉️ Support Question
url: https://our.umbraco.com
about: This issue tracker is NOT meant for support questions. If you have a question, please join us on the forum.
diff --git a/src/Umbraco.Core/Configuration/Models/NuCacheSerializerType.cs b/src/Umbraco.Core/Configuration/Models/NuCacheSerializerType.cs
new file mode 100644
index 0000000000..8f889b10c3
--- /dev/null
+++ b/src/Umbraco.Core/Configuration/Models/NuCacheSerializerType.cs
@@ -0,0 +1,14 @@
+// Copyright (c) Umbraco.
+// See LICENSE for more details.
+
+namespace Umbraco.Cms.Core.Configuration.Models
+{
+ ///
+ /// The serializer type that nucache uses to persist documents in the database.
+ ///
+ public enum NuCacheSerializerType
+ {
+ MessagePack = 1, // Default
+ JSON = 2
+ }
+}
diff --git a/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs b/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs
index e09d6adb24..b71c374c3f 100644
--- a/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs
+++ b/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs
@@ -13,5 +13,15 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// Gets or sets a value defining the BTree block size.
///
public int? BTreeBlockSize { get; set; }
+
+ ///
+ /// The serializer type that nucache uses to persist documents in the database.
+ ///
+ public NuCacheSerializerType NuCacheSerializerType { get; set; } = NuCacheSerializerType.MessagePack;
+
+ ///
+ /// The paging size to use for nucache SQL queries.
+ ///
+ public int SqlPageSize { get; set; } = 1000;
}
}
diff --git a/src/Umbraco.Core/Constants-SqlTemplates.cs b/src/Umbraco.Core/Constants-SqlTemplates.cs
index 116f04925e..c6bee5ca4f 100644
--- a/src/Umbraco.Core/Constants-SqlTemplates.cs
+++ b/src/Umbraco.Core/Constants-SqlTemplates.cs
@@ -1,4 +1,4 @@
-namespace Umbraco.Cms.Core
+namespace Umbraco.Cms.Core
{
public static partial class Constants
{
@@ -24,6 +24,20 @@
{
public const string EnsureUniqueNodeName = "Umbraco.Core.DataTypeDefinitionRepository.EnsureUniqueNodeName";
}
+
+ public static class NuCacheDatabaseDataSource
+ {
+ public const string WhereNodeId = "Umbraco.Web.PublishedCache.NuCache.DataSource.WhereNodeId";
+ public const string WhereNodeIdX = "Umbraco.Web.PublishedCache.NuCache.DataSource.WhereNodeIdX";
+ public const string SourcesSelectUmbracoNodeJoin = "Umbraco.Web.PublishedCache.NuCache.DataSource.SourcesSelectUmbracoNodeJoin";
+ public const string ContentSourcesSelect = "Umbraco.Web.PublishedCache.NuCache.DataSource.ContentSourcesSelect";
+ public const string ContentSourcesCount = "Umbraco.Web.PublishedCache.NuCache.DataSource.ContentSourcesCount";
+ public const string MediaSourcesSelect = "Umbraco.Web.PublishedCache.NuCache.DataSource.MediaSourcesSelect";
+ public const string MediaSourcesCount = "Umbraco.Web.PublishedCache.NuCache.DataSource.MediaSourcesCount";
+ public const string ObjectTypeNotTrashedFilter = "Umbraco.Web.PublishedCache.NuCache.DataSource.ObjectTypeNotTrashedFilter";
+ public const string OrderByLevelIdSortOrder = "Umbraco.Web.PublishedCache.NuCache.DataSource.OrderByLevelIdSortOrder";
+
+ }
}
}
}
diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
index c513e9910b..f9fde4c47e 100644
--- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
+++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
@@ -29,6 +29,8 @@ using Umbraco.Cms.Core.Manifest;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.PropertyEditors;
+using Umbraco.Cms.Core.PublishedCache;
+using Umbraco.Cms.Core.PublishedCache.Internal;
using Umbraco.Cms.Core.Routing;
using Umbraco.Cms.Core.Runtime;
using Umbraco.Cms.Core.Security;
@@ -229,6 +231,9 @@ namespace Umbraco.Cms.Core.DependencyInjection
.AddNotificationHandler();
Services.AddSingleton();
+
+ // register a basic/noop published snapshot service to be replaced
+ Services.AddSingleton();
}
}
}
diff --git a/src/Umbraco.Core/Migrations/IMigration.cs b/src/Umbraco.Core/Migrations/IMigration.cs
deleted file mode 100644
index 059ab4f2f5..0000000000
--- a/src/Umbraco.Core/Migrations/IMigration.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using Umbraco.Cms.Core.Composing;
-
-namespace Umbraco.Cms.Core.Migrations
-{
- ///
- /// Represents a migration.
- ///
- public interface IMigration : IDiscoverable
- {
- ///
- /// Executes the migration.
- ///
- void Migrate();
- }
-}
diff --git a/src/Umbraco.Core/Migrations/NoopMigration.cs b/src/Umbraco.Core/Migrations/NoopMigration.cs
deleted file mode 100644
index 9156c8cd09..0000000000
--- a/src/Umbraco.Core/Migrations/NoopMigration.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace Umbraco.Cms.Core.Migrations
-{
- public class NoopMigration : IMigration
- {
- public void Migrate()
- {
- // nop
- }
- }
-}
diff --git a/src/Umbraco.Core/Models/IContentBase.cs b/src/Umbraco.Core/Models/IContentBase.cs
index 4900ab00e1..1aac7dd1a5 100644
--- a/src/Umbraco.Core/Models/IContentBase.cs
+++ b/src/Umbraco.Core/Models/IContentBase.cs
@@ -4,6 +4,7 @@ using Umbraco.Cms.Core.Models.Entities;
namespace Umbraco.Cms.Core.Models
{
+
///
/// Provides a base class for content items.
///
diff --git a/src/Umbraco.Core/Models/IReadOnlyContentBase.cs b/src/Umbraco.Core/Models/IReadOnlyContentBase.cs
new file mode 100644
index 0000000000..e327a49f29
--- /dev/null
+++ b/src/Umbraco.Core/Models/IReadOnlyContentBase.cs
@@ -0,0 +1,72 @@
+using System;
+
+namespace Umbraco.Cms.Core.Models
+{
+ public interface IReadOnlyContentBase
+ {
+ ///
+ /// Gets the integer identifier of the entity.
+ ///
+ int Id { get; }
+
+ ///
+ /// Gets the Guid unique identifier of the entity.
+ ///
+ Guid Key { get; }
+
+ ///
+ /// Gets the creation date.
+ ///
+ DateTime CreateDate { get; }
+
+ ///
+ /// Gets the last update date.
+ ///
+ DateTime UpdateDate { get; }
+
+ ///
+ /// Gets the name of the entity.
+ ///
+ string Name { get; }
+
+ ///
+ /// Gets the identifier of the user who created this entity.
+ ///
+ int CreatorId { get; }
+
+ ///
+ /// Gets the identifier of the parent entity.
+ ///
+ int ParentId { get; }
+
+ ///
+ /// Gets the level of the entity.
+ ///
+ int Level { get; }
+
+ ///
+ /// Gets the path to the entity.
+ ///
+ string Path { get; }
+
+ ///
+ /// Gets the sort order of the entity.
+ ///
+ int SortOrder { get; }
+
+ ///
+ /// Gets the content type id
+ ///
+ int ContentTypeId { get; }
+
+ ///
+ /// Gets the identifier of the writer.
+ ///
+ int WriterId { get; }
+
+ ///
+ /// Gets the version identifier.
+ ///
+ int VersionId { get; }
+ }
+}
diff --git a/src/Umbraco.Core/Models/ReadOnlyContentBaseAdapter.cs b/src/Umbraco.Core/Models/ReadOnlyContentBaseAdapter.cs
new file mode 100644
index 0000000000..77d285596a
--- /dev/null
+++ b/src/Umbraco.Core/Models/ReadOnlyContentBaseAdapter.cs
@@ -0,0 +1,42 @@
+using System;
+
+namespace Umbraco.Cms.Core.Models
+{
+ public struct ReadOnlyContentBaseAdapter : IReadOnlyContentBase
+ {
+ private readonly IContentBase _content;
+
+ private ReadOnlyContentBaseAdapter(IContentBase content)
+ {
+ _content = content ?? throw new ArgumentNullException(nameof(content));
+ }
+
+ public static ReadOnlyContentBaseAdapter Create(IContentBase content) => new ReadOnlyContentBaseAdapter(content);
+
+ public int Id => _content.Id;
+
+ public Guid Key => _content.Key;
+
+ public DateTime CreateDate => _content.CreateDate;
+
+ public DateTime UpdateDate => _content.UpdateDate;
+
+ public string Name => _content.Name;
+
+ public int CreatorId => _content.CreatorId;
+
+ public int ParentId => _content.ParentId;
+
+ public int Level => _content.Level;
+
+ public string Path => _content.Path;
+
+ public int SortOrder => _content.SortOrder;
+
+ public int ContentTypeId => _content.ContentTypeId;
+
+ public int WriterId => _content.WriterId;
+
+ public int VersionId => _content.VersionId;
+ }
+}
diff --git a/src/Umbraco.Core/PropertyEditors/DataEditorAttribute.cs b/src/Umbraco.Core/PropertyEditors/DataEditorAttribute.cs
index f8fbc051cd..639dad1c23 100644
--- a/src/Umbraco.Core/PropertyEditors/DataEditorAttribute.cs
+++ b/src/Umbraco.Core/PropertyEditors/DataEditorAttribute.cs
@@ -2,6 +2,7 @@
namespace Umbraco.Cms.Core.PropertyEditors
{
+
///
/// Marks a class that represents a data editor.
///
diff --git a/src/Umbraco.Core/PropertyEditors/IPropertyCacheCompression.cs b/src/Umbraco.Core/PropertyEditors/IPropertyCacheCompression.cs
new file mode 100644
index 0000000000..817bc5aeae
--- /dev/null
+++ b/src/Umbraco.Core/PropertyEditors/IPropertyCacheCompression.cs
@@ -0,0 +1,15 @@
+using Umbraco.Cms.Core.Models;
+
+namespace Umbraco.Cms.Core.PropertyEditors
+{
+ ///
+ /// Determines if a property type's value should be compressed in memory
+ ///
+ ///
+ ///
+ ///
+ public interface IPropertyCacheCompression
+ {
+ bool IsCompressed(IReadOnlyContentBase content, string propertyTypeAlias);
+ }
+}
diff --git a/src/Umbraco.Core/PropertyEditors/IPropertyCacheCompressionOptions.cs b/src/Umbraco.Core/PropertyEditors/IPropertyCacheCompressionOptions.cs
new file mode 100644
index 0000000000..86bda9e799
--- /dev/null
+++ b/src/Umbraco.Core/PropertyEditors/IPropertyCacheCompressionOptions.cs
@@ -0,0 +1,9 @@
+using Umbraco.Cms.Core.Models;
+
+namespace Umbraco.Cms.Core.PropertyEditors
+{
+ public interface IPropertyCacheCompressionOptions
+ {
+ bool IsCompressed(IReadOnlyContentBase content, IPropertyType propertyType, IDataEditor dataEditor);
+ }
+}
diff --git a/src/Umbraco.Core/PropertyEditors/NoopPropertyCacheCompressionOptions.cs b/src/Umbraco.Core/PropertyEditors/NoopPropertyCacheCompressionOptions.cs
new file mode 100644
index 0000000000..f2020ecbca
--- /dev/null
+++ b/src/Umbraco.Core/PropertyEditors/NoopPropertyCacheCompressionOptions.cs
@@ -0,0 +1,12 @@
+using Umbraco.Cms.Core.Models;
+
+namespace Umbraco.Cms.Core.PropertyEditors
+{
+ ///
+ /// Default implementation for which does not compress any property data
+ ///
+ public sealed class NoopPropertyCacheCompressionOptions : IPropertyCacheCompressionOptions
+ {
+ public bool IsCompressed(IReadOnlyContentBase content, IPropertyType propertyType, IDataEditor dataEditor) => false;
+ }
+}
diff --git a/src/Umbraco.Core/PropertyEditors/PropertyCacheCompression.cs b/src/Umbraco.Core/PropertyEditors/PropertyCacheCompression.cs
new file mode 100644
index 0000000000..3664be6101
--- /dev/null
+++ b/src/Umbraco.Core/PropertyEditors/PropertyCacheCompression.cs
@@ -0,0 +1,51 @@
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Linq;
+using Umbraco.Cms.Core.Models;
+
+namespace Umbraco.Cms.Core.PropertyEditors
+{
+
+ ///
+ /// Compresses property data based on config
+ ///
+ public class PropertyCacheCompression : IPropertyCacheCompression
+ {
+ private readonly IPropertyCacheCompressionOptions _compressionOptions;
+ private readonly IReadOnlyDictionary _contentTypes;
+ private readonly PropertyEditorCollection _propertyEditors;
+ private readonly ConcurrentDictionary<(int contentTypeId, string propertyAlias), bool> _isCompressedCache;
+
+ public PropertyCacheCompression(
+ IPropertyCacheCompressionOptions compressionOptions,
+ IReadOnlyDictionary contentTypes,
+ PropertyEditorCollection propertyEditors,
+ ConcurrentDictionary<(int, string), bool> compressedStoragePropertyEditorCache)
+ {
+ _compressionOptions = compressionOptions;
+ _contentTypes = contentTypes ?? throw new System.ArgumentNullException(nameof(contentTypes));
+ _propertyEditors = propertyEditors ?? throw new System.ArgumentNullException(nameof(propertyEditors));
+ _isCompressedCache = compressedStoragePropertyEditorCache;
+ }
+
+ public bool IsCompressed(IReadOnlyContentBase content, string alias)
+ {
+ var compressedStorage = _isCompressedCache.GetOrAdd((content.ContentTypeId, alias), x =>
+ {
+ if (!_contentTypes.TryGetValue(x.contentTypeId, out var ct))
+ return false;
+
+ var propertyType = ct.CompositionPropertyTypes.FirstOrDefault(x => x.Alias == alias);
+ if (propertyType == null)
+ return false;
+
+ if (!_propertyEditors.TryGet(propertyType.PropertyEditorAlias, out var propertyEditor))
+ return false;
+
+ return _compressionOptions.IsCompressed(content, propertyType, propertyEditor);
+ });
+
+ return compressedStorage;
+ }
+ }
+}
diff --git a/src/Umbraco.Core/PublishedCache/IPublishedContentCache.cs b/src/Umbraco.Core/PublishedCache/IPublishedContentCache.cs
index 7358611711..5fa8c16832 100644
--- a/src/Umbraco.Core/PublishedCache/IPublishedContentCache.cs
+++ b/src/Umbraco.Core/PublishedCache/IPublishedContentCache.cs
@@ -36,16 +36,26 @@ namespace Umbraco.Cms.Core.PublishedCache
///
/// A value indicating whether to consider unpublished content.
/// The content unique identifier.
- /// The route.
- /// The value of overrides defaults.
+ /// A special string formatted route path.
+ ///
+ ///
+ /// The resulting string is a special encoded route string that may contain the domain ID
+ /// for the current route. If a domain is present the string will be prefixed with the domain ID integer, example: {domainId}/route-path-of-item
+ ///
+ /// The value of overrides defaults.
+ ///
string GetRouteById(bool preview, int contentId, string culture = null);
///
/// Gets the route for a content identified by its unique identifier.
///
/// The content unique identifier.
- /// The route.
+ /// A special string formatted route path.
/// Considers published or unpublished content depending on defaults.
+ ///
+ /// The resulting string is a special encoded route string that may contain the domain ID
+ /// for the current route. If a domain is present the string will be prefixed with the domain ID integer, example: {domainId}/route-path-of-item
+ ///
string GetRouteById(int contentId, string culture = null);
}
}
diff --git a/src/Umbraco.Core/PublishedCache/IPublishedSnapshotService.cs b/src/Umbraco.Core/PublishedCache/IPublishedSnapshotService.cs
index d1e113d16c..360f277da3 100644
--- a/src/Umbraco.Core/PublishedCache/IPublishedSnapshotService.cs
+++ b/src/Umbraco.Core/PublishedCache/IPublishedSnapshotService.cs
@@ -36,7 +36,6 @@ namespace Umbraco.Cms.Core.PublishedCache
///
/// Rebuilds internal database caches (but does not reload).
///
- /// The operation batch size to process the items
/// If not null will process content for the matching content types, if empty will process all content
/// If not null will process content for the matching media types, if empty will process all media
/// If not null will process content for the matching members types, if empty will process all members
@@ -47,7 +46,6 @@ namespace Umbraco.Cms.Core.PublishedCache
/// RefreshAllPublishedSnapshot method.
///
void Rebuild(
- int groupSize = 5000,
IReadOnlyCollection contentTypeIds = null,
IReadOnlyCollection mediaTypeIds = null,
IReadOnlyCollection memberTypeIds = null);
diff --git a/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedContent.cs b/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedContent.cs
new file mode 100644
index 0000000000..34152ebc0f
--- /dev/null
+++ b/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedContent.cs
@@ -0,0 +1,104 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Umbraco.Cms.Core.Models.PublishedContent;
+using Umbraco.Extensions;
+
+namespace Umbraco.Cms.Core.PublishedCache.Internal
+{
+
+ public sealed class InternalPublishedContent : IPublishedContent
+ {
+ public InternalPublishedContent(IPublishedContentType contentType)
+ {
+ // initialize boring stuff
+ TemplateId = 0;
+ WriterId = CreatorId = 0;
+ CreateDate = UpdateDate = DateTime.Now;
+ Version = Guid.Empty;
+
+ ContentType = contentType;
+ }
+
+ private Dictionary _cultures;
+
+ private Dictionary GetCultures() => new Dictionary { { string.Empty, new PublishedCultureInfo(string.Empty, Name, UrlSegment, UpdateDate) } };
+
+ public int Id { get; set; }
+
+ public Guid Key { get; set; }
+
+ public int? TemplateId { get; set; }
+
+ public int SortOrder { get; set; }
+
+ public string Name { get; set; }
+
+ public IReadOnlyDictionary Cultures => _cultures ??= GetCultures();
+
+ public string UrlSegment { get; set; }
+
+ public int WriterId { get; set; }
+
+ public int CreatorId { get; set; }
+
+ public string Path { get; set; }
+
+ public DateTime CreateDate { get; set; }
+
+ public DateTime UpdateDate { get; set; }
+
+ public Guid Version { get; set; }
+
+ public int Level { get; set; }
+
+ public PublishedItemType ItemType => PublishedItemType.Content;
+
+ public bool IsDraft(string culture = null) => false;
+
+ public bool IsPublished(string culture = null) => true;
+
+ public int ParentId { get; set; }
+
+ public IEnumerable ChildIds { get; set; }
+
+ public IPublishedContent Parent { get; set; }
+
+ public IEnumerable Children { get; set; }
+
+ public IEnumerable ChildrenForAllCultures => Children;
+
+ public IPublishedContentType ContentType { get; set; }
+
+ public IEnumerable Properties { get; set; }
+
+ public IPublishedProperty GetProperty(string alias) => Properties.FirstOrDefault(p => p.Alias.InvariantEquals(alias));
+
+ public IPublishedProperty GetProperty(string alias, bool recurse)
+ {
+ IPublishedProperty property = GetProperty(alias);
+ if (recurse == false)
+ {
+ return property;
+ }
+
+ IPublishedContent content = this;
+ while (content != null && (property == null || property.HasValue() == false))
+ {
+ content = content.Parent;
+ property = content?.GetProperty(alias);
+ }
+
+ return property;
+ }
+
+ public object this[string alias]
+ {
+ get
+ {
+ var property = GetProperty(alias);
+ return property == null || property.HasValue() == false ? null : property.GetValue();
+ }
+ }
+ }
+}
diff --git a/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedContentCache.cs b/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedContentCache.cs
new file mode 100644
index 0000000000..2a197affff
--- /dev/null
+++ b/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedContentCache.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Umbraco.Cms.Core.Models.PublishedContent;
+using Umbraco.Cms.Core.Xml;
+
+namespace Umbraco.Cms.Core.PublishedCache.Internal
+{
+ public sealed class InternalPublishedContentCache : PublishedCacheBase, IPublishedContentCache, IPublishedMediaCache
+ {
+ private readonly Dictionary _content = new Dictionary();
+
+ public InternalPublishedContentCache()
+ : base(false)
+ {
+ }
+
+ //public void Add(InternalPublishedContent content) => _content[content.Id] = content.CreateModel(Mock.Of());
+
+ public void Clear() => _content.Clear();
+
+ public IPublishedContent GetByRoute(bool preview, string route, bool? hideTopLevelNode = null, string culture = null) => throw new NotImplementedException();
+
+ public IPublishedContent GetByRoute(string route, bool? hideTopLevelNode = null, string culture = null) => throw new NotImplementedException();
+
+ public string GetRouteById(bool preview, int contentId, string culture = null) => throw new NotImplementedException();
+
+ public string GetRouteById(int contentId, string culture = null) => throw new NotImplementedException();
+
+ public override IPublishedContent GetById(bool preview, int contentId) => _content.ContainsKey(contentId) ? _content[contentId] : null;
+
+ public override IPublishedContent GetById(bool preview, Guid contentId) => throw new NotImplementedException();
+
+ public override IPublishedContent GetById(bool preview, Udi nodeId) => throw new NotSupportedException();
+
+ public override bool HasById(bool preview, int contentId) => _content.ContainsKey(contentId);
+
+ public override IEnumerable GetAtRoot(bool preview, string culture = null) => _content.Values.Where(x => x.Parent == null);
+
+ public override IPublishedContent GetSingleByXPath(bool preview, string xpath, XPathVariable[] vars) => throw new NotImplementedException();
+
+ public override IPublishedContent GetSingleByXPath(bool preview, System.Xml.XPath.XPathExpression xpath, XPathVariable[] vars) => throw new NotImplementedException();
+
+ public override IEnumerable GetByXPath(bool preview, string xpath, XPathVariable[] vars) => throw new NotImplementedException();
+
+ public override IEnumerable GetByXPath(bool preview, System.Xml.XPath.XPathExpression xpath, XPathVariable[] vars) => throw new NotImplementedException();
+
+ public override System.Xml.XPath.XPathNavigator CreateNavigator(bool preview) => throw new NotImplementedException();
+
+ public override System.Xml.XPath.XPathNavigator CreateNodeNavigator(int id, bool preview) => throw new NotImplementedException();
+
+ public override bool HasContent(bool preview) => _content.Count > 0;
+
+ public override IPublishedContentType GetContentType(int id) => throw new NotImplementedException();
+
+ public override IPublishedContentType GetContentType(string alias) => throw new NotImplementedException();
+
+ public override IPublishedContentType GetContentType(Guid key) => throw new NotImplementedException();
+
+ public override IEnumerable GetByContentType(IPublishedContentType contentType) => throw new NotImplementedException();
+ }
+}
diff --git a/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedProperty.cs b/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedProperty.cs
new file mode 100644
index 0000000000..a98eff6484
--- /dev/null
+++ b/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedProperty.cs
@@ -0,0 +1,27 @@
+using Umbraco.Cms.Core.Models.PublishedContent;
+
+namespace Umbraco.Cms.Core.PublishedCache.Internal
+{
+ public class InternalPublishedProperty : IPublishedProperty
+ {
+ public IPublishedPropertyType PropertyType { get; set; }
+
+ public string Alias { get; set; }
+
+ public object SolidSourceValue { get; set; }
+
+ public object SolidValue { get; set; }
+
+ public bool SolidHasValue { get; set; }
+
+ public object SolidXPathValue { get; set; }
+
+ public virtual object GetSourceValue(string culture = null, string segment = null) => SolidSourceValue;
+
+ public virtual object GetValue(string culture = null, string segment = null) => SolidValue;
+
+ public virtual object GetXPathValue(string culture = null, string segment = null) => SolidXPathValue;
+
+ public virtual bool HasValue(string culture = null, string segment = null) => SolidHasValue;
+ }
+}
diff --git a/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedSnapshot.cs b/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedSnapshot.cs
new file mode 100644
index 0000000000..c73b6cef76
--- /dev/null
+++ b/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedSnapshot.cs
@@ -0,0 +1,33 @@
+using System;
+using Umbraco.Cms.Core.Cache;
+
+namespace Umbraco.Cms.Core.PublishedCache.Internal
+{
+ public sealed class InternalPublishedSnapshot : IPublishedSnapshot
+ {
+ public InternalPublishedContentCache InnerContentCache { get; } = new InternalPublishedContentCache();
+ public InternalPublishedContentCache InnerMediaCache { get; } = new InternalPublishedContentCache();
+
+ public IPublishedContentCache Content => InnerContentCache;
+
+ public IPublishedMediaCache Media => InnerMediaCache;
+
+ public IPublishedMemberCache Members => null;
+
+ public IDomainCache Domains => null;
+
+ public IDisposable ForcedPreview(bool forcedPreview, Action callback = null) => throw new NotImplementedException();
+
+ public void Resync()
+ {
+ }
+
+ public IAppCache SnapshotCache => null;
+
+ public IAppCache ElementsCache => null;
+
+ public void Dispose()
+ {
+ }
+ }
+}
diff --git a/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedSnapshotService.cs b/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedSnapshotService.cs
new file mode 100644
index 0000000000..5dcdc5189f
--- /dev/null
+++ b/src/Umbraco.Core/PublishedCache/Internal/InternalPublishedSnapshotService.cs
@@ -0,0 +1,60 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Umbraco.Cms.Core.Cache;
+using Umbraco.Extensions;
+
+namespace Umbraco.Cms.Core.PublishedCache.Internal
+{
+ public class InternalPublishedSnapshotService : IPublishedSnapshotService
+ {
+ private InternalPublishedSnapshot _snapshot;
+ private InternalPublishedSnapshot _previewSnapshot;
+
+ public Task CollectAsync() => Task.CompletedTask;
+
+ public IPublishedSnapshot CreatePublishedSnapshot(string previewToken)
+ {
+ if (previewToken.IsNullOrWhiteSpace())
+ {
+ return _snapshot ??= new InternalPublishedSnapshot();
+ }
+ else
+ {
+ return _previewSnapshot ??= new InternalPublishedSnapshot();
+ }
+ }
+
+ public void Dispose()
+ {
+ _snapshot?.Dispose();
+ _previewSnapshot?.Dispose();
+ }
+
+ public void Notify(ContentCacheRefresher.JsonPayload[] payloads, out bool draftChanged, out bool publishedChanged)
+ {
+ draftChanged = false;
+ publishedChanged = false;
+ }
+
+ public void Notify(MediaCacheRefresher.JsonPayload[] payloads, out bool anythingChanged)
+ {
+ anythingChanged = false;
+ }
+
+ public void Notify(ContentTypeCacheRefresher.JsonPayload[] payloads)
+ {
+ }
+
+ public void Notify(DataTypeCacheRefresher.JsonPayload[] payloads)
+ {
+ }
+
+ public void Notify(DomainCacheRefresher.JsonPayload[] payloads)
+ {
+ }
+
+ public void Rebuild(IReadOnlyCollection contentTypeIds = null, IReadOnlyCollection mediaTypeIds = null, IReadOnlyCollection memberTypeIds = null)
+ {
+ }
+ }
+}
diff --git a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Collections.cs b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Collections.cs
index 9becde2ebe..34a14d7deb 100644
--- a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Collections.cs
+++ b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Collections.cs
@@ -1,4 +1,5 @@
using Umbraco.Cms.Core.DependencyInjection;
+using Umbraco.Cms.Infrastructure.Persistence;
using Umbraco.Cms.Infrastructure.Persistence.Mappers;
namespace Umbraco.Cms.Infrastructure.DependencyInjection
@@ -14,5 +15,8 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
/// The builder.
public static MapperCollectionBuilder Mappers(this IUmbracoBuilder builder)
=> builder.WithCollectionBuilder();
+
+ public static NPocoMapperCollectionBuilder NPocoMappers(this IUmbracoBuilder builder)
+ => builder.WithCollectionBuilder();
}
}
diff --git a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs
index f49931c105..e974c633a0 100644
--- a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs
+++ b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs
@@ -45,6 +45,7 @@ using Umbraco.Cms.Infrastructure.Migrations.Install;
using Umbraco.Cms.Infrastructure.Migrations.PostMigrations;
using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0.DataTypes;
using Umbraco.Cms.Infrastructure.Persistence;
+using Umbraco.Cms.Infrastructure.Persistence.Mappers;
using Umbraco.Cms.Infrastructure.Runtime;
using Umbraco.Cms.Infrastructure.Search;
using Umbraco.Cms.Infrastructure.Serialization;
@@ -66,6 +67,8 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
builder.Services.AddUnique();
builder.Services.AddUnique(factory => factory.GetRequiredService().CreateDatabase());
builder.Services.AddUnique(factory => factory.GetRequiredService().SqlContext);
+ builder.NPocoMappers().Add();
+
builder.Services.AddUnique();
builder.Services.AddUnique();
@@ -206,9 +209,18 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
var databaseSchemaCreatorFactory = factory.GetRequiredService();
var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
var loggerFactory = factory.GetRequiredService();
+ var npocoMappers = factory.GetRequiredService();
return globalSettings.Value.MainDomLock.Equals("SqlMainDomLock") || isWindows == false
- ? (IMainDomLock)new SqlMainDomLock(loggerFactory.CreateLogger(), loggerFactory, globalSettings, connectionStrings, dbCreator, hostingEnvironment, databaseSchemaCreatorFactory)
+ ? (IMainDomLock)new SqlMainDomLock(
+ loggerFactory.CreateLogger(),
+ loggerFactory,
+ globalSettings,
+ connectionStrings,
+ dbCreator,
+ hostingEnvironment,
+ databaseSchemaCreatorFactory,
+ npocoMappers)
: new MainDomSemaphoreLock(loggerFactory.CreateLogger(), hostingEnvironment);
});
diff --git a/src/Umbraco.Infrastructure/Migrations/IMigrationBuilder.cs b/src/Umbraco.Infrastructure/Migrations/IMigrationBuilder.cs
index 325c8dd752..087e04d41a 100644
--- a/src/Umbraco.Infrastructure/Migrations/IMigrationBuilder.cs
+++ b/src/Umbraco.Infrastructure/Migrations/IMigrationBuilder.cs
@@ -1,10 +1,9 @@
-using System;
-using Umbraco.Cms.Core.Migrations;
+using System;
namespace Umbraco.Cms.Infrastructure.Migrations
{
public interface IMigrationBuilder
{
- IMigration Build(Type migrationType, IMigrationContext context);
+ MigrationBase Build(Type migrationType, IMigrationContext context);
}
}
diff --git a/src/Umbraco.Infrastructure/Migrations/IMigrationContext.cs b/src/Umbraco.Infrastructure/Migrations/IMigrationContext.cs
index 016184d4cf..566b31dc13 100644
--- a/src/Umbraco.Infrastructure/Migrations/IMigrationContext.cs
+++ b/src/Umbraco.Infrastructure/Migrations/IMigrationContext.cs
@@ -1,5 +1,4 @@
-using Microsoft.Extensions.Logging;
-using Umbraco.Cms.Core.Migrations;
+using Microsoft.Extensions.Logging;
using Umbraco.Cms.Infrastructure.Persistence;
namespace Umbraco.Cms.Infrastructure.Migrations
@@ -38,6 +37,6 @@ namespace Umbraco.Cms.Infrastructure.Migrations
/// Adds a post-migration.
///
void AddPostMigration()
- where TMigration : IMigration;
+ where TMigration : MigrationBase;
}
}
diff --git a/src/Umbraco.Core/Migrations/IncompleteMigrationExpressionException.cs b/src/Umbraco.Infrastructure/Migrations/IncompleteMigrationExpressionException.cs
similarity index 95%
rename from src/Umbraco.Core/Migrations/IncompleteMigrationExpressionException.cs
rename to src/Umbraco.Infrastructure/Migrations/IncompleteMigrationExpressionException.cs
index bebed7ab50..67d559c66d 100644
--- a/src/Umbraco.Core/Migrations/IncompleteMigrationExpressionException.cs
+++ b/src/Umbraco.Infrastructure/Migrations/IncompleteMigrationExpressionException.cs
@@ -1,7 +1,7 @@
-using System;
+using System;
using System.Runtime.Serialization;
-namespace Umbraco.Cms.Core.Migrations
+namespace Umbraco.Cms.Infrastructure.Migrations
{
///
/// The exception that is thrown when a migration expression is not executed.
@@ -10,7 +10,7 @@ namespace Umbraco.Cms.Core.Migrations
/// Migration expressions such as Alter.Table(...).Do() must end with Do(), else they are not executed.
/// When a non-executed expression is detected, an IncompleteMigrationExpressionException is thrown.
///
- ///
+ ///
[Serializable]
public class IncompleteMigrationExpressionException : Exception
{
diff --git a/src/Umbraco.Infrastructure/Migrations/MergeBuilder.cs b/src/Umbraco.Infrastructure/Migrations/MergeBuilder.cs
index 4385fd54b8..917560de28 100644
--- a/src/Umbraco.Infrastructure/Migrations/MergeBuilder.cs
+++ b/src/Umbraco.Infrastructure/Migrations/MergeBuilder.cs
@@ -1,6 +1,5 @@
-using System;
+using System;
using System.Collections.Generic;
-using Umbraco.Cms.Core.Migrations;
namespace Umbraco.Cms.Infrastructure.Migrations
{
@@ -32,7 +31,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations
/// Adds a transition to a target state through a migration.
///
public MergeBuilder To(string targetState)
- where TMigration : IMigration
+ where TMigration : MigrationBase
=> To(targetState, typeof(TMigration));
///
@@ -71,16 +70,21 @@ namespace Umbraco.Cms.Infrastructure.Migrations
public MigrationPlan As(string targetState)
{
if (!_with)
+ {
throw new InvalidOperationException("Cannot invoke As() without invoking With() first.");
+ }
// reach final state
_plan.To(targetState);
// restart at former end of branch2
_plan.From(_withLast);
+
// and replay all branch1 migrations
foreach (var migration in _migrations)
+ {
_plan.To(_plan.CreateRandomState(), migration);
+ }
// reaching final state
_plan.To(targetState);
diff --git a/src/Umbraco.Infrastructure/Migrations/MigrationBase.cs b/src/Umbraco.Infrastructure/Migrations/MigrationBase.cs
index 56f195cd9f..a447d9e465 100644
--- a/src/Umbraco.Infrastructure/Migrations/MigrationBase.cs
+++ b/src/Umbraco.Infrastructure/Migrations/MigrationBase.cs
@@ -1,6 +1,6 @@
-using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Logging;
using NPoco;
-using Umbraco.Cms.Core.Migrations;
+using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Infrastructure.Migrations.Expressions.Alter;
using Umbraco.Cms.Infrastructure.Migrations.Expressions.Create;
using Umbraco.Cms.Infrastructure.Migrations.Expressions.Delete;
@@ -16,16 +16,14 @@ namespace Umbraco.Cms.Infrastructure.Migrations
///
/// Provides a base class to all migrations.
///
- public abstract partial class MigrationBase : IMigration
+ public abstract partial class MigrationBase : IDiscoverable
{
///
/// Initializes a new instance of the class.
///
/// A migration context.
protected MigrationBase(IMigrationContext context)
- {
- Context = context;
- }
+ => Context = context;
///
/// Gets the migration context.
@@ -65,17 +63,21 @@ namespace Umbraco.Cms.Infrastructure.Migrations
///
/// Executes the migration.
///
- public abstract void Migrate();
+ protected abstract void Migrate();
- ///
- void IMigration.Migrate()
+ ///
+ /// Runs the migration.
+ ///
+ public void Run()
{
Migrate();
// ensure there is no building expression
// ie we did not forget to .Do() an expression
if (Context.BuildingExpression)
+ {
throw new IncompleteMigrationExpressionException("The migration has run, but leaves an expression that has not run.");
+ }
}
// ensures we are not already building,
diff --git a/src/Umbraco.Infrastructure/Migrations/MigrationBuilder.cs b/src/Umbraco.Infrastructure/Migrations/MigrationBuilder.cs
index e0006134d7..e68dc7a700 100644
--- a/src/Umbraco.Infrastructure/Migrations/MigrationBuilder.cs
+++ b/src/Umbraco.Infrastructure/Migrations/MigrationBuilder.cs
@@ -1,5 +1,4 @@
-using System;
-using Umbraco.Cms.Core.Migrations;
+using System;
using Umbraco.Extensions;
namespace Umbraco.Cms.Infrastructure.Migrations
@@ -13,9 +12,9 @@ namespace Umbraco.Cms.Infrastructure.Migrations
_container = container;
}
- public IMigration Build(Type migrationType, IMigrationContext context)
+ public MigrationBase Build(Type migrationType, IMigrationContext context)
{
- return (IMigration) _container.CreateInstance(migrationType, context);
+ return (MigrationBase) _container.CreateInstance(migrationType, context);
}
}
}
diff --git a/src/Umbraco.Infrastructure/Migrations/MigrationContext.cs b/src/Umbraco.Infrastructure/Migrations/MigrationContext.cs
index 01e270dc79..9b01cd8acd 100644
--- a/src/Umbraco.Infrastructure/Migrations/MigrationContext.cs
+++ b/src/Umbraco.Infrastructure/Migrations/MigrationContext.cs
@@ -1,7 +1,6 @@
-using System;
+using System;
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
-using Umbraco.Cms.Core.Migrations;
using Umbraco.Cms.Infrastructure.Persistence;
namespace Umbraco.Cms.Infrastructure.Migrations
@@ -40,7 +39,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations
///
public void AddPostMigration()
- where TMigration : IMigration
+ where TMigration : MigrationBase
{
// just adding - will be de-duplicated when executing
PostMigrations.Add(typeof(TMigration));
diff --git a/src/Umbraco.Infrastructure/Migrations/MigrationPlan.cs b/src/Umbraco.Infrastructure/Migrations/MigrationPlan.cs
index 3bde224640..287f9d3bf4 100644
--- a/src/Umbraco.Infrastructure/Migrations/MigrationPlan.cs
+++ b/src/Umbraco.Infrastructure/Migrations/MigrationPlan.cs
@@ -1,8 +1,7 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.Logging;
-using Umbraco.Cms.Core.Migrations;
using Umbraco.Cms.Core.Scoping;
using Umbraco.Extensions;
using Type = System.Type;
@@ -50,7 +49,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations
if (string.IsNullOrWhiteSpace(targetState)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(targetState));
if (sourceState == targetState) throw new ArgumentException("Source and target state cannot be identical.");
if (migration == null) throw new ArgumentNullException(nameof(migration));
- if (!migration.Implements()) throw new ArgumentException($"Type {migration.Name} does not implement IMigration.", nameof(migration));
+ if (!migration.Implements()) throw new ArgumentException($"Type {migration.Name} does not implement IMigration.", nameof(migration));
sourceState = sourceState.Trim();
targetState = targetState.Trim();
@@ -86,7 +85,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations
/// Adds a transition to a target state through a migration.
///
public MigrationPlan To(string targetState)
- where TMigration : IMigration
+ where TMigration : MigrationBase
=> To(targetState, typeof(TMigration));
///
@@ -112,8 +111,8 @@ namespace Umbraco.Cms.Infrastructure.Migrations
/// The previous target state, which we need to recover from through .
/// The new target state.
public MigrationPlan ToWithReplace(string recoverState, string targetState)
- where TMigrationNew: IMigration
- where TMigrationRecover : IMigration
+ where TMigrationNew: MigrationBase
+ where TMigrationRecover : MigrationBase
{
To(targetState);
From(recoverState).To(targetState);
@@ -127,7 +126,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations
/// The previous target state, which we can recover from directly.
/// The new target state.
public MigrationPlan ToWithReplace(string recoverState, string targetState)
- where TMigrationNew : IMigration
+ where TMigrationNew : MigrationBase
{
To(targetState);
From(recoverState).To(targetState);
@@ -186,7 +185,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations
/// Adds a post-migration to the plan.
///
public virtual MigrationPlan AddPostMigration()
- where TMigration : IMigration
+ where TMigration : MigrationBase
{
_postMigrationTypes.Add(typeof(TMigration));
return this;
@@ -314,7 +313,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations
logger.LogInformation("Execute {MigrationType}", transition.MigrationType.Name);
var migration = migrationBuilder.Build(transition.MigrationType, context);
- migration.Migrate();
+ migration.Run();
var nextState = transition.TargetState;
origState = nextState;
@@ -338,7 +337,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations
{
logger.LogInformation($"PostMigration: {postMigrationType.FullName}.");
var postMigration = migrationBuilder.Build(postMigrationType, context);
- postMigration.Migrate();
+ postMigration.Run();
}
logger.LogInformation("Done (pending scope completion).");
diff --git a/src/Umbraco.Infrastructure/Migrations/NoopMigration.cs b/src/Umbraco.Infrastructure/Migrations/NoopMigration.cs
new file mode 100644
index 0000000000..0cc2fbad25
--- /dev/null
+++ b/src/Umbraco.Infrastructure/Migrations/NoopMigration.cs
@@ -0,0 +1,14 @@
+namespace Umbraco.Cms.Infrastructure.Migrations
+{
+ public class NoopMigration : MigrationBase
+ {
+ public NoopMigration(IMigrationContext context) : base(context)
+ {
+ }
+
+ protected override void Migrate()
+ {
+ // nop
+ }
+ }
+}
diff --git a/src/Umbraco.Infrastructure/Migrations/PostMigrations/ClearCsrfCookies.cs b/src/Umbraco.Infrastructure/Migrations/PostMigrations/ClearCsrfCookies.cs
index 90fb247f22..2a61351d1f 100644
--- a/src/Umbraco.Infrastructure/Migrations/PostMigrations/ClearCsrfCookies.cs
+++ b/src/Umbraco.Infrastructure/Migrations/PostMigrations/ClearCsrfCookies.cs
@@ -1,4 +1,3 @@
-using Umbraco.Cms.Core.Migrations;
using Umbraco.Cms.Core.Web;
using Constants = Umbraco.Cms.Core.Constants;
@@ -7,16 +6,14 @@ namespace Umbraco.Cms.Infrastructure.Migrations.PostMigrations
///
/// Clears Csrf tokens.
///
- public class ClearCsrfCookies : IMigration
+ public class ClearCsrfCookies : MigrationBase
{
private readonly ICookieManager _cookieManager;
public ClearCsrfCookies(IMigrationContext context, ICookieManager cookieManager)
- {
- _cookieManager = cookieManager;
- }
+ : base(context) => _cookieManager = cookieManager;
- public void Migrate()
+ protected override void Migrate()
{
_cookieManager.ExpireCookie(Constants.Web.AngularCookieName);
_cookieManager.ExpireCookie(Constants.Web.CsrfValidationCookieName);
diff --git a/src/Umbraco.Infrastructure/Migrations/PostMigrations/DeleteLogViewerQueryFile.cs b/src/Umbraco.Infrastructure/Migrations/PostMigrations/DeleteLogViewerQueryFile.cs
index cc1828dc2e..32d150fcca 100644
--- a/src/Umbraco.Infrastructure/Migrations/PostMigrations/DeleteLogViewerQueryFile.cs
+++ b/src/Umbraco.Infrastructure/Migrations/PostMigrations/DeleteLogViewerQueryFile.cs
@@ -1,6 +1,5 @@
-using System.IO;
+using System.IO;
using Umbraco.Cms.Core.Hosting;
-using Umbraco.Cms.Core.Migrations;
using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_9_0_0;
namespace Umbraco.Cms.Infrastructure.Migrations.PostMigrations
@@ -8,7 +7,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.PostMigrations
///
/// Deletes the old file that saved log queries
///
- public class DeleteLogViewerQueryFile : IMigration
+ public class DeleteLogViewerQueryFile : MigrationBase
{
private readonly IHostingEnvironment _hostingEnvironment;
@@ -16,12 +15,13 @@ namespace Umbraco.Cms.Infrastructure.Migrations.PostMigrations
/// Initializes a new instance of the class.
///
public DeleteLogViewerQueryFile(IMigrationContext context, IHostingEnvironment hostingEnvironment)
+ : base(context)
{
_hostingEnvironment = hostingEnvironment;
}
///
- public void Migrate()
+ protected override void Migrate()
{
var logViewerQueryFile = MigrateLogViewerQueriesFromFileToDb.GetLogViewerQueryFile(_hostingEnvironment);
diff --git a/src/Umbraco.Infrastructure/Migrations/PostMigrations/RebuildPublishedSnapshot.cs b/src/Umbraco.Infrastructure/Migrations/PostMigrations/RebuildPublishedSnapshot.cs
index bbf366882f..e2de75b7ec 100644
--- a/src/Umbraco.Infrastructure/Migrations/PostMigrations/RebuildPublishedSnapshot.cs
+++ b/src/Umbraco.Infrastructure/Migrations/PostMigrations/RebuildPublishedSnapshot.cs
@@ -1,11 +1,9 @@
-using Umbraco.Cms.Core.Migrations;
-
namespace Umbraco.Cms.Infrastructure.Migrations.PostMigrations
{
///
/// Rebuilds the published snapshot.
///
- public class RebuildPublishedSnapshot : IMigration
+ public class RebuildPublishedSnapshot : MigrationBase
{
private readonly IPublishedSnapshotRebuilder _rebuilder;
@@ -13,14 +11,10 @@ namespace Umbraco.Cms.Infrastructure.Migrations.PostMigrations
/// Initializes a new instance of the class.
///
public RebuildPublishedSnapshot(IMigrationContext context, IPublishedSnapshotRebuilder rebuilder)
- {
- _rebuilder = rebuilder;
- }
+ : base(context)
+ => _rebuilder = rebuilder;
///
- public void Migrate()
- {
- _rebuilder.Rebuild();
- }
+ protected override void Migrate() => _rebuilder.Rebuild();
}
}
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/Common/CreateKeysAndIndexes.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/Common/CreateKeysAndIndexes.cs
index 5bd7ddbf2b..bacd875f3f 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/Common/CreateKeysAndIndexes.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/Common/CreateKeysAndIndexes.cs
@@ -1,4 +1,4 @@
-using Umbraco.Cms.Infrastructure.Migrations.Install;
+using Umbraco.Cms.Infrastructure.Migrations.Install;
namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.Common
{
@@ -8,7 +8,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.Common
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
// remove those that may already have keys
Delete.KeysAndIndexes(Cms.Core.Constants.DatabaseSchema.Tables.KeyValue).Do();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/Common/DeleteKeysAndIndexes.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/Common/DeleteKeysAndIndexes.cs
index e36af3bfa4..14e4a5236a 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/Common/DeleteKeysAndIndexes.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/Common/DeleteKeysAndIndexes.cs
@@ -6,7 +6,7 @@
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
// all v7.14 tables
var tables = new[]
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
index 12d8a4afd2..9208b2ec19 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
@@ -9,6 +9,7 @@ using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_10_0;
using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_6_0;
using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_7_0;
using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_9_0;
+using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_15_0;
using Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_9_0_0;
using Umbraco.Extensions;
@@ -200,14 +201,26 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade
// to 8.10.0
To("{D6A8D863-38EC-44FB-91EC-ACD6A668BD18}");
+ // NOTE: we need to do a merge migration here because as of 'now',
+ // v9-beta* is already out and 8.15 isn't out yet
+ // so we need to ensure that migrations from 8.15 are included in the next
+ // v9*.
+
+ // to 8.15.0...
+ Merge()
+ .To("{8DDDCD0B-D7D5-4C97-BD6A-6B38CA65752F}")
+ .To("{4695D0C9-0729-4976-985B-048D503665D8}")
+
// to 9.0.0
- To("{22D801BA-A1FF-4539-BFCC-2139B55594F8}");
- To("{50A43237-A6F4-49E2-A7A6-5DAD65C84669}");
- To("{3D8DADEF-0FDA-4377-A5F0-B52C2110E8F2}");
- To("{1303BDCF-2295-4645-9526-2F32E8B35ABD}");
- To("{86AC839A-0D08-4D09-B7B5-027445E255A1}");
+ .With()
+ .To("{22D801BA-A1FF-4539-BFCC-2139B55594F8}")
+ .To("{50A43237-A6F4-49E2-A7A6-5DAD65C84669}")
+ .To("{3D8DADEF-0FDA-4377-A5F0-B52C2110E8F2}")
+ .To("{1303BDCF-2295-4645-9526-2F32E8B35ABD}")
+ .To("{86AC839A-0D08-4D09-B7B5-027445E255A1}")
//FINAL
+ .As("{5060F3D2-88BE-4D30-8755-CF51F28EAD12}");
}
}
}
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddContentNuTable.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddContentNuTable.cs
index 35552e4c0e..b53fd867b2 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddContentNuTable.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddContentNuTable.cs
@@ -1,4 +1,4 @@
-using Umbraco.Cms.Infrastructure.Persistence.Dtos;
+using Umbraco.Cms.Infrastructure.Persistence.Dtos;
using Umbraco.Extensions;
namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
@@ -9,7 +9,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
var tables = SqlSyntax.GetTablesInSchema(Context.Database);
if (tables.InvariantContains("cmsContentNu")) return;
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddContentTypeIsElementColumn.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddContentTypeIsElementColumn.cs
index d0425dcb76..28f6e8e6de 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddContentTypeIsElementColumn.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddContentTypeIsElementColumn.cs
@@ -7,7 +7,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
public AddContentTypeIsElementColumn(IMigrationContext context) : base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
AddColumn("isElement");
}
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddLockObjects.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddLockObjects.cs
index de6889c157..f8332fb0e2 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddLockObjects.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddLockObjects.cs
@@ -9,7 +9,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
// some may already exist, just ensure everything we need is here
EnsureLockObject(Cms.Core.Constants.Locks.Servers, "Servers");
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddLogTableColumns.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddLogTableColumns.cs
index 8cd193bb2c..4ef9d4ff14 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddLogTableColumns.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddLogTableColumns.cs
@@ -9,7 +9,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
var columns = SqlSyntax.GetColumnsInSchema(Context.Database).ToList();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddPackagesSectionAccess.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddPackagesSectionAccess.cs
index 8ca31127d1..fc708b1f4b 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddPackagesSectionAccess.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddPackagesSectionAccess.cs
@@ -6,7 +6,7 @@
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
// Any user group which had access to the Developer section should have access to Packages
Database.Execute($@"
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddTypedLabels.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddTypedLabels.cs
index 68b7d1524b..87d6edbc9f 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddTypedLabels.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddTypedLabels.cs
@@ -13,7 +13,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
// insert other label datatypes
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddVariationTables1A.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddVariationTables1A.cs
index 327a5df4da..465b17d7fc 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddVariationTables1A.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddVariationTables1A.cs
@@ -14,7 +14,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
//
// this is taking care of ppl left in this state
- public override void Migrate()
+ protected override void Migrate()
{
// note - original AddVariationTables1 just did
// Create.Table().Do();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddVariationTables2.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddVariationTables2.cs
index dfe8cccfc7..263dffd2b9 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddVariationTables2.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/AddVariationTables2.cs
@@ -8,7 +8,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
Create.Table(true).Do();
Create.Table(true).Do();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/ContentVariationMigration.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/ContentVariationMigration.cs
index 8e8111a04c..6171c3df13 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/ContentVariationMigration.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/ContentVariationMigration.cs
@@ -10,7 +10,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
byte GetNewValue(byte oldValue)
{
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/ConvertRelatedLinksToMultiUrlPicker.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/ConvertRelatedLinksToMultiUrlPicker.cs
index 71818fe285..4e277262a7 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/ConvertRelatedLinksToMultiUrlPicker.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/ConvertRelatedLinksToMultiUrlPicker.cs
@@ -14,7 +14,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
public ConvertRelatedLinksToMultiUrlPicker(IMigrationContext context) : base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
var sqlDataTypes = Sql()
.Select()
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs
index 30957e949a..c254ecc8df 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs
@@ -43,7 +43,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
_configurationEditorJsonSerializer = configurationEditorJsonSerializer;
}
- public override void Migrate()
+ protected override void Migrate()
{
// drop and create columns
Delete.Column("pk").FromTable("cmsDataType").Do();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs
index f55ebbbddc..a03c87159b 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs
@@ -24,7 +24,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
_configurationEditorJsonSerializer = configurationEditorJsonSerializer;
}
- public override void Migrate()
+ protected override void Migrate()
{
var refreshCache = Migrate(GetDataTypes(".DropDown", false));
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropMigrationsTable.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropMigrationsTable.cs
index a80d3936e1..0d1e0506cb 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropMigrationsTable.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropMigrationsTable.cs
@@ -6,7 +6,7 @@
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
if (TableExists("umbracoMigration"))
Delete.Table("umbracoMigration").Do();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropPreValueTable.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropPreValueTable.cs
index 1d5237ab94..0195e51e6e 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropPreValueTable.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropPreValueTable.cs
@@ -5,7 +5,7 @@
public DropPreValueTable(IMigrationContext context) : base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
// drop preValues table
if (TableExists("cmsDataTypePreValues"))
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropTaskTables.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropTaskTables.cs
index e830bddf92..b4004c1c82 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropTaskTables.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropTaskTables.cs
@@ -6,7 +6,7 @@
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
if (TableExists("cmsTask"))
Delete.Table("cmsTask").Do();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropTemplateDesignColumn.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropTemplateDesignColumn.cs
index 89dd26beed..9f65689a59 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropTemplateDesignColumn.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropTemplateDesignColumn.cs
@@ -6,7 +6,7 @@
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
if(ColumnExists("cmsTemplate", "design"))
Delete.Column("design").FromTable("cmsTemplate").Do();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropXmlTables.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropXmlTables.cs
index 81581c48cd..3e86e142aa 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropXmlTables.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/DropXmlTables.cs
@@ -6,7 +6,7 @@
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
if (TableExists("cmsContentXml"))
Delete.Table("cmsContentXml").Do();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/FallbackLanguage.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/FallbackLanguage.cs
index c1761f74f2..48e00df2ff 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/FallbackLanguage.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/FallbackLanguage.cs
@@ -14,7 +14,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
var columns = SqlSyntax.GetColumnsInSchema(Context.Database).ToArray();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/FixLanguageIsoCodeLength.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/FixLanguageIsoCodeLength.cs
index 24e820e816..7a35dc12ed 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/FixLanguageIsoCodeLength.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/FixLanguageIsoCodeLength.cs
@@ -6,7 +6,7 @@
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
// there is some confusion here when upgrading from v7
// it should be 14 already but that's not always the case
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/LanguageColumns.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/LanguageColumns.cs
index bb69922721..f6aa86259f 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/LanguageColumns.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/LanguageColumns.cs
@@ -8,7 +8,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
AddColumn(Cms.Core.Constants.DatabaseSchema.Tables.Language, "isDefaultVariantLang");
AddColumn(Cms.Core.Constants.DatabaseSchema.Tables.Language, "mandatory");
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MakeRedirectUrlVariant.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MakeRedirectUrlVariant.cs
index 5cc7a0e6b5..7958f4fbf8 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MakeRedirectUrlVariant.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MakeRedirectUrlVariant.cs
@@ -8,7 +8,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
AddColumn("culture");
}
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MakeTagsVariant.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MakeTagsVariant.cs
index 3a5db9c1e6..74cdd88357 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MakeTagsVariant.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MakeTagsVariant.cs
@@ -8,7 +8,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
AddColumn("languageId");
}
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MergeDateAndDateTimePropertyEditor.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MergeDateAndDateTimePropertyEditor.cs
index 287e4d8d15..a324204921 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MergeDateAndDateTimePropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/MergeDateAndDateTimePropertyEditor.cs
@@ -21,7 +21,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
_configurationEditorJsonSerializer = configurationEditorJsonSerializer;
}
- public override void Migrate()
+ protected override void Migrate()
{
var dataTypes = GetDataTypes(Cms.Core.Constants.PropertyEditors.Legacy.Aliases.Date);
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigration.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigration.cs
index b3ac352e67..935d51dacd 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigration.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigration.cs
@@ -10,7 +10,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
RenameDataType(Cms.Core.Constants.PropertyEditors.Legacy.Aliases.ContentPicker2, Cms.Core.Constants.PropertyEditors.Aliases.ContentPicker);
RenameDataType(Cms.Core.Constants.PropertyEditors.Legacy.Aliases.MediaPicker2, Cms.Core.Constants.PropertyEditors.Aliases.MediaPicker);
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RadioAndCheckboxPropertyEditorsMigration.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RadioAndCheckboxPropertyEditorsMigration.cs
index ee9a61e0c1..1dc0b7f2c3 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RadioAndCheckboxPropertyEditorsMigration.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RadioAndCheckboxPropertyEditorsMigration.cs
@@ -27,7 +27,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
_configurationEditorJsonSerializer = configurationEditorJsonSerializer;
}
- public override void Migrate()
+ protected override void Migrate()
{
var refreshCache = false;
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RefactorMacroColumns.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RefactorMacroColumns.cs
index fc03d18584..005a2ef464 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RefactorMacroColumns.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RefactorMacroColumns.cs
@@ -8,7 +8,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
if (ColumnExists(Cms.Core.Constants.DatabaseSchema.Tables.Macro, "macroXSLT"))
{
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RefactorVariantsModel.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RefactorVariantsModel.cs
index a444831c90..a7759e557c 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RefactorVariantsModel.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RefactorVariantsModel.cs
@@ -9,7 +9,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
if (ColumnExists(Cms.Core.Constants.DatabaseSchema.Tables.ContentVersionCultureVariation, "edited"))
Delete.Column("edited").FromTable(Cms.Core.Constants.DatabaseSchema.Tables.ContentVersionCultureVariation).Do();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameLabelAndRichTextPropertyEditorAliases.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameLabelAndRichTextPropertyEditorAliases.cs
index d5e47c54d2..c3fdf2d0fc 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameLabelAndRichTextPropertyEditorAliases.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameLabelAndRichTextPropertyEditorAliases.cs
@@ -11,7 +11,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
{
}
- public override void Migrate()
+ protected override void Migrate()
{
MigratePropertyEditorAlias("Umbraco.TinyMCEv3", Cms.Core.Constants.PropertyEditors.Aliases.TinyMce);
MigratePropertyEditorAlias("Umbraco.NoEdit", Cms.Core.Constants.PropertyEditors.Aliases.Label);
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameMediaVersionTable.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameMediaVersionTable.cs
index cedbb97666..632b6f8a6c 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameMediaVersionTable.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameMediaVersionTable.cs
@@ -9,7 +9,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
Rename.Table("cmsMedia").To(Cms.Core.Constants.DatabaseSchema.Tables.MediaVersion).Do();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameUmbracoDomainsTable.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameUmbracoDomainsTable.cs
index 9e89678e11..8bb2a8c14c 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameUmbracoDomainsTable.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/RenameUmbracoDomainsTable.cs
@@ -6,7 +6,7 @@
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
Rename.Table("umbracoDomains").To(Cms.Core.Constants.DatabaseSchema.Tables.Domain).Do();
}
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/SuperZero.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/SuperZero.cs
index 2d3c7264b6..4daab69962 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/SuperZero.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/SuperZero.cs
@@ -6,7 +6,7 @@
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
var exists = Database.Fetch("select id from umbracoUser where id=-1;").Count > 0;
if (exists) return;
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/TablesForScheduledPublishing.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/TablesForScheduledPublishing.cs
index db16e47701..531e7a06cc 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/TablesForScheduledPublishing.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/TablesForScheduledPublishing.cs
@@ -11,7 +11,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
//Get anything currently scheduled
var releaseSql = new Sql()
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/TagsMigration.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/TagsMigration.cs
index b90066c64a..35c32bddb9 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/TagsMigration.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/TagsMigration.cs
@@ -8,7 +8,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
// alter columns => non-null
AlterColumn(Cms.Core.Constants.DatabaseSchema.Tables.Tag, "group");
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/TagsMigrationFix.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/TagsMigrationFix.cs
index f4e37914a9..63ffd563a9 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/TagsMigrationFix.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/TagsMigrationFix.cs
@@ -6,7 +6,7 @@
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
// kill unused parentId column, if it still exists
if (ColumnExists(Cms.Core.Constants.DatabaseSchema.Tables.Tag, "ParentId"))
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/UpdateDefaultMandatoryLanguage.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/UpdateDefaultMandatoryLanguage.cs
index ddf3dfbcb5..e3251dc6ed 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/UpdateDefaultMandatoryLanguage.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/UpdateDefaultMandatoryLanguage.cs
@@ -9,7 +9,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
// add the new languages lock object
AddLockObjects.EnsureLockObject(Database, Cms.Core.Constants.Locks.Languages, "Languages");
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/UpdatePickerIntegerValuesToUdi.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/UpdatePickerIntegerValuesToUdi.cs
index 031d65dc73..cea0fbdd23 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/UpdatePickerIntegerValuesToUdi.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/UpdatePickerIntegerValuesToUdi.cs
@@ -13,7 +13,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
public UpdatePickerIntegerValuesToUdi(IMigrationContext context) : base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
var sqlDataTypes = Sql()
.Select()
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/UserForeignKeys.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/UserForeignKeys.cs
index f29526b8ce..03c3529f59 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/UserForeignKeys.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/UserForeignKeys.cs
@@ -11,7 +11,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
// first allow NULL-able
Alter.Table(ContentVersionCultureVariationDto.TableName).AlterColumn("availableUserId").AsInt32().Nullable().Do();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/VariantsMigration.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/VariantsMigration.cs
index d9e6109373..8dbc7d59b3 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/VariantsMigration.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_0/VariantsMigration.cs
@@ -17,7 +17,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_0
// notes
// do NOT use Rename.Column as it's borked on SQLCE - use ReplaceColumn instead
- public override void Migrate()
+ protected override void Migrate()
{
MigratePropertyData();
CreatePropertyDataIndexes();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_1/ChangeNuCacheJsonFormat.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_1/ChangeNuCacheJsonFormat.cs
index e0ba4c2403..74445d268d 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_1/ChangeNuCacheJsonFormat.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_0_1/ChangeNuCacheJsonFormat.cs
@@ -7,7 +7,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_0_1
public ChangeNuCacheJsonFormat(IMigrationContext context) : base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
// nothing - just adding the post-migration
Context.AddPostMigration();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_10_0/AddPropertyTypeLabelOnTopColumn.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_10_0/AddPropertyTypeLabelOnTopColumn.cs
index a8ecebbf99..6c6fd6166c 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_10_0/AddPropertyTypeLabelOnTopColumn.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_10_0/AddPropertyTypeLabelOnTopColumn.cs
@@ -10,7 +10,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_10_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
var columns = SqlSyntax.GetColumnsInSchema(Context.Database).ToList();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_15_0/AddCmsContentNuByteColumn.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_15_0/AddCmsContentNuByteColumn.cs
new file mode 100644
index 0000000000..2f0caa4939
--- /dev/null
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_15_0/AddCmsContentNuByteColumn.cs
@@ -0,0 +1,25 @@
+using System.Linq;
+using Umbraco.Cms.Core;
+using Umbraco.Cms.Infrastructure.Persistence.Dtos;
+
+namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_15_0
+{
+ public class AddCmsContentNuByteColumn : MigrationBase
+ {
+ public AddCmsContentNuByteColumn(IMigrationContext context)
+ : base(context)
+ {
+
+ }
+
+ protected override void Migrate()
+ {
+ var columns = SqlSyntax.GetColumnsInSchema(Context.Database).ToList();
+
+ AddColumnIfNotExists(columns, "dataRaw");
+
+ // allow null
+ AlterColumn(Constants.DatabaseSchema.Tables.NodeData, "data");
+ }
+ }
+}
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_15_0/UpgradedIncludeIndexes.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_15_0/UpgradedIncludeIndexes.cs
new file mode 100644
index 0000000000..9bdce9bfbf
--- /dev/null
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_15_0/UpgradedIncludeIndexes.cs
@@ -0,0 +1,66 @@
+using System.Linq;
+using Umbraco.Cms.Core;
+using Umbraco.Cms.Infrastructure.Migrations.Expressions.Execute.Expressions;
+using Umbraco.Cms.Infrastructure.Persistence.DatabaseModelDefinitions;
+using Umbraco.Cms.Infrastructure.Persistence.Dtos;
+
+namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_15_0
+{
+ public class UpgradedIncludeIndexes : MigrationBase
+ {
+ public UpgradedIncludeIndexes(IMigrationContext context)
+ : base(context)
+ {
+
+ }
+
+ protected override void Migrate()
+ {
+ // Need to drop the FK for the redirect table before modifying the unique id index
+ Delete.ForeignKey()
+ .FromTable(Constants.DatabaseSchema.Tables.RedirectUrl)
+ .ForeignColumn("contentKey")
+ .ToTable(NodeDto.TableName)
+ .PrimaryColumn("uniqueID")
+ .Do();
+ var nodeDtoIndexes = new[] { $"IX_{NodeDto.TableName}_UniqueId", $"IX_{NodeDto.TableName}_ObjectType", $"IX_{NodeDto.TableName}_Level" };
+ DeleteIndexes(nodeDtoIndexes); // delete existing ones
+ CreateIndexes(nodeDtoIndexes); // update/add
+ // Now re-create the FK for the redirect table
+ Create.ForeignKey()
+ .FromTable(Constants.DatabaseSchema.Tables.RedirectUrl)
+ .ForeignColumn("contentKey")
+ .ToTable(NodeDto.TableName)
+ .PrimaryColumn("uniqueID")
+ .Do();
+
+
+ var contentVersionIndexes = new[] { $"IX_{ContentVersionDto.TableName}_NodeId", $"IX_{ContentVersionDto.TableName}_Current" };
+ DeleteIndexes(contentVersionIndexes); // delete existing ones
+ CreateIndexes(contentVersionIndexes); // update/add
+ }
+
+ private void DeleteIndexes(params string[] toDelete)
+ {
+ var tableDef = DefinitionFactory.GetTableDefinition(typeof(T), Context.SqlContext.SqlSyntax);
+
+ foreach (var i in toDelete)
+ if (IndexExists(i))
+ Delete.Index(i).OnTable(tableDef.Name).Do();
+
+ }
+
+ private void CreateIndexes(params string[] toCreate)
+ {
+ var tableDef = DefinitionFactory.GetTableDefinition(typeof(T), Context.SqlContext.SqlSyntax);
+
+ foreach (var c in toCreate)
+ {
+ // get the definition by name
+ var index = tableDef.Indexes.First(x => x.Name == c);
+ new ExecuteSqlStatementExpression(Context) { SqlStatement = Context.SqlContext.SqlSyntax.Format(index) }.Execute();
+ }
+
+ }
+ }
+}
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_1_0/ConvertTinyMceAndGridMediaUrlsToLocalLink.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_1_0/ConvertTinyMceAndGridMediaUrlsToLocalLink.cs
index 3de504f48a..3f5a966544 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_1_0/ConvertTinyMceAndGridMediaUrlsToLocalLink.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_1_0/ConvertTinyMceAndGridMediaUrlsToLocalLink.cs
@@ -21,7 +21,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_1_0
_mediaService = mediaService ?? throw new ArgumentNullException(nameof(mediaService));
}
- public override void Migrate()
+ protected override void Migrate()
{
var mediaLinkPattern = new Regex(
@"(]*href="")(\/ media[^""\?]*)([^>]*>)",
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_1_0/FixContentNuCascade.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_1_0/FixContentNuCascade.cs
index 839baadec6..00389c547e 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_1_0/FixContentNuCascade.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_1_0/FixContentNuCascade.cs
@@ -8,7 +8,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_1_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
Delete.KeysAndIndexes().Do();
Create.KeysAndIndexes().Do();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_1_0/RenameUserLoginDtoDateIndex.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_1_0/RenameUserLoginDtoDateIndex.cs
index a88426966d..f06477579a 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_1_0/RenameUserLoginDtoDateIndex.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_1_0/RenameUserLoginDtoDateIndex.cs
@@ -8,7 +8,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_1_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
// there has been some confusion with an index name, resulting in
// different names depending on which migration path was followed,
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/AddMainDomLock.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/AddMainDomLock.cs
index 00e781c8b2..9fe257fafe 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/AddMainDomLock.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/AddMainDomLock.cs
@@ -8,7 +8,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_6_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
Database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.Lock, "id", false, new LockDto { Id = Cms.Core.Constants.Locks.MainDom, Name = "MainDom" });
}
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/AddNewRelationTypes.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/AddNewRelationTypes.cs
index 5feb6d887a..9c770adf15 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/AddNewRelationTypes.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/AddNewRelationTypes.cs
@@ -11,7 +11,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_6_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
CreateRelation(
Cms.Core.Constants.Conventions.RelationTypes.RelatedMediaAlias,
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/AddPropertyTypeValidationMessageColumns.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/AddPropertyTypeValidationMessageColumns.cs
index 63c4efa49c..9a9e2b5e77 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/AddPropertyTypeValidationMessageColumns.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/AddPropertyTypeValidationMessageColumns.cs
@@ -10,7 +10,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_6_0
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
var columns = SqlSyntax.GetColumnsInSchema(Context.Database).ToList();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/MissingContentVersionsIndexes.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/MissingContentVersionsIndexes.cs
index 68c7d1a174..2d4b227249 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/MissingContentVersionsIndexes.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/MissingContentVersionsIndexes.cs
@@ -10,7 +10,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_6_0
{
}
- public override void Migrate()
+ protected override void Migrate()
{
// We must check before we create an index because if we are upgrading from v7 we force re-create all
// indexes in the whole DB and then this would throw
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/UpdateRelationTypeTable.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/UpdateRelationTypeTable.cs
index 10b741bae8..bc3757eaad 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/UpdateRelationTypeTable.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_6_0/UpdateRelationTypeTable.cs
@@ -7,7 +7,7 @@
: base(context)
{ }
- public override void Migrate()
+ protected override void Migrate()
{
Alter.Table(Cms.Core.Constants.DatabaseSchema.Tables.RelationType).AlterColumn("parentObjectType").AsGuid().Nullable().Do();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_7_0/MissingDictionaryIndex.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_7_0/MissingDictionaryIndex.cs
index 287cb94edb..69e4a7423c 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_7_0/MissingDictionaryIndex.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_7_0/MissingDictionaryIndex.cs
@@ -14,7 +14,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_7_0
/// Adds an index to the foreign key column parent on DictionaryDto's table
/// if it doesn't already exist
///
- public override void Migrate()
+ protected override void Migrate()
{
var indexName = "IX_" + DictionaryDto.TableName + "_Parent";
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_9_0/ExternalLoginTableUserData.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_9_0/ExternalLoginTableUserData.cs
index 6865a35b7a..7f75bde572 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_9_0/ExternalLoginTableUserData.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_8_9_0/ExternalLoginTableUserData.cs
@@ -12,7 +12,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_8_9_0
///
/// Adds new column to the External Login table
///
- public override void Migrate()
+ protected override void Migrate()
{
AddColumn(Cms.Core.Constants.DatabaseSchema.Tables.ExternalLogin, "userData");
}
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/AddPasswordConfigToMemberTable.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/AddPasswordConfigToMemberTable.cs
index e01fb2eaab..01ea1cf3b3 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/AddPasswordConfigToMemberTable.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/AddPasswordConfigToMemberTable.cs
@@ -13,7 +13,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_9_0_0
///
/// Adds new columns to members table
///
- public override void Migrate()
+ protected override void Migrate()
{
var columns = SqlSyntax.GetColumnsInSchema(Context.Database).ToList();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/ExternalLoginTableIndexes.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/ExternalLoginTableIndexes.cs
index cf1124c4d9..ef29207093 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/ExternalLoginTableIndexes.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/ExternalLoginTableIndexes.cs
@@ -14,7 +14,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_9_0_0
///
/// Adds new indexes to the External Login table
///
- public override void Migrate()
+ protected override void Migrate()
{
// Before adding these indexes we need to remove duplicate data.
// Get all logins by latest
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/ExternalLoginTokenTable.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/ExternalLoginTokenTable.cs
index 418f0c3275..8dd43f1834 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/ExternalLoginTokenTable.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/ExternalLoginTokenTable.cs
@@ -15,7 +15,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_9_0_0
///
/// Adds new External Login token table
///
- public override void Migrate()
+ protected override void Migrate()
{
IEnumerable tables = SqlSyntax.GetTablesInSchema(Context.Database);
if (tables.InvariantContains(ExternalLoginTokenDto.TableName))
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/MemberTableColumns.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/MemberTableColumns.cs
index bf26e97540..5dd274ad05 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/MemberTableColumns.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/MemberTableColumns.cs
@@ -13,7 +13,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_9_0_0
///
/// Adds new columns to members table
///
- public override void Migrate()
+ protected override void Migrate()
{
var columns = SqlSyntax.GetColumnsInSchema(Context.Database).ToList();
diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/MigrateLogViewerQueriesFromFileToDb.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/MigrateLogViewerQueriesFromFileToDb.cs
index 0211e6b108..2eeca8804d 100644
--- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/MigrateLogViewerQueriesFromFileToDb.cs
+++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_0_0/MigrateLogViewerQueriesFromFileToDb.cs
@@ -63,7 +63,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_9_0_0
_hostingEnvironment = hostingEnvironment;
}
- public override void Migrate()
+ protected override void Migrate()
{
CreateDatabaseTable();
MigrateFileContentToDB();
diff --git a/src/Umbraco.Infrastructure/Models/MediaWithCrops.cs b/src/Umbraco.Infrastructure/Models/MediaWithCrops.cs
index e8d7e89522..cc80a34310 100644
--- a/src/Umbraco.Infrastructure/Models/MediaWithCrops.cs
+++ b/src/Umbraco.Infrastructure/Models/MediaWithCrops.cs
@@ -3,7 +3,7 @@
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PropertyEditors.ValueConverters;
-namespace Umbraco.Core.Models
+namespace Umbraco.Cms.Core.Models
{
///
/// Model used in Razor Views for rendering
diff --git a/src/Umbraco.Infrastructure/Models/PathValidationExtensions.cs b/src/Umbraco.Infrastructure/Models/PathValidationExtensions.cs
index 8758d17d07..e7286d683f 100644
--- a/src/Umbraco.Infrastructure/Models/PathValidationExtensions.cs
+++ b/src/Umbraco.Infrastructure/Models/PathValidationExtensions.cs
@@ -1,7 +1,6 @@
-using System;
+using System;
using System.IO;
using Microsoft.Extensions.Logging;
-using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models.Entities;
using Umbraco.Cms.Infrastructure.Persistence.Dtos;
using Umbraco.Extensions;
diff --git a/src/Umbraco.Infrastructure/Persistence/DatabaseAnnotations/IndexAttribute.cs b/src/Umbraco.Infrastructure/Persistence/DatabaseAnnotations/IndexAttribute.cs
index 5c9f41b097..6d1db2dc5f 100644
--- a/src/Umbraco.Infrastructure/Persistence/DatabaseAnnotations/IndexAttribute.cs
+++ b/src/Umbraco.Infrastructure/Persistence/DatabaseAnnotations/IndexAttribute.cs
@@ -31,5 +31,10 @@ namespace Umbraco.Cms.Infrastructure.Persistence.DatabaseAnnotations
/// Gets or sets the column name(s) for the current index
///
public string ForColumns { get; set; }
+
+ ///
+ /// Gets or sets the column name(s) for the columns to include in the index
+ ///
+ public string IncludeColumns { get; set; }
}
}
diff --git a/src/Umbraco.Infrastructure/Persistence/DatabaseModelDefinitions/DefinitionFactory.cs b/src/Umbraco.Infrastructure/Persistence/DatabaseModelDefinitions/DefinitionFactory.cs
index a3ca285918..407672c995 100644
--- a/src/Umbraco.Infrastructure/Persistence/DatabaseModelDefinitions/DefinitionFactory.cs
+++ b/src/Umbraco.Infrastructure/Persistence/DatabaseModelDefinitions/DefinitionFactory.cs
@@ -167,6 +167,14 @@ namespace Umbraco.Cms.Infrastructure.Persistence.DatabaseModelDefinitions
definition.Columns.Add(new IndexColumnDefinition {Name = column, Direction = Direction.Ascending});
}
}
+ if (string.IsNullOrEmpty(attribute.IncludeColumns) == false)
+ {
+ var columns = attribute.IncludeColumns.Split(',').Select(p => p.Trim());
+ foreach (var column in columns)
+ {
+ definition.IncludeColumns.Add(new IndexColumnDefinition { Name = column, Direction = Direction.Ascending });
+ }
+ }
return definition;
}
}
diff --git a/src/Umbraco.Infrastructure/Persistence/DatabaseModelDefinitions/IndexDefinition.cs b/src/Umbraco.Infrastructure/Persistence/DatabaseModelDefinitions/IndexDefinition.cs
index a1e14ac580..822bf79383 100644
--- a/src/Umbraco.Infrastructure/Persistence/DatabaseModelDefinitions/IndexDefinition.cs
+++ b/src/Umbraco.Infrastructure/Persistence/DatabaseModelDefinitions/IndexDefinition.cs
@@ -5,17 +5,13 @@ namespace Umbraco.Cms.Infrastructure.Persistence.DatabaseModelDefinitions
{
public class IndexDefinition
{
- public IndexDefinition()
- {
- Columns = new List();
- }
-
public virtual string Name { get; set; }
public virtual string SchemaName { get; set; }
public virtual string TableName { get; set; }
public virtual string ColumnName { get; set; }
- public virtual ICollection Columns { get; set; }
+ public virtual ICollection Columns { get; set; } = new List();
+ public virtual ICollection IncludeColumns { get; set; } = new List();
public IndexTypes IndexType { get; set; }
}
}
diff --git a/src/Umbraco.Infrastructure/Persistence/Dtos/ContentNuDto.cs b/src/Umbraco.Infrastructure/Persistence/Dtos/ContentNuDto.cs
index 27f277293c..a5ca3496ee 100644
--- a/src/Umbraco.Infrastructure/Persistence/Dtos/ContentNuDto.cs
+++ b/src/Umbraco.Infrastructure/Persistence/Dtos/ContentNuDto.cs
@@ -25,9 +25,16 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Dtos
///
[Column("data")]
[SpecialDbType(SpecialDbTypes.NTEXT)]
+ [NullSetting(NullSetting = NullSettings.Null)]
public string Data { get; set; }
[Column("rv")]
public long Rv { get; set; }
+
+ [Column("dataRaw")]
+ [NullSetting(NullSetting = NullSettings.Null)]
+ public byte[] RawData { get; set; }
+
+
}
}
diff --git a/src/Umbraco.Infrastructure/Persistence/Dtos/ContentVersionDto.cs b/src/Umbraco.Infrastructure/Persistence/Dtos/ContentVersionDto.cs
index 72e4edf85d..53e90859d9 100644
--- a/src/Umbraco.Infrastructure/Persistence/Dtos/ContentVersionDto.cs
+++ b/src/Umbraco.Infrastructure/Persistence/Dtos/ContentVersionDto.cs
@@ -19,7 +19,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Dtos
[Column("nodeId")]
[ForeignKey(typeof(ContentDto))]
- [Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_NodeId", ForColumns = "nodeId,current")]
+ [Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_NodeId", ForColumns = "nodeId,current", IncludeColumns = "id,versionDate,text,userId")]
public int NodeId { get; set; }
[Column("versionDate")] // TODO: db rename to 'updateDate'
@@ -32,6 +32,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Dtos
public int? UserId { get => _userId == 0 ? null : _userId; set => _userId = value; } //return null if zero
[Column("current")]
+ [Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_Current", IncludeColumns = "nodeId")]
public bool Current { get; set; }
// about current:
diff --git a/src/Umbraco.Infrastructure/Persistence/Dtos/NodeDto.cs b/src/Umbraco.Infrastructure/Persistence/Dtos/NodeDto.cs
index d401a6f5b8..4639e4529a 100644
--- a/src/Umbraco.Infrastructure/Persistence/Dtos/NodeDto.cs
+++ b/src/Umbraco.Infrastructure/Persistence/Dtos/NodeDto.cs
@@ -20,7 +20,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Dtos
[Column("uniqueId")]
[NullSetting(NullSetting = NullSettings.NotNull)]
- [Index(IndexTypes.UniqueNonClustered, Name = "IX_" + TableName + "_UniqueId")]
+ [Index(IndexTypes.UniqueNonClustered, Name = "IX_" + TableName + "_UniqueId", IncludeColumns = "parentId,level,path,sortOrder,trashed,nodeUser,text,createDate")]
[Constraint(Default = SystemMethods.NewGuid)]
public Guid UniqueId { get; set; }
@@ -29,7 +29,9 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Dtos
[Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_ParentId")]
public int ParentId { get; set; }
+ // NOTE: This index is primarily for the nucache data lookup, see https://github.com/umbraco/Umbraco-CMS/pull/8365#issuecomment-673404177
[Column("level")]
+ [Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_Level", ForColumns = "level,parentId,sortOrder,nodeObjectType,trashed", IncludeColumns = "nodeUser,path,uniqueId,createDate")]
public short Level { get; set; }
[Column("path")]
@@ -55,8 +57,8 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Dtos
public string Text { get; set; }
[Column("nodeObjectType")] // TODO: db rename to 'objectType'
- [NullSetting(NullSetting = NullSettings.Null)]
- [Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_ObjectType")]
+ [NullSetting(NullSetting = NullSettings.Null)]
+ [Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_ObjectType", ForColumns = "nodeObjectType,trashed", IncludeColumns = "uniqueId,parentId,level,path,sortOrder,nodeUser,text,createDate")]
public Guid? NodeObjectType { get; set; }
[Column("createDate")]
diff --git a/src/Umbraco.Infrastructure/Persistence/Mappers/PocoMapper.cs b/src/Umbraco.Infrastructure/Persistence/Mappers/NullableDateMapper.cs
similarity index 89%
rename from src/Umbraco.Infrastructure/Persistence/Mappers/PocoMapper.cs
rename to src/Umbraco.Infrastructure/Persistence/Mappers/NullableDateMapper.cs
index 835451755b..c647c4b93e 100644
--- a/src/Umbraco.Infrastructure/Persistence/Mappers/PocoMapper.cs
+++ b/src/Umbraco.Infrastructure/Persistence/Mappers/NullableDateMapper.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Reflection;
using NPoco;
@@ -7,7 +7,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Mappers
///
/// Extends NPoco default mapper and ensures that nullable dates are not saved to the database.
///
- public class PocoMapper : DefaultMapper
+ public class NullableDateMapper : DefaultMapper
{
public override Func