# encoding:utf-8
class CreateProfitUsers < ActiveRecord::Migration
  def up
    #分佣方管理
    create_table :profit_users do |t|
      #微信ID
      t.column :wx_user_id, :integer,:null=>false, :default => 0
      #openId
      t.column :openid,:string
      t.timestamps
    end
    add_index :profit_users, :wx_user_id
    add_column :cash_balances, :profit_flag, :bool
    add_column :cash_balances, :trade_no,:string

  end

  def down
    drop_table :profit_users
    remove_column :cash_balances, :trade_no
    remove_column :cash_balances, :profit_flag
  end

end
