From d3038eee925001fdb012670681f5564dd61010bf Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 14 Feb 2009 19:06:44 +0000 Subject: [PATCH] Adds an index on watchers table to speed up watched issue filtering. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2466 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../20090214190337_add_watchers_user_id_type_index.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 db/migrate/20090214190337_add_watchers_user_id_type_index.rb diff --git a/db/migrate/20090214190337_add_watchers_user_id_type_index.rb b/db/migrate/20090214190337_add_watchers_user_id_type_index.rb new file mode 100644 index 000000000..7ff4e542c --- /dev/null +++ b/db/migrate/20090214190337_add_watchers_user_id_type_index.rb @@ -0,0 +1,9 @@ +class AddWatchersUserIdTypeIndex < ActiveRecord::Migration + def self.up + add_index :watchers, [:user_id, :watchable_type], :name => :watchers_user_id_type + end + + def self.down + remove_index :watchers, :name => :watchers_user_id_type + end +end