首页 > 解决方案 > 如何重置生产放大数据库

问题描述

我目前仍处于网站的开发阶段,我想彻底清理当前的实时数据库并刷新以前的模式。由于我对架构进行了如此多的更改,以至于我不再能够amplify push

这可以通过 AWS 放大实现吗?

Attempting to edit the global secondary index byDivision on the DivisionTable table in the Division stack. 
An error occurred during the push operation: Attempting to edit the global secondary index 

byDivision 在 Division 堆栈中的 DivisionTable 表上。

标签: amazon-web-servicesamazon-dynamodbaws-amplify

解决方案


您可以简单地运行:

amplify api remove
amplify api push

因此它将删除 API(包括 DDB)。确保首先检查正确的环境。

之后,您需要再次使用以下方法添加 API:

amplify api add

但是,如果您想从头开始创建一个干净的环境,那么只需:

amplify env remove <env_name>
amplify init

它将首先删除环境,然后重新创建它。这需要一段时间,但工作正常!


推荐阅读