Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to MySqlConnector #16

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dbup-mysql/MySqlConnectionManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using DbUp.Engine.Transactions;
using MySql.Data.MySqlClient;
using MySqlConnector;

namespace DbUp.MySql
{
Expand Down
4 changes: 2 additions & 2 deletions src/dbup-mysql/MySqlExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using DbUp.Engine.Output;
using DbUp.Engine.Transactions;
using DbUp.MySql;
using MySql.Data.MySqlClient;
using MySqlConnector;

/// <summary>
/// Configuration extension methods for MySql.
Expand Down Expand Up @@ -231,7 +231,7 @@ static void GetMysqlConnectionStringBuilder(string connectionString, IUpgradeLog
if (string.IsNullOrEmpty(databaseName) || databaseName.Trim() == string.Empty)
throw new InvalidOperationException("The connection string does not specify a database name.");

masterConnectionStringBuilder.Database = "mysql";

masterConnectionString = masterConnectionStringBuilder.ConnectionString;
}
}
4 changes: 2 additions & 2 deletions src/dbup-mysql/MySqlScriptExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using DbUp.Engine.Output;
using DbUp.Engine.Transactions;
using DbUp.Support;
using MySql.Data.MySqlClient;
using MySqlConnector;

namespace DbUp.MySql
{
Expand Down Expand Up @@ -44,7 +44,7 @@ protected override void ExecuteCommandsWithinExceptionHandler(int index, SqlScri
#if MY_SQL_DATA_6_9_5
var code = exception.ErrorCode;
#else
var code = exception.Code;
var code = exception.ErrorCode;
#endif
Log().WriteInformation("MySql exception has occurred in script: '{0}'", script.Name);
Log().WriteError("Script block number: {0}; MySql error code: {1}; Number {2}; Message: {3}", index, code, exception.Number, exception.Message);
Expand Down
20 changes: 10 additions & 10 deletions src/dbup-mysql/dbup-mysql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Company>DbUp Contributors</Company>
<Product>DbUp</Product>
<Copyright>Copyright © DbUp Contributors 2015</Copyright>
<TargetFrameworks>netstandard1.3;netstandard2.0;net462</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
<AssemblyName>dbup-mysql</AssemblyName>
<RootNamespace>DbUp.MySql</RootNamespace>
<PackageId>dbup-mysql</PackageId>
Expand All @@ -21,25 +21,25 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="dbup-core" Version="5.0.87"/>
<PackageReference Include="dbup-core" Version="5.0.87" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="System"/>
<PackageReference Include="MySql.Data" Version="6.9.5"/>
<PackageReference Include="MySqlConnector">
<Version>2.3.7</Version>
</PackageReference>
<Reference Include="System" />
<!-- last version to support < .NET 4.5.2. -->
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<PackageReference Include="MySql.Data" Version="6.10.9"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="MySql.Data" Version="8.0.33"/>
<PackageReference Include="MySqlConnector">
<Version>2.3.7</Version>
</PackageReference>
</ItemGroup>

<ItemGroup>
<None Visible="false" Include="../dbup-icon.png" Pack="True" PackagePath=""/>
<None Visible="false" Include="../dbup-icon.png" Pack="True" PackagePath="" />
</ItemGroup>
</Project>