django version upgrades and manage.py migrate

Hello,

I suppose that some Django upgrades to a newer version may imply database modifications to django core tables (auth_user, auth_group, auth_permissions, etc.).

Should we try to apply manage.py migrate to each installed Django core applications (auth, sessions, sites, admin, etc.) after each Django upgrades to a newer version?

thanks,

Welcome @JBP !

It’s generally not necessary to run migrate specifically for each app. Running manage.py migrate will migrate all installed apps.

That’s right, manage.py migrate will do. However, executing this command or manage.py migrate --plan is recommended after a Django version update?

It can’t hurt. (If there are no outstanding migrations, then nothing happens.)

However, if there are migrations that need to be applied, Django will tell you. (The “You have “n” unapplied migration(s)” message will be shown.)

So how you handle this is up to you. You can either automatically run migrate with every upgrade, or check to see if there are migrations needing to be applied. (Fundamentally, these core and contrib apps are no different than any other app.)