Commit ca986885 authored by Adam Hegyi's avatar Adam Hegyi

Merge branch 'ab/ci-builds-pending-partial-covering' into 'master'

Disable statement timeout explicitly

See merge request gitlab-org/gitlab!61034
parents 06c9f530 5763925f
......@@ -9,13 +9,16 @@ class CreatePartialCoveringIndexForPendingBuilds < ActiveRecord::Migration[6.0]
NEW_INDEX = 'index_ci_builds_runner_id_pending_covering'
def up
execute "CREATE INDEX CONCURRENTLY #{NEW_INDEX} ON ci_builds (runner_id, id) INCLUDE (project_id) WHERE status = 'pending' AND type = 'Ci::Build'" unless index_exists_by_name?(:ci_builds, NEW_INDEX)
disable_statement_timeout do
execute "CREATE INDEX CONCURRENTLY #{NEW_INDEX} ON ci_builds (runner_id, id) INCLUDE (project_id) WHERE status = 'pending' AND type = 'Ci::Build'" unless index_exists_by_name?(:ci_builds, NEW_INDEX)
end
remove_concurrent_index_by_name :ci_builds, EXISTING_INDEX
end
def down
add_concurrent_index :ci_builds, :runner_id, where: "status = 'pending' AND type = 'Ci::Build'", name: EXISTING_INDEX
remove_concurrent_index_by_name :ci_builds, NEW_INDEX
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment