diff --git a/script/bulk_import/discourse_merger.rb b/script/bulk_import/discourse_merger.rb index 961c8ee0135..e3d4a752b04 100644 --- a/script/bulk_import/discourse_merger.rb +++ b/script/bulk_import/discourse_merger.rb @@ -271,7 +271,7 @@ class BulkImport::DiscourseMerger < BulkImport::Base @sequences[Tag.sequence_name] = last_id + 1 [TagUser, TopicTag, CategoryTag, CategoryTagStat].each do |k| - copy_model(k, skip_processing: true) + copy_model(k) end copy_model(TagGroup, mapping: @tag_groups) [TagGroupMembership, CategoryTagGroup].each do |k| @@ -655,6 +655,26 @@ class BulkImport::DiscourseMerger < BulkImport::Base ecr end + def process_tag_user(x) + return nil if TagUser.where(tag_id: x['tag_id'], user_id: x['user_id']).exists? + x + end + + def process_topic_tag(x) + return nil if TopicTag.where(topic_id: x['topic_id'], tag_id: x['tag_id']).exists? + x + end + + def process_category_tag(x) + return nil if CategoryTag.where(category_id: x['category_id'], tag_id: x['tag_id']).exists? + x + end + + def process_category_tag_stat(x) + return nil if CategoryTagStat.where(category_id: x['category_id'], tag_id: x['tag_id']).exists? + x + end + def user_id_from_imported_id(id) return id if id.to_i < 1 super(id)