class AddRatings < ActiveRecord::Migration
  def self.up
    create_table "ratings", :force => true do |t|
      t.column :score,            :integer
      t.column :comment,          :text
      t.column :user_id,          :integer
      t.column :rateable_type,    :string,  :limit => 30
      t.column :rateable_id,      :integer
      t.column :created_at,       :datetime
      t.column :updated_at,       :datetime
    end
    
    create_table "rating_comments", :force => true do |t|
      t.column :title,              :string, :limit => 100
      t.column :comment,            :text
      t.column :rating_id,          :integer
      t.column :user_id,            :integer
      t.column :parent_id,          :integer
      t.column :created_at,         :datetime
      t.column :updated_at,         :datetime
    end
  end

  def self.down
    drop_table :ratings
    drop_table :rating_comments
  end
end
