summaryrefslogtreecommitdiff
path: root/lib/gitlab/background_migration/fill_store_upload.rb
blob: cba3e21cea6a6f2431135bd70c705819b1b0a911 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true
# rubocop:disable Style/Documentation

module Gitlab
  module BackgroundMigration
    class FillStoreUpload
      class Upload < ActiveRecord::Base
        self.table_name = 'uploads'
        self.inheritance_column = :_type_disabled
      end

      def perform(start_id, stop_id)
        FillStoreUpload::Upload
          .where(store: nil)
          .where(id: (start_id..stop_id))
          .update_all(store: 1)
      end
    end
  end
end