jazzband / wagtailmenus

An app to help you manage and render menus in your Wagtail projects more effectively
MIT License
398 stars 138 forks source link

DEFAULT_AUTO_FIELD introduced in Django 3.2 behaviour #435

Closed saevarom closed 1 year ago

saevarom commented 2 years ago

I'm in the process of upgrading a project to Wagtail 4 and Django 4.1. This is a project created with Django 3.1 but later upgraded to 3.2 and now 4.1. I have been using the DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' for a few months without problems.

After the upgrade, when I run makemigrations, Django detects changes in wagtailmenus models that do not have migrations and creates a migration file in the site-packages directory:

Migrations for 'wagtailmenus':
  /usr/local/lib/python3.10/site-packages/wagtailmenus/migrations/0024_alter_flatmenu_id_alter_flatmenuitem_id_and_more.py
    - Alter field id on flatmenu
    - Alter field id on flatmenuitem
    - Alter field id on mainmenu
    - Alter field id on mainmenuitem

I'm not sure if this is expected behaviour, I find it kind of strange that my project is creating migration files in third party package folders.

Maybe wagtailmenus needs to explicitly set the auto field for the models?

MrCordeiro commented 1 year ago

Hello, we've just released a new version that solved this issue.

saevarom commented 1 year ago

Thank you!