20210118116666_create_live_awards.rb 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 :status, :boolean, :default=>0
  34. t.timestamps
  35. end
  36. add_index :live_awards, :wx_user_id
  37. end
  38. def down
  39. drop_table :live_awards
  40. end
  41. end