Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Add support for multiple @unique field #30

Merged
merged 1 commit into from
Dec 20, 2021
Merged

Conversation

yujonglee
Copy link
Member

@yujonglee yujonglee commented Dec 20, 2021

Resolves #29.

@@unique and @@id have not yet been considered.

@codecov-commenter
Copy link

Codecov Report

Merging #30 (33c1983) into master (66aa2f4) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #30      +/-   ##
==========================================
+ Coverage   98.51%   98.55%   +0.03%     
==========================================
  Files          14       15       +1     
  Lines         202      207       +5     
  Branches       17       17              
==========================================
+ Hits          199      204       +5     
  Misses          3        3              

@yujonglee yujonglee merged commit 161d7c2 into master Dec 20, 2021
@hyochan
Copy link
Contributor

hyochan commented Dec 20, 2021

Resolves #29.

@@unique and @@id have not yet been considered.

@yujong-lee By the way, thinking again, I think translating unique to ID is not a good idea. ID should be only one but unique can be many.

Actually, we can use ID with one unique field if id is not provided.

https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#model

@yujonglee yujonglee deleted the fix/convert-to-ID branch December 20, 2021 03:54
@yujonglee
Copy link
Member Author

yujonglee commented Dec 20, 2021

@hyochan Yes. before #30, every @unique field is converted to ID if there aren't any @id in model.
After #30, it is converted only if there are only one @unique and no @id.

I will consider @@unique and @@id in the later PR (#31).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to convert multiple @unique fields?
3 participants