Florian
PPrisma
•Created by Florian on 3/7/2025 in #help-and-questions
Composing relation types
Wow, it's literally impossible to find an answer to this
9 replies
PPrisma
•Created by Florian on 3/21/2025 in #help-and-questions
Workflow for getting your DB schema into production when using separate databases
Thank you
12 replies
PPrisma
•Created by Florian on 3/21/2025 in #help-and-questions
Workflow for getting your DB schema into production when using separate databases
I'm wondering about the workflow. At what step does that happen? Do I just SSH into my server (if I use a VPS) and run
migrate deploy
after pulling from Github?12 replies
PPrisma
•Created by Florian on 3/21/2025 in #help-and-questions
Workflow for getting your DB schema into production when using separate databases
Ok looks like prisma migrate deploy is what I need. Where can I execute this if I don't have a CI/CD integration and run everything manually on a VPS?
Would I simply set up my own build command that runs
prisma migrate deploy && next build
?12 replies
PPrisma
•Created by Florian on 3/21/2025 in #help-and-questions
Workflow for getting your DB schema into production when using separate databases
It would be great if a human can tell me briefly about the most simple approach here.
12 replies
PPrisma
•Created by Florian on 3/21/2025 in #help-and-questions
Workflow for getting your DB schema into production when using separate databases
@Prisma AI Help Can you link me to where you got this information from? It looks incomplete
12 replies
PPrisma
•Created by Florian on 3/7/2025 in #help-and-questions
Composing relation types
@Nurul (Prisma) Any insights on this? I'm preparing a tutorial but I don't know the best practices here.
9 replies
PPrisma
•Created by Florian on 3/7/2025 in #help-and-questions
Composing relation types
Thank you for your answer. My question is not how to generate the type, but best practices for composing them.
In your link, let's say in some places you need
UserWithPosts
, in others UserPersonalData
, and then in some places you need both. How do you handle that?
Do you make a UserWithPostsAndPersonalData
? It seems like this can get out of hand fast.9 replies
PPrisma
•Created by Florian on 2/24/2025 in #help-and-questions
Custom user type vs database type
That just gives me what I already have—a
User
type with an organizations
array. I'm wondering about best practices when the User
I need in my app doesn't fit the Prisma type anymore.8 replies
PPrisma
•Created by Florian on 12/22/2024 in #help-and-questions
Use foreign key as primary key
Thank you for the response!
5 replies
PPrisma
•Created by Florian on 6/29/2024 in #help-and-questions
How do you organize your Prisma.validator schemas?
Right now I have them in lib/types.ts together with other types and interfaces. But I don't know if that's the right place.
3 replies
PPrisma
•Created by Florian on 6/4/2024 in #help-and-questions
Type-safety for dates when returning DB entries as JSON
Because when I fetch a prisma object in a server component, I also get a Date back
11 replies
PPrisma
•Created by Florian on 6/4/2024 in #help-and-questions
Type-safety for dates when returning DB entries as JSON
I think so. But I decided to create a wrapper around fetch that parses timestamp strings back to Date objects:
11 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
Thank you for the hint
18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
A related question: Is it correct to create functions like
getPostInclude
around Prisma.validator
? I do that because I need the authenticated user's ID in the query.18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
I'll try your suggestion and remove the separation between quotes and reposts. It will only get rid of one FK but maybe that's enough.
18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
I'm not a database expert
18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
It already feels impossible to work with in its current form
18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
This will become even more complex if I ever need to add more FKs and query them. I was wondering if my whole DB structure is wrong.
18 replies
PPrisma
•Created by Florian on 6/4/2024 in #help-and-questions
Type-safety for dates when returning DB entries as JSON
I don't want to litter my components with
Jsonify<T>
11 replies