Class: CreateRatingsTable
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateRatingsTable
- Defined in:
- lib/generators/social_engine/install/templates/create_ratings_table.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
17 18 19 20 |
# File 'lib/generators/social_engine/install/templates/create_ratings_table.rb', line 17 def self.down remove_index :ratings, :name=> :ratings_index drop_table :ratings end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/generators/social_engine/install/templates/create_ratings_table.rb', line 2 def self.up create_table :ratings, :force => true do |t| t.string :rateable_type t.integer :rateable_id t.integer :value t.integer :user_id t.string :ip_address t.string :session_hash t.string :browser_fingerprint t. end add_index :ratings, [:rateable_type, :rateable_id, :ip_address, :browser_fingerprint], :name => "ratings_index", :unique => false end |