<p dir="auto">Part two of  <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2610276342" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5283" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/5283/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/5283">#5283</a>.</p>
<p dir="auto">Creates a subscription for every note commented by a non-anonymous user. Does this by:</p>
<ul dir="auto">
<li>iterating through batches of note comments</li>
<li>getting distinct non-null (user, note) pairs</li>
<li>inserting these pairs using <code class="notranslate">upsert_all</code>, this skips already existing pairs</li>
</ul>

<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/5304'>https://github.com/openstreetmap/openstreetmap-website/pull/5304</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5304/commits/e1d3074c9a79200123a6247a0f04b0239baf07aa" class="commit-link">e1d3074</a>  Backfill note subscriptions</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5304/files">2 files</a>)</p>
<ul>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5304/files#diff-9152b047fbb43379babec68f31f527b74a30affdb655f7ef371dd5f1ace56121">db/migrate/20241023004427_backfill_note_subscriptions.rb</a>
    (14)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5304/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/5304.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5304.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5304.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5304.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/5304">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPSI43TWQH6H6HRZ3DZ7HVFXAVCNFSM6AAAAABRIPZOLSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYZTONRVGI3DIMY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLP5FBUGHDSIOJKPDP3Z7HVFXA5CNFSM6AAAAABRIPZOLSWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHJ2N3CUM.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/5304</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/5304",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5304",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>