Automatically apply migrations on serverless deploy
I've got a basic Todo app using Turso DB and Nuxt: https://github.com/Amar-Gill/nuxt-todo
I'm wondering if there is a way to automatically apply migrations when I deploy to Vercel? The build command is
npm run build
.
Right now, I open a shell into my Turso DB and paste the migration scripts.
I might have to wait for a migration runner in drizzle-kit to ship: https://orm.drizzle.team/kit-docs/faq#how-do-i-apply-migrations-generated-by-drizzle-kitGitHub
GitHub - Amar-Gill/nuxt-todo
Contribute to Amar-Gill/nuxt-todo development by creating an account on GitHub.
FAQ & Troubleshooting – DrizzleORM
Drizzle ORM | %s
3 Replies
part of the challenge of using the
migrate
function is that the _journal.json
file is not preserved in a nuxt build outputhere's an example using nitro plugin system: https://github.com/Atinux/nuxt-todos-edge/blob/main/server/plugins/migrations.ts
but again only for dev -- on prod the
_journal.json
file is not availableGitHub
nuxt-todos-edge/server/plugins/migrations.ts at main · Atinux/nuxt-...
A todos application with user authentication, SSR and SQLite, working on the edge. - Atinux/nuxt-todos-edge
can also use nuxt build time hooks: