summaryrefslogtreecommitdiff
path: root/db/migrate/20211224114539_add_packages_cleanup_package_file_worker_capacity_check_constraint_to_app_settings.rb
blob: 3a40540a1e1095f7ba41e67bd887ed2bf0461cde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class AddPackagesCleanupPackageFileWorkerCapacityCheckConstraintToAppSettings < Gitlab::Database::Migration[1.0]
  CONSTRAINT_NAME = 'app_settings_p_cleanup_package_file_worker_capacity_positive'

  disable_ddl_transaction!

  def up
    add_check_constraint :application_settings, 'packages_cleanup_package_file_worker_capacity >= 0', CONSTRAINT_NAME
  end

  def down
    remove_check_constraint :application_settings, CONSTRAINT_NAME
  end
end