<p></p>
<p dir="auto">The note versions table could look like this:</p>
<div class="highlight highlight-source-sql" dir="auto"><pre class="notranslate">... (
    note_id <span class="pl-k">bigint</span> <span class="pl-k">NOT NULL</span>,
    version <span class="pl-k">bigint</span> <span class="pl-k">NOT NULL</span>,
    status <span class="pl-c1">public</span>.<span class="pl-c1">note_status_enum</span> <span class="pl-k">NOT NULL</span>,
    <span class="pl-s"><span class="pl-pds">"</span>timestamp<span class="pl-pds">"</span></span> <span class="pl-k">timestamp without time zone</span> <span class="pl-k">NOT NULL</span>, <span class="pl-c"><span class="pl-c">--</span> more standard name would be created_at but that could be mixed up with the note creation timestamp</span>
    latitude <span class="pl-k">integer</span> <span class="pl-k">NOT NULL</span>,
    longitude <span class="pl-k">integer</span> <span class="pl-k">NOT NULL</span>,
    tile <span class="pl-k">bigint</span> <span class="pl-k">NOT NULL</span>,
    user_id <span class="pl-k">bigint</span> <span class="pl-k">NOT NULL</span>, <span class="pl-c"><span class="pl-c">--</span> I guess we're not going to call this "author", that won't sound right for non-initial versions</span>
    user_ip <span class="pl-k">inet</span>, <span class="pl-c"><span class="pl-c">--</span> if we keep anonymous notes</span>
    ...
)</pre></div>
<p dir="auto">We also need to choose between</p>
<div class="highlight highlight-source-sql" dir="auto"><pre class="notranslate">    visible <span class="pl-k">boolean</span> <span class="pl-k">NOT NULL</span>,</pre></div>
<p dir="auto">and</p>
<div class="highlight highlight-source-sql" dir="auto"><pre class="notranslate">    redaction_id <span class="pl-k">integer</span></pre></div>
<p dir="auto">depending on whether we want to use redactions for hiding note version.</p>
<p dir="auto">If we want the versions table to be similar to element versions, its primary key should be <code class="notranslate">(note_id, version)</code>. But that surrogate <code class="notranslate">id</code> from <code class="notranslate">note_comments</code> is useful for sorting by last update, see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2150369576" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/4532" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/4532/hovercard?comment_id=1992379385&comment_type=issue_comment" href="https://github.com/openstreetmap/openstreetmap-website/pull/4532#issuecomment-1992379385">#4532 (comment)</a>. I'd like to keep it on the versions table in addition to the comments table. Element version tables don't have it, but I'd like them have it too, see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2231167073" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/4660" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/4660/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/4660">#4660</a>, but I'm afraid of that being a migration that is too large.</p>

<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/issues/5294#issuecomment-2541604426">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJ2BVT4PRFFLQBNGUT2FLWU5AVCNFSM6AAAAABQ2HD3MWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBRGYYDINBSGY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPEIYOH4VNPOFYMJOT2FLWU5A5CNFSM6AAAAABQ2HD3MWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUXPXHEU.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/issues/5294/2541604426</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/issues/5294#issuecomment-2541604426",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/5294#issuecomment-2541604426",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>