Changes between Initial Version and Version 2 of Ticket #36592


Ignore:
Timestamp:
Sep 3, 2025, 6:19:00 PM (44 hours ago)
Author:
Russell Owen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36592

    • Property Summary Incorrect warning when specifying a UniqueConstraint with SQLite and nulls_distinct=TrueIncorrect warning when specifying a UniqueConstraint with SQLite and nulls_distinct=False
  • Ticket #36592 – Description

    initial v2  
    22
    33When I migrate my sqlite database I get this warning:
    4 ```
     4
     5{{{
    56SQLite does not support unique constraints with nulls distinct.
    6 ```
     7}}}
     8
     9
    710I suspect this is a bug, since I specified that nulls should not be distinct.
    811
     
    1013
    1114Here is the simplest model I could come up with that shows the issue:
    12 ```
     15{{{
    1316class SimpleModel(models.Model):
    1417    field_a = models.IntegerField(null=True)
     
    2326            ),
    2427        ]
    25 ```
     28}}}
    2629The full warning I see on migration is:
    27 ```
     30{{{
    2831WARNINGS:
    2932dances.SimpleModel: (models.W047) SQLite does not support unique constraints with nulls distinct.
    3033        HINT: A constraint won't be created. Silence this warning if you don't care about it.
    31 ```
     34}}}
    3235and, as I said before, I get the same warning if I use `nulls_distinct=True` (which is when I expect to see the warning).
Back to Top