20210118116666_create_live_awards.rb 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # encoding:utf-8
  2. class CreateLiveAwards < ActiveRecord::Migration
  3. def up
  4. #直播奖励发放
  5. create_table :live_awards do |t|
  6. #openid
  7. t.column :openid, :string,:limit => 256
  8. #会员ID
  9. t.column :wx_user_id, :integer, :limit => 11, :default => 0
  10. #事由
  11. t.column :remark, :string,:limit => 256
  12. #直播房间号
  13. t.column :room_id, :integer, :limit => 11, :default => 0
  14. # 买品1
  15. t.column :prod1, :integer, :limit => 11, :default => 0
  16. # 数量1
  17. t.column :nums1, :integer, :limit => 11, :default => 0
  18. # 买品2
  19. t.column :prod2, :integer, :limit => 11, :default => 0
  20. # 数量3
  21. t.column :nums2, :integer, :limit => 11, :default => 0
  22. # 买品3
  23. t.column :prod3, :integer, :limit => 11, :default => 0
  24. # 数量3
  25. t.column :nums3, :integer, :limit => 11, :default => 0
  26. # 赠代办金
  27. t.column :cash, :integer, :limit => 11, :default => 0
  28. # 赠积分
  29. t.column :cent, :integer, :limit => 11, :default => 0
  30. #收货地址
  31. t.column :address, :string,:limit => 256
  32. #联系人
  33. t.column :contact, :string,:limit => 256
  34. #联系电话
  35. t.column :tel, :string,:limit => 256
  36. # 发放状态
  37. t.column :status, :boolean, :default=>0
  38. t.timestamps
  39. end
  40. add_index :live_awards, :wx_user_id
  41. end
  42. def down
  43. drop_table :live_awards
  44. end
  45. end