mercredi 23 août 2023

No unique index found for id

I have faced an error "No unique index found for id" while trying to use Upsert all. But isn't ID a unique index by default? Initially we have created our application in rails 3 and now we have migrated it to rails 6. Is this issue related to the migration?

I have added the below migration and it works fine

def change add_index :order_lists, :id, unique: true, algorithm: :concurrently end

Aucun commentaire:

Enregistrer un commentaire