#32205: ORM migrations after squash, command sqlmigrate will be error
-------------------------------------+-------------------------------------
     Reporter:  老广                 |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  3.1
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |  worksforme
     Keywords:  sqlmigrate           |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by elonzh):

 Replying to [comment:2 Carlton Gibson]:
 > Hi. Thanks for the report. — I can't reproduce this from the given info.
 >
 > Steps taken:
 >
 > * Create new venv with Django 2.2.17
 > * Create new project with simple model.
 > * Add fields, creating new migrations.
 > * Squash migrations
 > * Update to Django 3.1.3.
 > * Adjust model, create new migration (from squashed migration).
 >
 > All worked as expected.
 >
 > It's not clear what's going on in your case. If you can reduce it to a
 minimal example showing an issue in Django we can look again. Sorry.
 Thanks.


 This issue can be reproduced by removing the replaced migrations and the
 reported case above is just what I said.

 As the `squashmigrations` said:

 > You should commit this migration but leave the old ones in place;
 >  the new migration will be used for new installs. Once you are sure
 >  all instances of the codebase have applied the migrations you squashed,
 >  you can delete them.

 This means deleting the replaced migrations is normal behavior and should
 not cause any exception like this issue.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32205#comment:3>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.0534158d6c5b35289b5d3a09134010eb%40djangoproject.com.

Reply via email to