diff --git a/app/sidekiq/kms_key_rotation/batch_initiator_job.rb b/app/sidekiq/kms_key_rotation/batch_initiator_job.rb index 752f657f6db..efc005537bd 100644 --- a/app/sidekiq/kms_key_rotation/batch_initiator_job.rb +++ b/app/sidekiq/kms_key_rotation/batch_initiator_job.rb @@ -45,6 +45,7 @@ def gids_for_model(model, max_records_per_batch) model .where.not('encrypted_kms_key LIKE ?', "v#{KmsEncryptedModelPatch.kms_version}:%") + .or(model.where(encrypted_kms_key: nil)) .limit(max_records_per_batch) .pluck(model.primary_key) .map { |id| URI::GID.build(app: GlobalID.app, model_name: model.name, model_id: id).to_s }