4 | 5 | > I have created a Django project named **dj_bug_29177**. It contains an app called **foo** with models and migrations written in such a way that the reported bug is triggered. Additionally, I’ve added code that generalizes the issue - **this bug occurs for any column added to model B**. The error disappears if I **uncomment lines 19 and 20** in migration **foo 0001**. I confirm that the issue is not related to the SQL generated by the **python manage.py migrate** command, but rather to the **python manage.py makemigrations** command. The bug affects any column used in an unmanaged model, except for id. The **solution is** to fix the Django project code so that **all fields defined on unmanaged models are included in automatically generated migrations**. I will try to check today whether the ticket already contains a test; if not, I’ll attempt to write one. As it is described [https://docs.djangoproject.com/en/dev/intro/contributing/#writing-some-tests-for-your-ticket here] it must be regression test. |