debian-mirror-gitlab/db/migrate/20200528125905_add_project_id_user_id_status_ref_index_to_ci_pipelines.rb

28 lines
579 B
Ruby
Raw Normal View History

2020-06-23 00:09:42 +05:30
# 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