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

20200710130234_add_limit_constraints_to_project_incident_management_settings_token.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8af927d09597b241d6a2f605125375bd9c8c3493 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

class AddLimitConstraintsToProjectIncidentManagementSettingsToken < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers
  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_check_constraint :project_incident_management_settings, 'octet_length(encrypted_pagerduty_token) <= 255', 'pagerduty_token_length_constraint'
    add_check_constraint :project_incident_management_settings, 'octet_length(encrypted_pagerduty_token_iv) <= 12', 'pagerduty_token_iv_length_constraint'
  end

  def down
    remove_check_constraint :project_incident_management_settings, 'pagerduty_token_length_constraint'
    remove_check_constraint :project_incident_management_settings, 'pagerduty_token_iv_length_constraint'
  end
end