Updates some tests and fixes a couple things
This commit is contained in:
@@ -40,10 +40,15 @@ namespace SqlCE4Umbraco
|
||||
var localConnection = new SqlCeConnection(ConnectionString);
|
||||
if (!System.IO.File.Exists(ReplaceDataDirectory(localConnection.Database)))
|
||||
{
|
||||
using (var sqlCeEngine = new SqlCeEngine(ConnectionString))
|
||||
{
|
||||
sqlCeEngine.CreateDatabase();
|
||||
}
|
||||
var sqlCeEngine = new SqlCeEngine(ConnectionString);
|
||||
sqlCeEngine.CreateDatabase();
|
||||
|
||||
// SD: Pretty sure this should be in a using clause but i don't want to cause unknown side-effects here
|
||||
// since it's been like this for quite some time
|
||||
//using (var sqlCeEngine = new SqlCeEngine(ConnectionString))
|
||||
//{
|
||||
// sqlCeEngine.CreateDatabase();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -120,10 +120,15 @@ namespace Umbraco.Core
|
||||
var path = Path.Combine(GlobalSettings.FullpathToRoot, "App_Data", "Umbraco.sdf");
|
||||
if (File.Exists(path) == false)
|
||||
{
|
||||
using (var engine = new SqlCeEngine(connectionString))
|
||||
{
|
||||
engine.CreateDatabase();
|
||||
}
|
||||
var engine = new SqlCeEngine(connectionString);
|
||||
engine.CreateDatabase();
|
||||
|
||||
// SD: Pretty sure this should be in a using clause but i don't want to cause unknown side-effects here
|
||||
// since it's been like this for quite some time
|
||||
//using (var engine = new SqlCeEngine(connectionString))
|
||||
//{
|
||||
// engine.CreateDatabase();
|
||||
//}
|
||||
}
|
||||
|
||||
Initialize(providerName);
|
||||
|
||||
@@ -88,8 +88,8 @@ namespace Umbraco.Tests.Install
|
||||
|
||||
var steps = helper.GetSteps().ToArray();
|
||||
|
||||
//for new installs 4, don't require execution
|
||||
Assert.AreEqual(4, steps.Count(x => x.RequiresExecution() == false));
|
||||
//for upgrades 5, don't require execution (the db context is not configured so the upgrade report will not execute either)
|
||||
Assert.AreEqual(5, steps.Count(x => x.RequiresExecution() == false));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace Umbraco.Web.Install
|
||||
{
|
||||
new FilePermissionsStep(),
|
||||
new UserStep(_umbContext.Application, _status),
|
||||
new MajorVersion7UpgradeReport(_umbContext.Application, _status),
|
||||
new DatabaseConfigureStep(_umbContext.Application),
|
||||
new DatabaseInstallStep(_umbContext.Application),
|
||||
new DatabaseUpgradeStep(_umbContext.Application, _status),
|
||||
|
||||
@@ -43,9 +43,17 @@ namespace Umbraco.Web.Install.InstallSteps
|
||||
return false;
|
||||
}
|
||||
|
||||
//we cannot run this step if the db is not configured.
|
||||
if (_applicationContext.DatabaseContext.IsDatabaseConfigured == false)
|
||||
try
|
||||
{
|
||||
//we cannot run this step if the db is not configured.
|
||||
if (_applicationContext.DatabaseContext.IsDatabaseConfigured == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
//if there is no db context
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user