-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently we use the unique_together constraint to ensure that if a label has a shortcut key combination, no other label has the same combination. However, on SQL Server, the unique_together constraint also looks at null values which breaks the unique_together constraint since we now can no longer have two labels without shortcut keys. The error message is as follows: ``` Violation of UNIQUE KEY constraint 'api_label_project_id_prefix_key_suffix_key_1b3d8f77_uniq'. Cannot insert duplicate key in object 'dbo.api_label'. The duplicate key value is (32, <NULL>, <NULL>). ``` Moving the validation logic from the database into Django fixes the issue and makes the constraint clearer.
- Loading branch information
Showing
3 changed files
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters