<p></p>
<p><b>@gravitystorm</b> approved this pull request.</p>

<p dir="auto">Other than the enum suggestion (which can be left for later, it's not a blocker) then I'm happy with this. It's a shame that the logic has to go in as a database function, since that's harder to iterate/debug/lint etc, but I think it's a good solution.</p>
<p dir="auto">I'll leave this for <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tomhughes/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tomhughes">@tomhughes</a> to merge when he is ready, due to the operational considerations.</p><hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4319#discussion_r1394103269">config/initializers/migrate.rb</a>:</p>
<pre style='color:#555'>> @@ -51,6 +51,10 @@ def drop_enumeration(enumeration_name)
           execute "DROP TYPE #{enumeration_name}"
         end
 
+        def add_enumeration_value(enumeration_name, value)
</pre>
<p dir="auto">Rails 7.1 now has <code class="notranslate">add_enum_value</code> and supports this for the postgresql adapter.</p>
<ul dir="auto">
<li><a href="https://api.rubyonrails.org/v7.1.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html#method-i-add_enum_value" rel="nofollow">https://api.rubyonrails.org/v7.1.2/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html#method-i-add_enum_value</a></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1204835730" data-permission-text="Title is private" data-url="https://github.com/rails/rails/issues/44898" data-hovercard-type="pull_request" data-hovercard-url="/rails/rails/pull/44898/hovercard" href="https://github.com/rails/rails/pull/44898">rails/rails#44898</a></li>
</ul>
<p dir="auto">We could follow up with a separate PR to drop our other custom enum handling, since I think they are all built-in now.</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/pull/4319#pullrequestreview-1731880205">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLOUZAQBU2B65TJTPF3YESYTTAVCNFSM6AAAAAA6VBWHDWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOMZRHA4DAMRQGU">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLMPEA2XWLT4TW4ANVLYESYTTA5CNFSM6AAAAAA6VBWHDWWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTTHHJSQ2.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/4319/review/1731880205</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/4319#pullrequestreview-1731880205",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4319#pullrequestreview-1731880205",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>