Changes between Initial Version and Version 1 of Ticket #22277


Ignore:
Timestamp:
Mar 16, 2014, 6:40:06 PM (11 years ago)
Author:
Tim Graham
Comment:

Added some formatting for readability. In the future, please use preview, thanks!

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22277

    • Property Component UncategorizedMigrations
    • Property Type UncategorizedBug
  • Ticket #22277 – Description

    initial v1  
    11I have this list of migrations (migrations.loader line 196):
     2{{{
    23for i in normal.items(): print(i)
    34(('taggit', '0001_initial'), <Migration taggit.0001_initial>)
     
    1516(('social_feel', '0001_initial'), <Migration social_feel.0001_initial>)
    1617(('social_feel', '0004_posteditor'), <Migration social_feel.0004_posteditor>)
     18}}}
    1719
    1820When the loops (django.db.migrations.loader 196):
     21{{{
    1922        for key, migration in normal.items():
    2023            for parent in migration.dependencies:
    21 are building dependencies for key = ('accounts', '0003_image')
    22 there are no dependencies yet in self.graph, and the parent of this key is set to ('accounts', '__first__').
     24}}}
     25are building dependencies for `key = ('accounts', '0003_image')`
     26there are no dependencies yet in `self.graph`, and the parent of this key is set to `('accounts', '__first__')`.
    2327Then this parent is resolved by the line 230:
     28{{{
    2429parent = list(self.graph.root_nodes(parent[0]))[0]
    25 
     30}}}
    2631In pdb I can see that
     32{{{
    2733self.graph.root_nodes(parent[0]) returns:
    2834set([('accounts', '0003_image'), ('accounts', '0001_initial'), ('accounts', '0002_account')])
    29 also self.graph.dependencies returns:
     35also `self.graph.dependencies` returns:
    3036{}
     37}}}
    3138
    32 And then the parent (by the line 230) is set to ('accounts', '0003_image'), i.e. it is equal to key.
     39And then the parent (by the line 230) is set to `('accounts', '0003_image')`, i.e. it is equal to key.
    3340At the end of this loop iteration this line is executed:
    34 self.graph.add_dependency(key, parent)
     41`self.graph.add_dependency(key, parent)`
    3542which adds ('accounts', '0003_image') as a dependency of itself.
    3643Later on I can see this error:
     44{{{
    3745Traceback (most recent call last):
    3846  File "./manage.py", line 7, in <module>
     
    7179    raise CircularDependencyError(path[path.index(start):] + [start])
    7280django.db.migrations.graph.CircularDependencyError: [('accounts', '0003_image'), ('accounts', '0003_image')]
    73 
     81}}}
Back to Top