I have a feeling the functionality for this already exists, but I haven't come across it yet in the documentation or in the examples.

My issue: I two migrations. Both pull from the same data source, which happens to be an xml document. The first creates entity A. The second creates entity B, but — and here's the thing — entity B references A via a node reference field.

When running the second migration, how do I discover the entity ID created during the first migration? We can assume that in both migrations, I'm using the same sourceID.

Is this really obvious?

Comments

mikeryan’s picture

Status: Active » Fixed

In the entity B migration, to the node reference field mapping add

  ->sourceMigration('EntityA')  // Or whatever you called your Entity A migration 
torrance123’s picture

Thanks for this. Worked like a charm!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Minor formatting