# encoding:utf-8 class CreateProductCommends < ActiveRecord::Migration def up #商品评论管理 create_table :product_commends do |t| #微信ID t.column :wx_user_id, :integer,:null=>false, :default => 0 #商品ID t.column :product_id, :integer,:null=>false, :default => 0 #订单号 t.column :order_id, :string,:limit => 256 # 文字 t.column :detail, :string,:limit => 256 #评分 t.column :score, :integer,:null=>false, :default => 0 # 状态 t.column :is_enable, :boolean, :default=>false # 是否置顶 t.column :is_top, :boolean, :default=>false # 推荐程度 t.column :recommend, :integer,:null=>false, :default => 0 # 备注 t.column :remark, :string,:limit => 256 t.timestamps end add_index :product_commends, :wx_user_id add_index :product_commends, :product_id add_column :order_details, :commend, :boolean, :default=>false end def down drop_table :product_commends end end