<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
ARGH — I’m realizing that it’s actually even more complicated than this, because if I were to just update the source IDs on the subjects table, I would get duplicate subject records. So really what I need to do is start by getting a list of subjects that are
 duplicated in all ways except for their source ids, determine which are the subject records with bad source ids, update the relationships table so that records are related to subjects with the good source information, THEN I can do the merges I want. But then,
 also, I have a bunch of orphan subjects that are unassociated with any records. James from HM wrote a handy script for us that zaps orphan subject records, so I suppose I could run that.
<div class=""><br class="">
</div>
<div class="">Maureen<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">Begin forwarded message:</div>
<br class="Apple-interchange-newline">
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class="">
<span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">From:
</b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">"Callahan, Maureen" <<a href="mailto:maureen.callahan@yale.edu" class="">maureen.callahan@yale.edu</a>><br class="">
</span></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class="">
<span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Subject:
</b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><b class="">Re: [Archivesspace_Users_Group] merge value error</b><br class="">
</span></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class="">
<span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Date:
</b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">June 10, 2015 at 11:27:33 AM EDT<br class="">
</span></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class="">
<span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">To:
</b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Archivesspace Users Group <<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org" class="">archivesspace_users_group@lyralists.lyrasis.org</a>><br class="">
</span></div>
<br class="">
<div class="">Hey Brian,<br class="">
<br class="">
Oh, that makes sense. Could you help me think through what I need to do here? I basically want to start by getting a list of identifiers for enumeration values that I’m trying to merge into a given value — say, all of the values that should become “aat”. Then,
 I identify all records in the subjects table with non-legit source ids. Then, I do an update in the subjects table where I update the bad source ids (identified in the previous step) with the one that I want. Once that’s done, I should be able to merge the
 source values from the interface.<br class="">
<br class="">
Is there an easier/safer way of doing this?<br class="">
<br class="">
Thanks,<br class="">
Maureen<br class="">
<br class="">
<blockquote type="cite" class="">On Jun 5, 2015, at 9:35 AM, Brian Hoffman <<a href="mailto:brianjhoffman@gmail.com" class="">brianjhoffman@gmail.com</a>> wrote:<br class="">
<br class="">
Hi Maureen,<br class="">
<br class="">
It kind of looks to me like you might have the following situation:<br class="">
<br class="">
Two subject records with identical terms but different “source” values. The controlled values you are trying to merge would result in those two subject records having identical “source” values, and as a result be identical, which violates a uniqueness constraint
 in the database. Does that seem possible? If so, could you find those subject records first and de-dupe them?<br class="">
<br class="">
Brian<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
On Jun 5, 2015, at 8:46 AM, Callahan, Maureen <<a href="mailto:maureen.callahan@yale.edu" class="">maureen.callahan@yale.edu</a>> wrote:<br class="">
<br class="">
<blockquote type="cite" class=""><mergeenums.txt><br class="">
</blockquote>
<br class="">
_______________________________________________<br class="">
Archivesspace_Users_Group mailing list<br class="">
<a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" class="">Archivesspace_Users_Group@lyralists.lyrasis.org</a><br class="">
https://urldefense.proofpoint.com/v2/url?u=http-3A__lyralists.lyrasis.org_mailman_listinfo_archivesspace-5Fusers-5Fgroup&d=AwIF-g&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=JgH2YCQ8D3P9-Lm_x4bv3d2CZBYlbx6hxnLFHtfovi8&m=dV_f9dLVb2pHqBsLSvZeWxpMEI58bKX9XCUnViWF3fk&s=mh0bb7LGZEk0NfeTHYSLy6KGsnRi847Ov_p21GRSkxc&e=
<br class="">
</blockquote>
<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>