decaporg / decaporg/decap-cms

Schema and data migrations

Open
#1,813 4 comments 12 reactions 0 assignees View on GitHub
area: content migration exp: expert kind: feature pinned
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Is your feature request related to a problem? Please describe.**

I work in an R&D environment, and even with tons of forethought and discussion regarding what the shape of our data will be, there will always be a day--and always sooner rather than later--that we'll want to change the name of a field, change the type of a field, add a field, etc etc.

The only way I know how to both change the `collections` configuration in the CMS' `config.yml` and have already-existing, CMS-produced data reflect that change is to first edit the `config.yml`, then manually update the markdown/yaml data that has already been produced to match the new schema.

**Describe the solution you'd like**

I'm not entirely certain what a great solution looks like. One solution that I've been trying to think through is a schema and data migration tool. For example, a tool like [flyway](https://flywaydb.org/getstarted/) for relational databases allow you to define your schema and any modifications to it through ordered migration files. Similarly, a `netlify-cms-migration` tool could read in a series of migration files in order to produce a single `config.yml`. Along the way, it would run updates on already-existing data to ensure the data matches the new schema.

I don't believe, however, that a tool that accomplishes the above would be trivial to implement. Are there other ways that folks have accomplished this that works for them?

**Describe alternatives you've considered**

Continue to do everything by hand?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.