summaryrefslogtreecommitdiff
path: root/db/post_migrate/20220216201949_remove_package_files_limit_from_application_settings.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20220216201949_remove_package_files_limit_from_application_settings.rb')
-rw-r--r--db/post_migrate/20220216201949_remove_package_files_limit_from_application_settings.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/post_migrate/20220216201949_remove_package_files_limit_from_application_settings.rb b/db/post_migrate/20220216201949_remove_package_files_limit_from_application_settings.rb
new file mode 100644
index 00000000000..589b75dd918
--- /dev/null
+++ b/db/post_migrate/20220216201949_remove_package_files_limit_from_application_settings.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class RemovePackageFilesLimitFromApplicationSettings < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ return unless column_exists?(:application_settings, :max_package_files_for_package_destruction)
+
+ remove_column :application_settings, :max_package_files_for_package_destruction, :smallint
+ end
+
+ def down
+ add_column :application_settings, :max_package_files_for_package_destruction, :smallint, default: 100, null: false
+ add_check_constraint :application_settings,
+ 'max_package_files_for_package_destruction > 0',
+ 'app_settings_max_package_files_for_package_destruction_positive'
+ end
+end