Skip to content
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

Model with multiple FKs to same table throws error or finds changes that aren't there #330

Open
markmiscavage opened this issue Mar 12, 2024 · 0 comments

Comments

@markmiscavage
Copy link

markmiscavage commented Mar 12, 2024

In aerich/migrate.py line 244 the list of dicts being diff'd aren't ordered so there are cases when the diff is finding changes only due to ordering.

Monkey Patch to fix:

`import operator

old_m2m_fields = sorted(old_m2m_fields, key=operator.itemgetter('name'))
new_m2m_fields = sorted(new_m2m_fields, key=operator.itemgetter('name'))`

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

No branches or pull requests

1 participant