Markus Johansson
09/17/2024, 6:33 AMPerson Picker
[{
GroupName : string,
PersonId : string
}]
Company Picker
[{
GroupName : string,
CompanyId : string
}]
I'm thinking that maybe I should merge them into one schema in v14, something like this:
[{
GroupName : string,
EntityId : string
}]
I guess I would need to create something that migrates the data and transform the stored JSON. Is there anyone who have made similar migrations when moving to v14 or that have seen any reading/examples around this?Jemayn
09/17/2024, 6:39 AMMarkus Johansson
09/17/2024, 6:39 AMskttl
09/17/2024, 6:49 AMJemayn
09/17/2024, 6:52 AMWarren Buckley
09/17/2024, 8:02 AMMike Chambers
09/17/2024, 9:38 AMMike Chambers
09/17/2024, 9:45 AMIf building a new solution, you can adopt a new pattern. With this pattern you create and run a similar migration but trigger it in response to a notification handler.
Mike Chambers
09/17/2024, 9:50 AMMigrationBase
with a MigratonPlan
if you don't need the PacakgeMigrationBase
overhead of schema imports?
load of example in the core here.. https://github.com/umbraco/Umbraco-CMS/tree/contrib/src/Umbraco.Infrastructure/Migrations/Upgrade might be a json content update one?Markus Johansson
09/17/2024, 10:24 AMMike Chambers
09/17/2024, 11:15 AMMarkus Johansson
09/17/2024, 11:16 AMMike Chambers
09/17/2024, 11:21 AMINotificationHandler<MigrationPlansExecutedNotification>
to resave (dataype/doctype) as migrationplans
will supress notifications.. Otherwise if you have uSync/umb deploy for instance to import on startup.. it will immediately overwrite/revert your changes as it didn't know the migration changed anything 😦Markus Johansson
09/17/2024, 8:45 PMMike Chambers
09/18/2024, 9:31 AMcsharp
foreach (ExecutedMigrationPlan executedMigrationPlan in executedMigrationPlans)
{
foreach (MigrationPlan.Transition transition in executedMigrationPlan.CompletedTransitions)
{
if (transition.MigrationType == typeof(ImportPackageXmlMigration))
{
return true;
}
}
}
lifted from https://github.com/umbraco/The-Starter-Kit/blob/v14/dev/src/Umbraco.SampleSite/Migrations/PostMigrationNotificationHandler.cs
after @Ronald Barendse pointed me in the right direction so can't take any credit ;-).. thread here https://discord.com/channels/869656431308189746/1245696446301208616/1246046623507812413Warren Buckley
09/18/2024, 10:22 AMMike Chambers
09/18/2024, 10:23 AMMike Chambers
09/18/2024, 10:26 AMWarren Buckley
09/18/2024, 10:43 AMWarren Buckley
09/18/2024, 10:44 AMMike Chambers
09/18/2024, 10:47 AM