mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
FIX: S3 inventory can have duplicate etags
This commit is contained in:
parent
1045bbc35b
commit
426bd810f1
@ -37,7 +37,7 @@ class S3Inventory
|
|||||||
begin
|
begin
|
||||||
table_name = "#{inventory_id}_inventory"
|
table_name = "#{inventory_id}_inventory"
|
||||||
connection = ActiveRecord::Base.connection.raw_connection
|
connection = ActiveRecord::Base.connection.raw_connection
|
||||||
connection.exec("CREATE TEMP TABLE #{table_name}(key text UNIQUE, etag text PRIMARY KEY)")
|
connection.exec("CREATE TEMP TABLE #{table_name}(key text UNIQUE, etag text, PRIMARY KEY(etag, key))")
|
||||||
connection.copy_data("COPY #{table_name} FROM STDIN CSV") do
|
connection.copy_data("COPY #{table_name} FROM STDIN CSV") do
|
||||||
files.each do |file|
|
files.each do |file|
|
||||||
CSV.foreach(file[:filename][0...-3], headers: false) do |row|
|
CSV.foreach(file[:filename][0...-3], headers: false) do |row|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user