-
Notifications
You must be signed in to change notification settings - Fork 1k
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
DRAFT: Support compound primary key ids in SDL and Scaffold generators #6051
DRAFT: Support compound primary key ids in SDL and Scaffold generators #6051
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 141210c. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 14 targets
Sent with 💌 from NxCloud. |
✅ Deploy Preview for redwoodjs-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Due to the extent of the template rework, the team decided to hold off on this issue until the template engine is updated. Moved to Backlog. |
Cross-linking this one to #8556 |
Closing in favor of the linked PR |
First step to address #5689
As @joconor notes:
Prisma model:
yarn rw prisma migrate dev
runs successfullyyarn rw g scaffold xpolicy
results in error:Shouldn't this be as simple as using the Prisma generated composite ID field for the SDL? See https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#id-1
This PR instead of iterastingthe fields to check if is an id, uses the the Model's
primaryKey
property instead.https://github.com/prisma/prisma/blob/da4538d42aca8d7ab2777a979c0e8293f78b22b9/packages/generator-helper/src/dmmf.ts#L61
And since
PrimaryKey
also has aname
However, this just addresses the SDL.
Tasks:
id
in template but a way to get the name of the id