Opened 8 months ago

Closed 8 months ago

#34924 closed Bug (duplicate)

Example for squashmigration not working properly

Reported by: Sebastian Jekutsch Owned by: nobody
Component: Migrations Version: 4.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Sebastian Jekutsch)

Hi there,

sorry for the unspecific summary, but I expect to have a few issues here without knowing how to tell one from the other.

I expect squashmigrations with optimization turned on (default) to result in a squashed migration file so that running makemigration afterwards doesn't detect any migration needs. In my case though, makemigration detected for differences, i.e. some single migrations doesn't seem to be in the squashed migration file.

Squashing is important to me, because for some time I temporarily experimented with third-party libraries I don't want to include anymore. But installing/migrating in a new database still require them to be in the virtual environment, of course, if not squashed with optimization on.

See attachments:

  • Zip of single migrations 0001 to 0116
  • Resulting squashed migration file of "manage.py squashmigrations knowledgebase 0116"
  • Resulting migration file of "manage.py makemigrations" -> 0117

Additionally, I found that two models seem to have errorneously disappeared completely in the squashed migration file as well as they have not been recognized by the makemigrations cross-check (which I expected to be empty anyway):

  • Activity
  • AbstractEntity - this may be ok since it's an abstract super-class, but note that AbstractCategory *is* included in the squashing

See attachment models.py

In case any information is missing please don't hesitate to contact me.

Attachments (4)

single_migrations.zip (64.1 KB ) - added by Sebastian Jekutsch 8 months ago.
0001_squashed_0116_impact_alternative_names_alter_document_assocs_and_more.py (26.5 KB ) - added by Sebastian Jekutsch 8 months ago.
0117_alter_actor_category_alter_document_abstract_and_more.py (1.1 KB ) - added by Sebastian Jekutsch 8 months ago.
models.py (11.0 KB ) - added by Sebastian Jekutsch 8 months ago.

Download all attachments as: .zip

Change History (7)

by Sebastian Jekutsch, 8 months ago

Attachment: single_migrations.zip added

by Sebastian Jekutsch, 8 months ago

Attachment: models.py added

comment:1 by Sebastian Jekutsch, 8 months ago

Description: modified (diff)

comment:2 by Sebastian Jekutsch, 8 months ago

Description: modified (diff)

comment:3 by Mariusz Felisiak, 8 months ago

Resolution: duplicate
Status: newclosed

Thanks for this report, it's a duplicate of #26223 (document.created_at, document.abstract, evidence.reference) and #32263 (actor.category).

Note: See TracTickets for help on using tickets.
Back to Top