Changes between Initial Version and Version 1 of Ticket #29177, comment 17


Ignore:
Timestamp:
May 8, 2025, 12:06:58 PM (6 weeks ago)
Author:
Michal Mládek

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29177, comment 17

    initial v1  
    11Replying to [comment:16 Michal Mládek]:
    22Finally, there is problem only with FK. I made a mistake while I was testing unmanaged models migrations.
     3[https://github.com/django/django/pull/19452 Here] is current state of PR, still only with regression tests, one of them is more likely a test of solution.
    34
    45> 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.
Back to Top