separated out ip ban logic from regular bans, users can no longer register if an ip ban is in place
This commit is contained in:
@@ -2,7 +2,6 @@ class CreateBans < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :bans do |t|
|
||||
t.column :user_id, :integer
|
||||
t.column :ip_addr, "inet"
|
||||
t.column :reason, :text, :null => false
|
||||
t.column :banner_id, :integer, :null => false
|
||||
t.column :expires_at, :datetime, :null => false
|
||||
@@ -10,7 +9,6 @@ class CreateBans < ActiveRecord::Migration
|
||||
end
|
||||
|
||||
add_index :bans, :user_id
|
||||
add_index :bans, :ip_addr
|
||||
add_index :bans, :expires_at
|
||||
end
|
||||
|
||||
|
||||
16
db/migrate/20100318213503_create_ip_bans.rb
Normal file
16
db/migrate/20100318213503_create_ip_bans.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class CreateIpBans < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :ip_bans do |t|
|
||||
t.column :creator_id, :integer, :null => false
|
||||
t.column :ip_addr, :inet, :null => false
|
||||
t.column :reason, :text, :null => false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :ip_bans, :ip_addr, :unique => true
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :ip_bans
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user