diff options
author | Stan Hu <stanhu@gmail.com> | 2019-06-09 15:56:11 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-06-09 15:56:11 +0300 |
commit | b7e3a1e0409d88c86bf67797749b507a3d480c59 (patch) | |
tree | 3b8774ba169415b9fe58449635697dbddb165051 /db | |
parent | 2a01cb79560a861a7e32e9ee11e823f22e181aa1 (diff) |
Revert "Merge branch '50070-legacy-attachments' into 'master'"
This reverts commit fd19f887dfeeeedb483c4a4fb32f9f768e89389c, reversing
changes made to abb2d4c601d796339c8d7cb0c00946696730f198.
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20190114184258_migrate_legacy_attachments.rb | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/db/migrate/20190114184258_migrate_legacy_attachments.rb b/db/migrate/20190114184258_migrate_legacy_attachments.rb deleted file mode 100644 index e9fb7952dc9..00000000000 --- a/db/migrate/20190114184258_migrate_legacy_attachments.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class MigrateLegacyAttachments < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - MIGRATION = 'MigrateLegacyUploads'.freeze - BATCH_SIZE = 5000 - DELAY_INTERVAL = 5.minutes.to_i - - class Upload < ActiveRecord::Base - self.table_name = 'uploads' - - include ::EachBatch - end - - def up - Upload.where(uploader: 'AttachmentUploader').each_batch(of: BATCH_SIZE) do |relation, index| - start_id, end_id = relation.pluck('MIN(id), MAX(id)').first - delay = index * DELAY_INTERVAL - - BackgroundMigrationWorker.perform_in(delay, MIGRATION, [start_id, end_id]) - end - end - - # not needed - def down - end -end |