From 09a9b3d8619864fe958db8db51665eaad0aae6a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 17:01:52 +0000 Subject: [PATCH 1/2] chore: bump version 2.3 -> 2.4, add MigrationUpgradeDbVersion_24 Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/ddf8370b-a45e-433a-b3da-11898992fe25 Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com> --- src/Build/Grand.Common.props | 2 +- .../2.4/MigrationUpgradeDbVersion_24.cs | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/Modules/Grand.Module.Migration/Migrations/2.4/MigrationUpgradeDbVersion_24.cs diff --git a/src/Build/Grand.Common.props b/src/Build/Grand.Common.props index bb4383b86..a6f74ff1f 100644 --- a/src/Build/Grand.Common.props +++ b/src/Build/Grand.Common.props @@ -42,7 +42,7 @@ - 2.3.0 + 2.4.0 \ No newline at end of file diff --git a/src/Modules/Grand.Module.Migration/Migrations/2.4/MigrationUpgradeDbVersion_24.cs b/src/Modules/Grand.Module.Migration/Migrations/2.4/MigrationUpgradeDbVersion_24.cs new file mode 100644 index 000000000..e4a86d7d1 --- /dev/null +++ b/src/Modules/Grand.Module.Migration/Migrations/2.4/MigrationUpgradeDbVersion_24.cs @@ -0,0 +1,35 @@ +using Grand.Data; +using Grand.Domain.Common; +using Grand.Infrastructure; +using Grand.Infrastructure.Migrations; +using Microsoft.Extensions.DependencyInjection; + +namespace Grand.Module.Migration.Migrations._2._4; + +public class MigrationUpgradeDbVersion_24 : IMigration +{ + public int Priority => 0; + + public DbVersion Version => new(2, 4); + + public Guid Identity => new("A1B2C3D4-E5F6-7890-ABCD-EF1234567890"); + + public string Name => "Upgrade version of the database to 2.4"; + + /// + /// Upgrade process + /// + /// + /// + public bool UpgradeProcess(IServiceProvider serviceProvider) + { + var repository = serviceProvider.GetRequiredService>(); + + var dbversion = repository.Table.FirstOrDefault(); + dbversion!.InstalledVersion = $"{GrandVersion.SupportedDBVersion}"; + dbversion!.DataBaseVersion = $"{GrandVersion.SupportedDBVersion}"; + repository.Update(dbversion); + + return true; + } +} From cd7382bdba923e1145e8bf95dbea84f7ad348a7b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 17:48:22 +0000 Subject: [PATCH 2/2] fix: update MigrationManagerTests for version 2.4 Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/33c01318-25b2-4ea5-b333-84eaafaafb42 Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com> --- .../Migrations/MigrationManagerTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tests/Grand.Infrastructure.Tests/Migrations/MigrationManagerTests.cs b/src/Tests/Grand.Infrastructure.Tests/Migrations/MigrationManagerTests.cs index 2e1ba91b8..6482c1139 100644 --- a/src/Tests/Grand.Infrastructure.Tests/Migrations/MigrationManagerTests.cs +++ b/src/Tests/Grand.Infrastructure.Tests/Migrations/MigrationManagerTests.cs @@ -18,7 +18,7 @@ public void GetAllMigrationsTest() [TestMethod] public void GetCurrentMigrationsTest() { - var result = migrationManager.GetCurrentMigrations(new DbVersion(2,3)); + var result = migrationManager.GetCurrentMigrations(new DbVersion(2,4)); Assert.AreEqual(1, result.Count()); } } \ No newline at end of file