Skip to content

Prepare ci_builds_metadata for int8 migration

Andreas Brandl requested to merge ab/int8_ci_builds_metadata into master

What does this MR do?

This prepares to migrate ci_builds_metadata.id to int8. See #325616 (closed).

Migration: Up

== 20210519132109 InitializeConversionOfCiBuildsMetadataToBigint: migrating ===
-- table_exists?(:ci_builds_metadata)
   -> 0.0010s
-- column_exists?(:ci_builds_metadata, :id)
   -> 0.0011s
-- column_exists?(:ci_builds_metadata, :build_id)
   -> 0.0007s
-- columns(:ci_builds_metadata)
   -> 0.0008s
-- add_column(:ci_builds_metadata, "build_id_convert_to_bigint", :bigint, {:default=>0, :null=>false})
   -> 0.0011s
== 20210519132109 InitializeConversionOfCiBuildsMetadataToBigint: migrated (0.0120s) 

== 20210519132129 BackfillCiBuildsMetadataForBigintConversion: migrating ======
-- table_exists?(:ci_builds_metadata)
   -> 0.0010s
-- column_exists?(:ci_builds_metadata, :id)
   -> 0.0011s
-- column_exists?(:ci_builds_metadata, :build_id)
   -> 0.0008s
-- column_exists?(:ci_builds_metadata, "build_id_convert_to_bigint")
   -> 0.0007s
unknown OID 28: failed to recognize type of 'relfrozenxid'. It will be treated as String.
unknown OID 1034: failed to recognize type of 'relacl'. It will be treated as String.
unknown OID 194: failed to recognize type of 'relpartbound'. It will be treated as String.
== 20210519132129 BackfillCiBuildsMetadataForBigintConversion: migrated (0.0406s) 

Migration: Down

== 20210519132129 BackfillCiBuildsMetadataForBigintConversion: reverting ======
-- execute("DELETE FROM batched_background_migrations WHERE job_class_name = 'CopyColumnUsingBackgroundMigrationJob' AND table_name = 'ci_builds_metadata' AND column_name = 'id' AND job_arguments = '[[\"build_id\"],[\"build_id_convert_to_bigint\"]]'")
   -> 0.0016s
== 20210519132129 BackfillCiBuildsMetadataForBigintConversion: reverted (0.0018s) 

== 20210519132109 InitializeConversionOfCiBuildsMetadataToBigint: reverting ===
-- remove_column(:ci_builds_metadata, "build_id_convert_to_bigint")
   -> 0.0008s
== 20210519132109 InitializeConversionOfCiBuildsMetadataToBigint: reverted (0.0034s) 

Does this MR meet the acceptance criteria?

Conformity

Edited by Andreas Brandl

Merge request reports

Loading