Commit b438a770 by Philip Hallstrom

sort the indexes by name so they are printed in a consistent order

parent ff1131da
......@@ -101,7 +101,7 @@ module AnnotateModels
return "" if indexes.empty?
max_size = indexes.collect{|index| index.name.size}.max + 1
indexes.each do |index|
indexes.sort_by{|index| index.name}.each do |index|
index_info << sprintf("# %-#{max_size}.#{max_size}s %s %s", index.name, "(#{index.columns.join(",")})", index.unique ? "UNIQUE" : "").rstrip + "\n"
end
return index_info
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment