/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

  1. class RemoveCiVariablesProjectIdIndex < ActiveRecord::Migration
  2. include Gitlab::Database::MigrationHelpers
  3. DOWNTIME = false
  4. disable_ddl_transaction!
  5. def up
  6. if index_exists?(:ci_variables, :project_id)
  7. remove_concurrent_index(:ci_variables, :project_id)
  8. end
  9. end
  10. def down
  11. unless index_exists?(:ci_variables, :project_id)
  12. add_concurrent_index(:ci_variables, :project_id)
  13. end
  14. end
  15. end