Howdy, I have been working with Django for about three years now and have developed a couple business grade apps which are deployed and doing great.
The other day, I created a new project with a new database, etc.
I built out the initial models and migrated them to the proper database. However, subsequent migrations are going to a database I built for another app entirely. The two databases aren't on the same host, don't have similar names - they have nothing in common.
How is this possible? Is there some connection cache I need to clear? I haven't even had any of the other projects open or running locally- nothing.
I'm baffled.
Found the issue. I had a DATABASE_URL defined in my environment variables for one of my projects and my other project was somehow using this even though settings.py had its own definition under DATABASES.
I temporarily changed the DATABASE_URL var to a different name to eliminate it from the equation and then to be sure, I ran python manage.py migrate <app_name> zero on each app, then ran initial migrations for the auth and django tables and then makemigrations on my own models. It cleared everything up and migrated to the proper DB.
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/8qOfTvyVAVE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9b1c8381-063b-4971-9439-74b0dc0bde13n%40googlegroups.com.