summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-02-14 19:06:44 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-02-14 19:06:44 +0000
commitd3038eee925001fdb012670681f5564dd61010bf (patch)
tree7898e565c6e0e9a9828c5006bc1705e7b1a6d0b4 /db
parent1c2cdedf19feadfce5cddad683604b156105a5cd (diff)
downloadredmine-d3038eee925001fdb012670681f5564dd61010bf.tar.gz
redmine-d3038eee925001fdb012670681f5564dd61010bf.zip
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
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20090214190337_add_watchers_user_id_type_index.rb9
1 files changed, 9 insertions, 0 deletions
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