summaryrefslogtreecommitdiff
path: root/lib/gitlab/background_migration/migrate_null_private_profile_to_false.rb
blob: 32ed6a2756d4ca75fd8564176399a1c5febaabd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module Gitlab
  module BackgroundMigration
    # This class is responsible for migrating a range of users with private_profile == NULL to false
    class MigrateNullPrivateProfileToFalse
      # Temporary AR class for users
      class User < ActiveRecord::Base
        self.table_name = 'users'
      end

      def perform(start_id, stop_id)
        User.where(private_profile: nil, id: start_id..stop_id).update_all(private_profile: false)
      end
    end
  end
end