Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
migrate_plus
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
migrate_plus
Commits
ec47b1e4
Commit
ec47b1e4
authored
8 years ago
by
Mike Ryan
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2719735
by mikeryan: Lazy-create migration groups as needed
parent
55b1c6b2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/install/migrate_plus.migration_group.default.yml
+0
-4
0 additions, 4 deletions
config/install/migrate_plus.migration_group.default.yml
migrate_plus.module
+14
-1
14 additions, 1 deletion
migrate_plus.module
with
14 additions
and
5 deletions
config/install/migrate_plus.migration_group.default.yml
deleted
100644 → 0
+
0
−
4
View file @
55b1c6b2
# 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.
This diff is collapsed.
Click to expand it.
migrate_plus.module
+
14
−
1
View file @
ec47b1e4
...
...
@@ -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
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment