summaryrefslogtreecommitdiff
path: root/db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb
blob: 81903230f43330f5a176c13dcd037ab14f95ff86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class AddIndexToComplianceManagementFrameworksPipelineConfiguration < ActiveRecord::Migration[6.1]
  include Gitlab::Database::MigrationHelpers

  disable_ddl_transaction!

  INDEX_NAME = 'index_compliance_frameworks_id_where_frameworks_not_null'

  def up
    add_concurrent_index :compliance_management_frameworks, :id, name: INDEX_NAME, where: 'pipeline_configuration_full_path IS NOT NULL'
  end

  def down
    remove_concurrent_index_by_name :compliance_management_frameworks, INDEX_NAME
  end
end