# encoding:utf-8
# 提货信息表
class CreatePickAddresss < ActiveRecord::Migration
  def up
    create_table :pick_addresses do |t|

      #微信用户id
      t.integer :wx_user_id
      #联系人
      t.string :contact
      #联系电话
      t.string :tel
      #备注
      t.string :remark
      #是否默认地址
      t.boolean :state, :default => false
      t.timestamps
    end
    add_index  :pick_addresses, :wx_user_id
    add_column :orders, :pick_way,  :int, :limit => 11, :default => 0
    add_column :orders, :pick_dept,  :int, :limit => 11, :default => 0
    add_column :depart_records, :pick_title, :string, :limit => 128
    add_column :depart_records, :pick_address, :string, :limit => 128
    add_column :depart_records, :pick, :boolean, :default=>false

  end

  def down
    drop_table :pick_addresses
    remove_column :orders, :pick_way
    remove_column :orders, :pick_dept
    remove_column :depart_records, :pick_title
    remove_column :depart_records, :pick_address
    remove_column :depart_records, :pick

  end
end
