Opened 9 years ago

Closed 9 years ago

#24850 closed New feature (duplicate)

Squashed migration not recognized as an initial migration

Reported by: Piotr Maliński Owned by: nobody
Component: Migrations Version: 1.8
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

I have constant problems with squash migrations not being recognised as initial migrations.

  • when replaces and old migrations exist it's ok
  • when replaces exist and old migrations do not it's ok if there are not dependant migrations in other apps (or NodeNotFoundError will be thrown)
  • when both do not exist it tries to execute the migration which fails on an existing database as tables exist

Running migrations with --fake is a local solution, but definitely not optimal for deployment where other migrations may show up and so on. In only one simple example I managed to get migration auto-faked, recognised as initial. In every other it tries to apply it.

I would say that a squash should have an explicit flag that would affect data in django_migrations. Some sort of get_or_create with an entry for that squashed migration so that no matter where the code will go - the table will be updated without the need of any forced --fake operations.

Change History (1)

comment:1 by Tim Graham, 9 years ago

Resolution: duplicate
Status: newclosed
Type: UncategorizedNew feature

Duplicate of #24375, "Add ability to mark migration as "part of initial" in Migration".

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