summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-02-08 17:24:39 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-02-08 17:24:39 +0000
commitfc6d6b1e3b27ae2343eaebbdb61315dc7184b8bd (patch)
treefb126058c7d7299002c29aa5f1f98c5e5c0aea1e /db
parentb998572def6dd49a66c02f65b367a86f3de06476 (diff)
downloadredmine-fc6d6b1e3b27ae2343eaebbdb61315dc7184b8bd.tar.gz
redmine-fc6d6b1e3b27ae2343eaebbdb61315dc7184b8bd.zip
Fixed: migration 98 breaks when using table name prefix.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2415 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db')
-rw-r--r--db/migrate/098_set_topic_authors_as_watchers.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/db/migrate/098_set_topic_authors_as_watchers.rb b/db/migrate/098_set_topic_authors_as_watchers.rb
index 5bc41fb38..92a53f4a1 100644
--- a/db/migrate/098_set_topic_authors_as_watchers.rb
+++ b/db/migrate/098_set_topic_authors_as_watchers.rb
@@ -2,9 +2,10 @@ class SetTopicAuthorsAsWatchers < ActiveRecord::Migration
def self.up
# Sets active users who created/replied a topic as watchers of the topic
# so that the new watch functionality at topic level doesn't affect notifications behaviour
- Message.connection.execute("INSERT INTO watchers (watchable_type, watchable_id, user_id)" +
- " SELECT DISTINCT 'Message', COALESCE(messages.parent_id, messages.id), messages.author_id FROM messages, users" +
- " WHERE messages.author_id = users.id AND users.status = 1")
+ Message.connection.execute("INSERT INTO #{Watcher.table_name} (watchable_type, watchable_id, user_id)" +
+ " SELECT DISTINCT 'Message', COALESCE(m.parent_id, m.id), m.author_id" +
+ " FROM #{Message.table_name} m, #{User.table_name} u" +
+ " WHERE m.author_id = u.id AND u.status = 1")
end
def self.down