From 83629930997e59f700faf1e00d7cac17903bdb51 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 13 May 2015 19:43:51 +1000 Subject: [PATCH] PERF: add missing index on post actions --- db/migrate/20150513094042_add_index_on_post_actions.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 db/migrate/20150513094042_add_index_on_post_actions.rb diff --git a/db/migrate/20150513094042_add_index_on_post_actions.rb b/db/migrate/20150513094042_add_index_on_post_actions.rb new file mode 100644 index 00000000000000..e79c0ce9bed556 --- /dev/null +++ b/db/migrate/20150513094042_add_index_on_post_actions.rb @@ -0,0 +1,5 @@ +class AddIndexOnPostActions < ActiveRecord::Migration + def change + add_index :post_actions, [:user_id, :post_action_type_id], where: 'deleted_at IS NULL' + end +end