diff options
Diffstat (limited to 'db/migrate/20190930025655_add_incident_management_throttle_columns_to_application_setting.rb')
-rw-r--r-- | db/migrate/20190930025655_add_incident_management_throttle_columns_to_application_setting.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/db/migrate/20190930025655_add_incident_management_throttle_columns_to_application_setting.rb b/db/migrate/20190930025655_add_incident_management_throttle_columns_to_application_setting.rb new file mode 100644 index 00000000000..577c705fbef --- /dev/null +++ b/db/migrate/20190930025655_add_incident_management_throttle_columns_to_application_setting.rb @@ -0,0 +1,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 |