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

add line highlighting in custom model examples #5097

Closed
wants to merge 1 commit into from

Conversation

jharrell
Copy link
Member

Fixes #3815

@vercel
Copy link

vercel bot commented Jul 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2023 8:10pm

@github-actions
Copy link
Contributor

This PR changes the following pages (Vercel Preview Deploy links):

Changed Vercel links

(Note that links will only be valid after Vercel preview deploy succeeded)

@github-actions
Copy link
Contributor

This PR probably requires the following redirects to be added to vercel.json:

  • This PR does not change any pages in a way that would require a redirect.

@@ -173,7 +173,7 @@ You can "rename" fields and models that are used in Prisma Client by mapping the

_After_ you introspected your database with `prisma db pull`, you can manually adjust the resulting Prisma schema as follows:

```prisma
```prisma highlight=1-2;edit|4;edit|5-6;add|9;edit|12-13;edit|16;add|19-20;edit|25-26;edit|27-28;add|31-32;edit|35;edit|36-27;add|40-41;edit|44-45;edit|46-47;add
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code snippet is too chaotic, and hard to follow the changes. I would suggest either:

  • Using tabs — one tab containing the updates and the other one for the final schema (no highlights)
  • A combo of a comment (right above the relation field) and highlight for the section with the @@map("") attribute function
  • Using a simpler (our standard) schema with the Post & User models

https://docs-git-jharrell-issue3815-prisma.vercel.app/concepts/components/prisma-client/working-with-prismaclient/use-custom-model-and-field-names#using-map-and-map-to-rename-fields-and-models-in-the-prisma-client-api

CleanShot 2023-07-25 at 09 30 21@2x

@nikolasburk
Copy link
Member

I'm not sure this PR is an improvement, it's very noisy indeed. At this point, I'd probably prefer not using any highlights and keep the code snippet plain.

If you still feel strongly about line highlighting here, let's discuss on Slack how to best go about this 🙏

@ruheni ruheni deleted the jharrell/issue3815 branch November 16, 2023 16:47
@ruheni ruheni restored the jharrell/issue3815 branch November 16, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On custom model and field names page, consider adding line highlighting in the code examples
3 participants