Added the ability to automate any c# scripts for an upgrade process. I realize this is superceded already in 6.0
but we need a way to do this in 4.x too especially for this release since we need to run a script to fix some db issues. I've added a framework using an UpgradeScriptManager and another install step + unit tests for some of the UpgradeScriptManager methods.
This commit is contained in:
28
src/Umbraco.Web.UI/install/steps/UpgradeScripts.ascx.cs
Normal file
28
src/Umbraco.Web.UI/install/steps/UpgradeScripts.ascx.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Umbraco.Core.Configuration;
|
||||
using umbraco.presentation.install;
|
||||
using Umbraco.Web.Install.UpgradeScripts;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps
|
||||
{
|
||||
public partial class UpgradeScripts : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void RunScripts(object sender, EventArgs e)
|
||||
{
|
||||
//run the scripts and then go to the next step
|
||||
UpgradeScriptManager.ExecuteScriptsForVersion(GlobalSettings.GetConfigurationVersion());
|
||||
|
||||
Helper.RedirectToNextStep(Page);
|
||||
}
|
||||
}
|
||||
}
|
||||
24
src/Umbraco.Web.UI/install/steps/UpgradeScripts.ascx.designer.cs
generated
Normal file
24
src/Umbraco.Web.UI/install/steps/UpgradeScripts.ascx.designer.cs
generated
Normal file
@@ -0,0 +1,24 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps {
|
||||
|
||||
|
||||
public partial class UpgradeScripts {
|
||||
|
||||
/// <summary>
|
||||
/// btnNext control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnNext;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user