summaryrefslogtreecommitdiff
path: root/db/post_migrate/20170717150329_enqueue_migrate_system_uploads_to_new_folder.rb
blob: 87069dce0062d80fe9f08742c40873f9946e3fc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class EnqueueMigrateSystemUploadsToNewFolder < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  OLD_FOLDER = 'uploads/system/'
  NEW_FOLDER = 'uploads/-/system/'

  disable_ddl_transaction!

  def up
    BackgroundMigrationWorker.perform_async('MigrateSystemUploadsToNewFolder',
                                            [OLD_FOLDER, NEW_FOLDER])
  end

  def down
    BackgroundMigrationWorker.perform_async('MigrateSystemUploadsToNewFolder',
                                            [NEW_FOLDER, OLD_FOLDER])
  end
end