diff --git a/lib/active_storage/migration.rb b/lib/active_storage/migration.rb index 99d8b8554b0a85e1725caa8b22d1563cb8472973..e843c1b630051a42fe839531090543088d9a7642 100644 --- a/lib/active_storage/migration.rb +++ b/lib/active_storage/migration.rb @@ -21,9 +21,7 @@ def change t.datetime :created_at t.index :blob_id - t.index [ :record_type, :record_id ] - t.index [ :record_type, :record_id, :name ], name: "index_active_storage_attachments_record_and_name" - t.index [ :record_type, :record_id, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true + t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true end end end