I don't understand, shouldn't you have gotten an error when merging your deploy request if there are existing rows without a value set for "updatedAt"? I might be missing the concept of Planetscale, but it would be interesting to go further into depth about how you'd write data migrations.
Excellent video! 🙌 Glad you touched on the environments/branches handling towards the end, which I haven't seen discussed much. I've been doing almost the same, but instead of having both a preview _and_ dev branch, I just have a preview one that I use for both the preview deployments and local development. Thanks again! 🍻
Hey Agustin, I have been figuring out the same thing. Is this how It's done according to what you mentioned. Create two db's in planetScale one for production , and staging in vercel two env variables are created - one with production checked - another env variable with preview and local checked (this is where you work locally and in your staging env) Please correct If I'm wrong
Wish there were still a way to run non-automatic migrations. I've been using the automatic with db push for about 1.5 years but now I need to migrate data from one table to another, and have to add in my own code-based migrations, duplicating what we have with prisma migrations.
i have created a database in digital ocean managed database service now when i use prisma to connect with it locally it works fine. but when i dovkerized the node js app then prisma saying not able to reach the database host p1001 error, db connection error. any idea how to fix it? i tried without prisma just mysql2 and it works in dockerized app.
If I understand correctly, with this workflow we are completely foregoing the migration files that prisma generates for the planetscale diff/merging functionality. Is that correct? Is there ever an advantage to run prisma migrate incrementally, say, every minor version, to keep a record? I guess not, as if we were to move away from planetscale we would start fresh with the schema as is.
That’s correct. You get a full audit log on PlanetScale. The reason there’s no advantage in running Migrate incrementally is that it can give you a false sense of what the migrations looked like in practice. Either way, you will have the full record of your Prisma schema in Git.
Hi, I am using Prisma with for my project. Currently I am using local database. But how do i make the changes available in my production database (Digital Ocean) without data loss? I do not find any appropriate documentation. Please Help.
@Daniel Norman given that you get only one dev branch (at least in the free version) how bad of an idea would be to develop against a dockerized mysql locally and only later use the PlanetScale dev branch as a staging environment to test changes?
any updates? I have the same doubt. I think each programmer could create it's own developtment db and ask the project manager to run the migrations from develop to main
Thanks for this awesome video! I have a question tho: why would you want to deploy your PlanetScale DB to Vercel? Isn't PlanetScale already a Cloud DB? What does Vercel provides that PlanetScale doesn't? Thank you in advance!!
The DB isn't being deployed to Vercel, rather the app that's utilising the DB is (likely Next JS given Vercel). Then on vercel, the necessary env variables are set so that the deployed production app can connect to the preview/main planetscale DB's.
what happens when you run a "pscale deploy" command envisioning from a brach to production main, do you copy just the schema or schema with data from the branched db
This is probably one of the most helpful and insightful videos from Prisma. Love it.
Thanks Devin 🙌
Daniel is a great presenter, always straight to the point! just brilliant!
This was super helpful! What a great breakdown of the branching flow from start to finish!
Holy smokes. What a video. Thank you.
Glad you liked it!
I don't understand, shouldn't you have gotten an error when merging your deploy request if there are existing rows without a value set for "updatedAt"? I might be missing the concept of Planetscale, but it would be interesting to go further into depth about how you'd write data migrations.
Excellent video! 🙌 Glad you touched on the environments/branches handling towards the end, which I haven't seen discussed much. I've been doing almost the same, but instead of having both a preview _and_ dev branch, I just have a preview one that I use for both the preview deployments and local development. Thanks again! 🍻
Thanks Agustin 🙌
Hey Agustin, I have been figuring out the same thing.
Is this how It's done according to what you mentioned.
Create two db's in planetScale one for production , and staging
in vercel two env variables are created
- one with production checked
- another env variable with preview and local checked (this is where you work locally and in your staging env)
Please correct If I'm wrong
Fantastic video! ✨
What an excellent video! Thank you!
Wish there were still a way to run non-automatic migrations. I've been using the automatic with db push for about 1.5 years but now I need to migrate data from one table to another, and have to add in my own code-based migrations, duplicating what we have with prisma migrations.
Really good content
Love these
i have created a database in digital ocean managed database service
now when i use prisma to connect with it locally it works fine.
but when i dovkerized the node js app then prisma saying not able to reach the database host p1001 error, db connection error.
any idea how to fix it?
i tried without prisma just mysql2 and it works in dockerized app.
If I understand correctly, with this workflow we are completely foregoing the migration files that prisma generates for the planetscale diff/merging functionality. Is that correct? Is there ever an advantage to run prisma migrate incrementally, say, every minor version, to keep a record? I guess not, as if we were to move away from planetscale we would start fresh with the schema as is.
That’s correct. You get a full audit log on PlanetScale.
The reason there’s no advantage in running Migrate incrementally is that it can give you a false sense of what the migrations looked like in practice.
Either way, you will have the full record of your Prisma schema in Git.
Hi, I am using Prisma with for my project. Currently I am using local database. But how do i make the changes available in my production database (Digital Ocean) without data loss? I do not find any appropriate documentation. Please Help.
what about many to many implicit relationship with planetscale
@Daniel Norman given that you get only one dev branch (at least in the free version) how bad of an idea would be to develop against a dockerized mysql locally and only later use the PlanetScale dev branch as a staging environment to test changes?
any updates? I have the same doubt. I think each programmer could create it's own developtment db and ask the project manager to run the migrations from develop to main
Hey there 👋 can you raise your issue as a GitHub Discussion, that way our Support team can take a look at it 🙌 github.com/prisma/prisma/discussions
Thanks for this awesome video! I have a question tho: why would you want to deploy your PlanetScale DB to Vercel? Isn't PlanetScale already a Cloud DB? What does Vercel provides that PlanetScale doesn't?
Thank you in advance!!
The DB isn't being deployed to Vercel, rather the app that's utilising the DB is (likely Next JS given Vercel). Then on vercel, the necessary env variables are set so that the deployed production app can connect to the preview/main planetscale DB's.
How would you handle implicit many-to-many relationships?
Hey Amos,
You can still define implicit m:n relations.
Have you had any problems with those?
@@daniel2color Since implicit many to many relationships are handled by Prisma, I was wondering how to add the indices?
@@amosdottv Currently the way to do that for implicit many-to-many relations would be to directly define the index in the planetscale shell.
@@daniel2color would it be better to go for explicit and @@index both ids?
what happens when you run a "pscale deploy" command envisioning from a brach to production main, do you copy just the schema or schema with data from the branched db
Data is never copied over when you create a deploy request or when you create a new database branch.
Thanks!
I am stuck on many to many relation in planetscale
no more shadow branch?
Since Prisma Migrate is not used, there's no need for a shadow database/branch.
Can’t we have the code ?
github.com/2color/prisma-planetscale
"Great, it looks like it suc-seeded" (I see what you did there lol)
You know it!
unfornutaly planet scale doesnt let free users to make more then one branch