Markigno
PPrisma
•Created by Markigno on 7/2/2024 in #help-and-questions
Mongodb schema update - how to
I looked at the documentation to understand the right way to update the schema for MongoDB.
I'm doing
prisma generate
prima db push
is it the correct way? not able to find documentation
5 replies
PPrisma
•Created by Markigno on 6/26/2024 in #help-and-questions
mongodb not updating schema
I'm using Firebase functions with Mongodb (atlas)
Let's consider I have a schema like that
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
relationMode = "prisma"
}
model User {
id String @id @map("_id")
displayName String? @default("")
email String? @unique}
and I want to update the User model by adding "Mobile".
so the new schema is
model User {
id String @id @map("_id")
displayName String? @default("")
email String? @unique
mobile String? @default("") }
once updated the schema file I proceed with
prisma generate
prisma db push
after the db push (even if I changed the schema) I received the message
The database is already in sync with the Prisma schema.
✔ Generated Prisma Client (v5.15.1) to .\node_modules\@prisma\client in 1.21s
I deployed the new software version but it is not taking the change (I tried many times updating the software to be sure the deployment process saw software change).
I'm forced to delete the functions from Firebase and then, after deployment, it takes the new version of the schema1 replies