summaryrefslogtreecommitdiff
path: root/db/migrate/20200204070729_add_elasticsearch_indexed_field_length_limit_to_application_settings.rb
blob: 7d4787066139ec5cc4c65f33cc257ab4dcf14311 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class AddElasticsearchIndexedFieldLengthLimitToApplicationSettings < ActiveRecord::Migration[6.0]
  DOWNTIME = false

  def up
    add_column :application_settings, :elasticsearch_indexed_field_length_limit, :integer, null: false, default: 0

    if Gitlab.com?
      execute 'UPDATE application_settings SET elasticsearch_indexed_field_length_limit = 20000'
    end
  end

  def down
    remove_column :application_settings, :elasticsearch_indexed_field_length_limit
  end
end