Error to delete record in db
SysPass version | 2.1 (2.1.16.18061901)
Certain categories are not deleted by the db:
Error while querying
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails
(admin_xxx.accHistory, CONSTRAINT fk_accHistory_category_id FOREIGN KEY (acchistory_categoryId) REFERENCES categories (category_id)) (0)SQL : '
DELETE
FROM categories
WHERE category_id = ?
LIMIT 1'
Tnx
Hello, this is caused by integrity constraints, since the category item is being used by an account history record, that is, you would need to delete the account from the history and then the category.
Regards
In general you need to delete the childs before deleting the parent (sounds pretty nasty), here's a gobal exemple if it can help...
https://stackoverflow.com/questions/1905470/cannot-delete-or-update-a-parent-row-a-foreign-key-constraint-fails