django.db.utils.ProgrammingError: relation "ops_sightseeing" already exists

15 views
Skip to first unread message

rishi kalsi

unread,
Jun 29, 2020, 10:12:51 AM6/29/20
to Django users
Hi, 

I am very new to Django or to web programming.
Somehow i have learnt from Django documentation to create models.

django.db.utils.ProgrammingError: relation "ops_sightseeing" already exists

I have deleted my entire model due to the above mentioned error
after deleting I ran makemigrations which was fine.

but when i run migrate it gives this error

django.db.utils.ProgrammingError: relation "ops_sightseeing" already exists


Please help me on this


Regards

Rishi



maninder singh Kumar

unread,
Jun 29, 2020, 1:31:34 PM6/29/20
to django...@googlegroups.com
Are you using multiple databases perhaps.

Regds.  Willy

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/32eca0bd-4276-469c-9f3d-013a14c07049n%40googlegroups.com.

Arpana Mehta

unread,
Jun 29, 2020, 1:48:55 PM6/29/20
to django...@googlegroups.com
This is because those tables exist in your database probably. And thus when you migrate it is showing error.

maninder singh Kumar

unread,
Jun 29, 2020, 2:00:43 PM6/29/20
to django...@googlegroups.com
This could be a case for cleaning the database up.  Is there kinda too much data in it,  and which one is it ?

Normally when you use multiple databases,  the routers could also cause the problem

Without knowing all this and the code,  it might be difficult to take a decision

Regds

Sent from my iPhone

Arpana Mehta

unread,
Jun 29, 2020, 4:07:24 PM6/29/20
to django...@googlegroups.com
You are right sir. Perhaps, if we could see the settings and models file.. it would help

Akinfolarin Stephen

unread,
Jun 29, 2020, 4:45:40 PM6/29/20
to django...@googlegroups.com
hmm however will might not be able to really understand your problem but what me i feel could help is just search for this keyword [how to delete a model in django] google will always give you an edge

Damanjeet Singh

unread,
Jun 29, 2020, 5:40:21 PM6/29/20
to django...@googlegroups.com
Hello, 

You need to remove file from migration folder.

If this doesn't work, check django_migration table in the database.

Regards

Reply all
Reply to author
Forward
0 new messages