payload icon indicating copy to clipboard operation
payload copied to clipboard

Relationship with unique: true does not work in Postgres

Open HarleySalas opened this issue 9 months ago • 2 comments

Relationship with unique: true does not work in Postgres. (Untested in mongodb) beta.30, db-postgres

to reproduce, create a collection which has a Field of type relationship, setting unique: true and proceed to create multiple documents, linking to the same relation.

In the following repo, you can observe it in the posts collection, where I attempt to make the Post.author unique, but I am able to create as many Post documents as I wish, with the same user being related to it. https://github.com/HarleySalas/payload-3-reproductions/tree/unique-relationship

HarleySalas avatar May 11 '24 13:05 HarleySalas