20210115114641_create_user_perfomances.rb 1013 B

1234567891011121314151617181920212223242526272829303132333435
  1. # encoding:utf-8
  2. class CreateUserPerfomances < ActiveRecord::Migration
  3. def up
  4. #会员业绩汇总
  5. create_table :user_perfomances do |t|
  6. #开始时间
  7. t.column :begin_date,:datetime
  8. #结束时间
  9. t.column :end_date,:datetime
  10. #会员ID
  11. t.column :wx_user_id, :integer, :limit => 11, :default => 0
  12. #昵称
  13. t.column :nickname, :string,:limit => 256
  14. #普通订单业绩
  15. t.column :order_perfomance, :integer, :limit => 11, :default => 0
  16. # 店长专区订单业绩
  17. t.column :shop_order_perfomance, :integer, :limit => 11, :default => 0
  18. # 开店业绩
  19. t.column :shop_perfomance, :integer, :limit => 11, :default => 0
  20. # 充值业绩
  21. t.column :balance_perfomance, :integer, :limit => 11, :default => 0
  22. # 合计业绩
  23. t.column :total, :integer, :limit => 11, :default => 0
  24. t.timestamps
  25. end
  26. add_index :user_perfomances, :wx_user_id
  27. end
  28. def down
  29. drop_table :user_perfomances
  30. end
  31. end