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

[Re-Introspection] Keep @map and @@map #2545

Closed
janpio opened this issue May 25, 2020 · 0 comments · Fixed by prisma/prisma-engines#809
Closed

[Re-Introspection] Keep @map and @@map #2545

janpio opened this issue May 25, 2020 · 0 comments · Fixed by prisma/prisma-engines#809
Assignees
Labels
kind/feature A request for a new feature. tech/engines Issue for tech Engines. topic: previewFeatures Issue touches on an preview feature flag topic: re-introspection
Milestone

Comments

@janpio
Copy link
Member

janpio commented May 25, 2020

Problem

If a user decides that they prefer a different name for a model or field, they can use @map or @@map to give the model or field a different name for Prisma Client, that will be used in the generated API.

There are multiple default values that are not persisted in the database, most important uuid() and cuid(). Re-Introspection thus looses them, making it necessary for users to be on the lookout for them and apply them manually again.

Suggested solution

Use the old schema as input to figure out if a field or model was renamed before and use the same @map or @@map again.

@janpio janpio added kind/feature A request for a new feature. topic: re-introspection tech/engines Issue for tech Engines. labels May 25, 2020
@janpio janpio added this to the 2.1.0 milestone Jun 10, 2020
@janpio janpio mentioned this issue Jun 24, 2020
7 tasks
@janpio janpio added the topic: previewFeatures Issue touches on an preview feature flag label Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for a new feature. tech/engines Issue for tech Engines. topic: previewFeatures Issue touches on an preview feature flag topic: re-introspection
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants