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
deforestor
deforestor17mo ago
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
dopeinc
dopeinc17mo ago
Not sure I just comment to follow the discussions for further knowledge
Finn
Finn17mo ago
work on a local db on the free tier you can only have one branch
version: '3.9'

services:
db:
image: mysql:8
restart: always
environment:
MYSQL_DATABASE: 'v'
MYSQL_USER: 'v'
MYSQL_PASSWORD: 'v'
MYSQL_ROOT_PASSWORD: 'v'
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- my-db:/var/lib/mysql
# Names our volume
volumes:
my-db:
version: '3.9'

services:
db:
image: mysql:8
restart: always
environment:
MYSQL_DATABASE: 'v'
MYSQL_USER: 'v'
MYSQL_PASSWORD: 'v'
MYSQL_ROOT_PASSWORD: 'v'
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- my-db:/var/lib/mysql
# Names our volume
volumes:
my-db:
for easy use
deforestor
deforestor17mo ago
is that a docker file
Finn
Finn17mo ago
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
deforestor
deforestor17mo ago
yes I meant a compose, sorry Wouldn't it be easier to just run the db without docker? Docker is so heavy
Finn
Finn17mo ago
No Not really What os are you on
deforestor
deforestor17mo ago
Windows ☠️ Docker always take no less than 800mb but to be fair, I never ran docker only with mysql, so
Finn
Finn17mo ago
yeah well install mysql locally lol. endure pain
deforestor
deforestor17mo ago
Haha I'll try both next week. I'll keep you all updated
Ramazan
Ramazan17mo ago
You should be able to adjust how much memory/cpu/storage docker takes up in Settings->Resources->Advanced
deforestor
deforestor17mo ago
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
Want results from more Discord servers?
Add your server