From 5ce6df36675fbe5a758ce3a9031cbdfc8213bad7 Mon Sep 17 00:00:00 2001 From: twerthi Date: Tue, 13 Feb 2024 15:30:01 -0800 Subject: [PATCH 1/3] Converting to mysqlconnector --- src/dbup-mysql/MySqlConnectionManager.cs | 3 ++- src/dbup-mysql/MySqlExtensions.cs | 2 +- src/dbup-mysql/MySqlScriptExecutor.cs | 6 +----- src/dbup-mysql/dbup-mysql.csproj | 22 ++++++++++++---------- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/dbup-mysql/MySqlConnectionManager.cs b/src/dbup-mysql/MySqlConnectionManager.cs index dde8b6d..5f25c63 100644 --- a/src/dbup-mysql/MySqlConnectionManager.cs +++ b/src/dbup-mysql/MySqlConnectionManager.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using DbUp.Engine.Transactions; -using MySql.Data.MySqlClient; +using MySqlConnector; + namespace DbUp.MySql { diff --git a/src/dbup-mysql/MySqlExtensions.cs b/src/dbup-mysql/MySqlExtensions.cs index 478c6e9..1ce967e 100644 --- a/src/dbup-mysql/MySqlExtensions.cs +++ b/src/dbup-mysql/MySqlExtensions.cs @@ -6,7 +6,7 @@ using DbUp.Engine.Output; using DbUp.Engine.Transactions; using DbUp.MySql; -using MySql.Data.MySqlClient; +using MySqlConnector; /// /// Configuration extension methods for MySql. diff --git a/src/dbup-mysql/MySqlScriptExecutor.cs b/src/dbup-mysql/MySqlScriptExecutor.cs index 5e221a6..4d01964 100644 --- a/src/dbup-mysql/MySqlScriptExecutor.cs +++ b/src/dbup-mysql/MySqlScriptExecutor.cs @@ -4,7 +4,7 @@ using DbUp.Engine.Output; using DbUp.Engine.Transactions; using DbUp.Support; -using MySql.Data.MySqlClient; +using MySqlConnector; namespace DbUp.MySql { @@ -41,11 +41,7 @@ protected override void ExecuteCommandsWithinExceptionHandler(int index, SqlScri } catch (MySqlException exception) { -#if MY_SQL_DATA_6_9_5 var code = exception.ErrorCode; -#else - var code = exception.Code; -#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); Log().WriteError(exception.ToString()); diff --git a/src/dbup-mysql/dbup-mysql.csproj b/src/dbup-mysql/dbup-mysql.csproj index 46809e4..c0e0d15 100644 --- a/src/dbup-mysql/dbup-mysql.csproj +++ b/src/dbup-mysql/dbup-mysql.csproj @@ -6,7 +6,7 @@ DbUp Contributors DbUp Copyright © DbUp Contributors 2015 - netstandard1.3;netstandard2.0;net462 + netstandard2.0;net462 dbup-mysql DbUp.MySql dbup-mysql @@ -14,6 +14,7 @@ true https://github.com/DbUp/dbup-mysql.git dbup-icon.png + netstandard2.0 @@ -21,25 +22,26 @@ - + - - + + 2.3.5 + + + - - - - - + + 2.3.5 + - + From 7851709bdee6a304c3d6d88dd573d0d4ccf51586 Mon Sep 17 00:00:00 2001 From: Shawn Sesna Date: Mon, 18 Mar 2024 08:58:23 -0700 Subject: [PATCH 2/3] Update dbup-mysql.csproj --- src/dbup-mysql/dbup-mysql.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dbup-mysql/dbup-mysql.csproj b/src/dbup-mysql/dbup-mysql.csproj index 36b45b3..1d3a39f 100644 --- a/src/dbup-mysql/dbup-mysql.csproj +++ b/src/dbup-mysql/dbup-mysql.csproj @@ -14,7 +14,6 @@ true https://github.com/DbUp/dbup-mysql.git dbup-icon.png - netstandard2.0 From 7227e8ad4c1b7222b9986a97470b9d9e5153eba2 Mon Sep 17 00:00:00 2001 From: Robert Wagner Date: Tue, 19 Mar 2024 13:18:41 +1000 Subject: [PATCH 3/3] Referenced MySqlConnector --- src/dbup-mysql/MySqlScriptExecutor.cs | 4 ++-- src/dbup-mysql/dbup-mysql.csproj | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/dbup-mysql/MySqlScriptExecutor.cs b/src/dbup-mysql/MySqlScriptExecutor.cs index eebc547..8fff2f5 100644 --- a/src/dbup-mysql/MySqlScriptExecutor.cs +++ b/src/dbup-mysql/MySqlScriptExecutor.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using DbUp.Engine; using DbUp.Engine.Output; @@ -41,7 +41,7 @@ protected override void ExecuteCommandsWithinExceptionHandler(int index, SqlScri } catch (MySqlException exception) { - var code = exception.Code; + var code = exception.ErrorCode; Log().LogInformation("MySql exception has occurred in script: '{0}'", script.Name); Log().LogError("Script block number: {0}; MySql error code: {1}; Number {2}; Message: {3}", index, code, exception.Number, exception.Message); Log().LogError(exception.ToString()); diff --git a/src/dbup-mysql/dbup-mysql.csproj b/src/dbup-mysql/dbup-mysql.csproj index 1d3a39f..7815340 100644 --- a/src/dbup-mysql/dbup-mysql.csproj +++ b/src/dbup-mysql/dbup-mysql.csproj @@ -1,4 +1,4 @@ - + DbUp makes it easy to deploy and upgrade SQL Server databases. This package adds MySql support. @@ -21,14 +21,13 @@ true embedded - + - - + - +