#27750: TypeError when running manage.py migrate
---------------------------------+--------------------------------------
Reporter: Henrique Chehad | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 1.9
Severity: Normal | Resolution: needsinfo
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 Henrique Chehad):
Thanks.
The older migration file (0001_initial) that contains `artist` field was
with bytestring. I edited it and now the `migrate` worked. It was
affecting the current migration file (0005).
{{{
- ('artist', models.ForeignKey(db_column=b'actor_id',
on_delete=django.db.models.deletion.CASCADE, to='artists.Artist')),
+ ('artist', models.ForeignKey(db_column='actor_id',
on_delete=django.db.models.deletion.CASCADE, to='artists.Artist')),
}}}
Would be good a contribution with clearer error message or converting it
before the `quote_name` function?
Replying to [comment:1 Tim Graham]:
> Did you follow the advice about
[https://docs.djangoproject.com/en/1.10/topics/migrations/#supporting-
python-2-and-3 supporting Python 2 and 3]? It looks like you might have a
field in a migration that uses a bytestring (i.e. `b'artist'`). The issue
is likely obsolete with the removal of Django's support for Python 2, but
if you can reproduce some problem using only Python 3, please be more
specific about the steps and provide a sample project. Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/27750#comment:2>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/072.ff0948af46e19d947c43f30f6c42dcab%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.