Django-cms: InconsistentMigrationHistory caused by Django CMS migration dependencies

Created on 10 Jan 2018  路  3Comments  路  Source: django-cms/django-cms

Summary

Attempting to upgrade Django and Django CMS to latest version causes an InconsistentMigrationHistory when running migrations.

Expected behaviour

Migrations work

Actual behaviour

You get:

django.db.migrations.exceptions.InconsistentMigrationHistory: Migration cms.0010_migrate_use_structure is applied before its dependency
contenttypes.0002_remove_content_type_name on database 'default'.

Environment

  • Python version: 2.7.12
  • Django version: 1.11.19
  • django CMS version: 3.4.5

Analysis

The migration in cms/migrations/0010_migrate_use_structure.py defines it's dependencies as:

    dependencies = [
        ('cms', '0009_merge'),
        ('contenttypes', '__latest__'),
    ]

So if contenttypes gets a new migration after you've already applied 0010_migrate_use_structure, Django thinks your migration history is inconsistent.

bug accepted has patch

Most helpful comment

how to do fukers jsut discuss but not give a singal idea about it

All 3 comments

Hello @aliceh75,
Thanks for reporting this.
If you can, please have a look at https://github.com/divio/django-cms/pull/6261

Thanks you :) I don't have the environment to test the fix any more (the problem was easily bypassed by temporarily commenting the offending line, I mostly reported it for future users) - but the patch makes sense.

how to do fukers jsut discuss but not give a singal idea about it

Was this page helpful?
0 / 5 - 0 ratings