hasura / hasura/graphql-engine
Index naming conflict when same table named used in multiple schemas
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
v2.0.10-cloud.1
Hasura Hosted Database
Hasura has issues tracking indexes when multiple tables exist with the same name in different schemas.
In the image below you will see the table named employee has been created in three separate schemas: prx, public and test
Each table has an id integer autoincrement as a primary key.
When selecting the modify tab for any of the employee tables the indexes of the other employee tables appear in its modification section. I am not sure how the system handles the naming conflict.
### Screenshots or Screencast

### Any possible solutions?
It maybe best to append the schema name to all indexes and contraints.
i.e. schema_table_idx
This would follow the structure used in the GraphQL generated query statements.
### If the bug is confirmed, would you be willing to submit a PR?
Sure.
Contributor guide
Research direction
The issue names no files or tests; start at the table modify tab and reproduce the behavior with employee tables in the prx, public, and test schemas. Trace how indexes are selected for each table, then verify that each modify view shows only its own indexes and add regression coverage for same-named tables across schemas.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgres
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100