<p></p>
<p dir="auto">For the <code class="notranslate">timestamp(6)</code> on <code class="notranslate">ar_internal_metadata</code>, the structure.sql should continue to use <code class="notranslate">timestamp(6)</code>.</p>
<p dir="auto">This is because for rails 6.0+, timestamp(6) is the default for timestamp columns. (<a href="https://github.com/rails/rails/blob/87c42b2c4f0cd287323eae4c3e0e2f47a7635585/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb#L1824">default</a> vs <a href="https://github.com/rails/rails/blob/87c42b2c4f0cd287323eae4c3e0e2f47a7635585/activerecord/lib/active_record/migration/compatibility.rb#L255-L258">override for old versions</a>) All of our migrations are correctly labelled with which AR version to use, so tables before that are defined with <code class="notranslate">timestamp</code>, tables after that with <code class="notranslate">timestamp(6)</code>.</p>
<p dir="auto">The edge case is that <code class="notranslate">ar_internal_metadata</code> table is not controlled, so gets the defaults at the moment it was created, which varies from system to system. On my laptop that was before rails 6, so I have <code class="notranslate">timestamp</code>. Any developer who first ran the code after <a href="https://github.com/openstreetmap/openstreetmap-website/commit/22cd2314e52373d8fbe84a082c3ed058dfea8d40">November 2019</a> will have <code class="notranslate">timestamp(6)</code>.</p>
<p dir="auto">I've updated my development machine, by running:</p>
<pre class="notranslate"><code class="notranslate">alter table ar_internal_metadata alter column created_at set data type timestamp(6) without time zone;
alter table ar_internal_metadata alter column updated_at set data type timestamp(6) without time zone;
</code></pre>
<p dir="auto">I would encourage any other veteran developers to run the same update, to avoid noise when working on database migrations.</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/4298#issuecomment-1832194246">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPZ4VT33TJQRTQEZ6LYG5LZHAVCNFSM6AAAAAA6FVRJH6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZSGE4TIMRUGY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPPMSRXODII2MHD5M3YG5LZHA5CNFSM6AAAAAA6FVRJH6WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTNGUIMM.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/4298/1832194246</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/4298#issuecomment-1832194246",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/4298#issuecomment-1832194246",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>