summaryrefslogtreecommitdiff
path: root/db/migrate/20130203164500_remove_perimeter_parameters.rb
blob: 8c37174179e5eae96dc1251545b9ec438e978aa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class RemovePerimeterParameters < ActiveRecord::Migration
  def up
    GsParameter.where(:entity => 'perimeter', :section => 'general', :name => 'malicious_contact_count').destroy_all
    GsParameter.where(:entity => 'perimeter', :section => 'general', :name => 'malicious_contact_time_span').destroy_all
    GsParameter.where(:entity => 'perimeter', :section => 'general', :name => 'ban_futile').destroy_all
    GsParameter.where(:entity => 'perimeter', :section => 'general', :name => 'execute').destroy_all

  end

  def down
  	GsParameter.create(:entity => 'perimeter', :section => 'general', :name => 'malicious_contact_count',  :value => 20, :class_type => 'Integer')
    GsParameter.create(:entity => 'perimeter', :section => 'general', :name => 'malicious_contact_time_span',  :value => 2, :class_type => 'Integer')
    GsParameter.create(:entity => 'perimeter', :section => 'general', :name => 'ban_futile',  :value => 5, :class_type => 'Integer')
    GsParameter.create(:entity => 'perimeter', :section => 'general', :name => 'execute',  :value => 'sudo /usr/local/bin/ban_ip.sh {ip_address}', :class_type => 'String')
  end
end