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

Type Aliases not working #896

Closed
yovanoc opened this issue Nov 7, 2019 · 16 comments
Closed

Type Aliases not working #896

yovanoc opened this issue Nov 7, 2019 · 16 comments
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug.
Milestone

Comments

@yovanoc
Copy link

yovanoc commented Nov 7, 2019

Hello I see since one of the latest alpha I can't use my custom type.

image

image

PS: this error happen while prisma2 lift up

@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. labels Nov 8, 2019
@pantharshit00
Copy link
Contributor

I can confirm this bug.

@janpio janpio changed the title Custom Type not working Type Aliases not working Nov 8, 2019
@janpio janpio added this to the Preview 17 milestone Nov 8, 2019
@mavilein
Copy link
Contributor

I cannot reproduce this with the following version:

➜  type-alias-test prisma2 version
prisma2@2.0.0-preview015, binary version: 20b6dc13949cccccfef5be07c0be7a3d7c858abe

@mavilein
Copy link
Contributor

Nevermind my comment. I forgot -g in my npm install command 🤦‍♂

@mavilein
Copy link
Contributor

This is a regression of our new approach of diffing datamodels. The new diffing algorithm cannot handle type aliases as of now.

@tomhoule
Copy link
Contributor

tomhoule commented Nov 14, 2019

This should be fixed by prisma/prisma-engines#183. The fix will be in prisma2@alpha soon, and in the next preview version :)

@tomhoule
Copy link
Contributor

I'll close the issue, but feel free to re-open if the problem persists.

@yovanoc
Copy link
Author

yovanoc commented Nov 20, 2019

still happening to me with prisma2@2.0.0-alpha.334, binary version: b72fd0a786adc77ba6c61d0a9637ff0371e433b0

@tomhoule
Copy link
Contributor

Oh :/ Does the custom type appear in the migration when you prisma2 lift save?

@yovanoc
Copy link
Author

yovanoc commented Nov 21, 2019

No, that's why I get this error I guess

@pantharshit00 pantharshit00 reopened this Nov 21, 2019
@pantharshit00
Copy link
Contributor

I can confirm this still occurs in prisma2@2.0.0-alpha.338, binary version: b72fd0a786adc77ba6c61d0a9637ff0371e433b0

@tomhoule
Copy link
Contributor

tomhoule commented Nov 21, 2019

I just double checked and your binary version (b72fd0a786adc77ba6c61d0a9637ff0371e433b0) is older than the fix - the new preview that is coming out soon should have the fix.

@janpio
Copy link
Contributor

janpio commented Nov 25, 2019

@pantharshit00 Can you please double check if this occurs with the new preview017 release?

@janpio janpio assigned pantharshit00 and unassigned tomhoule Nov 25, 2019
@pantharshit00
Copy link
Contributor

Ok, I am not able to reproduce this now with preview-017.

Also, a quick note that you will need to delete the migrations both from the database and locally. They contain the wrong steps.

@nhuesmann
Copy link

Related to this issue, in Preview 17 I have been having a weird issue with custom types. I'm using the same type alias as the issue creator (CUID as an abstraction of String @id @default(cuid())). When I try to perform a migration with prisma2 lift up, I get an error stating that type CUID already exists—it seems like regardless of the changes I make to my schema, the lift up operation is trying to recreate the custom type.

@pantharshit00
Copy link
Contributor

@nhuesmann I can confirm that bug.

I opened a new issue about there here: prisma/migrate#225

@nhuesmann
Copy link

@pantharshit00 great, thank you!

@janpio janpio closed this as completed Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug.
Projects
None yet
Development

No branches or pull requests

7 participants