Feature #11404

Add command line script option to delete all descriptions for the selected archival institution

Added by Mike Gale almost 3 years ago. Updated almost 3 years ago.

Status:VerifiedStart date:07/11/2017
Priority:MediumDue date:
Assignee:Dan Gillean% Done:

0%

Category:CLI toolsEstimated time:9.00 hours
Target version:Release 2.4.0
Google Code Legacy ID: Tested version:
Sponsored:Yes Requires documentation:

Description

Add a "--repository" option to the existing “delete-description” command-line script

History

#2 Updated by Mike Gale almost 3 years ago

  • Status changed from New to QA/Review

merged mainline qa/2.4.x 91584d8

#3 Updated by Dan Gillean almost 3 years ago

  • Category set to CLI tools
  • Target version set to Release 2.4.0
  • Sponsored changed from No to Yes
  • Requires documentation set to Yes

#4 Updated by Dan Gillean almost 3 years ago

  • Status changed from QA/Review to Feedback
  • Assignee changed from Dan Gillean to Mike Gale

I tried this, and got an error.

to reproduce

  • Create a new repo - "Test repo"
  • Create several new hierarchical descriptions (e.g. collection with children), associated with test repo
  • Run the task:
php symfony tools:delete-description --repository test-repo

Resulting error

Task fails to execute. The following error was returned:

Unable to execute DELETE statement. [wrapped: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key
 constraint fails (`atom`.`information_object`, CONSTRAINT `information_object_FK_5` FOREIGN KEY (`parent_id`) REFERENCES `information_object` (`id`))]

#5 Updated by Mike Gale almost 3 years ago

  • Assignee changed from Mike Gale to Dan Gillean

Hi Dan, did you get a chance to recreate this? It worked on my end, and I suspected it's possibly a cache issue. If you can reproduce, please provide a dump.

#6 Updated by Dan Gillean almost 3 years ago

  • Assignee changed from Dan Gillean to Mike Gale

Purged my site, dropped and reloaded the db, did a sql upgrade, restarted services, and reloaded the demo data. Still getting the same error. I've sent you an email with a sqldump attached.

#7 Updated by Mike Gale almost 3 years ago

  • Status changed from Feedback to Code Review
  • Assignee changed from Mike Gale to Steve Breker

#8 Updated by Steve Breker almost 3 years ago

Code review looks good. Nice removal of duplicated code to use the deleteFullHierarchy() in the IO class.

#9 Updated by Steve Breker almost 3 years ago

  • Assignee changed from Steve Breker to Mike Gale

#10 Updated by Mike Gale almost 3 years ago

  • Status changed from Code Review to QA/Review
  • Assignee changed from Mike Gale to Dan Gillean

hi Dan, I think this should fix it. Merged qa/2.4.x d23b2c2ca8c7927ff47f1f4eebf82159ef69b6e9

#11 Updated by Dan Gillean almost 3 years ago

  • Status changed from QA/Review to Verified

#12 Updated by Dan Gillean almost 3 years ago

  • Requires documentation deleted (Yes)

Also available in: Atom PDF