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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20231122100006_remove_custom_email_smtp_columns_from_service_desk_settings.rb')
-rw-r--r--db/post_migrate/20231122100006_remove_custom_email_smtp_columns_from_service_desk_settings.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/db/post_migrate/20231122100006_remove_custom_email_smtp_columns_from_service_desk_settings.rb b/db/post_migrate/20231122100006_remove_custom_email_smtp_columns_from_service_desk_settings.rb
new file mode 100644
index 00000000000..98bb15dd76e
--- /dev/null
+++ b/db/post_migrate/20231122100006_remove_custom_email_smtp_columns_from_service_desk_settings.rb
@@ -0,0 +1,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