20201114114698_create_cent_balances.rb 879 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # encoding:utf-8
  2. class CreateCentBalances < ActiveRecord::Migration
  3. def up
  4. #积分账户
  5. create_table :cent_balances do |t|
  6. #用户ID
  7. t.column :wx_uid, :integer, :null=>false
  8. #变动金额(分)
  9. t.column :count, :integer, :null=>false
  10. #来源
  11. t.column :source, :string, :limit=>64
  12. #关联ID
  13. t.column :relate_id, :string
  14. #备注
  15. t.column :remark,:string
  16. t.timestamps
  17. end
  18. #积分活动配置
  19. create_table :cent_awards do |t|
  20. #变动金额(分)
  21. t.column :count, :integer, :null=>false
  22. #活动类型
  23. t.column :c_type, :string, :limit=>64
  24. #备注
  25. t.column :remark,:string
  26. t.timestamps
  27. end
  28. add_index :cent_balances, :wx_uid
  29. add_index :cent_awards, :c_type
  30. end
  31. def down
  32. drop_table :cent_balances
  33. drop_table :cent_awards
  34. end
  35. end