diff options
author | spag <spag@golwen.net> | 2013-02-03 18:50:10 +0100 |
---|---|---|
committer | spag <spag@golwen.net> | 2013-02-03 18:50:10 +0100 |
commit | 53fcddfc40f84d8fd12872e751233cb034e2832f (patch) | |
tree | 7ba8c7830aa6a4ecde7803ddd16b837409406325 /db/migrate/20130203164500_remove_perimeter_parameters.rb | |
parent | b8576b59e912905f3e30e0d69ca2d4df013bc313 (diff) |
remove_perimeter_parameters migration fixed
Diffstat (limited to 'db/migrate/20130203164500_remove_perimeter_parameters.rb')
-rw-r--r-- | db/migrate/20130203164500_remove_perimeter_parameters.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/db/migrate/20130203164500_remove_perimeter_parameters.rb b/db/migrate/20130203164500_remove_perimeter_parameters.rb index 15838bb..8c37174 100644 --- a/db/migrate/20130203164500_remove_perimeter_parameters.rb +++ b/db/migrate/20130203164500_remove_perimeter_parameters.rb @@ -1,10 +1,16 @@ -class StartPerimeterDefense < ActiveRecord::Migration +class RemovePerimeterParameters < ActiveRecord::Migration def up - module_index = GsParameter.where(:entity => 'events', :section => 'modules').all.count + 1; - GsParameter.create(:entity => 'events', :section => 'modules', :name => 'perimeter_defense', :value => module_index, :class_type => 'Integer') + 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.where(:entity => 'events', :section => 'modules', :name => 'perimeter_defense').destroy_all + 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 |