mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 04:34:13 -06:00
BUGFIX: make sure we properly set topics.last_posted_at when importing from Vanilla
This commit is contained in:
parent
f111e4ba56
commit
90edaec9f0
@ -240,14 +240,15 @@ class Vanilla < Thor
|
||||
@discussions.each do |discussion|
|
||||
next unless topic_id = discussion[:new_id]
|
||||
|
||||
# HACK to make sure bumped_at is properly set
|
||||
# HACK: make sure both bumped_at and last_posted_at are properly set
|
||||
|
||||
sql = <<-SQL
|
||||
UPDATE topics
|
||||
SET views = :views,
|
||||
closed = :closed,
|
||||
pinned_at = :pinned_at,
|
||||
bumped_at = (SELECT created_at FROM posts WHERE topic_id = :topic_id ORDER BY created_at DESC LIMIT 1)
|
||||
last_posted_at = (SELECT MAX(created_at) FROM posts WHERE topic_id = :topic_id)
|
||||
bumped_at = (SELECT MAX(created_at) FROM posts WHERE topic_id = :topic_id)
|
||||
WHERE id = :topic_id
|
||||
SQL
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user