public override Task <InstallSetupResult> ExecuteAsync(object model)
        {
            var installSteps = InstallStatusTracker.GetStatus().ToArray();
            var previousStep = installSteps.Single(x => x.Name == "DatabaseInstall");
            var upgrade      = previousStep.AdditionalData.ContainsKey("upgrade");

            if (upgrade)
            {
                _logger.Info <DatabaseUpgradeStep>("Running 'Upgrade' service");

                var plan = new UmbracoPlan();
                plan.AddPostMigration <ClearCsrfCookies>(); // needed when running installer (back-office)

                var result = _databaseBuilder.UpgradeSchemaAndData(plan);

                if (result.Success == false)
                {
                    throw new InstallException("The database failed to upgrade. ERROR: " + result.Message);
                }

                DatabaseInstallStep.HandleConnectionStrings(_logger);
            }

            return(Task.FromResult <InstallSetupResult>(null));
        }
        public override Task <InstallSetupResult?> ExecuteAsync(object model)
        {
            InstallTrackingItem[] installSteps = InstallStatusTracker.GetStatus().ToArray();
            InstallTrackingItem   previousStep = installSteps.Single(x => x.Name == "DatabaseInstall");
            var upgrade = previousStep.AdditionalData.ContainsKey("upgrade");

            if (upgrade)
            {
                _logger.LogInformation("Running 'Upgrade' service");

                var plan = new UmbracoPlan(_umbracoVersion);
                plan.AddPostMigration <ClearCsrfCookies>(); // needed when running installer (back-office)

                DatabaseBuilder.Result?result = _databaseBuilder.UpgradeSchemaAndData(plan);

                if (result?.Success == false)
                {
                    throw new InstallException("The database failed to upgrade. ERROR: " + result.Message);
                }
            }

            return(Task.FromResult((InstallSetupResult?)null));
        }