#---
# Excerpted from "Rails Recipes"
# We make no guarantees that this code is fit for any purpose. 
# Visit http://www.pragmaticprogrammer.com/titles/fr_rr for more book information.
#---
class AddTablesForTypicalHabtm < ActiveRecord::Migration

  def self.up
    create_table :magazines do |t|
      t.column :title, :string 
    end                      
    create_table :readers do |t|
      t.column :name, :string
    end                      
    create_table :magazines_readers, :id => false do |t|
      t.column :magazine_id, :integer
      t.column :reader_id, :integer
    end

  end

  def self.down
    drop_table :magazines
    drop_table :readers
    drop_table :magazines_readers    
  end
end
