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

20231029134824_remove_deployments_cluster_id.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 11ab9370ad2bdf10ccc191f4290bd383894549bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

class RemoveDeploymentsClusterId < Gitlab::Database::Migration[2.2]
  disable_ddl_transaction!
  milestone '16.7'

  def up
    with_lock_retries do
      remove_column :deployments, :cluster_id, if_exists: true
    end
  end

  def down
    with_lock_retries do
      add_column :deployments, :cluster_id, :integer, if_not_exists: true
    end

    add_concurrent_index(:deployments, [:cluster_id, :status])
  end
end