From 3c397255d5a9928277464c3b0680cbbdd899c517 Mon Sep 17 00:00:00 2001 From: Mads Larsen Date: Sun, 26 Jan 2025 12:39:38 +0100 Subject: [PATCH 1/5] Update dbup-core in .net6 and newer --- .../EventFlow.MsSql.Tests.csproj | 2 +- Source/EventFlow.Sql/EventFlow.Sql.csproj | 19 +++++++- .../Integrations/DbUpUpgradeLog.cs | 46 ++++++++++++++++++- 3 files changed, 63 insertions(+), 4 deletions(-) diff --git a/Source/EventFlow.MsSql.Tests/EventFlow.MsSql.Tests.csproj b/Source/EventFlow.MsSql.Tests/EventFlow.MsSql.Tests.csproj index 61c64eff9..d120298b1 100644 --- a/Source/EventFlow.MsSql.Tests/EventFlow.MsSql.Tests.csproj +++ b/Source/EventFlow.MsSql.Tests/EventFlow.MsSql.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1;net6.0 + netcoreapp3.1;net6.0;net8.0 False diff --git a/Source/EventFlow.Sql/EventFlow.Sql.csproj b/Source/EventFlow.Sql/EventFlow.Sql.csproj index 1f6164a38..93c9b0fc3 100644 --- a/Source/EventFlow.Sql/EventFlow.Sql.csproj +++ b/Source/EventFlow.Sql/EventFlow.Sql.csproj @@ -4,7 +4,7 @@ EventFlow.Sql Rasmus Mikkelsen Rasmus Mikkelsen - Copyright (c) Rasmus Mikkelsen 2015 - 2021 + Copyright (c) Rasmus Mikkelsen 2015 - 2025 Generic SQL support for EventFlow CQRS ES event sourcing SQL UPDATED BY BUILD @@ -13,11 +13,26 @@ - + + + + + + + + + + + + + + + + diff --git a/Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs b/Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs index 1acbe9fad..1966fbd58 100644 --- a/Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs +++ b/Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs @@ -20,12 +20,55 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +using System; using DbUp.Engine.Output; using Microsoft.Extensions.Logging; namespace EventFlow.Sql.Integrations { +#if NET6_0_OR_GREATER public class DbUpUpgradeLog : IUpgradeLog + { + private readonly ILogger _logger; + + public DbUpUpgradeLog( + ILogger logger) + { + _logger = logger; + } + + public void LogTrace(string format, params object[] args) + { + _logger.LogError(format, args); + } + + public void LogDebug(string format, params object[] args) + { + _logger.LogError(format, args); + } + + public void LogInformation(string format, params object[] args) + { + _logger.LogError(format, args); + } + + public void LogWarning(string format, params object[] args) + { + _logger.LogError(format, args); + } + + public void LogError(string format, params object[] args) + { + _logger.LogError(format, args); + } + + public void LogError(Exception ex, string format, params object[] args) + { + _logger.LogError(format, args); + } + } +#else +public class DbUpUpgradeLog : IUpgradeLog { private readonly ILogger _logger; @@ -50,4 +93,5 @@ public void WriteError(string format, params object[] args) _logger.LogError(format, args); } } -} +#endif +} \ No newline at end of file From 6c499922db79e1c78f2d6ace13293c2d0588e110 Mon Sep 17 00:00:00 2001 From: Mads Larsen Date: Sun, 26 Jan 2025 12:44:18 +0100 Subject: [PATCH 2/5] Pass exception to logger --- Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs b/Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs index 1966fbd58..afa88edc8 100644 --- a/Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs +++ b/Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs @@ -64,7 +64,7 @@ public void LogError(string format, params object[] args) public void LogError(Exception ex, string format, params object[] args) { - _logger.LogError(format, args); + _logger.LogError(ex, format, args); } } #else From ab49e03ca4fa8e82deb80d0a043f7880a6392d61 Mon Sep 17 00:00:00 2001 From: Mads Larsen Date: Sun, 26 Jan 2025 12:46:07 +0100 Subject: [PATCH 3/5] Set old version back to 5.0.37 --- RELEASE_NOTES.md | 1 + .../EventFlow.MsSql.Tests.csproj | 2 +- Source/EventFlow.Sql/EventFlow.Sql.csproj | 4 ++-- Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs | 13 ------------- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index bbf114d8f..a2eb6cb0a 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -10,6 +10,7 @@ - MongoDB - MSSQL - PostgreSQL +* Breaking: `EventFlow.Sql` from .NET 6 and above uses dbup version 6 to migrate databases. *Sorry for the delay.* diff --git a/Source/EventFlow.MsSql.Tests/EventFlow.MsSql.Tests.csproj b/Source/EventFlow.MsSql.Tests/EventFlow.MsSql.Tests.csproj index d120298b1..61c64eff9 100644 --- a/Source/EventFlow.MsSql.Tests/EventFlow.MsSql.Tests.csproj +++ b/Source/EventFlow.MsSql.Tests/EventFlow.MsSql.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1;net6.0;net8.0 + netcoreapp3.1;net6.0 False diff --git a/Source/EventFlow.Sql/EventFlow.Sql.csproj b/Source/EventFlow.Sql/EventFlow.Sql.csproj index 93c9b0fc3..2ed651b63 100644 --- a/Source/EventFlow.Sql/EventFlow.Sql.csproj +++ b/Source/EventFlow.Sql/EventFlow.Sql.csproj @@ -26,11 +26,11 @@ - + - + diff --git a/Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs b/Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs index afa88edc8..15e003206 100644 --- a/Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs +++ b/Source/EventFlow.Sql/Integrations/DbUpUpgradeLog.cs @@ -26,7 +26,6 @@ namespace EventFlow.Sql.Integrations { -#if NET6_0_OR_GREATER public class DbUpUpgradeLog : IUpgradeLog { private readonly ILogger _logger; @@ -66,17 +65,6 @@ public void LogError(Exception ex, string format, params object[] args) { _logger.LogError(ex, format, args); } - } -#else -public class DbUpUpgradeLog : IUpgradeLog - { - private readonly ILogger _logger; - - public DbUpUpgradeLog( - ILogger logger) - { - _logger = logger; - } public void WriteInformation(string format, params object[] args) { @@ -93,5 +81,4 @@ public void WriteError(string format, params object[] args) _logger.LogError(format, args); } } -#endif } \ No newline at end of file From e82ae23fb82d69aabdc4e07e7def7f273eeccf1b Mon Sep 17 00:00:00 2001 From: Mads Larsen Date: Sat, 15 Feb 2025 12:40:44 +0100 Subject: [PATCH 4/5] Install dbup-sqlserver 6.0 --- RELEASE_NOTES.md | 2 +- Source/EventFlow.MsSql/EventFlow.MsSql.csproj | 22 +++++++++++++++++-- .../EventFlow.PostgreSql.csproj | 22 +++++++++++++++++-- .../EventFlow.SQLite/EventFlow.SQLite.csproj | 17 +++++++++++++- Source/EventFlow.Sql/EventFlow.Sql.csproj | 2 +- 5 files changed, 58 insertions(+), 7 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index a2eb6cb0a..9c50f0eb9 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -10,7 +10,7 @@ - MongoDB - MSSQL - PostgreSQL -* Breaking: `EventFlow.Sql` from .NET 6 and above uses dbup version 6 to migrate databases. +* Breaking: `EventFlow.Sql` from .NET 8 and above uses dbup version 6 to migrate databases. *Sorry for the delay.* diff --git a/Source/EventFlow.MsSql/EventFlow.MsSql.csproj b/Source/EventFlow.MsSql/EventFlow.MsSql.csproj index ff686d64c..36da833b9 100644 --- a/Source/EventFlow.MsSql/EventFlow.MsSql.csproj +++ b/Source/EventFlow.MsSql/EventFlow.MsSql.csproj @@ -1,6 +1,6 @@  - netstandard2.1;netcoreapp3.1;net6.0 + netstandard2.1;netcoreapp3.1;net6.0;net8.0 EventFlow.MsSql Rasmus Mikkelsen Rasmus Mikkelsen @@ -12,9 +12,27 @@ + + + + + + + + + + + + + + + + + + + - diff --git a/Source/EventFlow.PostgreSql/EventFlow.PostgreSql.csproj b/Source/EventFlow.PostgreSql/EventFlow.PostgreSql.csproj index 1a60b0ed7..a97da78d4 100644 --- a/Source/EventFlow.PostgreSql/EventFlow.PostgreSql.csproj +++ b/Source/EventFlow.PostgreSql/EventFlow.PostgreSql.csproj @@ -1,6 +1,6 @@  - netstandard2.1;netcoreapp3.1;net6.0 + netstandard2.1;netcoreapp3.1;net6.0;net8.0 EventFlow.PostgreSql Rida Messaoudene Rasmus Mikkelsen @@ -25,8 +25,26 @@ - + + + + + + + + + + + + + + + + + + + diff --git a/Source/EventFlow.SQLite/EventFlow.SQLite.csproj b/Source/EventFlow.SQLite/EventFlow.SQLite.csproj index ed9480299..3efec7135 100644 --- a/Source/EventFlow.SQLite/EventFlow.SQLite.csproj +++ b/Source/EventFlow.SQLite/EventFlow.SQLite.csproj @@ -9,11 +9,26 @@ - + + + + + + + + + + + + + + + + diff --git a/Source/EventFlow.Sql/EventFlow.Sql.csproj b/Source/EventFlow.Sql/EventFlow.Sql.csproj index 2ed651b63..fb813e9b0 100644 --- a/Source/EventFlow.Sql/EventFlow.Sql.csproj +++ b/Source/EventFlow.Sql/EventFlow.Sql.csproj @@ -22,7 +22,7 @@ - + From 23721c8545d978c5f33dc37bb277eef2db590df2 Mon Sep 17 00:00:00 2001 From: Mads Larsen Date: Sun, 9 Mar 2025 13:15:05 +0100 Subject: [PATCH 5/5] fix: Entity framework postgres package minimum version --- .../EventFlow.EntityFramework.Tests.csproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/EventFlow.EntityFramework.Tests/EventFlow.EntityFramework.Tests.csproj b/Source/EventFlow.EntityFramework.Tests/EventFlow.EntityFramework.Tests.csproj index efaad38f5..8073e6011 100644 --- a/Source/EventFlow.EntityFramework.Tests/EventFlow.EntityFramework.Tests.csproj +++ b/Source/EventFlow.EntityFramework.Tests/EventFlow.EntityFramework.Tests.csproj @@ -6,12 +6,12 @@ - - - + + + - - + +