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

20190930025655_add_incident_management_throttle_columns_to_application_setting.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 577c705fbef6058ee502ace877ae35bf7060fe21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true

class AddIncidentManagementThrottleColumnsToApplicationSetting < ActiveRecord::Migration[5.2]
  # Set this constant to true if this migration requires downtime.
  DOWNTIME = false

  def up
    add_column(:application_settings,
                            :throttle_incident_management_notification_enabled,
                            :boolean,
                            null: false,
                            default: false)

    add_column(:application_settings,
                            :throttle_incident_management_notification_period_in_seconds,
                            :integer,
                            default: 3_600)

    add_column(:application_settings,
                            :throttle_incident_management_notification_per_period,
                            :integer,
                            default: 3_600)
  end

  def down
    remove_column :application_settings, :throttle_incident_management_notification_enabled
    remove_column :application_settings, :throttle_incident_management_notification_period_in_seconds
    remove_column :application_settings, :throttle_incident_management_notification_per_period
  end
end