Re: [Django] #23071: Can't create migration for apps that have ForeignKeys to each other

2014-07-25 Thread Django
#23071: Can't create migration for apps that have ForeignKeys to each other
-+
 Reporter:  dekkers  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.7-rc-1
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by Andrew Godwin ):

 In [changeset:"6e7e5bacd51d1ab4411c58eea04a137639a0a354"]:
 {{{
 #!CommitTicketReference repository=""
 revision="6e7e5bacd51d1ab4411c58eea04a137639a0a354"
 [1.7.x] Fixed #23071 -- Use last migration's name in dependency to other
 app

 Changed the autodetector to lookup the name of the other app's last
 migration in the graph and use that as dependency instead of using
 __latest__.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.f7fefa6295e9c262632c879844087b97%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23071: Can't create migration for apps that have ForeignKeys to each other

2014-07-25 Thread Django
#23071: Can't create migration for apps that have ForeignKeys to each other
-+
 Reporter:  dekkers  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.7-rc-1
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by Jeroen Dekkers ):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"3582698c138a7a311d12a57d0b35359815e8dbc9"]:
 {{{
 #!CommitTicketReference repository=""
 revision="3582698c138a7a311d12a57d0b35359815e8dbc9"
 Fixed #23071 -- Use last migration's name in dependency to other app

 Changed the autodetector to lookup the name of the other app's last
 migration in the graph and use that as dependency instead of using
 __latest__.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.0e99cca9c8cd41449c9d7b352e405a2c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23071: Can't create migration for apps that have ForeignKeys to each other

2014-07-25 Thread Django
#23071: Can't create migration for apps that have ForeignKeys to each other
-+
 Reporter:  dekkers  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.7-rc-1
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by Andrew Godwin ):

 In [changeset:"ed4812692e3a103444303b0a3dd1429bbdf9511c"]:
 {{{
 #!CommitTicketReference repository=""
 revision="ed4812692e3a103444303b0a3dd1429bbdf9511c"
 Merge pull request #2938 from dekkers/ticket_23071

 Fixed #23071 -- Use last migration's name in dependency to other app
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.533ae64827e074544c0ad0f8266b9e5a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23071: Can't create migration for apps that have ForeignKeys to each other

2014-07-22 Thread Django
#23071: Can't create migration for apps that have ForeignKeys to each other
-+
 Reporter:  dekkers  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7-rc-1
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by apollo13):

 * stage:  Unreviewed => Accepted


Comment:

 Yeah, latest also doesn't work if at some point the target of the FK is
 deleted :/

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.d9dbf834e99afa684b60edcd7354e0c2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23071: Can't create migration for apps that have ForeignKeys to each other

2014-07-21 Thread Django
#23071: Can't create migration for apps that have ForeignKeys to each other
-+--
 Reporter:  dekkers  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.7-rc-1
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by dekkers):

 * needs_better_patch:   => 0
 * has_patch:  0 => 1
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 https://github.com/django/django/pull/2938

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.57944cc9a3c3200afbb8a5ed5507b490%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #23071: Can't create migration for apps that have ForeignKeys to each other

2014-07-21 Thread Django
#23071: Can't create migration for apps that have ForeignKeys to each other
-+--
 Reporter:  dekkers  |  Owner:  nobody
 Type:  Bug  | Status:  new
Component:  Migrations   |Version:  1.7-rc-1
 Severity:  Release blocker  |   Keywords:
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0|  UI/UX:  0
-+--
 ForeignKey's to other apps create a dependency on {{{__latest__}}}
 migration of that app. Because of this we can't create migrations where we
 have ForeignKey relations that go both ways, because that would result in
 app1 depending on {{{__latest__}}} of app2 and app2 depending on
 {{{__latest__}}} of app1. Way to reproduce:

 Create the following model in myapp1:
 {{{
 class Model1(models.Model):
 field = models.CharField(max_length=10)
 }}}

 And the following model in myapp2:
 {{{
 class Model2(models.Model):
 field = models.CharField(max_length=10)
 }}}

 We run makemigations creating both initial migrations. We then add the
 following model in myapp1:
 {{{
 class Model3(models.Model):
 model2 = models.ForeignKey('myapp2.Model2')
 }}}
 We run makemigrations again, this will create a myapp1 migration that
 depends on {{{__latest__}}} of myapp2.

 Then we add the following model to myapp2:
 {{{
 class Model4(models.Model):
 model1 = models.ForeignKey('myapp1.Model1')
 }}}
 We then run makemigrations again, this will create a myapp2 migration that
 depends on {{{__latest__}}} of myapp1. Running migrate then gives us a
 circular dependency error:
 {{{
 django.db.migrations.graph.CircularDependencyError: [('myapp1',
 u'0002_model3'), ('myapp2', u'0002_model4'), ('myapp1', u'0002_model3')]
 }}}

 I think the correct way to create dependency would be to create an
 explicit dependency on the latest migration of the other app at the time
 of creating the new ForeigKey instead of using {{{__latest__}}}. This will
 mean that the second myapp1 migration will depend on myapp2's
 0001_initial, and the second myapp2 migration will depend on myapp1's
 0002_model3.

 I tested this and it seems to work fine.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.1fdb0952d27badf7e9f044615b06274a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.