| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- # encoding:utf-8
- #
- # 我的余额充值记录表
- #
- class CreateBalanceOrders < ActiveRecord::Migration
- def up
- create_table :balance_orders do |t|
- #订单号
- t.column :order_id, :string, :limit => 64, :null => false
- #用户ID
- t.column :user_id, :integer, :null => false
- #微信用户ID
- t.column :wx_user_id, :integer
- #支付方式
- t.column :pay_way, :string, :limit => 20
- #交易号
- t.column :trade_no, :string, :limit => 64
- #支付时间
- t.column :paied_at, :integer
- #支付金额(单位:分)
- t.column :total_price, :integer, :limit => 8, :default => 0
- #实付金额(单位:分)
- t.column :paied_price, :integer, :limit => 8, :default => 0
- # 是否支付
- t.boolean :state, :default => false
- # 中文描述
- t.column :remark, :string
- #充值银行卡
- t.column :balance_bank_card_no, :string
- t.timestamps
- end
- add_index :balance_orders, :order_id
- add_index :balance_orders, :user_id
- add_index :balance_orders, :wx_user_id
- end
- def down
- drop_table :balance_orders
- end
- end
|