FIX: Dismiss new with better migration (#12062)

Original PR was reverted because of broken migration https://github.com/discourse/discourse/pull/12058

I fixed it by adding this line
```
          AND topics.id IN(SELECT id FROM topics ORDER BY created_at DESC LIMIT :max_new_topics)
```

This time it is left joining a limited amount of topics. I tested it on few databases and it worked quite smooth
This commit is contained in:
Krzysztof Kotlarek
2021-02-15 08:50:33 +11:00
committed by GitHub
parent 7fe5368718
commit ad3ec5809f
13 changed files with 92 additions and 93 deletions

View File

@@ -317,7 +317,6 @@ describe Jobs::ExportUserArchive do
.where(category_id: category_id)
.first_or_initialize
.update!(last_seen_at: reset_at)
#TopicTrackingState.publish_dismiss_new(user.id, category_id)
end
# Set Watching First Post on announcements, Tracking on subcategory, Muted on deleted, nothing on subsubcategory