Prisma

P

Prisma

Join the community to ask questions about Prisma and get answers from other members.

Join

migration of existing db to Prisma Postgress

I have an existing database (Postgress) that i would like to move to your Prisma postgress. I would like to backup (old db) and restore (to new db) the db. Is it possible? If yes, how? If no, how can i proceed? Thanks...

Workflow for getting your DB schema into production when using separate databases

Let's say I use separate databases in development and production. How do you push your schema changes into your production DB? Do you just run push or migrate after pulling the latest code from GitHub?...

Prisma setup on VPS

Hey, is it possible to use Prisma when my Next.js app and Postgres DB run on a VPS? How does Prisma connect to the DB in this case?

Relation missing in UncheckedCreateInput

I have this model: ``` model Configuration { appId String @unique...

Environment variables in .env file

I have a .env file ``` DB_HOST="main-rds.some-alphanumericstring.us-west-2.rds.amazonaws.com" DB_USER="admin"...

implement a multi-schema database architecture with Prisma for a B2B SaaS with multiple organization

I'm trying to implement a database architecture with separate schemas for a B2B SaaS application supporting multiple organizations. My desired setup is: - A public schema for user authentication (tokens, sessions) with next-auth and a global organizations table - An organization_template schema with pre-populated tables (roles, permissions, organization_details) - Dynamic creation of new schemas (organization1, organization2, etc.) by cloning the template when a new organization is created...

Prisma5.22.0 + Next.js on Kubernetes → intermittent invocation errors

I’m running a Next.js 14.2.23 app with Prisma ORM 5.22.0 and MongoDB Atlas Serverless. Locally everything works perfectly (I’m using the same Prisma schema pointed at a dedicated/dev cluster). In production (Kubernetes pods) I’m seeing invocation failures sometimes that crash the site. Does anyone know what happen with this?. I'll attach the full pod log and the prisma schema for your reference. 🖥 Environment • Prisma: 5.22.0 • Next.js: 14.2.23...

Prisma Client Credential Error

When i try to fetch from the frontend localhost to the backend prisma prisma.users.findUnique() it cause an error of PrismaClientInitializationError
Solution:
Based on the knowledge sources, I can see that you're encountering a PrismaClientInitializationError when trying to use Prisma Client to fetch data. This is a common issue that can occur for several reasons. The main issue appears to be that you're trying to use Prisma Client directly in the frontend/browser environment, which is not supported. Prisma Client is designed to run in a Node.js environment only and cannot be used directly in browser code. As mentioned in one of the discussions:...
No description

Migration Modified After Applied (but checksums are the same)

I have not ad any issues with my procedures yet, but today when I went to modify my chema and generate a new migration, I got the following ``` Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma...

What is the best way to use UUID v7 in postgres with Prisma?

Also is there a way to add PL/pgSql using Prisma schema?

Monorepo package isn't generating client

It was working for a bit in my monorepo, but i changed nothing and now only in builds it says types cant be found, despite no type errors in development

Remove the "?" in "user?.post"

Hey So this is from Youtube. When we get a user from prisma, it always has to include this "?" How can we make the code better so it wont require us to do that? Just to add if (!user) return XYZ; ?...
No description

Is it possible to subscribe to a creation of a model?

So I have a ticket model, and I want to execute an handler when a new model is being created, the thing is, if i subscribe to a middleware or $extend, I need to specify from where exactly i create that model, but the thing is, there are many options via nested queries to do that, e.g.: ``` model1: { create: { model2: {...

Prisma postgres with static IP - is this supported?

I was looking into using the prisma postgres instead of an Amazon RDS but I need to have a static IP so that I can connect directly to the database for my medussa.js ecommerce module which doesn't use prisma. Does anyone know if this is supported? It seems that the option for a static IP is not avaialble when I go through the steps to set up a prisma postgre database. Accelerate is installed by default without a static IP. If I go to the I have a database section I see this option.
No description

@map("updated_at") still shows updatedAt in prisma studio

Hey, So I did
updatedAt DateTime @updatedAt @map("updated_at")
updatedAt DateTime @updatedAt @map("updated_at")
...

How to update Prisma @unique

Hello, So I started a new NextJS project. I did this: ```ts model Post {...

Prisma not rolling back failed migration during vercel deployment

I've ran into a strange situation where during a deployment to vercel, I run the prisma generate && prisma migrate deploy as a build command. I had a migration fail during this. I went through, rolled it back, fixed it, then pushed the changes back to production. However, I noticed that prisma was not attempting to re-run the migration as it was marked as failed in the _prisma_migrations tables. I had to manually delete the migration entry for the migration to re apply correctly. My question is: Is there a correct process for re running failed migrations in production? I followed the instructions here https://www.prisma.io/docs/orm/prisma-migrate/workflows/patching-and-hotfixing#option-2-manually-complete-migration-and-resolve-as-applied. However it doesnt seem the migration was marked as rolled back. - Does rolled back have to be run in production OR can we run it locally and merge to production?...

Can't update table data from studio and directly

when I try to update the data in the table one particular model is not updated not through the api, not directly in prism studio. On the screen from the console the field phone = 1, The screen from the studio shows that the field is empty...
No description

Supabase Prisma Bad performance can't handle batches of saving on connection pooler.

I am unable to save lots of data at the same time using prisma and supabase. If i try to do bigger batches it always seems to throw these random errors that say the database cannot be reached. Is there some issue with the connection pooler or something I should know about?

Context : Shops and Orders. Autoincremented "number" by shopId

Hello, Let's say I've 2 entities in my schema. Shop and Order. ```ts...