20210220114641_create_product_commends.rb 920 B

123456789101112131415161718192021222324252627282930313233343536
  1. # encoding:utf-8
  2. class CreateProductCommends < ActiveRecord::Migration
  3. def up
  4. #商品评论管理
  5. create_table :product_commends do |t|
  6. #微信ID
  7. t.column :wx_user_id, :integer,:null=>false, :default => 0
  8. #商品ID
  9. t.column :product_id, :integer,:null=>false, :default => 0
  10. #订单号
  11. t.column :order_id, :string,:limit => 256
  12. # 文字
  13. t.column :detail, :string,:limit => 256
  14. #评分
  15. t.column :score, :integer,:null=>false, :default => 0
  16. # 状态
  17. t.column :is_enable, :boolean, :default=>false
  18. # 是否置顶
  19. t.column :is_top, :boolean, :default=>false
  20. # 推荐程度
  21. t.column :recommend, :boolean, :default=>false
  22. # 备注
  23. t.column :remark, :string,:limit => 256
  24. t.timestamps
  25. end
  26. add_index :product_commends, :admin_user_id
  27. end
  28. def down
  29. drop_table :product_commends
  30. end
  31. end