-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Introspection] @@unique name with spaces are not supported #8645
Comments
Hey, names in |
Ok, yes that makes sense. Can you try out the just released |
Hummm I tried, but when I did a db pull it break my schema (but don´t sweat it, the schema is an existant borked one and I myself I´m not a prisma expert) I guess I´ll use my parsed names. Will that be a problem that the constrains on the schema and the one in db are not aligned? will the introspect work properly? I say it because after the db pull the schema shows again:
instead of how I understand you it will work:
Edit: Nevermind, I didnt had the namedConstraints enabled, now it shows properly:
|
Regarding the "breaking", I guess is related to #1368, but I don´t know what options I have |
generator client {
provider = "prisma-client-js"
previewFeatures = ["nApi", "filterJson", "namedConstraints"]
} "prisma": "2.29.1", re-introspect will remove name alias defined on model
after introspect, it become
|
Thanks for the report @xiaoyu-tamu, I split this off into its own issue: #8865 |
This should be fixed in |
Bug description
Using introspection for creating the schema for a ugly database I found that if the index had non suported characters, they were used directly on the name, breaking the client.
The generated code:
@@index([SetType], name: "Master Index 5-2")
The workaround (that I don´t know if it will have any problems)
@@index([SetType], name: "Master_Index_5_2")
How to reproduce
Expected behavior
No response
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: