##// END OF EJS Templates
Fixed: migration 98 breaks when using table name prefix....
Jean-Philippe Lang -
r2361:fc6d6b1e3b27
parent child
Show More
@@ -2,9 +2,10 class SetTopicAuthorsAsWatchers < ActiveRecord::Migration
2 def self.up
2 def self.up
3 # Sets active users who created/replied a topic as watchers of the topic
3 # Sets active users who created/replied a topic as watchers of the topic
4 # so that the new watch functionality at topic level doesn't affect notifications behaviour
4 # so that the new watch functionality at topic level doesn't affect notifications behaviour
5 Message.connection.execute("INSERT INTO watchers (watchable_type, watchable_id, user_id)" +
5 Message.connection.execute("INSERT INTO #{Watcher.table_name} (watchable_type, watchable_id, user_id)" +
6 " SELECT DISTINCT 'Message', COALESCE(messages.parent_id, messages.id), messages.author_id FROM messages, users" +
6 " SELECT DISTINCT 'Message', COALESCE(m.parent_id, m.id), m.author_id" +
7 " WHERE messages.author_id = users.id AND users.status = 1")
7 " FROM #{Message.table_name} m, #{User.table_name} u" +
8 " WHERE m.author_id = u.id AND u.status = 1")
8 end
9 end
9
10
10 def self.down
11 def self.down
General Comments 0
You need to be logged in to leave comments. Login now