Sha256: bc02228915a77bcd44a4fc165a33032a6ee4a6afbe1ca09756bd8c536c187c4c

Contents?: true

Size: 583 Bytes

Versions: 1

Compression:

Stored size: 583 Bytes

Contents

class CreateVotesTable < ActiveRecord::Migration
  def self.up
    create_table :votes, :force => true do |t|
      t.string :voteable_type
      t.integer :voteable_id
      t.integer :user_id
      t.integer :value
      t.string :ip_address
      t.string :session_hash
      t.string :browser_fingerprint            
      t.timestamps
    end
    
    add_index :votes, [:voteable_type, :voteable_id, :ip_address, :browser_fingerprint], :name => "votes_index", :unique => false
  end

  def self.down
    remove_index :votes, :name=> :votes_index
    drop_table :votes
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
social_engine-0.0.1 lib/generators/social_engine/install/templates/create_votes_table.rb