Fix upgrading

This commit is contained in:
Stephan
2018-03-30 10:16:21 +02:00
parent 826102ea4d
commit 62b6efc4da
20 changed files with 177 additions and 193 deletions

View File

@@ -30,7 +30,7 @@
@{ Continue = $continue })
if ($ubuild.OnError()) { return }
Write-Host "Zbu.ModelsBuilder Build"
Write-Host "Umbraco Cms Build"
Write-Host "Umbraco.Build v$($ubuild.BuildVersion)"
# ################################################################

View File

@@ -107,7 +107,7 @@ namespace Umbraco.Core.Persistence.Dtos
/// <summary>
/// A Json blob stored for recording tour data for a user
/// </summary>
[Column("tourData")] // FIXME CANNOT UPGRADE???
[Column("tourData")]
[NullSetting(NullSetting = NullSettings.Null)]
[SpecialDbType(SpecialDbTypes.NTEXT)]
public string TourData { get; set; }

View File

@@ -32,5 +32,10 @@ namespace Umbraco.Core.Persistence
/// Gets the Sql context.
/// </summary>
ISqlContext SqlContext { get; }
/// <summary>
/// Configures the database factory for upgrades.
/// </summary>
void ConfigureForUpgrade();
}
}

View File

@@ -888,7 +888,7 @@ namespace Umbraco.Core.Persistence
#region Utilities
private static object[] GetColumns<TDto>(this Sql<ISqlContext> sql, string tableAlias = null, string referenceName = null, Expression<Func<TDto, object>>[] columnExpressions = null, bool withAlias = true)
private static string[] GetColumns<TDto>(this Sql<ISqlContext> sql, string tableAlias = null, string referenceName = null, Expression<Func<TDto, object>>[] columnExpressions = null, bool withAlias = true)
{
var pd = sql.SqlContext.PocoDataFactory.ForType(typeof (TDto));
var tableName = tableAlias ?? pd.TableInfo.TableName;
@@ -923,10 +923,9 @@ namespace Umbraco.Core.Persistence
return withAlias ? (string.IsNullOrEmpty(column.ColumnAlias) ? column.MemberInfoKey : column.ColumnAlias) : null;
}
return queryColumns.Select(x => (object) GetColumn(sql.SqlContext.DatabaseType,
tableName, x.Value.ColumnName,
GetAlias(x.Value),
referenceName)).ToArray();
return queryColumns
.Select(x => GetColumn(sql.SqlContext.DatabaseType, tableName, x.Value.ColumnName, GetAlias(x.Value), referenceName))
.ToArray();
}
private static string GetColumn(DatabaseType dbType, string tableName, string columnName, string columnAlias, string referenceName = null)

View File

@@ -42,8 +42,10 @@ namespace Umbraco.Core.Persistence
private ISqlSyntaxProvider _sqlSyntax;
private RetryPolicy _connectionRetryPolicy;
private RetryPolicy _commandRetryPolicy;
private NPoco.MapperCollection _pocoMappers;
private bool _upgrading;
#region Ctor
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoDatabaseFactory"/>.
@@ -112,12 +114,14 @@ namespace Umbraco.Core.Persistence
/// <inheritdoc />
public bool CanConnect => Configured && DbConnectionExtensions.IsConnectionAvailable(_connectionString, _providerName);
#region IDatabaseContext
/// <inheritdoc />
public ISqlContext SqlContext => _sqlContext;
#endregion
/// <inheritdoc />
public void ConfigureForUpgrade()
{
_upgrading = true;
}
/// <inheritdoc />
public void Configure(string connectionString, string providerName)
@@ -150,13 +154,13 @@ namespace Umbraco.Core.Persistence
// ensure we have only 1 set of mappers, and 1 PocoDataFactory, for all database
// so that everything NPoco is properly cached for the lifetime of the application
var mappers = new NPoco.MapperCollection { new PocoMapper() };
var factory = new FluentPocoDataFactory((type, iPocoDataFactory) => new PocoDataBuilder(type, mappers).Init());
_pocoMappers = new NPoco.MapperCollection { new PocoMapper() };
var factory = new FluentPocoDataFactory(GetPocoDataFactoryResolver);
_pocoDataFactory = factory;
var config = new FluentConfig(xmappers => factory);
// create the database factory
_npocoDatabaseFactory = NPoco.DatabaseFactory.Config(x => x
_npocoDatabaseFactory = DatabaseFactory.Config(x => x
.UsingDatabase(CreateDatabaseInstance) // creating UmbracoDatabase instances
.WithFluentConfig(config)); // with proper configuration
@@ -177,6 +181,10 @@ namespace Umbraco.Core.Persistence
return (IUmbracoDatabase) _npocoDatabaseFactory.GetDatabase();
}
// gets initialized poco data builders
private InitializedPocoDataBuilder GetPocoDataFactoryResolver(Type type, IPocoDataFactory factory)
=> new UmbracoPocoDataBuilder(type, _pocoMappers, _upgrading).Init();
// gets the sql syntax provider that corresponds, from attribute
private ISqlSyntaxProvider GetSqlSyntaxProvider(string providerName)
{

View File

@@ -0,0 +1,44 @@
using System;
using System.Reflection;
using NPoco;
using Umbraco.Core.Persistence.Dtos;
namespace Umbraco.Core.Persistence
{
/// <summary>
/// Umbraco's implementation of NPoco <see cref="PocoDataBuilder"/>.
/// </summary>
/// <remarks>
/// <para>NPoco PocoDataBuilder analyzes DTO classes and returns infos about the tables and
/// their columns.</para>
/// <para>In some very special occasions, a class may expose a column that we do not want to
/// use. This is essentially when adding a column to the User table: if the code wants the
/// column to exist, and it does not exist yet in the database, because a given migration has
/// not run, then the user cannot log into the site, and cannot upgrade = catch 22.</para>
/// <para>So far, this is very manual. We don't try to be clever and figure out whether the
/// columns exist already. We just ignore it.</para>
/// <para>Beware, the application MUST restart when this class behavior changes.</para>
/// </remarks>
internal class UmbracoPocoDataBuilder : PocoDataBuilder
{
private readonly bool _upgrading;
public UmbracoPocoDataBuilder(Type type, MapperCollection mapper, bool upgrading)
: base(type, mapper)
{
_upgrading = upgrading;
}
protected override ColumnInfo GetColumnInfo(MemberInfo mi, Type type)
{
var columnInfo = base.GetColumnInfo(mi, type);
if (_upgrading)
{
if (type == typeof(UserDto) && mi.Name == "TourData") columnInfo.IgnoreColumn = true;
}
return columnInfo;
}
}
}

View File

@@ -139,7 +139,14 @@ namespace Umbraco.Core.Runtime
{
var dbfactory = container.GetInstance<IUmbracoDatabaseFactory>();
SetRuntimeStateLevel(dbfactory, Logger);
Logger.Debug<CoreRuntime>($"Runtime level: {_state.Level}");
if (_state.Level == RuntimeLevel.Upgrade)
{
Logger.Debug<CoreRuntime>($"Configure database factory for upgrades.");
dbfactory.ConfigureForUpgrade();
}
}
catch
{

View File

@@ -80,7 +80,7 @@
<PackageReference Include="MiniProfiler" Version="3.2.0.157" />
<PackageReference Include="MySql.Data" Version="6.9.9" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="NPoco" Version="3.6.1" />
<PackageReference Include="NPoco" Version="3.9.3" />
<PackageReference Include="NuGet.Core" Version="2.14.0" />
<PackageReference Include="Semver" Version="2.0.4" />
<PackageReference Include="SqlServerCE" Version="4.0.0.1" />
@@ -381,6 +381,7 @@
<Compile Include="Persistence\Repositories\IConsentRepository.cs" />
<Compile Include="Persistence\Repositories\Implement\AuditEntryRepository.cs" />
<Compile Include="Persistence\Repositories\Implement\ConsentRepository.cs" />
<Compile Include="Persistence\UmbracoPocoDataBuilder.cs" />
<Compile Include="PropertyEditors\ColorPickerConfiguration.cs" />
<Compile Include="PropertyEditors\ConfigurationEditorOfTConfiguration.cs" />
<Compile Include="PropertyEditors\DataEditorAttribute.cs" />

View File

@@ -50,7 +50,7 @@
<Version>1.0.0-beta024</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="NPoco" Version="3.6.1" />
<PackageReference Include="NPoco" Version="3.9.3" />
</ItemGroup>
<ItemGroup>
<Compile Include="Config\ConfigIndexCriteria.cs" />

View File

@@ -1,130 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.1.0" newVersion="1.5.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" />
</dependentAssembly>
<!--
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.4.1.0" newVersion="1.4.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Extensions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
-->
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.8.0" newVersion="2.0.8.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.FileVersionInfo" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.DotNet.PlatformAbstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.1.2.0" newVersion="1.1.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.3.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -56,15 +56,15 @@
<Reference Include="Castle.Core, Version=4.1.1.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.4.1.1\lib\net45\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeAnalysis, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.Common.2.7.0\lib\netstandard1.3\Microsoft.CodeAnalysis.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeAnalysis.CSharp, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.2.7.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Diagnostics.Tracing.TraceEvent, Version=1.0.41.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.41\lib\net40\Microsoft.Diagnostics.Tracing.TraceEvent.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeAnalysis, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.Common.2.4.0\lib\netstandard1.3\Microsoft.CodeAnalysis.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeAnalysis.CSharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.2.4.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
</Reference>
<Reference Include="Microsoft.DotNet.InternalAbstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.DotNet.InternalAbstractions.1.0.0\lib\net451\Microsoft.DotNet.InternalAbstractions.dll</HintPath>
</Reference>
@@ -77,8 +77,8 @@
<Reference Include="Moq, Version=4.7.99.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.7.99\lib\net45\Moq.dll</HintPath>
</Reference>
<Reference Include="NPoco, Version=3.6.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NPoco.3.6.1\lib\net45\NPoco.dll</HintPath>
<Reference Include="NPoco, Version=3.9.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NPoco.3.9.3\lib\net45\NPoco.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
@@ -208,6 +208,10 @@
<Name>Umbraco.Web</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.2.6.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.2.6.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
@@ -234,4 +238,4 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\"
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

View File

@@ -119,11 +119,11 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.3.0.0" />
<bindingRedirect oldVersion="0.0.0.0-2.7.0.0" newVersion="2.7.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.3.0.0" />
<bindingRedirect oldVersion="0.0.0.0-2.7.0.0" newVersion="2.7.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

View File

@@ -5,16 +5,16 @@
<package id="BenchmarkDotNet.Diagnostics.Windows" version="0.10.8" targetFramework="net461" />
<package id="BenchmarkDotNet.Toolchains.Roslyn" version="0.10.12" targetFramework="net46" />
<package id="Castle.Core" version="4.1.1" targetFramework="net461" />
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net461" />
<package id="Microsoft.CodeAnalysis.Common" version="2.4.0" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.CSharp" version="2.4.0" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.Analyzers" version="2.6.0" targetFramework="net461" developmentDependency="true" />
<package id="Microsoft.CodeAnalysis.Common" version="2.7.0" targetFramework="net461" />
<package id="Microsoft.CodeAnalysis.CSharp" version="2.7.0" targetFramework="net461" />
<package id="Microsoft.Diagnostics.Tracing.TraceEvent" version="1.0.41" targetFramework="net461" />
<package id="Microsoft.DotNet.InternalAbstractions" version="1.0.0" targetFramework="net46" />
<package id="Microsoft.DotNet.PlatformAbstractions" version="1.1.1" targetFramework="net46" />
<package id="Microsoft.SqlServer.Compact" version="4.0.8876.1" targetFramework="net461" />
<package id="Microsoft.Win32.Registry" version="4.3.0" targetFramework="net46" />
<package id="Moq" version="4.7.99" targetFramework="net461" />
<package id="NPoco" version="3.6.1" targetFramework="net461" />
<package id="NPoco" version="3.9.3" targetFramework="net461" />
<package id="SqlServerCE" version="4.0.0.1" targetFramework="net461" />
<package id="System.AppContext" version="4.3.0" targetFramework="net46" />
<package id="System.Collections" version="4.3.0" targetFramework="net46" />

View File

@@ -640,6 +640,26 @@ namespace Umbraco.Tests.Testing
throw new NotImplementedException();
}
public Task<T> SingleAsync<T>(string sql, params object[] args)
{
throw new NotImplementedException();
}
public Task<T> SingleAsync<T>(Sql sql)
{
throw new NotImplementedException();
}
public Task<T> SingleOrDefaultAsync<T>(string sql, params object[] args)
{
throw new NotImplementedException();
}
public Task<T> SingleOrDefaultAsync<T>(Sql sql)
{
throw new NotImplementedException();
}
public Task<T> SingleByIdAsync<T>(object primaryKey)
{
throw new NotImplementedException();
@@ -650,6 +670,26 @@ namespace Umbraco.Tests.Testing
throw new NotImplementedException();
}
public Task<T> FirstAsync<T>(string sql, params object[] args)
{
throw new NotImplementedException();
}
public Task<T> FirstAsync<T>(Sql sql)
{
throw new NotImplementedException();
}
public Task<T> FirstOrDefaultAsync<T>(string sql, params object[] args)
{
throw new NotImplementedException();
}
public Task<T> FirstOrDefaultAsync<T>(Sql sql)
{
throw new NotImplementedException();
}
public Task<IEnumerable<T>> QueryAsync<T>(string sql, params object[] args)
{
throw new NotImplementedException();

View File

@@ -137,8 +137,8 @@
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NPoco, Version=3.6.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NPoco.3.6.1\lib\net45\NPoco.dll</HintPath>
<Reference Include="NPoco, Version=3.9.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NPoco.3.9.3\lib\net45\NPoco.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.7.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.7.1\lib\net45\nunit.framework.dll</HintPath>

View File

@@ -27,7 +27,7 @@
<package id="MiniProfiler" version="3.2.0.157" targetFramework="net461" />
<package id="Moq" version="4.7.99" targetFramework="net461" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
<package id="NPoco" version="3.6.1" targetFramework="net461" />
<package id="NPoco" version="3.9.3" targetFramework="net461" />
<package id="NUnit" version="3.7.1" targetFramework="net461" />
<package id="NUnit3TestAdapter" version="3.7.0" targetFramework="net461" />
<package id="Owin" version="1.0" targetFramework="net461" />

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0">
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.5\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.5\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<Import Project="..\packages\Microsoft.Net.Compilers.2.2.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.2.2.0\build\Microsoft.Net.Compilers.props')" />
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<Import Project="..\packages\Microsoft.Net.Compilers.2.7.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.2.7.0\build\Microsoft.Net.Compilers.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
@@ -66,14 +66,14 @@
<Reference Include="Log4Net.Async, Version=2.0.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Log4Net.Async.2.0.4\lib\net40\Log4Net.Async.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeAnalysis, Version=2.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.Common.2.3.0\lib\netstandard1.3\Microsoft.CodeAnalysis.dll</HintPath>
<Reference Include="Microsoft.CodeAnalysis, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.Common.2.7.0\lib\netstandard1.3\Microsoft.CodeAnalysis.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeAnalysis.CSharp, Version=2.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.2.3.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
<Reference Include="Microsoft.CodeAnalysis.CSharp, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.2.7.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.5\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.IO.RecyclableMemoryStream, Version=1.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -982,15 +982,10 @@
<Content Include="Config\EmbeddedMedia.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup />
<ItemGroup>
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
<Folder Include="App_Data\" />
<Folder Include="Views\MacroPartials\" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.2.6.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.2.6.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
@@ -1012,7 +1007,7 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\"
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>8000</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
@@ -1106,4 +1101,11 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\"
<Message Text="ConfigFile: $(OriginalFileName) -&gt; $(OutputFileName)" Importance="high" Condition="Exists('$(ModifiedFileName)')" />
<Copy SourceFiles="$(ModifiedFileName)" DestinationFiles="$(OutputFileName)" OverwriteReadOnlyFiles="true" SkipUnchangedFiles="false" Condition="Exists('$(ModifiedFileName)')" />
</Target>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.2.7.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.2.7.0\build\Microsoft.Net.Compilers.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
</Target>
</Project>

View File

@@ -21,12 +21,12 @@
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net461" />
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net461" />
<package id="Microsoft.CodeAnalysis.Common" version="2.3.0" targetFramework="net461" />
<package id="Microsoft.CodeAnalysis.CSharp" version="2.3.0" targetFramework="net461" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.5" targetFramework="net461" />
<package id="Microsoft.CodeAnalysis.Analyzers" version="2.6.0" targetFramework="net461" developmentDependency="true" />
<package id="Microsoft.CodeAnalysis.Common" version="2.7.0" targetFramework="net461" />
<package id="Microsoft.CodeAnalysis.CSharp" version="2.7.0" targetFramework="net461" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.8" targetFramework="net461" />
<package id="Microsoft.IO.RecyclableMemoryStream" version="1.2.2" targetFramework="net461" />
<package id="Microsoft.Net.Compilers" version="2.2.0" targetFramework="net461" developmentDependency="true" />
<package id="Microsoft.Net.Compilers" version="2.7.0" targetFramework="net461" developmentDependency="true" />
<package id="Microsoft.Owin" version="3.1.0" targetFramework="net461" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.1.0" targetFramework="net461" />
<package id="Microsoft.Owin.Security" version="3.1.0" targetFramework="net461" />

View File

@@ -22,13 +22,17 @@ namespace Umbraco.Web.Install.InstallSteps
var currentVersion = UmbracoVersion.Local.ToString();
var newVersion = UmbracoVersion.SemanticVersion.ToString();
string FormatGuidState(string value)
{
if (string.IsNullOrWhiteSpace(value)) value = "unknown";
else if (Guid.TryParse(value, out var currentStateGuid))
value = currentStateGuid.ToString("N").Substring(0, 8);
return value;
}
var state = Current.RuntimeState; // fixme inject
var currentState = state.CurrentMigrationState;
if (string.IsNullOrWhiteSpace(currentState)) currentState = "unknown";
var newState = state.FinalMigrationState?.Trim('{', '}');
if (string.IsNullOrWhiteSpace(newState)) newState = "unknown";
else if (Guid.TryParse(newState, out _))
newState = newState.Substring(0, 8);
var currentState = FormatGuidState(state.CurrentMigrationState);
var newState = FormatGuidState(state.FinalMigrationState);
var reportUrl = $"https://our.umbraco.org/contribute/releases/compare?from={currentVersion}&to={newVersion}&notes=1";

View File

@@ -102,7 +102,7 @@
<PackageReference Include="Microsoft.Web.Xdt" Version="2.1.1" />
<PackageReference Include="MiniProfiler" Version="3.2.0.157" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="NPoco" Version="3.6.1" />
<PackageReference Include="NPoco" Version="3.9.3" />
<PackageReference Include="Owin" Version="1.0" />
<PackageReference Include="Semver" Version="2.0.4" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="4.7.0" />