20201109114688_create_order_refunds.rb 984 B

1234567891011121314151617181920212223242526272829303132333435
  1. # encoding:utf-8
  2. class CreateOrderRefunds < ActiveRecord::Migration
  3. def up
  4. #订单退款记录
  5. create_table :order_refunds do |t|
  6. # 订单Id
  7. t.column :order_id, :string,:limit => 128
  8. # 微信ID
  9. t.column :wx_user_id, :integer, :limit => 11, :default => 0
  10. # 微信支付单号
  11. t.column :transaction_id, :string,:limit => 256
  12. # 订单金额
  13. t.column :total, :integer, :limit => 11, :default => 0
  14. # 微信退款金额
  15. t.column :refund_fee, :integer, :limit => 11, :default => 0
  16. # 到账时间
  17. t.column :refund_time, :integer, :limit => 11, :default => 0
  18. # 到账状态
  19. t.column :status, :boolean, :default=>0
  20. # 备注
  21. t.column :remark, :string,:limit => 128
  22. t.timestamps
  23. end
  24. add_index :order_refunds, :order_id
  25. add_column :orders, :cent_price,:integer,:limit => 11
  26. end
  27. def down
  28. drop_table :order_refunds
  29. remove_column :orders, :cent_price
  30. end
  31. end