traches
TTCTheo's Typesafe Cult
•Created by traches on 10/20/2023 in #questions
Drizzle & Planetscale data migration workflow
Tagged as "databases" because there's no Drizzle tag.
I'm running T3 + Drizzle + Planetscale. I've been using a planetscale branch ->
db:push
-> deploy request workflow for managing schema changes, which I like a lot. This doesn't handle modifications to existing data however, so I still need a way to run a set of SQL commands against an existing database exactly once.
Drizzle-kit claims to be able to do this with drizzle-kit generate:mysql --custom
, but this doesn't generate an empty SQL file for me like the docs say it will. On first run it creates all the tables in my schema, and subsequently it says there aren't any changes to make and it does nothing. (In other words it seems to ignore the --custom
flag).
Do I have to implement this myself? Make a migrations table, track which migrations have been run, call the ones that haven't? Is there some other way? I can't be the only one with this issue.7 replies