Skip to content

Fix change_column_type_concurrently for migration v2

Tianwen Chen requested to merge 422316-fix into master

What does this MR do and why?

Fix the migration helper change_column_type_concurrently

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  • Run migration generator to run change_column_type_concurrently: rails g post_deployment_migration change_column_type_testing

  • Change the migration files:

    class ChangeColumnTypeTesting < Gitlab::Database::Migration[2.2]
      milestone '16.7'
      disable_ddl_transaction!
    
      def up
        change_column_type_concurrently(:ci_pipelines, :lock_version, :text)
      end
    
      def down
      end
    end
  • Execute the migrations using scripts/regenerate-schema

  • Check if the migrations update db/structure.sql correctly and add the new column lock_version_for_type_change and associated triggers and constraints.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #422316 (closed) #383072

Edited by Krasimir Angelov

Merge request reports