Commit 321e580e authored by Shinya Maeda's avatar Shinya Maeda

Rename FillFileStoreUpload to FillStoreUpload

parent 26b3816d
...@@ -28,10 +28,11 @@ class FillFileStore < ActiveRecord::Migration ...@@ -28,10 +28,11 @@ class FillFileStore < ActiveRecord::Migration
class Upload < ActiveRecord::Base class Upload < ActiveRecord::Base
include EachBatch include EachBatch
self.table_name = 'uploads' self.table_name = 'uploads'
self.inheritance_column = :_type_disabled # Disable STI
BATCH_SIZE = 10_000 BATCH_SIZE = 10_000
def self.params_for_background_migration 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
end end
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
module Gitlab module Gitlab
module BackgroundMigration module BackgroundMigration
class FillFileStoreUpload class FillStoreUpload
class Upload < ActiveRecord::Base class Upload < ActiveRecord::Base
self.table_name = 'uploads' self.table_name = 'uploads'
self.inheritance_column = :_type_disabled self.inheritance_column = :_type_disabled
end end
def perform(start_id, stop_id) def perform(start_id, stop_id)
Gitlab::BackgroundMigration::FillFileStoreUpload::Upload Gitlab::BackgroundMigration::FillStoreUpload::Upload
.where('store is NULL') .where('store is NULL')
.where(id: (start_id..stop_id)) .where(id: (start_id..stop_id))
.update_all(store: 1) .update_all(store: 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment