fix: Migrations not working on a fresh DatoCMS instance as a result of mismatched IDs #245
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes several previous migrations relying on non-existent hardcoded IDs when creating a new project.
Updating previous migrations is not supposed to happen, however, no migration logic is changed.
It now relies on the API to find the right IDs using the corresponding label.
How to reproduce
main
on a personal DatoCMS accountnpx datocms migrations:run --destination=start --fast-fork
at the corresponding step, expect an errorExample of a related error
(saved during debugging, this is not the first error to show up, but they are all similar)
I inferred the itemTypes for
page
andhome_page
from inspecting an existing DatoCMS instance that uses Head Start, please check if this is correct.Changes
menuItems
since it now relies on finding IDs in a listHow to test
npx datocms migrations:run --destination=start --fast-fork
Checklist