Closed zacwebb closed 3 weeks ago
Thank you for your feedback @zacwebb
I agree with you as we need to find a nice way to run migrations, so far having it as a server plugin is nice for development but I believe we should be able to run the migrations with a command line too.
Would having nuxthub migrate
works for you?
nuxthub migrate # local migration (can replace the server plugin)
nuxthub migrate --remote # remote migration (based on current branch to know prod/preview)
nuxthub migrate --remote production # migrate production database
Yeah that would be great! Coming from the Laravel world being able to run migrations in local and prod (via CI/CD) with just a single command is a really great DX.
Funnily enough just saw this release from Drizzle today https://github.com/drizzle-team/drizzle-kit-mirror/releases/tag/v0.21.3 👀
any updates? migrations to prod or preview is a pain rn my app is non-critical in the development phase but I need to delete and replace the db everytime I have conflicting changes in the migration which is a pain. Will there be plans for like a db push in drizzle to override?
Would having
nuxthub migrate
works for you?nuxthub migrate # local migration (can replace the server plugin) nuxthub migrate --remote # remote migration (based on current branch to know prod/preview) nuxthub migrate --remote production # migrate production database
That would solve lots of issues IMO 👍🏻
Indeed, it would be nuxthub database migrate
though :)
Database migrations is out!
I've had a read of #46, but I'm wondering if there's plans for a built-in approach to running migrations?
As much as running the dev server in remote mode works, I'd be much more confident in shipping if there was a proper way to do it. Currently most of my production services run on and I'm quite fond of their pre-deployment command to run migrations – maybe something similar could work for NuxtHub?
Currently I've got one project deploying with nuxthub to CF using a Github action to handle the deploy/migration process:
But this requires me having a separate wrangler.toml with the production database details in it to run the migrations using wrangler:
Any ideas on how to improve this setup to avoid having the separate wrangler file, and is the idea of something like the pre-deploy command something that would be considered for NuxtHub?