Commit 1d5391d1 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Add PagerDuty columns to Incident Management

Add PagerDuty integration columns to
`project_incident_management_settings`
parent c0df5956
# frozen_string_literal: true
class AddPagerDutyIntegrationColumnsToProjectIncidentManagementSettings < ActiveRecord::Migration[6.0]
DOWNTIME = false
# limit constraints added in a separate migration:
# 20200710130234_add_limit_constraints_to_project_incident_management_settings_token.rb
def change
add_column :project_incident_management_settings, :pagerduty_active, :boolean, null: false, default: false
add_column :project_incident_management_settings, :encrypted_pagerduty_token, :binary, null: true
add_column :project_incident_management_settings, :encrypted_pagerduty_token_iv, :binary, null: true
end
end
# 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
...@@ -14111,7 +14111,12 @@ CREATE TABLE public.project_incident_management_settings ( ...@@ -14111,7 +14111,12 @@ CREATE TABLE public.project_incident_management_settings (
project_id integer NOT NULL, project_id integer NOT NULL,
create_issue boolean DEFAULT false NOT NULL, create_issue boolean DEFAULT false NOT NULL,
send_email boolean DEFAULT false NOT NULL, send_email boolean DEFAULT false NOT NULL,
issue_template_key text issue_template_key text,
pagerduty_active boolean DEFAULT false NOT NULL,
encrypted_pagerduty_token bytea,
encrypted_pagerduty_token_iv bytea,
CONSTRAINT pagerduty_token_iv_length_constraint CHECK ((octet_length(encrypted_pagerduty_token_iv) <= 12)),
CONSTRAINT pagerduty_token_length_constraint CHECK ((octet_length(encrypted_pagerduty_token) <= 255))
); );
CREATE SEQUENCE public.project_incident_management_settings_project_id_seq CREATE SEQUENCE public.project_incident_management_settings_project_id_seq
...@@ -23645,6 +23650,8 @@ COPY "schema_migrations" (version) FROM STDIN; ...@@ -23645,6 +23650,8 @@ COPY "schema_migrations" (version) FROM STDIN;
20200707071941 20200707071941
20200707094341 20200707094341
20200707095849 20200707095849
20200708080631
20200710102846 20200710102846
20200710130234
\. \.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment