Best practices for data migrations/historical data changes?

I'm using t3 + Vercel + Planetscale and would like to add a field like user.apiToken as an example. A new field that every user should have pre-generated and ready to use

So I need to generate tokens for my existing users.

  • Prisma migrations are SQL-only by default (right?) so that doesn't play nice
  • Planetscale doesn't really like Prisma migrations anyway
Should I just be making a scripts/ directory and figuring out to run something like that against Vercel? Maybe a temporary API endpoint? What's a good best practice for one-off data migrations like this?
Was this page helpful?