DEV: follow up on bb8cdf9e, assume no dupe bounce_keys

DEV: follow up on bb8cdf9e, assume no dupe bounce_keys

We may have tons of emails in the email logs, assume none are duplicate hunting for duplication can be very expensive.

diff --git a/db/migrate/20190502223613_add_bounce_key_index_on_email_logs.rb b/db/migrate/20190502223613_add_bounce_key_index_on_email_logs.rb
index f7d8493..c0c66f5 100644
--- a/db/migrate/20190502223613_add_bounce_key_index_on_email_logs.rb
+++ b/db/migrate/20190502223613_add_bounce_key_index_on_email_logs.rb
@@ -1,14 +1,5 @@
 class AddBounceKeyIndexOnEmailLogs < ActiveRecord::Migration[5.2]
   def change
-    execute <<~SQL
-      DELETE FROM email_logs l
-      WHERE bounce_key IS NOT NULL
-        AND id > (
-          SELECT MIN(id)
-          FROM email_logs l2
-          WHERE l2.bounce_key = l.bounce_key
-        )
-    SQL
     add_index :email_logs, [:bounce_key], unique: true, where: 'bounce_key IS NOT NULL'
   end
 end

GitHub sha: 413a54e7

1 Like