Skip to content

Instantly share code, notes, and snippets.

@dinarcon
Created August 16, 2019 11:08
Show Gist options
  • Save dinarcon/cb399017b24786611fa80f255d6e4f07 to your computer and use it in GitHub Desktop.
Save dinarcon/cb399017b24786611fa80f255d6e4f07 to your computer and use it in GitHub Desktop.
process:
psf_destination_filename:
plugin: callback
callable: basename
source: photo_url
source:
plugin: csv
path: modules/custom/ud_migrations/ud_migrations_csv_source/sources/udm_photos.csv
ids: [photo_id]
header_offset: null
fields:
- name: photo_id
label: 'Photo ID'
- name: photo_url
label: 'Photo URL'
process:
field_ud_image/target_id:
plugin: migration_lookup
migration: udm_csv_source_image
source: photo_file
destination:
plugin: 'entity:node'
default_bundle: ud_paragraphs
migration_dependencies:
required:
- udm_csv_source_image
- udm_csv_source_paragraph
optional: []
source:
plugin: csv
path: modules/custom/ud_migrations/ud_migrations_csv_source/sources/udm_people.csv
ids: [unique_id]
process:
field_ud_book_paragraph_title: book_title
field_ud_book_paragraph_author: 'Book author'
source:
plugin: csv
path: modules/custom/ud_migrations/ud_migrations_csv_source/sources/udm_book_paragraph.csv
ids: [book_id]
header_offset: null
fields:
- name: book_id
- name: book_title
- name: 'Book author'
B10 The definite guide to Drupal 7 Benjamin Melançon et al.
B20 Understanding Drupal Views Carlos Dinarte
B30 Understanding Drupal Migrations Mauricio Dinarte
unique_id name photo_file book_ref
1 Michele Metts P01 B10
2 Benjamin Melançon P02 B20
3 Stefan Freudenberg P03 B30
P01 https://agaric.coop/sites/default/files/pictures/picture-15-1421176712.jpg
P02 https://agaric.coop/sites/default/files/pictures/picture-3-1421176784.jpg
P03 https://agaric.coop/sites/default/files/pictures/picture-2-1421176752.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment