#31337: [mysql] Django loses track of renamed table when recreating a foreign
key,
resulting in "Table 'foo.bar' doesn't exist"
-------------------------------------+-------------------------------------
Reporter: Stephen Finucane | Owner: nobody
Type: Uncategorized | Status: new
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Stephen Finucane):
I can workaround this issue by moving the removal of the child class and
rename of the parent into a separate migration:
{{{
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '002_merge_foo_bar_part_a'),
]
operations = [
migrations.DeleteModel(
name='Bar',
),
migrations.RenameModel(
old_name='Foo',
new_name='Bar',
),
]
}}}
Again, just in case anyone else stumbles upon this.
--
Ticket URL: <https://code.djangoproject.com/ticket/31337#comment:1>
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/068.73cf94569dc83189862eb28f3d1e47db%40djangoproject.com.