I am working on a website in Django 1.9.8, and am trying to deploy an updated version of it to a server to demo it.
As I have been learning Django as I develop this, I have made the mistake a few times of deleting my migrations and creating new ones when I run into database issues. This works fine on my dev when I am able to just delete an existing database, but is causing issues trying to get this deployed on the demo server without loosing the existing database data.
I don't have the migration for the existing database schema on the demo server, and when I run manage.py makemigration <myappname>
, it creates a initial migration for the app. When I attempt to run manage.py migrate <myappname>
, it tells me that the tables already exist (because the migration is trying to add all of those tables, rather than do the modifications needed to be done on the database).
Is there a way to create an initial migration based off of the current database, that I could then run makemigrations to get a migration that will modify the current database to be up to date with the current model?
Appologies if this is already answered somewhere, I have looked and had no lucking finding an answer.
Thanks!