Skip to content
Snippets Groups Projects

Fix MySQL compatibility in zero downtime migration helpers

Merged Grzegorz Bizon requested to merge fix/migration-helpers-mysql-compatibility into master

What does this MR do?

This MR fixes MySQL for zero downtime migration helpers introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3860

Closes #17711 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Grzegorz Bizon Added 1 commit:

    Added 1 commit:

    • 7f9092da - Extend comment for migrations helper MySQL fix
  • Grzegorz Bizon Added 1 commit:

    Added 1 commit:

    • 891888aa - Add Changelog entry for MySQL compatibility fix
  • Stan Hu Enabled an automatic merge when the build for 891888aa succeeds

    Enabled an automatic merge when the build for 891888aa succeeds

  • Stan Hu Status changed to merged

    Status changed to merged

  • Stan Hu mentioned in commit b4c47368

    mentioned in commit b4c47368

  • mentioned in issue #17715 (closed)

  • Stan Hu mentioned in issue #17725 (closed)

    mentioned in issue #17725 (closed)

  • 2 2
    3 3 describe Gitlab::Database::MigrationHelpers, lib: true do
    4 4 let(:model) do
    5 Class.new do
    6 include Gitlab::Database::MigrationHelpers
    7
    8 def method_missing(name, *args, &block)
    9 ActiveRecord::Base.connection.send(name, *args, &block)
    10 end
    11 end.new
    5 ActiveRecord::Migration.new.extend(
    6 Gitlab::Database::MigrationHelpers
    7 )
    12 8 end
    13 9
    10 before { allow(model).to receive(:puts) }
  • 39 39 def update_column_in_batches(table, column, value)
    40 40 quoted_table = quote_table_name(table)
    41 41 quoted_column = quote_column_name(column)
    42 quoted_value = quote(value)
    42
    43 ##
    44 # Workaround for #17711
    45 #
    46 # It looks like for MySQL `ActiveRecord::Base.conntection.quote(true)`
  • Robert Speicher Removed ~149423 label

    Removed ~149423 label

  • Reassigned to @stanhu

  • @stanhu No action for you, just keeping assignee accurate.

  • Stan Hu mentioned in commit 1f9004a8

    mentioned in commit 1f9004a8

  • Please register or sign in to reply
    Loading