Version 1
[yaffs-website] / web / modules / contrib / migrate_plus / migrate_example / config / install / migrate_plus.migration.beer_node.yml
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 (file)
index 0000000..e2a9aef
--- /dev/null
@@ -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