<h3 dir="auto">Description</h3>
<p dir="auto">PR adds migration script for copying notes descriptions, user_ids and user_ips from notes first comments to notes table records. In 2 commits we propose 2 variants of migration script (not sure which is more appropriate for the situation because of large number of notes):</p>
<ol dir="auto">
<li>basic version - for every <code class="notranslate">batch of notes</code>, dynamically generates SQL query for copying values and executes it (simpler to understand, ..).</li>
<li>enhanced version - same as previous but keeps track about notes for which migration failed (for some reason?) and retries again later (more robust, ..)</li>
</ol>
<h3 dir="auto">How has this been tested?</h3>
<p dir="auto">Automated and manual tests before and after data migrations (both basic and enhanced one)</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/5667'>https://github.com/openstreetmap/openstreetmap-website/pull/5667</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5667/commits/e570b884c1a376cd3a14eded523cac70dad9c22d" class="commit-link">e570b88</a>  Copies description, user_id and user_ip to notes</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5667/commits/757e22a1d37b83b1e5bb2ae6da390dcf4e1d002e" class="commit-link">757e22a</a>  Enhance backfill migration script with logging, retries, and conversion fixes</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5667/files">2 files</a>)</p>
<ul>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5667/files#diff-deb1ff6905055b3d04378e5e354b9c3bba7eff93ed6a1749196cd403103b6919">db/migrate/20250212160355_backfill_note_descriptions.rb</a>
    (169)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5667/files#diff-1dd5a8f580b9615769ddc19a64a98f455d9d20eb149c443f41d9d3c797d39b12">db/structure.sql</a>
    (1)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5667.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5667.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5667.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5667.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5667">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJ3ZXL6FZEFLG7EEWD2PS2EVAVCNFSM6AAAAABXCOPTA2VHI2DSMVQWIX3LMV43ASLTON2WKOZSHA2TCMZXGI2DAMY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLLHS5CRHF7ZDIH23DL2PS2EVA5CNFSM6AAAAABXCOPTA2WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHKT5D5OM.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5667</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5667",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5667",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>