-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type RDSModelSchema is not assignable to type GenericModelSchema #2934
Comments
Hey👋, thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂 |
Hey @chrisl777, Thanks for raising this. To better understand the issue, would you be able to share the generated schema? |
@AnilMaktala I can't share the entire generated schema publicly, but here's an excerpt of some models that I thought may be interesting. Oddly, the identifier in some cases is not
|
Hey @chrisl777, Thanks for your reply. Based on the error, the issue seems related to the Brand model. Do you have a Brand model, and if so, could you share it with us? |
@AnilMaktala As far as Brand, if you mean database type, we're connecting to a Postgres database (it's a third party database host, not RDS). We followed these directions quite closely to generate the schema (Postgres): https://docs.amplify.aws/react-native/build-a-backend/data/connect-to-existing-data-sources/connect-postgres-mysql-database/ |
Hey @chrisl777, thanks for providing additional details. Can you please remove and re-install the node modules. run below command to remove the |
Hey @chrisl777 - It looks like in some cases, the primary key isn't correctly detected during the schema generation step and it ends up assigning the default |
@sundersc @AnilMaktala I ended up commenting out the "ar_internal_metadata" and "schema_migrations" tables in the generated schema, as I don't really need those for operation of the app. In the case of "ar_internal_metadata," that table is apparently automatically created by Rails to check the current environment before running migrations (the current backend was created using Ruby on Rails): https://vinioyama.com/blog/ruby-on-rails-what-is-ar_internal_metadata-metada-table/ For the "schema_migrations" table, it similarly is automatically created by Rails to manage databse migrations: https://planetscale.com/docs/tutorials/automatic-rails-migrations Going forward, I don't need to access these tables via AppSync, so it's not as much of an issue. But I could see other people tripping over this problem. |
Hi @chrisl777, Circling back to the issue in the overview, we exported the type that was missing with this change, released in November. Are you still seeing the type issue. From you last comment, it sounds like you have a workaround for the Where there any other issues raised inline here that we need to get fixed before we resolve this issue? Thanks! @stocaaro |
@stocaaro I just updated packages and tried it. I re-generated my SQL schema and I can see some changes like Oddly, I was getting the same error, I uninstalled |
Hey @chrisl777 , I've had the experience you're describing where transitive deps don't get updated. Glad to hear the latest version is working. Good to close this out, or is there anything else here that needs troubleshooting? Thanks |
@stocaaro It looks like we can close it out! I think it was my re-install that helped, I may have had some issues with how it was installed in the monorepo, perhaps there were multiple versions present of @aws-amplify/data-schema. I am however, having this issue when I try to export a helper class that wraps |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Environment information
Describe the bug
I'm following the directions on connecting to existing data sources:
https://docs.amplify.aws/react-native/build-a-backend/data/connect-to-existing-data-sources/connect-postgres-mysql-database/
In my case, I'm connecting to a Postgres database (third-party, not RDS).
I see the following error when I deploy the sandbox:
Reproduction steps
Follow the directions for importing your database schema (using
npx ampx generate schema-from-database
).Deploy the sandbox with
npx ampx sandbox
.The text was updated successfully, but these errors were encountered: