I have two models and a ForeignKey. In this project I'm still using django 1.11 (still busy migrating to python3) but I have reproduced this in django 2.2.2
Models are Call and Client. Call has a ForeignKey to a PositiveIntegerField on Client. I'm changing the type of this field to a CharField, but django/mysql cannot drop or add constraints.
django.db.utils.OperationalError: (1833, "Cannot change column 'code': used in a foreign key constraint 'myapp_call_clientcode_907d4acf_fk_myapp_client_code' of table 'test_test.myapp_call'")
django.db.utils.IntegrityError: (1215, 'Cannot add foreign key constraint')
From what I've read about MySQL constraints this is caused by the different field types. Changing the type of the original field doesn't change the type of the foreign key field and the constraint cannot be re-added after dropping it.
Known workaround that I've come up with is:
run a migration to change ForeignKey on Call to PositiveIntegerField
run a migration to change the PositiveIntegerField on Client to CharField
run a migration to change the PositiveIntegerField on Call to ForeignKey
With this, both fields end up as a CharField. I'd rather have Django generate either multiple migrations or do an ALTER TABLE for related fields.