Skip to content

Fix unique index on ci_build_pending_states

Max Orefice requested to merge morefice/fix-index-ci-build-pending-states into master

Ref: #382033 (closed)

What does this MR do and why?

Following up !106717 (merged) where we introduced an index for ci_build_pending_states.

We forgot to mark this index as unique. This MR fixes it by redefining a unique index for (partition_id, build_id).

Indexes:
    "ci_build_trace_chunks_pkey" PRIMARY KEY, btree (id)
    "index_ci_build_trace_chunks_on_build_id_and_chunk_index" UNIQUE, btree (build_id, chunk_index)
-   "index_ci_build_trace_chunks_on_partition_id_build_id" btree (partition_id, build_id)
+   "unique_index_ci_build_pending_states_on_partition_id_build_id" UNIQUE, btree (partition_id, build_id)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Max Orefice

Merge request reports