From 523de079c0ac931c37375f4ea17ca119d93eef73 Mon Sep 17 00:00:00 2001 From: Adam Kiczula Date: Sat, 29 Apr 2023 14:44:16 -0500 Subject: [PATCH] Removes duplicate indexes from activities migration template As of https://github.com/rails/rails/pull/23179, using `belongs_to` or `references` automatically adds an index. #64 previously manually added the indexes, but they are no longer needed. --- .../public_activity/migration/templates/migration.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/generators/public_activity/migration/templates/migration.rb b/lib/generators/public_activity/migration/templates/migration.rb index f7aa7f2..e807e65 100644 --- a/lib/generators/public_activity/migration/templates/migration.rb +++ b/lib/generators/public_activity/migration/templates/migration.rb @@ -12,10 +12,6 @@ def self.up t.timestamps end - - add_index :activities, %i[trackable_id trackable_type] - add_index :activities, %i[owner_id owner_type] - add_index :activities, %i[recipient_id recipient_type] end # Drop table