2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/generators/ballot_box/templates/migrate/create_votes.rb', line 2
def self.up
create_table :ballot_box_votes do |t|
t.string :voter_type, :limit => 40
t.integer :voter_id
t.string :voteable_type, :limit => 40
t.integer :voteable_id
t.integer :ip_address, :limit => 8
t.string :user_agent
t.string :referrer
t.string :browser_name, :limit => 40
t.string :browser_version, :limit => 15
t.string :browser_platform, :limit => 15
t.integer :value, :default => 1
t.timestamps
end
add_index :ballot_box_votes, [:voter_type, :voter_id]
add_index :ballot_box_votes, [:voteable_type, :voteable_id]
add_index :ballot_box_votes, :ip_address
end
|