Data UI JS error on relation with a view without FK
See original GitHub issueFollow up from here: https://github.com/hasura/graphql-engine/issues/1167
Hi 👋
I have an issue, after creating my new relationship the UI for data schema crash (JS error) with the message “Something went wrong”
If I remove the relationship directly in the database it works again. I’ve traced the JS error to this line: https://github.com/hasura/graphql-engine/blob/c3f4c35141f1187fc2f0f107158c1dff26f34568/console/src/components/Services/Data/TableRelationships/autoRelations.js#L110
Here is my faulty hdb_relationship
row:
table_schema | table_name | rel_name | rel_type | rel_def | comment | is_system_defined |
---|---|---|---|---|---|---|
public | orders | states | array | {"manual_configuration": {"remote_table": "orders_states", "column_mapping": {"id": "resource_id"}}} | NULL | f |
Did I missed something or this is a bug? Thank you.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Unable to create foreign key relationships in the Table Editor
Now how to set a foreign key without causing the error: ... Within the Database -> Tables view we are provided with the...
Read more >Entity Framework foreign key relationship returns no data
The cause of your problem is that you forgot to define a property for your foreign key. Because of the foreign key attribute, ......
Read more >3 common foreign key mistakes (and how to avoid them)
Foreign key constraints are important to any SQL database, but they can also cause problems if they're not implemented correctly.
Read more >Add a foreign key constraint to an existing column - GitLab Docs
If we can find “invalid” records by doing a database query and the record count is not high, then the data migration can...
Read more >Violation of constraints in relational database - GeeksforGeeks
Referential integrity : On inserting a value in the foreign key of relation 1, for which there is no corresponding value in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Huh, with this simple example I submitted, I cannot reproduce the bug.
My database is pretty complex, I’m going to investigate more and find out what is causing the bug 👍
@karthikvt26 @arvi3411301 Can this issue be closed? The associated PR has been marked as closed as Arvi’s already taken care of it.