I'm running into a problem after updating my project from Django 2.2 to Django 3.2.
In Django 2.2 primary keys are created using AutoField meaning in MySql they are considered int(11) and all foreign keys from this table must also be int(11).
In Django 3.2 primary keys are now created with BigAutoField which in MySql creates type bigint(20). Therefore, I can't create any foreign key relations with old tables.
According to the documentation this can be changed in settings using:
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
This works in creating primary keys as int(11) however, foreign key fields are still being created as bigint(20) meaning a relation can't be created because they must be of the same type.
Here says that you can change all your existing tables to BigAutoField but this also doesn't take care of foreign key relations.
Is there any way to change all primary keys and their relations to a different type easily? Am I missing something in the Django documentation where they also provide compatibility to related keys and well as primary keys?
I would obviously prefer to change all my existing data to work with BigAutoField if all future releases of Django will now use this as the default