summaryrefslogtreecommitdiff
path: root/db/post_migrate/20220729033851_add_partial_legacy_open_source_license_available_index.rb
blob: c99c452c149c1b875697c1b817673d939344aef0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

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

  INDEX_NAME = 'index_project_settings_on_legacy_open_source_license_available'

  def up
    add_concurrent_index :project_settings,
                         %i[legacy_open_source_license_available],
                         where: "legacy_open_source_license_available = TRUE",
                         name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name(:project_settings, INDEX_NAME)
  end
end