You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.
Run all scripts in date order, regardless of content type.
Actual Behavior
Scripts run in order of content type alphabetical, then by date, causing the migration to fail.
Possible Solution
Instead of going through each folder one by one, get all files under the matching directories and run in order by date.
Steps to Reproduce
Create content model A
Create content model B
Create first file under content model A create some fields
Create first file under content model B create some fields
Create second file under content model B to create a new field and populate it with data from a field in A in a field in B
Create second file under content model A delete field that is now in content model B
Context
We have some spaces that are far behind (or newly created), so need to run through our migration scripts. We have 1 that relies on some field being present in another content type, but another script that deletes that field.
Environment
Node Version: 14.17.3
Package Manager Version: yarn 1.18.0
Operating System: Mac OSX 11.4
Package Version: v4.0.10
The text was updated successfully, but these errors were encountered:
Sorry for the long delay in replying to this. This folder per content-model structure is a legacy for the original use-case of this tool. There was even work to try to implement a way for it to handle single-folder migrations in the branch https://github.com/deluan/contentful-migrate/tree/single-folder, but this still incomplete.
You don't need to create one folder per content-model. In fact the content-models are not tied to any folder. You can simply have all migrations in one folder by using -t single if you want. This would create a "content-model" folder named single and all your migrations would be in the same folder, independent of what content model they change. This would allow you to run migrations always in sequence, the same behaviour as we have with traditional DB schema migration tools.
That's the sort of approach that I have started to migrate to. It would be nice to still have the separate folder structure, so it's easier to go through previous scripts, but at least this works.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Expected Behavior
Run all scripts in date order, regardless of content type.
Actual Behavior
Scripts run in order of content type alphabetical, then by date, causing the migration to fail.
Possible Solution
Instead of going through each folder one by one, get all files under the matching directories and run in order by date.
Steps to Reproduce
Context
We have some spaces that are far behind (or newly created), so need to run through our migration scripts. We have 1 that relies on some field being present in another content type, but another script that deletes that field.
Environment
The text was updated successfully, but these errors were encountered: