Storyblok CLI - migrations - run against other spaces #221
Replies: 2 comments 4 replies
-
|
@alvarosabu @imranolas any resolution here? I find this as a major blocker for us, as we use multi-space setup. We can run datasources/components pushing cross-space, but weirdly migrations can't 🤔 |
Beta Was this translation helpful? Give feedback.
-
|
@edvinasjurele Thanks for bringing this up earlier. Just wanted to give an update that this has now been addressed in the latest version of the Storyblok CLI. The feature is included out of the box, so updating to the newest release should resolve it. If you run into anything unexpected after upgrading, feel free to reopen or start a new discussion. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It seems I can't find a way to run migrations against multiple spaces with the current setup. We have a 3-space structure (DEV, STAGING, and PRODUCTION), where migrations are typically created and tested against the DEV space first. Once validated, they are run against STAGING, and finally PRODUCTION, either via CI/CD or locally.
In the old v3 CLI (reference), migrations were organized into a folder like so:
This allowed us to run migrations against any specified space by pointing the command to the desired space. Typically, we executed them locally on DEV first, followed by STAGING and PRODUCTION through CI as part of our release pipeline.
In the new CLI version, the usage seems very similar:
However, the
--spaceflag is used to both read migrations from and execute them on the same space. This does not align well with our workflow, as it would require physically duplicating the migration files into separate folders assigned to different space IDs. This duplication feels excessive and unnecessary, as it complicates the process just to accommodate cross-space execution.I initially thought the
--pathoption would solve this issue, as I assumed it would allow specifying the exact directory or full path of migrations to use. However, it turns out--pathserves only as a base path, not a fully customized path to source migrations from.Do you have any suggestions on how we could achieve cross-space execution without duplicating migration files? Ideally, we'd like a way to keep a single set of migration files and execute them against multiple spaces (DEV, STAGING, PRODUCTION) as needed.
Beta Was this translation helpful? Give feedback.
All reactions