Resolve "Migrate merge_request_metrics.id to bigint"
What does this MR do and why?
Prepare conversion of merge_request_metrics.id
to bigint.
Up:
main: == 20230127093353 InitializeConversionOfMergeRequestMetricsToBigint: migrating
main: -- table_exists?(:merge_request_metrics)
main: -> 0.0754s
main: -- column_exists?(:merge_request_metrics, :id)
main: -> 0.0029s
main: -- column_exists?(:merge_request_metrics, :id)
main: -> 0.0012s
main: -- transaction_open?()
main: -> 0.0000s
main: -- columns(:merge_request_metrics)
main: -> 0.0015s
main: -- add_column(:merge_request_metrics, "id_convert_to_bigint", :bigint, {:default=>0, :null=>false})
main: -> 0.0029s
main: == 20230127093353 InitializeConversionOfMergeRequestMetricsToBigint: migrated (0.1127s)
main: == 20230127101834 BackfillMergeRequestMetricsForBigintConversion: migrating ===
main: -- table_exists?(:merge_request_metrics)
main: -> 0.0039s
main: -- column_exists?(:merge_request_metrics, :id)
main: -> 0.0023s
main: -- column_exists?(:merge_request_metrics, :id)
main: -> 0.0010s
main: -- column_exists?(:merge_request_metrics, "id_convert_to_bigint")
main: -> 0.0009s
main: == 20230127101834 BackfillMergeRequestMetricsForBigintConversion: migrated (0.0646s)
ci: == 20230127101834 BackfillMergeRequestMetricsForBigintConversion: migrating ===
ci: -- The migration is skipped since it modifies the schemas: [:gitlab_main].
ci: -- This database can only apply migrations in one of the following schemas: [:gitlab_ci, :gitlab_shared, :gitlab_internal].
ci: == 20230127101834 BackfillMergeRequestMetricsForBigintConversion: migrated (0.0045s)
Down:
main: == 20230127101834 BackfillMergeRequestMetricsForBigintConversion: reverting ===
main: -- execute("DELETE FROM batched_background_migrations WHERE job_class_name = 'CopyColumnUsingBackgroundMigrationJob' AND table_name = 'merge_request_metrics' AND column_name = 'id' AND job_arguments = '[[\"id\"],[\"id_convert_to_bigint\"]]'")
main: -> 0.0063s
main: == 20230127101834 BackfillMergeRequestMetricsForBigintConversion: reverted (0.0077s)
main: == 20230127093353 InitializeConversionOfMergeRequestMetricsToBigint: reverting
main: -- remove_column(:merge_request_metrics, "id_convert_to_bigint")
main: -> 0.0008s
main: == 20230127093353 InitializeConversionOfMergeRequestMetricsToBigint: reverted (0.0043s)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #389516 (closed)
Edited by Diogo Frazão