<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On May 14, 2014, at 4:08 PM, Bridger Dyson-Smith <<a href="mailto:bdysonsm@utk.edu">bdysonsm@utk.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi all,<br><br>I'm trying to delete a record from a test repository and I'm getting the following error:<br><br>Unable to delete records:<br>["{\"error\":\"Record deletion failed: Java::ComMysqlJdbcExceptionsJdbc4::MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`archivesspace`.`archival_object`, CONSTRAINT `archival_object_ibfk_5` FOREIGN KEY (`parent_id`) REFERENCES `archival_object` (`id`))\"}\n"] [/repositories/2/resources/5]<br><br>Any suggestions for how to proceed? I'm unable to delete the repository because of these records.<br><br></blockquote><br></div><div>Have you upgraded to v1.0.9 yet ? </div><div><br></div><div>This bug was on the list fixed in the latest release:</div><br><div><ul style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);"><li>FEATURE <a href="http://www.pivotaltracker.com/story/show/67289478">#67289478</a>: Resources do not delete on cascade in MySQL</li></ul><div><br></div></div><div>— Steve Majewski</div><div><br></div><div><br></div><div><div>Begin forwarded message:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin: 0px;"><b>From: </b>Chris Fitzpatrick <<a href="mailto:Chris.Fitzpatrick@lyrasis.org">Chris.Fitzpatrick@lyrasis.org</a>><br></div><div style="margin: 0px;"><b>Subject: </b><b>Re: [Archivesspace_Users_Group] Can't delete guide under mysql: foreign key constraint.</b><br></div><div style="margin: 0px;"><b>Date: </b>March 11, 2014 at 5:39:34 AM EDT<br></div><div style="margin: 0px;"><b>To: </b>Archivesspace Users Group <<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org">archivesspace_users_group@lyralists.lyrasis.org</a>><br></div><div style="margin: 0px;"><b>Reply-To: </b>Archivesspace Users Group <<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org">archivesspace_users_group@lyralists.lyrasis.org</a>><br></div><br><div><div style="font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif; position: static; z-index: auto;"><div style="margin-top: 0px; margin-bottom: 0px;">Hi Steven,</div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">Thanks for this. This is indeed a bug, I've replicated this,  and I have made a ticket​ here =><br></div><div style="margin-top: 0px; margin-bottom: 0px;"><a href="https://www.pivotaltracker.com/story/show/67289478">https://www.pivotaltracker.com/story/show/67289478</a><br></div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">MySQL needs to be explicitly told to perform a cascade delete, so that all the children are deleted with the parent. This slipped through because the test suite runs on derby. Will get a fix in for this for an upcoming release...<br></div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">The work around now is to delete the children first then the parent. <br></div><div style="margin-top: 0px; margin-bottom: 0px;">​Apologize about the inconvenience. <br></div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">Thanks again! very much appreciated. <br></div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">best, chris fitzpatrick <br></div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div class="BodyFragment"><font size="2">Chris Fitzpatrick | <a href="mailto:chris.fitzpatrick@lyrasis.org">chris.fitzpatrick@lyrasis.org</a><br>Developer, ArchivesSpace<br><a href="http://archivesspace.org/">http://archivesspace.org/</a></font></div></div></div></div></blockquote></div></body></html>