citusdata / django-multitenant

Python/Django support for distributed multi-tenant databases like Postgres+Citus
MIT License
712 stars 117 forks source link

Error running migrations #52

Closed ledburyb closed 4 years ago

ledburyb commented 5 years ago

The fix for https://github.com/citusdata/django-multitenant/blob/master/django_multitenant/backends/postgresql/base.py#L37 introduced a new issue.

If I make a change to a TenantForeignKey that requires an AlterField operation (e.g. change the related_name, the migration that's created will try and recreate the constraint that already exists and fail with the following error.

django.db.utils.ProgrammingError: constraint "core_order_customer_id_brand_id_c6c43641_fk_core_cust" for relation "core_order" already exists
louiseGrandjonc commented 4 years ago

Fixed in https://github.com/citusdata/django-multitenant/pull/61