Add migrations to swap ci_builds.id column (take 2)
This MR is a copy of !65201 (merged), which was supposed to be deployed in isolation, but had to be reverted because of production incidents that required rollback - gitlab-com/gl-infra/delivery#2009 (comment 676478203). The rest of the description bellow is a copy of !65201 (merged).
What does this MR do?
Related issue: #325619 (closed)
Migration Up
$ rails db:migrate:up VERSION=20210907211557
== 20210907211557 FinalizeCiBuildsBigintConversion: migrating =================
-- foreign_keys(:dep_ci_build_trace_sections)
-> 0.0031s
-- transaction_open?()
-> 0.0000s
-- index_exists?("ci_builds", :id_convert_to_bigint, {:unique=>true, :name=>"index_ci_builds_on_converted_id", :algorithm=>:concurrently})
-> 0.0088s
-- execute("SET statement_timeout TO 0")
-> 0.0004s
-- add_index("ci_builds", :id_convert_to_bigint, {:unique=>true, :name=>"index_ci_builds_on_converted_id", :algorithm=>:concurrently})
-> 0.0029s
-- execute("RESET statement_timeout")
-> 0.0004s
-- transaction_open?()
-> 0.0000s
-- index_exists?("ci_builds", [:commit_id, :artifacts_expire_at, :id_convert_to_bigint], {:where=>"type::text = 'Ci::Build'::text\n AND (retried = false OR retried IS NULL)\n AND (name::text = ANY (ARRAY['sast'::character varying::text,\n 'secret_detection'::character varying::text,\n 'dependency_scanning'::character varying::text,\n 'container_scanning'::character varying::text,\n 'dast'::character varying::text]))", :name=>:index_ci_builds_on_commit_id_expire_at_and_converted_id, :algorithm=>:concurrently})
-> 0.0074s
-- add_index("ci_builds", [:commit_id, :artifacts_expire_at, :id_convert_to_bigint], {:where=>"type::text = 'Ci::Build'::text\n AND (retried = false OR retried IS NULL)\n AND (name::text = ANY (ARRAY['sast'::character varying::text,\n 'secret_detection'::character varying::text,\n 'dependency_scanning'::character varying::text,\n 'container_scanning'::character varying::text,\n 'dast'::character varying::text]))", :name=>:index_ci_builds_on_commit_id_expire_at_and_converted_id, :algorithm=>:concurrently})
-> 0.0024s
-- transaction_open?()
-> 0.0000s
-- index_exists?("ci_builds", [:project_id, :id_convert_to_bigint], {:name=>:index_ci_builds_on_project_and_converted_id, :algorithm=>:concurrently})
-> 0.0071s
-- add_index("ci_builds", [:project_id, :id_convert_to_bigint], {:name=>:index_ci_builds_on_project_and_converted_id, :algorithm=>:concurrently})
-> 0.0019s
-- transaction_open?()
-> 0.0000s
-- index_exists?("ci_builds", [:runner_id, :id_convert_to_bigint], {:order=>{:id_convert_to_bigint=>:desc}, :name=>:index_ci_builds_on_runner_id_and_converted_id_desc, :algorithm=>:concurrently})
-> 0.0071s
-- add_index("ci_builds", [:runner_id, :id_convert_to_bigint], {:order=>{:id_convert_to_bigint=>:desc}, :name=>:index_ci_builds_on_runner_id_and_converted_id_desc, :algorithm=>:concurrently})
-> 0.0020s
-- transaction_open?()
-> 0.0000s
-- index_exists?("ci_builds", [:resource_group_id, :id_convert_to_bigint], {:where=>"resource_group_id IS NOT NULL", :name=>:index_ci_builds_on_resource_group_and_converted_id, :algorithm=>:concurrently})
-> 0.0076s
-- add_index("ci_builds", [:resource_group_id, :id_convert_to_bigint], {:where=>"resource_group_id IS NOT NULL", :name=>:index_ci_builds_on_resource_group_and_converted_id, :algorithm=>:concurrently})
-> 0.0019s
-- transaction_open?()
-> 0.0000s
-- index_exists?("ci_builds", [:name, :id_convert_to_bigint], {:where=>"(name::text = ANY (ARRAY['container_scanning'::character varying::text,\n 'dast'::character varying::text,\n 'dependency_scanning'::character varying::text,\n 'license_management'::character varying::text,\n 'sast'::character varying::text,\n 'secret_detection'::character varying::text,\n 'coverage_fuzzing'::character varying::text,\n 'license_scanning'::character varying::text])\n ) AND type::text = 'Ci::Build'::text", :name=>:index_security_ci_builds_on_name_and_converted_id_parser, :algorithm=>:concurrently})
-> 0.0084s
-- add_index("ci_builds", [:name, :id_convert_to_bigint], {:where=>"(name::text = ANY (ARRAY['container_scanning'::character varying::text,\n 'dast'::character varying::text,\n 'dependency_scanning'::character varying::text,\n 'license_management'::character varying::text,\n 'sast'::character varying::text,\n 'secret_detection'::character varying::text,\n 'coverage_fuzzing'::character varying::text,\n 'license_scanning'::character varying::text])\n ) AND type::text = 'Ci::Build'::text", :name=>:index_security_ci_builds_on_name_and_converted_id_parser, :algorithm=>:concurrently})
-> 0.0024s
-- index_name_exists?("ci_builds", :index_ci_builds_runner_id_and_converted_id_pending_covering)
-> 0.0006s
-- execute("CREATE INDEX CONCURRENTLY index_ci_builds_runner_id_and_converted_id_pending_covering\nON ci_builds (runner_id, id_convert_to_bigint) INCLUDE (project_id)\nWHERE status::text = 'pending'::text AND type::text = 'Ci::Build'::text\n")
-> 0.0022s
-- foreign_keys(:ci_build_needs)
-> 0.0023s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_build_needs)
-> 0.0018s
-- execute("ALTER TABLE ci_build_needs\nADD CONSTRAINT fk_rails_3cf221d4ed_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0014s
-- execute("ALTER TABLE ci_build_needs VALIDATE CONSTRAINT fk_rails_3cf221d4ed_tmp;")
-> 0.0046s
-- foreign_keys(:ci_build_pending_states)
-> 0.0022s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_build_pending_states)
-> 0.0017s
-- execute("ALTER TABLE ci_build_pending_states\nADD CONSTRAINT fk_rails_0bbbfeaf9d_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE ci_build_pending_states VALIDATE CONSTRAINT fk_rails_0bbbfeaf9d_tmp;")
-> 0.0016s
-- foreign_keys(:ci_build_report_results)
-> 0.0019s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_build_report_results)
-> 0.0017s
-- execute("ALTER TABLE ci_build_report_results\nADD CONSTRAINT fk_rails_16cb1ff064_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE ci_build_report_results VALIDATE CONSTRAINT fk_rails_16cb1ff064_tmp;")
-> 0.0014s
-- foreign_keys(:ci_build_trace_chunks)
-> 0.0017s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_build_trace_chunks)
-> 0.0017s
-- execute("ALTER TABLE ci_build_trace_chunks\nADD CONSTRAINT fk_rails_1013b761f2_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE ci_build_trace_chunks VALIDATE CONSTRAINT fk_rails_1013b761f2_tmp;")
-> 0.0014s
-- foreign_keys(:ci_build_trace_metadata)
-> 0.0021s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_build_trace_metadata)
-> 0.0017s
-- execute("ALTER TABLE ci_build_trace_metadata\nADD CONSTRAINT fk_rails_aebc78111f_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE ci_build_trace_metadata VALIDATE CONSTRAINT fk_rails_aebc78111f_tmp;")
-> 0.0014s
-- foreign_keys(:ci_builds_runner_session)
-> 0.0024s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_builds_runner_session)
-> 0.0023s
-- execute("ALTER TABLE ci_builds_runner_session\nADD CONSTRAINT fk_rails_70707857d3_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE ci_builds_runner_session VALIDATE CONSTRAINT fk_rails_70707857d3_tmp;")
-> 0.0015s
-- foreign_keys(:ci_builds_metadata)
-> 0.0018s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_builds_metadata)
-> 0.0017s
-- execute("ALTER TABLE ci_builds_metadata\nADD CONSTRAINT fk_rails_e20479742e_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0011s
-- execute("ALTER TABLE ci_builds_metadata VALIDATE CONSTRAINT fk_rails_e20479742e_tmp;")
-> 0.0018s
-- foreign_keys(:ci_job_artifacts)
-> 0.0017s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_job_artifacts)
-> 0.0016s
-- execute("ALTER TABLE ci_job_artifacts\nADD CONSTRAINT fk_rails_c5137cb2c1_tmp\nFOREIGN KEY (job_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE ci_job_artifacts VALIDATE CONSTRAINT fk_rails_c5137cb2c1_tmp;")
-> 0.0020s
-- foreign_keys(:ci_job_variables)
-> 0.0021s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_job_variables)
-> 0.0019s
-- execute("ALTER TABLE ci_job_variables\nADD CONSTRAINT fk_rails_fbf3b34792_tmp\nFOREIGN KEY (job_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0011s
-- execute("ALTER TABLE ci_job_variables VALIDATE CONSTRAINT fk_rails_fbf3b34792_tmp;")
-> 0.0015s
-- foreign_keys(:ci_pending_builds)
-> 0.0019s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_pending_builds)
-> 0.0017s
-- execute("ALTER TABLE ci_pending_builds\nADD CONSTRAINT fk_rails_725a2644a3_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0011s
-- execute("ALTER TABLE ci_pending_builds VALIDATE CONSTRAINT fk_rails_725a2644a3_tmp;")
-> 0.0018s
-- foreign_keys(:ci_resources)
-> 0.0018s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_resources)
-> 0.0017s
-- execute("ALTER TABLE ci_resources\nADD CONSTRAINT fk_e169a8e3d5_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE SET NULL\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE ci_resources VALIDATE CONSTRAINT fk_e169a8e3d5_tmp;")
-> 0.0015s
-- foreign_keys(:ci_running_builds)
-> 0.0019s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_running_builds)
-> 0.0018s
-- execute("ALTER TABLE ci_running_builds\nADD CONSTRAINT fk_rails_da45cfa165_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE ci_running_builds VALIDATE CONSTRAINT fk_rails_da45cfa165_tmp;")
-> 0.0018s
-- foreign_keys(:ci_sources_pipelines)
-> 0.0019s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_sources_pipelines)
-> 0.0020s
-- execute("ALTER TABLE ci_sources_pipelines\nADD CONSTRAINT fk_be5624bf37_tmp\nFOREIGN KEY (source_job_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE ci_sources_pipelines VALIDATE CONSTRAINT fk_be5624bf37_tmp;")
-> 0.0016s
-- foreign_keys(:ci_unit_test_failures)
-> 0.0018s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_unit_test_failures)
-> 0.0017s
-- execute("ALTER TABLE ci_unit_test_failures\nADD CONSTRAINT fk_0f09856e1f_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE ci_unit_test_failures VALIDATE CONSTRAINT fk_0f09856e1f_tmp;")
-> 0.0016s
-- foreign_keys(:dast_scanner_profiles_builds)
-> 0.0018s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:dast_scanner_profiles_builds)
-> 0.0017s
-- execute("ALTER TABLE dast_scanner_profiles_builds\nADD CONSTRAINT fk_e4c49200f8_tmp\nFOREIGN KEY (ci_build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE dast_scanner_profiles_builds VALIDATE CONSTRAINT fk_e4c49200f8_tmp;")
-> 0.0017s
-- foreign_keys(:dast_site_profiles_builds)
-> 0.0022s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:dast_site_profiles_builds)
-> 0.0018s
-- execute("ALTER TABLE dast_site_profiles_builds\nADD CONSTRAINT fk_a325505e99_tmp\nFOREIGN KEY (ci_build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE dast_site_profiles_builds VALIDATE CONSTRAINT fk_a325505e99_tmp;")
-> 0.0014s
-- foreign_keys(:pages_deployments)
-> 0.0018s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:pages_deployments)
-> 0.0017s
-- execute("ALTER TABLE pages_deployments\nADD CONSTRAINT fk_rails_c3a90cf29b_tmp\nFOREIGN KEY (ci_build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE SET NULL\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE pages_deployments VALIDATE CONSTRAINT fk_rails_c3a90cf29b_tmp;")
-> 0.0017s
-- foreign_keys(:requirements_management_test_reports)
-> 0.0018s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:requirements_management_test_reports)
-> 0.0017s
-- execute("ALTER TABLE requirements_management_test_reports\nADD CONSTRAINT fk_rails_e67d085910_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE SET NULL\nNOT VALID;\n")
-> 0.0011s
-- execute("ALTER TABLE requirements_management_test_reports VALIDATE CONSTRAINT fk_rails_e67d085910_tmp;")
-> 0.0017s
-- foreign_keys(:security_scans)
-> 0.0019s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:security_scans)
-> 0.0018s
-- execute("ALTER TABLE security_scans\nADD CONSTRAINT fk_rails_4ef1e6b4c6_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE security_scans VALIDATE CONSTRAINT fk_rails_4ef1e6b4c6_tmp;")
-> 0.0020s
-- foreign_keys(:terraform_state_versions)
-> 0.0018s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:terraform_state_versions)
-> 0.0017s
-- execute("ALTER TABLE terraform_state_versions\nADD CONSTRAINT fk_04b91e4a9f_tmp\nFOREIGN KEY (ci_build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE SET NULL\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE terraform_state_versions VALIDATE CONSTRAINT fk_04b91e4a9f_tmp;")
-> 0.0019s
-- foreign_keys(:ci_build_needs)
-> 0.0018s
-- remove_foreign_key(:ci_build_needs, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_3cf221d4ed"})
-> 0.0027s
-- quote_table_name(:ci_build_needs)
-> 0.0000s
-- quote_column_name("fk_rails_3cf221d4ed_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_3cf221d4ed")
-> 0.0000s
-- execute("ALTER TABLE \"ci_build_needs\"\nRENAME CONSTRAINT \"fk_rails_3cf221d4ed_tmp\" TO \"fk_rails_3cf221d4ed\"\n")
-> 0.0005s
-- foreign_keys(:ci_build_pending_states)
-> 0.0018s
-- remove_foreign_key(:ci_build_pending_states, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_0bbbfeaf9d"})
-> 0.0029s
-- quote_table_name(:ci_build_pending_states)
-> 0.0000s
-- quote_column_name("fk_rails_0bbbfeaf9d_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_0bbbfeaf9d")
-> 0.0000s
-- execute("ALTER TABLE \"ci_build_pending_states\"\nRENAME CONSTRAINT \"fk_rails_0bbbfeaf9d_tmp\" TO \"fk_rails_0bbbfeaf9d\"\n")
-> 0.0006s
-- foreign_keys(:ci_build_report_results)
-> 0.0018s
-- remove_foreign_key(:ci_build_report_results, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_16cb1ff064"})
-> 0.0026s
-- quote_table_name(:ci_build_report_results)
-> 0.0000s
-- quote_column_name("fk_rails_16cb1ff064_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_16cb1ff064")
-> 0.0000s
-- execute("ALTER TABLE \"ci_build_report_results\"\nRENAME CONSTRAINT \"fk_rails_16cb1ff064_tmp\" TO \"fk_rails_16cb1ff064\"\n")
-> 0.0005s
-- foreign_keys(:ci_build_trace_chunks)
-> 0.0017s
-- remove_foreign_key(:ci_build_trace_chunks, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_1013b761f2"})
-> 0.0026s
-- quote_table_name(:ci_build_trace_chunks)
-> 0.0000s
-- quote_column_name("fk_rails_1013b761f2_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_1013b761f2")
-> 0.0000s
-- execute("ALTER TABLE \"ci_build_trace_chunks\"\nRENAME CONSTRAINT \"fk_rails_1013b761f2_tmp\" TO \"fk_rails_1013b761f2\"\n")
-> 0.0005s
-- foreign_keys(:ci_build_trace_metadata)
-> 0.0018s
-- remove_foreign_key(:ci_build_trace_metadata, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_aebc78111f"})
-> 0.0027s
-- quote_table_name(:ci_build_trace_metadata)
-> 0.0000s
-- quote_column_name("fk_rails_aebc78111f_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_aebc78111f")
-> 0.0000s
-- execute("ALTER TABLE \"ci_build_trace_metadata\"\nRENAME CONSTRAINT \"fk_rails_aebc78111f_tmp\" TO \"fk_rails_aebc78111f\"\n")
-> 0.0005s
-- foreign_keys(:ci_builds_runner_session)
-> 0.0018s
-- remove_foreign_key(:ci_builds_runner_session, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_70707857d3"})
-> 0.0034s
-- quote_table_name(:ci_builds_runner_session)
-> 0.0000s
-- quote_column_name("fk_rails_70707857d3_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_70707857d3")
-> 0.0000s
-- execute("ALTER TABLE \"ci_builds_runner_session\"\nRENAME CONSTRAINT \"fk_rails_70707857d3_tmp\" TO \"fk_rails_70707857d3\"\n")
-> 0.0006s
-- foreign_keys(:ci_builds_metadata)
-> 0.0019s
-- remove_foreign_key(:ci_builds_metadata, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_e20479742e"})
-> 0.0030s
-- quote_table_name(:ci_builds_metadata)
-> 0.0000s
-- quote_column_name("fk_rails_e20479742e_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_e20479742e")
-> 0.0000s
-- execute("ALTER TABLE \"ci_builds_metadata\"\nRENAME CONSTRAINT \"fk_rails_e20479742e_tmp\" TO \"fk_rails_e20479742e\"\n")
-> 0.0005s
-- foreign_keys(:ci_job_artifacts)
-> 0.0017s
-- remove_foreign_key(:ci_job_artifacts, "ci_builds", {:column=>:job_id, :primary_key=>:id, :name=>"fk_rails_c5137cb2c1"})
-> 0.0025s
-- quote_table_name(:ci_job_artifacts)
-> 0.0000s
-- quote_column_name("fk_rails_c5137cb2c1_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_c5137cb2c1")
-> 0.0000s
-- execute("ALTER TABLE \"ci_job_artifacts\"\nRENAME CONSTRAINT \"fk_rails_c5137cb2c1_tmp\" TO \"fk_rails_c5137cb2c1\"\n")
-> 0.0005s
-- foreign_keys(:ci_job_variables)
-> 0.0017s
-- remove_foreign_key(:ci_job_variables, "ci_builds", {:column=>:job_id, :primary_key=>:id, :name=>"fk_rails_fbf3b34792"})
-> 0.0027s
-- quote_table_name(:ci_job_variables)
-> 0.0000s
-- quote_column_name("fk_rails_fbf3b34792_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_fbf3b34792")
-> 0.0000s
-- execute("ALTER TABLE \"ci_job_variables\"\nRENAME CONSTRAINT \"fk_rails_fbf3b34792_tmp\" TO \"fk_rails_fbf3b34792\"\n")
-> 0.0005s
-- foreign_keys(:ci_pending_builds)
-> 0.0017s
-- remove_foreign_key(:ci_pending_builds, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_725a2644a3"})
-> 0.0028s
-- quote_table_name(:ci_pending_builds)
-> 0.0000s
-- quote_column_name("fk_rails_725a2644a3_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_725a2644a3")
-> 0.0000s
-- execute("ALTER TABLE \"ci_pending_builds\"\nRENAME CONSTRAINT \"fk_rails_725a2644a3_tmp\" TO \"fk_rails_725a2644a3\"\n")
-> 0.0005s
-- foreign_keys(:ci_resources)
-> 0.0018s
-- remove_foreign_key(:ci_resources, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_e169a8e3d5"})
-> 0.0031s
-- quote_table_name(:ci_resources)
-> 0.0000s
-- quote_column_name("fk_e169a8e3d5_tmp")
-> 0.0000s
-- quote_column_name("fk_e169a8e3d5")
-> 0.0000s
-- execute("ALTER TABLE \"ci_resources\"\nRENAME CONSTRAINT \"fk_e169a8e3d5_tmp\" TO \"fk_e169a8e3d5\"\n")
-> 0.0006s
-- foreign_keys(:ci_running_builds)
-> 0.0018s
-- remove_foreign_key(:ci_running_builds, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_da45cfa165"})
-> 0.0027s
-- quote_table_name(:ci_running_builds)
-> 0.0000s
-- quote_column_name("fk_rails_da45cfa165_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_da45cfa165")
-> 0.0000s
-- execute("ALTER TABLE \"ci_running_builds\"\nRENAME CONSTRAINT \"fk_rails_da45cfa165_tmp\" TO \"fk_rails_da45cfa165\"\n")
-> 0.0008s
-- foreign_keys(:ci_sources_pipelines)
-> 0.0018s
-- remove_foreign_key(:ci_sources_pipelines, "ci_builds", {:column=>:source_job_id, :primary_key=>:id, :name=>"fk_be5624bf37"})
-> 0.0026s
-- quote_table_name(:ci_sources_pipelines)
-> 0.0000s
-- quote_column_name("fk_be5624bf37_tmp")
-> 0.0000s
-- quote_column_name("fk_be5624bf37")
-> 0.0000s
-- execute("ALTER TABLE \"ci_sources_pipelines\"\nRENAME CONSTRAINT \"fk_be5624bf37_tmp\" TO \"fk_be5624bf37\"\n")
-> 0.0005s
-- foreign_keys(:ci_unit_test_failures)
-> 0.0017s
-- remove_foreign_key(:ci_unit_test_failures, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_0f09856e1f"})
-> 0.0027s
-- quote_table_name(:ci_unit_test_failures)
-> 0.0000s
-- quote_column_name("fk_0f09856e1f_tmp")
-> 0.0000s
-- quote_column_name("fk_0f09856e1f")
-> 0.0000s
-- execute("ALTER TABLE \"ci_unit_test_failures\"\nRENAME CONSTRAINT \"fk_0f09856e1f_tmp\" TO \"fk_0f09856e1f\"\n")
-> 0.0006s
-- foreign_keys(:dast_scanner_profiles_builds)
-> 0.0019s
-- remove_foreign_key(:dast_scanner_profiles_builds, "ci_builds", {:column=>:ci_build_id, :primary_key=>:id, :name=>"fk_e4c49200f8"})
-> 0.0031s
-- quote_table_name(:dast_scanner_profiles_builds)
-> 0.0000s
-- quote_column_name("fk_e4c49200f8_tmp")
-> 0.0000s
-- quote_column_name("fk_e4c49200f8")
-> 0.0000s
-- execute("ALTER TABLE \"dast_scanner_profiles_builds\"\nRENAME CONSTRAINT \"fk_e4c49200f8_tmp\" TO \"fk_e4c49200f8\"\n")
-> 0.0006s
-- foreign_keys(:dast_site_profiles_builds)
-> 0.0018s
-- remove_foreign_key(:dast_site_profiles_builds, "ci_builds", {:column=>:ci_build_id, :primary_key=>:id, :name=>"fk_a325505e99"})
-> 0.0026s
-- quote_table_name(:dast_site_profiles_builds)
-> 0.0000s
-- quote_column_name("fk_a325505e99_tmp")
-> 0.0000s
-- quote_column_name("fk_a325505e99")
-> 0.0000s
-- execute("ALTER TABLE \"dast_site_profiles_builds\"\nRENAME CONSTRAINT \"fk_a325505e99_tmp\" TO \"fk_a325505e99\"\n")
-> 0.0005s
-- foreign_keys(:pages_deployments)
-> 0.0018s
-- remove_foreign_key(:pages_deployments, "ci_builds", {:column=>:ci_build_id, :primary_key=>:id, :name=>"fk_rails_c3a90cf29b"})
-> 0.0027s
-- quote_table_name(:pages_deployments)
-> 0.0000s
-- quote_column_name("fk_rails_c3a90cf29b_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_c3a90cf29b")
-> 0.0000s
-- execute("ALTER TABLE \"pages_deployments\"\nRENAME CONSTRAINT \"fk_rails_c3a90cf29b_tmp\" TO \"fk_rails_c3a90cf29b\"\n")
-> 0.0005s
-- foreign_keys(:requirements_management_test_reports)
-> 0.0018s
-- remove_foreign_key(:requirements_management_test_reports, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_e67d085910"})
-> 0.0026s
-- quote_table_name(:requirements_management_test_reports)
-> 0.0000s
-- quote_column_name("fk_rails_e67d085910_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_e67d085910")
-> 0.0000s
-- execute("ALTER TABLE \"requirements_management_test_reports\"\nRENAME CONSTRAINT \"fk_rails_e67d085910_tmp\" TO \"fk_rails_e67d085910\"\n")
-> 0.0005s
-- foreign_keys(:security_scans)
-> 0.0019s
-- remove_foreign_key(:security_scans, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_4ef1e6b4c6"})
-> 0.0028s
-- quote_table_name(:security_scans)
-> 0.0000s
-- quote_column_name("fk_rails_4ef1e6b4c6_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_4ef1e6b4c6")
-> 0.0000s
-- execute("ALTER TABLE \"security_scans\"\nRENAME CONSTRAINT \"fk_rails_4ef1e6b4c6_tmp\" TO \"fk_rails_4ef1e6b4c6\"\n")
-> 0.0006s
-- foreign_keys(:terraform_state_versions)
-> 0.0021s
-- remove_foreign_key(:terraform_state_versions, "ci_builds", {:column=>:ci_build_id, :primary_key=>:id, :name=>"fk_04b91e4a9f"})
-> 0.0028s
-- quote_table_name(:terraform_state_versions)
-> 0.0000s
-- quote_column_name("fk_04b91e4a9f_tmp")
-> 0.0000s
-- quote_column_name("fk_04b91e4a9f")
-> 0.0000s
-- execute("ALTER TABLE \"terraform_state_versions\"\nRENAME CONSTRAINT \"fk_04b91e4a9f_tmp\" TO \"fk_04b91e4a9f\"\n")
-> 0.0005s
-- quote_table_name("ci_builds")
-> 0.0000s
-- quote_column_name(:id)
-> 0.0000s
-- quote_column_name("id_tmp")
-> 0.0000s
-- execute("ALTER TABLE \"ci_builds\" RENAME COLUMN \"id\" TO \"id_tmp\"")
-> 0.0006s
-- quote_column_name(:id_convert_to_bigint)
-> 0.0000s
-- quote_column_name(:id)
-> 0.0000s
-- execute("ALTER TABLE \"ci_builds\" RENAME COLUMN \"id_convert_to_bigint\" TO \"id\"")
-> 0.0006s
-- quote_column_name("id_tmp")
-> 0.0000s
-- quote_column_name(:id_convert_to_bigint)
-> 0.0000s
-- execute("ALTER TABLE \"ci_builds\" RENAME COLUMN \"id_tmp\" TO \"id_convert_to_bigint\"")
-> 0.0005s
-- quote_table_name("trigger_3f6129be01d2")
-> 0.0000s
-- execute("ALTER FUNCTION \"trigger_3f6129be01d2\" RESET ALL")
-> 0.0006s
-- execute("ALTER SEQUENCE ci_builds_id_seq OWNED BY ci_builds.id")
-> 0.0008s
-- change_column_default("ci_builds", :id, #<Proc:0x00007ff0e91ff068 /Users/pbair/Projects/gitlab-development-kit/gitlab/db/post_migrate/20210907211557_finalize_ci_builds_bigint_conversion.rb:135 (lambda)>)
-> 0.0029s
-- change_column_default("ci_builds", :id_convert_to_bigint, 0)
-> 0.0025s
-- execute("ALTER TABLE \"ci_builds\" DROP CONSTRAINT ci_builds_pkey")
-> 0.0007s
-- rename_index("ci_builds", "index_ci_builds_on_converted_id", "ci_builds_pkey")
-> 0.0005s
-- execute("ALTER TABLE \"ci_builds\" ADD CONSTRAINT ci_builds_pkey PRIMARY KEY USING INDEX ci_builds_pkey")
-> 0.0006s
-- remove_index("ci_builds", {:name=>:index_ci_builds_on_commit_id_artifacts_expired_at_and_id})
-> 0.0006s
-- rename_index("ci_builds", :index_ci_builds_on_commit_id_expire_at_and_converted_id, :index_ci_builds_on_commit_id_artifacts_expired_at_and_id)
-> 0.0005s
-- remove_index("ci_builds", {:name=>:index_ci_builds_on_project_id_and_id})
-> 0.0006s
-- rename_index("ci_builds", :index_ci_builds_on_project_and_converted_id, :index_ci_builds_on_project_id_and_id)
-> 0.0005s
-- remove_index("ci_builds", {:name=>:index_ci_builds_on_runner_id_and_id_desc})
-> 0.0006s
-- rename_index("ci_builds", :index_ci_builds_on_runner_id_and_converted_id_desc, :index_ci_builds_on_runner_id_and_id_desc)
-> 0.0005s
-- remove_index("ci_builds", {:name=>:index_for_resource_group})
-> 0.0006s
-- rename_index("ci_builds", :index_ci_builds_on_resource_group_and_converted_id, :index_for_resource_group)
-> 0.0005s
-- remove_index("ci_builds", {:name=>:index_security_ci_builds_on_name_and_id_parser_features})
-> 0.0006s
-- rename_index("ci_builds", :index_security_ci_builds_on_name_and_converted_id_parser, :index_security_ci_builds_on_name_and_id_parser_features)
-> 0.0006s
-- remove_index("ci_builds", {:name=>:index_ci_builds_runner_id_pending_covering})
-> 0.0006s
-- rename_index("ci_builds", :index_ci_builds_runner_id_and_converted_id_pending_covering, :index_ci_builds_runner_id_pending_covering)
-> 0.0005s
== 20210907211557 FinalizeCiBuildsBigintConversion: migrated (0.4829s) ========
Migration Down
$ rails db:migrate:down VERSION=20210907211557
== 20210907211557 FinalizeCiBuildsBigintConversion: reverting =================
-- transaction_open?()
-> 0.0000s
-- index_exists?("ci_builds", :id_convert_to_bigint, {:unique=>true, :name=>"index_ci_builds_on_converted_id", :algorithm=>:concurrently})
-> 0.0096s
-- execute("SET statement_timeout TO 0")
-> 0.0005s
-- add_index("ci_builds", :id_convert_to_bigint, {:unique=>true, :name=>"index_ci_builds_on_converted_id", :algorithm=>:concurrently})
-> 0.0433s
-- execute("RESET statement_timeout")
-> 0.0010s
-- transaction_open?()
-> 0.0000s
-- index_exists?("ci_builds", [:commit_id, :artifacts_expire_at, :id_convert_to_bigint], {:where=>"type::text = 'Ci::Build'::text\n AND (retried = false OR retried IS NULL)\n AND (name::text = ANY (ARRAY['sast'::character varying::text,\n 'secret_detection'::character varying::text,\n 'dependency_scanning'::character varying::text,\n 'container_scanning'::character varying::text,\n 'dast'::character varying::text]))", :name=>:index_ci_builds_on_commit_id_expire_at_and_converted_id, :algorithm=>:concurrently})
-> 0.0096s
-- add_index("ci_builds", [:commit_id, :artifacts_expire_at, :id_convert_to_bigint], {:where=>"type::text = 'Ci::Build'::text\n AND (retried = false OR retried IS NULL)\n AND (name::text = ANY (ARRAY['sast'::character varying::text,\n 'secret_detection'::character varying::text,\n 'dependency_scanning'::character varying::text,\n 'container_scanning'::character varying::text,\n 'dast'::character varying::text]))", :name=>:index_ci_builds_on_commit_id_expire_at_and_converted_id, :algorithm=>:concurrently})
-> 0.0030s
-- transaction_open?()
-> 0.0000s
-- index_exists?("ci_builds", [:project_id, :id_convert_to_bigint], {:name=>:index_ci_builds_on_project_and_converted_id, :algorithm=>:concurrently})
-> 0.0082s
-- add_index("ci_builds", [:project_id, :id_convert_to_bigint], {:name=>:index_ci_builds_on_project_and_converted_id, :algorithm=>:concurrently})
-> 0.0021s
-- transaction_open?()
-> 0.0000s
-- index_exists?("ci_builds", [:runner_id, :id_convert_to_bigint], {:order=>{:id_convert_to_bigint=>:desc}, :name=>:index_ci_builds_on_runner_id_and_converted_id_desc, :algorithm=>:concurrently})
-> 0.0080s
-- add_index("ci_builds", [:runner_id, :id_convert_to_bigint], {:order=>{:id_convert_to_bigint=>:desc}, :name=>:index_ci_builds_on_runner_id_and_converted_id_desc, :algorithm=>:concurrently})
-> 0.0020s
-- transaction_open?()
-> 0.0000s
-- index_exists?("ci_builds", [:resource_group_id, :id_convert_to_bigint], {:where=>"resource_group_id IS NOT NULL", :name=>:index_ci_builds_on_resource_group_and_converted_id, :algorithm=>:concurrently})
-> 0.0085s
-- add_index("ci_builds", [:resource_group_id, :id_convert_to_bigint], {:where=>"resource_group_id IS NOT NULL", :name=>:index_ci_builds_on_resource_group_and_converted_id, :algorithm=>:concurrently})
-> 0.0025s
-- transaction_open?()
-> 0.0000s
-- index_exists?("ci_builds", [:name, :id_convert_to_bigint], {:where=>"(name::text = ANY (ARRAY['container_scanning'::character varying::text,\n 'dast'::character varying::text,\n 'dependency_scanning'::character varying::text,\n 'license_management'::character varying::text,\n 'sast'::character varying::text,\n 'secret_detection'::character varying::text,\n 'coverage_fuzzing'::character varying::text,\n 'license_scanning'::character varying::text])\n ) AND type::text = 'Ci::Build'::text", :name=>:index_security_ci_builds_on_name_and_converted_id_parser, :algorithm=>:concurrently})
-> 0.0620s
-- add_index("ci_builds", [:name, :id_convert_to_bigint], {:where=>"(name::text = ANY (ARRAY['container_scanning'::character varying::text,\n 'dast'::character varying::text,\n 'dependency_scanning'::character varying::text,\n 'license_management'::character varying::text,\n 'sast'::character varying::text,\n 'secret_detection'::character varying::text,\n 'coverage_fuzzing'::character varying::text,\n 'license_scanning'::character varying::text])\n ) AND type::text = 'Ci::Build'::text", :name=>:index_security_ci_builds_on_name_and_converted_id_parser, :algorithm=>:concurrently})
-> 0.0037s
-- index_name_exists?("ci_builds", :index_ci_builds_runner_id_and_converted_id_pending_covering)
-> 0.0008s
-- execute("CREATE INDEX CONCURRENTLY index_ci_builds_runner_id_and_converted_id_pending_covering\nON ci_builds (runner_id, id_convert_to_bigint) INCLUDE (project_id)\nWHERE status::text = 'pending'::text AND type::text = 'Ci::Build'::text\n")
-> 0.0029s
-- foreign_keys(:ci_build_needs)
-> 0.0034s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_build_needs)
-> 0.0027s
-- execute("ALTER TABLE ci_build_needs\nADD CONSTRAINT fk_rails_3cf221d4ed_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0015s
-- execute("ALTER TABLE ci_build_needs VALIDATE CONSTRAINT fk_rails_3cf221d4ed_tmp;")
-> 0.0086s
-- foreign_keys(:ci_build_pending_states)
-> 0.0024s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_build_pending_states)
-> 0.0018s
-- execute("ALTER TABLE ci_build_pending_states\nADD CONSTRAINT fk_rails_0bbbfeaf9d_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE ci_build_pending_states VALIDATE CONSTRAINT fk_rails_0bbbfeaf9d_tmp;")
-> 0.0034s
-- foreign_keys(:ci_build_report_results)
-> 0.0019s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_build_report_results)
-> 0.0017s
-- execute("ALTER TABLE ci_build_report_results\nADD CONSTRAINT fk_rails_16cb1ff064_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0016s
-- execute("ALTER TABLE ci_build_report_results VALIDATE CONSTRAINT fk_rails_16cb1ff064_tmp;")
-> 0.0018s
-- foreign_keys(:ci_build_trace_chunks)
-> 0.0019s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_build_trace_chunks)
-> 0.0019s
-- execute("ALTER TABLE ci_build_trace_chunks\nADD CONSTRAINT fk_rails_1013b761f2_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE ci_build_trace_chunks VALIDATE CONSTRAINT fk_rails_1013b761f2_tmp;")
-> 0.0020s
-- foreign_keys(:ci_build_trace_metadata)
-> 0.0019s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_build_trace_metadata)
-> 0.0018s
-- execute("ALTER TABLE ci_build_trace_metadata\nADD CONSTRAINT fk_rails_aebc78111f_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE ci_build_trace_metadata VALIDATE CONSTRAINT fk_rails_aebc78111f_tmp;")
-> 0.0020s
-- foreign_keys(:ci_builds_runner_session)
-> 0.0020s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_builds_runner_session)
-> 0.0017s
-- execute("ALTER TABLE ci_builds_runner_session\nADD CONSTRAINT fk_rails_70707857d3_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE ci_builds_runner_session VALIDATE CONSTRAINT fk_rails_70707857d3_tmp;")
-> 0.0024s
-- foreign_keys(:ci_builds_metadata)
-> 0.0021s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_builds_metadata)
-> 0.0017s
-- execute("ALTER TABLE ci_builds_metadata\nADD CONSTRAINT fk_rails_e20479742e_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE ci_builds_metadata VALIDATE CONSTRAINT fk_rails_e20479742e_tmp;")
-> 0.0025s
-- foreign_keys(:ci_job_artifacts)
-> 0.0019s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_job_artifacts)
-> 0.0017s
-- execute("ALTER TABLE ci_job_artifacts\nADD CONSTRAINT fk_rails_c5137cb2c1_tmp\nFOREIGN KEY (job_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE ci_job_artifacts VALIDATE CONSTRAINT fk_rails_c5137cb2c1_tmp;")
-> 0.0042s
-- foreign_keys(:ci_job_variables)
-> 0.0018s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_job_variables)
-> 0.0017s
-- execute("ALTER TABLE ci_job_variables\nADD CONSTRAINT fk_rails_fbf3b34792_tmp\nFOREIGN KEY (job_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE ci_job_variables VALIDATE CONSTRAINT fk_rails_fbf3b34792_tmp;")
-> 0.0022s
-- foreign_keys(:ci_pending_builds)
-> 0.0017s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_pending_builds)
-> 0.0017s
-- execute("ALTER TABLE ci_pending_builds\nADD CONSTRAINT fk_rails_725a2644a3_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE ci_pending_builds VALIDATE CONSTRAINT fk_rails_725a2644a3_tmp;")
-> 0.0028s
-- foreign_keys(:ci_resources)
-> 0.0019s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_resources)
-> 0.0021s
-- execute("ALTER TABLE ci_resources\nADD CONSTRAINT fk_e169a8e3d5_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE SET NULL\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE ci_resources VALIDATE CONSTRAINT fk_e169a8e3d5_tmp;")
-> 0.0035s
-- foreign_keys(:ci_running_builds)
-> 0.0021s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_running_builds)
-> 0.0017s
-- execute("ALTER TABLE ci_running_builds\nADD CONSTRAINT fk_rails_da45cfa165_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE ci_running_builds VALIDATE CONSTRAINT fk_rails_da45cfa165_tmp;")
-> 0.0025s
-- foreign_keys(:ci_sources_pipelines)
-> 0.0018s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_sources_pipelines)
-> 0.0017s
-- execute("ALTER TABLE ci_sources_pipelines\nADD CONSTRAINT fk_be5624bf37_tmp\nFOREIGN KEY (source_job_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE ci_sources_pipelines VALIDATE CONSTRAINT fk_be5624bf37_tmp;")
-> 0.0023s
-- foreign_keys(:ci_unit_test_failures)
-> 0.0020s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:ci_unit_test_failures)
-> 0.0017s
-- execute("ALTER TABLE ci_unit_test_failures\nADD CONSTRAINT fk_0f09856e1f_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0011s
-- execute("ALTER TABLE ci_unit_test_failures VALIDATE CONSTRAINT fk_0f09856e1f_tmp;")
-> 0.0033s
-- foreign_keys(:dast_scanner_profiles_builds)
-> 0.0018s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:dast_scanner_profiles_builds)
-> 0.0017s
-- execute("ALTER TABLE dast_scanner_profiles_builds\nADD CONSTRAINT fk_e4c49200f8_tmp\nFOREIGN KEY (ci_build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE dast_scanner_profiles_builds VALIDATE CONSTRAINT fk_e4c49200f8_tmp;")
-> 0.0028s
-- foreign_keys(:dast_site_profiles_builds)
-> 0.0017s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:dast_site_profiles_builds)
-> 0.0016s
-- execute("ALTER TABLE dast_site_profiles_builds\nADD CONSTRAINT fk_a325505e99_tmp\nFOREIGN KEY (ci_build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE dast_site_profiles_builds VALIDATE CONSTRAINT fk_a325505e99_tmp;")
-> 0.0022s
-- foreign_keys(:pages_deployments)
-> 0.0019s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:pages_deployments)
-> 0.0018s
-- execute("ALTER TABLE pages_deployments\nADD CONSTRAINT fk_rails_c3a90cf29b_tmp\nFOREIGN KEY (ci_build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE SET NULL\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE pages_deployments VALIDATE CONSTRAINT fk_rails_c3a90cf29b_tmp;")
-> 0.0030s
-- foreign_keys(:requirements_management_test_reports)
-> 0.0018s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:requirements_management_test_reports)
-> 0.0017s
-- execute("ALTER TABLE requirements_management_test_reports\nADD CONSTRAINT fk_rails_e67d085910_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE SET NULL\nNOT VALID;\n")
-> 0.0010s
-- execute("ALTER TABLE requirements_management_test_reports VALIDATE CONSTRAINT fk_rails_e67d085910_tmp;")
-> 0.0029s
-- foreign_keys(:security_scans)
-> 0.0017s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:security_scans)
-> 0.0017s
-- execute("ALTER TABLE security_scans\nADD CONSTRAINT fk_rails_4ef1e6b4c6_tmp\nFOREIGN KEY (build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE CASCADE\nNOT VALID;\n")
-> 0.0009s
-- execute("ALTER TABLE security_scans VALIDATE CONSTRAINT fk_rails_4ef1e6b4c6_tmp;")
-> 0.0033s
-- foreign_keys(:terraform_state_versions)
-> 0.0018s
-- transaction_open?()
-> 0.0000s
-- foreign_keys(:terraform_state_versions)
-> 0.0018s
-- execute("ALTER TABLE terraform_state_versions\nADD CONSTRAINT fk_04b91e4a9f_tmp\nFOREIGN KEY (ci_build_id)\nREFERENCES ci_builds (id_convert_to_bigint)\nON DELETE SET NULL\nNOT VALID;\n")
-> 0.0011s
-- execute("ALTER TABLE terraform_state_versions VALIDATE CONSTRAINT fk_04b91e4a9f_tmp;")
-> 0.0041s
-- foreign_keys(:ci_build_needs)
-> 0.0018s
-- remove_foreign_key(:ci_build_needs, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_3cf221d4ed"})
-> 0.0028s
-- quote_table_name(:ci_build_needs)
-> 0.0000s
-- quote_column_name("fk_rails_3cf221d4ed_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_3cf221d4ed")
-> 0.0000s
-- execute("ALTER TABLE \"ci_build_needs\"\nRENAME CONSTRAINT \"fk_rails_3cf221d4ed_tmp\" TO \"fk_rails_3cf221d4ed\"\n")
-> 0.0005s
-- foreign_keys(:ci_build_pending_states)
-> 0.0017s
-- remove_foreign_key(:ci_build_pending_states, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_0bbbfeaf9d"})
-> 0.0026s
-- quote_table_name(:ci_build_pending_states)
-> 0.0000s
-- quote_column_name("fk_rails_0bbbfeaf9d_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_0bbbfeaf9d")
-> 0.0000s
-- execute("ALTER TABLE \"ci_build_pending_states\"\nRENAME CONSTRAINT \"fk_rails_0bbbfeaf9d_tmp\" TO \"fk_rails_0bbbfeaf9d\"\n")
-> 0.0010s
-- foreign_keys(:ci_build_report_results)
-> 0.0019s
-- remove_foreign_key(:ci_build_report_results, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_16cb1ff064"})
-> 0.0030s
-- quote_table_name(:ci_build_report_results)
-> 0.0000s
-- quote_column_name("fk_rails_16cb1ff064_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_16cb1ff064")
-> 0.0000s
-- execute("ALTER TABLE \"ci_build_report_results\"\nRENAME CONSTRAINT \"fk_rails_16cb1ff064_tmp\" TO \"fk_rails_16cb1ff064\"\n")
-> 0.0006s
-- foreign_keys(:ci_build_trace_chunks)
-> 0.0018s
-- remove_foreign_key(:ci_build_trace_chunks, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_1013b761f2"})
-> 0.0025s
-- quote_table_name(:ci_build_trace_chunks)
-> 0.0000s
-- quote_column_name("fk_rails_1013b761f2_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_1013b761f2")
-> 0.0000s
-- execute("ALTER TABLE \"ci_build_trace_chunks\"\nRENAME CONSTRAINT \"fk_rails_1013b761f2_tmp\" TO \"fk_rails_1013b761f2\"\n")
-> 0.0005s
-- foreign_keys(:ci_build_trace_metadata)
-> 0.0017s
-- remove_foreign_key(:ci_build_trace_metadata, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_aebc78111f"})
-> 0.0027s
-- quote_table_name(:ci_build_trace_metadata)
-> 0.0000s
-- quote_column_name("fk_rails_aebc78111f_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_aebc78111f")
-> 0.0000s
-- execute("ALTER TABLE \"ci_build_trace_metadata\"\nRENAME CONSTRAINT \"fk_rails_aebc78111f_tmp\" TO \"fk_rails_aebc78111f\"\n")
-> 0.0006s
-- foreign_keys(:ci_builds_runner_session)
-> 0.0019s
-- remove_foreign_key(:ci_builds_runner_session, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_70707857d3"})
-> 0.0026s
-- quote_table_name(:ci_builds_runner_session)
-> 0.0000s
-- quote_column_name("fk_rails_70707857d3_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_70707857d3")
-> 0.0000s
-- execute("ALTER TABLE \"ci_builds_runner_session\"\nRENAME CONSTRAINT \"fk_rails_70707857d3_tmp\" TO \"fk_rails_70707857d3\"\n")
-> 0.0005s
-- foreign_keys(:ci_builds_metadata)
-> 0.0018s
-- remove_foreign_key(:ci_builds_metadata, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_e20479742e"})
-> 0.0027s
-- quote_table_name(:ci_builds_metadata)
-> 0.0000s
-- quote_column_name("fk_rails_e20479742e_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_e20479742e")
-> 0.0000s
-- execute("ALTER TABLE \"ci_builds_metadata\"\nRENAME CONSTRAINT \"fk_rails_e20479742e_tmp\" TO \"fk_rails_e20479742e\"\n")
-> 0.0005s
-- foreign_keys(:ci_job_artifacts)
-> 0.0021s
-- remove_foreign_key(:ci_job_artifacts, "ci_builds", {:column=>:job_id, :primary_key=>:id, :name=>"fk_rails_c5137cb2c1"})
-> 0.0030s
-- quote_table_name(:ci_job_artifacts)
-> 0.0000s
-- quote_column_name("fk_rails_c5137cb2c1_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_c5137cb2c1")
-> 0.0000s
-- execute("ALTER TABLE \"ci_job_artifacts\"\nRENAME CONSTRAINT \"fk_rails_c5137cb2c1_tmp\" TO \"fk_rails_c5137cb2c1\"\n")
-> 0.0005s
-- foreign_keys(:ci_job_variables)
-> 0.0018s
-- remove_foreign_key(:ci_job_variables, "ci_builds", {:column=>:job_id, :primary_key=>:id, :name=>"fk_rails_fbf3b34792"})
-> 0.0027s
-- quote_table_name(:ci_job_variables)
-> 0.0000s
-- quote_column_name("fk_rails_fbf3b34792_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_fbf3b34792")
-> 0.0000s
-- execute("ALTER TABLE \"ci_job_variables\"\nRENAME CONSTRAINT \"fk_rails_fbf3b34792_tmp\" TO \"fk_rails_fbf3b34792\"\n")
-> 0.0006s
-- foreign_keys(:ci_pending_builds)
-> 0.0018s
-- remove_foreign_key(:ci_pending_builds, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_725a2644a3"})
-> 0.0029s
-- quote_table_name(:ci_pending_builds)
-> 0.0000s
-- quote_column_name("fk_rails_725a2644a3_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_725a2644a3")
-> 0.0000s
-- execute("ALTER TABLE \"ci_pending_builds\"\nRENAME CONSTRAINT \"fk_rails_725a2644a3_tmp\" TO \"fk_rails_725a2644a3\"\n")
-> 0.0005s
-- foreign_keys(:ci_resources)
-> 0.0018s
-- remove_foreign_key(:ci_resources, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_e169a8e3d5"})
-> 0.0029s
-- quote_table_name(:ci_resources)
-> 0.0000s
-- quote_column_name("fk_e169a8e3d5_tmp")
-> 0.0000s
-- quote_column_name("fk_e169a8e3d5")
-> 0.0000s
-- execute("ALTER TABLE \"ci_resources\"\nRENAME CONSTRAINT \"fk_e169a8e3d5_tmp\" TO \"fk_e169a8e3d5\"\n")
-> 0.0006s
-- foreign_keys(:ci_running_builds)
-> 0.0019s
-- remove_foreign_key(:ci_running_builds, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_da45cfa165"})
-> 0.0029s
-- quote_table_name(:ci_running_builds)
-> 0.0000s
-- quote_column_name("fk_rails_da45cfa165_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_da45cfa165")
-> 0.0000s
-- execute("ALTER TABLE \"ci_running_builds\"\nRENAME CONSTRAINT \"fk_rails_da45cfa165_tmp\" TO \"fk_rails_da45cfa165\"\n")
-> 0.0005s
-- foreign_keys(:ci_sources_pipelines)
-> 0.0018s
-- remove_foreign_key(:ci_sources_pipelines, "ci_builds", {:column=>:source_job_id, :primary_key=>:id, :name=>"fk_be5624bf37"})
-> 0.0029s
-- quote_table_name(:ci_sources_pipelines)
-> 0.0000s
-- quote_column_name("fk_be5624bf37_tmp")
-> 0.0000s
-- quote_column_name("fk_be5624bf37")
-> 0.0000s
-- execute("ALTER TABLE \"ci_sources_pipelines\"\nRENAME CONSTRAINT \"fk_be5624bf37_tmp\" TO \"fk_be5624bf37\"\n")
-> 0.0005s
-- foreign_keys(:ci_unit_test_failures)
-> 0.0019s
-- remove_foreign_key(:ci_unit_test_failures, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_0f09856e1f"})
-> 0.0028s
-- quote_table_name(:ci_unit_test_failures)
-> 0.0000s
-- quote_column_name("fk_0f09856e1f_tmp")
-> 0.0000s
-- quote_column_name("fk_0f09856e1f")
-> 0.0000s
-- execute("ALTER TABLE \"ci_unit_test_failures\"\nRENAME CONSTRAINT \"fk_0f09856e1f_tmp\" TO \"fk_0f09856e1f\"\n")
-> 0.0005s
-- foreign_keys(:dast_scanner_profiles_builds)
-> 0.0018s
-- remove_foreign_key(:dast_scanner_profiles_builds, "ci_builds", {:column=>:ci_build_id, :primary_key=>:id, :name=>"fk_e4c49200f8"})
-> 0.0030s
-- quote_table_name(:dast_scanner_profiles_builds)
-> 0.0000s
-- quote_column_name("fk_e4c49200f8_tmp")
-> 0.0000s
-- quote_column_name("fk_e4c49200f8")
-> 0.0000s
-- execute("ALTER TABLE \"dast_scanner_profiles_builds\"\nRENAME CONSTRAINT \"fk_e4c49200f8_tmp\" TO \"fk_e4c49200f8\"\n")
-> 0.0006s
-- foreign_keys(:dast_site_profiles_builds)
-> 0.0020s
-- remove_foreign_key(:dast_site_profiles_builds, "ci_builds", {:column=>:ci_build_id, :primary_key=>:id, :name=>"fk_a325505e99"})
-> 0.0028s
-- quote_table_name(:dast_site_profiles_builds)
-> 0.0000s
-- quote_column_name("fk_a325505e99_tmp")
-> 0.0000s
-- quote_column_name("fk_a325505e99")
-> 0.0000s
-- execute("ALTER TABLE \"dast_site_profiles_builds\"\nRENAME CONSTRAINT \"fk_a325505e99_tmp\" TO \"fk_a325505e99\"\n")
-> 0.0006s
-- foreign_keys(:pages_deployments)
-> 0.0018s
-- remove_foreign_key(:pages_deployments, "ci_builds", {:column=>:ci_build_id, :primary_key=>:id, :name=>"fk_rails_c3a90cf29b"})
-> 0.0028s
-- quote_table_name(:pages_deployments)
-> 0.0000s
-- quote_column_name("fk_rails_c3a90cf29b_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_c3a90cf29b")
-> 0.0000s
-- execute("ALTER TABLE \"pages_deployments\"\nRENAME CONSTRAINT \"fk_rails_c3a90cf29b_tmp\" TO \"fk_rails_c3a90cf29b\"\n")
-> 0.0005s
-- foreign_keys(:requirements_management_test_reports)
-> 0.0018s
-- remove_foreign_key(:requirements_management_test_reports, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_e67d085910"})
-> 0.0027s
-- quote_table_name(:requirements_management_test_reports)
-> 0.0000s
-- quote_column_name("fk_rails_e67d085910_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_e67d085910")
-> 0.0000s
-- execute("ALTER TABLE \"requirements_management_test_reports\"\nRENAME CONSTRAINT \"fk_rails_e67d085910_tmp\" TO \"fk_rails_e67d085910\"\n")
-> 0.0005s
-- foreign_keys(:security_scans)
-> 0.0018s
-- remove_foreign_key(:security_scans, "ci_builds", {:column=>:build_id, :primary_key=>:id, :name=>"fk_rails_4ef1e6b4c6"})
-> 0.0030s
-- quote_table_name(:security_scans)
-> 0.0000s
-- quote_column_name("fk_rails_4ef1e6b4c6_tmp")
-> 0.0000s
-- quote_column_name("fk_rails_4ef1e6b4c6")
-> 0.0000s
-- execute("ALTER TABLE \"security_scans\"\nRENAME CONSTRAINT \"fk_rails_4ef1e6b4c6_tmp\" TO \"fk_rails_4ef1e6b4c6\"\n")
-> 0.0006s
-- foreign_keys(:terraform_state_versions)
-> 0.0020s
-- remove_foreign_key(:terraform_state_versions, "ci_builds", {:column=>:ci_build_id, :primary_key=>:id, :name=>"fk_04b91e4a9f"})
-> 0.0031s
-- quote_table_name(:terraform_state_versions)
-> 0.0000s
-- quote_column_name("fk_04b91e4a9f_tmp")
-> 0.0000s
-- quote_column_name("fk_04b91e4a9f")
-> 0.0000s
-- execute("ALTER TABLE \"terraform_state_versions\"\nRENAME CONSTRAINT \"fk_04b91e4a9f_tmp\" TO \"fk_04b91e4a9f\"\n")
-> 0.0006s
-- quote_table_name("ci_builds")
-> 0.0000s
-- quote_column_name(:id)
-> 0.0000s
-- quote_column_name("id_tmp")
-> 0.0000s
-- execute("ALTER TABLE \"ci_builds\" RENAME COLUMN \"id\" TO \"id_tmp\"")
-> 0.0006s
-- quote_column_name(:id_convert_to_bigint)
-> 0.0000s
-- quote_column_name(:id)
-> 0.0000s
-- execute("ALTER TABLE \"ci_builds\" RENAME COLUMN \"id_convert_to_bigint\" TO \"id\"")
-> 0.0005s
-- quote_column_name("id_tmp")
-> 0.0000s
-- quote_column_name(:id_convert_to_bigint)
-> 0.0000s
-- execute("ALTER TABLE \"ci_builds\" RENAME COLUMN \"id_tmp\" TO \"id_convert_to_bigint\"")
-> 0.0005s
-- quote_table_name("trigger_3f6129be01d2")
-> 0.0000s
-- execute("ALTER FUNCTION \"trigger_3f6129be01d2\" RESET ALL")
-> 0.0006s
-- execute("ALTER SEQUENCE ci_builds_id_seq OWNED BY ci_builds.id")
-> 0.0007s
-- change_column_default("ci_builds", :id, #<Proc:0x00007fd91ca07fb0 /Users/pbair/Projects/gitlab-development-kit/gitlab/db/post_migrate/20210907211557_finalize_ci_builds_bigint_conversion.rb:135 (lambda)>)
-> 0.0030s
-- change_column_default("ci_builds", :id_convert_to_bigint, 0)
-> 0.0025s
-- execute("ALTER TABLE \"ci_builds\" DROP CONSTRAINT ci_builds_pkey")
-> 0.0007s
-- rename_index("ci_builds", "index_ci_builds_on_converted_id", "ci_builds_pkey")
-> 0.0006s
-- execute("ALTER TABLE \"ci_builds\" ADD CONSTRAINT ci_builds_pkey PRIMARY KEY USING INDEX ci_builds_pkey")
-> 0.0007s
-- remove_index("ci_builds", {:name=>:index_ci_builds_on_commit_id_artifacts_expired_at_and_id})
-> 0.0007s
-- rename_index("ci_builds", :index_ci_builds_on_commit_id_expire_at_and_converted_id, :index_ci_builds_on_commit_id_artifacts_expired_at_and_id)
-> 0.0006s
-- remove_index("ci_builds", {:name=>:index_ci_builds_on_project_id_and_id})
-> 0.0007s
-- rename_index("ci_builds", :index_ci_builds_on_project_and_converted_id, :index_ci_builds_on_project_id_and_id)
-> 0.0006s
-- remove_index("ci_builds", {:name=>:index_ci_builds_on_runner_id_and_id_desc})
-> 0.0007s
-- rename_index("ci_builds", :index_ci_builds_on_runner_id_and_converted_id_desc, :index_ci_builds_on_runner_id_and_id_desc)
-> 0.0007s
-- remove_index("ci_builds", {:name=>:index_for_resource_group})
-> 0.0008s
-- rename_index("ci_builds", :index_ci_builds_on_resource_group_and_converted_id, :index_for_resource_group)
-> 0.0006s
-- remove_index("ci_builds", {:name=>:index_security_ci_builds_on_name_and_id_parser_features})
-> 0.0007s
-- rename_index("ci_builds", :index_security_ci_builds_on_name_and_converted_id_parser, :index_security_ci_builds_on_name_and_id_parser_features)
-> 0.0006s
-- remove_index("ci_builds", {:name=>:index_ci_builds_runner_id_pending_covering})
-> 0.0007s
-- rename_index("ci_builds", :index_ci_builds_runner_id_and_converted_id_pending_covering, :index_ci_builds_runner_id_pending_covering)
-> 0.0007s
== 20210907211557 FinalizeCiBuildsBigintConversion: reverted (0.6112s) ========
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Related to #325619 (closed)
Edited by Henri Philipps