Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20221117135032_remove_clusters_applications_job_instances.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 80cd00e77374b902baa1bb056dbbacb29a98613e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true

class RemoveClustersApplicationsJobInstances < Gitlab::Database::Migration[2.0]
  DEPRECATED_JOB_CLASSES = %w[
    ClusterConfigureIstioWorker
    ClusterInstallAppWorker
    ClusterPatchAppWorker
    ClusterUpdateAppWorker
    ClusterUpgradeAppWorker
    ClusterWaitForAppInstallationWorker
    ClusterWaitForAppUpdateWorker
    ClusterWaitForIngressIpAddressWorker
  ]

  disable_ddl_transaction!

  def up
    sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES)
  end

  def down
    # no-op Why: This migration removes any instances of deprecated job classes
    # from expected queues via the sidekiq_queue_length method. Once the job
    # class instances are removed, they cannot be added back. These job classes
    # are deprecated and previous MRs have already no-op'd their perform
    # methods to further increase confidence that removal is OK.
  end
end