Address the Primary Key Overflow risk for the taggings table - Step 2: Finalize background migrations and swap columns
With #329536 (closed) we have started the process of converting taggings.id
and taggings.taggable_id
to bigint
(int8
).
taggings.id
is the 7th table with the highest value for its PK (&4785 (closed)) and taggings.taggable_id
indirectly references ci_builds
(polymorphic association).
In this issue we'll address the second step of the process:
- Ensure the migration of
taggings.id
toid_convert_to_bigint
is completed. - Ensure the migration of
taggings.taggable_id
totaggable_id_convert_to_bigint
is completed. - Define any indexes over
taggings.id
andtaggings.taggable_id
for the new columns as well - Define a unique index over
taggings.id_convert_to_bigint
- Swap columns, drop existing PK, define new PK, swap sequences
The implementation should follow what we'll add for !64779 (merged), with only difference that we finalize and swap one additional column and there is no Foreign Key as this is a polymorphic association.
Edited by Yannis Roussos