PlanetScale workflow confuses me
So, I'm not even sure if I should be doing this, but I'm working with a few people on a T3 project and we chose to use PlanetScale (free tier) due to the simplicity.
However, as we modify the database, we realize how the workflow doesn't seem to make sense, so we have been wondering if we're doing anything wrong.
As we are using it free for now, we only have one Dev branch, so we all work on it and deploy the changes.
But the thing is, if person A is working on the schema with, let's say, the table
Clients
, and the person B works on a schema without that table, what happens is that when person B does the npx prisma db push
, they'll override the version with the table and everything will crash.
To mitigate that, we do npx prisma db pull
before the push aaand.. that's where the problem is. Since it's the same branch, we can't really "merge" the differences, so when the person A does a pull, it would erase the Clients
table either way.12 Replies
I took upon myself to read all about the workflow on the docs, but I can't seem to find anything that could solve that flow
Not sure I just comment to follow the discussions for further knowledge
work on a local db
on the free tier you can only have one branch
for easy use
is that a docker file
it is not
itsa docker compose file
if you have docker installed
just run
docker-compose up
in the same dir as that file. make sure to name it docker-compose.yml
yes I meant a compose, sorry
Wouldn't it be easier to just run the db without docker?
Docker is so heavy
No
Not really
What os are you on
Windows ☠️
Docker always take no less than 800mb
but to be fair, I never ran docker only with mysql, so
yeah well install mysql locally lol. endure pain
Haha I'll try both next week. I'll keep you all updated
You should be able to adjust how much memory/cpu/storage docker takes up in Settings->Resources->Advanced
So, turns out just running mysql locally is by far the best solution
On Windows, you need to run wsl before you run docker. That already eats up at least 2-4Gb of memory.
Given that a lot of our developers are on company's laptops, that would be a terrible idea.
To use mysql is stupidly easy too, and since we already connect to planetscale, all of us have mysql installed.
I didn't figure all I had to do was start mysql, create the database, use it and do
npx prisma db push