PERF: Add index to speed up `User#number_of_flagged_posts`.

PERF: Add index to speed up User#number_of_flagged_posts.

On meta, we were seeing the query take almost 100ms.

diff --git a/db/migrate/20190320091323_add_index_post_action_type_id_disagreed_at_on_post_actions.rb b/db/migrate/20190320091323_add_index_post_action_type_id_disagreed_at_on_post_actions.rb
new file mode 100644
index 0000000..6b23f10
--- /dev/null
+++ b/db/migrate/20190320091323_add_index_post_action_type_id_disagreed_at_on_post_actions.rb
@@ -0,0 +1,6 @@
+class AddIndexPostActionTypeIdDisagreedAtOnPostActions < ActiveRecord::Migration[5.2]
+  def change
+    add_index :post_actions, [:post_action_type_id, :disagreed_at],
+      where: "(disagreed_at IS NULL)"
+  end
+end

GitHub sha: f0f1e878