I love youuuuuuuuuu❤❤❤ Thank youuuuu Especially for those updating columns. But why does it clear out when I update production? I already have a database in production and I just want to add one more to the enum on the orders table. When I run migrate, how do I avoid data loss?
When updating a column in prisma, prisma for some reason likes to drop that column and create a new one. What I do is run `prisma migrate dev --create-only` for all my migrations. Then I go into migration file and review it. If necessary, I update SQL code from drop and create to rename (so I basically try to change a destructive migration to a non-destructive one). Then I run `prisma migrate dev` again to actually apply my migration. In production, however, you need to run `prisma migrate deploy` instead of `prisma migrate dev`
Prisma down migrations are a pain :-( www.prisma.io/docs/orm/prisma-migrate/workflows/generating-down-migrations When developing, if I make a mistake, I just revert manually by running reverse commands on sql and removing migration files and then updating client. In production you can just create a new migration that makes changes to fix the error. Migrations in Squelize are much better. You technically can use Prisma as your ORM and Sequelize only for migrations.
I don't think I have a specific repository for Prisma migrations. You can check out this one: github.com/alexrusin/nextjs-prisma It has Prisma migrations.
I watched many prisma tutorials, but always ended up confused. After them, I ended up just blindly using these terminal commands hoping that i dont mistakenly use wrong one. Great video, thank you very much.
Your video is well done. On a side note, and I mean this as a compliment: your voice reminds me of Javier Bardem's. HIs accent is awesome.
Thank you! I take it as a compliment. Javier Bardem is a great actor.
I love youuuuuuuuuu❤❤❤
Thank youuuuu
Especially for those updating columns.
But why does it clear out when I update production?
I already have a database in production and I just want to add one more to the enum on the orders table. When I run migrate, how do I avoid data loss?
yes same problem @alex russin
When updating a column in prisma, prisma for some reason likes to drop that column and create a new one.
What I do is run `prisma migrate dev --create-only` for all my migrations. Then I go into migration file and review it. If necessary, I update SQL code from drop and create to rename (so I basically try to change a destructive migration to a non-destructive one). Then I run `prisma migrate dev` again to actually apply my migration.
In production, however, you need to run `prisma migrate deploy` instead of `prisma migrate dev`
dude, any comments on down migrations?? that's the only thing I came for
Prisma down migrations are a pain :-( www.prisma.io/docs/orm/prisma-migrate/workflows/generating-down-migrations
When developing, if I make a mistake, I just revert manually by running reverse commands on sql and removing migration files and then updating client. In production you can just create a new migration that makes changes to fix the error. Migrations in Squelize are much better. You technically can use Prisma as your ORM and Sequelize only for migrations.
Great content! Just curious, what is your vs code theme?
Thank you. I do believe it is night owl black.
Great Content, The last Prisma Video helped me a lot to setup Prisma.
Glad it helped
where is the repository?
I don't think I have a specific repository for Prisma migrations. You can check out this one: github.com/alexrusin/nextjs-prisma It has migrations.
I don't think I have a specific repository for Prisma migrations. You can check out this one: github.com/alexrusin/nextjs-prisma It has Prisma migrations.
I watched many prisma tutorials, but always ended up confused. After them, I ended up just blindly using these terminal commands hoping that i dont mistakenly use wrong one.
Great video, thank you very much.
I'm glad it helped.