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

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

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

  INDEX = 'pages_deployments_deleted_at_index'
  COLUMNS = [:id, :project_id, :path_prefix]

  def up
    add_concurrent_index :pages_deployments,
      COLUMNS,
      where: 'deleted_at IS NULL',
      name: INDEX
  end

  def down
    remove_concurrent_index :pages_deployments, COLUMNS, name: INDEX
  end
end