question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Split the prisma cli in multiple packages

See original GitHub issue

Problem

A lot of my clients are running prisma migrations at runtime when the service boots. While I don’t recommend this approach, this is what they do. This leads to an annoying problem where they either include all dev dependencies in their production Docker image or they add the full prisma cli in the production dependencies. This bloats the image unnecessarily.

Suggested solution

It would be nice if we could just add a smaller @prisma/migrate package in the production dependencies that would only contain the commands necessary to perform the migrations.

Alternatives

Continue doing what they are doing or have another step in the CICD to do the migration (should be preferred but hard to make happen sometimes)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Syttencommented, Dec 15, 2021

Depends on the company:

  • Organizational -> getting approvals to do the changes, infrastructure team needs to change the process, etc
  • Technical -> database is in a private VPC and it would thus require a second image to do the migration
  • Security -> Not all cicd pipeline have an approval process built-in to execute the migration
  • They do production deployments manually and thus they dont have CD
1reaction
jcpagecommented, Jan 18, 2022

Ok - I think my issue is highly related to this improvement (the goal is the same - to have a small amount of code specific to migrations) and I think the download code is technically behaving as designed - but I’ll open a new one that is more specific.

(filed as #11234 )

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prisma CLI Command Reference
This page gives an overview of all available Prisma CLI commands, explains their options and shows numerous usage examples.
Read more >
Generating the client (Concepts) - Prisma
This page explains how to generate Prisma Client. It also provides additional context on the generated client, typical workflows and Node.js configuration.
Read more >
Prisma schema (Reference)
Whenever a prisma command is invoked, the CLI typically reads some ... A generator (Prisma Client); A data model definition with two models...
Read more >
Relation queries (Concepts) - Prisma
A key feature of Prisma Client is the ability to query relations between two or more models. Relation queries include: Nested reads (sometimes...
Read more >
Prisma CLI Installation (Reference)
The Prisma CLI is available as an npm package. ... Warning: If you have several Prisma projects on your machine, a global installation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found