-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Altering a field constrained with unique_together results in error 42000 #73
Comments
I think I identified the root cause of the problem and updated the title accordingly. It looks like altering constrained with unique_together field raises an exception. Manual dropping of such constraint allows the migration process to continue. The schema.py already has a check for unique constraints but it seems it needs a unique_together constraint test too. Thanks. |
@RussBaz Thank you for reporting! I've made the fix for the issue and pushed it to PyPI. Please let me know if you still have the same problem after upgrading django-pyodbc-azure to the latest one. |
Awesome, I just checked it and it worked flawlessly. Thanks again! |
Just recently got this same error when trying to alter the length of field constrained with unique_together:
My "fix" was to "remove" the unique constraint at the beginning of the migration and then recreate it at the end:
Using:
*The error is pretty much exactly the same as the OP's, so I just posted the final line to avoid a giant blob of the same text over and over again. I can provide more details if needed. |
I am trying to apply django-allauth (0.26.1) migrations and I am getting the following exception:
And here is the misbehaving migration from django-allauth:
(D:\Projects\myproject\env\Lib\site-packages\allauth\socialaccount\migrations\0002_token_max_lengths.py)
This is the initial migration which the failing one depends on:
(D:\Projects\myproject\env\Lib\site-packages\allauth\socialaccount\migrations\0001_initial.py)
Also, I am using SQL Server 2016 Express with windows 10, Python 3.5.2 (64 bit) and Django 1.10.
Is this a bug of django-pyodbc-azure?
Thank you.
The text was updated successfully, but these errors were encountered: