Swapping bigint columns for DeploymentClusters

What does this MR do and why?

This code implements a database migration to upgrade the deployment_clusters table by converting ID columns from 32-bit integers to 64-bit integers (bigint). This change prevents potential overflow issues as the database grows larger.

The migration happens in three coordinated steps: first validating that the new bigint columns work correctly with foreign key relationships, then swapping the old integer columns with the new bigint columns (including updating indexes and constraints), and finally cleaning up temporary structures that were created during the conversion process.

This is a common maintenance operation for large databases to ensure they can handle more data without running into size limitations. The migration includes safety checks to prevent data corruption and can be rolled back if needed.

References

Here's a diff of my local env (simulated to match prod) before and after the migrations

https://www.diffchecker.com/Ynpu7cmw/

https://docs.gitlab.com/development/database/avoiding_downtime_in_migrations/#swap-the-columns-release-n--1

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #581429 (closed)

Edited by Max Fan

Merge request reports

Loading