PERF: added missing indexes for pinned topics

This commit is contained in:
Sam 2015-02-24 11:53:32 +11:00
parent 738f2cb72c
commit 8c7cce1bfc

View File

@ -0,0 +1,6 @@
class AddPinnedIndexes < ActiveRecord::Migration
def change
add_index :topics, :pinned_globally, where: 'pinned_globally'
add_index :topics, :pinned_at, where: 'pinned_at IS NOT NULL'
end
end