ip bans: add hit counter, deleted flag, new ban type.
* Make IP bans soft deletable. * Add a hit counter to track how many times an IP ban has blocked someone. * Add a last hit timestamp to track when the IP ban last blocked someone. * Add a new type of IP ban, the signup ban. Signup bans restrict new signups from editing anything until they've verified their email address.
This commit is contained in:
11
db/migrate/20200406054838_add_type_to_ip_bans.rb
Normal file
11
db/migrate/20200406054838_add_type_to_ip_bans.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class AddTypeToIpBans < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_column :ip_bans, :is_deleted, :boolean, default: false, null: false
|
||||
add_column :ip_bans, :category, :integer, default: 0, null: false
|
||||
add_column :ip_bans, :hit_count, :integer, default: 0, null: false
|
||||
add_column :ip_bans, :last_hit_at, :datetime
|
||||
|
||||
add_index :ip_bans, :is_deleted
|
||||
add_index :ip_bans, :category
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user