n drosos
n drosos

Reputation: 181

Django - Migrations mixed up?

I've been working on a contract project in Django, and I performed some updates for the live server, including updates that went from South to an up to date Django version.

I was attempting to follow the instructions in the documentation, which states to delete all the old migration files except init, and then use makemigrations and "python manage.py migrate --fake-initial".

But it turns out database permissions were screwy. I was not able to apply the update.

The server owner (who was the past contractor) did not yet realize that there was a permission issue, and tried the update on his own.

The server is now working, but he stated to me he "had to do many changes to the migrations working because there was no old migrations".

I am assuming he did not know the proper way to upgrade from South to integration migrations with Django, and did it all manually rather than letting Django migrations do the work.

Well now I am ready for future updates, but I look in the migrations folder, and it looks like both the old migrations files as well as the new migrations files are in there? An example: http://screencast.com/t/gYQdc1tl4 (notice the dates).

Everything seems to be working, but I am wondering... how should I go about future migrations from here? Will a regular makemigrations/migrate work? Or should I do the --fake-initial again?

Any suggestions please? Since we strayed from documentation I'm unsure of how to go about this next.

Thanks

Upvotes: 2

Views: 159

Answers (1)

ilse2005
ilse2005

Reputation: 11429

If everything works now and you don't need the migrations for your development server, then I would just remove all old migrations (do a backup!) and start with "new migrations" using --fake-initial

Upvotes: 2

Related Questions