0

Right now I'm in development so frequently make changes to models, edit, delete, etc.

However often even with makemigrations and migrate Django doesn't pick up on the changes I've made.

Sometimes running python manage.py migrate --run-syncdb will solve it (yes I know this has been depreciated but it still works which is why I use it as a last resort) but sometimes it doesn't and I have to delete the sqlite database and migrate from scratch.

Obviously in production this not going to be possible and I'd like to know the best way to deal with this.

The question that has been suggested to me as a duplicate is from 2012 and the answers are no longer relevant.

Trilla
  • 943
  • 2
  • 15
  • 31
  • Possible duplicate of [Database migrations on django production](https://stackoverflow.com/questions/10826266/database-migrations-on-django-production) – ohlr Feb 20 '19 at 19:50
  • @ohlr That question is from 2012 and the information is outdated including the advice on South. – Trilla Feb 22 '19 at 09:19
  • Could you give a sample of error in the migration? – mfrackowiak Feb 22 '19 at 09:23
  • What do you mean "doesn't pick up on the changes I've made"? What sort of changes are they? I mean, this feels pretty much impossible, unless there's something deeply wrong with your Django environment. – AKX Feb 22 '19 at 09:23
  • True that, if you have a new version of django it's unlikely you use `south`. However, the rest of the answers there are still valid. For example the advise to have 3 environments. A local dev environment, a staging dev enviroment, and third a production environment. – ohlr Feb 22 '19 at 09:24
  • The error in the migration is `no changes detected` when I have in fact made a change, I have seemed to fix it the majority of the time by running `python manage.py makemigrations specificapp` but sometimes it still doesn't recognise a change. Yes I do currently run 3 environments so I appreciate the validity in that advice. – Trilla Feb 22 '19 at 15:28

0 Answers0