mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:42:02 +08:00
Fix occasional bug in order of imported comments (#20204)
This bug is actually a Drupal issue where some edited posts have their `created` and `changed` timestamps set to the same value. But even when that happens in Drupal it still maintains the correct post order in an affected thread. This PR makes the Discourse importer also maintain the original Drupal comment order by sorting comments in the source DB by their `cid`, which is sequential and never changes. More details from this post onward: https://meta.discourse.org/t/large-drupal-forum-migration-importer-errors-and-limitations/246939/24?u=rahim123
This commit is contained in:
parent
fc166258d3
commit
d1e844841d
|
@ -223,6 +223,7 @@ class ImportScripts::Drupal < ImportScripts::Base
|
|||
AND c.status = 1
|
||||
AND n.type IN ('blog', 'forum')
|
||||
AND n.status = 1
|
||||
ORDER BY c.cid ASC
|
||||
LIMIT #{BATCH_SIZE}
|
||||
OFFSET #{offset}
|
||||
SQL
|
||||
|
|
Loading…
Reference in New Issue
Block a user