-
Notifications
You must be signed in to change notification settings - Fork 526
Expand file tree
/
Copy pathMigrationUpgradeDbVersion_24.cs
More file actions
35 lines (27 loc) · 1.05 KB
/
MigrationUpgradeDbVersion_24.cs
File metadata and controls
35 lines (27 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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";
/// <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;
}
}