class BuildDb < ActiveRecord::Migration
  def self.up

    create_table :cart_items do |t|
      t.column :user_id, :integer
      t.column :name, :string
      t.column :quantity, :integer, { :default => 0 }
    end

    create_table :inventory_items do |t|
      t.column :name, :string
      t.column :on_hand, :integer
    end

    InventoryItem.create :name => "Laptop",
                         :on_hand => 50
  end

  def self.down
    drop_table :cart_items
    drop_table :inventory_items
  end
end
