Commit 55f88708 authored by Toon Claes's avatar Toon Claes

Merge branch...

Merge branch '227190-add-pagerduty-related-columns-to-project_incident_management_settings' into 'master'

Add PagerDuty columns to Incident Management

Closes #227190

See merge request gitlab-org/gitlab!36277
parents 1ef0df07 d11b1a8a
---
title: Add PagerDuty integration columns to `project_incident_management_settings` table.
merge_request: 36277
author:
type: added
# 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
...@@ -23688,6 +23693,8 @@ COPY "schema_migrations" (version) FROM STDIN; ...@@ -23688,6 +23693,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