#31326: Deleting a concrete subclass table with no additional fields results
results in invalid migration
--------------------------------------------+------------------------
Reporter: Stephen Finucane | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------------+------------------------
Take the following models
{{{#!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.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.7a369179df226a90813bb237e054eeda%40djangoproject.com.