Skip to content

Commit 5b024f9

Browse files
authored
Merge pull request #1 from indigoviolet/vi/improve-index
Improve indexes
2 parents 1a64730 + 380ff6f commit 5b024f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/annotate/annotate_models.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def get_index_info(klass, options={})
313313
if options[:format_markdown]
314314
index_info << sprintf("# * `%s`%s:\n# * **`%s`**\n", index.name, index.unique ? " (_unique_)" : "", Array(index.columns).join("`**\n# * **`"))
315315
else
316-
index_info << sprintf("# %-#{max_size}.#{max_size}s %s %s", index.name, "(#{Array(index.columns).join(",")})", index.unique ? "UNIQUE" : "").rstrip + "\n"
316+
index_info << sprintf("# %-#{max_size}.#{max_size}s %s %s %s %s", index.name, "(#{Array(index.columns).join(",")})", index.unique ? "UNIQUE" : "", index.where, (index.using != :btree ? index.using : "")).rstrip + "\n"
317317
end
318318
end
319319

0 commit comments

Comments
 (0)