Skip to content
Snippets Groups Projects

Finalize ci_job_artifacts conversion to bigint

Merged Alex Ives requested to merge 325615/finalize_ci_job_artifacts_bigint into master
1 file
+ 5
3
Compare changes
  • Side-by-side
  • Inline
@@ -105,9 +105,11 @@ def swap
# Change the name of the temporary FK for project_pages_metadata(artifacts_archive_id) -> id
rename_constraint(:project_pages_metadata, fk_artifacts_archive_id_tmp, fk_artifacts_archive_id)
# Change the name of the old FK (will be dropped when old index is updated)
rename_constraint(TABLE_NAME, fk_ci_builds_job_id, "#{fk_ci_builds_job_id}_old_id")
# Change the name of the temporary FK for job_id -> ci_builds(id)
# Drop original FK on the old int4 `job_id` (fk_rails_c5137cb2c1)
remove_foreign_key TABLE_NAME, name: fk_ci_builds_job_id
# We swapped the columns but the FK for job_id is still using the temporary name for the job_id_convert_to_bigint column
# So we have to also swap the FK name now that we dropped the other one with the same
rename_constraint(TABLE_NAME, fk_ci_builds_job_id_tmp, fk_ci_builds_job_id)
end
end
Loading