Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use an Enum as part of a composed ID. #190

Closed
danielweil opened this issue Dec 21, 2021 · 6 comments · Fixed by #191
Closed

Cannot use an Enum as part of a composed ID. #190

danielweil opened this issue Dec 21, 2021 · 6 comments · Fixed by #191
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug.
Projects
Milestone

Comments

@danielweil
Copy link

Hello,

I want to build a relation table containing three foreign keys ID's and another column containing an ENUM. As I need each row to be unique, I added a @@id containing all three ID's and the ENUM column.

When I try to start my app after generating the binaries, it gives me the following error:

image

After looking a bit into it, I found out that types.py contains a syntax error:

image

Is this behaviour expected? Can I use all four information as ID's?

Sincerely. Thanks,

@RobertCraigie RobertCraigie changed the title Using ENUM as part of composed ID. Cannot use an Enum as part of a composed ID. Dec 21, 2021
@RobertCraigie RobertCraigie added kind/bug A reported bug. bug/2-confirmed We have confirmed that this is a bug. labels Dec 21, 2021
@RobertCraigie RobertCraigie added this to To do in v1.0.0 via automation Dec 21, 2021
@RobertCraigie RobertCraigie added this to the v0.5.0 milestone Dec 21, 2021
@RobertCraigie RobertCraigie added the process/candidate Candidate for the next release label Dec 21, 2021
@danielweil
Copy link
Author

Is there any way to not use the ENUM as part of the ID and make the row unique while this fix is not released?

@RobertCraigie
Copy link
Owner

RobertCraigie commented Dec 21, 2021

@danielweil I've created a fix for this issue, can you please try it out and let me know if it fixes your issue?

pip install -U git+https://github.com/RobertCraigie/prisma-client-py@fix/190

Also, thanks for the bug report!

@danielweil
Copy link
Author

Sure! Will try it out!

@danielweil
Copy link
Author

It worked perfectly. Can you make a new merge with the transaction branch for a wip for me?

v1.0.0 automation moved this from To do to Done Dec 21, 2021
@RobertCraigie
Copy link
Owner

Yeah of course, I've just updated the wip/transactions branch.

Thanks for the bug report!

@danielweil
Copy link
Author

Excelent work!

@RobertCraigie RobertCraigie removed the process/candidate Candidate for the next release label Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug.
Projects
Development

Successfully merging a pull request may close this issue.

2 participants