class AddUniqueIndexToPostsTag < ActiveRecord::Migration
  def self.up
    add_index :posts_tags, [:post_id, :tag_id], :unique => true
  end

  def self.down
    remove_index :posts_tags, :column => [:post_id, :tag_id]
  end
end

Add unique index to posts_tags to boost join performace.
Add unique index to posts_tags to boost join performace.
