debian-mirror-gitlab/db/migrate/20200528125905_add_project_id_user_id_status_ref_index_to_ci_pipelines.rb
2020-06-23 00:09:42 +05:30

28 lines
579 B
Ruby

# frozen_string_literal: true
class AddProjectIdUserIdStatusRefIndexToCiPipelines < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
SOURCE_PARENT_PIPELINE = 12
def up
add_concurrent_index(
:ci_pipelines,
[:project_id, :user_id, :status, :ref],
where: "source != #{SOURCE_PARENT_PIPELINE}"
)
end
def down
remove_concurrent_index(
:ci_pipelines,
[:project_id, :user_id, :status, :ref],
where: "source != #{SOURCE_PARENT_PIPELINE}"
)
end
end