Changes between Initial Version and Version 1 of Ticket #22277
- Timestamp:
- Mar 16, 2014, 6:40:06 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #22277
- Property Component Uncategorized → Migrations
- Property Type Uncategorized → Bug
-
Ticket #22277 – Description
initial v1 1 1 I have this list of migrations (migrations.loader line 196): 2 {{{ 2 3 for i in normal.items(): print(i) 3 4 (('taggit', '0001_initial'), <Migration taggit.0001_initial>) … … 15 16 (('social_feel', '0001_initial'), <Migration social_feel.0001_initial>) 16 17 (('social_feel', '0004_posteditor'), <Migration social_feel.0004_posteditor>) 18 }}} 17 19 18 20 When the loops (django.db.migrations.loader 196): 21 {{{ 19 22 for key, migration in normal.items(): 20 23 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 }}} 25 are building dependencies for `key = ('accounts', '0003_image')` 26 there are no dependencies yet in `self.graph`, and the parent of this key is set to `('accounts', '__first__')`. 23 27 Then this parent is resolved by the line 230: 28 {{{ 24 29 parent = list(self.graph.root_nodes(parent[0]))[0] 25 30 }}} 26 31 In pdb I can see that 32 {{{ 27 33 self.graph.root_nodes(parent[0]) returns: 28 34 set([('accounts', '0003_image'), ('accounts', '0001_initial'), ('accounts', '0002_account')]) 29 also self.graph.dependenciesreturns:35 also `self.graph.dependencies` returns: 30 36 {} 37 }}} 31 38 32 And then the parent (by the line 230) is set to ('accounts', '0003_image'), i.e. it is equal to key.39 And then the parent (by the line 230) is set to `('accounts', '0003_image')`, i.e. it is equal to key. 33 40 At the end of this loop iteration this line is executed: 34 self.graph.add_dependency(key, parent) 41 `self.graph.add_dependency(key, parent)` 35 42 which adds ('accounts', '0003_image') as a dependency of itself. 36 43 Later on I can see this error: 44 {{{ 37 45 Traceback (most recent call last): 38 46 File "./manage.py", line 7, in <module> … … 71 79 raise CircularDependencyError(path[path.index(start):] + [start]) 72 80 django.db.migrations.graph.CircularDependencyError: [('accounts', '0003_image'), ('accounts', '0003_image')] 73 81 }}}