module ActsAsArchive
  module Base
    module Adapters
      module MySQL
        
        private

        def archive_table_indexed_columns
          index_query = "SHOW INDEX FROM archived_#{table_name}"
          indexes = connection.select_all(index_query).collect do |r|
            r["Column_name"]
          end
        end
      end
    end
  end
end
module ActsAsArchive
  module Base
    module Adapters
      module MySQL
        
        private

        def archive_table_indexed_columns
          index_query = "SHOW INDEX FROM archived_#{table_name}"
          indexes = connection.select_all(index_query)
          final_indexes = []
          current_index = 0
          indexes.each do |index|
            if index['Seq_in_index'] != '1'
              final_indexes[current_index-1] = Array(final_indexes[current_index-1]).flatten.concat(Array(index['Column_name']))
            else
              final_indexes[current_index] = index['Column_name']
              current_index += 1
            end
          end
          return final_indexes
        end
      end
    end
  end
end

Add multi-columns indexes support for MySQL
Add multi-columns indexes support for MySQL

refs #6
Acts_as_archive now fully supports the following syntax :

acts_as_archive :indexes => [ :id, [:subject_id, :subject_type],
:created_at, :deleted_at ]

for MySQL and Postgresql
