Fix document URL migration (split it in two)
This commit is contained in:
@@ -170,7 +170,7 @@ public class DocumentUrlService : IDocumentUrlService
|
||||
using ICoreScope scope = _coreScopeProvider.CreateCoreScope();
|
||||
scope.ReadLock(Constants.Locks.ContentTree);
|
||||
|
||||
IEnumerable<IContent> documents = _documentRepository.GetMany(Array.Empty<Guid>());
|
||||
IEnumerable<IContent> documents = _documentRepository.GetMany(Array.Empty<int>());
|
||||
|
||||
await CreateOrUpdateUrlSegmentsAsync(documents);
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ public class UmbracoPlan : MigrationPlan
|
||||
// To 15.0.0
|
||||
To<V_15_0_0.AddUserClientId>("{7F4F31D8-DD71-4F0D-93FC-2690A924D84B}");
|
||||
To<NoopMigration>("{1A8835EF-F8AB-4472-B4D8-D75B7C164022}");
|
||||
To<V_15_0_0.RebuildDocumentUrls>("{3FE0FA2D-CF4F-4892-BA8D-E97D06E028DC}");
|
||||
To<V_15_0_0.ConvertBlockListEditorProperties>("{6C04B137-0097-4938-8C6A-276DF1A0ECA8}");
|
||||
To<V_15_0_0.ConvertBlockGridEditorProperties>("{9D3CE7D4-4884-41D4-98E8-302EB6CB0CF6}");
|
||||
To<V_15_0_0.ConvertRichTextEditorProperties>("{37875E80-5CDD-42FF-A21A-7D4E3E23E0ED}");
|
||||
|
||||
@@ -1,22 +1,15 @@
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Infrastructure.Persistence.Dtos;
|
||||
using Umbraco.Cms.Infrastructure.Persistence.Dtos;
|
||||
|
||||
namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_15_0_0;
|
||||
|
||||
[Obsolete("Remove in Umbraco 18.")]
|
||||
public class AddDocumentUrl : MigrationBase
|
||||
{
|
||||
private readonly IDocumentUrlService _documentUrlService;
|
||||
|
||||
public AddDocumentUrl(IMigrationContext context, IDocumentUrlService documentUrlService)
|
||||
public AddDocumentUrl(IMigrationContext context)
|
||||
: base(context)
|
||||
{
|
||||
_documentUrlService = documentUrlService;
|
||||
}
|
||||
|
||||
protected override void Migrate()
|
||||
{
|
||||
Create.Table<DocumentUrlDto>().Do();
|
||||
_documentUrlService.InitAsync(false, CancellationToken.None);
|
||||
}
|
||||
=> Create.Table<DocumentUrlDto>().Do();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using Umbraco.Cms.Core.Services;
|
||||
|
||||
namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_15_0_0;
|
||||
|
||||
[Obsolete("Remove in Umbraco 18.")]
|
||||
public class RebuildDocumentUrls : MigrationBase
|
||||
{
|
||||
private readonly IDocumentUrlService _documentUrlService;
|
||||
|
||||
public RebuildDocumentUrls(IMigrationContext context, IDocumentUrlService documentUrlService)
|
||||
: base(context) =>
|
||||
_documentUrlService = documentUrlService;
|
||||
|
||||
protected override void Migrate()
|
||||
=> _documentUrlService.InitAsync(false, CancellationToken.None).GetAwaiter().GetResult();
|
||||
}
|
||||
Reference in New Issue
Block a user