Order of migrations should not matter to drush migrate:import

Created on 12 July 2024, about 2 months ago

Problem/Motivation

I have two migrations, image and media, and media depends on image.

If I explicitly request to run both of them in one order it's fine:

$ drush mim image,media --execute-dependencies --update
[notice] Processed 1 item (0 created, 1 updated, 0 failed, 0 ignored) - done with 'image'
[notice] Processed 1 item (0 created, 1 updated, 0 failed, 0 ignored) - done with 'media'

but if I swap the order, the image migration is run twice:

$ drush mim media,image --execute-dependencies --update
[notice] Processed 1 item (0 created, 1 updated, 0 failed, 0 ignored) - done with 'image'
[notice] Processed 1 item (0 created, 1 updated, 0 failed, 0 ignored) - done with 'media'
[notice] Processed 1 item (0 created, 1 updated, 0 failed, 0 ignored) - done with 'image'

Steps to reproduce

Proposed resolution

The order should not matter when --execute-dependencies is specified, the resolution should be the same and image should only be run once.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

6.0

Component

Drush commands

Created by

🇬🇧United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @longwave
  • 🇬🇧United Kingdom khaled.zaidan

    I would say the order should/could still matter, just without any migration being run multiple times.

    This could be useful if we have a migration X that depends on several other migrations A, B and C. If we know that A and B take particularly long, then we might want to run influence the order and run C first.

    There could be other reasons we'd want a migration to run before others aside from explicitly being a "dependency".

Production build 0.71.5 2024