From 16d780302e4198132c010430fc4ba6f43b3039ca Mon Sep 17 00:00:00 2001 From: MarvinKlein1508 Date: Fri, 26 Jul 2024 10:39:24 +0200 Subject: [PATCH 1/2] Switch to MySqlConnector --- src/dbup-mysql/MySqlConnectionManager.cs | 2 +- src/dbup-mysql/MySqlExtensions.cs | 2 +- src/dbup-mysql/MySqlScriptExecutor.cs | 4 ++-- src/dbup-mysql/dbup-mysql.csproj | 20 ++++++++++---------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/dbup-mysql/MySqlConnectionManager.cs b/src/dbup-mysql/MySqlConnectionManager.cs index dde8b6d..4649e2d 100644 --- a/src/dbup-mysql/MySqlConnectionManager.cs +++ b/src/dbup-mysql/MySqlConnectionManager.cs @@ -1,6 +1,6 @@ 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..12673de 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 { @@ -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); diff --git a/src/dbup-mysql/dbup-mysql.csproj b/src/dbup-mysql/dbup-mysql.csproj index 1e7d602..b92249f 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 @@ -21,25 +21,25 @@ - + - - + + 2.3.7 + + - - - - - + + 2.3.7 + - + From b2c3f7e1a3fc1bea3774b3bdebdfc687314513f3 Mon Sep 17 00:00:00 2001 From: MarvinKlein1508 Date: Fri, 26 Jul 2024 10:54:17 +0200 Subject: [PATCH 2/2] do not set mysql as default database --- src/dbup-mysql/MySqlExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbup-mysql/MySqlExtensions.cs b/src/dbup-mysql/MySqlExtensions.cs index 1ce967e..cf79f68 100644 --- a/src/dbup-mysql/MySqlExtensions.cs +++ b/src/dbup-mysql/MySqlExtensions.cs @@ -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; } }