upgrade-1.2d1-1.2b2.sql should have been named upgrade-1.2d2-1.2b2.sql as it overlapped with the upgrade-1.2d1-1.2d2.sql script an so was not executed when upgrading from core 5.0.4
Fixed bug #361 again (parent_id of log entry cr_items point to case's object), this time providing an upgrade script, changing the parent_id of existing log entries, and fixing the case deletion proc to delete cases properly given the parent_id.