X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fmigrate_plus%2Fmigrate_example%2Fconfig%2Finstall%2Fmigrate_plus.migration.beer_node.yml;fp=web%2Fmodules%2Fcontrib%2Fmigrate_plus%2Fmigrate_example%2Fconfig%2Finstall%2Fmigrate_plus.migration.beer_node.yml;h=e2a9aefcb3ac0604700a5f8c020e033a72962938;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_node.yml b/web/modules/contrib/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_node.yml new file mode 100644 index 000000000..e2a9aefcb --- /dev/null +++ b/web/modules/contrib/migrate_plus/migrate_example/config/install/migrate_plus.migration.beer_node.yml @@ -0,0 +1,53 @@ +# Migration configuration for beer content. +id: beer_node +label: Beers of the world +migration_group: beer +source: + plugin: beer_node +destination: + plugin: entity:node +process: + # Hardcode the destination node type (bundle) as 'migrate_example_beer'. + type: + plugin: default_value + default_value: migrate_example_beer + title: name + nid: bid + uid: + plugin: migration + migration: beer_user + source: aid + sticky: + plugin: default_value + default_value: 0 + field_migrate_example_country: countries + field_migrate_example_beer_style: + plugin: migration + migration: beer_term + source: terms + # Some Drupal fields may have multiple components we may want to set + # separately. For example, text fields may have summaries (teasers) in + # addition to the full text value. We use / to separate the field name from + # the internal field value being set, and put it in quotes because / is a + # YAML special character. + 'body/value': body + 'body/summary': excerpt +# Our beer nodes have references to terms and users, so we want those to be +# imported first. We make that dependency explicit here - by putting those +# migrations under the 'required' key, we ensure that the tools will prevent +# us from running the beer_node migration unless the beer_term and beer_user +# migrations are complete (although we can override the dependency check by +# passing --force to the drush migrate-import command). We can also add +# 'optional' dependencies - these affect the order in which migrations are +# displayed, and run by default, but does not force you run them in that +# order. +# The general rule of thumb is that any migrations referenced by migration +# process plugins should be required here. +migration_dependencies: + required: + - beer_term + - beer_user +dependencies: + enforced: + module: + - migrate_example