summaryrefslogtreecommitdiff
path: root/db/post_migrate/20210823193234_remove_allow_editing_commit_messages_from_project_settings.rb
blob: 638361d0e83ccbf5cf0d18de6305be146fa245a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class RemoveAllowEditingCommitMessagesFromProjectSettings < ActiveRecord::Migration[6.1]
  include Gitlab::Database::MigrationHelpers

  def up
    return unless column_exists?(:project_settings, :allow_editing_commit_messages)

    with_lock_retries do
      remove_column :project_settings, :allow_editing_commit_messages
    end
  end

  def down
    with_lock_retries do
      add_column :project_settings, :allow_editing_commit_messages, :boolean, default: false, null: false
    end
  end
end