Skip to main content

I created a unique index and I deployed my project. When I try to delete this index I am getting

“An explicit DROP INDEX is not allowed on index ‘ sales_person.unique_sales_person’ . It is being used for FOREING KEY constraint enforcement.”

error message.

I tried to clean install but it didn’t work. It is in software factory version 2022.1

How can I solve this?

 

Hi Mehmet,

Could you create a ticket for this in TCP? We'll need a backup of your database including this Indexes script so we can figure out what is causing this error to occur.

Thanks!


To fix this problem, first drop al Foreign Keys and Constraints on any of the columns used in the Index. Then drop the INDEX and afterwards you can recreate the FK and constraints. I've had a similar issue. 


To fix this problem, first drop al Foreign Keys and Constraints on any of the columns used in the Index. Then drop the INDEX and afterwards you can recreate the FK and constraints. I've had a similar issue. 

We found the issue. The table had both a Primary key and an Unique index for the same column. We'll add a validation in the next version (2022.2) to ensure developers get notified of this problem.