Links do not work after adding check constraint to a table #3109
Labels
restricted: maintainers
Only maintainers can resolve this issue
type: bug
Something isn't working
user reported
Reported by a Mathesar user
work: backend
Related to Python, Django, and simple SQL
Milestone
Description
It appears that tables with any check constraint (e.g. on an unrelated column) breaks the display of all links on that table.
The foreign key constraint is held by the underlying database, and the links are shown in the link panel on the sidebar. However, in the grid the cells just show the raw value rather than a dropdown.
Another clue: clicking table > advanced > constraints results shows the error 'Unable to fetch table constraints When making an XHR request, the server responded with an error, but the response body was not valid JSON.' Under the hood this corresponds with a 500 request to
/api/db/v0/tables/22/constraints/?limit=500
500 response body
To Reproduce
Steps:
Expected: The links display as before
Actual: The raw value of the links (e.g. the number for an integer id column) are shown
Video:
This is all mock data. Ignore bit where I try to add person_id manually at the beginning, this is force of habit 😅. Also, I add a record in the external tool but this is not necessary for reproduction (this is just meant to show the check constraint appears to work fine in other tools, and doesn't stop manipulating data there, so I don't think this is a problem with the other tool).
Screen.Recording.2023-07-28.at.16.24.24.-.264.mp4
Environment
The text was updated successfully, but these errors were encountered: