Hi,
We have a long standing problem that pops up on occasion. We are using atom 2.5.3 The error is:
Parent Resource id '311113' does not exist. This comes from an import that went really bad.
I have tried the rebuilding the nested sets, repopulating the search and clearing the cache etc. I have also ran the query to find the corruption that is explained here:
Nothing seems to help. I just may be left with the option to delete. Now the problem is deleting the record using the command:
php symfony tools:delete-description general-administation-operations-and-publicity
gives me an integrity constraint violation.
Cannot delete or update a parent row: a foreign key constraint fails (`atom253`.`information_object`, CONSTRAINT `information_object_FK_5` FOREIGN KEY (`parent_id`) REFERENCES `information_object` (`id`))
I try to dig down with a query:
SELECT s.object_id, s.slug, i.parent_id FROM information_object i, slug s
WHERE i.parent_id=311113 AND i.id = s.object_id
. This does yield a few records:
object_id | slug | parent_id |
311116 | a-fringe-theatre-event-program | 311113 |
311119 | a-fringe-theatre-event-poster | 311113 |
311122 | a-fringe-theatre-event-poster-2 | 311113 |
311126 | a-fringe-theatre-event-program-2 | 311113
|
When I try to delete any of the above using the delete-description I get the same constraint violation (information_object_FK_5)
I try to dig down some more by using the query below for each of the above records
select * from information_object where parent_id = 311116
but 0 records are returned each time.
Either the data is corrupt or I'm completely missing something here. The delete-description tool says there are 19 descendants. How does it calculate that?
Also I am wondering how do I get the next level of children (grand children, great grandchildren etc)? I'd like to know the sql behind it if possible just so I have a better understanding of the database and maybe construct a series of sql delete statements.
Thanks for your time. I know it's a big question.
Jeremy