aiondemand / aiondemand/AIOD-rest-api

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

未關閉
#396 1 則留言 0 個 reaction 已指派 1 人 已被 @PGijsbers 認領 在 GitHub 檢視
bug priority
主要語言
Python
星號
36
分支
78
PR 合併指標
30 天內沒有已合併 PR

描述

**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

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。