# encoding:utf-8
class CreateMerchantTables < ActiveRecord::Migration
  def self.up
    create_table :merchants do |t|
      #商家别名
      t.column :name, :string, :limit => 100
      #用户id
      t.column :user_id, :integer
      #联系人
      t.column :contact, :string, :limit => 64
      #手机
      t.column :tel, :string, :limit => 64
      #收款人
      t.column :payee, :string, :limit => 64
      #银行账户
      t.column :bank_card_no, :string, :limit => 64
      #银行名称
      t.column :bank_name, :string, :limit => 64
      #收款凭证
      t.column :back_voucher, :string, :limit => 100
      t.timestamps
     end
     add_index :merchants, :user_id
  end

  def self.down
      drop_table :merchants
  end
  
end
