Ensure that SqlCeSupport is still enabled after changing the namespace
This commit is contained in:
@@ -98,7 +98,7 @@ namespace Umbraco.Web.Install.InstallSteps
|
||||
// NOTE: Type.GetType will only return types that are currently loaded into the appdomain. In this case
|
||||
// that is ok because we know if this is availalbe we will have manually loaded it into the appdomain.
|
||||
// Else we'd have to use Assembly.LoadFrom and need to know the DLL location here which we don't need to do.
|
||||
return !(Type.GetType("Umbraco.Persistence.SqlCe.SqlCeSyntaxProvider, Umbraco.Persistence.SqlCe") is null);
|
||||
return !(Type.GetType("Umbraco.Cms.Persistence.SqlCe.SqlCeSyntaxProvider, Umbraco.Persistence.SqlCe") is null);
|
||||
}
|
||||
|
||||
public override string View => ShouldDisplayView() ? base.View : "";
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Umbraco.Core.Migrations.Install
|
||||
else if (integratedAuth)
|
||||
{
|
||||
// has to be Sql Server
|
||||
providerName = Cms.Core.Constants.DbProviderNames.SqlServer;
|
||||
providerName = Constants.DbProviderNames.SqlServer;
|
||||
connectionString = GetIntegratedSecurityDatabaseConnectionString(server, database);
|
||||
}
|
||||
else
|
||||
@@ -115,7 +115,7 @@ namespace Umbraco.Core.Migrations.Install
|
||||
var sql = scope.Database.SqlContext.Sql()
|
||||
.SelectCount()
|
||||
.From<UserDto>()
|
||||
.Where<UserDto>(x => x.Id == Cms.Core.Constants.Security.SuperUserId && x.Password == "default");
|
||||
.Where<UserDto>(x => x.Id == Constants.Security.SuperUserId && x.Password == "default");
|
||||
var result = scope.Database.ExecuteScalar<int>(sql);
|
||||
var has = result != 1;
|
||||
if (has == false)
|
||||
@@ -154,7 +154,7 @@ namespace Umbraco.Core.Migrations.Install
|
||||
|
||||
private void ConfigureEmbeddedDatabaseConnection(IUmbracoDatabaseFactory factory)
|
||||
{
|
||||
_configManipulator.SaveConnectionString(EmbeddedDatabaseConnectionString, Cms.Core.Constants.DbProviderNames.SqlCe);
|
||||
_configManipulator.SaveConnectionString(EmbeddedDatabaseConnectionString, Constants.DbProviderNames.SqlCe);
|
||||
|
||||
var path = _hostingEnvironment.MapPathContentRoot(Path.Combine("App_Data", "Umbraco.sdf"));
|
||||
if (File.Exists(path) == false)
|
||||
@@ -162,10 +162,10 @@ namespace Umbraco.Core.Migrations.Install
|
||||
// this should probably be in a "using (new SqlCeEngine)" clause but not sure
|
||||
// of the side effects and it's been like this for quite some time now
|
||||
|
||||
_dbProviderFactoryCreator.CreateDatabase(Cms.Core.Constants.DbProviderNames.SqlCe);
|
||||
_dbProviderFactoryCreator.CreateDatabase(Constants.DbProviderNames.SqlCe);
|
||||
}
|
||||
|
||||
factory.Configure(EmbeddedDatabaseConnectionString, Cms.Core.Constants.DbProviderNames.SqlCe);
|
||||
factory.Configure(EmbeddedDatabaseConnectionString, Constants.DbProviderNames.SqlCe);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -175,7 +175,7 @@ namespace Umbraco.Core.Migrations.Install
|
||||
/// <remarks>Has to be SQL Server</remarks>
|
||||
public void ConfigureDatabaseConnection(string connectionString)
|
||||
{
|
||||
const string providerName = Cms.Core.Constants.DbProviderNames.SqlServer;
|
||||
const string providerName = Constants.DbProviderNames.SqlServer;
|
||||
|
||||
_configManipulator.SaveConnectionString(connectionString, providerName);
|
||||
_databaseFactory.Configure(connectionString, providerName);
|
||||
@@ -209,7 +209,7 @@ namespace Umbraco.Core.Migrations.Install
|
||||
/// <returns>A connection string.</returns>
|
||||
public static string GetDatabaseConnectionString(string server, string databaseName, string user, string password, string databaseProvider, out string providerName)
|
||||
{
|
||||
providerName = Cms.Core.Constants.DbProviderNames.SqlServer;
|
||||
providerName = Constants.DbProviderNames.SqlServer;
|
||||
var provider = databaseProvider.ToLower();
|
||||
if (provider.InvariantContains("azure"))
|
||||
return GetAzureConnectionString(server, databaseName, user, password);
|
||||
@@ -224,8 +224,8 @@ namespace Umbraco.Core.Migrations.Install
|
||||
public void ConfigureIntegratedSecurityDatabaseConnection(string server, string databaseName)
|
||||
{
|
||||
var connectionString = GetIntegratedSecurityDatabaseConnectionString(server, databaseName);
|
||||
_configManipulator.SaveConnectionString(connectionString, Cms.Core.Constants.DbProviderNames.SqlServer);
|
||||
_databaseFactory.Configure(connectionString, Cms.Core.Constants.DbProviderNames.SqlServer);
|
||||
_configManipulator.SaveConnectionString(connectionString, Constants.DbProviderNames.SqlServer);
|
||||
_databaseFactory.Configure(connectionString, Constants.DbProviderNames.SqlServer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -467,7 +467,7 @@ namespace Umbraco.Core.Migrations.Install
|
||||
{
|
||||
Message =
|
||||
"The database configuration failed with the following message: " + ex.Message +
|
||||
$"\n Please check log file for additional information (can be found in '{Cms.Core.Constants.SystemDirectories.LogFiles}')",
|
||||
$"\n Please check log file for additional information (can be found in '{Constants.SystemDirectories.LogFiles}')",
|
||||
Success = false,
|
||||
Percentage = "90"
|
||||
};
|
||||
|
||||
@@ -5,19 +5,18 @@ using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Moq;
|
||||
using NPoco;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Cms.Core;
|
||||
using Umbraco.Cms.Core.Configuration;
|
||||
using Umbraco.Core.Migrations.Install;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Tests.Common.TestHelpers;
|
||||
using Umbraco.Tests.Integration.Testing;
|
||||
using Umbraco.Tests.Testing;
|
||||
using Constants = Umbraco.Cms.Core.Constants;
|
||||
|
||||
namespace Umbraco.Tests.UnitTests.Umbraco.Infrastructure.Persistence
|
||||
{
|
||||
[TestFixture]
|
||||
[UmbracoTest]
|
||||
|
||||
public class DatabaseBuilderTests : UmbracoIntegrationTest
|
||||
{
|
||||
private IDbProviderFactoryCreator DbProviderFactoryCreator => GetRequiredService<IDbProviderFactoryCreator>();
|
||||
|
||||
@@ -315,9 +315,9 @@ namespace Umbraco.Extensions
|
||||
var dllPath = Path.Combine(binFolder, "Umbraco.Persistence.SqlCe.dll");
|
||||
var umbSqlCeAssembly = Assembly.LoadFrom(dllPath);
|
||||
|
||||
var sqlCeSyntaxProviderType = umbSqlCeAssembly.GetType("Umbraco.Persistence.SqlCe.SqlCeSyntaxProvider");
|
||||
var sqlCeBulkSqlInsertProviderType = umbSqlCeAssembly.GetType("Umbraco.Persistence.SqlCe.SqlCeBulkSqlInsertProvider");
|
||||
var sqlCeEmbeddedDatabaseCreatorType = umbSqlCeAssembly.GetType("Umbraco.Persistence.SqlCe.SqlCeEmbeddedDatabaseCreator");
|
||||
var sqlCeSyntaxProviderType = umbSqlCeAssembly.GetType("Umbraco.Cms.Persistence.SqlCe.SqlCeSyntaxProvider");
|
||||
var sqlCeBulkSqlInsertProviderType = umbSqlCeAssembly.GetType("Umbraco.Cms.Persistence.SqlCe.SqlCeBulkSqlInsertProvider");
|
||||
var sqlCeEmbeddedDatabaseCreatorType = umbSqlCeAssembly.GetType("Umbraco.Cms.Persistence.SqlCe.SqlCeEmbeddedDatabaseCreator");
|
||||
|
||||
if (!(sqlCeSyntaxProviderType is null || sqlCeBulkSqlInsertProviderType is null || sqlCeEmbeddedDatabaseCreatorType is null))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user