class CreateShippingDetails < ActiveRecord::Migration

  def self.up
    create_table "shipping_details", :force => true do |t|
      t.integer  "shipping_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.integer  "scheduled_quantity",   :comment => '予定数'
      t.string   "detail_note",          :limit => 200, :comment => '備考'
      t.datetime "created_at",           :comment => '作成日時'
      t.datetime "updated_at",           :comment => '更新日時'
    end
    execute "ALTER TABLE shipping_details COMMENT = '出荷明細'"
    add_index "shipping_details", ["shipping_id"], :name => "shipping_id"
    add_index "shipping_details", ["product_set_id"], :name => "product_set_id"
    add_index "shipping_details", ["product_id"], :name => "product_id"
  end

  def self.down
    drop_table :shipping_details
  end

end
