I am trying to connect/migrate my Prisma schema into my MongoDB cluster. I have my MongoDB connection string, and have an instance of the Prisma client.
Here is my prisma/schema.prisma file:
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
createdAt DateTime @default(now())
username String
password String
email String @unique
}
So, in order to migrate, I used the command "npx prisma migrate dev" and got this error:
Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma Datasource "db": MongoDB database "DATABASE" at "HOST"
Error: The "mongodb" provider is not supported with this command. For more info see https://www.prisma.io/docs/concepts/database-connectors/mongodb 0: schema_core::state::DevDiagnostic at schema-engine/core/src/state.rs:266
I went to that link in the Prisma docs, and and saw this: "Currently, there are no plans to add support for Prisma Migrate as MongoDB projects do not rely on internal schemas where changes need to be managed with an extra tool. Management of @unique indexes is realized through db push."
So, I tried the command "npx db push", and got this error: npm ERR! could not determine executable to run
So, how do I fix it and do a correct migration? And if there are differences between development and production environment migrations, what are those differences?
Thanks