class CreatePayables < ActiveRecord::Migration

  def self.up
    create_table "payables", :force => true do |t|
      t.integer  "supplier_id",           :comment => '仕入先'
      t.integer  "supplier_group_id",     :comment => '仕入先グループ'
      t.date     "cutoff_date",           :comment => '締日'
      t.date     "payment_date",          :comment => '支払日'
      t.column   "payment_type_code",     :"SMALLINT(6)", :comment => '支払方法'
      t.column   "currency_type_code",    :"SMALLINT(6)", :comment => '通貨'
      t.integer  "total_price",           :comment => '仕入合計'
      t.integer  "total_duty",            :comment => '消費税合計'
      t.integer  "total_payment",         :comment => '支払合計'
      t.integer  "total_carry",           :comment => '繰越合計'
      t.integer  "pre_total",             :comment => '前回請求額'
      t.integer  "total",                 :comment => '今回請求額'
      t.integer  "trade_sheet_cnt",       :comment => '伝票枚数'
      t.datetime "print_ledger_date",     :comment => '元帳印刷日時'
      t.datetime "created_at",            :comment => '作成日時'
      t.datetime "updated_at",            :comment => '更新日時'
    end
    execute "ALTER TABLE payables COMMENT = '買掛'"
    add_index "payables", ["supplier_id"], :name => "supplier_id"
    add_index "payables", ["supplier_group_id"], :name => "supplier_group_id"
    add_index "payables", ["cutoff_date"], :name => "cutoff_date"
    add_index "payables", ["payment_date"], :name => "payment_date"
  end

  def self.down
    drop_table :payables
  end

end
