]> git.openstreetmap.org Git - rails.git/blob - db/migrate/20240912181413_backfill_user_creation_address.rb
Add frozen_string_literal comments to ruby files
[rails.git] / db / migrate / 20240912181413_backfill_user_creation_address.rb
1 # frozen_string_literal: true
2
3 class BackfillUserCreationAddress < ActiveRecord::Migration[7.1]
4   class User < ApplicationRecord
5   end
6
7   def up
8     User
9       .where(:creation_address => nil)
10       .where.not(:creation_ip => nil)
11       .in_batches(:of => 1000)
12       .update_all("creation_address = creation_ip::inet")
13   end
14
15   def down; end
16 end