Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20231127171903_remove_application_settings_columns.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9400c0366781b9b08bc1287217c2a7f17df11c5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

class RemoveApplicationSettingsColumns < Gitlab::Database::Migration[2.2]
  milestone '16.7'

  disable_ddl_transaction!

  def up
    remove_column :application_settings, :elasticsearch_shards, if_exists: true
    remove_column :application_settings, :elasticsearch_replicas, if_exists: true
    remove_column :application_settings, :static_objects_external_storage_auth_token, if_exists: true
    remove_column :application_settings, :web_ide_clientside_preview_enabled, if_exists: true
  end

  def down
    add_column :application_settings, :elasticsearch_shards, :integer, default: 5, null: false, if_not_exists: true
    add_column :application_settings, :elasticsearch_replicas, :integer, default: 1, null: false, if_not_exists: true
    add_column :application_settings, :static_objects_external_storage_auth_token, :string, limit: 255,
      if_not_exists: true
    add_column :application_settings, :web_ide_clientside_preview_enabled, :boolean, default: false, null: false,
      if_not_exists: true
  end
end