#36141: After double squashing migrate command fails with
InconsistentMigrationHistory
-----------------------------+-------------------------------------------
     Reporter:  Jacob Walls  |                     Type:  Bug
       Status:  new          |                Component:  Migrations
      Version:  dev          |                 Severity:  Release blocker
     Keywords:               |             Triage Stage:  Unreviewed
    Has patch:  0            |      Needs documentation:  0
  Needs tests:  0            |  Patch needs improvement:  0
Easy pickings:  0            |                    UI/UX:  0
-----------------------------+-------------------------------------------
 [main/6.0]
 Make four migrations, migrate, squash the first two, then squash the first
 three: then migrate (or makemigrations --check) fails.

 {{{#!shell
 manage.py makemigrations myapp --empty
 manage.py makemigrations myapp --empty
 manage.py makemigrations myapp --empty
 manage.py makemigrations myapp --empty
 manage.py migrate
 manage.py squashmigrations myapp 0001 0002
 manage.py squashmigrations myapp 0001_initial_squashed 0003
 manage.py migrate
 }}}

 {{{
 django.db.migrations.exceptions.InconsistentMigrationHistory: Migration
 myapp.0004_auto_20250126_1339 is applied before its dependency
 
new.0001_initial_squashed_0002_auto_20250126_1339_squashed_0003_auto_20250126_1339
 on database 'default'.
 }}}

 Other migration commands can be subbed for that last call and still
 produce the same error, e.g. `makemigrations --check`, which is likely in
 a CI setting.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36141>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070194a42f6c01-89f130fe-62f8-4e0e-99b0-9f007d98e727-000000%40eu-central-1.amazonses.com.

Reply via email to