FIX: Import posts of missing users from phpbb3 (#9085)

Posts without a user probably shouldn't happen unless there was some direct database tampering, but data like that has been seen in the wild.

The importer will assign those posts to the "system" user.
This commit is contained in:
Jarek Radosz 2020-03-06 22:54:40 +01:00 committed by GitHub
parent 4c3bd50c13
commit f7ea2fdea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ module ImportScripts::PhpBB3
CASE WHEN u.user_type = #{Constants::USER_TYPE_IGNORE} THEN p.post_username ELSE NULL END post_username
FROM #{@table_prefix}posts p
JOIN #{@table_prefix}topics t ON (p.topic_id = t.topic_id)
JOIN #{@table_prefix}users u ON (p.poster_id = u.user_id)
LEFT OUTER JOIN #{@table_prefix}users u ON (p.poster_id = u.user_id)
WHERE p.post_id > #{last_post_id}
ORDER BY p.post_id
LIMIT #{@batch_size}