﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24934	Can't drop or change unique_together index in MySql	user0007	nobody	"Hello,

I'm using Django 1.8.2 and Mysql 5.6. I created model with two fields in unique_together:


{{{
    class Meta:
        unique_together = ('user', 'product')
}}}

the table was created successfully. Later I removed unique_together from my model:

{{{
    class Meta:
        pass
}}}

so Django created migration:

{{{
    operations = [
        migrations.AlterUniqueTogether(
            name='mymodel',
            unique_together=set([]),
        ),
    ]
}}}

but when i try to apply this migrattion I have got an error:

{{{
    django.db.utils.OperationalError: (1061, ""Duplicate key name 'myapp_mymodel_1ba366c5'"")
}}}

Django is trying to create this index, instead of removed them.

The same situation is when I try to add third field to my unique_together list:

{{{
    class Meta:
        unique_together = ('user', 'product', 'category')
}}}

{{{
    django.db.utils.OperationalError: (1061, ""Duplicate key name 'myapp_mymodel_1ba366c5'"")
}}}"	Bug	new	Migrations	1.8	Normal				Unreviewed	0	0	0	0	0	0
