`prisma db push` works for MongoDB, but is there a...
# orm-help
b
prisma db push
works for MongoDB, but is there a way to prevent it from making breaking changes? (e.g. deleting fields, changing the type of fields, etc) Given that Prisma MIgrate doesn't currently support MongoDB, I'm trying to figure out a good way of replicating the way that migrations work for relational DBs
1
n
Hey Ben 👋
npx prisma db push
is supposed to be used for quick prototyping. I don’t think there’s a way to prevent breaking changes, though the command will explicitly ask in case the database needs to be reset. This guide might be useful, it describes cases where using
db push
would be recommended.
b
Hey @Nurul, thanks for the info 🙂 In that case, what's the best way to create indexes, migrate data, etc for non-dev environments please? (specifically for MongoDB; we're using MongoDB Atlas if that makes any difference)
n
You could use this package for now: https://www.npmjs.com/package/mongo-migrate-ts This is the GitHub Issue: #7305 were we are tracking adding support for migrations for MongoDB
👍 1