mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:16:38 -06:00
FIX: support amazon S3 upload urls in discourse_merger.rb
This commit is contained in:
parent
1ad358fa0a
commit
8d11df6971
@ -285,7 +285,9 @@ class BulkImport::DiscourseMerger < BulkImport::Base
|
||||
source_raw_connection.exec("SELECT * FROM uploads").each do |row|
|
||||
user_id = row['user_id'].to_i
|
||||
user_id = user_id_from_imported_id(user_id) if user_id > 0
|
||||
absolute_filename = File.join(@uploads_path, row['url'].gsub(/^\/uploads\/[^\/]+\//, ''))
|
||||
rel_filename = row['url'].gsub(/^\/uploads\/[^\/]+\//, '')
|
||||
rel_filename = rel_filename.gsub(/^\/\/[^\/]+\.amazonaws\.com\//, '')
|
||||
absolute_filename = File.join(@uploads_path, rel_filename)
|
||||
print '.'
|
||||
|
||||
next unless File.exists?(absolute_filename)
|
||||
|
Loading…
Reference in New Issue
Block a user