From: Anton Khorev Date: Fri, 13 Sep 2024 10:16:27 +0000 (+0300) Subject: Merge branch 'pull/5207' X-Git-Tag: live~360 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/0423d18a8f5b232aa2a08b55351bee553047fb81?hp=e47187a8fb45c9372ad3a7422f96d357e087676d Merge branch 'pull/5207' --- diff --git a/db/migrate/20240912181413_backfill_user_creation_address.rb b/db/migrate/20240912181413_backfill_user_creation_address.rb new file mode 100644 index 000000000..3cc14f238 --- /dev/null +++ b/db/migrate/20240912181413_backfill_user_creation_address.rb @@ -0,0 +1,14 @@ +class BackfillUserCreationAddress < ActiveRecord::Migration[7.1] + class User < ApplicationRecord + end + + def up + User + .where(:creation_address => nil) + .where.not(:creation_ip => nil) + .in_batches(:of => 1000) + .update_all("creation_address = creation_ip::inet") + end + + def down; end +end diff --git a/db/structure.sql b/db/structure.sql index 9318185c6..60164558c 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -3357,6 +3357,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('23'), ('22'), ('21'), +('20240912181413'), ('20240910175616'), ('20240822121603'), ('20240813070506'),