hasura / hasura/graphql-engine

Server: parent_id not dropped although relationship does not exist

Open
#8,726 2 comments 0 reactions 0 assignees View on GitHub
k/bug t/gql-services
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: 2.9.0
CLI Version (for CLI related issue): 2.9.0

### Environment

ubuntu 22.04.

### What is the current behaviour?

Attempting to drop column "segmentation_markup_id" from table "datapoint_markups" shows relationship error, although no relationship is present. The relationship existed before but was deleted.

![image](https://user-images.githubusercontent.com/2518993/181513502-8c44bce2-4525-42fd-9e46-3d77fff63f3f.png)

![image](https://user-images.githubusercontent.com/2518993/181513172-eef85649-94f8-4e23-8a4a-7d5ee5612f7a.png)
### What is the expected behaviour?

Drop the column without any error since no relationship is defined.

### How to reproduce the issue?

1. add foreign key relationship between two tables
2. remove foreign key, remove relationship
3. try to drop parent_id column

### Screenshots or Screencast

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by following the reproduction steps on the server with the relationship metadata: create the foreign key, remove it, and retry dropping the column. Done means the previously removed relationship is not reported and the column can be dropped without an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.