debian-mirror-gitlab/db/migrate/20211207165508_add_protected_environments_required_approval_count_check_constraint.rb
2022-01-26 12:08:38 +05:30

16 lines
444 B
Ruby

# frozen_string_literal: true
class AddProtectedEnvironmentsRequiredApprovalCountCheckConstraint < Gitlab::Database::Migration[1.0]
CONSTRAINT_NAME = 'protected_environments_required_approval_count_positive'
disable_ddl_transaction!
def up
add_check_constraint :protected_environments, 'required_approval_count >= 0', CONSTRAINT_NAME
end
def down
remove_check_constraint :protected_environments, CONSTRAINT_NAME
end
end