Fix base and vBulletin importer

This commit is contained in:
Gerhard Schlager 2015-10-21 19:07:31 +02:00
parent 1821ba8d93
commit 6238a43f93
2 changed files with 3 additions and 3 deletions

View file

@ -199,7 +199,7 @@ class ImportScripts::Base
Post.exec_sql('create temp table import_ids(val varchar(200) primary key)') Post.exec_sql('create temp table import_ids(val varchar(200) primary key)')
import_id_clause = import_ids.map{|id| "('#{PG::Connection.escape_string(id)}')"}.join(",") import_id_clause = import_ids.map{|id| "('#{PG::Connection.escape_string(id.to_s)}')"}.join(",")
Post.exec_sql("insert into import_ids values #{import_id_clause}") Post.exec_sql("insert into import_ids values #{import_id_clause}")
existing = "#{type.to_s.classify}CustomField".constantize.where(name: 'import_id') existing = "#{type.to_s.classify}CustomField".constantize.where(name: 'import_id')

View file

@ -210,7 +210,7 @@ class ImportScripts::VBulletin < ImportScripts::Base
SQL SQL
break if topics.size < 1 break if topics.size < 1
next if all_records_exist? :posts, topics.map {|t| "thread-#{topic["threadid"]}" } next if all_records_exist? :posts, topics.map {|t| "thread-#{t["threadid"]}" }
create_posts(topics, total: topic_count, offset: offset) do |topic| create_posts(topics, total: topic_count, offset: offset) do |topic|
raw = preprocess_post_raw(topic["raw"]) rescue nil raw = preprocess_post_raw(topic["raw"]) rescue nil
@ -555,7 +555,7 @@ class ImportScripts::VBulletin < ImportScripts::Base
end end
def mysql_query(sql) def mysql_query(sql)
@client.query(sql, cache_rows: false) @client.query(sql, cache_rows: true)
end end
end end