amazon-web-services - AWS Amplify API:无法从 @model 中删除 @key
问题描述
使用 AWS Amplify,我终于删除了我的一个模型的 @key 属性(我不需要它,我想要一个自动生成的 UUID)。
执行时出现amplify push
此错误
Attempting to edit the key schema of the NewsTable table in the News stack.
An error occured during the push operation: Attempting to edit the key schema of the NewsTable table in the News stack.
我怎么能强迫它?我不介意丢失数据,因为它不在生产中。我只是不想用蹩脚的重命名来破解它,也不想为此删除我的整个 App Sync 项目。
解决方案
不用于生产。请注意,此方法会删除您的所有数据。
假设您需要从“Car”模型中删除密钥“licenceNumber”
type Car @model {
licenceNumber: String! @key
color: String!
}
推动任何东西,但删除该汽车模型
type Car_renamed_to_make_the_push_work @model {
licenceNumber: String!
color: String!
}
然后再次重命名您的模型,但没有密钥
type Car @model {
licenceNumber: String!
color: String!
}
推荐阅读
- java - 将数组传递给构造函数并出现“无法将 double [] 转换为 int”错误
- python - 如何让硒一个接一个地执行两个不同的按钮
- java - How do you make the application get to read the 1st letter of the 2nd word
- python - 如何从 3d 数组中删除周围的空数据
- docker - 是否有将 ansible-playbook 转换为 Dockerfile 的工具?
- flutter - Flutter Carousel no Image 等一些困难
- javascript - 如何将SVG图像添加到pdf
- javascript - 我是 ajax 和 jquery 的新手,所以我不知道我的代码有什么问题
- c# - 如何从“textbox1”获取输入到 .bat 文件
- html - 我如何将元素内联 html