With Planetscale (or others), what's the correct way to retroactively edit a prod database?
Noob question I don't know how to Google correctly.
Let's say I forgot to add a username field to the users portion of my database.
In Planetscale, you can't push a development branch to production without a default value if the field can't be null, for example.
Or, let's say I didn't have 'creation date' in one table, but now I need it and want to import it over.
I find it hard to wrap my head around how to do this correctly.
Any advice (or guides on YouTube or text) would be very helpful!
Thanks 👍
3 Replies
Theo - t3․gg
YouTube
We Don't Need Migrations Anymore
My database takes are spicy but it was overdue. Migration files are bad practice. We deserve better.
#t3stack #fullstack #database
Talk that inspired this: https://archive.fosdem.org/2022/schedule/event/relational_model_dev/?utm_source=pocket_reader
ALL MY VIDEOS ARE POSTED EARLY ON PATREON https://www.patreon.com/t3dotgg
Everything else (Twi...
you could make the field optional then you wont have that poroblem
when adding new columns, if you want the column to be not null, you can use the default directive and on a later migration you can remove it if it annoys you with anything, though I wouldn't see the point.