Niels
PPrisma
•Created by Niels on 10/31/2024 in #help-and-questions
Way to run migrations & seeding using the PrismaClient
Yeah, got it. Well, using exec still means downloading the cli at runtime again. No probs, thanks.
7 replies
PPrisma
•Created by Niels on 10/31/2024 in #help-and-questions
Way to run migrations & seeding using the PrismaClient
Yeah, exactly. I wanted to speed up the pipeline, so I included my source code in the container. However, the container grew 100 times larger in size and took 2 times longer to build (over 10 minutes).
Just to give an idea of why I would need it: Fortunately, with seeding, I can now manually call my seed script (by including the seed.ts file in my instrumentations for NextJS depending on an env var) to achieve the same result.
However, there doesn’t seem to be a way to do this for migrations which has to be done in all environments and forces me to include pnpm and prisma at runtime. If there was an option to run migrations with the client, since the required binaries and files are already compiled and included, it would be much more efficient I’d say.
Technically, would it be possible to code an extension like this myself or is that not easy to achieve without editing the prisma source?
Looks like I'm not the only one: https://github.com/prisma/prisma/issues/4703
7 replies
PPrisma
•Created by Niels on 8/22/2024 in #help-and-questions
Prisma keeps generating same migrations
Solution: After using
prisma db pull
I saw that the database returned these formulas without spaces, so I had to change those values in the prisma schema and now it seems to be okay 🙂4 replies