10000 Fixed #29177: FKs accessible in subsequent migrations for unmanaged models by michalnik · Pull Request #19452 · django/django · GitHub
[go: up one dir, main page]

Skip to content

Fixed #29177: FKs accessible in subsequent migrations for unmanaged models #19452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

michalnik
Copy link
@michalnik michalnik commented May 8, 2025

Work done

  1. I added regression tests for the scenario described in ticket #29177 in the test_autodetector_unmanaged module.
  2. I implemented a fix in django.db.migrations.autodetector.
  3. Finally, I added also unittests for Autodetector covering problems with unmanaged models and foreign keys

Trac ticket number

ticket-29177

Branch description

Provide a concise overview of the issue or rationale behind the proposed changes.

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.

@github-actions github-actions bot added the no ticket Based on PR title, no linked Trac ticket label May 8, 2025
@michalnik michalnik force-pushed the ticket_29177 branch 4 times, most recently from 0aeec5c to 2b75fd6 Compare May 11, 2025 17:30
@michalnik michalnik changed the title added regression tests WIP: Ticket #29177 May 12, 2025
@github-actions github-actions bot removed the no ticket Based on PR title, no linked Trac ticket label May 12, 2025
@michalnik michalnik changed the title WIP: Ticket #29177 WIP: Bug fix from ticket #29177 May 12, 2025
@michalnik michalnik force-pushed the ticket_29177 branch 9 times, most recently from cc1fc6f to 19d2f91 Compare May 13, 2025 14:29
Aloha8333 added 2 commits May 13, 2025 16:30
1) On creation of a new managed=False model in migration with FK.
2) On addition of a FK field to already created managed=False model.
3) On removing of a FK field from already created managed=False model.
Unmanaged models missed FKs in MigrationAutodetector
@michalnik michalnik changed the title WIP: Bug fix from ticket #29177 FKs accessible in subsequent migrations for unmanaged models #29177 May 13, 2025
@michalnik michalnik changed the title FKs accessible in subsequent migrations for unmanaged models #29177 Ticket #29177: FKs accessible in subsequent migrations for unmanaged models May 13, 2025
@michalnik michalnik changed the title Ticket #29177: FKs accessible in subsequent migrations for unmanaged models Fixed #29177: FKs accessible in subsequent migrations for unmanaged models May 13, 2025
@michalnik michalnik marked this pull request as draft May 18, 2025 07:44
@michalnik michalnik marked this pull request as ready for review May 18, 2025 16:31
Aloha8333 added 3 commits May 19, 2025 14:04
They had good results before this fix and they have got the same good results after it, but now
the tests are testing what they should IMHO.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0