debian-mirror-gitlab/db/post_migrate/20211210140629_encrypt_static_object_token.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
508 B
Ruby
Raw Normal View History

2022-03-02 08:16:31 +05:30
# frozen_string_literal: true
class EncryptStaticObjectToken < Gitlab::Database::Migration[1.0]
BATCH_SIZE = 10_000
MIGRATION = 'EncryptStaticObjectToken'
disable_ddl_transaction!
def up
queue_background_migration_jobs_by_range_at_intervals(
define_batchable_model('users').where.not(static_object_token: nil).where(static_object_token_encrypted: nil),
MIGRATION,
2.minutes,
batch_size: BATCH_SIZE,
track_jobs: true
)
end
def down
# no ops
end
end