aiondemand / aiondemand/AIOD-rest-api

Can't delete AI Resource that has `is_part_of` or `has_part` relationship

Offen
#396 1 Kommentar 0 Reaktionen 1 zugewiesene Person Beansprucht von @PGijsbers Auf GitHub ansehen
bug priority
Vorherrschende Sprache
Python
Sterne
36
Forks
78
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**Describe the bug**
Deleting a dataset when it has an `is_part_of` and `has_part` relation to other resources results in an error.
Example error:
```
ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`aiod`.`ai_resource_part_link`, CONSTRAINT `ai_resource_part_link_ibfk_2` FOREIGN KEY (`child_identifier`) REFERENCES `ai_resource` (`identifier`))
```

**To Reproduce**
TODO

**Expected behavior**
I expect to be able to delete a dataset even when it has an `is_part_of` and `has_part` relation to other resources.
The link should be removed accordingly (cascading deletes should work).

**Additional context**
n/a

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.