{{{#!python
class Parent(models.Model):
name = models.CharField(max_length=255)
class Child(Parent):
pass
}}}
Attempting the delete `Child` will result in a migration like so:
{{{#!python
from django.db import migrations
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.RemoveField(
model_name='child',
name='parent_ptr',
),
migrations.DeleteModel(
name='Child',
),
]
}}}
Unfortunately this results in an error from PostgreSQL at least:
{{{
django.db.utils.OperationalError: (1090, "You can't delete all columns
with ALTER TABLE; use DROP TABLE instead")
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31326>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
You reported this issue on Django 1.11 but it cannot be reproduced anymore
in Django 2.2+ (likely because of
ad82900ad94ed4bbad050b9993373dafbe66b610).
It can also be easily worked around by removing the `RemoveField`
operation entirely.
Closing this ticket as invalid because the patch won't be backported to
1.11 (it only receives security backport at this point).
--
Ticket URL: <https://code.djangoproject.com/ticket/31326#comment:1>
Comment (by Stephen Finucane):
Dropping the errant line is indeed what I did. Apologies for not testing
this on a newer version.
--
Ticket URL: <https://code.djangoproject.com/ticket/31326#comment:2>