FIX: S3 inventory can have duplicate etags

FIX: S3 inventory can have duplicate etags

diff --git a/lib/s3_inventory.rb b/lib/s3_inventory.rb
index fab1756..5b26717 100644
--- a/lib/s3_inventory.rb
+++ b/lib/s3_inventory.rb
@@ -37,7 +37,7 @@ class S3Inventory
       begin
         table_name = "#{inventory_id}_inventory"
         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
           files.each do |file|
             CSV.foreach(file[:filename][0...-3], headers: false) do |row|

GitHub sha: 426bd810