<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        color:black;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">Hi Clinton,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">There's two answers here: the right one (full of good practice), and the correct answer to your actual question.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">The 'best practice' and 'right' answer is:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">Do these things via the API.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">If you want to write a script that e.g. read pairs of EPrintIDs / pagination data, it's not that difficult. Once you've done it a few times, it becomes much easier.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">For your situation, I'd probably use a hash of EPrintIDs to pagination data, and iterate over that.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">You then get revision info, and automatically updated abstract pages for free.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">If you write a standalone script to do this, the revision data (in the history table) will also include the information about the script that caused the changes (this can be useful),
so call the script something sensible that might mean something to someone else in the future!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">The correct answer is:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">If your changes are to a field that in no way has any calculated outcomes (e.g. changing a document 'security' flag may require the owning eprint's 'fulltext_status' field to be changed),
then executing the SQL, and then regenerating the abstract pages (and views) etc. isn't a 'broken' option (this is how I used to do things, until I learnt to do them properly!).
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">The main thing that you have (probably) overlooked is how the data gets from the eprint table into the ordervalues / rindex tables. This is a 'calculated outcome' (I learnt this the
hard way).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">If you are a little unsure about writing a script like this, maybe post a gist on GitHub and ask for comments here?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US">John<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
<b>On Behalf Of </b>Graham, Clinton T<br>
<b>Sent:</b> 20 March 2017 14:24<br>
<b>To:</b> Eprints Tech Mailing List <eprints-tech@ecs.soton.ac.uk><br>
<b>Subject:</b> [EP-tech] Direct SQL updates for eprint records?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:"Tahoma",sans-serif;color:black">We have found a set of pagination errors in our records. Can someone clarify the implications of directly updating the records via SQL
vs. writing a script to use the EPrints API to make the updates, including creating revisions?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Tahoma",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Tahoma",sans-serif">Executing some SQL directly to fix these errors would be a trivial operation, but is a record of this change required as a revision on the filesystem? Or can "known good" non-revisioned
changes be made ad-hoc without concern?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Tahoma",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Tahoma",sans-serif">Enjoy,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Tahoma",sans-serif"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Tahoma",sans-serif;color:black">- Clinton Graham<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Tahoma",sans-serif;color:black">Systems Developer<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Tahoma",sans-serif;color:black">University of Pittsburgh | University Library System<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Tahoma",sans-serif;color:black">412-383-1057<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="color:black"><o:p> </o:p></span></p>
</div>
</body>
</html>