Skip to content
Snippets Groups Projects
Commit ec47b1e4 authored by Mike Ryan's avatar Mike Ryan
Browse files

Issue #2719735 by mikeryan: Lazy-create migration groups as needed

parent 55b1c6b2
No related branches found
No related tags found
No related merge requests found
# A default group, assigned to any migrations with no explicit group.
id: default
label: Default
description: A container for any migrations not explicitly assigned to a group.
......@@ -23,7 +23,20 @@ function migrate_plus_migration_plugins_alter(array &$migrations) {
}
$group = MigrationGroup::load($migration['migration_group']);
if (empty($group)) {
continue;
// If the specified group does not exist, create it. Provide a little more
// for the 'default' group.
$group_properties = [];
$group_properties['id'] = $migration['migration_group'];
if ($migration['migration_group'] == 'default') {
$group_properties['label'] = 'Default';
$group_properties['description'] = 'A container for any migrations not explicitly assigned to a group.';
}
else {
$group_properties['label'] = $group_properties['id'];
$group_properties['description'] = '';
}
$group = MigrationGroup::create($group_properties);
$group->save();
}
$shared_configuration = $group->get('shared_configuration');
if (empty($shared_configuration)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment