hasura / hasura/graphql-engine

[MSSQL] Adding relationship between two tables in different schemas fail

Open
#8,511 4 comments 1 reaction 1 assignee Claimed by @dameleney View on GitHub
c/server estimate/S k/bug support/needs-action
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: `v2.6.2-cloud.1`
Database: `MSSQL`

### Environment
Cloud

### What is the expected behaviour?

Clicking "Track" on a detected relationship between two tables in different schemas should not throw errors

### Keywords

### What is the current behaviour?

I have two tables that each sit in a different schema. One table is in the default `dbo` schema, while the second table is in the `assessments` schema. Hasura is correctly detecting the relationship between the tables since there is a primary/foreign key constraint configured.

![image](https://user-images.githubusercontent.com/1908292/169726220-be22afd9-d6f5-4999-9695-2bff06e0ce0d.png)

I'm presented with an option to "Add" the relationship, but when clicking, I get an error that the table in `dbo` schema could not be found, although the error message makes it clear that it's attempting to locate the table in the wrong schema.

![image](https://user-images.githubusercontent.com/1908292/169726261-5023ff7d-11c3-419c-9580-8f7daedfdcea.png)

### How to reproduce the issue?

1. Create two tables each in a different schema.
2. Configure a primary/foreign key between the tables
3. Use Hasura Cloud to track the relationship between the two tables

### Any possible solutions?

I am using a workaround in the Hasura Cloud UI where I manually configure the relationship, since this allows me to choose the correct schema.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.