According to postgresql documentation :
Adding a primary key will automatically create a unique btree index on the column or group of columns used in the primary key.
Hovewer, this does not stop you from creating a different index in the same columns. This may make sense if you use some other indexing policy (for example, the GiST index). But, if you are not sure about this, 99.9% say that you just created an identical index.
In fact, this will not affect the functionality of the application at all. The only thing to consider is that indexes are rebuilt during update operations, so some performance problems may occur. Thus, since the manual suggests removing rarely used indexes (last sentence), you better remove these indexes from db.
I am not very familiar with RoR migrations, but I think itβs enough to remove these indexes for migration.
J0hn
source share