django 1.8 upgrade custom user model syncdb

143 views
Skip to first unread message

Jochen Wersdoerfer

unread,
Apr 8, 2015, 10:56:43 AM4/8/15
to django...@googlegroups.com
Hi *,

I’m trying to upgrade to django 1.8, but running into some app-dependency
issues:


There’s an initial migration for my custom user model in accounts.models,
so the accounts_pixolususer table should have been created. The syncdb
command breaks while adding a constraint to an app without migrations
(meters), which has a model with a foreign key pointing to my custom user
model.

For syncdb there’s an easy workaround - I just run ./manage.py migrate accounts
first. But since syncdb is also called by the testrunner, so I can’t run tests
anymore :/.

best regards,
Jochen

Jochen Wersdoerfer

unread,
Apr 8, 2015, 11:32:35 AM4/8/15
to django...@googlegroups.com
On Wednesday, April 8, 2015 at 4:56:43 PM UTC+2, Jochen Wersdoerfer wrote:

There’s an initial migration for my custom user model in accounts.models,
so the accounts_pixolususer table should have been created. The syncdb
command breaks while adding a constraint to an app without migrations
(meters), which has a model with a foreign key pointing to my custom user
model.

Ok, got it. Can't have a dependency from an unmigrated app to an
app with migrations. Most of my own and some third party apps were
unmigrated. Had circular dependencies, too. Difficult upgrade. You
can add an initial migration for an umigrated third party app installed
via pip by:

./manage.py makemigrations third_party_app

But now it works \o/ :).

best regards,
Jochen 

Markus Holtermann

unread,
Apr 8, 2015, 11:46:42 AM4/8/15
to django...@googlegroups.com
Hey Jochen,

glad it works now. In that case you want to look at
https://docs.djangoproject.com/en/1.8/ref/settings/#migration-modules
and place the migrations somewhere in your project. Otherwise the
migrations end up in your virtualenv and are not available when you
deploy the application.

Best,

/Markus
>--
>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...@googlegroups.com.
>To post to this group, send email to django...@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/3ad4dc51-94c0-41da-addf-cd1676243df7%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.


--

Jochen Wersdoerfer

unread,
Apr 9, 2015, 5:01:35 AM4/9/15
to django...@googlegroups.com


On Wednesday, April 8, 2015 at 5:46:42 PM UTC+2, Markus Holtermann wrote:

glad it works now. In that case you want to look at
https://docs.djangoproject.com/en/1.8/ref/settings/#migration-modules
and place the migrations somewhere in your project. Otherwise the
migrations end up in your virtualenv and are not available when you
deploy the application.

Yep, thx - didn't know I could place the migrations anywhere :).

best regards,
Jochen 
Reply all
Reply to author
Forward
0 new messages