# encoding:utf-8
class CreateLiveAwards < ActiveRecord::Migration
  def up
    #直播奖励发放
    create_table :live_awards do |t|
      #openid
      t.column :openid, :string,:limit => 256
      #会员ID
      t.column :wx_user_id, :integer, :limit => 11, :default => 0
      #事由
      t.column :remark, :string,:limit => 256
      #直播房间号
      t.column :room_id, :integer, :limit => 11, :default => 0
      # 买品1
      t.column :prod1, :integer, :limit => 11, :default => 0
      # 数量1
      t.column :nums1, :integer, :limit => 11, :default => 0
      # 买品2
      t.column :prod2, :integer, :limit => 11, :default => 0
      # 数量3
      t.column :nums2, :integer, :limit => 11, :default => 0
      # 买品3
      t.column :prod3, :integer, :limit => 11, :default => 0
      # 数量3
      t.column :nums3, :integer, :limit => 11, :default => 0
      # 赠代办金
      t.column :cash, :integer, :limit => 11, :default => 0
      # 赠积分
      t.column :cent, :integer, :limit => 11, :default => 0
      #收货地址
      t.column :address, :string,:limit => 256
      #联系人
      t.column :contact, :string,:limit => 256
      #联系电话
      t.column :tel, :string,:limit => 256
      # 发放状态
      t.column :status, :boolean, :default=>0
      t.timestamps
    end
    add_index :live_awards, :wx_user_id

  end

  def down
  	drop_table :live_awards
  end

end
