summaryrefslogtreecommitdiffstats
path: root/migrate_example/config/install/migrate_plus.migration.beer_node.yml
blob: 321c576df3656335ba2f7bfba73ff93d33a56d7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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_lookup
    migration: beer_user
    source: aid
  sticky:
    plugin: default_value
    default_value: 0
  field_migrate_example_country: countries
  field_migrate_example_beer_style:
    plugin: migration_lookup
    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