Skip to content

v4.0.9

Choose a tag to compare

@stefanoverna stefanoverna released this 22 Apr 10:09
· 70 commits to main since this release

Changes

  • --allow-primary flag for migrations:run — The CLI previously refused any in-place migration run on the primary environment. The recommended workflow is still to fork → run → promote, but that flow has real cost when a migration is strictly additive (e.g. adding an optional field, creating a new model). You can now opt in with --allow-primary to run the migration directly against primary.
  • The guardrail error now surfaces both the recommended fork+promote workflow and the --allow-primary escape hatch via oclif suggestions, so the way out is discoverable the first time you hit it.
  • Using --allow-primary prints a runtime warning: an in-place run has no automatic rollback, so a failure partway through leaves primary in a partially-migrated state. Only use this flag for migrations you've verified to be safe and additive.

Examples

# Recommended: fork, migrate, promote
datocms migrations:run --source=main
datocms environments:promote main-post-migrations

# New: in-place on primary (additive migrations only)
datocms migrations:run --source=main --in-place --allow-primary