Convert ci_build_needs.build_id to bigint - Step 2: Finalize background migrations and swap columns
With #328044 (closed) we have started the process of converting the foreign key from ci_build_needs
that references ci_builds
(ci_build_needs.build_id
) to bigint
(int8
).
In this issue we'll address the second step of the process for ci_build_needs
:
- Ensure background migrations are competed.
- Create indexes and FKs using the new columns.
- In a single transaction, swap columns:
- Swap column names
- Update rename trigger function
- Swap defaults
- Swap PK constraint
- Rename the rest of the indexes
- Rename FKs
Additional required steps once the switch is done:
- Remove rename triggers
- Remove
integer
columns - Remove the temporary columns from the
IMPORT_EXPORT_CONFIG: lib/gitlab/import_export/project/import_export.yml
(related comment in the MR that introduced the change) - Remove the temporary columns from ignored columns
Edited by Krasimir Angelov