PageRenderTime 20ms CodeModel.GetById 12ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/db/migrate/20170623080805_remove_ci_variables_project_id_index.rb

https://gitlab.com/visay/gitlab-ce
Ruby | 19 lines | 15 code | 4 blank | 0 comment | 1 complexity | ef2aa947a31f3ed2b69759886a42032a MD5 | raw file
 1class RemoveCiVariablesProjectIdIndex < ActiveRecord::Migration
 2  include Gitlab::Database::MigrationHelpers
 3
 4  DOWNTIME = false
 5
 6  disable_ddl_transaction!
 7
 8  def up
 9    if index_exists?(:ci_variables, :project_id)
10      remove_concurrent_index(:ci_variables, :project_id)
11    end
12  end
13
14  def down
15    unless index_exists?(:ci_variables, :project_id)
16      add_concurrent_index(:ci_variables, :project_id)
17    end
18  end
19end