Skip to content

Prepare async indexes for ci table int8 swaps

What does this MR do?

See #325617 (closed) and #325619 (closed)

Migration up
$ rails db:migrate:up VERSION=20210824174615
== 20210824174615 PrepareCiBuildsMetadataAndCiBuildAsyncIndexes: migrating ====
-- index_exists?(:ci_builds_metadata, :id_convert_to_bigint, {:unique=>true, :name=>:index_ci_builds_metadata_on_id_convert_to_bigint, :algorithm=>:concurrently})
   -> 0.0030s
-- add_index_options(:ci_builds_metadata, :id_convert_to_bigint, {:unique=>true, :name=>:index_ci_builds_metadata_on_id_convert_to_bigint, :algorithm=>:concurrently})
   -> 0.0000s
-- index_exists?(:ci_builds_metadata, :build_id_convert_to_bigint, {:unique=>true, :name=>:index_ci_builds_metadata_on_build_id_convert_to_bigint, :algorithm=>:concurrently})
   -> 0.0020s
-- add_index_options(:ci_builds_metadata, :build_id_convert_to_bigint, {:unique=>true, :name=>:index_ci_builds_metadata_on_build_id_convert_to_bigint, :algorithm=>:concurrently})
   -> 0.0000s
-- index_exists?(:ci_builds_metadata, :build_id_convert_to_bigint, {:where=>"has_exposed_artifacts IS TRUE", :name=>:index_ci_builds_metadata_on_build_id_int8_and_exposed_artifacts, :algorithm=>:concurrently})
   -> 0.0017s
-- add_index_options(:ci_builds_metadata, :build_id_convert_to_bigint, {:where=>"has_exposed_artifacts IS TRUE", :name=>:index_ci_builds_metadata_on_build_id_int8_and_exposed_artifacts, :algorithm=>:concurrently})
   -> 0.0000s
-- index_name_exists?(:ci_builds_metadata, :index_ci_builds_metadata_on_build_id_int8_where_interruptible)
   -> 0.0007s
-- index_exists?(:ci_builds, :id_convert_to_bigint, {:unique=>true, :name=>:index_ci_builds_on_converted_id, :algorithm=>:concurrently})
   -> 0.0084s
-- add_index_options(:ci_builds, :id_convert_to_bigint, {:unique=>true, :name=>:index_ci_builds_on_converted_id, :algorithm=>:concurrently})
   -> 0.0000s
== 20210824174615 PrepareCiBuildsMetadataAndCiBuildAsyncIndexes: migrated (0.0578s)
Migration down
$ rails db:migrate:down VERSION=20210824174615
== 20210824174615 PrepareCiBuildsMetadataAndCiBuildAsyncIndexes: reverting ====
== 20210824174615 PrepareCiBuildsMetadataAndCiBuildAsyncIndexes: reverted (0.0186s)

Screenshots or Screencasts (strongly suggested)

How to setup and validate locally (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Patrick Bair

Merge request reports

Loading