Phinx - Schema Migration Tools

Schema Migration (DB migration) using Phinx

Phinx - Schema Migration Tools

Managing database is a part of software development process. Each team have their own way to manage their schema/database. Often times I see people manage their database using sql files. As application grows, managing database changes using sql files is inconvenient. If you miss or forget to apply one or more alter script on production this will be a disaster. You really need to use other way, using sql files to manage your database is waiting an accident to happens.

How to get your database under control? How do you manage which database is at what version that match your current codebase? Well, the answer is by writing migrations. Migrations is highly effective to manage incremental database changes in a schema using code. You can use whatever migration tools that suits you and your team. In this post, i want to share how my team and i do database versioning using tool called Phinx.

Why Phinx?

What’s great about phinx are;

  • Written in PHP (since my team all familiar with it)
  • Supports several most popular DBMSes
  • Independent
  • etc

Although since June 2017 Phinx is a part of CakePHP, you can still use it independently.

Check out my take on this matter on my presentation below.

Conclusion

Start using migration tool to manage your schema/database.

OK, see you guys on another post.. soon.. (hopefully).

Ciao!

Leave a Reply

Your email address will not be published. Required fields are marked *