From d23f28953fd6ff4df54588101307b4a1db6aaf2f Mon Sep 17 00:00:00 2001 From: Vitali Tatarintev <vtatarintev@gitlab.com> Date: Fri, 21 Aug 2020 23:11:47 +0000 Subject: [PATCH] Add auto_close_incident column to incident_management_settings --- ...ident-column-to-incident_management_settings.yml | 5 +++++ ...ident_to_project_incident_management_settings.rb | 13 +++++++++++++ db/schema_migrations/20200820130839 | 1 + db/structure.sql | 1 + 4 files changed, 20 insertions(+) create mode 100644 changelogs/unreleased/add-auto_close_incident-column-to-incident_management_settings.yml create mode 100644 db/migrate/20200820130839_add_auto_close_incident_to_project_incident_management_settings.rb create mode 100644 db/schema_migrations/20200820130839 diff --git a/changelogs/unreleased/add-auto_close_incident-column-to-incident_management_settings.yml b/changelogs/unreleased/add-auto_close_incident-column-to-incident_management_settings.yml new file mode 100644 index 0000000000000..63a049cd8f553 --- /dev/null +++ b/changelogs/unreleased/add-auto_close_incident-column-to-incident_management_settings.yml @@ -0,0 +1,5 @@ +--- +title: Adds auto_close_incident column to project_incident_management_settings +merge_request: 39980 +author: +type: added diff --git a/db/migrate/20200820130839_add_auto_close_incident_to_project_incident_management_settings.rb b/db/migrate/20200820130839_add_auto_close_incident_to_project_incident_management_settings.rb new file mode 100644 index 0000000000000..01aafa6d988d6 --- /dev/null +++ b/db/migrate/20200820130839_add_auto_close_incident_to_project_incident_management_settings.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddAutoCloseIncidentToProjectIncidentManagementSettings < ActiveRecord::Migration[6.0] + DOWNTIME = false + + def up + add_column :project_incident_management_settings, :auto_close_incident, :boolean, default: true, null: false + end + + def down + remove_column :project_incident_management_settings, :auto_close_incident + end +end diff --git a/db/schema_migrations/20200820130839 b/db/schema_migrations/20200820130839 new file mode 100644 index 0000000000000..e372e4df2bebe --- /dev/null +++ b/db/schema_migrations/20200820130839 @@ -0,0 +1 @@ +751a2c8e06b522b1564ea09f961d8883543a631874ae26bb14c98b7b442d59cc \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 7fdde701fbf24..7e848777840ac 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -14403,6 +14403,7 @@ CREATE TABLE public.project_incident_management_settings ( pagerduty_active boolean DEFAULT false NOT NULL, encrypted_pagerduty_token bytea, encrypted_pagerduty_token_iv bytea, + auto_close_incident boolean DEFAULT true NOT NULL, 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)) ); -- GitLab