Skip to content

Commit

Permalink
Merge branch 'postgresqlCore'
Browse files Browse the repository at this point in the history
  • Loading branch information
droyad committed Feb 9, 2018
2 parents 6a8abc3 + 373041d commit fe5e1cf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/dbup-postgresql/PostgresqlScriptExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ protected override void ExecuteCommandsWithinExceptionHandler(int index, SqlScri
{
excuteCommand();
}
#if NPGSQLv2
catch (NpgsqlException exception)
#else
catch (PostgresException exception)
#endif
{
Log().WriteInformation("Npgsql exception has occured in script: '{0}'", script.Name);
Log().WriteError("Script block number: {0}; Block line {1}; Position: {2}; Message: {3}", index, exception.Line, exception.Position, exception.Message);
Expand Down
16 changes: 14 additions & 2 deletions src/dbup-postgresql/dbup-postgresql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>DbUp makes it easy to deploy and upgrade SQL Server databases. This package adds PostgreSQL support.</Description>
<AssemblyTitle>DbUp PostgreSQL Support</AssemblyTitle>
<Authors>Paul Stovell;Jim Burger;Jake Ginnivan;Damian Maclennan</Authors>
<TargetFrameworks>net35;net45</TargetFrameworks>
<TargetFrameworks>netstandard1.3;netstandard2.0;net35;net45</TargetFrameworks>
<AssemblyName>dbup-postgresql</AssemblyName>
<AssemblyOriginatorKeyFile>../dbup.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
Expand All @@ -20,9 +20,21 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net35'">
<DefineConstants>$(DefineConstants);NPGSQLv2</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Npgsql" Version="2.2.1" />
<ProjectReference Include="..\dbup-core\dbup-core.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net35'">
<PackageReference Include="Npgsql" Version="2.2.7" /> <!-- Last version that supports .NET 3.5 -->
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net35'">
<PackageReference Include="Npgsql" Version="3.2.6" />
</ItemGroup>


</Project>
2 changes: 1 addition & 1 deletion src/dbup-tests/ApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public class ApiTests
[InlineData(typeof(UpgradeEngine))]
[InlineData(typeof(SQLiteExtensions))]
[InlineData(typeof(MySqlExtensions))]
[InlineData(typeof(PostgresqlExtensions))]
#if !NETCORE
[InlineData(typeof(FirebirdExtensions))]
[InlineData(typeof(PostgresqlExtensions))]
[InlineData(typeof(SqlCeExtensions))]
#endif
public void NoPublicApiChanges(Type type)
Expand Down
2 changes: 1 addition & 1 deletion src/dbup-tests/dbup-tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<ProjectReference Include="..\dbup-sqlserver\dbup-sqlserver.csproj" />
<ProjectReference Include="..\dbup-sqlite\dbup-sqlite.csproj" />
<ProjectReference Include="..\dbup-mysql\dbup-mysql.csproj" />
<ProjectReference Include="..\dbup-postgresql\dbup-postgresql.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
Expand All @@ -30,7 +31,6 @@
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
<ProjectReference Include="..\dbup-sqlce\dbup-sqlce.csproj" />
<ProjectReference Include="..\dbup-firebird\dbup-firebird.csproj" />
<ProjectReference Include="..\dbup-postgresql\dbup-postgresql.csproj" />
<PackageReference Include="Microsoft.SqlServer.Compact" Version="4.0.8876.1" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
Expand Down

0 comments on commit fe5e1cf

Please sign in to comment.