1

I made some changes to the db (i.e. added on column). I can make and run migrations just fine in my local env, the problem is in Production. I have made the migrations and pushed them to my remote repo, but when I run the migrations in production, nothing happens. I can makemigrations in production but when I run "heroku run python manage.py migrate", the system says, that are no migrations to implement.

This is worth mentioning though, initially I ran "heroku run python manage.py migrate --fake" because I had a lot intermediary tables that threw the error "table xxxxxx already exist" everytime I tried to run a migrations, so that fixed that problem but I believe that the actual change that I wanted(i.e. adding a column to the db) to make, actually got migrated as fake migration. How can I fix this?

Ayanda Khanyile
  • 235
  • 2
  • 14
  • See this link for info on --fake and --fake-initial: https://stackoverflow.com/questions/46772762/django-migrate-fake-and-fake-initial-explained. Snippet that might apply to you is "(fake) is intended for advanced users to manipulate the current migration state directly if they’re manually applying changes; be warned that using --fake runs the risk of putting the migration state table into a state where manual recovery will be needed to make migrations run correctly." I guess they mean manually delete the last migration. Also, did you try makemigrations app_name/migrate app_name? –  Dec 22 '18 at 00:14
  • Yes i did try makemigrations app_name/migrate but the problem persists. And i've tried deleting migration and rolling back git commit in heroku, that didn't help either. – Ayanda Khanyile Dec 22 '18 at 04:29

0 Answers0