Skip to content

Commit 273cadf

Browse files
authored
Updated Migration code to RC003 compatible
The signature of Upgrader.Execute changed, so updated the example in RunBlogCommentsMigration to reflect this
1 parent aa3dbd1 commit 273cadf

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

Extending/Database/index-v9.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,19 @@ namespace MyNamespace
4141
public class BlogCommentsComponent : IComponent
4242
{
4343
private readonly IScopeProvider _scopeProvider;
44-
private readonly IMigrationBuilder _migrationBuilder;
44+
private readonly IMigrationPlanExecutor _migrationPlanExecutor;
4545
private readonly IKeyValueService _keyValueService;
4646
private readonly ILoggerFactory _loggerFactory;
47-
private readonly IRuntimeState _runtimeState;
4847

4948
public BlogCommentsComponent(
5049
IScopeProvider scopeProvider,
51-
IMigrationBuilder migrationBuilder,
50+
IMigrationPlanExecutor migrationPlanExecutor,
5251
IKeyValueService keyValueService,
53-
ILoggerFactory loggerFactory,
5452
IRuntimeState runtimeState)
5553
{
5654
_scopeProvider = scopeProvider;
57-
_migrationBuilder = migrationBuilder;
55+
_migrationPlanExecutor = migrationPlanExecutor;
5856
_keyValueService = keyValueService;
59-
_loggerFactory = loggerFactory;
6057
_runtimeState = runtimeState;
6158
}
6259

@@ -79,12 +76,7 @@ namespace MyNamespace
7976
// Go and upgrade our site (Will check if it needs to do the work or not)
8077
// Based on the current/latest step
8178
var upgrader = new Upgrader(migrationPlan);
82-
upgrader.Execute(
83-
_scopeProvider,
84-
_migrationBuilder,
85-
_keyValueService,
86-
_loggerFactory.CreateLogger<Upgrader>(),
87-
_loggerFactory);
79+
upgrader.Execute(_migrationPlanExecutor,_scopeProvider,_keyValueService);
8880
}
8981

9082
public void Terminate()

0 commit comments

Comments
 (0)