Migrations and multiple databases

42 views
Skip to first unread message

odd hogstad

unread,
Nov 24, 2016, 6:10:33 AM11/24/16
to Django users
I have two databases in my project, db1, which changes quite frequently, and db2, which seldom changes. The app was original written in django 1.3, but we've upgraded since then, and now uses 1.8. Now I need to make a change on db2 for the first time since the upgrade from 1.3. I make my changes in the model, but when I do python manage.py migrate model_of_db2 db2, the changes seems to be applyed, but I get an error:


"Error creating new content types. Please make sure contenttypes "

RuntimeError: Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually.


I tried adding a router, but same issue. What am I doing wrong? Do I need contenttypes also in db2?


Thanks!


pradam programming

unread,
Nov 24, 2016, 6:22:14 AM11/24/16
to django...@googlegroups.com
hi Hogstad,
Before doing app migrate please python manage.py migrate auth ==>I hope this will solve the issue

--
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...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/844ea033-380b-4103-86cc-311aec9f5abd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

odd hogstad

unread,
Nov 24, 2016, 12:46:27 PM11/24/16
to Django users
db1 holds the auth stuff already. Do I need to also have it in db2 for the migrations to work?


torsdag 24. november 2016 12.22.14 UTC+1 skrev pradam.programming følgende:
hi Hogstad,
Before doing app migrate please python manage.py migrate auth ==>I hope this will solve the issue
On Thu, Nov 24, 2016 at 3:54 PM, odd hogstad <odd.r....@gmail.com> wrote:
I have two databases in my project, db1, which changes quite frequently, and db2, which seldom changes. The app was original written in django 1.3, but we've upgraded since then, and now uses 1.8. Now I need to make a change on db2 for the first time since the upgrade from 1.3. I make my changes in the model, but when I do python manage.py migrate model_of_db2 db2, the changes seems to be applyed, but I get an error:


"Error creating new content types. Please make sure contenttypes "

RuntimeError: Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually.


I tried adding a router, but same issue. What am I doing wrong? Do I need contenttypes also in db2?


Thanks!


--
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.

pradam programming

unread,
Nov 25, 2016, 12:00:49 AM11/25/16
to django...@googlegroups.com
Yes do the same.

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...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

odd hogstad

unread,
Nov 25, 2016, 8:06:18 AM11/25/16
to Django users
Isn't that kind of stupid?
Yes do the same.

Reply all
Reply to author
Forward
0 new messages