add index

This commit is contained in:
Sam 2015-07-20 09:45:11 +10:00
parent a23a04a1e5
commit c552f846ae

View File

@ -431,7 +431,7 @@ class ImportScripts::Lithium < ImportScripts::Base
puts "loading data into temp table"
PostAction.exec_sql("create temp table accepted_data(post_id int)")
PostAction.exec_sql("create temp table accepted_data(post_id int primary key)")
PostAction.transaction do
results.each do |result|
@ -446,6 +446,7 @@ class ImportScripts::Lithium < ImportScripts::Base
end
end
puts "deleting dupe answers"
PostAction.exec_sql <<-SQL
DELETE FROM accepted_data WHERE post_id NOT IN (