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

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

class AddPartialLegacyOpenSourceLicenseAvailableProjectIdIndex < Gitlab::Database::Migration[2.0]
  disable_ddl_transaction!

  INDEX_NAME = 'index_project_settings_on_legacy_os_license_project_id'

  def up
    add_concurrent_index :project_settings,
                         :project_id,
                         where: "legacy_open_source_license_available = TRUE",
                         name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name(:project_settings, INDEX_NAME)
  end
end