Changes between Initial Version and Version 2 of Ticket #24110


Ignore:
Timestamp:
Jan 10, 2015, 2:04:05 PM (9 years ago)
Author:
Markus Holtermann
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24110

    • Property Summary Related models in migration state are sometimes strings and not modelsUnapplying a migration has side-effects on the ProjectState passed to the method
  • Ticket #24110 – Description

    initial v2  
    1 In some edge cases, I think, related models in the migration state are referenced via strings rather than `__fake__` models. This is related to #23745 and 1aa3e09c2043c88a760e8b73fb95dc8f1ffef50e
     1`django.db.migrations.migration.Migration.unapply()` accepts an argument `state` that represents the project state right before the migration is applied. The current implementation alters this state when building the intermediate states to which each operation rolls back, instead of using a copy. This side effect results in errors where e.g. a model can exists in the state, but its gone from the database.
    22
    33{{{#!python
     
    2929AttributeError: 'str' object has no attribute '_meta'
    3030}}}
    31 
    32 I've yet to figure out when this is happening exactly.
Back to Top