Merge remote-tracking branch 'origin/v9/dev' into v9/task/package-refactor
# Conflicts: # src/Umbraco.Core/Migrations/IMigration.cs # src/Umbraco.Core/Migrations/MigrationPlan.cs # src/Umbraco.Infrastructure/Migrations/IMigrationContext.cs # src/Umbraco.Infrastructure/Runtime/RuntimeState.cs # src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/MigrationTests.cs # src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml # src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml
This commit is contained in:
33
.github/ISSUE_TEMPLATE/02_feature_request.yml
vendored
33
.github/ISSUE_TEMPLATE/02_feature_request.yml
vendored
@@ -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.
|
||||
3
.github/ISSUE_TEMPLATE/config.yml
vendored
3
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -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.
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
namespace Umbraco.Cms.Core.Configuration.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// The serializer type that nucache uses to persist documents in the database.
|
||||
/// </summary>
|
||||
public enum NuCacheSerializerType
|
||||
{
|
||||
MessagePack = 1, // Default
|
||||
JSON = 2
|
||||
}
|
||||
}
|
||||
@@ -12,5 +12,15 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
/// Gets or sets a value defining the BTree block size.
|
||||
/// </summary>
|
||||
public int? BTreeBlockSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The serializer type that nucache uses to persist documents in the database.
|
||||
/// </summary>
|
||||
public NuCacheSerializerType NuCacheSerializerType { get; set; } = NuCacheSerializerType.MessagePack;
|
||||
|
||||
/// <summary>
|
||||
/// The paging size to use for nucache SQL queries.
|
||||
/// </summary>
|
||||
public int SqlPageSize { get; set; } = 1000;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,25 +122,45 @@ namespace Umbraco.Cms.Core
|
||||
public const string Image = "Image";
|
||||
|
||||
/// <summary>
|
||||
/// MediaType alias for a video.
|
||||
/// MediaType name for a video.
|
||||
/// </summary>
|
||||
public const string Video = "Video";
|
||||
|
||||
/// <summary>
|
||||
/// MediaType alias for an audio.
|
||||
/// MediaType name for an audio.
|
||||
/// </summary>
|
||||
public const string Audio = "Audio";
|
||||
|
||||
/// <summary>
|
||||
/// MediaType alias for an article.
|
||||
/// MediaType name for an article.
|
||||
/// </summary>
|
||||
public const string Article = "Article";
|
||||
|
||||
/// <summary>
|
||||
/// MediaType alias for vector graphics.
|
||||
/// MediaType name for vector graphics.
|
||||
/// </summary>
|
||||
public const string VectorGraphics = "VectorGraphics";
|
||||
|
||||
/// <summary>
|
||||
/// MediaType alias for a video.
|
||||
/// </summary>
|
||||
public const string VideoAlias = "umbracoMediaVideo";
|
||||
|
||||
/// <summary>
|
||||
/// MediaType alias for an audio.
|
||||
/// </summary>
|
||||
public const string AudioAlias = "umbracoMediaAudio";
|
||||
|
||||
/// <summary>
|
||||
/// MediaType alias for an article.
|
||||
/// </summary>
|
||||
public const string ArticleAlias = "umbracoMediaArticle";
|
||||
|
||||
/// <summary>
|
||||
/// MediaType alias for vector graphics.
|
||||
/// </summary>
|
||||
public const string VectorGraphicsAlias = "umbracoMediaVectorGraphics";
|
||||
|
||||
/// <summary>
|
||||
/// MediaType alias indicating allowing auto-selection.
|
||||
/// </summary>
|
||||
|
||||
@@ -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";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<MemberGroupDeletedNotification, PublicAccessHandler>();
|
||||
|
||||
Services.AddSingleton<ISyncBootStateAccessor, NonRuntimeLevelBootStateAccessor>();
|
||||
|
||||
// register a basic/noop published snapshot service to be replaced
|
||||
Services.AddSingleton<IPublishedSnapshotService, InternalPublishedSnapshotService>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
using System;
|
||||
@@ -85,10 +85,13 @@ namespace Umbraco.Cms.Core.HealthChecks.Checks
|
||||
}
|
||||
|
||||
string resultMessage = string.Format(CheckErrorMessage, ItemPath, Values, CurrentValue);
|
||||
return Task.FromResult(new HealthCheckStatus(resultMessage)
|
||||
var healthCheckStatus = new HealthCheckStatus(resultMessage)
|
||||
{
|
||||
ResultType = StatusResultType.Error, ReadMoreLink = ReadMoreLink
|
||||
}.Yield());
|
||||
ResultType = StatusResultType.Error,
|
||||
ReadMoreLink = ReadMoreLink
|
||||
};
|
||||
|
||||
return Task.FromResult(healthCheckStatus.Yield());
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
using System.Collections.Generic;
|
||||
@@ -9,6 +9,7 @@ using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.Core.HealthChecks.Checks.Configuration
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Health check for the recommended production configuration for Notification Email.
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
namespace Umbraco.Cms.Core.HealthChecks.Checks
|
||||
{
|
||||
public enum ProvidedValueValidation
|
||||
{
|
||||
None = 1,
|
||||
Email = 2,
|
||||
Regex = 3
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
@@ -44,6 +44,10 @@ namespace Umbraco.Cms.Core.HealthChecks
|
||||
/// Get the status for this health check
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
/// If there are possible actions to take to rectify this check, this method must be overridden by a sub class
|
||||
/// in order to explicitly provide those actions.
|
||||
/// </remarks>
|
||||
public abstract Task<IEnumerable<HealthCheckStatus>> GetStatus();
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
@@ -68,6 +68,18 @@ namespace Umbraco.Cms.Core.HealthChecks
|
||||
[DataMember(Name = "valueRequired")]
|
||||
public bool ValueRequired { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if a value required, how it is validated
|
||||
/// </summary>
|
||||
[DataMember(Name = "providedValueValidation")]
|
||||
public string ProvidedValueValidation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if a value required, and is validated by a regex, what the regex to use is
|
||||
/// </summary>
|
||||
[DataMember(Name = "providedValueValidationRegex")]
|
||||
public string ProvidedValueValidationRegex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides a value to rectify the issue
|
||||
/// </summary>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
using Umbraco.Cms.Core.Composing;
|
||||
|
||||
namespace Umbraco.Cms.Core.Migrations
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a migration.
|
||||
/// </summary>
|
||||
public interface IMigration
|
||||
{
|
||||
/// <summary>
|
||||
/// Executes the migration.
|
||||
/// </summary>
|
||||
void Migrate();
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ namespace Umbraco.Cms.Core.Migrations
|
||||
/// Adds a transition to a target state through a migration.
|
||||
/// </summary>
|
||||
public MergeBuilder To<TMigration>(string targetState)
|
||||
where TMigration : IMigration
|
||||
where TMigration : MigrationBase
|
||||
=> To(targetState, typeof(TMigration));
|
||||
|
||||
/// <summary>
|
||||
@@ -70,16 +70,21 @@ namespace Umbraco.Cms.Core.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);
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Umbraco.Cms.Core.Scoping;
|
||||
using Umbraco.Extensions;
|
||||
using Type = System.Type;
|
||||
|
||||
@@ -68,7 +70,7 @@ namespace Umbraco.Cms.Core.Migrations
|
||||
throw new ArgumentException("Source and target state cannot be identical.");
|
||||
if (migration == null)
|
||||
throw new ArgumentNullException(nameof(migration));
|
||||
if (!migration.Implements<IMigration>())
|
||||
if (!migration.Implements<MigrationBase>())
|
||||
throw new ArgumentException($"Type {migration.Name} does not implement IMigration.", nameof(migration));
|
||||
|
||||
sourceState = sourceState.Trim();
|
||||
@@ -108,7 +110,7 @@ namespace Umbraco.Cms.Core.Migrations
|
||||
/// Adds a transition to a target state through a migration.
|
||||
/// </summary>
|
||||
public MigrationPlan To<TMigration>(string targetState)
|
||||
where TMigration : IMigration
|
||||
where TMigration : MigrationBase
|
||||
=> To(targetState, typeof(TMigration));
|
||||
|
||||
public MigrationPlan To<TMigration>(Guid targetState)
|
||||
@@ -141,8 +143,8 @@ namespace Umbraco.Cms.Core.Migrations
|
||||
/// <param name="recoverState">The previous target state, which we need to recover from through <typeparamref name="TMigrationRecover"/>.</param>
|
||||
/// <param name="targetState">The new target state.</param>
|
||||
public MigrationPlan ToWithReplace<TMigrationNew, TMigrationRecover>(string recoverState, string targetState)
|
||||
where TMigrationNew : IMigration
|
||||
where TMigrationRecover : IMigration
|
||||
where TMigrationNew : MigrationBase
|
||||
where TMigrationRecover : MigrationBase
|
||||
{
|
||||
To<TMigrationNew>(targetState);
|
||||
From(recoverState).To<TMigrationRecover>(targetState);
|
||||
@@ -156,7 +158,7 @@ namespace Umbraco.Cms.Core.Migrations
|
||||
/// <param name="recoverState">The previous target state, which we can recover from directly.</param>
|
||||
/// <param name="targetState">The new target state.</param>
|
||||
public MigrationPlan ToWithReplace<TMigrationNew>(string recoverState, string targetState)
|
||||
where TMigrationNew : IMigration
|
||||
where TMigrationNew : MigrationBase
|
||||
{
|
||||
To<TMigrationNew>(targetState);
|
||||
From(recoverState).To(targetState);
|
||||
@@ -213,7 +215,7 @@ namespace Umbraco.Cms.Core.Migrations
|
||||
/// Adds a post-migration to the plan.
|
||||
/// </summary>
|
||||
public virtual MigrationPlan AddPostMigration<TMigration>()
|
||||
where TMigration : IMigration
|
||||
where TMigration : MigrationBase
|
||||
{
|
||||
_postMigrationTypes.Add(typeof(TMigration));
|
||||
return this;
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace Umbraco.Cms.Core.Migrations
|
||||
{
|
||||
public class NoopMigration : IMigration
|
||||
{
|
||||
public void Migrate()
|
||||
{
|
||||
// nop
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using Umbraco.Cms.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Provides a base class for content items.
|
||||
/// </summary>
|
||||
|
||||
72
src/Umbraco.Core/Models/IReadOnlyContentBase.cs
Normal file
72
src/Umbraco.Core/Models/IReadOnlyContentBase.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models
|
||||
{
|
||||
public interface IReadOnlyContentBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the integer identifier of the entity.
|
||||
/// </summary>
|
||||
int Id { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Guid unique identifier of the entity.
|
||||
/// </summary>
|
||||
Guid Key { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the creation date.
|
||||
/// </summary>
|
||||
DateTime CreateDate { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the last update date.
|
||||
/// </summary>
|
||||
DateTime UpdateDate { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the entity.
|
||||
/// </summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the identifier of the user who created this entity.
|
||||
/// </summary>
|
||||
int CreatorId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the identifier of the parent entity.
|
||||
/// </summary>
|
||||
int ParentId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the level of the entity.
|
||||
/// </summary>
|
||||
int Level { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path to the entity.
|
||||
/// </summary>
|
||||
string Path { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sort order of the entity.
|
||||
/// </summary>
|
||||
int SortOrder { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content type id
|
||||
/// </summary>
|
||||
int ContentTypeId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the identifier of the writer.
|
||||
/// </summary>
|
||||
int WriterId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the version identifier.
|
||||
/// </summary>
|
||||
int VersionId { get; }
|
||||
}
|
||||
}
|
||||
42
src/Umbraco.Core/Models/ReadOnlyContentBaseAdapter.cs
Normal file
42
src/Umbraco.Core/Models/ReadOnlyContentBaseAdapter.cs
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ namespace Umbraco.Cms.Core.PropertyEditors
|
||||
public class DataEditor : IDataEditor
|
||||
{
|
||||
private IDictionary<string, object> _defaultConfiguration;
|
||||
private IDataValueEditor _reusableEditor;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DataEditor"/> class.
|
||||
@@ -89,7 +90,8 @@ namespace Umbraco.Cms.Core.PropertyEditors
|
||||
/// simple enough for now.</para>
|
||||
/// </remarks>
|
||||
// TODO: point of that one? shouldn't we always configure?
|
||||
public IDataValueEditor GetValueEditor() => ExplicitValueEditor ?? CreateValueEditor();
|
||||
public IDataValueEditor GetValueEditor() => ExplicitValueEditor ?? (_reusableEditor ?? (_reusableEditor = CreateValueEditor()));
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Umbraco.Cms.Core.PropertyEditors
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Marks a class that represents a data editor.
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.PropertyEditors
|
||||
{
|
||||
/// <summary>
|
||||
/// Determines if a property type's value should be compressed in memory
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
public interface IPropertyCacheCompression
|
||||
{
|
||||
bool IsCompressed(IReadOnlyContentBase content, string propertyTypeAlias);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.PropertyEditors
|
||||
{
|
||||
/// <summary>
|
||||
/// Default implementation for <see cref="IPropertyCacheCompressionOptions"/> which does not compress any property data
|
||||
/// </summary>
|
||||
public sealed class NoopPropertyCacheCompressionOptions : IPropertyCacheCompressionOptions
|
||||
{
|
||||
public bool IsCompressed(IReadOnlyContentBase content, IPropertyType propertyType, IDataEditor dataEditor) => false;
|
||||
}
|
||||
}
|
||||
51
src/Umbraco.Core/PropertyEditors/PropertyCacheCompression.cs
Normal file
51
src/Umbraco.Core/PropertyEditors/PropertyCacheCompression.cs
Normal file
@@ -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
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Compresses property data based on config
|
||||
/// </summary>
|
||||
public class PropertyCacheCompression : IPropertyCacheCompression
|
||||
{
|
||||
private readonly IPropertyCacheCompressionOptions _compressionOptions;
|
||||
private readonly IReadOnlyDictionary<int, IContentTypeComposition> _contentTypes;
|
||||
private readonly PropertyEditorCollection _propertyEditors;
|
||||
private readonly ConcurrentDictionary<(int contentTypeId, string propertyAlias), bool> _isCompressedCache;
|
||||
|
||||
public PropertyCacheCompression(
|
||||
IPropertyCacheCompressionOptions compressionOptions,
|
||||
IReadOnlyDictionary<int, IContentTypeComposition> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,16 +36,26 @@ namespace Umbraco.Cms.Core.PublishedCache
|
||||
/// </summary>
|
||||
/// <param name="preview">A value indicating whether to consider unpublished content.</param>
|
||||
/// <param name="contentId">The content unique identifier.</param>
|
||||
/// <returns>The route.</returns>
|
||||
/// <remarks>The value of <paramref name="preview"/> overrides defaults.</remarks>
|
||||
/// <returns>A special string formatted route path.</returns>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// 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
|
||||
/// </para>
|
||||
/// <para>The value of <paramref name="preview"/> overrides defaults.</para>
|
||||
/// </remarks>
|
||||
string GetRouteById(bool preview, int contentId, string culture = null);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the route for a content identified by its unique identifier.
|
||||
/// </summary>
|
||||
/// <param name="contentId">The content unique identifier.</param>
|
||||
/// <returns>The route.</returns>
|
||||
/// <returns>A special string formatted route path.</returns>
|
||||
/// <remarks>Considers published or unpublished content depending on defaults.</remarks>
|
||||
/// <para>
|
||||
/// 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
|
||||
/// </para>
|
||||
string GetRouteById(int contentId, string culture = null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ namespace Umbraco.Cms.Core.PublishedCache
|
||||
/// <summary>
|
||||
/// Rebuilds internal database caches (but does not reload).
|
||||
/// </summary>
|
||||
/// <param name="groupSize">The operation batch size to process the items</param>
|
||||
/// <param name="contentTypeIds">If not null will process content for the matching content types, if empty will process all content</param>
|
||||
/// <param name="mediaTypeIds">If not null will process content for the matching media types, if empty will process all media</param>
|
||||
/// <param name="memberTypeIds">If not null will process content for the matching members types, if empty will process all members</param>
|
||||
@@ -47,7 +46,6 @@ namespace Umbraco.Cms.Core.PublishedCache
|
||||
/// <see cref="DistributedCache" /> RefreshAllPublishedSnapshot method.</para>
|
||||
/// </remarks>
|
||||
void Rebuild(
|
||||
int groupSize = 5000,
|
||||
IReadOnlyCollection<int> contentTypeIds = null,
|
||||
IReadOnlyCollection<int> mediaTypeIds = null,
|
||||
IReadOnlyCollection<int> memberTypeIds = null);
|
||||
|
||||
@@ -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<string, PublishedCultureInfo> _cultures;
|
||||
|
||||
private Dictionary<string, PublishedCultureInfo> GetCultures() => new Dictionary<string, PublishedCultureInfo> { { 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<string, PublishedCultureInfo> 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<int> ChildIds { get; set; }
|
||||
|
||||
public IPublishedContent Parent { get; set; }
|
||||
|
||||
public IEnumerable<IPublishedContent> Children { get; set; }
|
||||
|
||||
public IEnumerable<IPublishedContent> ChildrenForAllCultures => Children;
|
||||
|
||||
public IPublishedContentType ContentType { get; set; }
|
||||
|
||||
public IEnumerable<IPublishedProperty> 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<int, IPublishedContent> _content = new Dictionary<int, IPublishedContent>();
|
||||
|
||||
public InternalPublishedContentCache()
|
||||
: base(false)
|
||||
{
|
||||
}
|
||||
|
||||
//public void Add(InternalPublishedContent content) => _content[content.Id] = content.CreateModel(Mock.Of<IPublishedModelFactory>());
|
||||
|
||||
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<IPublishedContent> 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<IPublishedContent> GetByXPath(bool preview, string xpath, XPathVariable[] vars) => throw new NotImplementedException();
|
||||
|
||||
public override IEnumerable<IPublishedContent> 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<IPublishedContent> GetByContentType(IPublishedContentType contentType) => throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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<bool> callback = null) => throw new NotImplementedException();
|
||||
|
||||
public void Resync()
|
||||
{
|
||||
}
|
||||
|
||||
public IAppCache SnapshotCache => null;
|
||||
|
||||
public IAppCache ElementsCache => null;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<int> contentTypeIds = null, IReadOnlyCollection<int> mediaTypeIds = null, IReadOnlyCollection<int> memberTypeIds = null)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.7" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<RootNamespace>Umbraco.Cms.Infrastructure.Examine</RootNamespace>
|
||||
@@ -25,7 +25,7 @@
|
||||
<ProjectReference Include="..\Umbraco.Infrastructure\Umbraco.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Examine" Version="2.0.0-beta.150" />
|
||||
<PackageReference Include="Examine" Version="2.0.0-beta.154" />
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
|
||||
@@ -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
|
||||
/// <param name="builder">The builder.</param>
|
||||
public static MapperCollectionBuilder Mappers(this IUmbracoBuilder builder)
|
||||
=> builder.WithCollectionBuilder<MapperCollectionBuilder>();
|
||||
|
||||
public static NPocoMapperCollectionBuilder NPocoMappers(this IUmbracoBuilder builder)
|
||||
=> builder.WithCollectionBuilder<NPocoMapperCollectionBuilder>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ using Umbraco.Cms.Infrastructure.Migrations.PostMigrations;
|
||||
using Umbraco.Cms.Infrastructure.Packaging;
|
||||
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;
|
||||
@@ -68,6 +69,8 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
|
||||
builder.Services.AddUnique<IUmbracoDatabaseFactory, UmbracoDatabaseFactory>();
|
||||
builder.Services.AddUnique(factory => factory.GetRequiredService<IUmbracoDatabaseFactory>().CreateDatabase());
|
||||
builder.Services.AddUnique(factory => factory.GetRequiredService<IUmbracoDatabaseFactory>().SqlContext);
|
||||
builder.NPocoMappers().Add<NullableDateMapper>();
|
||||
|
||||
builder.Services.AddUnique<IRuntimeState, RuntimeState>();
|
||||
builder.Services.AddUnique<IRuntime, CoreRuntime>();
|
||||
builder.Services.AddUnique<PendingPackageMigrations>();
|
||||
@@ -212,9 +215,18 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
|
||||
var databaseSchemaCreatorFactory = factory.GetRequiredService<DatabaseSchemaCreatorFactory>();
|
||||
var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
var loggerFactory = factory.GetRequiredService<ILoggerFactory>();
|
||||
var npocoMappers = factory.GetRequiredService<NPocoMapperCollection>();
|
||||
|
||||
return globalSettings.Value.MainDomLock.Equals("SqlMainDomLock") || isWindows == false
|
||||
? (IMainDomLock)new SqlMainDomLock(loggerFactory.CreateLogger<SqlMainDomLock>(), loggerFactory, globalSettings, connectionStrings, dbCreator, hostingEnvironment, databaseSchemaCreatorFactory)
|
||||
? (IMainDomLock)new SqlMainDomLock(
|
||||
loggerFactory.CreateLogger<SqlMainDomLock>(),
|
||||
loggerFactory,
|
||||
globalSettings,
|
||||
connectionStrings,
|
||||
dbCreator,
|
||||
hostingEnvironment,
|
||||
databaseSchemaCreatorFactory,
|
||||
npocoMappers)
|
||||
: new MainDomSemaphoreLock(loggerFactory.CreateLogger<MainDomSemaphoreLock>(), hostingEnvironment);
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -43,6 +42,6 @@ namespace Umbraco.Cms.Infrastructure.Migrations
|
||||
/// Adds a post-migration.
|
||||
/// </summary>
|
||||
void AddPostMigration<TMigration>()
|
||||
where TMigration : IMigration;
|
||||
where TMigration : MigrationBase;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Cms.Core.Migrations
|
||||
namespace Umbraco.Cms.Infrastructure.Migrations
|
||||
{
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </remarks>
|
||||
/// <seealso cref="System.Exception" />
|
||||
/// <seealso cref="Exception" />
|
||||
[Serializable]
|
||||
public class IncompleteMigrationExpressionException : Exception
|
||||
{
|
||||
@@ -151,8 +151,8 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install
|
||||
//New UDI pickers with newer Ids
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1046, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1046", SortOrder = 2, UniqueId = new Guid("FD1E0DA5-5606-4862-B679-5D0CF3A52A59"), Text = "Content Picker", NodeObjectType = Cms.Core.Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1047, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1047", SortOrder = 2, UniqueId = new Guid("1EA2E01F-EBD8-4CE1-8D71-6B1149E63548"), Text = "Member Picker", NodeObjectType = Cms.Core.Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1048, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1048", SortOrder = 2, UniqueId = new Guid("135D60E0-64D9-49ED-AB08-893C9BA44AE5"), Text = "(Obsolete) Media Picker", NodeObjectType = Cms.Core.Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1049, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1049", SortOrder = 2, UniqueId = new Guid("9DBBCBBB-2327-434A-B355-AF1B84E5010A"), Text = "(Obsolete) Multiple Media Picker", NodeObjectType = Cms.Core.Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1048, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1048", SortOrder = 2, UniqueId = new Guid("135D60E0-64D9-49ED-AB08-893C9BA44AE5"), Text = "Media Picke (legacy)", NodeObjectType = Cms.Core.Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1049, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1049", SortOrder = 2, UniqueId = new Guid("9DBBCBBB-2327-434A-B355-AF1B84E5010A"), Text = "Multiple Media Picker (legacy)", NodeObjectType = Cms.Core.Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1050, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1050", SortOrder = 2, UniqueId = new Guid("B4E3535A-1753-47E2-8568-602CF8CFEE6F"), Text = "Multi URL Picker", NodeObjectType = Cms.Core.Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1051, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1051", SortOrder = 2, UniqueId = Cms.Core.Constants.DataTypes.Guids.MediaPicker3Guid, Text = "Media Picker", NodeObjectType = Cms.Core.Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
@@ -184,10 +184,10 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 532, NodeId = 1031, Alias = Cms.Core.Constants.Conventions.MediaTypes.Folder, Icon = Cms.Core.Constants.Icons.MediaFolder, Thumbnail = Cms.Core.Constants.Icons.MediaFolder, IsContainer = false, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 533, NodeId = 1032, Alias = Cms.Core.Constants.Conventions.MediaTypes.Image, Icon = Cms.Core.Constants.Icons.MediaImage, Thumbnail = Cms.Core.Constants.Icons.MediaImage, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 534, NodeId = 1033, Alias = Cms.Core.Constants.Conventions.MediaTypes.File, Icon = Cms.Core.Constants.Icons.MediaFile, Thumbnail = Cms.Core.Constants.Icons.MediaFile, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 540, NodeId = 1034, Alias = Cms.Core.Constants.Conventions.MediaTypes.Video, Icon = Cms.Core.Constants.Icons.MediaVideo, Thumbnail = Cms.Core.Constants.Icons.MediaVideo, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 541, NodeId = 1035, Alias = Cms.Core.Constants.Conventions.MediaTypes.Audio, Icon = Cms.Core.Constants.Icons.MediaAudio, Thumbnail = Cms.Core.Constants.Icons.MediaAudio, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 542, NodeId = 1036, Alias = Cms.Core.Constants.Conventions.MediaTypes.Article, Icon = Cms.Core.Constants.Icons.MediaArticle, Thumbnail = Cms.Core.Constants.Icons.MediaArticle, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 543, NodeId = 1037, Alias = Cms.Core.Constants.Conventions.MediaTypes.VectorGraphics, Icon = Cms.Core.Constants.Icons.MediaVectorGraphics, Thumbnail = Cms.Core.Constants.Icons.MediaVectorGraphics, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 540, NodeId = 1034, Alias = Cms.Core.Constants.Conventions.MediaTypes.VideoAlias, Icon = Cms.Core.Constants.Icons.MediaVideo, Thumbnail = Cms.Core.Constants.Icons.MediaVideo, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 541, NodeId = 1035, Alias = Cms.Core.Constants.Conventions.MediaTypes.AudioAlias, Icon = Cms.Core.Constants.Icons.MediaAudio, Thumbnail = Cms.Core.Constants.Icons.MediaAudio, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 542, NodeId = 1036, Alias = Cms.Core.Constants.Conventions.MediaTypes.ArticleAlias, Icon = Cms.Core.Constants.Icons.MediaArticle, Thumbnail = Cms.Core.Constants.Icons.MediaArticle, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 543, NodeId = 1037, Alias = Cms.Core.Constants.Conventions.MediaTypes.VectorGraphicsAlias, Icon = Cms.Core.Constants.Icons.MediaVectorGraphics, Thumbnail = Cms.Core.Constants.Icons.MediaVectorGraphics, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
|
||||
_database.Insert(Cms.Core.Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 531, NodeId = 1044, Alias = Cms.Core.Constants.Conventions.MemberTypes.DefaultAlias, Icon = Cms.Core.Constants.Icons.Member, Thumbnail = Cms.Core.Constants.Icons.Member, Variations = (byte) ContentVariation.Nothing });
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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
|
||||
/// <summary>
|
||||
/// Provides a base class to all migrations.
|
||||
/// </summary>
|
||||
public abstract partial class MigrationBase : IMigration
|
||||
public abstract partial class MigrationBase : IDiscoverable
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MigrationBase"/> class.
|
||||
/// </summary>
|
||||
/// <param name="context">A migration context.</param>
|
||||
protected MigrationBase(IMigrationContext context)
|
||||
{
|
||||
Context = context;
|
||||
}
|
||||
=> Context = context;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the migration context.
|
||||
@@ -65,17 +63,21 @@ namespace Umbraco.Cms.Infrastructure.Migrations
|
||||
/// <summary>
|
||||
/// Executes the migration.
|
||||
/// </summary>
|
||||
public abstract void Migrate();
|
||||
protected abstract void Migrate();
|
||||
|
||||
/// <inheritdoc />
|
||||
void IMigration.Migrate()
|
||||
/// <summary>
|
||||
/// Runs the migration.
|
||||
/// </summary>
|
||||
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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
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
|
||||
@@ -46,7 +45,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations
|
||||
|
||||
/// <inheritdoc />
|
||||
public void AddPostMigration<TMigration>()
|
||||
where TMigration : IMigration
|
||||
where TMigration : MigrationBase
|
||||
{
|
||||
// just adding - will be de-duplicated when executing
|
||||
_postMigrations.Add(typeof(TMigration));
|
||||
|
||||
14
src/Umbraco.Infrastructure/Migrations/NoopMigration.cs
Normal file
14
src/Umbraco.Infrastructure/Migrations/NoopMigration.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Umbraco.Cms.Infrastructure.Migrations
|
||||
{
|
||||
public class NoopMigration : MigrationBase
|
||||
{
|
||||
public NoopMigration(IMigrationContext context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Migrate()
|
||||
{
|
||||
// nop
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
/// <summary>
|
||||
/// Clears Csrf tokens.
|
||||
/// </summary>
|
||||
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);
|
||||
|
||||
@@ -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
|
||||
/// <summary>
|
||||
/// Deletes the old file that saved log queries
|
||||
/// </summary>
|
||||
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 <see cref="DeleteLogViewerQueryFile"/> class.
|
||||
/// </summary>
|
||||
public DeleteLogViewerQueryFile(IMigrationContext context, IHostingEnvironment hostingEnvironment)
|
||||
: base(context)
|
||||
{
|
||||
_hostingEnvironment = hostingEnvironment;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Migrate()
|
||||
protected override void Migrate()
|
||||
{
|
||||
var logViewerQueryFile = MigrateLogViewerQueriesFromFileToDb.GetLogViewerQueryFile(_hostingEnvironment);
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
using Umbraco.Cms.Core.Migrations;
|
||||
|
||||
namespace Umbraco.Cms.Infrastructure.Migrations.PostMigrations
|
||||
{
|
||||
/// <summary>
|
||||
/// Rebuilds the published snapshot.
|
||||
/// </summary>
|
||||
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 <see cref="RebuildPublishedSnapshot"/> class.
|
||||
/// </summary>
|
||||
public RebuildPublishedSnapshot(IMigrationContext context, IPublishedSnapshotRebuilder rebuilder)
|
||||
{
|
||||
_rebuilder = rebuilder;
|
||||
}
|
||||
: base(context)
|
||||
=> _rebuilder = rebuilder;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Migrate()
|
||||
{
|
||||
_rebuilder.Rebuild();
|
||||
}
|
||||
protected override void Migrate() => _rebuilder.Rebuild();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
: base(context)
|
||||
{ }
|
||||
|
||||
public override void Migrate()
|
||||
protected override void Migrate()
|
||||
{
|
||||
// all v7.14 tables
|
||||
var tables = new[]
|
||||
|
||||
@@ -10,6 +10,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;
|
||||
|
||||
@@ -201,14 +202,26 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade
|
||||
// to 8.10.0
|
||||
To<AddPropertyTypeLabelOnTopColumn>("{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<AddCmsContentNuByteColumn>("{8DDDCD0B-D7D5-4C97-BD6A-6B38CA65752F}")
|
||||
.To<UpgradedIncludeIndexes>("{4695D0C9-0729-4976-985B-048D503665D8}")
|
||||
|
||||
// to 9.0.0
|
||||
To<MigrateLogViewerQueriesFromFileToDb>("{22D801BA-A1FF-4539-BFCC-2139B55594F8}");
|
||||
To<ExternalLoginTableIndexes>("{50A43237-A6F4-49E2-A7A6-5DAD65C84669}");
|
||||
To<ExternalLoginTokenTable>("{3D8DADEF-0FDA-4377-A5F0-B52C2110E8F2}");
|
||||
To<MemberTableColumns>("{1303BDCF-2295-4645-9526-2F32E8B35ABD}");
|
||||
To<AddPasswordConfigToMemberTable>("{86AC839A-0D08-4D09-B7B5-027445E255A1}");
|
||||
.With()
|
||||
.To<MigrateLogViewerQueriesFromFileToDb>("{22D801BA-A1FF-4539-BFCC-2139B55594F8}")
|
||||
.To<ExternalLoginTableIndexes>("{50A43237-A6F4-49E2-A7A6-5DAD65C84669}")
|
||||
.To<ExternalLoginTokenTable>("{3D8DADEF-0FDA-4377-A5F0-B52C2110E8F2}")
|
||||
.To<MemberTableColumns>("{1303BDCF-2295-4645-9526-2F32E8B35ABD}")
|
||||
.To<AddPasswordConfigToMemberTable>("{86AC839A-0D08-4D09-B7B5-027445E255A1}")
|
||||
|
||||
//FINAL
|
||||
.As("{5060F3D2-88BE-4D30-8755-CF51F28EAD12}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<ContentTypeDto>("isElement");
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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($@"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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<ContentVersionCultureVariationDto>().Do();
|
||||
|
||||
@@ -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<ContentVersionCultureVariationDto>(true).Do();
|
||||
Create.Table<DocumentCultureVariationDto>(true).Do();
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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<DataTypeDto>()
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
: base(context)
|
||||
{ }
|
||||
|
||||
public override void Migrate()
|
||||
protected override void Migrate()
|
||||
{
|
||||
if (TableExists("umbracoMigration"))
|
||||
Delete.Table("umbracoMigration").Do();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
public DropPreValueTable(IMigrationContext context) : base(context)
|
||||
{ }
|
||||
|
||||
public override void Migrate()
|
||||
protected override void Migrate()
|
||||
{
|
||||
// drop preValues table
|
||||
if (TableExists("cmsDataTypePreValues"))
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
: base(context)
|
||||
{ }
|
||||
|
||||
public override void Migrate()
|
||||
protected override void Migrate()
|
||||
{
|
||||
if (TableExists("cmsTask"))
|
||||
Delete.Table("cmsTask").Do();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
: base(context)
|
||||
{ }
|
||||
|
||||
public override void Migrate()
|
||||
protected override void Migrate()
|
||||
{
|
||||
if(ColumnExists("cmsTemplate", "design"))
|
||||
Delete.Column("design").FromTable("cmsTemplate").Do();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
: base(context)
|
||||
{ }
|
||||
|
||||
public override void Migrate()
|
||||
protected override void Migrate()
|
||||
{
|
||||
if (TableExists("cmsContentXml"))
|
||||
Delete.Table("cmsContentXml").Do();
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<LanguageDto>(Cms.Core.Constants.DatabaseSchema.Tables.Language, "isDefaultVariantLang");
|
||||
AddColumn<LanguageDto>(Cms.Core.Constants.DatabaseSchema.Tables.Language, "mandatory");
|
||||
|
||||
@@ -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<RedirectUrlDto>("culture");
|
||||
}
|
||||
|
||||
@@ -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<TagDto>("languageId");
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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"))
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
: base(context)
|
||||
{ }
|
||||
|
||||
public override void Migrate()
|
||||
protected override void Migrate()
|
||||
{
|
||||
var exists = Database.Fetch<int>("select id from umbracoUser where id=-1;").Count > 0;
|
||||
if (exists) return;
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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<TagDto>(Cms.Core.Constants.DatabaseSchema.Tables.Tag, "group");
|
||||
|
||||
@@ -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"))
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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<DataTypeDto>()
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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<RebuildPublishedSnapshot>();
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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<ContentNuDto>(columns, "dataRaw");
|
||||
|
||||
// allow null
|
||||
AlterColumn<ContentNuDto>(Constants.DatabaseSchema.Tables.NodeData, "data");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<NodeDto>(nodeDtoIndexes); // delete existing ones
|
||||
CreateIndexes<NodeDto>(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<ContentVersionDto>(contentVersionIndexes); // delete existing ones
|
||||
CreateIndexes<ContentVersionDto>(contentVersionIndexes); // update/add
|
||||
}
|
||||
|
||||
private void DeleteIndexes<T>(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<T>(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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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(
|
||||
@"(<a[^>]*href="")(\/ media[^""\?]*)([^>]*>)",
|
||||
|
||||
@@ -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<ContentNuDto>().Do();
|
||||
Create.KeysAndIndexes<ContentNuDto>().Do();
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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" });
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user