class CreateActorsMovies < ActiveRecord::Migration
  def self.up
    create_table :actors_movies, :id => false do |t|
      t.integer  :actor_id,    :null => false
      t.integer  :movie_id,    :null => false
    end  
    # ADD INDEX FOR SPEED
    add_index :actors_movies, [:actor_id, :movie_id], :unique => true
  end

  def self.down
    remove_index :actors_movies, :column => [:actor_id, :movie_id]
    drop_table   :actors_movies
  end
end



