2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/generators/templates/migration.rb', line 2
def self.up
create_table :wait_a_minute_request_logs, :id => false do |t|
t.string :ip
t.boolean :refused, :nil => false, :default => false
t.datetime :created_at, :nil => false
end
add_index :wait_a_minute_request_logs, :ip
add_index :wait_a_minute_request_logs, :created_at
add_index :wait_a_minute_request_logs, [:ip, :refused], :name => 'refused_ip_index'
add_index :wait_a_minute_request_logs, [:ip, :created_at], :name => 'ip_by_date_index'
add_index :wait_a_minute_request_logs, [:ip, :created_at, :refused], :name => 'index_all'
end
|