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

20231122100006_remove_custom_email_smtp_columns_from_service_desk_settings.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 98bb15dd76e79931b96240364b2a91d82501755e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true

class RemoveCustomEmailSmtpColumnsFromServiceDeskSettings < Gitlab::Database::Migration[2.2]
  MAXIMUM_LIMIT = 255

  milestone '16.7'

  disable_ddl_transaction!

  def up
    with_lock_retries do
      remove_column :service_desk_settings, :custom_email_smtp_address
      remove_column :service_desk_settings, :custom_email_smtp_port
      remove_column :service_desk_settings, :custom_email_smtp_username
      remove_column :service_desk_settings, :encrypted_custom_email_smtp_password
      remove_column :service_desk_settings, :encrypted_custom_email_smtp_password_iv
    end
  end

  def down
    with_lock_retries do
      add_column :service_desk_settings, :custom_email_smtp_address, :text
      add_column :service_desk_settings, :custom_email_smtp_port, :integer
      add_column :service_desk_settings, :custom_email_smtp_username, :text
      add_column :service_desk_settings, :encrypted_custom_email_smtp_password, :binary
      add_column :service_desk_settings, :encrypted_custom_email_smtp_password_iv, :binary
    end

    add_text_limit :service_desk_settings, :custom_email_smtp_address, MAXIMUM_LIMIT
    add_text_limit :service_desk_settings, :custom_email_smtp_username, MAXIMUM_LIMIT
  end
end