"Foreign key constraint is incorrectly formed" при проведении миграции
Раньше в таблице attribute_values было int поле attribute_id. Хочу преобразовать его в ForeignKey к таблице attributes, но получаю ошибку "Foreign key constraint is incorrectly formed" (также таблицы раньше были MyIsam, переделал их в InnoDB).
Миграция выглядит так:
operations = [
migrations.RemoveField(
model_name='attributevalue',
name='attribute_id',
),
migrations.AddField(
model_name='attributevalue',
name='attribute',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='attributes.attribute'),
),
]
atrributes
attribute_values



