ORM UniqueConstraint, null value duplicate
问题 I have an entity with an unique constraint on 3 fiels. 2 fields are not nullable, and the third is nullable. My problem, when the third field is null, the unique constraint doesn't work, so i can have in my database some duplicate values like ( 5,1,null)(5,1,null) For me, ( 5,1,null) is an unique value, with null too. Do you have any ideas ? This is my ORM line : * @ORM\Table(name="table", uniqueConstraints={@ORM\UniqueConstraint(name="table_idx", columns={"field1", "field2", "field3"})})