Monday, July 27, 2015

Re: "RuntimeError: Error creating new content types."

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJVtlupAAoJEC0ft5FqUuEhLmAQAKJPRHc13jQRwcC70YbUNBxd
VYBZodocueTPIN4MuoxzMRH/uNldhxfgL5H8NcW9vFxUpZ/Eqn1Jd1Hc0Fu3X4hI
4jq+pbKUqxbZALBjQ7gsCE1aIANWKOgSMW+aOSqbyGwll/jyGqVMVlvYhGulx8T9
OIOryMG9/Wx7XkDaciB1M76jpiRQfbUlUyCCO+eIsM11JAMXqqqW8trsqNkIh1mp
Pj7M44qN2wZHLl930UWJ27wEjSpJYCDp7UUT7RnUh0Q7/g5OeUCa2upZW8z7Jssp
8otB5OPZENBHcQdt+zOaG0FuAimSIR8G/TkfooX9xkRKoQnYh1Zk7jHYPaACpHS2
yJYpxdrYTneADlDdxGsLbwxIpq7EunU1QWNPZPWCTTknrfd4NPJ8zknkFSnnRqDY
YBrvKCXqKB87wGCr2scuTnKSJr1XoscdbQqwyr9KKjPlJ5xbVSqU2N8DwBf+U1gL
YHdAL32BAA/ymnzppglSqb5kYLbfoRAXbWbg1kKdRiZAA6mSOdZfumhGv/bkP6zq
fTsaDDPRjyBAE4JYmoNlg87F2+dFwcZ7Wiz9t2K/sNNia9fXLA33Ny9Ayta1jc3Y
tNKrJZpMXUXDtZwSsfWlW5KGGWn9bwV22Iexek+ySlTlqDHn77OtURjluLutwpOF
rNmoK6rAwhaOMnxoIqEW
=tP6t
-----END PGP SIGNATURE-----
On 07/26/2015 10:46 AM, Tobias McNulty wrote:
> I just ran into this issue as well when updating an old project to
> Django 1.8. The only suitable workaround I found was to update first to
> Django 1.7 and fake the initial migrations for my apps (presumably
> Django's as well, though it seems to handle that automatically). Only
> then can you safely update to Django 1.8. Otherwise, there is no way to
> fake only the initial migrations for the auth and contenttypes apps if
> you've already upgraded to Django 1.8 (perhaps there should be?).

I believe the way to do this is the `--fake-initial` flag to `manage.py
migrate`. It's mentioned in the migrations docs, as well as the 1.8
release notes.

In 1.7, the behavior enabled by `--fake-initial` (automatically fake any
migration where it looks like its tables already exist) was always on,
but we felt that was a bit too implicit and magical. Especially
considering that "tables already exist" is a very rough heuristic for
"is the initial migration already applied", which silently fails to
catch any kind of mismatch at the field/column level. So in 1.8 we
require the use of that heuristic to be explicitly requested.

`--fake-initial` should work equally well for your own apps or Django
contrib apps. Did you try it and it didn't work? Or were you not aware
of it? If the latter, is there someplace it ought to be documented but
isn't?

Carl

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/55B65BA9.5080709%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment