0

How to fix django.db.utils.ProgrammingError: relation "some_object" does not exist? I saw lots of topic on this platform to related this error, but won't able to fix it in my case. In my case means, I am working on django and I have the postgresql database and It's working well but whenever I took pull request from git(where other person is working) and run the migration then I am getting this error. below is some links that I had tried

  1. https://stackoverflow.com/a/33055243/11360069 I just try but not working
  2. https://stackoverflow.com/a/46697898/11360069
  3. ./manage.py migrate --fake default
  4. https://stackoverflow.com/a/29672770/11360069
  5. python manage.py migrate --run-syncdb and python manage.py migrate --fake appname
  6. python manage.py migrate --fake, python manage.py migrate --fake--initial, python manage.py migrate

Only one way is working for me when I had create a new database and applying migration. But I am not sure that what will happen if, if I'll update this code on server then it will show same error then we can't delete or change the exiting database.

7
  • You probably have some missing migration files, try makemigrations and generate migration files again. Commented Mar 10, 2021 at 8:16
  • @Sajad I tried that too but not working Commented Mar 10, 2021 at 8:20
  • Did you remove existing migration files and try on a new database? Commented Mar 10, 2021 at 8:22
  • @Sajad Yes I removed and getting same error. Ya it's working on new database(localhost) but if we are merging on server side code then we can't change the database because lots of users are there in that database. Commented Mar 10, 2021 at 8:51
  • Out of interest are you the only developer or is this a case of migration dependency getting out of whack when multiple people create mergeable, but out of order migrations? Commented Mar 11, 2021 at 0:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.