class CreatePersonRatings

Public Class Methods

down() click to toggle source
# File lib/generators/coletivo/templates/person_ratings_migration.rb, line 18
def self.down
  drop_table :person_ratings
end
up() click to toggle source
# File lib/generators/coletivo/templates/person_ratings_migration.rb, line 2
def self.up
  create_table :person_ratings do |t|
    t.integer :person_id
    t.string  :person_type

    t.integer :rateable_id
    t.string  :rateable_type

    t.decimal :weight, :precision => 5, :scale => 2

    t.timestamps
  end

  add_index :person_ratings, :rateable_type, :unique => false
end