(Postgres and MySQL answer)
If you look at your actual table (use \d table_name ) and look at the indexes, you will find an entry for your unique constraint. This is what Django is trying to find and drop. But he cannot find an exact match.
For instance,
"table_name_...6cf2a9c6e98cbd0d_uniq" UNIQUE CONSTRAINT, btree (d, a, b, c)
In my case, the order of the keys (d, a, b, c) did not match the restriction that he would like to remove (a, b, c, d) .
I went back to the migration history and modified the original AlterUniqueTogether to match the actual order in the database.
The migration is then completed successfully.
source share