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

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

class AddTempIndexForSoftwareLicenseCleanup < Gitlab::Database::Migration[2.1]
  disable_ddl_transaction!

  INDEX_NAME = 'tmp_index_for_software_licenses_spdx_identifier_cleanup'

  def up
    add_concurrent_index :software_licenses, :spdx_identifier, where: 'spdx_identifier IS NULL', name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :software_licenses, INDEX_NAME
  end
end