Please sign in to comment.
Fix integrity error on SQL Server
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 with 13 additions and 10 deletions.