#35848: Problem with UniqueConstraint on fields, one of which allows NULL value.
-------------------------------------+-------------------------------------
Reporter: Андрей | Owner: (none)
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) | Resolution:
Severity: Normal | worksforme
Keywords: UniqueConstraint, | Triage Stage:
nullable, null | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):
* resolution: => worksforme
* status: new => closed
Comment:
I couldn't replicate - could you share a script?
I am using postgres 15 and Django 5.1.2
{{{
>>> MyModel.objects.create(name="Test", measure=measure_1)
<MyModel: MyModel object (1)>
>>> MyModel.objects.create(name="Test")
<MyModel: MyModel object (2)>
>>> MyModel.objects.create(name="Test", measure=measure_2)
<MyModel: MyModel object (3)>
>>> MyModel.objects.all().delete()
(3, {'app1.MyModel': 3})
>>> my_model = MyModel(name="Test")
>>> my_model.full_clean()
>>> my_model.save()
>>> my_model = MyModel(name="Test", measure=measure_1)
>>> my_model.full_clean()
>>> my_model.save()
>>> my_model = MyModel(name="Test", measure=measure_2)
>>> my_model.full_clean()
>>> my_model.save()
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35848#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701929962562d-e8d39098-d6ae-4ae5-9d06-5ba0064613a6-000000%40eu-central-1.amazonses.com.