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).

j


On Friday, February 9, 2018 at 2:17:19 PM UTC-6, jason...@gmail.com wrote:
>
> 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
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/15b6693f-8bfa-497b-8e92-ca1e46c1b1c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to