You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hello all,
I'm using 1.11 and have a migration that is throwing:
django.db.utils.ProgrammingError: constraint "inventory_ltmvirtualserver_ltm_id_47dc1635_fk" for relation "inventory_ltmvirtualserver" already exists
I'm having troubles figuring this out for a couple reasons. First, the migration scripts ran fine against the development and stage environments and only fails in production. Also, if I export the production database and import that copy to the development environment the migration works just fine.
The other issue I'm having is that the migration in question (inventory.0040_auto_20180104_1225) doesn't actually reference the "ltmvirtualserver" model. I can't figure out why the migration is attempting to create this constraint.
The backend database is Postgres.
What information can I provide to help track this down? Migration scripts? Is there a way to get the precise line in the migration script that is being processed when the error is thrown?
Thanks in advance for the help.
j
jason...@gmail.com
unread,
Feb 9, 2018, 5:03:27 PM2/9/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
I was able to work around the issue by dumping out the SQL for the migration that was failing (manage.py sqlmigrate ...) and running through the steps manually (skipping the "already exists" constraints) and finally marking the migration as completed (with a --fake).