Merge remote-tracking branch 'origin/v13/dev' into v14/dev

This commit is contained in:
Bjarke Berg
2023-08-08 12:10:18 +02:00
62 changed files with 1167 additions and 1189 deletions

View File

@@ -2,5 +2,6 @@ namespace Umbraco.Cms.Persistence.EFCore.Migrations;
public enum EFCoreMigration
{
InitialCreate = 0
InitialCreate = 0,
AddOpenIddict = 1
}

View File

@@ -291,7 +291,10 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install
using (var scope = _scopeProvider.CreateCoreScope())
{
var result = CreateSchemaAndData(scope);
scope.Notifications.Publish(new DatabaseSchemaAndDataCreatedNotification());
if (result?.Success is true)
{
scope.Notifications.Publish(new DatabaseSchemaAndDataCreatedNotification(result!.RequiresUpgrade));
}
scope.Complete();
return result;
}

View File

@@ -4,5 +4,8 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Notifications;
public class DatabaseSchemaAndDataCreatedNotification : INotification
{
public bool RequiresUpgrade { get; }
public DatabaseSchemaAndDataCreatedNotification(bool requiresUpgrade)
=> RequiresUpgrade = requiresUpgrade;
}

View File

@@ -15,6 +15,7 @@ public class AddOpenIddict : UnscopedMigrationBase
protected override void Migrate()
{
_iefCoreMigrationExecutor.ExecuteSingleMigrationAsync(EFCoreMigration.InitialCreate).GetAwaiter().GetResult();
_iefCoreMigrationExecutor.ExecuteSingleMigrationAsync(EFCoreMigration.AddOpenIddict).GetAwaiter().GetResult();
}
}