Search code examples
djangodjango-modelsheroku-postgres

Running Migration in django works locally, but database is not updated when deployed to Heroku


Note: This questions has been asked before, but none of the answers provided worked for me. I deployed a django app on heroku and then made changes to my model after which i run migrations locally(python manage.py makemigrations and python manage.py migrate). The app works fine after the changes locally, but on the server, I run into the programming error below:

django.db.utils.ProgrammingError: column "product_owner_id" of relation "cart_cartitem" does not exist.
I run python manage.py migrate on the server, but I still get the same error. I also run python manage.py makemigrations on the server and it says No Changes detected.

What I am doing wrong? Thank you


Solution

  • Error fixed. I was pushing from a different directory