Re: [Django] #27746: Database migration fail when removing a child model containing only foreignkeys in a multi-table inheritance context on MySQL

2017-01-24 Thread Django
#27746: Database migration fail when removing a child model containing only
foreignkeys in a multi-table inheritance context on MySQL
---+
 Reporter:  David CHANIAL  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Simon Charette):

 It looks like this can't be done at the optimizer level as not all
 `RemoveField` operations can be fold into `DeleteModel` ones. For example,
 the `RemoveField` operations removing many-to-many fields cannot be
 optimized (as the schema editor's `delete_model` function doesn't deal
 with intermediary table deletions) but there's no way to figure out
 whether or not a `RemoveField` operation removes a many-to-many field or
 not.

 I believe the method that requires adjustments is the
 `MigrationAutodetector.generate_deleted_models()` one.

--
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/064.28e3e6c6216baba58b663730d81f0d33%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27746: Database migration fail when removing a child model containing only foreignkeys in a multi-table inheritance context on MySQL

2017-01-21 Thread Django
#27746: Database migration fail when removing a child model containing only
foreignkeys in a multi-table inheritance context on MySQL
---+
 Reporter:  David CHANIAL  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Simon Charette):

 Replying to [comment:3 Tim Graham]:
 > I thought the conclusion of ticket:24424#comment:11 was that it's also
 an issue with the autodetector.

 Indeed but the only way we'll be able to solve #24424 is by teaching the
 auto-detector to either issue an `AlterField` or a combination of
 equivalent operations instead of a `RemoveField` + `AddField` in order to
 convert the `id` auto-incrementing field primay key to integer foreign key
 primary key.

 There's a side discussion about the issue encountered here from comments
 19 to 22 on #24424. I believe the solution here would be to teach field
 operations to optimize the `[FieldOperation('model', 'field'),
 RemoveModel('model')]` case to `[RemoveModel("model')]`.

--
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/064.4780ab4c9408841acd4c68b41e4d7a92%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27746: Database migration fail when removing a child model containing only foreignkeys in a multi-table inheritance context on MySQL

2017-01-21 Thread Django
#27746: Database migration fail when removing a child model containing only
foreignkeys in a multi-table inheritance context on MySQL
---+
 Reporter:  David CHANIAL  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Migrations |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Tim Graham):

 * component:  Database layer (models, ORM) => Migrations


Comment:

 I thought the conclusion of ticket:24424#comment:11 was that it's also an
 issue with the autodetector. Maybe a different one, I guess.

--
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/064.3e0b0a74ab0d028a2cc2b60ff3ec5f59%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27746: Database migration fail when removing a child model containing only foreignkeys in a multi-table inheritance context on MySQL

2017-01-20 Thread Django
#27746: Database migration fail when removing a child model containing only
foreignkeys in a multi-table inheritance context on MySQL
-+-
 Reporter:  David CHANIAL|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Simon Charette):

 * status:  closed => new
 * version:  1.9 => master
 * resolution:  duplicate =>
 * stage:  Unreviewed => Accepted


Comment:

 Tim, I re-opened the ticket because I would expect the auto-detector to
 generate a single `migrations.DeleteModel` in this case.

 #24424 is related in the sense that making sure that altered tables always
 have a column would prevent the reported crash but issuing a `DROP COLUMN`
 for every single fields a model has to finally `DROP` the table doesn't
 make much sense.

--
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/064.0cac5979a412c4cbe759f87271936386%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27746: Database migration fail when removing a child model containing only foreignkeys in a multi-table inheritance context on MySQL

2017-01-20 Thread Django
#27746: Database migration fail when removing a child model containing only
foreignkeys in a multi-table inheritance context on MySQL
-+-
 Reporter:  David CHANIAL|Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.9
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

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


Comment:

 Duplicate of #24424.

--
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/064.e1feb5962cbfa33aaa894309ee157737%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.