-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Description
Description
When installing the latest version (5.0.1), there are migrations that are missing under both the cms
and menus
apps.
Steps to reproduce
- Install django-cms according to the instructions for installing in an existing app: https://docs.django-cms.org/en/release-5.0.x/introduction/01-install.html
- Run
python manage.py makemigrations
Expected behaviour
No new migrations are created - they should all exist in the venv site-packages already
Actual behaviour
Migrations are found:
Migrations for 'cms':
venv/lib/python3.12/site-packages/cms/migrations/0042_alter_cmsplugin_id_alter_globalpagepermission_id_and_more.py
~ Alter field id on cmsplugin
~ Alter field id on globalpagepermission
~ Alter field id on page
~ Alter field id on pagecontent
~ Alter field id on pagepermission
~ Alter field id on pageurl
~ Alter field id on placeholder
~ Alter field id on staticplaceholder
~ Alter field id on urlconfrevision
~ Alter field id on usersettings
Migrations for 'menus':
venv/lib/python3.12/site-packages/menus/migrations/0002_alter_cachekey_id.py
~ Alter field id on cachekey
Additional information (CMS/Python/Django versions)
The migrations are probably just database no-ops (Django loves to create "migrations" that are really just internal model behaviors) but in our project we have a test that fails if any migrations are oustanding, so this breaks our CI. For now, we're working around by specifically ignoring the cms and menus apps when checking for missing migrations, but this shouldn't be necessary (and is probably a very easy fix).
For reference, the test we're using to avoid forgetting migrations:
from io import StringIO
from django.core.management import call_command
from django.test import TestCase
class PendingMigrationsTests(TestCase):
def test_no_missing_migrations(self):
stdout = StringIO()
try:
call_command(
"makemigrations",
"--check",
stdout=stdout,
stderr=StringIO(),
)
except SystemExit:
raise AssertionError(f"Missing migrations found!\n\n{stdout.getvalue()}") from None
Do you want to help fix this issue?
- Yes, I want to help fix this issue and I will join the channel #pr-reviews on the Discord Server to confirm with the community that a PR is welcome.
- [/] No, I only want to report the issue.
Metadata
Metadata
Assignees
Labels
No labels