Hi everyone, I notice when I change a certain part...
# orm-help
r
Hi everyone, I notice when I change a certain part of my schema, prisma goes ahead and wipes all of my schema. I have two tables, user and options. When I changed things in 'options', then did prisma push, It asked to clear everything since there were contradictions in the schema. I assumed clearing everything meant just the 'options' table, but I also noticed my 'users' table was gone as well. It's not a big deal since this isn't production, but what could be done to prevent this?
1
r
Hi Rob 👋 Did you use
npx prisma db push
command or did you run the
migration
command?
❤️ 1
r
npx prisma db push
r
npx prisma db push
command usually results in data loss and is only recommended if you want to quickly prototype and iterate locally, for production workflow,
npx prisma migrate
is recommended for keeping your database schema in sync with your Prisma Schema as it evolves and maintianing existing data in your database. See the docs on Prisma Migrate and DB Push.
r
Thank you
I am trying to learn as much as prisma as soon as possible. I do find it a little complicated, but that may be just because I was comfortable with Sequelize due to it resembling MongoDB closely.
r
You are welcome and if you have any other queries, always ask on the #general channel.
❤️ 1