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

20180629191052_add_partial_index_to_projects_for_last_repository_check_at.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a701d3678db596ea9b7e611464d2408a5ad4886f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class AddPartialIndexToProjectsForLastRepositoryCheckAt < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  # Set this constant to true if this migration requires downtime.
  DOWNTIME = false

  disable_ddl_transaction!

  INDEX_NAME = "index_projects_on_last_repository_check_at"

  def up
    add_concurrent_index(:projects, :last_repository_check_at, where: "last_repository_check_at IS NOT NULL", name: INDEX_NAME)
  end

  def down
    remove_concurrent_index(:projects, :last_repository_check_at, where: "last_repository_check_at IS NOT NULL", name: INDEX_NAME)
  end
end