-
Notifications
You must be signed in to change notification settings - Fork 51
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
Creating a unique nullable field and then altering it to be non-nullable no longer produces an error #77
base: master
Are you sure you want to change the base?
Conversation
This migration fails
This reverts commit de0584a.
Any idea when this may merged on the master branch? I'm seeing this issue pop up when trying to integrate djangorestframework-api-key into an existing project. |
I don't think this is going to be merged anytime soon. I've had no feedback at all. Besides this there are many other problems with this backend. I would recommend to stay away from Django+SQLServer whenever possible. |
Thanks for the info. Unfortunately, my company uses SQL Server exclusively so I don't have much choice but to press forward. |
@dcleveng Microsoft has forked this backend and is developing it here https://github.com/microsoft/mssql-django |
Problem was that the unique index generated during the creation of the field was being run as a deferred_sql. But the alter field executed the statement to create the unique index in place. Therefore the deferred statement failed because an index with the same name already existed.
With this PR, the alter field removes any deferred statement that would attempt to create a unique index that has already been created.