Welcome to mirror list, hosted at ThFree Co, Russian Federation.

fill_file_store_upload.rb « background_migration « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 203c3cea09fa76f60034b5f8cb1e6b794fce9ee8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true
# rubocop:disable Metrics/AbcSize
# rubocop:disable Style/Documentation

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

      def perform(start_id, stop_id)
        Gitlab::BackgroundMigration::FillFileStoreUpload::Upload
          .where('store is NULL')
          .where(id: (start_id..stop_id))
          .update_all(store: 1)
      end
    end
  end
end