aerich icon indicating copy to clipboard operation
aerich copied to clipboard

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

Open markmiscavage opened this issue 1 year ago • 0 comments

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'))`

markmiscavage avatar Mar 12 '24 20:03 markmiscavage