Prisma

P

Prisma

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

Join

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...

Optimizing MongoDB Query for Unique User Count

How can I optimize my MongoDB query to count unique userIds for a specific action type (LOGIN_CLIENT) within a date range (startOfDayUTC to endOfDayUTC) without consuming too much time or resources? ```ts const monthlyUniqueIDs = (await this.prismaService.history.findMany({ where: {...

WILDCARD, New index type for MongoDB

I want to thank the Prisma team for the quick response to my previous request, especially @Nurul. My current question is: how do I add a new type of indexes for MongoDB, what is the flow for implementing this feature, where should I start, and what tests should I add? My question: https://github.com/prisma/prisma/discussions/26165#discussioncomment-12220940 Docs: https://www.mongodb.com/docs/manual/core/indexes/index-types/index-wildcard/...

real time fetching when data changes

I am using prisma postgresql and I need to add a trigger when something changes on the database I can fetch the data without prisma pulse.

Spend Limit

Hello there! I am not sure why but I can't set a monthly spend limit. Can you help me understand why? As you see in the screenshot, I am on the starter plan. Thanks!
No description

Error validating datasource `db`: the URL must contain a valid API key

My connection string: prisma://postgresql://username:[email protected]/stitchCounter?sslmode=require

Null constraint violation on the fields: (`ownerId`)

With the following schema when I try and create a new Project I get then Null constraint violation for field ownerId which doesn't exist anymore ```js model Project { id String @id @unique @default(cuid(2)) name String...

unique constraint failed on where column? how is possible?

In production, once in a while our customer gets an error on the backend """Invalid prisma.trainerProposalXrefDbo.update() invocation: Unique constraint failed on the fields: (id)""" on the following code """ `const promise1 = txClient.trainerProposalXrefDbo.update({...

NestJS + prisma optimize

I'm trying to add prisma optimize to project with nest.js framework. As I can see in logs - it initializes, but there is no data recorded ``` import { FactoryProvider,...

n:m relations between tables and view

I have a view "DepartmentInfo" as well as model "User". The user can be part of many departments and a department can have many users -- we are talking about n:m relation. ...

Type of extended Prisma client is too long (TS7056)

Hello, I am currently trying to install the following extension in my Prisma environment. https://github.com/yxx4c/prisma-extension-redis ``` // It is not possible for Typescript to create the type for extendedClient...

AppleMac

I am new to Prisma. Can it be used on an AppleMac?

Migrate prisma lost data

Hello there, I have an issue while I try to migrate something. While preforming that command : npx prisma migrate dev --create-only --name rename-column a SQL file is created so I modify it by : ALTER TABLE "Token" RENAME COLUMN "token" TO "tokens"; and I still lost my data inside that column. Is this even possible to rename a column without lost all datas ??...

No matter what command I run, I keep getting the error “maximum call stack size exceeded.”

Hello, I’m encountering an issue where running commands like npx prisma generate and npx prisma migrate reset --force results in the error “maximum call stack size exceeded.” I came across guidance on X (Twitter) and decided to join Discord for further assistance. Originally, I was working on a Mac Studio, but after moving my development environment to a MacBook, this error has been consistently occurring. Docker is running properly....
No description

Unexpected error login into prisma console

Hello guys, I am no longer able to login to the prisma console platform. I keep getting this error, "unexpected server error" as seen in the attached image. Please, how do I fix this?
No description

Prisma Migrate dev --create-only resets my DB!

```jack@dance-party Wanyama % npx prisma migrate dev --name "add_other_to_win_state" --create-only Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma Datasource "db": MySQL database "wanyama" at "eu01.jpy.gg:3307"...