Database Migrations

Hi all. With the introduction of Git and the doors it opens for CI and deployment options, I thought it would be worth sharing a database migration tool I came across which seems quite neat.

Database migrations are a way of programmatically defining your database schema changes, so you and other developers can easily ensure that the database schema you’re using is consistent. It’s essentially like version control for your database schema and is very popular in most MVC frameworks that utilise relational databases.

This tool also has some other advantages such as database seeding; prepopulating the database with data.

Anyways, thought I’d share as I’m sure more people will start to move away from the cPanel hosting providers of yester-year and move towards modern CI and auto-deployment options.

https://phinx.org/

All the best.

1 Like

Thanks for sharing, Niall!
Maybe you can further share your experience on modern deployment and hosting models?

If I plan to have an app built on Wappler, with MySQL, integrations with external APIs, what is the best way to deploy it?

Ususally I would take DigitalOcean droplet with Ubuntu, install LAMP (Apache, MySQL, php), but I understand that it’s a old-school and very limited approach. Having now docker, kubernets, sql-as-a-service it’s hard to sort everything out and choose best model to go.

No problem @alexey . Personally, I don’t like devops at all and spend most of my work-day developing enterprise JavaScript applications.

But for PHP application deployments, I’d certainly look into tools like Forge for server setups and Envoyer if you want additional deployment power but still want control over your own servers etc.

I’ve heard great things about Render and I know they’ve some great additional features on their roadmap (MongoDB support, Cloud Storage etc.) I see that they have a Laravel deployment example, would be cool if the Wappler team worked with a cool company like this to integrate deployments into Wappler (or some other trusted service).
Or at least work with them to produce some documentation.

FortRabbit is another company I used many years ago, might be worth checking out.

I still have a lot of research to do in this space myself as I haven’t been near PHP in a very long time. Ideally I want something that will deploy when I push to my master branch in Github, provide database hosting and auto-scaling, run my database migrations on deploy to update the DB schema, cloud storage would be nice (just to have everything in one place; less invoices to deal with). Also, at some point I’m sure I will want to utilise cron jobs and job queues - if a service can make these operations easier, then that would be great.