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

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

class DropOperationsFeatureFlagsClientsToken < ActiveRecord::Migration[5.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    # Ignored in 12.5 - https://gitlab.com/gitlab-org/gitlab/merge_requests/18923
    remove_column :operations_feature_flags_clients, :token
  end

  def down
    unless column_exists?(:operations_feature_flags_clients, :token)
      add_column :operations_feature_flags_clients, :token, :string # rubocop:disable Migration/AddLimitToStringColumns
    end

    add_concurrent_index :operations_feature_flags_clients, [:project_id, :token], unique: true,
      name: 'index_operations_feature_flags_clients_on_project_id_and_token'
  end
end