Convert ci_build_trace_chunks.build_id to bigint - Step 2: Finalize background migrations and swap columns
With #328442 (closed) we have started the process of converting the foreign key from ci_build_trace_chunks that references ci_builds (ci_build_trace_chunks.build_id) to bigint (int8).
In this issue we'll address the second step of the process:
-
Clean up the background migrations
-
Drop the
DEFAULT 0from thebuild_id_convert_to_bigintcolumn -
Concurrently add any secondary indexes that include the
build_idcolumn"index_ci_build_trace_chunks_on_build_id_and_chunk_index" UNIQUE, btree (build_id, chunk_index) -
Single Transaction: Drop old FK, define new FK (as invalid), swap columns, validate FK
Edited by Yannis Roussos