generated from Kentico/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## Custom migrations | ||
|
||
Samples: | ||
- `Migration.Tool.Extensions/CommunityMigrations/SampleTextMigration.cs` contains simplest implementation for migration of text fields | ||
- `Migration.Tool.Extensions/DefaultMigrations/AssetMigration.cs` contains real world migration of assets (complex example) | ||
|
||
To create custom migration: | ||
- create new file in `Migration.Tool.Extensions/CommunityMigrations` (directory if you need more files for single migration) | ||
- implement interface `Migration.Toolkit.KXP.Api.Services.CmsClass.IFieldMigration` | ||
- implement property rank, set number bellow 100 000 - for example 5000 | ||
- implement method shall migrate (if method returns true, migration will be used) | ||
- implement `MigrateFieldDefinition`, where objective is to mutate argument `XElement field` that represents one particular field | ||
- implement `MigrateValue` where goal is to return new migrated value derived from `object? sourceValue` | ||
- finally register in `Migration.Tool.Extensions/ServiceCollectionExtensions.cs` as `Transient` dependency into service collection. For example `services.AddTransient<IFieldMigration, AssetMigration>()` | ||
|
||
## Custom re-modeling of page types | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters