mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Do not suppress reply-to when other posts quoted
This commit is contained in:
16
db/migrate/20140731011328_add_reply_quoted_to_posts.rb
Normal file
16
db/migrate/20140731011328_add_reply_quoted_to_posts.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class AddReplyQuotedToPosts < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :posts, :reply_quoted, :boolean, null: false, default: false
|
||||
execute "UPDATE posts p
|
||||
SET reply_quoted = true
|
||||
WHERE EXISTS(
|
||||
SELECT 1 FROM quoted_posts q
|
||||
JOIN posts p1 ON p1.post_number = p.reply_to_post_number AND p1.topic_id = p.topic_id
|
||||
WHERE q.post_id = p.id AND q.quoted_post_id = p1.id
|
||||
) AND p.reply_to_post_number IS NOT NULL"
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :posts, :reply_quoted
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user