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 1 year 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

PR here! https://github.com/payloadcms/payload/pull/8432

r1tsuu avatar Sep 26 '24 21:09 r1tsuu

PR here! #8432

thank you for so many useful fixes lately!

HarleySalas avatar Sep 29 '24 14:09 HarleySalas

🚀 This is included in version v3.0.0-beta.114

github-actions[bot] avatar Oct 15 '24 13:10 github-actions[bot]

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.

github-actions[bot] avatar Oct 17 '24 04:10 github-actions[bot]