Version 1
[yaffs-website] / web / modules / contrib / migrate_plus / migrate_example_advanced / config / install / migrate_plus.migration.wine_terms.yml
diff --git a/web/modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_terms.yml b/web/modules/contrib/migrate_plus/migrate_example_advanced/config/install/migrate_plus.migration.wine_terms.yml
new file mode 100644 (file)
index 0000000..f11b82f
--- /dev/null
@@ -0,0 +1,37 @@
+id: wine_terms
+label: Migrate all categories into Drupal taxonomy terms
+migration_group: wine
+source:
+  plugin: wine_term
+destination:
+  plugin: entity:taxonomy_term
+process:
+  name: name
+  description: details
+  # Usually, one wants to have a separate migration for each entity_type/bundle
+  # combination - e.g., separate migrations for articles and blog posts, as
+  # opposed to a single monolithic node migration. This affords maximum
+  # control - the ability to import just one bundle at a time, and most
+  # importantly to have distinct field mappings (because different node types
+  # usually have different fields). In this case, though, because all of the
+  # vocabularies we're importing come from a common table, and on the Drupal
+  # side there are no distinct custom fields, we are able to import them all in
+  # one migration. The static_map tells the migration in which vocabulary to
+  # place each term, based on the incoming 'type' column.
+  vid:
+    plugin: static_map
+    source: type
+    map:
+      best_with: migrate_example_wine_best_with
+      region: migrate_example_wine_regions
+      variety: migrate_example_wine_varieties
+  parent:
+    plugin: migration
+    migration: wine_terms
+    source: category_parent
+  weight: ordering
+migration_dependencies: {}
+dependencies:
+  enforced:
+    module:
+      - migrate_example_advanced