# Why we can't use unique=True inplace of primaryKey=True for a onetoone relationship

**URL:** <https://forum.codewithmosh.com/t/why-we-cant-use-unique-true-inplace-of-primarykey-true-for-a-onetoone-relationship/19449>\
**Category:** Django\
**Created:** [April 8, 2023, 12:21pm UTC](https://forum.codewithmosh.com/t/why-we-cant-use-unique-true-inplace-of-primarykey-true-for-a-onetoone-relationship/19449 "2023-04-08T12:21:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Learner](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/learner/32/6012_2.png) [@Learner](https://forum.codewithmosh.com/u/Learner)\
**Post date:** [April 8, 2023, 12:21pm UTC](https://forum.codewithmosh.com/t/why-we-cant-use-unique-true-inplace-of-primarykey-true-for-a-onetoone-relationship/19449/1 "2023-04-08T12:21:48Z")

</div>

In Building a data model section, why can’t we use unique=True for making the customer unique inplace of using primary key=True?
