Merge remote-tracking branch 'origin/v13/dev' into v14/dev
This commit is contained in:
@@ -2,5 +2,6 @@ namespace Umbraco.Cms.Persistence.EFCore.Migrations;
|
||||
|
||||
public enum EFCoreMigration
|
||||
{
|
||||
InitialCreate = 0
|
||||
InitialCreate = 0,
|
||||
AddOpenIddict = 1
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -4,5 +4,8 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Notifications;
|
||||
|
||||
public class DatabaseSchemaAndDataCreatedNotification : INotification
|
||||
{
|
||||
public bool RequiresUpgrade { get; }
|
||||
|
||||
public DatabaseSchemaAndDataCreatedNotification(bool requiresUpgrade)
|
||||
=> RequiresUpgrade = requiresUpgrade;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ public class AddOpenIddict : UnscopedMigrationBase
|
||||
protected override void Migrate()
|
||||
{
|
||||
_iefCoreMigrationExecutor.ExecuteSingleMigrationAsync(EFCoreMigration.InitialCreate).GetAwaiter().GetResult();
|
||||
_iefCoreMigrationExecutor.ExecuteSingleMigrationAsync(EFCoreMigration.AddOpenIddict).GetAwaiter().GetResult();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user