#34247 closed Bug (needsinfo)
Cannot resolve operation dependencies
Reported by: | Mike Schem | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | 4.1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I've been having trouble regenerating all my Django migrations from scratch. We have hundreds of models and many complex relationships. I kept getting the error Cannot resolve operation dependencies
when generating and I noticed that proxy models that were foreign keys of other models seemed to be the culprit. I've created a pr to fix the sort method to ensure that proxy model based CreateModel and regular model CreateModel operations are at the top.
Change History (4)
follow-up: 3 comment:1 by , 23 months ago
Easy pickings: | unset |
---|---|
Needs tests: | set |
comment:2 by , 23 months ago
Resolution: | → needsinfo |
---|---|
Status: | new → closed |
comment:3 by , 23 months ago
Replying to Tim Graham:
You'll need to provide a minimal example to reproduce the issue so we can better understand it. The patch also requires a regression test based on that.
Yea, I've tried to come up with something, but no luck so far. I've only been able to get this to fail on my project, and like I said, it has hundreds of objects with complex relations. The code does fix the problem and I see no downside to ordering proxy model and model creates at the top before the sort, any reason not to just accept the PR?
Not sure if I'll be able to come up with something here.
comment:4 by , 23 months ago
We can't add code for a problem we don't fully understand, or else Django would quickly become a mess. Without a test, we can't be sure the problem is fixed and that the behavior won't regress in the future.
You'll need to provide a minimal example to reproduce the issue so we can better understand it. The patch also requires a regression test based on that.