<p></p>
<p><b>@AntonKhorev</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5207#discussion_r1758549692">db/migrate/20240912181413_backfill_user_creation_address.rb</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,11 @@
+class BackfillUserCreationAddress < ActiveRecord::Migration[7.1]
+ def up
+ User
</pre>
<p dir="auto">If you refer to a model from within a migration, there's a possibility that at some point in the future this model won't exist but you still want the migration to run. You can declare that model inside the migration, then the migration will work. Looks like we've been doing this for a while:</p>
<p dir="auto"><a href="https://github.com/openstreetmap/openstreetmap-website/blob/b81d645f0c6a78b944708005f188ba1a5ab6f4e7/db/migrate/20180204153242_tile_users.rb#L2-L3">https://github.com/openstreetmap/openstreetmap-website/blob/b81d645f0c6a78b944708005f188ba1a5ab6f4e7/db/migrate/20180204153242_tile_users.rb#L2-L3</a></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/5207#pullrequestreview-2302663216">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLP2TUITPRP5EX6WT6LZWKX4NAVCNFSM6AAAAABOD2XIGWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGMBSGY3DGMRRGY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLLAVJGJTMRW5B5H2WTZWKX4NA5CNFSM6AAAAABOD2XIGWWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTUJH7NDA.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/5207/review/2302663216</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/5207#pullrequestreview-2302663216",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5207#pullrequestreview-2302663216",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>