Current theorie, if the error:
Cannot add or update a child row: a foreign key constraint fails
(akonadi.collectionpimitemrelation,
CONSTRAINT `collectionpimitemrelation_ibfk_2` FOREIGN KEY (`PimItem_id`) REFERENCES `pimitemtable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)"
Collection::addPimItem is performed for items in PimItem, that do not exist anymore.
This patch added a debug message, what items are not vaild anymore in PimItem.