We're updating the issue view to help you get more done. 

purge-deleted gets foreign-key error with download log

Description

When running caUtils purge-deleted, I get a foriegn key error on the download log--I then have to go back in mysql and delete the download log items there before running again.

PHP Fatal error: Uncaught D atabaseException: Cannot delete or update a parent row: a foreign key constraint fails (`collectiveaccess178prep`.`ca_download_log`, CONSTRAINT `fk_ca_download_ log_representation_id` FOREIGN KEY (`representation_id`) REFERENCES `ca_object_r epresentations` (`representation_id`)) in D:\SMA-catalog\app\lib\core\Db\mysqli. php:316 Stack trace: #0 D:\SMA-catalog\app\lib\core\Db\DbStatement.php(151): Db_mysqli->execute(Objec t(DbStatement), Object(DbStatement), 'DELETE FROM ca_...', Array, NULL) #1 D:\SMA-catalog\app\lib\core\Db.php(270): DbStatement->executeWithParamsAsArra y(Array) #2 D:\SMA-catalog\app\lib\core\BaseModel.php(3424): Db->query('DELETE FROM ca_.. .') #3 D:\SMA-catalog\app\lib\core\BaseModelWithAttributes.php(605): BaseModel->dele te(true, Array, NULL, Array) #4 D:\SMA-catalog\app\lib\ca\BundlableLabelableBaseModelWithAttributes.php(364): BaseModelWithAttributes->delete(true, Array, NULL, NULL) #5 D:\SMA-catalog\app\models\ca_object_representations.php(510): BundlableLabela bleBaseModelWithAttri in D:\SMA-catalog\app\lib\core\Db\mysqli.php on line 316

Environment

Windows2012 R2/IIS

Activity

Show:
User known
August 1, 2019, 11:47 PM

Fixed in dev/locMerge branch

Assignee

User known

Reporter

Sarah Shipley

Labels

None

Components

Fix versions

Affects versions

Priority

Minor
Configure