mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 04:04:59 -05:00
DEV: Update importers from PostUpload to UploadReference (#23681)
Discourse stopped using PostUpload in https://github.com/discourse/discourse/commit/9db8f00b3dd6f2881adf1b786e29426889225e7a. Since then, these importers have been writing to the table, but any data was totally unused. This commit updates the easy cases to use UploadReference, and adds an error to the discourse_merger import script, which needs more significant work.
This commit is contained in:
@@ -189,9 +189,7 @@ class ImportScripts::HigherLogic < ImportScripts::Base
|
||||
|
||||
post.raw << "\n\n" << html
|
||||
post.save!
|
||||
unless PostUpload.where(post: post, upload: upload).exists?
|
||||
PostUpload.create!(post: post, upload: upload)
|
||||
end
|
||||
UploadReference.ensure_exist!(upload_ids: [upload.id], target: post)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user