class CreateArrivingDetails < ActiveRecord::Migration

  def self.up
    create_table "arriving_details", :force => true do |t|
      t.integer  "arriving_id",         :comment => '伝票番号'
      t.integer  "seq_number",          :comment => '枝番'
      t.integer  "product_category_id", :comment => '製品カテゴリ'
      t.integer  "product_set_id",      :comment => '製品名'
      t.integer  "product_id",          :comment => '製品モデル'
      t.string   "lot_number",          :limit => 20, :comment => 'ロット'
      t.string   "serial_number",       :limit => 40, :comment => 'シリアル'
      t.date     "ubd",                 :comment => 'UBD'
      t.integer  "validity_period",      :comment => '有効期間' 
      t.column   "unit_code",           :"SMALLINT(6)", :comment => '単位'
      t.integer  "quantity",            :comment => '数量'
      t.column   "shipping_type_code",  :"SMALLINT(6)", :comment => '入荷区分'
      t.string   "detail_note",         :limit => 200, :comment => '備考'
      t.datetime "created_at",          :comment => '作成日時'
      t.datetime "updated_at",          :comment => '更新日時'
    end
    execute "ALTER TABLE arriving_details COMMENT = '入荷明細'"
    add_index "arriving_details", ["arriving_id"], :name => "arriving_id"
    add_index "arriving_details", ["product_set_id"], :name => "product_set_id"
    add_index "arriving_details", ["product_id"], :name => "product_id"
    add_index "arriving_details", ["shipping_type_code"], :name => "shipping_type_code"
  end

  def self.down
    drop_table :shipping_details
  end

end
