简体   繁体   English

没有这样的表:(代码:0)模式更改后错误 Amplify.DataStore.save

[英]no such table: (code: 0) error Amplify.DataStore.save after schema change

I am new to Amplify integration in iOS application.我是 iOS 应用程序中 Amplify 集成的新手。 I am using Amplify DataStore for offline.我正在使用 Amplify DataStore 进行离线操作。 Before it was working fine to save and retrieve user data from Amplify DataStore, then i change the Schema name just from Users to User.在从 Amplify DataStore 保存和检索用户数据工作正常之前,我将模式名称从 Users 更改为 User。 Now am facing this error when saving user data to DataStore:现在在将用户数据保存到 DataStore 时遇到此错误:

"no such table: User(code: 0)"

After Schema change I run:架构更改后,我运行:

Amplify Push

Then I clean the build.然后我清理构建。 Delete the application.删除应用程序。 Delete the Amplify Folder删除放大文件夹

Run the amplify pull command:运行放大拉命令:

Amplify pull and Amplify codegen models.

But still facing the issue.但仍然面临这个问题。 Any help or suggestion would be greatly appreciated.任何帮助或建议将不胜感激。

After a lot of debugging and search i finally found a solution.经过大量调试和搜索,我终于找到了解决方案。

 There was a duplicate key in one of my Schema modals. I just remove and deploy and pull, it start working. 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM