Skip to content
Merged
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/Build/Grand.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</ItemGroup>
<Target Name="SetVersion" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<Version>2.3.0</Version>
<Version>2.4.0</Version>
</PropertyGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -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

Check warning on line 9 in src/Modules/Grand.Module.Migration/Migrations/2.4/MigrationUpgradeDbVersion_24.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename class 'MigrationUpgradeDbVersion_24' to match pascal case naming rules, consider using 'MigrationUpgradeDbVersion24'.

See more on https://sonarcloud.io/project/issues?id=grandnode_grandnode2&issues=AZ06ktqLPU4l3pg_gIFA&open=AZ06ktqLPU4l3pg_gIFA&pullRequest=666
{
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";

/// <summary>
/// Upgrade process
/// </summary>
/// <param name="serviceProvider"></param>
/// <returns></returns>
public bool UpgradeProcess(IServiceProvider serviceProvider)
{
var repository = serviceProvider.GetRequiredService<IRepository<GrandNodeVersion>>();

var dbversion = repository.Table.FirstOrDefault();
dbversion!.InstalledVersion = $"{GrandVersion.SupportedDBVersion}";
dbversion!.DataBaseVersion = $"{GrandVersion.SupportedDBVersion}";
repository.Update(dbversion);

return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Loading