From 321e580eded961d4de1570d2dd24e8140b0e1b77 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Fri, 18 May 2018 17:04:05 +0900 Subject: [PATCH] Rename FillFileStoreUpload to FillStoreUpload --- db/post_migrate/20180424151928_fill_file_store.rb | 3 ++- .../{fill_file_store_upload.rb => fill_store_upload.rb} | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) rename lib/gitlab/background_migration/{fill_file_store_upload.rb => fill_store_upload.rb} (82%) diff --git a/db/post_migrate/20180424151928_fill_file_store.rb b/db/post_migrate/20180424151928_fill_file_store.rb index e950d78e1dd..bb7d0978efe 100644 --- a/db/post_migrate/20180424151928_fill_file_store.rb +++ b/db/post_migrate/20180424151928_fill_file_store.rb @@ -28,10 +28,11 @@ class FillFileStore < ActiveRecord::Migration class Upload < ActiveRecord::Base include EachBatch self.table_name = 'uploads' + self.inheritance_column = :_type_disabled # Disable STI BATCH_SIZE = 10_000 def self.params_for_background_migration - yield self.where(store: nil), 'FillFileStoreUpload', 5.minutes, BATCH_SIZE + yield self.where(store: nil), 'FillStoreUpload', 5.minutes, BATCH_SIZE end end diff --git a/lib/gitlab/background_migration/fill_file_store_upload.rb b/lib/gitlab/background_migration/fill_store_upload.rb similarity index 82% rename from lib/gitlab/background_migration/fill_file_store_upload.rb rename to lib/gitlab/background_migration/fill_store_upload.rb index 203c3cea09f..669a9351fb4 100644 --- a/lib/gitlab/background_migration/fill_file_store_upload.rb +++ b/lib/gitlab/background_migration/fill_store_upload.rb @@ -4,14 +4,14 @@ module Gitlab module BackgroundMigration - class FillFileStoreUpload + class FillStoreUpload class Upload < ActiveRecord::Base self.table_name = 'uploads' self.inheritance_column = :_type_disabled end def perform(start_id, stop_id) - Gitlab::BackgroundMigration::FillFileStoreUpload::Upload + Gitlab::BackgroundMigration::FillStoreUpload::Upload .where('store is NULL') .where(id: (start_id..stop_id)) .update_all(store: 1) -- GitLab