aws-amplify / aws-amplify/amplify-cli
A way to migrate data when updating app
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 825
- Avg merge
- 11d 23h
- Merged PRs (30d)
- 2
Description
**Is your feature request related to a problem? Please describe.**
When developing our app, we use 3 environments : dev, preproduction, production. Often there is :
• a need to alter the schemas to add required fields => after push, existing data have this field set to null
• a need to add a new data schema that should be populated at first (ie app parameters) => after push the dynamoDB table is empty
It seems to be missing a feature in amplify cli to migrate the databases so we can achieve seamless push in new environments
**Describe the solution you'd like**
It would be great to have the ability to describe migrations of data in the amplify folder so that the migrations are executed upon push
**Describe alternatives you've considered**
• Using dynamoDB interface to input the data by hand => difficult if there is a lot of data
• Using a custom external script to trigger mutations with the data needed to modify or input => sometimes you want to disable mutations on this particular schema (i.e. for a list of Countries) so you cannot do this easily. This also requires more boilerplate code.
• using a custom script with [aws js sdk](https://docs.aws.amazon.com/en_en/sdk-for-javascript/v2/developer-guide/dynamodb-example-table-read-write-batch.html) => seems the way to go for now
**Additional context**
Some great things exist with other frameworks, I will only link there some I have used : [for meteor](https://github.com/percolatestudio/meteor-migrations), [for laravel](https://laravel.com/docs/5.8/migrations)
I think version numbering is a must have for such functionality
If you have other alternatives, please comment here, I would be happy to test other solutions
Contributor guide
Assessment
This issue has not been assessed yet.