Creating a unique nullable field and then altering it to be non-nullable no longer produces an error#77
Creating a unique nullable field and then altering it to be non-nullable no longer produces an error#77ivissani wants to merge 6 commits into
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.