[openstreetmap/openstreetmap-website] Backfill the creation_address column from creation_ip (PR #5207)

Anton Khorev notifications at github.com
Fri Sep 13 09:45:42 UTC 2024


@AntonKhorev commented on this pull request.



> @@ -0,0 +1,11 @@
+class BackfillUserCreationAddress < ActiveRecord::Migration[7.1]
+  def up
+    User

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:

https://github.com/openstreetmap/openstreetmap-website/blob/b81d645f0c6a78b944708005f188ba1a5ab6f4e7/db/migrate/20180204153242_tile_users.rb#L2-L3

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5207#pullrequestreview-2302663216
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5207/review/2302663216 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240913/f073d620/attachment-0001.htm>


More information about the rails-dev mailing list