Sha256: 01985a1ba8fcb029895250c70d2f9e27ad4033f80761fabb9fcdcfe8ed595c97

Contents?: true

Size: 377 Bytes

Versions: 4

Compression:

Stored size: 377 Bytes

Contents

class AddRatingToProducts < ActiveRecord::Migration
  def self.up
    add_column :products, :avg_rating, :decimal, :default => 0.0, :null => false, :precision => 7, :scale => 5
    add_column :products, :reviews_count, :integer, :default => 0, :null => false
  end

  def self.down
    remove_column :products, :reviews_count
    remove_column :products, :avg_rating
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spree_reviews_rating-0.70.7.1 db/migrate/20110406083603_add_rating_to_products.rb
spree_reviews_rating-0.70.7 db/migrate/20110406083603_add_rating_to_products.rb
spree_reviews_rating-0.70.6.1 db/migrate/20110406083603_add_rating_to_products.rb
spree_reviews_rating-0.70.6 db/migrate/20110406083603_add_rating_to_products.rb