class CreateCustomerLedgerDetails < ActiveRecord::Migration

  def self.up
    create_table "customer_ledger_details", :force => true do |t|
      t.integer  "customer_ledger_id",    :comment => '元帳番号'
      t.column   "deal_type_code",        :"SMALLINT(6)", :comment => '取引タイプ'
      t.integer  "trade_id",              :comment => '売上番号'
      t.integer  "payment_id",            :comment => '入金番号'
      t.integer  "carry_id",              :comment => '繰越番号'
      t.datetime "created_at",            :comment => '作成日時'
      t.datetime "updated_at",            :comment => '更新日時'
    end
    execute "ALTER TABLE customer_ledger_details COMMENT = '得意先元帳明細'"
    add_index "customer_ledger_details", ["customer_ledger_id"], :name => "customer_ledger_id"
    add_index "customer_ledger_details", ["deal_type_code"], :name => "deal_type_code"
    add_index "customer_ledger_details", ["trade_id"], :name => "trade_id"
    add_index "customer_ledger_details", ["payment_id"], :name => "payment_id"
    add_index "customer_ledger_details", ["carry_id"], :name => "carry_id"
  end

  def self.down
    drop_table :customer_ledger_details
  end

end
