1
class VoteFuMigration < ActiveRecord::Migration
3
create_table :votes, :force => true do |t|
4
t.boolean :vote, :default => false
5
t.references :voteable, :polymorphic => true, :null => false
6
t.references :voter, :polymorphic => true
10
add_index :votes, ["voter_id", "voter_type"], :name => "fk_voters"
11
add_index :votes, ["voteable_id", "voteable_type"], :name => "fk_voteables"
13
# If you want to enfore "One Person, One Vote" rules in the database, uncomment the index below
14
# add_index :votes, ["voter_id", "voter_type", "voteable_id", "voteable_type"], :unique => true, :name => "uniq_one_vote_only"