#36800: Issue with ManyToManyField renaming
-------------------------------------+-------------------------------------
Reporter: Josik | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 6.0
(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 karyon):
I saw this too. sqlmigrate in 5.2 outputs something like
{{{
-- Rename field degrees on course to programs
-- Rename field books on author to volumes
--
ALTER TABLE "my_app_author_books" RENAME TO "my_app_author_volumes";
}}}
With 6.0, the ALTER TABLE line is replaced by {{{-- (no-op)}}}.
Adding this to the migration works around it:
{{{
migrations.RunSQL(
sql='ALTER TABLE "my_app_author_books" RENAME TO
"my_app_author_volumes";',
reverse_sql='ALTER TABLE "my_app_author_volumes" RENAME TO
"my_app_author_books";',
),
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36800#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 visit
https://groups.google.com/d/msgid/django-updates/0107019b226f414d-e63ef54c-3213-4ae4-b73c-80ccd0cac38a-000000%40eu-central-1.amazonses.com.