Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

38 lines
1.2 KiB

// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschränkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Squidex.Infrastructure.Migrations;
namespace Migrate_01
{
public sealed class Migration05_RebuildForNewCommands : IMigration
{
private readonly Rebuilder rebuilder;
public int FromVersion { get; } = 4;
public int ToVersion { get; } = 5;
public Migration05_RebuildForNewCommands(Rebuilder rebuilder)
{
this.rebuilder = rebuilder;
}
public async Task UpdateAsync(IEnumerable<IMigration> previousMigrations)
{
if (!previousMigrations.Any(x => x is Migration01_FromCqrs))
{
await rebuilder.RebuildConfigAsync();
await rebuilder.RebuildContentAsync();
await rebuilder.RebuildAssetsAsync();
}
}
}
}