20210304114641_create_balance_promotions.rb 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # encoding:utf-8
  2. class CreateBalancePromotions < ActiveRecord::Migration
  3. def up
  4. #充值促销
  5. create_table :balance_promotions do |t|
  6. # 促销名称
  7. t.column :name, :string,:limit => 128
  8. #开始时间
  9. t.column :begin_time,:datetime
  10. #结束时间
  11. t.column :end_time,:datetime
  12. # 最小金额
  13. t.column :min_total, :integer, :limit => 11, :default => 0
  14. # 赠品1
  15. t.column :send_prod1, :integer, :limit => 11, :default => 0
  16. # 数量1
  17. t.column :send_nums1, :integer, :limit => 11, :default => 0
  18. # 赠品2
  19. t.column :send_prod2, :integer, :limit => 11, :default => 0
  20. # 赠品数量2
  21. t.column :send_nums2, :integer, :limit => 11, :default => 0
  22. # 赠品3
  23. t.column :send_prod3, :integer, :limit => 11, :default => 0
  24. # 赠品数量3
  25. t.column :send_nums3, :integer, :limit => 11, :default => 0
  26. # 状态
  27. t.column :is_enable, :boolean, :default=>1
  28. # 赠代办金
  29. t.column :cash, :integer, :limit => 11, :default => 0
  30. # 赠积分
  31. t.column :cent, :integer, :limit => 11, :default => 0
  32. t.timestamps
  33. end
  34. end
  35. def down
  36. drop_table :balance_promotions
  37. end
  38. end