Solved

An explicit DROP INDEX is not allowed on index

  • 17 March 2022
  • 3 replies
  • 1068 views

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?

 

icon

Best answer by Mark Jongeling 18 March 2022, 21:03

View original

This topic has been closed for comments

3 replies

Userlevel 7
Badge +23

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!

Userlevel 5
Badge +16

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. 

Userlevel 7
Badge +23

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.